PageSourceSearch

https://alreadyalive.com/assets/main-DkdVaf3P.js

js alreadyalive.com collected 2026-10-05 02:23:29 UTC 882,850 bytes, 63 lines download raw bytes

vendor: 5,735 bytes, line 1
1var Ww=e=>{throw TypeError(e)};var Xw=(e,t,s)=>t.has(e)||Ww("Cannot "+s);var on=(e,t,s)=>(Xw(e,t,"read from private field"),s?s.call(e):t.get(e)),Zw=(e,t,s)=>t.has(e)?Ww("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),bm=(e,t,s,r)=>(Xw(e,t,"write to private field"),r?r.call(e,s):t.set(e,s),s);function Fk(e,t){for(var s=0;s<t.length;s++){const r=t[s];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const c=Object.getOwnPropertyDescriptor(r,o);c&&Object.defineProperty(e,o,c.get?c:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function Vk(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var wm={exports:{}},hl={};var Jw;function Bk(){if(Jw)return hl;Jw=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function s(r,o,c){var u=null;if(c!==void 0&&(u=""+c),o.key!==void 0&&(u=""+o.key),"key"in o){c={};for(var f in o)f!=="key"&&(c[f]=o[f])}else c=o;return o=c.ref,{$$typeof:e,type:r,key:u,ref:o!==void 0?o:null,props:c}}return hl.Fragment=t,hl.jsx=s,hl.jsxs=s,hl}var e0;function $k(){return e0||(e0=1,wm.exports=Bk()),wm.exports}var a=$k(),jm={exports:{}},ml={},Sm={exports:{}},Nm={};var t0;function qk(){return t0||(t0=1,(function(e){function t(U,L){var z=U.length;U.push(L);e:for(;0<z;){var W=z-1>>>1,M=U[W];if(0<o(M,L))U[W]=L,U[z]=M,z=W;else break e}}function s(U){return U.length===0?null:U[0]}function r(U){if(U.length===0)return null;var L=U[0],z=U.pop();if(z!==L){U[0]=z;e:for(var W=0,M=U.length,K=M>>>1;W<K;){var ie=2*(W+1)-1,ee=U[ie],ae=ie+1,oe=U[ae];if(0>o(ee,z))ae<M&&0>o(oe,ee)?(U[W]=oe,U[ae]=z,W=ae):(U[W]=ee,U[ie]=z,W=ie);else if(ae<M&&0>o(oe,z))U[W]=oe,U[ae]=z,W=ae;else break e}}return L}function o(U,L){var z=U.sortIndex-L.sortIndex;return z!==0?z:U.id-L.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var h=[],m=[],p=1,x=null,v=3,j=!1,w=!1,C=!1,S=!1,N=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function D(U){for(var L=s(m);L!==null;){if(L.callback===null)r(m);else if(L.startTime<=U)r(m),L.sortIndex=L.expirationTime,t(h,L);else break;L=s(m)}}function A(U){if(C=!1,D(U),!w)if(s(h)!==null)w=!0,_||(_=!0,k());else{var L=s(m);L!==null&&re(A,L.startTime-U)}}var _=!1,F=-1,O=5,I=-1;function V(){return S?!0:!(e.unstable_now()-I<O)}function H(){if(S=!1,_){var U=e.unstable_now();I=U;var L=!0;try{e:{w=!1,C&&(C=!1,E(F),F=-1),j=!0;var z=v;try{t:{for(D(U),x=s(h);x!==null&&!(x.expirationTime>U&&V());){var W=x.callback;if(typeof W=="function"){x.callback=null,v=x.priorityLevel;var M=W(x.expirationTime<=U);if(U=e.unstable_now(),typeof M=="function"){x.callback=M,D(U),L=!0;break t}x===s(h)&&r(h),D(U)}else r(h);x=s(h)}if(x!==null)L=!0;else{var K=s(m);K!==null&&re(A,K.startTime-U),L=!1}}break e}finally{x=null,v=z,j=!1}L=void 0}}finally{L?k():_=!1}}}var k;if(typeof R=="function")k=function(){R(H)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,J=q.port2;q.port1.onmessage=H,k=function(){J.postMessage(null)}}else k=function(){N(H,0)};function re(U,L){F=N(function(){U(e.unstable_now())},L)}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(U){U.callback=null},e.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<U?Math.floor(1e3/U):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(U){switch(v){case 1:case 2:case 3:var L=3;break;default:L=v}var z=v;v=L;try{return U()}finally{v=z}},e.unstable_requestPaint=function(){S=!0},e.unstable_runWithPriority=function(U,L){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var z=v;v=U;try{return L()}finally{v=z}},e.unstable_scheduleCallback=function(U,L,z){var W=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?W+z:W):z=W,U){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=z+M,U={id:p++,callback:L,priorityLevel:U,startTime:z,expirationTime:M,sortIndex:-1},z>W?(U.sortIndex=z,t(m,U),s(h)===null&&U===s(m)&&(C?(E(F),F=-1):C=!0,re(A,z-W))):(U.sortIndex=M,t(h,U),w||j||(w=!0,_||(_=!0,k()))),U},e.unstable_shouldYield=V,e.unstable_wrapCallback=function(U){var L=v;return function(){var z=v;v=L;try{return U.apply(this,arguments)}finally{v=z}}}})(Nm)),Nm}var n0;function Hk(){return n0||(n0=1,Sm.exports=qk()),Sm.exports}var Cm={exports:{}},Ce={};var s0;function Kk(){if(s0)return Ce;s0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),x=Symbol.iterator;function v(M){return M===null||typeof M!="object"?null:(M=x&&M[x]||M["@@iterator"],typeof M=="function"?M:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,C={};function S(M,K,ie){this.props=M,this.context=K,this.refs=C,this.updater=ie||j}S.prototype.isReactComponent={}
vendor: 28,652 bytes, lines 1-8
1,S.prototype.setState=function(M,K){if(typeof M!="object"&&typeof M!="function"&&M!=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,M,K,"setState")},S.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function N(){}N.prototype=S.prototype;function E(M,K,ie){this.props=M,this.context=K,this.refs=C,this.updater=ie||j}var R=E.prototype=new N;R.constructor=E,w(R,S.prototype),R.isPureReactComponent=!0;var D=Array.isArray,A={H:null,A:null,T:null,S:null,V:null},_=Object.prototype.hasOwnProperty;function F(M,K,ie,ee,ae,oe){return ie=oe.ref,{$$typeof:e,type:M,key:K,ref:ie!==void 0?ie:null,props:oe}}function O(M,K){return F(M.type,K,void 0,void 0,void 0,M.props)}function I(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function V(M){var K={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(ie){return K[ie]})}var H=/\/+/g;function k(M,K){return typeof M=="object"&&M!==null&&M.key!=null?V(""+M.key):K.toString(36)}function q(){}function J(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(q,q):(M.status="pending",M.then(function(K){M.status==="pending"&&(M.status="fulfilled",M.value=K)},function(K){M.status==="pending"&&(M.status="rejected",M.reason=K)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function re(M,K,ie,ee,ae){var oe=typeof M;(oe==="undefined"||oe==="boolean")&&(M=null);var le=!1;if(M===null)le=!0;else switch(oe){case"bigint":case"string":case"number":le=!0;break;case"object":switch(M.$$typeof){case e:case t:le=!0;break;case p:return le=M._init,re(le(M._payload),K,ie,ee,ae)}}if(le)return ae=ae(M),le=ee===""?"."+k(M,0):ee,D(ae)?(ie="",le!=null&&(ie=le.replace(H,"$&/")+"/"),re(ae,K,ie,"",function(xe){return xe})):ae!=null&&(I(ae)&&(ae=O(ae,ie+(ae.key==null||M&&M.key===ae.key?"":(""+ae.key).replace(H,"$&/")+"/")+le)),K.push(ae)),1;le=0;var Ne=ee===""?".":ee+":";if(D(M))for(var ce=0;ce<M.length;ce++)ee=M[ce],oe=Ne+k(ee,ce),le+=re(ee,K,ie,oe,ae);else if(ce=v(M),typeof ce=="function")for(M=ce.call(M),ce=0;!(ee=M.next()).done;)ee=ee.value,oe=Ne+k(ee,ce++),le+=re(ee,K,ie,oe,ae);else if(oe==="object"){if(typeof M.then=="function")return re(J(M),K,ie,ee,ae);throw K=String(M),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.")}return le}function U(M,K,ie){if(M==null)return M;var ee=[],ae=0;return re(M,ee,"","",function(oe){return K.call(ie,oe,ae++)}),ee}function L(M){if(M._status===-1){var K=M._result;K=K(),K.then(function(ie){(M._status===0||M._status===-1)&&(M._status=1,M._result=ie)},function(ie){(M._status===0||M._status===-1)&&(M._status=2,M._result=ie)}),M._status===-1&&(M._status=0,M._result=K)}if(M._status===1)return M._result.default;throw M._result}var z=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var K=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(K))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)};function W(){}return Ce.Children={map:U,forEach:function(M,K,ie){U(M,function(){K.apply(this,arguments)},ie)},count:function(M){var K=0;return U(M,function(){K++}),K},toArray:function(M){return U(M,function(K){return K})||[]},only:function(M){if(!I(M))throw Error("React.Children.only expected to receive a single React element child.");return M}},Ce.Component=S,Ce.Fragment=s,Ce.Profiler=o,Ce.PureComponent=E,Ce.StrictMode=r,Ce.Suspense=h,Ce.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,Ce.__COMPILER_RUNTIME={__proto__:null,c:function(M){return A.H.useMemoCache(M)}},Ce.cache=function(M){return function(){return M.apply(null,arguments)}},Ce.cloneElement=function(M,K,ie){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var ee=w({},M.props),ae=M.key,oe=void 0;if(K!=null)for(le in K.ref!==void 0&&(oe=void 0),K.key!==void 0&&(ae=""+K.key),K)!_.call(K,le)||le==="key"||le==="__self"||le==="__source"||le==="ref"&&K.ref===void 0||(ee[le]=K[le]);var le=arguments.length-2;if(le===1)ee.children=ie;else if(1<le){for(var Ne=Array(le),ce=0;ce<le;ce++)Ne[ce]=arguments[ce+2];ee.children=Ne}return F(M.type,ae,void 0,void 0,oe,ee)},Ce.createContext=function(M){return M={$$typeof:u,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:c,_context:M},M},Ce.createElement=function(M,K,ie){var ee,ae={},oe=null;if(K!=null)for(ee in K.key!==void 0&&(oe=""+K.key),K)_.call(K,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(ae[ee]=K[ee]);var le=arguments.length-2;if(le===1)ae.children=ie;else if(1<le){for(var Ne=Array(le),ce=0;ce<le;ce++)Ne[ce]=arguments[ce+2];ae.children=Ne}if(M&&M.defaultProps)for(ee in le=M.defaultProps,le)ae[ee]===void 0&&(ae[ee]=le[ee]);return F(M,oe,void 0,void 0,null,ae)},Ce.createRef=function(){return{current:null}},Ce.forwardRef=function(M){return{$$typeof:f,render:M}},Ce.isValidElement=I,Ce.lazy=function(M){return{$$typeof:p,_payload:{_status:-1,_result:M},_init:L}},Ce.memo=function(M,K){return{$$typeof:m,type:M,compare:K===void 0?null:K}},Ce.startTransition=function(M){var K=A.T,ie={};A.T=ie;try{var ee=M(),ae=A.S;ae!==null&&ae(ie,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(W,z)}catch(oe){z(oe)}finally{A.T=K}},Ce.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},Ce.use=function(M){return A.H.use(M)},Ce.useActionState=function(M,K,ie){return A.H.useActionState(M,K,ie)},Ce.useCallback=function(M,K){return A.H.useCallback(M,K)},Ce.useContext=function(M){return A.H.useContext(M)},Ce.useDebugValue=function(){},Ce.useDeferredValue=function(M,K){return A.H.useDeferredValue(M,K)},Ce.useEffect=function(M,K,ie){var ee=A.H;if(typeof ie=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return ee.useEffect(M,K)},Ce.useId=function(){return A.H.useId()},Ce.useImperativeHandle=function(M,K,ie){return A.H.useImperativeHandle(M,K,ie)},Ce.useInsertionEffect=function(M,K){return A.H.useInsertionEffect(M,K)},Ce.useLayoutEffect=function(M,K){return A.H.useLayoutEffect(M,K)},Ce.useMemo=function(M,K){return A.H.useMemo(M,K)},Ce.useOptimistic=function(M,K){return A.H.useOptimistic(M,K)},Ce.useReducer=function(M,K,ie){return A.H.useReducer(M,K,ie)},Ce.useRef=function(M){return A.H.useRef(M)},Ce.useState=function(M){return A.H.useState(M)},Ce.useSyncExternalStore=function(M,K,ie){return A.H.useSyncExternalStore(M,K,ie)},Ce.useTransition=function(){return A.H.useTransition()},Ce.version="19.1.0",Ce}var r0;function Ld(){return r0||(r0=1,Cm.exports=Kk()),Cm.exports}var Em={exports:{}},ln={};var i0;function Gk(){if(i0)return ln;i0=1;var e=Ld();function t(h){var m="https://react.dev/errors/"+h;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)m+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+h+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var r={d:{f:s,r:function(){throw Error(t(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},o=Symbol.for("react.portal");function c(h,m,p){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:x==null?null:""+x,children:h,containerInfo:m,implementation:p}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(h,m){if(h==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return ln.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,ln.createPortal=function(h,m){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(t(299));return c(h,m,null,p)},ln.flushSync=function(h){var m=u.T,p=r.p;try{if(u.T=null,r.p=2,h)return h()}finally{u.T=m,r.p=p,r.d.f()}},ln.preconnect=function(h,m){typeof h=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,r.d.C(h,m))},ln.prefetchDNS=function(h){typeof h=="string"&&r.d.D(h)},ln.preinit=function(h,m){if(typeof h=="string"&&m&&typeof m.as=="string"){var p=m.as,x=f(p,m.crossOrigin),v=typeof m.integrity=="string"?m.integrity:void 0,j=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;p==="style"?r.d.S(h,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:x,integrity:v,fetchPriority:j}):p==="script"&&r.d.X(h,{crossOrigin:x,integrity:v,fetchPriority:j,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},ln.preinitModule=function(h,m){if(typeof h=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var p=f(m.as,m.crossOrigin);r.d.M(h,{crossOrigin:p,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&r.d.M(h)},ln.preload=function(h,m){if(typeof h=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var p=m.as,x=f(p,m.crossOrigin);r.d.L(h,p,{crossOrigin:x,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},ln.preloadModule=function(h,m){if(typeof h=="string")if(m){var p=f(m.as,m.crossOrigin);r.d.m(h,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:p,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else r.d.m(h)},ln.requestFormReset=function(h){r.d.r(h)},ln.unstable_batchedUpdates=function(h,m){return h(m)},ln.useFormState=function(h,m,p){return u.H.useFormState(h,m,p)},ln.useFormStatus=function(){return u.H.useHostTransitionStatus()},ln.version="19.1.0",ln}var a0;function fS(){if(a0)return Em.exports;a0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Em.exports=Gk(),Em.exports}var o0;function Yk(){if(o0)return ml;o0=1;var e=Hk(),t=Ld(),s=fS();function r(n){var i="https://react.dev/errors/"+n;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+n+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function c(n){var i=n,l=n;if(n.alternate)for(;i.return;)i=i.return;else{n=i;do i=n,(i.flags&4098)!==0&&(l=i.return),n=i.return;while(n)}return i.tag===3?l:null}function u(n){if(n.tag===13){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function f(n){if(c(n)!==n)throw Error(r(188))}function h(n){var i=n.alternate;if(!i){if(i=c(n),i===null)throw Error(r(188));return i!==n?null:n}for(var l=n,d=i;;){var g=l.return;if(g===null)break;var b=g.alternate;if(b===null){if(d=g.return,d!==null){l=d;continue}break}if(g.child===b.child){for(b=g.child;b;){if(b===l)return f(g),n;if(b===d)return f(g),i;b=b.sibling}throw Error(r(188))}if(l.return!==d.return)l=g,d=b;else{for(var T=!1,P=g.child;P;){if(P===l){T=!0,l=g,d=b;break}if(P===d){T=!0,d=g,l=b;break}P=P.sibling}if(!T){for(P=b.child;P;){if(P===l){T=!0,l=b,d=g;break}if(P===d){T=!0,d=b,l=g;break}P=P.sibling}if(!T)throw Error(r(189))}}if(l.alternate!==d)throw Error(r(190))}if(l.tag!==3)throw Error(r(188));return l.stateNode.current===l?n:i}function m(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n;for(n=n.child;n!==null;){if(i=m(n),i!==null)return i;n=n.sibling}return null}var p=Object.assign,x=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),N=Symbol.for("react.provider"),E=Symbol.for("react.consumer"),R=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),V=Symbol.for("react.memo_cache_sentinel"),H=Symbol.iterator;function k(n){return n===null||typeof n!="object"?null:(n=H&&n[H]||n["@@iterator"],typeof n=="function"?n:null)}var q=Symbol.for("react.client.reference");function J(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===q?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case w:return"Fragment";case S:return"Profiler";case C:return"StrictMode";case A:return"Suspense";case _:return"SuspenseList";case I:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case j:return"Portal";case R:return(n.displayName||"Context")+".Provider";case E:return(n._context.displayName||"Context")+".Consumer";case D:var i=n.render;return n=n.displayName,n||(n=i.displayName||i.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case F:return i=n.displayName||null,i!==null?i:J(n.type)||"Memo";case O:i=n._payload,n=n._init;try{return J(n(i))}catch{}}return null}var re=Array.isArray,U=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z={pending:!1,data:null,method:null,action:null},W=[],M=-1;function K(n){return{current:n}}function ie(n){0>M||(n.current=W[M],W[M]=null,M--)}function ee(n,i){M++,W[M]=n.current,n.current=i}var ae=K(null),oe=K(null),le=K(null),Ne=K(null);function ce(n,i){switch(ee(le,i),ee(oe,n),ee(ae,null),i.nodeType){case 9:case 11:n=(n=i.documentElement)&&(n=n.namespaceURI)?Nw(n):0;break;default:if(n=i.tagName,i=i.namespaceURI)i=Nw(i),n=Cw(i,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}ie(ae),ee(ae,n)}function xe(){ie(ae),ie(oe),ie(le)}function ut(n){n.memoizedState!==null&&ee(Ne,n);var i=ae.current,l=Cw(i,n.type);i!==l&&(ee(oe,n),ee(ae,l))}function nt(n){oe.current===n&&(ie(ae),ie(oe)),Ne.current===n&&(ie(Ne),ll._currentValue=z)}var tn=Object.prototype.hasOwnProperty,nn=e.unstable_scheduleCallback,Rt=e.unstable_cancelCallback,jt=e.unstable_shouldYield,ui=e.unstable_requestPaint,Ft=e.unstable_now,di=e.unstable_getCurrentPriorityLevel,Gt=e.unstable_ImmediatePriority,Ji=e.unstable_UserBlockingPriority,Vn=e.unstable_NormalPriority,_s=e.unstable_LowPriority,Nn=e.unstable_IdlePriority,Le=e.log,Ls=e.unstable_setDisableYieldValue,Us=null,kt=null;function Cn(n){if(typeof Le=="function"&&Ls(n),kt&&typeof kt.setStrictMode=="function")try{kt.setStrictMode(Us,n)}catch{}}var Vt=Math.clz32?Math.clz32:ft,br=Math.log,$e=Math.LN2;function ft(n){return n>>>=0,n===0?32:31-(br(n)/$e|0)|0}var dt=256,pt=4194304;function Oe(n){var i=n&42;if(i!==0)return i;switch(n&-n){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:case 262144:case 524288:case 1048576:case 2097152:return n&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function st(n,i,l){var d=n.pendingLanes;if(d===0)return 0;var g=0,b=n.suspendedLanes,T=n.pingedLanes;n=n.warmLanes;var P=d&134217727;return P!==0?(d=P&~b,d!==0?g=Oe(d):(T&=P,T!==0?g=Oe(T):l||(l=P&~n,l!==0&&(g=Oe(l))))):(P=d&~b,P!==0?g=Oe(P):T!==0?g=Oe(T):l||(l=d&~n,l!==0&&(g=Oe(l)))),g===0?0:i!==0&&i!==g&&(i&b)===0&&(b=g&-g,l=i&-i,b>=l||b===32&&(l&4194048)!==0)?i:g}function Mt(n,i){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&i)===0}function sn(n,i){switch(n){case 1:case 2:case 4:case 8:case 64:return i+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 i+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 Yt(){var n=dt;return dt<<=1,(dt&4194048)===0&&(dt=256),n}function rn(){var n=pt;return pt<<=1,(pt&62914560)===0&&(pt=4194304),n}function En(n){for(var i=[],l=0;31>l;l++)i.push(n);return i}function xn(n,i){n.pendingLanes|=i,i!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function fi(n,i,l,d,g,b){var T=n.pendingLanes;n.pendingLanes=l,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=l,n.entangledLanes&=l,n.errorRecoveryDisabledLanes&=l,n.shellSuspendCounter=0;var P=n.entanglements,B=n.expirationTimes,Q=n.hiddenUpdates;for(l=T&~l;0<l;){var te=31-Vt(l),se=1<<te;P[te]=0,B[te]=-1;var X=Q[te];if(X!==null)for(Q[te]=null,te=0;te<X.length;te++){var Z=X[te];Z!==null&&(Z.lane&=-536870913)}l&=~se}d!==0&&yo(n,d,0),b!==0&&g===0&&n.tag!==0&&(n.suspendedLanes|=b&~(T&~i))}function yo(n,i,l){n.pendingLanes|=i,n.suspendedLanes&=~i;var d=31-Vt(i);n.entangledLanes|=i,n.entanglements[d]=n.entanglements[d]|1073741824|l&4194090}function ea(n,i){var l=n.entangledLanes|=i;for(n=n.entanglements;l;){var d=31-Vt(l),g=1<<d;g&i|n[d]&i&&(n[d]|=i),l&=~g}}function be(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=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:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function je(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function me(){var n=L.p;return n!==0?n:(n=window.event,n===void 0?32:qw(n.type))}function De(n,i){var l=L.p;try{return L.p=n,i()}finally{L.p=l}}var qe=Math.random().toString(36).slice(2),Ie="__reactFiber$"+qe,Ye="__reactProps$"+qe,rt="__reactContainer$"+qe,ke="__reactEvents$"+qe,ta="__reactListeners$"+qe,wr="__reactHandles$"+qe,Is="__reactResources$"+qe,vo="__reactMarker$"+qe;function hf(n){delete n[Ie],delete n[Ye],delete n[ke],delete n[ta],delete n[wr]}function na(n){var i=n[Ie];if(i)return i;for(var l=n.parentNode;l;){if(i=l[rt]||l[Ie]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(n=Rw(n);n!==null;){if(l=n[Ie])return l;n=Rw(n)}return i}n=l,l=n.parentNode}return null}function sa(n){if(n=n[Ie]||n[rt]){var i=n.tag;if(i===5||i===6||i===13||i===26||i===27||i===3)return n}return null}function bo(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n.stateNode;throw Error(r(33))}function ra(n){var i=n[Is];return i||(i=n[Is]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Bt(n){n[vo]=!0}var hy=new Set,my={};function hi(n,i){ia(n,i),ia(n+"Capture",i)}function ia(n,i){for(my[n]=i,n=0;n<i.length;n++)hy.add(i[n])}var OA=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]*$"),py={},gy={};function DA(n){return tn.call(gy,n)?!0:tn.call(py,n)?!1:OA.test(n)?gy[n]=!0:(py[n]=!0,!1)}function ac(n,i,l){if(DA(i))if(l===null)n.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":n.removeAttribute(i);return;case"boolean":var d=i.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){n.removeAttribute(i);return}}n.setAttribute(i,""+l)}}function oc(n,i,l){if(l===null)n.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(i);return}n.setAttribute(i,""+l)}}function zs(n,i,l,d){if(d===null)n.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(l);return}n.setAttributeNS(i,l,""+d)}}var mf,xy;function aa(n){if(mf===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);mf=i&&i[1]||"",xy=-1<l.stack.indexOf(`
2    at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
3`+mf+n+xy}var pf=!1;function gf(n,i){if(!n||pf)return"";pf=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(i){var se=function(){throw Error()};if(Object.defineProperty(se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(se,[])}catch(Z){var X=Z}Reflect.construct(n,[],se)}else{try{se.call()}catch(Z){X=Z}n.call(se.prototype)}}else{try{throw Error()}catch(Z){X=Z}(se=n())&&typeof se.catch=="function"&&se.catch(function(){})}}catch(Z){if(Z&&X&&typeof Z.stack=="string")return[Z.stack,X.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var g=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");g&&g.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var b=d.DetermineComponentFrameRoot(),T=b[0],P=b[1];if(T&&P){var B=T.split(`
4`),Q=P.split(`
5`);for(g=d=0;d<B.length&&!B[d].includes("DetermineComponentFrameRoot");)d++;for(;g<Q.length&&!Q[g].includes("DetermineComponentFrameRoot");)g++;if(d===B.length||g===Q.length)for(d=B.length-1,g=Q.length-1;1<=d&&0<=g&&B[d]!==Q[g];)g--;for(;1<=d&&0<=g;d--,g--)if(B[d]!==Q[g]){if(d!==1||g!==1)do if(d--,g--,0>g||B[d]!==Q[g]){var te=`
6`+B[d].replace(" at new "," at ");return n.displayName&&te.includes("<anonymous>")&&(te=te.replace("<anonymous>",n.displayName)),te}while(1<=d&&0<=g);break}}}finally{pf=!1,Error.prepareStackTrace=l}return(l=n?n.displayName||n.name:"")?aa(l):""}function PA(n){switch(n.tag){case 26:case 27:case 5:return aa(n.type);case 16:return aa("Lazy");case 13:return aa("Suspense");case 19:return aa("SuspenseList");case 0:case 15:return gf(n.type,!1);case 11:return gf(n.type.render,!1);case 1:return gf(n.type,!0);case 31:return aa("Activity");default:return""}}function yy(n){try{var i="";do i+=PA(n),n=n.return;while(n);return i}catch(l){return`
7Error generating stack: `+l.message+`
8`+l.stack}}function Bn(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function vy(n){var i=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function _A(n){var i=vy(n)?"checked":"value",l=Object.getOwnPropertyDescriptor(n.constructor.prototype,i),d=""+n[i];if(!n.hasOwnProperty(i)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var g=l.get,b=l.set;return Object.defineProperty(n,i,{configurable:!0,get:function(){return g.call(this)},set:function(T){d=""+T,b.call(this,T)}}),Object.defineProperty(n,i,{enumerable:l.enumerable}),{getValue:function(){return d},setValue:function(T){d=""+T},stopTracking:function(){n._valueTracker=null,delete n[i]}}}}function lc(n){n._valueTracker||(n._valueTracker=_A(n))}function by(n){if(!n)return!1;var i=n._valueTracker;if(!i)return!0;var l=i.getValue(),d="";return n&&(d=vy(n)?n.checked?"true":"false":n.value),n=d,n!==l?(i.setValue(n),!0):!1}function cc(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var LA=/[\n"\\]/g;function $n(n){return n.replace(LA,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function xf(n,i,l,d,g,b,T,P){n.name="",T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?n.type=T:n.removeAttribute("type"),i!=null?T==="number"?(i===0&&n.value===""||n.value!=i)&&(n.value=""+Bn(i)):n.value!==""+Bn(i)&&(n.value=""+Bn(i)):T!=="submit"&&T!=="reset"||n.removeAttribute("value"),i!=null?yf(n,T,Bn(i)):l!=null?yf(n,T,Bn(l)):d!=null&&n.removeAttribute("value"),g==null&&b!=null&&(n.defaultChecked=!!b),g!=null&&(n.checked=g&&typeof g!="function"&&typeof g!="symbol"),P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?n.name=""+Bn(P):n.removeAttribute("name")}function wy(n,i,l,d,g,b,T,P){if(b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(n.type=b),i!=null||l!=null){if(!(b!=="submit"&&b!=="reset"||i!=null))return;l=l!=null?""+Bn(l):"",i=i!=null?""+Bn(i):l,P||i===n.value||(n.value=i),n.defaultValue=i}d=d??g,d=typeof d!="function"&&typeof d!="symbol"&&!!d,n.checked=P?n.checked:!!d,n.defaultChecked=!!d,T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(n.name=T)}function yf(n,i,l){i==="number"&&cc(n.ownerDocument)===n||n.defaultValue===""+l||(n.defaultValue=""+l)}function oa(n,i,l,d){if(n=n.options,i){i={};for(var g=0;g<l.length;g++)i["$"+l[g]]=!0;for(l=0;l<n.length;l++)g=i.hasOwnProperty("$"+n[l].value),n[l].selected!==g&&(n[l].selected=g),g&&d&&(n[l].defaultSelected=!0)}else{for(l=""+Bn(l),i=null,g=0;g<n.length;g++){if(n[g].value===l){n[g].selected=!0,d&&(n[g].defaultSelected=!0);return}i!==null||n[g].disabled||(i=n[g])}i!==null&&(i.selected=!0)}}function jy(n,i,l){if(i!=null&&(i=""+Bn(i),i!==n.value&&(n.value=i),l==null)){n.defaultValue!==i&&(n.defaultValue=i);return}n.defaultValue=l!=null?""+Bn(l):""}function Sy(n,i,l,d){if(i==null){if(d!=null){if(l!=null)throw Error(r(92));if(re(d)){if(1<d.length)throw Error(r(93));d=d[0]}l=d}l==null&&(l=""),i=l}l=Bn(i),n.defaultValue=l,d=n.textContent,d===l&&d!==""&&d!==null&&(n.value=d)}function la(n,i){if(i){var l=n.firstChild;if(l&&l===n.lastChild&&l.nodeType===3){l.nodeValue=i;return}}n.textContent=i}var UA=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 Ny(n,i,l){var d=i.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?d?n.setProperty(i,""):i==="float"?n.cssFloat="":n[i]="":d?n.setProperty(i,l):typeof l!="number"||l===0||UA.has(i)?i==="float"?n.cssFloat=l:n[i]=(""+l).trim():n[i]=l+"px"}function Cy(n,i,l){if(i!=null&&typeof i!="object")throw Error(r(62));if(n=n.style,l!=null){for(var d in l)!l.hasOwnProperty(d)||i!=null&&i.hasOwnProperty(d)||(d.indexOf("--")===0?n.setProperty(d,""):d==="float"?n.cssFloat="":n[d]="");for(var g in i)d=i[g],i.hasOwnProperty(g)&&l[g]!==d&&Ny(n,g,d)}else for(var b in i)i.hasOwnProperty(b)&&Ny(n,b,i[b])}function vf(n){if(n.indexOf("-")===-1)return!1;switch(n){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 IA=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"],["colorRen
8dering","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"]]),zA=/^[\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 uc(n){return zA.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}var bf=null;function wf(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var ca=null,ua=null;function Ey(n){var i=sa(n);if(i&&(n=i.stateNode)){var l=n[Ye]||null;e:switch(n=i.stateNode,i.type){case"input":if(xf(n,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),i=l.name,l.type==="radio"&&i!=null){for(l=n;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+$n(""+i)+'"][type="radio"]'),i=0;i<l.length;i++){var d=l[i];if(d!==n&&d.form===n.form){var g=d[Ye]||null;if(!g)throw Error(r(90));xf(d,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(i=0;i<l.length;i++)d=l[i],d.form===n.form&&by(d)}break e;case"textarea":jy(n,l.value,l.defaultValue);break e;case"select":i=l.value,i!=null&&oa(n,!!l.multiple,i,!1)}}}var jf=!1;function Ty(n,i,l){if(jf)return n(i,l);jf=!0;try{var d=n(i);return d}finally{if(jf=!1,(ca!==null||ua!==null)&&(Qc(),ca&&(i=ca,n=ua,ua=ca=null,Ey(i),n)))for(i=0;i<n.length;i++)Ey(n[i])}}function wo(n,i){var l=n.stateNode;if(l===null)return null;var d=l[Ye]||null;if(d===null)return null;l=d[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(n=n.type,d=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!d;break e;default:n=!1}if(n)return null;if(l&&typeof l!="function")throw Error(r(231,i,typeof l));return l}var Fs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Sf=!1;if(Fs)try{var jo={};Object.defineProperty(jo,"passive",{get:function(){Sf=!0}}
vendor: 3,273 bytes, line 8
8),window.addEventListener("test",jo,jo),window.removeEventListener("test",jo,jo)}catch{Sf=!1}var jr=null,Nf=null,dc=null;function Ay(){if(dc)return dc;var n,i=Nf,l=i.length,d,g="value"in jr?jr.value:jr.textContent,b=g.length;for(n=0;n<l&&i[n]===g[n];n++);var T=l-n;for(d=1;d<=T&&i[l-d]===g[b-d];d++);return dc=g.slice(n,1<d?1-d:void 0)}function fc(n){var i=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&i===13&&(n=13)):n=i,n===10&&(n=13),32<=n||n===13?n:0}function hc(){return!0}function Ry(){return!1}function yn(n){function i(l,d,g,b,T){this._reactName=l,this._targetInst=g,this.type=d,this.nativeEvent=b,this.target=T,this.currentTarget=null;for(var P in n)n.hasOwnProperty(P)&&(l=n[P],this[P]=l?l(b):b[P]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?hc:Ry,this.isPropagationStopped=Ry,this}return p(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=hc)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=hc)},persist:function(){},isPersistent:hc}),i}var mi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},mc=yn(mi),So=p({},mi,{view:0,detail:0}),FA=yn(So),Cf,Ef,No,pc=p({},So,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Af,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==No&&(No&&n.type==="mousemove"?(Cf=n.screenX-No.screenX,Ef=n.screenY-No.screenY):Ef=Cf=0,No=n),Cf)},movementY:function(n){return"movementY"in n?n.movementY:Ef}}),ky=yn(pc),VA=p({},pc,{dataTransfer:0}),BA=yn(VA),$A=p({},So,{relatedTarget:0}),Tf=yn($A),qA=p({},mi,{animationName:0,elapsedTime:0,pseudoElement:0}),HA=yn(qA),KA=p({},mi,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),GA=yn(KA),YA=p({},mi,{data:0}),My=yn(YA),QA={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},WA={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"},XA={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ZA(n){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(n):(n=XA[n])?!!i[n]:!1}function Af(){return ZA}var JA=p({},So,{key:function(n){if(n.key){var i=QA[n.key]||n.key;if(i!=="Unidentified")return i}return n.type==="keypress"?(n=fc(n),n===13?"Enter":String.fromCharCode(n)):n.type==="
8keydown"||n.type==="keyup"?WA[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Af,charCode:function(n){return n.type==="keypress"?fc(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?fc(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),eR=yn(JA),tR=p({},pc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Oy=yn(tR),nR=p({},So,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Af}),sR=yn(nR),rR=p({},mi,{propertyName:0,elapsedTime:0,pseudoElement:0}),iR=yn(rR),aR=p({},pc,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),oR=yn(aR),lR=p({},mi,{newState:0,oldState:0}),cR=yn(lR),uR=[9,13,27,32],Rf=Fs&&"CompositionEvent"in window,Co=null;Fs&&"documentMode"in document&&(Co=document.documentMode);var dR=Fs&&"TextEvent"in window&&!Co,Dy=Fs&&(!Rf||Co&&8<Co&&11>=Co),Py=" ",_y=!1;function Ly(n,i){switch(n){case"keyup":return uR.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Uy(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var da=!1;function fR(n,i){switch(n){case"compositionend":return Uy(i);case"keypress":return i.which!==32?null:(_y=!0,Py);case"textInput":return n=i.data,n===Py&&_y?null:n;default:return null}}function hR(n,i){if(da)return n==="compositionend"||!Rf&&Ly(n,i)?(n=Ay(),dc=Nf=jr=null,da=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Dy&&i.locale!=="ko"?null:i.data;default:return null}}var mR={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 Iy(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i==="input"?!!mR[n.type]:i==="textarea"}function zy(n,i,l,d){ca?ua?ua.push(d):ua=[d]:ca=d,i=tu(i,"onChange"),0<i.length&&(l=new mc("onChange","change",null,l,d),n.push({event:l,listeners:i}))}var Eo=null,To=null;function pR(n){vw(n,0)}function gc(n){var i=bo(n);if(by(i))return n}function Fy(n,i){if(n==="change")return i}var Vy=!1;if(Fs){var kf;if(Fs){var Mf="oninput"in document;if(!Mf){var By=document.createElement("div");By.setAttribute("oninput","return;"),Mf=typeof By.oninput=="function"}kf=Mf}else kf=!1;Vy=kf&&(!document.documentMode||9<document.documentMode)}function $y(){Eo&&(Eo.detachEvent("onpropertychange",qy),To=Eo=null)}function qy(n){if(n.propertyName==="value"&&gc(To)){var i=[];zy(i,To,n,wf(n)),Ty(pR,i)}}function gR(n,i,l){n==="focusin"?($y(),Eo=i,To=l,Eo.attachEvent("onpropertychange",qy)):n==="focusout"&&$y()}function xR(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return gc(To)}function yR(n,i){if(n==="click")return gc(i)}function vR(n,i){if(n==="input"||n==="change")return gc(i)}function bR(n,i){return n===i&&(n!==0||1/n===1/i)||n!==n&&i!==i}var Tn=typeof Object.is=="function"?Object.is:bR;function Ao(n,i){if(Tn(n,i))return!0;if(typeof n!="object"||n===null||typeof i!="object"||i===null)return!1;var l=Object.keys(n),d=Object.keys(i);if(l.length!==d.length)return!1;for(d=0;d<l.length;d++){var g=l[d];if(!tn.call(i,g)||!Tn(n[g],i[g]))return!1}return!0}function Hy(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Ky(n,i){var l=Hy(n);n=0;for(var d;l;){if(l.nodeType===3){if(d=n+l.textContent.length,n<=i&&d>=i)return{node:l,offset:i-n};n=d}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Hy(l)}}function Gy(n,i){return n&&i?n===i?!0:n&&n.nodeType===3?!1:i&&i.nodeType===3?Gy(n,i.parentNode):"contains"in n?n.contains(i):n.compareDocumentPosition?!!(n.compareDocumentPosition(i)&16):!1:!1}function Yy(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var i=cc(n.document);i instanceof n.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)n=i.contentWindow;else break;i=cc(n.document)}return i}function Of(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i&&(i==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||i==="textarea"||n.contentEditable==="true")}var wR=Fs&&"documentMode"in document&&11>=document.documentMode,fa=null,Df=null,Ro=null,Pf=!1;function Qy(n,i,l){var d=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Pf||fa==null||fa!==cc(d)||(d=fa,"selectionStart"in d&&Of(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focu
vendor: 54,205 bytes, line 8
8sNode:d.focusNode,focusOffset:d.focusOffset}),Ro&&Ao(Ro,d)||(Ro=d,d=tu(Df,"onSelect"),0<d.length&&(i=new mc("onSelect","select",null,i,l),n.push({event:i,listeners:d}),i.target=fa)))}function pi(n,i){var l={};return l[n.toLowerCase()]=i.toLowerCase(),l["Webkit"+n]="webkit"+i,l["Moz"+n]="moz"+i,l}var ha={animationend:pi("Animation","AnimationEnd"),animationiteration:pi("Animation","AnimationIteration"),animationstart:pi("Animation","AnimationStart"),transitionrun:pi("Transition","TransitionRun"),transitionstart:pi("Transition","TransitionStart"),transitioncancel:pi("Transition","TransitionCancel"),transitionend:pi("Transition","TransitionEnd")},_f={},Wy={};Fs&&(Wy=document.createElement("div").style,"AnimationEvent"in window||(delete ha.animationend.animation,delete ha.animationiteration.animation,delete ha.animationstart.animation),"TransitionEvent"in window||delete ha.transitionend.transition);function gi(n){if(_f[n])return _f[n];if(!ha[n])return n;var i=ha[n],l;for(l in i)if(i.hasOwnProperty(l)&&l in Wy)return _f[n]=i[l];return n}var Xy=gi("animationend"),Zy=gi("animationiteration"),Jy=gi("animationstart"),jR=gi("transitionrun"),SR=gi("transitionstart"),NR=gi("transitioncancel"),ev=gi("transitionend"),tv=new Map,Lf="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(" ");Lf.push("scrollEnd");function as(n,i){tv.set(n,i),hi(i,[n])}var nv=new WeakMap;function qn(n,i){if(typeof n=="object"&&n!==null){var l=nv.get(n);return l!==void 0?l:(i={value:n,source:i,stack:yy(i)},nv.set(n,i),i)}return{value:n,source:i,stack:yy(i)}}var Hn=[],ma=0,Uf=0;function xc(){for(var n=ma,i=Uf=ma=0;i<n;){var l=Hn[i];Hn[i++]=null;var d=Hn[i];Hn[i++]=null;var g=Hn[i];Hn[i++]=null;var b=Hn[i];if(Hn[i++]=null,d!==null&&g!==null){var T=d.pending;T===null?g.next=g:(g.next=T.next,T.next=g),d.pending=g}b!==0&&sv(l,g,b)}}function yc(n,i,l,d){Hn[ma++]=n,Hn[ma++]=i,Hn[ma++]=l,Hn[ma++]=d,Uf|=d,n.lanes|=d,n=n.alternate,n!==null&&(n.lanes|=d)}function If(n,i,l,d){return yc(n,i,l,d),vc(n)}function pa(n,i){return yc(n,null,null,i),vc(n)}function sv(n,i,l){n.lanes|=l;var d=n.alternate;d!==null&&(d.lanes|=l);for(var g=!1,b=n.return;b!==null;)b.childLanes|=l,d=b.alternate,d!==null&&(d.childLanes|=l),b.tag===22&&(n=b.stateNode,n===null||n._visibility&1||(g=!0)),n=b,b=b.return;return n.tag===3?(b=n.stateNode,g&&i!==null&&(g=31-Vt(l),n=b.hiddenUpdates,d=n[g],d===null?n[g]=[i]:d.push(i),i.lane=l|536870912),b):null}function vc(n){if(50<el)throw el=0,qh=null,Error(r(185));for(var i=n.return;i!==null;)n=i,i=n.return;return n.tag===3?n.stateNode:null}var ga={};function CR(n,i,l,d){this.tag=n,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function An(n,i,l,d){return new CR(n,i,l,d)}function zf(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Vs(n,i){var l=n.alternate;return l===null?(l=An(n.tag,i,n.key,n.mode),l.elementType=n.elementType,l.type=n.type,l.stateNode=n.stateNode,l.alternate=n,n.alternate=l):(l.pendingProps=i,l.type=n.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=n.flags&65011712,l.childLanes=n.childLanes,l.lanes=n.lanes,l.child=n.child,l.memoizedProps=n.memoizedProps,l.memoizedState=n.memoizedState,l.updateQueue=n.updateQueue,i=n.dependencies,l.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},l.sibling=n.sibling,l.index=n.index,l.ref=n.ref,l.refCleanup=n.refCleanup,l}function rv(n,i){n.flags&=65011714;var l=n.alternate;return l===null?(n.childLanes=0,n.lanes=i,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=l.childLanes,n.lanes=l.lanes,n.child=l.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=l.memoizedProps,n.memoizedState=l.memoizedState,n.updateQueue=l.updateQueue,n.type=l.type,i=l.dependencies,n.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),n}function bc(n,i,l,d,g,b){var T=0;if(d=n,typeof n=="function")zf(n)&&(T=1);else if(typeof n=="string")T=Tk(n,l,ae.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case I:return n=An(31,l,i,g),n.elementType=I,n.lanes=b,n;case w:return xi(l.children,g,b,i);case C:T=8,g|=24;break;case S:return n=An(12,l,i,g|2),n.elementType=S,n.lanes=b,n;case A:return n=An(13,l,i,g),n.elementType=A,n.lanes=b,n;case _:return n=An(19,l,i,g),n.elementType=_,n.lanes=b,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case N:case R:T=10;break e;case E:T=9;break e;case D:T=11;break e;case F:T=14;break e;case O:T=16,d=null;break e}T=29,l=Error(r(130,n===null?"null":typeof n,"")),d=null}return i=An(T,l,i,g),i.elementType=n,i.type=d,i.lanes=b,i}function xi(n,i,l,d){return n=An(7,n,d,i),n.lanes=l,n}function Ff(n,i,l){return n=An(6,n,null,i),n.lanes=l,n}function Vf(n,i,l){return i=An(4,n.children!==null?n.children:[],n.key,i),i.lanes=l,i.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},i}var xa=[],ya=0,wc=null,jc=0,Kn=[],Gn=0,yi=null,Bs=1,$s="";function vi(n,i){xa[ya++]=jc,xa[ya++]=wc,wc=n,jc=i}function iv(n,i,l){Kn[Gn++]=Bs,Kn[Gn++]=$s,Kn[Gn++]=yi,yi=n;var d=Bs;n=$s;var g=32-Vt(d)-1;d&=~(1<<g),l+=1;var b=32-Vt(i)+g;if(30<b){var T=g-g%5;b=(d&(1<<T)-1).toString(32),d>>=T,g-=T,Bs=1<<32-Vt(i)+g|l<<g|d,$s=b+n}else Bs=1<<b|l<<g|d,$s=n}function Bf(n){n.return!==null&&(vi(n,1),iv(n,1,0))}function $f(n){for(;n===wc;)wc=xa[--ya],xa[ya]=null,jc=xa[--ya],xa[ya]=null;for(;n===yi;)yi=Kn[--Gn],Kn[Gn]=null,$s=Kn[--Gn],Kn[Gn]=null,Bs=Kn[--Gn],Kn[Gn]=null}var cn=null,yt=null,He=!1,bi=null,xs=!1,qf=Error(r(519));function wi(n){var i=Error(r(418,""));throw Oo(qn(i,n)),qf}function av(n){var i=n.stateNode,l=n.type,d=n.memoizedProps;switch(i[Ie]=n,i[Ye]=d,l){case"dialog":_e("cancel",i),_e("close",i);break;case"iframe":case"object":case"embed":_e("load",i);break;case"video":case"audio":for(l=0;l<nl.length;l++)_e(nl[l],i);break;case"source":_e("error",i);break;case"img":case"image":case"link":_e("error",i),_e("load",i);break;case"details":_e("toggle",i);break;case"input":_e("invalid",i),wy(i,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0),lc(i);break;case"select":_e("invalid",i);break;case"textarea":_e("invalid",i),Sy(i,d.value,d.defaultValue,d.children),lc(i)}l=d.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||i.textContent===""+l||d.suppressHydrationWarning===!0||Sw(i.textContent,l)?(d.popover!=null&&(_e("beforetoggle",i),_e("toggle",i)),d.onScroll!=null&&_e("scroll",i),d.onScrollEnd!=null&&_e("scrollend",i),d.onClick!=null&&(i.onclick=nu),i=!0):i=!1,i||wi(n)}function ov(n){for(cn=n.return;cn;)switch(cn.tag){case 5:case 13:xs=!1;return;case 27:case 3:xs=!0;return;default:cn=cn.return}}function ko(n){if(n!==cn)return!1;if(!He)return ov(n),He=!0,!1;var i=n.tag,l;if((l=i!==3&&i!==27)&&((l=i===5)&&(l=n.type,l=!(l!=="form"&&l!=="button")||am(n.type,n.memoizedProps)),l=!l),l&&yt&&wi(n),ov(n),i===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(317));e:{for(n=n.nextSibling,i=0;n;){if(n.nodeType===8)if(l=n.data,l==="/$"){if(i===0){yt=ls(n.nextSibling);break e}i--}else l!=="$"&&l!=="$!"&&l!=="$?"||i++;n=n.nextSibling}yt=null}}else i===27?(i=yt,Ir(n.type)?(n=um,um=null,yt=n):yt=i):yt=cn?ls(n.stateNode.nextSibling):null;return!0}function Mo(){yt=cn=null,He=!1}function lv(){var n=bi;return n!==null&&(wn===null?wn=n:wn.push.apply(wn,n),bi=null),n}function Oo(n){bi===null?bi=[n]:bi.push(n)}var Hf=K(null),ji=null,qs=null;function Sr(n,i,l){ee(Hf,i._currentValue),i._currentValue=l}function Hs(n){n._currentValue=Hf.current,ie(Hf)}function Kf(n,i,l){for(;n!==null;){var d=n.alternate;if((n.childLanes&i)!==i?(n.childLanes|=i,d!==null&&(d.childLanes|=i)):d!==null&&(d.childLanes&i)!==i&&(d.childLanes|=i),n===l)break;n=n.return}}function Gf(n,i,l,d){var g=n.child;for(g!==null&&(g.return=n);g!==null;){var b=g.dependencies;if(b!==null){var T=g.child;b=b.firstContext;e:for(;b!==null;){var P=b;b=g;for(var B=0;B<i.length;B++)if(P.context===i[B]){b.lanes|=l,P=b.alternate,P!==null&&(P.lanes|=l),Kf(b.return,l,n),d||(T=null);break e}b=P.next}}else if(g.tag===18){if(T=g.return,T===null)throw Error(r(341));T.lanes|=l,b=T.alternate,b!==null&&(b.lanes|=l),Kf(T,l,n),T=null}else T=g.child;if(T!==null)T.return=g;else for(T=g;T!==null;){if(T===n){T=null;break}if(g=T.sibling,g!==null){g.return=T.return,T=g;break}T=T.return}g=T}}function Do(n,i,l,d){n=null;for(var g=i,b=!1;g!==null;){if(!b){if((g.flags&524288)!==0)b=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var T=g.alternate;if(T===null)throw Error(r(387));if(T=T.memoizedProps,T!==null){var P=g.type;Tn(g.pendingProps.value,T.value)||(n!==null?n.push(P):n=[P])}}else if(g===Ne.current){if(T=g.alternate,T===null)throw Error(r(387));T.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(n!==null?n.push(ll):n=[ll])}g=g.return}n!==null&&Gf(i,n,l,d),i.flags|=262144}function Sc(n){for(n=n.firstContext;n!==null;){if(!Tn(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function Si(n){ji=n,qs=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function an(n){return cv(ji,n)}function Nc(n,i){return ji===null&&Si(n),cv(n,i)}function cv(n,i){var l=i._currentValue;if(i={context:i,memoizedValue:l,next:null},qs===null){if(n===null)throw Error(r(308));qs=i,n.dependencies={lanes:0,firstContext:i},n.flags|=524288}else qs=qs.next=i;return l}var ER=typeof AbortController<"u"?AbortController:function(){var n=[],i=this.signal={aborted:!1,addEventListener:function(l,d){n.push(d)}};this.abort=function(){i.aborted=!0,n.forEach(function(l){return l()})}},TR=e.unstable_scheduleCallback,AR=e.unstable_NormalPriority,Ot={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Yf(){return{controller:new ER,data:new Map,refCount:0}}function Po(n){n.refCount--,n.refCount===0&&TR(AR,function(){n.controller.abort()})}var _o=null,Qf=0,va=0,ba=null;function RR(n,i){if(_o===null){var l=_o=[];Qf=0,va=Xh(),ba={status:"pending",value:void 0,then:function(d){l.push(d)}}}return Qf++,i.then(uv,uv),i}function uv(){if(--Qf===0&&_o!==null){ba!==null&&(ba.status="fulfilled");var n=_o;_o=null,va=0,ba=null;for(var i=0;i<n.length;i++)(0,n[i])()}}function kR(n,i){var l=[],d={status:"pending",value:null,reason:null,then:function(g){l.push(g)}};return n.then(function(){d.status="fulfilled",d.value=i;for(var g=0;g<l.length;g++)(0,l[g])(i)},function(g){for(d.status="rejected",d.reason=g,g=0;g<l.length;g++)(0,l[g])(void 0)}),d}var dv=U.S;U.S=function(n,i){typeof i=="object"&&i!==null&&typeof i.then=="function"&&RR(n,i),dv!==null&&dv(n,i)};var Ni=K(null);function Wf(){var n=Ni.current;return n!==null?n:ct.pooledCache}function Cc(n,i){i===null?ee(Ni,Ni.current):ee(Ni,i.pool)}function fv(){var n=Wf();return n===null?null:{parent:Ot._currentValue,pool:n}}var Lo=Error(r(460)),hv=Error(r(474)),Ec=Error(r(542)),Xf={then:function(){}};function mv(n){return n=n.status,n==="fulfilled"||n==="rejected"}function Tc(){}function pv(n,i,l){switch(l=n[l],l===void 0?n.push(i):l!==i&&(i.then(Tc,Tc),i=l),i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,xv(n),n;default:if(typeof i.status=="string")i.then(Tc,Tc);else{if(n=ct,n!==null&&100<n.shellSuspendCounter)throw Error(r(482));n=i,n.status="pending",n.then(function(d){if(i.status==="pending"){var g=i;g.status="fulfilled",g.value=d}},function(d){if(i.status==="pending"){var g=i;g.status="rejected",g.reason=d}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,xv(n),n}throw Uo=i,Lo}}var Uo=null;function gv(){if(Uo===null)throw Error(r(459));var n=Uo;return Uo=null,n}function xv(n){if(n===Lo||n===Ec)throw Error(r(483))}var Nr=!1;function Zf(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Jf(n,i){n=n.updateQueue,i.updateQueue===n&&(i.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function Cr(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function Er(n,i,l){var d=n.updateQueue;if(d===null)return null;if(d=d.shared,(Qe&2)!==0){var g=d.pending;return g===null?i.next=i:(i.next=g.next,g.next=i),d.pending=i,i=vc(n),sv(n,null,l),i}return yc(n,d,i,l),vc(n)}function Io(n,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194048)!==0)){var d=i.lanes;d&=n.pendingLanes,l|=d,i.lanes=l,ea(n,l)}}function eh(n,i){var l=n.updateQueue,d=n.alternate;if(d!==null&&(d=d.updateQueue,l===d)){var g=null,b=null;if(l=l.firstBaseUpdate,l!==null){do{var T={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};b===null?g=b=T:b=b.next=T,l=l.next}while(l!==null);b===null?g=b=i:b=b.next=i}else g=b=i;l={baseState:d.baseState,firstBaseUpdate:g,lastBaseUpdate:b,shared:d.shared,callbacks:d.callbacks},n.updateQueue=l;return}n=l.lastBaseUpdate,n===null?l.firstBaseUpdate=i:n.next=i,l.lastBaseUpdate=i}var th=!1;function zo(){if(th){var n=ba;if(n!==null)throw n}}function Fo(n,i,l,d){th=!1;var g=n.updateQueue;Nr=!1;var b=g.firstBaseUpdate,T=g.lastBaseUpdate,P=g.shared.pending;if(P!==null){g.shared.pending=null;var B=P,Q=B.next;B.next=null,T===null?b=Q:T.next=Q,T=B;var te=n.alternate;te!==null&&(te=te.updateQueue,P=te.lastBaseUpdate,P!==T&&(P===null?te.firstBaseUpdate=Q:P.next=Q,te.lastBaseUpdate=B))}if(b!==null){var se=g.baseState;T=0,te=Q=B=null,P=b;do{var X=P.lane&-536870913,Z=X!==P.lane;if(Z?(ze&X)===X:(d&X)===X){X!==0&&X===va&&(th=!0),te!==null&&(te=te.next={lane:0,tag:P.tag,payload:P.payload,callback:null,next:null});e:{var we=n,ye=P;X=i;var et=l;switch(ye.tag){case 1:if(we=ye.payload,typeof we=="function"){se=we.call(et,se,X);break e}se=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=ye.payload,X=typeof we=="function"?we.call(et,se,X):we,X==null)break e;se=p({},se,X);break e;case 2:Nr=!0}}X=P.callback,X!==null&&(n.flags|=64,Z&&(n.flags|=8192),Z=g.callbacks,Z===null?g.callbacks=[X]:Z.push(X))}else Z={lane:X,tag:P.tag,payload:P.payload,callback:P.callback,next:null},te===null?(Q=te=Z,B=se):te=te.next=Z,T|=X;if(P=P.next,P===null){if(P=g.shared.pending,P===null)break;Z=P,P=Z.next,Z.next=null,g.lastBaseUpdate=Z,g.shared.pending=null}}while(!0);te===null&&(B=se),g.baseState=B,g.firstBaseUpdate=Q,g.lastBaseUpdate=te,b===null&&(g.shared.lanes=0),Pr|=T,n.lanes=T,n.memoizedState=se}}function yv(n,i){if(typeof n!="function")throw Error(r(191,n));n.call(i)}function vv(n,i){var l=n.callbacks;if(l!==null)for(n.callbacks=null,n=0;n<l.length;n++)yv(l[n],i)}var wa=K(null),Ac=K(0);function bv(n,i){n=Zs,ee(Ac,n),ee(wa,i),Zs=n|i.baseLanes}function nh(){ee(Ac,Zs),ee(wa,wa.current)}function sh(){Zs=Ac.current,ie(wa),ie(Ac)}var Tr=0,Te=null,Ze=null,Ct=null,Rc=!1,ja=!1,Ci=!1,kc=0,Vo=0,Sa=null,MR=0;function St(){throw Error(r(321))}function rh(n,i){if(i===null)return!1;for(var l=0;l<i.length&&l<n.length;l++)if(!Tn(n[l],i[l]))return!1;return!0}function ih(n,i,l,d,g,b){return Tr=b,Te=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,U.H=n===null||n.memoizedState===null?sb:rb,Ci=!1,b=l(d,g),Ci=!1,ja&&(b=jv(i,l,d,g)),wv(n),b}function wv(n){U.H=Lc;var i=Ze!==null&&Ze.next!==null;if(Tr=0,Ct=Ze=Te=null,Rc=!1,Vo=0,Sa=null,i)throw Error(r(300));n===null||$t||(n=n.dependencies,n!==null&&Sc(n)&&($t=!0))}function jv(n,i,l,d){Te=n;var g=0;do{if(ja&&(Sa=null),Vo=0,ja=!1,25<=g)throw Error(r(301));if(g+=1,Ct=Ze=null,n.updateQueue!=null){var b=n.updateQueue;b.lastEffect=null,b.events=null,b.stores=null,b.memoCache!=null&&(b.memoCache.index=0)}U.H=IR,b=i(l,d)}while(ja);return b}function OR(){var n=U.H,i=n.useState()[0];return i=typeof i.then=="function"?Bo(i):i,n=n.useState()[0],(Ze!==null?Ze.memoizedState:null)!==n&&(Te.flags|=1024),i}function ah(){var n=kc!==0;return kc=0,n}function oh(n,i,l){i.updateQueue=n.updateQueue,i.flags&=-2053,n.lanes&=~l}function lh(n){if(Rc){for(n=n.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}Rc=!1}Tr=0,Ct=Ze=Te=null,ja=!1,Vo=kc=0,Sa=null}function vn(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ct===null?Te.memoizedState=Ct=n:Ct=Ct.next=n,Ct}function Et(){if(Ze===null){var n=Te.alternate;n=n!==null?n.memoizedState:null}else n=Ze.next;var i=Ct===null?Te.memoizedState:Ct.next;if(i!==null)Ct=i,Ze=n;else{if(n===null)throw Te.alternate===null?Error(r(467)):Error(r(310));Ze=n,n={memoizedState:Ze.memoizedState,baseState:Ze.baseState,baseQueue:Ze.baseQueue,queue:Ze.queue,next:null},Ct===null?Te.memoizedState=Ct=n:Ct=Ct.next=n}return Ct}function ch(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Bo(n){var i=Vo;return Vo+=1,Sa===null&&(Sa=[]),n=pv(Sa,n,i),i=Te,(Ct===null?i.memoizedState:Ct.next)===null&&(i=i.alternate,U.H=i===null||i.memoizedState===null?sb:rb),n}function Mc(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return Bo(n);if(n.$$typeof===R)return an(n)}throw Error(r(438,String(n)))}function uh(n){var i=null,l=Te.updateQueue;if(l!==null&&(i=l.memoCache),i==null){var d=Te.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(i={data:d.data.map(function(g){return g.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),l===null&&(l=ch(),Te.updateQueue=l),l.memoCache=i,l=i.data[i.index],l===void 0)for(l=i.data[i.index]=Array(n),d=0;d<n;d++)l[d]=V;return i.index++,l}function Ks(n,i){return typeof i=="function"?i(n):i}function Oc(n){var i=Et();return dh(i,Ze,n)}function dh(n,i,l){var d=n.queue;if(d===null)throw Error(r(311));d.lastRenderedReducer=l;var g=n.baseQueue,b=d.pending;if(b!==null){if(g!==null){var T=g.next;g.next=b.next,b.next=T}i.baseQueue=g=b,d.pending=null}if(b=n.baseState,g===null)n.memoizedState=b;else{i=g.next;var P=T=null,B=null,Q=i,te=!1;do{var se=Q.lane&-536870913;if(se!==Q.lane?(ze&se)===se:(Tr&se)===se){var X=Q.revertLane;if(X===0)B!==null&&(B=B.next={lane:0,revertLane:0,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null}),se===va&&(te=!0);else if((Tr&X)===X){Q=Q.next,X===va&&(te=!0);continue}else se={lane:0,revertLane:Q.revertLane,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},B===null?(P=B=se,T=b):B=B.next=se,Te.lanes|=X,Pr|=X;se=Q.action,Ci&&l(b,se),b=Q.hasEagerState?Q.eagerState:l(b,se)}else X={lane:se,revertLane:Q.revertLane,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},B===null?(P=B=X,T=b):B=B.next=X,Te.lanes|=se,Pr|=se;Q=Q.next}while(Q!==null&&Q!==i);if(B===null?T=b:B.next=P,!Tn(b,n.memoizedState)&&($t=!0,te&&(l=ba,l!==null)))throw l;n.memoizedState=b,n.baseState=T,n.baseQueue=B,d.lastRenderedState=b}return g===null&&(d.lanes=0),[n.memoizedState,d.dispatch]}function fh(n){var i=Et(),l=i.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=n;var d=l.dispatch,g=l.pending,b=i.memoizedState;if(g!==null){l.pending=null;var T=g=g.next;do b=n(b,T.action),T=T.next;while(T!==g);Tn(b,i.memoizedState)||($t=!0),i.memoizedState=b,i.baseQueue===null&&(i.baseState=b),l.lastRenderedState=b}return[b,d]}function Sv(n,i,l){var d=Te,g=Et(),b=He;if(b){if(l===void 0)throw Error(r(407));l=l()}else l=i();var T=!Tn((Ze||g).memoizedState,l);T&&(g.memoizedState=l,$t=!0),g=g.queue;var P=Ev.bind(null,d,g,n);if($o(2048,8,P,[n]),g.getSnapshot!==i||T||Ct!==null&&Ct.memoizedState.tag&1){if(d.flags|=2048,Na(9,Dc(),Cv.bind(null,d,g,l,i),null),ct===null)throw Error(r(349));b||(Tr&124)!==0||Nv(d,i,l)}return l}function Nv(n,i,l){n.flags|=16384,n={getSnapshot:i,value:l},i=Te.updateQueue,i===null?(i=ch(),Te.updateQueue=i,i.stores=[n]):(l=i.stores,l===null?i.stores=[n]:l.push(n))}function Cv(n,i,l,d){i.value=l,i.getSnapshot=d,Tv(i)&&Av(n)}function Ev(n,i,l){return l(function(){Tv(i)&&Av(n)})}function Tv(n){var i=n.getSnapshot;n=n.value;try{var l=i();return!Tn(n,l)}catch{return!0}}function Av(n){var i=pa(n,2);i!==null&&Dn(i,n,2)}function hh(n){var i=vn();if(typeof n=="function"){var l=n;if(n=l(),Ci){Cn(!0);try{l()}finally{Cn(!1)}}}return i.memoizedState=i.baseState=n,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ks,lastRenderedState:n},i}function Rv(n,i,l,d){return n.baseState=l,dh(n,Ze,typeof d=="function"?d:Ks)}function DR(n,i,l,d,g){if(_c(n))throw Error(r(485));if(n=i.action,n!==null){var b={payload:g,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(T){b.listeners.push(T)}};U.T!==null?l(!0):b.isTransition=!1,d(b),l=i.pending,l===null?(b.next=i.pending=b,kv(i,b)):(b.next=l.next,i.pending=l.next=b)}}function kv(n,i){var l=i.action,d=i.payload,g=n.state;if(i.isTransition){var b=U.T,T={};U.T=T;try{var P=l(g,d),B=U.S;B!==null&&B(T,P),Mv(n,i,P)}catch(Q){mh(n,i,Q)}finally{U.T=b}}else try{b=l(g,d),Mv(n,i,b)}catch(Q){mh(n,i,Q)}}function Mv(n,i,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(d){Ov(n,i,d)},function(d){return mh(n,i,d)}):Ov(n,i,l)}function Ov(n,i,l){i.status="fulfilled",i.value=l,Dv(i),n.state=l,i=n.pending,i!==null&&(l=i.next,l===i?n.pending=null:(l=l.next,i.next=l,kv(n,l)))}function mh(n,i,l){var d=n.pending;if(n.pending=null,d!==null){d=d.next;do i.status="rejected",i.reason=l,Dv(i),i=i.next;while(i!==d)}n.action=null}function Dv(n){n=n.listeners;for(var i=0;i<n.length;i++)(0,n[i])()}function Pv(n,i){return i}function _v(n,i){if(He){var l=ct.formState;if(l!==null){e:{var d=Te;if(He){if(yt){t:{for(var g=yt,b=xs;g.nodeType!==8;){if(!b){g=null;break t}if(g=ls(g.nextSibling),g===null){g=null;break t}}b=g.data,g=b==="F!"||b==="F"?g:null}if(g){yt=ls(g.nextSibling),d=g.data==="F!";break e}}wi(d)}d=!1}d&&(i=l[0])}}return l=vn(),l.memoizedState=l.baseState=i,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pv,lastRenderedState:i},l.queue=d,l=eb.bind(null,Te,d),d.dispatch=l,d=hh(!1),b=vh.bind(null,Te,!1,d.queue),d=vn(),g={state:i,dispatch:null,action:n,pending:null},d.queue=g,l=DR.bind(null,Te,g,b,l),g.dispatch=l,d.memoizedState=n,[i,l,!1]}function Lv(n){var i=Et();return Uv(i,Ze,n)}function Uv(n,i,l){if(i=dh(n,i,Pv)[0],n=Oc(Ks)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var d=Bo(i)}catch(T){throw T===Lo?Ec:T}else d=i;i=Et();var g=i.queue,b=g.dispatch;return l!==i.memoizedState&&(Te.flags|=2048,Na(9,Dc(),PR.bind(null,g,l),null)),[d,b,n]}function PR(n,i){n.action=i}function Iv(n){var i=Et(),l=Ze;if(l!==null)return Uv(i,l,n);Et(),i=i.memoizedState,l=Et();var d=l.queue.dispatch;return l.memoizedState=n,[i,d,!1]}function Na(n,i,l,d){return n={tag:n,create:l,deps:d,inst:i,next:null},i=Te.updateQueue,i===null&&(i=ch(),Te.updateQueue=i),l=i.lastEffect,l===null?i.lastEffect=n.next=n:(d=l.next,l.next=n,n.next=d,i.lastEffect=n),n}function Dc(){return{destroy:void 0,resource:void 0}}function zv(){return Et().memoizedState}function Pc(n,i,l,d){var g=vn();d=d===void 0?null:d,Te.flags|=n,g.memoizedState=Na(1|i,Dc(),l,d)}function $o(n,i,l,d){var g=Et();d=d===void 0?null:d;var b=g.memoizedState.inst;Ze!==null&&d!==null&&rh(d,Ze.memoizedState.deps)?g.memoizedState=Na(i,b,l,d):(Te.flags|=n,g.memoizedState=Na(1|i,b,l,d))}function Fv(n,i){Pc(8390656,8,n,i)}function Vv(n,i){$o(2048,8,n,i)}function Bv(n,i){return $o(4,2,n,i)}function $v(n,i){return $o(4,4,n,i)}function qv(n,i){if(typeof i=="function"){n=n();var l=i(n);return function(){typeof l=="function"?l():i(null)}}if(i!=null)return n=n(),i.current=n,function(){i.current=null}}function Hv(n,i,l){l=l!=null?l.concat([n]):null,$o(4,4,qv.bind(null,i,n),l)}function ph(){}function Kv(n,i){var l=Et();i=i===void 0?null:i;var d=l.memoizedState;return i!==null&&rh(i,d[1])?d[0]:(l.memoizedState=[n,i],n)}function Gv(n,i){var l=Et();i=i===void 0?null:i;var d=l.memoizedState;if(i!==null&&rh(i,d[1]))return d[0];if(d=n(),Ci){Cn(!0);try{n()}finally{Cn(!1)}}return l.memoizedState=[d,i],d}function gh(n,i,l){return l===void 0||(Tr&1073741824)!==0?n.memoizedState=i:(n.memoizedState=l,n=Wb(),Te.lanes|=n,Pr|=n,l)}function Yv(n,i,l,d){return Tn(l,i)?l:wa.current!==null?(n=gh(n,l,d),Tn(n,i)||($t=!0),n):(Tr&42)===0?($t=!0,n.memoizedState=l):(n=Wb(),Te.lanes|=n,Pr|=n,i)}function Qv(n,i,l,d,g){var b=L.p;L.p=b!==0&&8>b?b:8;var T=U.T,P={};U.T=P,vh(n,!1,i,l);try{var B=g(),Q=U.S;if(Q!==null&&Q(P,B),B!==null&&typeof B=="object"&&typeof B.then=="function"){var te=kR(B,d);qo(n,i,te,On(n))}else qo(n,i,d,On(n))}catch(se){qo(n,i,{then:function(){},status:"rejected",reason:se},On())}finally{L.p=b,U.T=T}}function _R(){}function xh(n,i,l,d){if(n.tag!==5)throw Error(r(476));var g=Wv(n).queue;Qv(n,g,i,z,l===null?_R:function(){return Xv(n),l(d)})}function Wv(n){var i=n.memoizedState;if(i!==null)return i;i={memoizedState:z,baseState:z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ks,lastRenderedState:z},next:null};var l={};return i.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ks,lastRenderedState:l},next:null},n.memoizedState=i,n=n.alternate,n!==null&&(n.memoizedState=i),i}function Xv(n){var i=Wv(n).next.queue;qo(n,i,{},On())}function yh(){return an(ll)}function Zv(){return Et().memoizedState}function Jv(){return Et().memoizedState}function LR(n){for(var i=n.return;i!==null;){switch(i.tag){case 24:case 3:var l=On();n=Cr(l);var d=Er(i,n,l);d!==null&&(Dn(d,i,l),Io(d,i,l)),i={cache:Yf()},n.payload=i;return}i=i.return}}function UR(n,i,l){var d=On();l={lane:d,revertLane:0,action:l,hasEagerState:!1,eagerState:null,next:null},_c(n)?tb(i,l):(l=If(n,i,l,d),l!==null&&(Dn(l,n,d),nb(l,i,d)))}function eb(n,i,l){var d=On();qo(n,i,l,d)}function qo(n,i,l,d){var g={lane:d,revertLane:0,action:l,hasEagerState:!1,eagerState:null,next:null};if(_c(n))tb(i,g);else{var b=n.alternate;if(n.lanes===0&&(b===null||b.lanes===0)&&(b=i.lastRenderedReducer,b!==null))try{var T=i.lastRenderedState,P=b(T,l);if(g.hasEagerState=!0,g.eagerState=P,Tn(P,T))return yc(n,i,g,0),ct===null&&xc(),!1}catch{}if(l=If(n,i,g,d),l!==null)return Dn(l,n,d),nb(l,i,d),!0}return!1}function vh(n,i,l,d){if(d={lane:2,revertLane:Xh(),action:d,hasEagerState:!1,eagerState:null,next:null},_c(n)){if(i)throw Error(r(479))}else i=If(n,l,d,2),i!==null&&Dn(i,n,2)}function _c(n){var i=n.alternate;return n===Te||i!==null&&i===Te}function tb(n,i){ja=Rc=!0;var l=n.pending;l===null?i.next=i:(i.next=l.next,l.next=i),n.pending=i}function nb(n,i,l){if((l&4194048)!==0){var d=i.lanes;d&=n.pendingLanes,l|=d,i.lanes=l,ea(n,l)}}var Lc={readContext:an,use:Mc,useCallback:St,useContext:St,useEffect:St,useImperativeHandle:St,useLayoutEffect:St,useInsertionEffect:St,useMemo:St,useReducer:St,useRef:St,useState:St,useDebugValue:St,useDeferredValue:St,useTransition:St,useSyncExternalStore:St,useId:St,useHostTransitionStatus:St,useFormState:St,useActionState:St,useOptimistic:St,useMemoCache:St,useCacheRefresh:St},sb={readContext:an,use:Mc,useCallback:function(n,i){return vn().memoizedState=[n,i===void 0?null:i],n},useContext:an,useEffect:Fv,useImperativeHandle:function(n,i,l){l=l!=null?l.concat([n]):null,Pc(4194308,4,qv.bind(null,i,n),l)},useLayoutEffect:function(n,i){return Pc(4194308,4,n,i)},useInsertionEffect:function(n,i){Pc(4,2,n,i)},useMemo:function(n,i){var l=vn();i=i===void 0?null:i;var d=n();if(Ci){Cn(!0);try{n()}finally{Cn(!1)}}return l.memoizedState=[d,i],d},useReducer:function(n,i,l){var d=vn();if(l!==void 0){var g=l(i);if(Ci){Cn(!0);try{l(i)}finally{Cn(!1)}}}else g=i;return d.memoizedState=d.baseState=g,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:g},d.queue=n,n=n.dispatch=UR.bind(null,Te,n),[d.memoizedState,n]},useRef:function(n){var i=vn();return n={current:n},i.memoizedState=n},useState:function(n){n=hh(n);var i=n.queue,l=eb.bind(null,Te,i);return i.dispatch=l,[n.memoizedState,l]},useDebugValue:ph,useDeferredValue:function(n,i){var l=vn();return gh(l,n,i)},useTransition:function(){var n=hh(!1);return n=Qv.bind(null,Te,n.queue,!0,!1),vn().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,i,l){var d=Te,g=vn();if(He){if(l===void 0)throw Error(r(407));l=l()}else{if(l=i(),ct===null)throw Error(r(349));(ze&124)!==0||Nv(d,i,l)}g.memoizedState=l;var b={value:l,getSnapshot:i};return g.queue=b,Fv(Ev.bind(null,d,b,n),[n]),d.flags|=2048,Na(9,Dc(),Cv.bind(null,d,b,l,i),null),l},useId:function(){var n=vn(),i=ct.identifierPrefix;if(He){var l=$s,d=Bs;l=(d&~(1<<32-Vt(d)-1)).toString(32)+l,i="«"+i+"R"+l,l=kc++,0<l&&(i+="H"+l.toString(32)),i+="»"}else l=MR++,i="«"+i+"r"+l.toString(32)+"»";return n.memoizedState=i},useHostTransitionStatus:yh,useFormState:_v,useActionState:_v,useOptimistic:function(n){var i=vn();i.memoizedState=i.baseState=n;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=l,i=vh.bind(null,Te,!0,l),l.dispatch=i,[n,i]},useMemoCache:uh,useCacheRefresh:function(){return vn().memoizedState=LR.bind(null,Te)}},rb={readContext:an,use:Mc,useCallback:Kv,useContext:an,useEffect:Vv,useImperativeHandle:Hv,useInsertionEffect:Bv,useLayoutEffect:$v,useMemo:Gv,useReducer:Oc,useRef:zv,useState:function(){return Oc(Ks)},useDebugValue:ph,useDeferredValue:function(n,i){var l=Et();return Yv(l,Ze.memoizedState,n,i)},useTransition:function(){var n=Oc(Ks)[0],i=Et().memoizedState;return[typeof n=="boolean"?n:Bo(n),i]},useSyncExternalStore:Sv,useId:Zv,useHostTransitionStatus:yh,useFormState:Lv,useActionState:Lv,useOptimistic:function(n,i){var l=Et();return Rv(l,Ze,n,i)},useMemoCache:uh,useCacheRefresh:Jv},IR={readContext:an,use:Mc,useCallback:Kv,useContext:an,useEffect:Vv,useImperativeHandle:Hv,useInsertionEffect:Bv,useLayoutEffect:$v,useMemo:Gv,useReducer:fh,useRef:zv,useState:function(){return fh(Ks)},useDebugValue:ph,useDeferredValue:function(n,i){var l=Et();return Ze===null?gh(l,n,i):Yv(l,Ze.memoizedState,n,i)},useTransition:function(){var n=fh(Ks)[0],i=Et().memoizedState;return[typeof n=="boolean"?n:Bo(n),i]},useSyncExternalStore:Sv,useId:Zv,useHostTransitionStatus:yh,useFormState:Iv,useActionState:Iv,useOptimistic:function(n,i){var l=Et();return Ze!==null?Rv(l,Ze,n,i):(l.baseState=n,[n,l.queue.dispatch])},useMemoCache:uh,useCacheRefresh:Jv},Ca=null,Ho=0;function Uc(n){var i=Ho;return Ho+=1,Ca===null&&(Ca=[]),pv(Ca,n,i)}function Ko(n,i){i=i.props.ref,n.ref=i!==void 0?i:null}function Ic(n,i){throw i.$$typeof===x?Error(r(525)):(n=Object.prototype.toString.call(i),Error(r(31,n==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":n)))}function ib(n){var i=n._init;return i(n._payload)}function ab(n){function i(G,$){if(n){var Y=G.deletions;Y===null?(G.deletions=[$],G.flags|=16):Y.push($)}}function l(G,$){if(!n)return null;for(;$!==null;)i(G,$),$=$.sibling;return null}function d(G){for(var $=new Map;G!==null;)G.key!==null?$.set(G.key,G):$.set(G.index,G),G=G.sibling;return $}function g(G,$){return G=Vs(G,$),G.index=0,G.sibling=null,G}function b(G,$,Y){return G.index=Y,n?(Y=G.alternate,Y!==null?(Y=Y.index,Y<$?(G.flags|=67108866,$):Y):(G.flags|=67108866,$)):(G.flags|=1048576,$)}function T(G){return n&&G.alternate===null&&(G.flags|=67108866),G}function P(G,$,Y,ne){return $===null||$.tag!==6?($=Ff(Y,G.mode,ne),$.return=G,$):($=g($,Y),$.return=G,$)}function B(G,$,Y,ne){var fe=Y.type;return fe===w?te(G,$,Y.props.children,ne,Y.key):$!==null&&($.elementType===fe||typeof fe=="object"&&fe!==null&&fe.$$typeof===O&&ib(fe)===$.type)?($=g($,Y.props),Ko($,Y),$.return=G,$):($=bc(Y.type,Y.key,Y.props,null,G.mode,ne),Ko($,Y),$.return=G,$)}function Q(G,$,Y,ne){return $===null||$.tag!==4||$.stateNode.containerInfo!==Y.containerInfo||$.stateNode.implementation!==Y.implementation?($=Vf(Y,G.mode,ne),$.return=G,$):($=g($,Y.children||[]),$.return=G,$)}function te(G,$,Y,ne,fe){return $===null||$.tag!==7?($=xi(Y,G.mode,ne,fe),$.return=G,$):($=g($,Y),$.return=G,$)}function se(G,$,Y){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return $=Ff(""+$,G.mode,Y),$.return=G,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case v:return Y=bc($.type,$.key,$.props,null,G.mode,Y),Ko(Y,$),Y.return=G,Y;case j:return $=Vf($,G.mode,Y),$.return=G,$;case O:var ne=$._init;return $=ne($._payload),se(G,$,Y)}if(re($)||k($))return $=xi($,G.mode,Y,null),$.return=G,$;if(typeof $.then=="function")return se(G,Uc($),Y);if($.$$typeof===R)return se(G,Nc(G,$),Y);Ic(G,$)}return null}function X(G,$,Y,ne){var fe=$!==null?$.key:null;if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return fe!==null?null:P(G,$,""+Y,ne);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case v:return Y.key===fe?B(G,$,Y,ne):null;case j:return Y.key===fe?Q(G,$,Y,ne):null;case O:return fe=Y._init,Y=fe(Y._payload),X(G,$,Y,ne)}if(re(Y)||k(Y))return fe!==null?null:te(G,$,Y,ne,null);if(typeof Y.then=="function")return X(G,$,Uc(Y),ne);if(Y.$$typeof===R)return X(G,$,Nc(G,Y),ne);Ic(G,Y)}return null}function Z(G,$,Y,ne,fe){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return G=G.get(Y)||null,P($,G,""+ne,fe);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case v:return G=G.get(ne.key===null?Y:ne.key)||null,B($,G,ne,fe);case j:return G=G.get(ne.key===null?Y:ne.key)||null,Q($,G,ne,fe);case O:var Me=ne._init;return ne=Me(ne._payload),Z(G,$,Y,ne,fe)}if(re(ne)||k(ne))return G=G.get(Y)||null,te($,G,ne,fe,null);if(typeof ne.then=="function")return Z(G,$,Y,Uc(ne),fe);if(ne.$$typeof===R)return Z(G,$,Y,Nc($,ne),fe);Ic($,ne)}return null}function we(G,$,Y,ne){for(var fe=null,Me=null,pe=$,ve=$=0,Ht=null;pe!==null&&ve<Y.length;ve++){pe.index>ve?(Ht=pe,pe=null):Ht=pe.sibling;var Fe=X(G,pe,Y[ve],ne);if(Fe===null){pe===null&&(pe=Ht);break}n&&pe&&Fe.alternate===null&&i(G,pe),$=b(Fe,$,ve),Me===null?fe=Fe:Me.sibling=Fe,Me=Fe,pe=Ht}if(ve===Y.length)return l(G,pe),He&&vi(G,ve),fe;if(pe===null){for(;ve<Y.length;ve++)pe=se(G,Y[ve],ne),pe!==null&&($=b(pe,$,ve),Me===null?fe=pe:Me.sibling=pe,Me=pe);return He&&vi(G,ve),fe}for(pe=d(pe);ve<Y.length;ve++)Ht=Z(pe,G,ve,Y[ve],ne),Ht!==null&&(n&&Ht.alternate!==null&&pe.delete(Ht.key===null?ve:Ht.key),$=b(Ht,$,ve),Me===null?fe=Ht:Me.sibling=Ht,Me=Ht);return n&&pe.forEach(function($r){return i(G,$r)}),He&&vi(G,ve),fe}function ye(G,$,Y,ne){if(Y==null)throw Error(r(151));for(var fe=null,Me=null,pe=$,ve=$=0,Ht=null,Fe=Y.next();pe!==null&&!Fe.done;ve++,Fe=Y.next()){pe.index>ve?(Ht=pe,pe=null):Ht=pe.sibling;var $r=X(G,pe,Fe.value,ne);if($r===null){pe===null&&(pe=Ht);break}n&&pe&&$r.alternate===null&&i(G,pe),$=b($r,$,ve),Me===null?fe=$r:Me.sibling=$r,Me=$r,pe=Ht}if(Fe.done)return l(G,pe),He&&vi(G,ve),fe;if(pe===null){for(;!Fe.done;ve++,Fe=Y.next())Fe=se(G,Fe.value,ne),Fe!==null&&($=b(Fe,$,ve),Me===null?fe=Fe:Me.sibling=Fe,Me=Fe);return He&&vi(G,ve),fe}for(pe=d(pe);!Fe.done;ve++,Fe=Y.next())Fe=Z(pe,G,ve,Fe.value,ne),Fe!==null&&(n&&Fe.alternate!==null&&pe.delete(Fe.key===null?ve:Fe.key),$=b(Fe,$,ve),Me===null?fe=Fe:Me.sibling=Fe,Me=Fe);return n&&pe.forEach(function(zk){return i(G,zk)}),He&&vi(G,ve),fe}function et(G,$,Y,ne){if(typeof Y=="object"&&Y!==null&&Y.type===w&&Y.key===null&&(Y=Y.props.children),typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case v:e:{for(var fe=Y.key;$!==null;){if($.key===fe){if(fe=Y.type,fe===w){if($.tag===7){l(G,$.sibling),ne=g($,Y.props.children),ne.return=G,G=ne;break e}}else if($.elementType===fe||typeof fe=="object"&&fe!==null&&fe.$$typeof===O&&ib(fe)===$.type){l(G,$.sibling),ne=g($,Y.props),Ko(ne,Y),ne.return=G,G=ne;break e}l(G,$);break}else i(G,$);$=$.sibling}Y.type===w?(ne=xi(Y.props.children,G.mode,ne,Y.key),ne.return=G,G=ne):(ne=bc(Y.type,Y.key,Y.props,null,G.mode,ne),Ko(ne,Y),ne.return=G,G=ne)}return T(G);case j:e:{for(fe=Y.key;$!==null;){if($.key===fe)if($.tag===4&&$.stateNode.containerInfo===Y.containerInfo&&$.stateNode.implementation===Y.implementation){l(G,$.sibling),ne=g($,Y.children||[]),ne.return=G,G=ne;break e}else{l(G,$);break}else i(G,$);$=$.sibling}ne=Vf(Y,G.mode,ne),ne.return=G,G=ne}return T(G);case O:return fe=Y._init,Y=fe(Y._payload),et(G,$,Y,ne)}if(re(Y))return we(G,$,Y,ne);if(k(Y)){if(fe=k(Y),typeof fe!="function")throw Error(r(150));return Y=fe.call(Y),ye(G,$,Y,ne)}if(typeof Y.then=="function")return et(G,$,Uc(Y),ne);if(Y.$$typeof===R)return et(G,$,Nc(G,Y),ne);Ic(G,Y)}return typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint"?(Y=""+Y,$!==null&&$.tag===6?(l(G,$.sibling),ne=g($,Y),ne.return=G,G=ne):(l(G,$),ne=Ff(Y,G.mode,ne),ne.return=G,G=ne),T(G)):l(G,$)}return function(G,$,Y,ne){try{Ho=0;var fe=et(G,$,Y,ne);return Ca=null,fe}catch(pe){if(pe===Lo||pe===Ec)throw pe;var Me=An(29,pe,null,G.mode);return Me.lanes=ne,Me.return=G,Me}}}var Ea=ab(!0),ob=ab(!1),Yn=K(null),ys=null;function Ar(n){var i=n.alternate;ee(Dt,Dt.current&1),ee(Yn,n),ys===null&&(i===null||wa.current!==null||i.memoizedState!==null)&&(ys=n)}function lb(n){if(n.tag===22){if(ee(Dt,Dt.current),ee(Yn,n),ys===null){var i=n.alternate;i!==null&&i.memoizedState!==null&&(ys=n)}}else Rr()}function Rr(){ee(Dt,Dt.current),ee(Yn,Yn.current)}function Gs(n){ie(Yn),ys===n&&(ys=null),ie(Dt)}var Dt=K(0);function zc(n){for(var i=n;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||l.data==="$?"||cm(l)))return i}else if(i.tag===19&&i.memoizedProps.revealOrder!==void 0){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}function bh(n,i,l,d){i=n.memoizedState,l=l(d,i),l=l==null?i:p({},i,l),n.memoizedState=l,n.lanes===0&&(n.updateQueue.baseState=l)}var wh={enqueueSetState:function(n,i,l){n=n._reactInternals;var d=On(),g=Cr(d);g.payload=i,l!=null&&(g.callback=l),i=Er(n,g,d),i!==null&&(Dn(i,n,d),Io(i,n,d))},enqueueReplaceState:function(n,i,l){n=n._reactInternals;var d=On(),g=Cr(d);g.tag=1,g.payload=i,l!=null&&(g.callback=l),i=Er(n,g,d),i!==null&&(Dn(i,n,d),Io(i,n,d))},enqueueForceUpdate:function(n,i){n=n._reactInternals;var l=On(),d=Cr(l);d.tag=2,i!=null&&(d.callback=i),i=Er(n,d,l),i!==null&&(Dn(i,n,l),Io(i,n,l))}};function cb(n,i,l,d,g,b,T){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(d,b,T):i.prototype&&i.prototype.isPureReactComponent?!Ao(l,d)||!Ao(g,b):!0}function ub(n,i,l,d){n=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(l,d),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(l,d),i.state!==n&&wh.enqueueReplaceState(i,i.state,null)}function Ei(n,i){var l=i;if("ref"in i){l={};for(var d in i)d!=="ref"&&(l[d]=i[d])}if(n=n.defaultProps){l===i&&(l=p({},l));for(var g in n)l[g]===void 0&&(l[g]=n[g])}return l}var Fc=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)};function db(n){Fc(n)}function fb(n){console.error(n)}function hb(n){Fc(n)}function Vc(n,i){try{var l=n.onUncaughtError;l(i.value,{componentStack:i.stack})}catch(d){setTimeout(function(){throw d})}}function mb(n,i,l){try{var d=n.onCaughtError;d(l.value,{componentStack:l.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function jh(n,i,l){return l=Cr(l),l.tag=3,l.payload={element:null},l.callback=function(){Vc(n,i)},l}function pb(n){return n=Cr(n),n.tag=3,n}function gb(n,i,l,d){var g=l.type.getDerivedStateFromError;if(typeof g=="function"){var b=d.value;n.payload=function(){return g(b)},n.callback=function(){mb(i,l,d)}}var T=l.stateNode;T!==null&&typeof T.componentDidCatch=="function"&&(n.callback=function(){mb(i,l,d),typeof g!="function"&&(_r===null?_r=new Set([this]):_r.add(this));var P=d.stack;this.componentDidCatch(d.value,{componentStack:P!==null?P:""})})}function zR(n,i,l,d,g){if(l.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(i=l.alternate,i!==null&&Do(i,l,g,!0),l=Yn.current,l!==null){switch(l.tag){case 13:return ys===null?Kh():l.alternate===null&&vt===0&&(vt=3),l.flags&=-257,l.flags|=65536,l.lanes=g,d===Xf?l.flags|=16384:(i=l.updateQueue,i===null?l.updateQueue=new Set([d]):i.add(d),Yh(n,d,g)),!1;case 22:return l.flags|=65536,d===Xf?l.flags|=16384:(i=l.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([d])},l.updateQueue=i):(l=i.retryQueue,l===null?i.retryQueue=new Set([d]):l.add(d)),Yh(n,d,g)),!1}throw Error(r(435,l.tag))}return Yh(n,d,g),Kh(),!1}if(He)return i=Yn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=g,d!==qf&&(n=Error(r(422),{cause:d}),Oo(qn(n,l)))):(d!==qf&&(i=Error(r(423),{cause:d}),Oo(qn(i,l))),n=n.current.alternate,n.flags|=65536,g&=-g,n.lanes|=g,d=qn(d,l),g=jh(n.stateNode,d,g),eh(n,g),vt!==4&&(vt=2)),!1;var b=Error(r(520),{cause:d});if(b=qn(b,l),Jo===null?Jo=[b]:Jo.push(b),vt!==4&&(vt=2),i===null)return!0;d=qn(d,l),l=i;do{switch(l.tag){case 3:return l.flags|=65536,n=g&-g,l.lanes|=n,n=jh(l.stateNode,d,n),eh(l,n),!1;case 1:if(i=l.type,b=l.stateNode,(l.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(_r===null||!_r.has(b))))return l.flags|=65536,g&=-g,l.lanes|=g,g=pb(g),gb(g,n,l,d),eh(l,g),!1}l=l.return}while(l!==null);return!1}var xb=Error(r(461)),$t=!1;function Qt(n,i,l,d){i.child=n===null?ob(i,null,l,d):Ea(i,n.child,l,d)}function yb(n,i,l,d,g){l=l.render;var b=i.ref;if("ref"in d){var T={};for(var P in d)P!=="ref"&&(T[P]=d[P])}else T=d;return Si(i),d=ih(n,i,l,T,b,g),P=ah(),n!==null&&!$t?(oh(n,i,g),Ys(n,i,g)):(He&&P&&Bf(i),i.flags|=1,Qt(n,i,d,g),i.child)}function vb(n,i,l,d,g){if(n===null){var b=l.type;return typeof b=="function"&&!zf(b)&&b.defaultProps===void 0&&l.compare===null?(i.tag=15,i.type=b,bb(n,i,b,d,g)):(n=bc(l.type,null,d,i,i.mode,g),n.ref=i.ref,n.return=i,i.child=n)}if(b=n.child,!kh(n,g)){var T=b.memoizedProps;if(l=l.compare,l=l!==null?l:Ao,l(T,d)&&n.ref===i.ref)return Ys(n,i,g)}return i.flags|=1,n=Vs(b,d),n.ref=i.ref,n.return=i,i.child=n}function bb(n,i,l,d,g){if(n!==null){var b=n.memoizedProps;if(Ao(b,d)&&n.ref===i.ref)if($t=!1,i.pendingProps=d=b,kh(n,g))(n.flags&131072)!==0&&($t=!0);else return i.lanes=n.lanes,Ys(n,i,g)}return Sh(n,i,l,d,g)}function wb(n,i,l){var d=i.pendingProps,g=d.children,b=n!==null?n.memoizedState:null;if(d.mode==="hidden"){if((i.flags&128)!==0){if(d=b!==null?b.baseLanes|l:l,n!==null){for(g=i.child=n.child,b=0;g!==null;)b=b|g.lanes|g.childLanes,g=g.sibling;i.childLanes=b&~d}else i.childLanes=0,i.child=null;return jb(n,i,d,l)}if((l&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},n!==null&&Cc(i,b!==null?b.cachePool:null),b!==null?bv(i,b):nh(),lb(i);else return i.lanes=i.childLanes=536870912,jb(n,i,b!==null?b.baseLanes|l:l,l)}else b!==null?(Cc(i,b.cachePool),bv(i,b),Rr(),i.memoizedState=null):(n!==null&&Cc(i,null),nh(),Rr());return Qt(n,i,g,l),i.child}function jb(n,i,l,d){var g=Wf();return g=g===null?null:{parent:Ot._currentValue,pool:g},i.memoizedState={baseLanes:l,cachePool:g},n!==null&&Cc(i,null),nh(),lb(i),n!==null&&Do(n,i,d,!0),null}function Bc(n,i){var l=i.ref;if(l===null)n!==null&&n.ref!==null&&(i.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(r(284));(n===null||n.ref!==l)&&(i.flags|=4194816)}}function Sh(n,i,l,d,g){return Si(i),l=ih(n,i,l,d,void 0,g),d=ah(),n!==null&&!$t?(oh(n,i,g),Ys(n,i,g)):(He&&d&&Bf(i),i.flags|=1,Qt(n,i,l,g),i.child)}function Sb(n,i,l,d,g,b){return Si(i),i.updateQueue=null,l=jv(i,d,l,g),wv(n),d=ah(),n!==null&&!$t?(oh(n,i,b),Ys(n,i,b)):(He&&d&&Bf(i),i.flags|=1,Qt(n,i,l,b),i.child)}function Nb(n,i,l,d,g){if(Si(i),i.stateNode===null){var b=ga,T=l.contextType;typeof T=="object"&&T!==null&&(b=an(T)),b=new l(d,b),i.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,b.updater=wh,i.stateNode=b,b._reactInternals=i,b=i.stateNode,b.props=d,b.state=i.memoizedState,b.refs={},Zf(i),T=l.contextType,b.context=typeof T=="object"&&T!==null?an(T):ga,b.state=i.memoizedState,T=l.getDerivedStateFromProps,typeof T=="function"&&(bh(i,l,T,d),b.state=i.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(T=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),T!==b.state&&wh.enqueueReplaceState(b,b.state,null),Fo(i,d,b,g),zo(),b.state=i.memoizedState),typeof b.componentDidMount=="function"&&(i.flags|=4194308),d=!0}else if(n===null){b=i.stateNode;var P=i.memoizedProps,B=Ei(l,P);b.props=B;var Q=b.context,te=l.contextType;T=ga,typeof te=="object"&&te!==null&&(T=an(te));var se=l.getDerivedStateFromProps;te=typeof se=="function"||typeof b.getSnapshotBeforeUpdate=="function",P=i.pendingProps!==P,te||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(P||Q!==T)&&ub(i,b,d,T),Nr=!1;var X=i.memoizedState;b.state=X,Fo(i,d,b,g),zo(),Q=i.memoizedState,P||X!==Q||Nr?(typeof se=="function"&&(bh(i,l,se,d),Q=i.memoizedState),(B=Nr||cb(i,l,B,d,X,Q,T))?(te||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount()),typeof b.componentDidMount=="function"&&(i.flags|=4194308)):(typeof b.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=d,i.memoizedState=Q),b.props=d,b.state=Q,b.context=T,d=B):(typeof b.componentDidMount=="function"&&(i.flags|=4194308),d=!1)}else{b=i.stateNode,Jf(n,i),T=i.memoizedProps,te=Ei(l,T),b.props=te,se=i.pendingProps,X=b.context,Q=l.contextType,B=ga,typeof Q=="object"&&Q!==null&&(B=an(Q)),P=l.getDerivedStateFromProps,(Q=typeof P=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(T!==se||X!==B)&&ub(i,b,d,B),Nr=!1,X=i.memoizedState,b.state=X,Fo(i,d,b,g),zo();var Z=i.memoizedState;T!==se||X!==Z||Nr||n!==null&&n.dependencies!==null&&Sc(n.dependencies)?(typeof P=="function"&&(bh(i,l,P,d),Z=i.memoizedState),(te=Nr||cb(i,l,te,d,X,Z,B)||n!==null&&n.dependencies!==null&&Sc(n.dependencies))?(Q||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(d,Z,B),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(d,Z,B)),typeof b.componentDidUpdate=="function"&&(i.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof b.componentDidUpdate!="function"||T===n.memoizedProps&&X===n.memoizedState||(i.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||T===n.memoizedProps&&X===n.memoizedState||(i.flags|=1024),i.memoizedProps=d,i.memoizedState=Z),b.props=d,b.state=Z,b.context=B,d=te):(typeof b.componentDidUpdate!="function"||T===n.memoizedProps&&X===n.memoizedState||(i.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||T===n.memoizedProps&&X===n.memoizedState||(i.flags|=1024),d=!1)}return b=d,Bc(n,i),d=(i.flags&128)!==0,b||d?(b=i.stateNode,l=d&&typeof l.getDerivedStateFromError!="function"?null:b.render(),i.flags|=1,n!==null&&d?(i.child=Ea(i,n.child,null,g),i.child=Ea(i,null,l,g)):Qt(n,i,l,g),i.memoizedState=b.state,n=i.child):n=Ys(n,i,g),n}function Cb(n,i,l,d){return Mo(),i.flags|=256,Qt(n,i,l,d),i.child}var Nh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ch(n){return{baseLanes:n,cachePool:fv()}}function Eh(n,i,l){return n=n!==null?n.childLanes&~l:0,i&&(n|=Qn),n}function Eb(n,i,l){var d=i.pendingProps,g=!1,b=(i.flags&128)!==0,T;if((T=b)||(T=n!==null&&n.memoizedState===null?!1:(Dt.current&2)!==0),T&&(g=!0,i.flags&=-129),T=(i.flags&32)!==0,i.flags&=-33,n===null){if(He){if(g?Ar(i):Rr(),He){var P=yt,B;if(B=P){e:{for(B=P,P=xs;B.nodeType!==8;){if(!P){P=null;break e}if(B=ls(B.nextSibling),B===null){P=null;break e}}P=B}P!==null?(i.memoizedState={dehydrated:P,treeContext:yi!==null?{id:Bs,overflow:$s}:null,retryLane:536870912,hydrationErrors:null},B=An(18,null,null,0),B.stateNode=P,B.return=i,i.child=B,cn=i,yt=null,B=!0):B=!1}B||wi(i)}if(P=i.memoizedState,P!==null&&(P=P.dehydrated,P!==null))return cm(P)?i.lanes=32:i.lanes=536870912,null;Gs(i)}return P=d.children,d=d.fallback,g?(Rr(),g=i.mode,P=$c({mode:"hidden",children:P},g),d=xi(d,g,l,null),P.return=i,d.return=i,P.sibling=d,i.child=P,g=i.child,g.memoizedState=Ch(l),g.childLanes=Eh(n,T,l),i.memoizedState=Nh,d):(Ar(i),Th(i,P))}if(B=n.memoizedState,B!==null&&(P=B.dehydrated,P!==null)){if(b)i.flags&256?(Ar(i),i.flags&=-257,i=Ah(n,i,l)):i.memoizedState!==null?(Rr(),i.child=n.child,i.flags|=128,i=null):(Rr(),g=d.fallback,P=i.mode,d=$c({mode:"visible",children:d.children},P),g=xi(g,P,l,null),g.flags|=2,d.return=i,g.return=i,d.sibling=g,i.child=d,Ea(i,n.child,null,l),d=i.child,d.memoizedState=Ch(l),d.childLanes=Eh(n,T,l),i.memoizedState=Nh,i=g);else if(Ar(i),cm(P)){if(T=P.nextSibling&&P.nextSibling.dataset,T)var Q=T.dgst;T=Q,d=Error(r(419)),d.stack="",d.digest=T,Oo({value:d,source:null,stack:null}),i=Ah(n,i,l)}else if($t||Do(n,i,l,!1),T=(l&n.childLanes)!==0,$t||T){if(T=ct,T!==null&&(d=l&-l,d=(d&42)!==0?1:be(d),d=(d&(T.suspendedLanes|l))!==0?0:d,d!==0&&d!==B.retryLane))throw B.retryLane=d,pa(n,d),Dn(T,n,d),xb;P.data==="$?"||Kh(),i=Ah(n,i,l)}else P.data==="$?"?(i.flags|=192,i.child=n.child,i=null):(n=B.treeContext,yt=ls(P.nextSibling),cn=i,He=!0,bi=null,xs=!1,n!==null&&(Kn[Gn++]=Bs,Kn[Gn++]=$s,Kn[Gn++]=yi,Bs=n.id,$s=n.overflow,yi=i),i=Th(i,d.children),i.flags|=4096);return i}return g?(Rr(),g=d.fallback,P=i.mode,B=n.child,Q=B.sibling,d=Vs(B,{mode:"hidden",children:d.children}),d.subtreeFlags=B.subtreeFlags&65011712,Q!==null?g=Vs(Q,g):(g=xi(g,P,l,null),g.flags|=2),g.return=i,d.return=i,d.sibling=g,i.child=d,d=g,g=i.child,P=n.child.memoizedState,P===null?P=Ch(l):(B=P.cachePool,B!==null?(Q=Ot._currentValue,B=B.parent!==Q?{parent:Q,pool:Q}:B):B=fv(),P={baseLanes:P.baseLanes|l,cachePool:B}),g.memoizedState=P,g.childLanes=Eh(n,T,l),i.memoizedState=Nh,d):(Ar(i),l=n.child,n=l.sibling,l=Vs(l,{mode:"visible",children:d.children}),l.return=i,l.sibling=null,n!==null&&(T=i.deletions,T===null?(i.deletions=[n],i.flags|=16):T.push(n)),i.child=l,i.memoizedState=null,l)}function Th(n,i){return i=$c({mode:"visible",children:i},n.mode),i.return=n,n.child=i}function $c(n,i){return n=An(22,n,null,i),n.lanes=0,n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},n}function Ah(n,i,l){return Ea(i,n.child,null,l),n=Th(i,i.pendingProps.children),n.flags|=2,i.memoizedState=null,n}function Tb(n,i,l){n.lanes|=i;var d=n.alternate;d!==null&&(d.lanes|=i),Kf(n.return,i,l)}function Rh(n,i,l,d,g){var b=n.memoizedState;b===null?n.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:d,tail:l,tailMode:g}:(b.isBackwards=i,b.rendering=null,b.renderingStartTime=0,b.last=d,b.tail=l,b.tailMode=g)}function Ab(n,i,l){var d=i.pendingProps,g=d.revealOrder,b=d.tail;if(Qt(n,i,d.children,l),d=Dt.current,(d&2)!==0)d=d&1|2,i.flags|=128;else{if(n!==null&&(n.flags&128)!==0)e:for(n=i.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&Tb(n,l,i);else if(n.tag===19)Tb(n,l,i);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===i)break e;for(;n.sibling===null;){if(n.return===null||n.return===i)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}d&=1}switch(ee(Dt,d),g){case"forwards":for(l=i.child,g=null;l!==null;)n=l.alternate,n!==null&&zc(n)===null&&(g=l),l=l.sibling;l=g,l===null?(g=i.child,i.child=null):(g=l.sibling,l.sibling=null),Rh(i,!1,g,l,b);break;case"backwards":for(l=null,g=i.child,i.child=null;g!==null;){if(n=g.alternate,n!==null&&zc(n)===null){i.child=g;break}n=g.sibling,g.sibling=l,l=g,g=n}Rh(i,!0,l,null,b);break;case"together":Rh(i,!1,null,null,void 0);break;default:i.memoizedState=null}return i.child}function Ys(n,i,l){if(n!==null&&(i.dependencies=n.dependencies),Pr|=i.lanes,(l&i.childLanes)===0)if(n!==null){if(Do(n,i,l,!1),(l&i.childLanes)===0)return null}else return null;if(n!==null&&i.child!==n.child)throw Error(r(153));if(i.child!==null){for(n=i.child,l=Vs(n,n.pendingProps),i.child=l,l.return=i;n.sibling!==null;)n=n.sibling,l=l.sibling=Vs(n,n.pendingProps),l.return=i;l.sibling=null}return i.child}function kh(n,i){return(n.lanes&i)!==0?!0:(n=n.dependencies,!!(n!==null&&Sc(n)))}function FR(n,i,l){switch(i.tag){case 3:ce(i,i.stateNode.containerInfo),Sr(i,Ot,n.memoizedState.cache),Mo();break;case 27:case 5:ut(i);break;case 4:ce(i,i.stateNode.containerInfo);break;case 10:Sr(i,i.type,i.memoizedProps.value);break;case 13:var d=i.memoizedState;if(d!==null)return d.dehydrated!==null?(Ar(i),i.flags|=128,null):(l&i.child.childLanes)!==0?Eb(n,i,l):(Ar(i),n=Ys(n,i,l),n!==null?n.sibling:null);Ar(i);break;case 19:var g=(n.flags&128)!==0;if(d=(l&i.childLanes)!==0,d||(Do(n,i,l,!1),d=(l&i.childLanes)!==0),g){if(d)return Ab(n,i,l);i.flags|=128}if(g=i.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),ee(Dt,Dt.current),d)break;return null;case 22:case 23:return i.lanes=0,wb(n,i,l);case 24:Sr(i,Ot,n.memoizedState.cache)}return Ys(n,i,l)}function Rb(n,i,l){if(n!==null)if(n.memoizedProps!==i.pendingProps)$t=!0;else{if(!kh(n,l)&&(i.flags&128)===0)return $t=!1,FR(n,i,l);$t=(n.flags&131072)!==0}
vendor: 3,419 bytes, line 8
8else $t=!1,He&&(i.flags&1048576)!==0&&iv(i,jc,i.index);switch(i.lanes=0,i.tag){case 16:e:{n=i.pendingProps;var d=i.elementType,g=d._init;if(d=g(d._payload),i.type=d,typeof d=="function")zf(d)?(n=Ei(d,n),i.tag=1,i=Nb(null,i,d,n,l)):(i.tag=0,i=Sh(null,i,d,n,l));else{if(d!=null){if(g=d.$$typeof,g===D){i.tag=11,i=yb(null,i,d,n,l);break e}else if(g===F){i.tag=14,i=vb(null,i,d,n,l);break e}}throw i=J(d)||d,Error(r(306,i,""))}}return i;case 0:return Sh(n,i,i.type,i.pendingProps,l);case 1:return d=i.type,g=Ei(d,i.pendingProps),Nb(n,i,d,g,l);case 3:e:{if(ce(i,i.stateNode.containerInfo),n===null)throw Error(r(387));d=i.pendingProps;var b=i.memoizedState;g=b.element,Jf(n,i),Fo(i,d,null,l);var T=i.memoizedState;if(d=T.cache,Sr(i,Ot,d),d!==b.cache&&Gf(i,[Ot],l,!0),zo(),d=T.element,b.isDehydrated)if(b={element:d,isDehydrated:!1,cache:T.cache},i.updateQueue.baseState=b,i.memoizedState=b,i.flags&256){i=Cb(n,i,d,l);break e}else if(d!==g){g=qn(Error(r(424)),i),Oo(g),i=Cb(n,i,d,l);break e}else for(n=i.stateNode.containerInfo,n.nodeType===9?n=n.body:n=n.nodeName==="HTML"?n.ownerDocument.body:n,yt=ls(n.firstChild),cn=i,He=!0,bi=null,xs=!0,l=ob(i,null,d,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(Mo(),d===g){i=Ys(n,i,l);break e}Qt(n,i,d,l)}i=i.child}return i;case 26:return Bc(n,i),n===null?(l=Dw(i.type,null,i.pendingProps,null))?i.memoizedState=l:He||(l=i.type,n=i.pendingProps,d=su(le.current).createElement(l),d[Ie]=i,d[Ye]=n,Xt(d,l,n),Bt(d),i.stateNode=d):i.memoizedState=Dw(i.type,n.memoizedProps,i.pendingProps,n.memoizedState),null;case 27:return ut(i),n===null&&He&&(d=i.stateNode=kw(i.type,i.pendingProps,le.current),cn=i,xs=!0,g=yt,Ir(i.type)?(um=g,yt=ls(d.firstChild)):yt=g),Qt(n,i,i.pendingProps.children,l),Bc(n,i),n===null&&(i.flags|=4194304),i.child;case 5:return n===null&&He&&((g=d=yt)&&(d=mk(d,i.type,i.pendingProps,xs),d!==null?(i.stateNode=d,cn=i,yt=ls(d.firstChild),xs=!1,g=!0):g=!1),g||wi(i)),ut(i),g=i.type,b=i.pendingProps,T=n!==null?n.memoizedProps:null,d=b.children,am(g,b)?d=null:T!==null&&am(g,T)&&(i.flags|=32),i.memoizedState!==null&&(g=ih(n,i,OR,null,null,l),ll._currentValue=g),Bc(n,i),Qt(n,i,d,l),i.child;case 6:return n===null&&He&&((n=l=yt)&&(l=pk(l,i.pendingProps,xs),l!==null?(i.stateNode=l,cn=i,yt=null,n=!0):n=!1),n||wi(i)),null;case 13:return Eb(n,i,l);case 4:return ce(i,i.stateNode.containerInfo),d=i.pendingProps,n===null?i.child=Ea(i,null,d,l):Qt(n,i,d,l),i.child;case 11:return yb(n,i,i.type,i.pendingProps,l);case 7:return Qt(n,i,i.pendingProps,l),i.child;case 8:return Qt(n,i,i.pendingProps.children,l),i.child;case 12:return Qt(n,i,i.pendingProps.children,l),i.child;case 10:return d=i.pendingProps,Sr(i,i.type,d.value),Qt(n,i,d.children,l),i.child;case 9:return g=i.type._context,d=i.pendingProps.children,Si(i),g=an(g),d=d(g),i.flags|=1,Qt(n,i,d,l),i.child;case 14:return vb(n,i,i.type,i.pendingProps,l);case 15:return bb(n,i,i.type,i.pendingProps,l);case 19:return Ab(n,i,l);case 31:return d=i.pendingProps,l=i.mode,d={mode:d.mode,children:d.children},n===null?(l=$c(d,l),l.ref=i.ref,i.child=l,l.return=i,i=l):(l=Vs(n.child,d),l.ref=i.ref,i.child=l,l.return=i,i=l),i;case 22:return wb(n,i,l);case 24:return Si(i),d=an(Ot),n===null?(g=Wf(),g===null&&(g=ct,b=Yf(),g.pooledCache=b,b.refCount++,b!==null&&(g.pooledCacheLanes|=l),g=b),i.memoizedState={parent:d,cache:g},Zf(i),Sr(i,Ot,g)):((n.lanes&l)!==0&&(Jf(n,i),Fo(i,null,null,l),zo()),g=n.memoizedState,b
vendor: 16,060 bytes, line 8
8=i.memoizedState,g.parent!==d?(g={parent:d,cache:d},i.memoizedState=g,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=g),Sr(i,Ot,d)):(d=b.cache,Sr(i,Ot,d),d!==g.cache&&Gf(i,[Ot],l,!0))),Qt(n,i,i.pendingProps.children,l),i.child;case 29:throw i.pendingProps}throw Error(r(156,i.tag))}function Qs(n){n.flags|=4}function kb(n,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!Iw(i)){if(i=Yn.current,i!==null&&((ze&4194048)===ze?ys!==null:(ze&62914560)!==ze&&(ze&536870912)===0||i!==ys))throw Uo=Xf,hv;n.flags|=8192}}function qc(n,i){i!==null&&(n.flags|=4),n.flags&16384&&(i=n.tag!==22?rn():536870912,n.lanes|=i,ka|=i)}function Go(n,i){if(!He)switch(n.tailMode){case"hidden":i=n.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?n.tail=null:l.sibling=null;break;case"collapsed":l=n.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?i||n.tail===null?n.tail=null:n.tail.sibling=null:d.sibling=null}}function gt(n){var i=n.alternate!==null&&n.alternate.child===n.child,l=0,d=0;if(i)for(var g=n.child;g!==null;)l|=g.lanes|g.childLanes,d|=g.subtreeFlags&65011712,d|=g.flags&65011712,g.return=n,g=g.sibling;else for(g=n.child;g!==null;)l|=g.lanes|g.childLanes,d|=g.subtreeFlags,d|=g.flags,g.return=n,g=g.sibling;return n.subtreeFlags|=d,n.childLanes=l,i}function VR(n,i,l){var d=i.pendingProps;switch($f(i),i.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return gt(i),null;case 1:return gt(i),null;case 3:return l=i.stateNode,d=null,n!==null&&(d=n.memoizedState.cache),i.memoizedState.cache!==d&&(i.flags|=2048),Hs(Ot),xe(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(n===null||n.child===null)&&(ko(i)?Qs(i):n===null||n.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,lv())),gt(i),null;case 26:return l=i.memoizedState,n===null?(Qs(i),l!==null?(gt(i),kb(i,l)):(gt(i),i.flags&=-16777217)):l?l!==n.memoizedState?(Qs(i),gt(i),kb(i,l)):(gt(i),i.flags&=-16777217):(n.memoizedProps!==d&&Qs(i),gt(i),i.flags&=-16777217),null;case 27:nt(i),l=le.current;var g=i.type;if(n!==null&&i.stateNode!=null)n.memoizedProps!==d&&Qs(i);else{if(!d){if(i.stateNode===null)throw Error(r(166));return gt(i),null}n=ae.current,ko(i)?av(i):(n=kw(g,d,l),i.stateNode=n,Qs(i))}return gt(i),null;case 5:if(nt(i),l=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==d&&Qs(i);else{if(!d){if(i.stateNode===null)throw Error(r(166));return gt(i),null}if(n=ae.current,ko(i))av(i);else{switch(g=su(le.current),n){case 1:n=g.createElementNS("http://www.w3.org/2000/svg",l);break;case 2:n=g.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;default:switch(l){case"svg":n=g.createElementNS("http://www.w3.org/2000/svg",l);break;case"math":n=g.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;case"script":n=g.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild);break;case"select":n=typeof d.is=="string"?g.createElement("select",{is:d.is}):g.createElement("select"),d.multiple?n.multiple=!0:d.size&&(n.size=d.size);break;default:n=typeof d.is=="string"?g.createElement(l,{is:d.is}):g.createElement(l)}}n[Ie]=i,n[Ye]=d;e:for(g=i.child;g!==null;){if(g.tag===5||g.tag===6)n.appendChild(g.stateNode);else if(g.tag!==4&&g.tag!==27&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===i)break e;for(;g.sibling===null;){if(g.return===null||g.return===i)break e;g=g.return}g.sibling.return=g.return,g=g.sibling}i.stateNode=n;e:switch(Xt(n,l,d),l){case"button":case"input":case"select":case"textarea":n=!!d.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&Qs(i)}}return gt(i),i.flags&=-16777217,null;case 6:if(n&&i.stateNode!=null)n.memoizedProps!==d&&Qs(i);else{if(typeof d!="string"&&i.stateNode===null)throw Error(r(166));if(n=le.current,ko(i)){if(n=i.stateNode,l=i.memoizedProps,d=null,g=cn,g!==null)switch(g.tag){case 27:case 5:d=g.memoizedProps}n[Ie]=i,n=!!(n.nodeValue===l||d!==null&&d.suppressHydrationWarning===!0||Sw(n.nodeValue,l)),n||wi(i)}else n=su(n).createTextNode(d),n[Ie]=i,i.stateNode=n}return gt(i),null;case 13:if(d=i.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(g=ko(i),d!==null&&d.dehydrated!==null){if(n===null){if(!g)throw Error(r(318));if(g=i.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(r(317));g[Ie]=i}else Mo(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;gt(i),g=!1}else g=lv(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=g),g=!0;if(!g)return i.flags&256?(Gs(i),i):(Gs(i),null)}if(Gs(i),(i.flags&128)!==0)return i.lanes=l,i;if(l=d!==null,n=n!==null&&n.memoizedState!==null,l){d=i.child,g=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(g=d.alternate.memoizedState.cachePool.pool);var b=null;d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(b=d.memoizedState.cachePool.pool),b!==g&&(d.flags|=2048)}return l!==n&&l&&(i.child.flags|=8192),qc(i,i.updateQueue),gt(i),null;case 4:return xe(),n===null&&tm(i.stateNode.containerInfo),gt(i),null;case 10:return Hs(i.type),gt(i),null;case 19:if(ie(Dt),g=i.memoizedState,g===null)return gt(i),null;if(d=(i.flags&128)!==0,b=g.rendering,b===null)if(d)Go(g,!1);else{if(vt!==0||n!==null&&(n.flags&128)!==0)for(n=i.child;n!==null;){if(b=zc(n),b!==null){for(i.flags|=128,Go(g,!1),n=b.updateQueue,i.updateQueue=n,qc(i,n),i.subtreeFlags=0,n=l,l=i.child;l!==null;)rv(l,n),l=l.sibling;return ee(Dt,Dt.current&1|2),i.child}n=n.sibling}g.tail!==null&&Ft()>Gc&&(i.flags|=128,d=!0,Go(g,!1),i.lanes=4194304)}else{if(!d)if(n=zc(b),n!==null){if(i.flags|=128,d=!0,n=n.updateQueue,i.updateQueue=n,qc(i,n),Go(g,!0),g.tail===null&&g.tailMode==="hidden"&&!b.alternate&&!He)return gt(i),null}else 2*Ft()-g.renderingStartTime>Gc&&l!==536870912&&(i.flags|=128,d=!0,Go(g,!1),i.lanes=4194304);g.isBackwards?(b.sibling=i.child,i.child=b):(n=g.last,n!==null?n.sibling=b:i.child=b,g.last=b)}return g.tail!==null?(i=g.tail,g.rendering=i,g.tail=i.sibling,g.renderingStartTime=Ft(),i.sibling=null,n=Dt.current,ee(Dt,d?n&1|2:n&1),i):(gt(i),null);case 22:case 23:return Gs(i),sh(),d=i.memoizedState!==null,n!==null?n.memoizedState!==null!==d&&(i.flags|=8192):d&&(i.flags|=8192),d?(l&536870912)!==0&&(i.flags&128)===0&&(gt(i),i.subtreeFlags&6&&(i.flags|=8192)):gt(i),l=i.updateQueue,l!==null&&qc(i,l.retryQueue),l=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),d=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),d!==l&&(i.flags|=2048),n!==null&&ie(Ni),null;case 24:return l=null,n!==null&&(l=n.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),Hs(Ot),gt(i),null;case 25:return null;case 30:return null}throw Error(r(156,i.tag))}function BR(n,i){switch($f(i),i.tag){case 1:return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 3:return Hs(Ot),xe(),n=i.flags,(n&65536)!==0&&(n&128)===0?(i.flags=n&-65537|128,i):null;case 26:case 27:case 5:return nt(i),null;case 13:if(Gs(i),n=i.memoizedState,n!==null&&n.dehydrated!==null){if(i.alternate===null)throw Error(r(340));Mo()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 19:return ie(Dt),null;case 4:return xe(),null;case 10:return Hs(i.type),null;case 22:case 23:return Gs(i),sh(),n!==null&&ie(Ni),n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 24:return Hs(Ot),null;case 25:return null;default:return null}}function Mb(n,i){switch($f(i),i.tag){case 3:Hs(Ot),xe();break;case 26:case 27:case 5:nt(i);break;case 4:xe();break;case 13:Gs(i);break;case 19:ie(Dt);break;case 10:Hs(i.type);break;case 22:case 23:Gs(i),sh(),n!==null&&ie(Ni);break;case 24:Hs(Ot)}}function Yo(n,i){try{var l=i.updateQueue,d=l!==null?l.lastEffect:null;if(d!==null){var g=d.next;l=g;do{if((l.tag&n)===n){d=void 0;var b=l.create,T=l.inst;d=b(),T.destroy=d}l=l.next}while(l!==g)}}catch(P){it(i,i.return,P)}}function kr(n,i,l){try{var d=i.updateQueue,g=d!==null?d.lastEffect:null;if(g!==null){var b=g.next;d=b;do{if((d.tag&n)===n){var T=d.inst,P=T.destroy;if(P!==void 0){T.destroy=void 0,g=i;var B=l,Q=P;try{Q()}catch(te){it(g,B,te)}}}d=d.next}while(d!==b)}}catch(te){it(i,i.return,te)}}function Ob(n){var i=n.updateQueue;if(i!==null){var l=n.stateNode;try{vv(i,l)}catch(d){it(n,n.return,d)}}}function Db(n,i,l){l.props=Ei(n.type,n.memoizedProps),l.state=n.memoizedState;try{l.componentWillUnmount()}catch(d){it(n,i,d)}}function Qo(n,i){try{var l=n.ref;if(l!==null){switch(n.tag){case 26:case 27:case 5:var d=n.stateNode;break;case 30:d=n.stateNode;break;default:d=n.stateNode}typeof l=="function"?n.refCleanup=l(d):l.current=d}}catch(g){it(n,i,g)}}function vs(n,i){var l=n.ref,d=n.refCleanup;if(l!==null)if(typeof d=="function")try{d()}catch(g){it(n,i,g)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(g){it(n,i,g)}else l.current=null}function Pb(n){var i=n.type,l=n.memoizedProps,d=n.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":l.autoFocus&&d.focus();break e;case"img":l.src?d.src=l.src:l.srcSet&&(d.srcset=l.srcSet)}}catch(g){it(n,n.return,g)}}function Mh(n,i,l){try{var d=n.stateNode;ck(d,n.type,l,i),d[Ye]=i}catch(g){it(n,n.return,g)}}function _b(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Ir(n.type)||n.tag===4}function Oh(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||_b(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&Ir(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Dh(n,i,l){var d=n.tag;if(d===5||d===6)n=n.stateNode,i?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(n,i):(i=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,i.appendChild(n),l=l._reactRootContainer,l!=null||i.onclick!==null||(i.onclick=nu));else if(d!==4&&(d===27&&Ir(n.type)&&(l=n.stateNode,i=null),n=n.child,n!==null))for(Dh(n,i,l),n=n.sibling;n!==null;)Dh(n,i,l),n=n.sibling}function Hc(n,i,l){var d=n.tag;if(d===5||d===6)n=n.stateNode,i?l.insertBefore(n,i):l.appendChild(n);else if(d!==4&&(d===27&&Ir(n.type)&&(l=n.stateNode),n=n.child,n!==null))for(Hc(n,i,l),n=n.sibling;n!==null;)Hc(n,i,l),n=n.sibling}function Lb(n){var i=n.stateNode,l=n.memoizedProps;try{for(var d=n.type,g=i.attributes;g.length;)i.removeAttributeNode(g[0]);Xt(i,d,l),i[Ie]=n,i[Ye]=l}catch(b){it(n,n.return,b)}}var Ws=!1,Nt=!1,Ph=!1,Ub=typeof WeakSet=="function"?WeakSet:Set,qt=null;function $R(n,i){if(n=n.containerInfo,rm=cu,n=Yy(n),Of(n)){if("selectionStart"in n)var l={start:n.selectionStart,end:n.selectionEnd};else e:{l=(l=n.ownerDocument)&&l.defaultView||window;var d=l.getSelection&&l.getSelection();if(d&&d.rangeCount!==0){l=d.anchorNode;var g=d.anchorOffset,b=d.focusNode;d=d.focusOffset;try{l.nodeType,b.nodeType}catch{l=null;break e}var T=0,P=-1,B=-1,Q=0,te=0,se=n,X=null;t:for(;;){for(var Z;se!==l||g!==0&&se.nodeType!==3||(P=T+g),se!==b||d!==0&&se.nodeType!==3||(B=T+d),se.nodeType===3&&(T+=se.nodeValue.length),(Z=se.firstChild)!==null;)X=se,se=Z;for(;;){if(se===n)break t;if(X===l&&++Q===g&&(P=T),X===b&&++te===d&&(B=T),(Z=se.nextSibling)!==null)break;se=X,X=se.parentNode}se=Z}l=P===-1||B===-1?null:{start:P,end:B}}else l=null}l=l||{start:0,end:0}}else l=null;for(im={focusedElem:n,selectionRange:l},cu=!1,qt=i;qt!==null;)if(i=qt,n=i.child,(i.subtreeFlags&1024)!==0&&n!==null)n.return=i,qt=n;else for(;qt!==null;){switch(i=qt,b=i.alternate,n=i.flags,i.tag){case 0:break;case 11:case 15:break;case 1:if((n&1024)!==0&&b!==null){n=void 0,l=i,g=b.memoizedProps,b=b.memoizedState,d=l.stateNode;try{var we=Ei(l.type,g,l.elementType===l.type);n=d.getSnapshotBeforeUpdate(we,b),d.__reactInternalSnapshotBeforeUpdate=n}catch(ye){it(l,l.return,ye)}}break;case 3:if((n&1024)!==0){if(n=i.stateNode.containerInfo,l=n.nodeType,l===9)lm(n);else if(l===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":lm(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(r(163))}if(n=i.sibling,n!==null){n.return=i.return,qt=n;break}qt=i.return}}function Ib(n,i,l){var d=l.flags;switch(l.tag){case 0:case 11:case 15:Mr(n,l),d&4&&Yo(5,l);break;case 1:if(Mr(n,l),d&4)if(n=l.stateNode,i===null)try{n.componentDidMount()}catch(T){it(l,l.return,T)}else{var g=Ei(l.type,i.memoizedProps);i=i.memoizedState;try{n.componentDidUpdate(g,i,n.__reactInternalSnapshotBeforeUpdate)}catch(T){it(l,l.return,T)}}d&64&&Ob(l),d&512&&Qo(l,l.return);break;case 3:if(Mr(n,l),d&64&&(n=l.updateQueue,n!==null)){if(i=null,l.child!==null)switch(l.child.tag){case 27:case 5:i=l.child.stateNode;break;case 1:i=l.child.stateNode}try{vv(n,i)}catch(T){it(l,l.return,T)}}break;case 27:i===null&&d&4&&Lb(l);case 26:case 5:Mr(n,l),i===null&&d&4&&Pb(l),d&512&&Qo(l,l.return);break;case 12:Mr(n,l);break;case 13:Mr(n,l),d&4&&Vb(n,l),d&64&&(n=l.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(l=ZR.bind(null,l),gk(n,l))));break;case 22:if(d=l.memoizedState!==null||Ws,!d){i=i!==null&&i.memoizedState!==null||Nt,g=Ws;var b=Nt;Ws=d,(Nt=i)&&!b?Or(n,l,(l.subtreeFlags&8772)!==0):Mr(n,l),Ws=g,Nt=b}break;case 30:break;default:Mr(n,l)}}function zb(n){var i=n.alternate;i!==null&&(n.alternate=null,zb(i)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(i=n.stateNode,i!==null&&hf(i)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var ht=null,bn=!1;function Xs(n,i,l){for(l=l.child;l!==null;)Fb(n,i,l),l=l.sibling}function Fb(n,i,l){if(kt&&typeof kt.onCommitFiberUnmount=="function")try{kt.onCommitFiberUnmount(Us,l)}catch{}switch(l.tag){case 26:Nt||vs(l,i),Xs(n,i,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Nt||vs(l,i);var d=ht,g=bn;Ir(l.type)&&(ht=l.stateNode,bn=!1),Xs(n,i,l),rl(l.stateNode),ht=d,bn=g;break;case 5:Nt||vs(l,i);case 6:if(d=ht,g=bn,ht=null,Xs(n,i,l),ht=d,bn=g,ht!==null)if(bn)try{(ht.nodeType===9?ht.body:ht.nodeName==="HTML"?ht.ownerDocument.body:ht).removeChild(l.stateNode)}catch(b){it(l,i,b)}else try{ht.removeChild(l.stateNode)}catch(b){it(l,i,b)}break;case 18:ht!==null&&(bn?(n=ht,Aw(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,l.stateNode),fl(n)):Aw(ht,l.stateNode));break;case 4:d=ht,g=bn,ht=l.stateNode.containerInfo,bn=!0,Xs(n,i,l),ht=d,bn=g;break;case 0:case 11:case 14:case 15:Nt||kr(2,l,i),Nt||kr(4,l,i),Xs(n,i,l);break;case 1:Nt||(vs(l,i),d=l.stateNode,typeof d.componentWillUnmount=="function"&&Db(l,i,d)),Xs(n,i,l);break;case 21:Xs(n,i,l);break;case 22:Nt=(d=Nt)||l.memoizedState!==null,Xs(n,i,l),Nt=d;break;default:Xs(n,i,l)}}function Vb(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{fl(n)}catch(l){it(i,i.return,l)}}function qR(n){switch(n.tag){case 13:case 19:var i=n.stateNode;return i===null&&(i=n.stateNode=new Ub),i;case 22:return n=n.stateNode,i=n._retryCache,i===null&&(i=n._retryCache=new Ub),i;default:throw Error(r(435,n.tag))}}function _h(n,i){var l=qR(n);i.forEach(function(d){var g=JR.bind(null,n,d);l.has(d)||(l.add(d),d.then(g,g))})}function Rn(n,i){var l=i.deletions;if(l!==null)for(var d=0;d<l.length;d++){var g=l[d],b=n,T=i,P=T;e:for(;P!==null;){switch(P.tag){case 27:if(Ir(P.type)){ht=P.stateNode,bn=!1;break e}break;case 5:ht=P.stateNode,bn=!1;break e;case 3:case 4:ht=P.stateNode.containerInfo,bn=!0;break e}P=P.return}if(ht===null)throw Error(r(160));Fb(b,T,g),ht=null,bn=!1,b=g.alternate,b!==null&&(b.return=null),g.return=null}if(i.subtreeFlags&13878)for(i=i.child;i!==null;)Bb(i,n),i=i.sibling}var os=null;function Bb(n,i){var l=n.alternate,d=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:Rn(i,n),kn(n),d&4&&(kr(3,n,n.return),Yo(3,n),kr(5,n,n.return));break;case 1:Rn(i,n),kn(n),d&512&&(Nt||l===null||vs(l,l.return)),d&64&&Ws&&(n=n.updateQueue,n!==null&&(d=n.
vendor: 5,239 bytes, line 8
8callbacks,d!==null&&(l=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=l===null?d:l.concat(d))));break;case 26:var g=os;if(Rn(i,n),kn(n),d&512&&(Nt||l===null||vs(l,l.return)),d&4){var b=l!==null?l.memoizedState:null;if(d=n.memoizedState,l===null)if(d===null)if(n.stateNode===null){e:{d=n.type,l=n.memoizedProps,g=g.ownerDocument||g;t:switch(d){case"title":b=g.getElementsByTagName("title")[0],(!b||b[vo]||b[Ie]||b.namespaceURI==="http://www.w3.org/2000/svg"||b.hasAttribute("itemprop"))&&(b=g.createElement(d),g.head.insertBefore(b,g.querySelector("head > title"))),Xt(b,d,l),b[Ie]=n,Bt(b),d=b;break e;case"link":var T=Lw("link","href",g).get(d+(l.href||""));if(T){for(var P=0;P<T.length;P++)if(b=T[P],b.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&b.getAttribute("rel")===(l.rel==null?null:l.rel)&&b.getAttribute("title")===(l.title==null?null:l.title)&&b.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){T.splice(P,1);break t}}b=g.createElement(d),Xt(b,d,l),g.head.appendChild(b);break;case"meta":if(T=Lw("meta","content",g).get(d+(l.content||""))){for(P=0;P<T.length;P++)if(b=T[P],b.getAttribute("content")===(l.content==null?null:""+l.content)&&b.getAttribute("name")===(l.name==null?null:l.name)&&b.getAttribute("property")===(l.property==null?null:l.property)&&b.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&b.getAttribute("charset")===(l.charSet==null?null:l.charSet)){T.splice(P,1);break t}}b=g.createElement(d),Xt(b,d,l),g.head.appendChild(b);break;default:throw Error(r(468,d))}b[Ie]=n,Bt(b),d=b}n.stateNode=d}else Uw(g,n.type,n.stateNode);else n.stateNode=_w(g,d,n.memoizedProps);else b!==d?(b===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):b.count--,d===null?Uw(g,n.type,n.stateNode):_w(g,d,n.memoizedProps)):d===null&&n.stateNode!==null&&Mh(n,n.memoizedProps,l.memoizedProps)}break;case 27:Rn(i,n),kn(n),d&512&&(Nt||l===null||vs(l,l.return)),l!==null&&d&4&&Mh(n,n.memoizedProps,l.memoizedProps);break;case 5:if(Rn(i,n),kn(n),d&512&&(Nt||l===null||vs(l,l.return)),n.flags&32){g=n.stateNode;try{la(g,"")}catch(Z){it(n,n.return,Z)}}d&4&&n.stateNode!=null&&(g=n.memoizedProps,Mh(n,g,l!==null?l.memoizedProps:g)),d&1024&&(Ph=!0);break;case 6:if(Rn(i,n),kn(n),d&4){if(n.stateNode===null)throw Error(r(162));d=n.memoizedProps,l=n.stateNode;try{l.nodeValue=d}catch(Z){it(n,n.return,Z)}}break;case 3:if(au=null,g=os,os=ru(i.containerInfo),Rn(i,n),os=g,kn(n),d&4&&l!==null&&l.memoizedState.isDehydrated)try{fl(i.containerInfo)}catch(Z){it(n,n.return,Z)}Ph&&(Ph=!1,$b(n));break;case 4:d=os,os=ru(n.stateNode.containerInfo),Rn(i,n),kn(n),os=d;break;case 12:Rn(i,n),kn(n);break;case 13:Rn(i,n),kn(n),n.child.flags&8192&&n.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Vh=Ft()),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,_h(n,d)));break;case 22:g=n.memoizedState!==null;var B=l!==null&&l.memoizedState!==null,Q=Ws,te=Nt;if(Ws=Q||g,Nt=te||B,Rn(i,n),Nt=te,Ws=Q,kn(n),d&8192)e:for(i=n.stateNode,i._visibility=g?i._visibility&-2:i._visibility|1,g&&(l===null||B||Ws||Nt||Ti(n)),l=null,i=n;;){if(i.tag===5||i.tag===26){if(l===null){B=l=i;try{if(b=B.stateNode,g)T=b.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none";else{P=B.stateNode;var se=B.memoizedProps.style,X=se!=null&&se.hasOwnProperty("display")?se.display:null;P.style.display=X==null||typeof X=="boolean"?"":(""+X).trim()}}catch(Z){it(B,B.return,Z)}}}else if(i.tag===6){if(l===null){B=i;try{B.stateNode.nodeValue=g?"":B.memoizedProps}catch(Z){it(B,B.return,Z)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===n)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break e;for(;i.sibling===null;){if(i.return===null||i.return===n)break e;l===i&&(l=null),i=i.return}l===i&&(l=null),i.sibling.return=i.return,i=i.sibling}d&4&&(d=n.updateQueue,d!==null&&(l=d.retryQueue,l!==null&&(d.retryQueue=null,_h(n,l))));break;case 19:Rn(i,n),kn(n),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,_h(n,d)));break;case 30:break;case 21:break;default:Rn(i,n),kn(n)}}function kn(n){var i=n.flags;if(i&2){try{for(var l,d=n.return;d!==null;){if(_b(d)){l=d;break}d=d.return}if(l==null)throw Error(r(160));switch(l.tag){case 27:var g=l.stateNode,b=Oh(n);Hc(n,b,g);break;case 5:var T=l.stateNode;l.flags&32&&(la(T,""),l.flags&=-33);var P=Oh(n);Hc(n,P,T);break;case 3:case 4:var B=l.stateNode.containerInfo,Q=Oh(n);Dh(n,Q,B);break;default:throw Error(r(161))}}catch(te){it(n,n.return,te)}n.flags&=-3}i&4096&&(n.flags&=-4097)}function $b(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var i=n;$b(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),n=n.sibling}}function Mr(n,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Ib(n,i.alternate,i),i=i.sibling}function Ti(n){for(n=n.child;n!==null;){var i=n;switch(i.tag){case 0:case 11:case 14:case 15:kr(4,i,i.return),Ti(i);break;case 1:vs(i,i.return);var l=i.stateNode;typeof l.componentWillUnmount=="function"&&Db(i,i.return,l),Ti(i);break;case 27:rl(i.stateNode);case 26:case 5:vs(i,i.return),Ti(i);break;case 22:i.memoizedState===null&&Ti(i);break;case 30:Ti(i);break;default:Ti(i)}n=n.sibling}}function Or(n,i,l){for(l=l&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;
vendor: 21,292 bytes, line 8
8){var d=i.alternate,g=n,b=i,T=b.flags;switch(b.tag){case 0:case 11:case 15:Or(g,b,l),Yo(4,b);break;case 1:if(Or(g,b,l),d=b,g=d.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(Q){it(d,d.return,Q)}if(d=b,g=d.updateQueue,g!==null){var P=d.stateNode;try{var B=g.shared.hiddenCallbacks;if(B!==null)for(g.shared.hiddenCallbacks=null,g=0;g<B.length;g++)yv(B[g],P)}catch(Q){it(d,d.return,Q)}}l&&T&64&&Ob(b),Qo(b,b.return);break;case 27:Lb(b);case 26:case 5:Or(g,b,l),l&&d===null&&T&4&&Pb(b),Qo(b,b.return);break;case 12:Or(g,b,l);break;case 13:Or(g,b,l),l&&T&4&&Vb(g,b);break;case 22:b.memoizedState===null&&Or(g,b,l),Qo(b,b.return);break;case 30:break;default:Or(g,b,l)}i=i.sibling}}function Lh(n,i){var l=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),n=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(n=i.memoizedState.cachePool.pool),n!==l&&(n!=null&&n.refCount++,l!=null&&Po(l))}function Uh(n,i){n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&Po(n))}function bs(n,i,l,d){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)qb(n,i,l,d),i=i.sibling}function qb(n,i,l,d){var g=i.flags;switch(i.tag){case 0:case 11:case 15:bs(n,i,l,d),g&2048&&Yo(9,i);break;case 1:bs(n,i,l,d);break;case 3:bs(n,i,l,d),g&2048&&(n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&Po(n)));break;case 12:if(g&2048){bs(n,i,l,d),n=i.stateNode;try{var b=i.memoizedProps,T=b.id,P=b.onPostCommit;typeof P=="function"&&P(T,i.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(B){it(i,i.return,B)}}else bs(n,i,l,d);break;case 13:bs(n,i,l,d);break;case 23:break;case 22:b=i.stateNode,T=i.alternate,i.memoizedState!==null?b._visibility&2?bs(n,i,l,d):Wo(n,i):b._visibility&2?bs(n,i,l,d):(b._visibility|=2,Ta(n,i,l,d,(i.subtreeFlags&10256)!==0)),g&2048&&Lh(T,i);break;case 24:bs(n,i,l,d),g&2048&&Uh(i.alternate,i);break;default:bs(n,i,l,d)}}function Ta(n,i,l,d,g){for(g=g&&(i.subtreeFlags&10256)!==0,i=i.child;i!==null;){var b=n,T=i,P=l,B=d,Q=T.flags;switch(T.tag){case 0:case 11:case 15:Ta(b,T,P,B,g),Yo(8,T);break;case 23:break;case 22:var te=T.stateNode;T.memoizedState!==null?te._visibility&2?Ta(b,T,P,B,g):Wo(b,T):(te._visibility|=2,Ta(b,T,P,B,g)),g&&Q&2048&&Lh(T.alternate,T);break;case 24:Ta(b,T,P,B,g),g&&Q&2048&&Uh(T.alternate,T);break;default:Ta(b,T,P,B,g)}i=i.sibling}}function Wo(n,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var l=n,d=i,g=d.flags;switch(d.tag){case 22:Wo(l,d),g&2048&&Lh(d.alternate,d);break;case 24:Wo(l,d),g&2048&&Uh(d.alternate,d);break;default:Wo(l,d)}i=i.sibling}}var Xo=8192;function Aa(n){if(n.subtreeFlags&Xo)for(n=n.child;n!==null;)Hb(n),n=n.sibling}function Hb(n){switch(n.tag){case 26:Aa(n),n.flags&Xo&&n.memoizedState!==null&&Rk(os,n.memoizedState,n.memoizedProps);break;case 5:Aa(n);break;case 3:case 4:var i=os;os=ru(n.stateNode.containerInfo),Aa(n),os=i;break;case 22:n.memoizedState===null&&(i=n.alternate,i!==null&&i.memoizedState!==null?(i=Xo,Xo=16777216,Aa(n),Xo=i):Aa(n));break;default:Aa(n)}}function Kb(n){var i=n.alternate;if(i!==null&&(n=i.child,n!==null)){i.child=null;do i=n.sibling,n.sibling=null,n=i;while(n!==null)}}function Zo(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var d=i[l];qt=d,Yb(d,n)}Kb(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Gb(n),n=n.sibling}function Gb(n){switch(n.tag){case 0:case 11:case 15:Zo(n),n.flags&2048&&kr(9,n,n.return);break;case 3:Zo(n);break;case 12:Zo(n);break;case 22:var i=n.stateNode;n.memoizedState!==null&&i._visibility&2&&(n.return===null||n.return.tag!==13)?(i._visibility&=-3,Kc(n)):Zo(n);break;default:Zo(n)}}function Kc(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var d=i[l];qt=d,Yb(d,n)}Kb(n)}for(n=n.child;n!==null;){switch(i=n,i.tag){case 0:case 11:case 15:kr(8,i,i.return),Kc(i);break;case 22:l=i.stateNode,l._visibility&2&&(l._visibility&=-3,Kc(i));break;default:Kc(i)}n=n.sibling}}function Yb(n,i){for(;qt!==null;){var l=qt;switch(l.tag){case 0:case 11:case 15:kr(8,l,i);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var d=l.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:Po(l.memoizedState.cache)}if(d=l.child,d!==null)d.return=l,qt=d;else e:for(l=n;qt!==null;){d=qt;var g=d.sibling,b=d.return;if(zb(d),d===l){qt=null;break e}if(g!==null){g.return=b,qt=g;break e}qt=b}}}var HR={getCacheForType:function(n){var i=an(Ot),l=i.data.get(n);return l===void 0&&(l=n(),i.data.set(n,l)),l}},KR=typeof WeakMap=="function"?WeakMap:Map,Qe=0,ct=null,Pe=null,ze=0,We=0,Mn=null,Dr=!1,Ra=!1,Ih=!1,Zs=0,vt=0,Pr=0,Ai=0,zh=0,Qn=0,ka=0,Jo=null,wn=null,Fh=!1,Vh=0,Gc=1/0,Yc=null,_r=null,Wt=0,Lr=null,Ma=null,Oa=0,Bh=0,$h=null,Qb=null,el=0,qh=null;function On(){if((Qe&2)!==0&&ze!==0)return ze&-ze;if(U.T!==null){var n=va;return n!==0?n:Xh()}return me()}function Wb(){Qn===0&&(Qn=(ze&536870912)===0||He?Yt():536870912);var n=Yn.current;return n!==null&&(n.flags|=32),Qn}function Dn(n,i,l){(n===ct&&(We===2||We===9)||n.cancelPendingCommit!==null)&&(Da(n,0),Ur(n,ze,Qn,!1)),xn(n,l),((Qe&2)===0||n!==ct)&&(n===ct&&((Qe&2)===0&&(Ai|=l),vt===4&&Ur(n,ze,Qn,!1)),ws(n))}function Xb(n,i,l){if((Qe&6)!==0)throw Error(r(327));var d=!l&&(i&124)===0&&(i&n.expiredLanes)===0||Mt(n,i),g=d?QR(n,i):Gh(n,i,!0),b=d;do{if(g===0){Ra&&!d&&Ur(n,i,0,!1);break}else{if(l=n.current.alternate,b&&!GR(l)){g=Gh(n,i,!1),b=!1;continue}if(g===2){if(b=i,n.errorRecoveryDisabledLanes&b)var T=0;else T=n.pendingLanes&-536870913,T=T!==0?T:T&536870912?536870912:0;if(T!==0){i=T;e:{var P=n;g=Jo;var B=P.current.memoizedState.isDehydrated;if(B&&(Da(P,T).flags|=256),T=Gh(P,T,!1),T!==2){if(Ih&&!B){P.errorRecoveryDisabledLanes|=b,Ai|=b,g=4;break e}b=wn,wn=g,b!==null&&(wn===null?wn=b:wn.push.apply(wn,b))}g=T}if(b=!1,g!==2)continue}}if(g===1){Da(n,0),Ur(n,i,0,!0);break}e:{switch(d=n,b=g,b){case 0:case 1:throw Error(r(345));case 4:if((i&4194048)!==i)break;case 6:Ur(d,i,Qn,!Dr);break e;case 2:wn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((i&62914560)===i&&(g=Vh+300-Ft(),10<g)){if(Ur(d,i,Qn,!Dr),st(d,0,!0)!==0)break e;d.timeoutHandle=Ew(Zb.bind(null,d,l,wn,Yc,Fh,i,Qn,Ai,ka,Dr,b,2,-0,0),g);break e}Zb(d,l,wn,Yc,Fh,i,Qn,Ai,ka,Dr,b,0,-0,0)}}break}while(!0);ws(n)}function Zb(n,i,l,d,g,b,T,P,B,Q,te,se,X,Z){if(n.timeoutHandle=-1,se=i.subtreeFlags,(se&8192||(se&16785408)===16785408)&&(ol={stylesheets:null,count:0,unsuspend:Ak},Hb(i),se=kk(),se!==null)){n.cancelPendingCommit=se(iw.bind(null,n,i,b,l,d,g,T,P,B,te,1,X,Z)),Ur(n,b,T,!Q);return}iw(n,i,b,l,d,g,T,P,B)}function GR(n){for(var i=n;;){var l=i.tag;if((l===0||l===11||l===15)&&i.flags&16384&&(l=i.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var d=0;d<l.length;d++){var g=l[d],b=g.getSnapshot;g=g.value;try{if(!Tn(b(),g))return!1}catch{return!1}}if(l=i.child,i.subtreeFlags&16384&&l!==null)l.return=i,i=l;else{if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function Ur(n,i,l,d){i&=~zh,i&=~Ai,n.suspendedLanes|=i,n.pingedLanes&=~i,d&&(n.warmLanes|=i),d=n.expirationTimes;for(var g=i;0<g;){var b=31-Vt(g),T=1<<b;d[b]=-1,g&=~T}l!==0&&yo(n,l,i)}function Qc(){return(Qe&6)===0?(tl(0),!1):!0}function Hh(){if(Pe!==null){if(We===0)var n=Pe.return;else n=Pe,qs=ji=null,lh(n),Ca=null,Ho=0,n=Pe;for(;n!==null;)Mb(n.alternate,n),n=n.return;Pe=null}}function Da(n,i){var l=n.timeoutHandle;l!==-1&&(n.timeoutHandle=-1,dk(l)),l=n.cancelPendingCommit,l!==null&&(n.cancelPendingCommit=null,l()),Hh(),ct=n,Pe=l=Vs(n.current,null),ze=i,We=0,Mn=null,Dr=!1,Ra=Mt(n,i),Ih=!1,ka=Qn=zh=Ai=Pr=vt=0,wn=Jo=null,Fh=!1,(i&8)!==0&&(i|=i&32);var d=n.entangledLanes;if(d!==0)for(n=n.entanglements,d&=i;0<d;){var g=31-Vt(d),b=1<<g;i|=n[g],d&=~b}return Zs=i,xc(),l}function Jb(n,i){Te=null,U.H=Lc,i===Lo||i===Ec?(i=gv(),We=3):i===hv?(i=gv(),We=4):We=i===xb?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Mn=i,Pe===null&&(vt=1,Vc(n,qn(i,n.current)))}function ew(){var n=U.H;return U.H=Lc,n===null?Lc:n}function tw(){var n=U.A;return U.A=HR,n}function Kh(){vt=4,Dr||(ze&4194048)!==ze&&Yn.current!==null||(Ra=!0),(Pr&134217727)===0&&(Ai&134217727)===0||ct===null||Ur(ct,ze,Qn,!1)}function Gh(n,i,l){var d=Qe;Qe|=2;var g=ew(),b=tw();(ct!==n||ze!==i)&&(Yc=null,Da(n,i)),i=!1;var T=vt;e:do try{if(We!==0&&Pe!==null){var P=Pe,B=Mn;switch(We){case 8:Hh(),T=6;break e;case 3:case 2:case 9:case 6:Yn.current===null&&(i=!0);var Q=We;if(We=0,Mn=null,Pa(n,P,B,Q),l&&Ra){T=0;break e}break;default:Q=We,We=0,Mn=null,Pa(n,P,B,Q)}}YR(),T=vt;break}catch(te){Jb(n,te)}while(!0);return i&&n.shellSuspendCounter++,qs=ji=null,Qe=d,U.H=g,U.A=b,Pe===null&&(ct=null,ze=0,xc()),T}function YR(){for(;Pe!==null;)nw(Pe)}function QR(n,i){var l=Qe;Qe|=2;var d=ew(),g=tw();ct!==n||ze!==i?(Yc=null,Gc=Ft()+500,Da(n,i)):Ra=Mt(n,i);e:do try{if(We!==0&&Pe!==null){i=Pe;var b=Mn;t:switch(We){case 1:We=0,Mn=null,Pa(n,i,b,1);break;case 2:case 9:if(mv(b)){We=0,Mn=null,sw(i);break}i=function(){We!==2&&We!==9||ct!==n||(We=7),ws(n)},b.then(i,i);break e;case 3:We=7;break e;case 4:We=5;break e;case 7:mv(b)?(We=0,Mn=null,sw(i)):(We=0,Mn=null,Pa(n,i,b,7));break;case 5:var T=null;switch(Pe.tag){case 26:T=Pe.memoizedState;case 5:case 27:var P=Pe;if(!T||Iw(T)){We=0,Mn=null;var B=P.sibling;if(B!==null)Pe=B;else{var Q=P.return;Q!==null?(Pe=Q,Wc(Q)):Pe=null}break t}}We=0,Mn=null,Pa(n,i,b,5);break;case 6:We=0,Mn=null,Pa(n,i,b,6);break;case 8:Hh(),vt=6;break e;default:throw Error(r(462))}}WR();break}catch(te){Jb(n,te)}while(!0);return qs=ji=null,U.H=d,U.A=g,Qe=l,Pe!==null?0:(ct=null,ze=0,xc(),vt)}function WR(){for(;Pe!==null&&!jt();)nw(Pe)}function nw(n){var i=Rb(n.alternate,n,Zs);n.memoizedProps=n.pendingProps,i===null?Wc(n):Pe=i}function sw(n){var i=n,l=i.alternate;switch(i.tag){case 15:case 0:i=Sb(l,i,i.pendingProps,i.type,void 0,ze);break;case 11:i=Sb(l,i,i.pendingProps,i.type.render,i.ref,ze);break;case 5:lh(i);default:Mb(l,i),i=Pe=rv(i,Zs),i=Rb(l,i,Zs)}n.memoizedProps=n.pendingProps,i===null?Wc(n):Pe=i}function Pa(n,i,l,d){qs=ji=null,lh(i),Ca=null,Ho=0;var g=i.return;try{if(zR(n,g,i,l,ze)){vt=1,Vc(n,qn(l,n.current)),Pe=null;return}}catch(b){if(g!==null)throw Pe=g,b;vt=1,Vc(n,qn(l,n.current)),Pe=null;return}i.flags&32768?(He||d===1?n=!0:Ra||(ze&536870912)!==0?n=!1:(Dr=n=!0,(d===2||d===9||d===3||d===6)&&(d=Yn.current,d!==null&&d.tag===13&&(d.flags|=16384))),rw(i,n)):Wc(i)}function Wc(n){var i=n;do{if((i.flags&32768)!==0){rw(i,Dr);return}n=i.return;var l=VR(i.alternate,i,Zs);if(l!==null){Pe=l;return}if(i=i.sibling,i!==null){Pe=i;return}Pe=i=n}while(i!==null);vt===0&&(vt=5)}function rw(n,i){do{var l=BR(n.alternate,n);if(l!==null){l.flags&=32767,Pe=l;return}if(l=n.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!i&&(n=n.sibling,n!==null)){Pe=n;return}Pe=n=l}while(n!==null);vt=6,Pe=null}function iw(n,i,l,d,g,b,T,P,B){n.cancelPendingCommit=null;do Xc();while(Wt!==0);if((Qe&6)!==0)throw Error(r(327));if(i!==null){if(i===n.current)throw Error(r(177));if(b=i.lanes|i.childLanes,b|=Uf,fi(n,l,b,T,P,B),n===ct&&(Pe=ct=null,ze=0),Ma=i,Lr=n,Oa=l,Bh=b,$h=g,Qb=d,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,ek(Vn,function(){return uw(),null})):(n.callbackNode=null,n.callbackPriority=0),d=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||d){d=U.T,U.T=null,g=L.p,L.p=2,T=Qe,Qe|=4;try{$R(n,i,l)}finally{Qe=T,L.p=g,U.T=d}}Wt=1,aw(),ow(),lw()}}function aw(){if(Wt===1){Wt=0;var n=Lr,i=Ma,l=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||l){l=U.T,U.T=null;var d=L.p;L.p=2;var g=Qe;Qe|=4;try{Bb(i,n);var b=im,T=Yy(n.containerInfo),P=b.focusedElem,B=b.selectionRange;if(T!==P&&P&&P.ownerDocument&&Gy(P.ownerDocument.documentElement,P)){if(B!==null&&Of(P)){var Q=B.start,te=B.end;if(te===void 0&&(te=Q),"selectionStart"in P)P.selectionStart=Q,P.selectionEnd=Math.min(te,P.value.length);else{var se=P.ownerDocument||document,X=se&&se.defaultView||window;if(X.getSelection){var Z=X.getSelection(),we=P.textContent.length,ye=Math.min(B.start,we),et=B.end===void 0?ye:Math.min(B.end,we);!Z.extend&&ye>et&&(T=et,et=ye,ye=T);var G=Ky(P,ye),$=Ky(P,et);if(G&&$&&(Z.rangeCount!==1||Z.anchorNode!==G.node||Z.anchorOffset!==G.offset||Z.focusNode!==$.node||Z.focusOffset!==$.offset)){var Y=se.createRange();Y.setStart(G.node,G.offset),Z.removeAllRanges(),ye>et?(Z.addRange(Y),Z.extend($.node,$.offset)):(Y.setEnd($.node,$.offset),Z.addRange(Y))}}}}for(se=[],Z=P;Z=Z.parentNode;)Z.nodeType===1&&se.push({element:Z,left:Z.scrollLeft,top:Z.scrollTop});for(typeof P.focus=="function"&&P.focus(),P=0;P<se.length;P++){var ne=se[P];ne.element.scrollLeft=ne.left,ne.element.scrollTop=ne.top}}cu=!!rm,im=rm=null}finally{Qe=g,L.p=d,U.T=l}}n.current=i,Wt=2}}function ow(){if(Wt===2){Wt=0;var n=Lr,i=Ma,l=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||l){l=U.T,U.T=null;var d=L.p;L.p=2;var g=Qe;Qe|=4;try{Ib(n,i.alternate,i)}finally{Qe=g,L.p=d,U.T=l}}Wt=3}}function lw(){if(Wt===4||Wt===3){Wt=0,ui();var n=Lr,i=Ma,l=Oa,d=Qb;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Wt=5:(Wt=0,Ma=Lr=null,cw(n,n.pendingLanes));var g=n.pendingLanes;if(g===0&&(_r=null),je(l),i=i.stateNode,kt&&typeof kt.onCommitFiberRoot=="function")try{kt.onCommitFiberRoot(Us,i,void 0,(i.current.flags&128)===128)}catch{}if(d!==null){i=U.T,g=L.p,L.p=2,U.T=null;try{for(var b=n.onRecoverableError,T=0;T<d.length;T++){var P=d[T];b(P.value,{componentStack:P.stack})}}finally{U.T=i,L.p=g}}(Oa&3)!==0&&Xc(),ws(n),g=n.pendingLanes,(l&4194090)!==0&&(g&42)!==0?n===qh?el++:(el=0,qh=n):el=0,tl(0)}}function cw(n,i){(n.pooledCacheLanes&=i)===0&&(i=n.pooledCache,i!=null&&(n.pooledCache=null,Po(i)))}function Xc(n){return aw(),ow(),lw(),uw()}function uw(){if(Wt!==5)return!1;var n=Lr,i=Bh;Bh=0;var l=je(Oa),d=U.T,g=L.p;try{L.p=32>l?32:l,U.T=null,l=$h,$h=null;var b=Lr,T=Oa;if(Wt=0,Ma=Lr=null,Oa=0,(Qe&6)!==0)throw Error(r(331));var P=Qe;if(Qe|=4,Gb(b.current),qb(b,b.current,T,l),Qe=P,tl(0,!1),kt&&typeof kt.onPostCommitFiberRoot=="function")try{kt.onPostCommitFiberRoot(Us,b)}catch{}return!0}finally{L.p=g,U.T=d,cw(n,i)}}function dw(n,i,l){i=qn(l,i),i=jh(n.stateNode,i,2),n=Er(n,i,2),n!==null&&(xn(n,2),ws(n))}function it(n,i,l){if(n.tag===3)dw(n,n,l);else for(;i!==null;){if(i.tag===3){dw(i,n,l);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(_r===null||!_r.has(d))){n=qn(l,n),l=pb(2),d=Er(i,l,2),d!==null&&(gb(l,d,i,n),xn(d,2),ws(d));break}}i=i.return}}function Yh(n,i,l){var d=n.pingCache;if(d===null){d=n.pingCache=new KR;var g=new Set;d.set(i,g)}else g=d.get(i),g===void 0&&(g=new Set,d.set(i,g));g.has(l)||(Ih=!0,g.add(l),n=XR.bind(null,n,i,l),i.then(n,n))}function XR(n,i,l){var d=n.pingCache;d!==null&&d.delete(i),n.pingedLanes|=n.suspendedLanes&l,n.warmLanes&=~l,ct===n&&(ze&l)===l&&(vt===4||vt===3&&(ze&62914560)===ze&&300>Ft()-Vh?(Qe&2)===0&&Da(n,0):zh|=l,ka===ze&&(ka=0)),ws(n)}function fw(n,i){i===0&&(i=rn()),n=pa(n,i),n!==null&&(xn(n,i),ws(n))}function ZR(n){var i=n.memoizedState,l=0;i!==null&&(l=i.retryLane),fw(n,l)}function JR(n,i){var l=0;switch(n.tag){case 13:var d=n.stateNode,g=n.memoizedState;g!==null&&(l=g.retryLane);break;case 19:d=n.stateNode;break;case 22:d=n.stateNode._retryCache;break;default:throw Error(r(314))}d!==null&&d.delete(i),fw(n,l)}function ek(n,i){return nn(n,i)}var Zc=null,_a=null,Qh=!1,Jc=!1,Wh=!1,Ri=0;function ws(n){n!==_a&&n.next===null&&(_a===null?Zc=_a=n:_a=_a.next=n),Jc=!0,Qh||(Qh=!0,nk())}function tl(n,i){if(!Wh&&Jc){Wh=!0;do for(var l=!1,d=Zc;d!==null;){if(n!==0){var g=d.pendingLanes;if(g===0)var b=0;else{var T=d.suspendedLanes,P=d.pingedLanes;b=(1<<31-Vt(42|n)+1)-1,b&=g&~(T&~P),b=b&201326741?b&201326741|1:b?b|2:0}b!==0&&(l=!0,gw(d,b))}else b=ze,b=st(d,d===ct?b:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(b&3)===0||Mt(d,b)||(l=!0,gw(d,b));d=d.next}while(l);Wh=!1}}function tk(){hw()}function hw(){Jc=Qh=!1;var n=0;Ri!==0&&(uk()&&(n=Ri),Ri=0);for(var i=Ft(),l=null,d=Zc;d!==null;){var g=d.next,b=mw(d,i);b===0?(d.next=null,l===null?Zc=g:l.next=g,g===null&&(_a=l)):(l=d,(n!==0||(b&3)!==0)&&(Jc=!0)),d=g}tl(n)}function mw(n,i){for(var l=n.suspendedLanes,d=n.pingedLanes,g=n.expirationTimes,b=n.pendingLanes&-62914561;0<b;){var T=31-Vt(b),P=1<<T,B=g[T];B===-1?((P&l)===0||(P&d)!==0)&&(g[T]=sn(P,i)):B<=i&&(n.expiredLanes|=P),b&=~P}if(i=ct,l=ze,l=st(n,n===i?l:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),d=n.callbackNode,l===0||n===i&&(We===2||We===9)||n.cancelPendingCommit!==null)return d!==null&&d!==null&&Rt(d),n.callbackNode=null,n.callbackPriority=0;if((l&3)===0||Mt(n,l)){if(i=l&-l,i===n.callbackPriority)return i;switch(d!==null&&Rt(d),je(l)){case 2:case 8:l=Ji;break;case 32:l=Vn;break;case 268435456:l=Nn;break;default:l=Vn}return d=pw.bind(null,n),l=nn(l,d),n.callbackPriority=i,n.callbackNode=l,i}return d!==null&&d!==null&&Rt(d),n.callbackPriority=2,n.callbackNode=null,2}function pw(n,i){if(Wt!==0&&Wt!==5)return n.callbackNode=null,n.callbackPriority=0,null;var l=n.callbackNode;if(Xc()&&n.callbackNode!==l)return null;var d=ze;return d=st(n,n===ct?d:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),d===0?null:(Xb(n,d,i),mw(n,Ft()),n.callbackNode!=null&&n.callbackNode===l?pw.bind(null,n):null)}function gw(n,i){if(Xc())return null;Xb(n,i,!0)}function nk(){fk(function(){(Qe&6)!==0?nn(Gt,tk):hw()})}function Xh(){return Ri===0&&(Ri=Yt()),Ri}function xw(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:uc(""+n)}function yw(n,i){var l=i.ownerDocument.createElement("input");return l.name=i.name,l.value=i.value,n.id&&l.setAttribute("form",n.id),i.parentNode.insertBefore(l,i),n=new FormData(n),l.parentNode.removeChild(l),n}function sk(n,i,l,d,g){if(i==="submit"&&l&&l.stateNode===g){var b=xw((g[Ye]||null).action),T=d.submitter;T&&(i=(i=T[Ye]||null)?xw(i.formAction):T.getAttribute("formAction"),i!==null&&(b=i,T=null));var P=new mc("action","action",null,d,g);n.push({event:P,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(Ri!==0){var B=T?yw(g,T):new FormData(g);xh(l,{pending:!0,data:B,method:g.method,action:b},null,B)}}else typeof b=="function"&&(P.preventDefault(),B=T?yw(g,T):new FormData(g),xh(l,{pending:!0,data:B,method:g.method,action:b},b,B))},currentTarget:g}]})}}for(var Zh=0;Zh<Lf.length;Zh++){var Jh=Lf[Zh],rk=Jh.toLowerCase(),ik=Jh[0].toUpperCase()+Jh.slice(1);as(rk,"on"+ik)}as(Xy,"onAnimationEnd"),as(Zy,"onAnimationIteration"),as(Jy,"onAnimationStart"),as("dblclick","onDoubleClick"),as("focusin","onFocus"),as("focusout","onBlur"),as(jR,"onTransitionRun"),as(SR,"onTransitionStart"),as(NR,"onTransitionCancel"),as(ev,"onTransitionEnd"),ia("onMouseEnter",["mouseout","mouseover"]),ia("onMouseLeave",["mouseout","mouseover"]),ia("onPointerEnter",["pointerout","pointerover"]),ia("onPointerLeave",["pointerout","pointerover"]),hi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),hi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),hi("onBeforeInput",["compositionend","keypress","textInput","paste"]),hi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),hi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),hi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var nl="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(" "),ak=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(nl));function vw(n,i){i=(i&4)!==0;for(var l=0;l<n.length;l++){var d=n[l],g=d.event;d=d.listeners;e:{var b=void 0;if(i)for(var T=d.length-1;0<=T;T--){var P=d[T],B=P.instance,Q=P.currentTarget;if(P=P.listener,B!==b&&g.isPropagationStopped())break e;b=P,g.currentTarget=Q;try{b(g)}catch(te){Fc(te)}g.currentTarget=null,b=B}else for(T=0;T<d.length;T++){if(P=d[T],B=P.instance,Q=P.currentTarget,P=P.listener,B!==b&&g.isPropagationStopped())break e;b=P,g.currentTarget=Q;try{b(g)}catch(te){Fc(te)}g.currentTarget=null,b=B}}}}function _e(n,i){var l=i[ke];l===void 0&&(l=i[ke]=new Set);var d=n+"__bubble";l.has(d)||(bw(i,n,2,!1),l.add(d))}function em(n,i,l){var d=0;i&&(d|=4),bw(l,n,d,i)}var eu="_reactListening"+Math.random().toString(36).slice(2);function tm(n){if(!n[eu]){n[eu]=!0,hy.forEach(function(l){l!=="selectionchange"&&(ak.has(l)||em(l,!1,n),em(l,!0,n))});var i=n.nodeType===9?n:n.ownerDocument;i===null||i[eu]||(i[eu]=!0,em("selectionchange",!1,i))}}function bw(n,i,l,d){switch(qw(i)){case 2:var g=Dk;break;case 8:g=Pk;break;default:g=pm}l=g.bind(null,i,l,n),g=void 0,!Sf||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(g=!0),d?g!==void 0?n.addEventListener(i,l,{capture:!0,passive:g}):n.addEventListener(i,l,!0):g!==void 0?n.addEventListener(i,l,{passive:g}):n.addEventListener(i,l,!1)}function nm(n,i,l,d,g){var b=d;if((i&1)===0&&(i&2)===0&&d!==null)e:for(;;){if(d===null)return;var T=d.tag;if(T===3||T===4){var P=d.stateNode.containerInfo;
vendor: 2,252 bytes, line 8
8if(P===g)break;if(T===4)for(T=d.return;T!==null;){var B=T.tag;if((B===3||B===4)&&T.stateNode.containerInfo===g)return;T=T.return}for(;P!==null;){if(T=na(P),T===null)return;if(B=T.tag,B===5||B===6||B===26||B===27){d=b=T;continue e}P=P.parentNode}}d=d.return}Ty(function(){var Q=b,te=wf(l),se=[];e:{var X=tv.get(n);if(X!==void 0){var Z=mc,we=n;switch(n){case"keypress":if(fc(l)===0)break e;case"keydown":case"keyup":Z=eR;break;case"focusin":we="focus",Z=Tf;break;case"focusout":we="blur",Z=Tf;break;case"beforeblur":case"afterblur":Z=Tf;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Z=ky;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Z=BA;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Z=sR;break;case Xy:case Zy:case Jy:Z=HA;break;case ev:Z=iR;break;case"scroll":case"scrollend":Z=FA;break;case"wheel":Z=oR;break;case"copy":case"cut":case"paste":Z=GA;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Z=Oy;break;case"toggle":case"beforetoggle":Z=cR}var ye=(i&4)!==0,et=!ye&&(n==="scroll"||n==="scrollend"),G=ye?X!==null?X+"Capture":null:X;ye=[];for(var $=Q,Y;$!==null;){var ne=$;if(Y=ne.stateNode,ne=ne.tag,ne!==5&&ne!==26&&ne!==27||Y===null||G===null||(ne=wo($,G),ne!=null&&ye.push(sl($,ne,Y))),et)break;$=$.return}0<ye.length&&(X=new Z(X,we,null,l,te),se.push({event:X,listeners:ye}))}}if((i&7)===0){e:{if(X=n==="mouseover"||n==="pointerover",Z=n==="mouseout"||n==="pointerout",X&&l!==bf&&(we=l.relatedTarget||l.fromElement)&&(na(we)||we[rt]))break e;if((Z||X)&&(X=te.window===te?te:(X=te.ownerDocument)?X.defaultView||X.parentWindow:window,Z?(we=l.relatedTarget||l.toElement,Z=Q,we=we?na(we):null,we!==null&&(et=c(we),ye=we.tag,we!==et||ye!==5&&ye!==27&&ye!==6)&&(we=null)):(Z=null,we=Q),Z!==we)){if(ye=ky,ne="onMouseLeave",G="onMouseEnter",$="mouse",(n==="pointerout"||n==="pointerover")&&(ye=Oy,ne="onPointerLeave",G="onPointerEnter",$="pointer"),et=Z==null?X:bo(Z),Y=we==null?X:bo(we),X=new ye(ne,$+"leave",Z,l,te),
vendor: 7,458 bytes, lines 8-9
8X.target=et,X.relatedTarget=Y,ne=null,na(te)===Q&&(ye=new ye(G,$+"enter",we,l,te),ye.target=Y,ye.relatedTarget=et,ne=ye),et=ne,Z&&we)t:{for(ye=Z,G=we,$=0,Y=ye;Y;Y=La(Y))$++;for(Y=0,ne=G;ne;ne=La(ne))Y++;for(;0<$-Y;)ye=La(ye),$--;for(;0<Y-$;)G=La(G),Y--;for(;$--;){if(ye===G||G!==null&&ye===G.alternate)break t;ye=La(ye),G=La(G)}ye=null}else ye=null;Z!==null&&ww(se,X,Z,ye,!1),we!==null&&et!==null&&ww(se,et,we,ye,!0)}}e:{if(X=Q?bo(Q):window,Z=X.nodeName&&X.nodeName.toLowerCase(),Z==="select"||Z==="input"&&X.type==="file")var fe=Fy;else if(Iy(X))if(Vy)fe=vR;else{fe=xR;var Me=gR}else Z=X.nodeName,!Z||Z.toLowerCase()!=="input"||X.type!=="checkbox"&&X.type!=="radio"?Q&&vf(Q.elementType)&&(fe=Fy):fe=yR;if(fe&&(fe=fe(n,Q))){zy(se,fe,l,te);break e}Me&&Me(n,X,Q),n==="focusout"&&Q&&X.type==="number"&&Q.memoizedProps.value!=null&&yf(X,"number",X.value)}switch(Me=Q?bo(Q):window,n){case"focusin":(Iy(Me)||Me.contentEditable==="true")&&(fa=Me,Df=Q,Ro=null);break;case"focusout":Ro=Df=fa=null;break;case"mousedown":Pf=!0;break;case"contextmenu":case"mouseup":case"dragend":Pf=!1,Qy(se,l,te);break;case"selectionchange":if(wR)break;case"keydown":case"keyup":Qy(se,l,te)}var pe;if(Rf)e:{switch(n){case"compositionstart":var ve="onCompositionStart";break e;case"compositionend":ve="onCompositionEnd";break e;case"compositionupdate":ve="onCompositionUpdate";break e}ve=void 0}else da?Ly(n,l)&&(ve="onCompositionEnd"):n==="keydown"&&l.keyCode===229&&(ve="onCompositionStart");ve&&(Dy&&l.locale!=="ko"&&(da||ve!=="onCompositionStart"?ve==="onCompositionEnd"&&da&&(pe=Ay()):(jr=te,Nf="value"in jr?jr.value:jr.textContent,da=!0)),Me=tu(Q,ve),0<Me.length&&(ve=new My(ve,n,null,l,te),se.push({event:ve,listeners:Me}),pe?ve.data=pe:(pe=Uy(l),pe!==null&&(ve.data=pe)))),(pe=dR?fR(n,l):hR(n,l))&&(ve=tu(Q,"onBeforeInput"),0<ve.length&&(Me=new My("onBeforeInput","beforeinput",null,l,te),se.push({event:Me,listeners:ve}),Me.data=pe)),sk(se,n,Q,l,te)}vw(se,i)})}function sl(n,i,l){return{instance:n,listener:i,currentTarget:l}}function tu(n,i){for(var l=i+"Capture",d=[];n!==null;){var g=n,b=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||b===null||(g=wo(n,l),g!=null&&d.unshift(sl(n,g,b)),g=wo(n,i),g!=null&&d.push(sl(n,g,b))),n.tag===3)return d;n=n.return}return[]}function La(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function ww(n,i,l,d,g){for(var b=i._reactName,T=[];l!==null&&l!==d;){var P=l,B=P.alternate,Q=P.stateNode;if(P=P.tag,B!==null&&B===d)break;P!==5&&P!==26&&P!==27||Q===null||(B=Q,g?(Q=wo(l,b),Q!=null&&T.unshift(sl(l,Q,B))):g||(Q=wo(l,b),Q!=null&&T.push(sl(l,Q,B)))),l=l.return}T.length!==0&&n.push({event:i,listeners:T})}var ok=/\r\n?/g,lk=/\u0000|\uFFFD/g;function jw(n){return(typeof n=="string"?n:""+n).replace(ok,`
9`).replace(lk,"")}function Sw(n,i){return i=jw(i),jw(n)===i}function nu(){}function Je(n,i,l,d,g,b){switch(l){case"children":typeof d=="string"?i==="body"||i==="textarea"&&d===""||la(n,d):(typeof d=="number"||typeof d=="bigint")&&i!=="body"&&la(n,""+d);break;case"className":oc(n,"class",d);break;case"tabIndex":oc(n,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":oc(n,l,d);break;case"style":Cy(n,d,b);break;case"data":if(i!=="object"){oc(n,"data",d);break}case"src":case"href":if(d===""&&(i!=="a"||l!=="href")){n.removeAttribute(l);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){n.removeAttribute(l);break}d=uc(""+d),n.setAttribute(l,d);break;case"action":case"formAction":if(typeof d=="function"){n.setAttribute(l,"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 b=="function"&&(l==="formAction"?(i!=="input"&&Je(n,i,"name",g.name,g,null),Je(n,i,"formEncType",g.formEncType,g,null),Je(n,i,"formMethod",g.formMethod,g,null),Je(n,i,"formTarget",g.formTarget,g,null)):(Je(n,i,"encType",g.encType,g,null),Je(n,i,"method",g.method,g,null),Je(n,i,"target",g.target,g,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){n.removeAttribute(l);break}d=uc(""+d),n.setAttribute(l,d);break;case"onClick":d!=null&&(n.onclick=nu);break;case"onScroll":d!=null&&_e("scroll",n);break;case"onScrollEnd":d!=null&&_e("scrollend",n);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(r(61));if(l=d.__html,l!=null){if(g.children!=null)throw Error(r(60));n.innerHTML=l}}break;case"multiple":n.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":n.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){n.removeAttribute("xlink:href");break}l=uc(""+d),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(l,""+d):n.removeAttribute(l);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":d&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(l,""):n.removeAttribute(l);break;case"capture":case"download":d===!0?n.setAttribute(l,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(l,d):n.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?n.setAttribute(l,d):n.removeAttribute(l);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?n.removeAttribute(l):n.setAttribute(l,d);break;case"popover":_e("beforetoggle",n),_e("toggle",n),ac(n,"popover",d);break;case"xlinkActuate":zs(n,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":zs(n,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":zs(n,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":zs(n,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":zs(n,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":zs(n,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":zs(n,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":zs(n,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":zs(n,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":ac(n,"is",d);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=IA.get(l)||l,ac(n,l,d))}}function sm(n,i,l,d,g,b){switch(l){case"style":Cy(n,d,b);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(r(61));if(l=d.__html,l!=null){if(g.children!=null)throw Error(r(60));n.innerHTML=l}}break;
vendor: 6,221 bytes, line 9
9case"children":typeof d=="string"?la(n,d):(typeof d=="number"||typeof d=="bigint")&&la(n,""+d);break;case"onScroll":d!=null&&_e("scroll",n);break;case"onScrollEnd":d!=null&&_e("scrollend",n);break;case"onClick":d!=null&&(n.onclick=nu);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!my.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(g=l.endsWith("Capture"),i=l.slice(2,g?l.length-7:void 0),b=n[Ye]||null,b=b!=null?b[l]:null,typeof b=="function"&&n.removeEventListener(i,b,g),typeof d=="function")){typeof b!="function"&&b!==null&&(l in n?n[l]=null:n.hasAttribute(l)&&n.removeAttribute(l)),n.addEventListener(i,d,g);break e}l in n?n[l]=d:d===!0?n.setAttribute(l,""):ac(n,l,d)}}}function Xt(n,i,l){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":_e("error",n),_e("load",n);var d=!1,g=!1,b;for(b in l)if(l.hasOwnProperty(b)){var T=l[b];if(T!=null)switch(b){case"src":d=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:Je(n,i,b,T,l,null)}}g&&Je(n,i,"srcSet",l.srcSet,l,null),d&&Je(n,i,"src",l.src,l,null);return;case"input":_e("invalid",n);var P=b=T=g=null,B=null,Q=null;for(d in l)if(l.hasOwnProperty(d)){var te=l[d];if(te!=null)switch(d){case"name":g=te;break;case"type":T=te;break;case"checked":B=te;break;case"defaultChecked":Q=te;break;case"value":b=te;break;case"defaultValue":P=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(r(137,i));break;default:Je(n,i,d,te,l,null)}}wy(n,b,P,B,Q,T,g,!1),lc(n);return;case"select":_e("invalid",n),d=T=b=null;for(g in l)if(l.hasOwnProperty(g)&&(P=l[g],P!=null))switch(g){case"value":b=P;break;case"defaultValue":T=P;break;case"multiple":d=P;default:Je(n,i,g,P,l,null)}i=b,l=T,n.multiple=!!d,i!=null?oa(n,!!d,i,!1):l!=null&&oa(n,!!d,l,!0);return;case"textarea":_e("invalid",n),b=g=d=null;for(T in l)if(l.hasOwnProperty(T)&&(P=l[T],P!=null))switch(T){case"value":d=P;break;case"defaultValue":g=P;break;case"children":b=P;break;case"dangerouslySetInnerHTML":if(P!=null)throw Error(r(91));break;default:Je(n,i,T,P,l,null)}Sy(n,d,g,b),lc(n);return;case"option":for(B in l)l.hasOwnProperty(B)&&(d=l[B],d!=null)&&(B==="selected"?n.selected=d&&typeof d!="function"&&typeof d!="symbol":Je(n,i,B,d,l,null));return;case"dialog":_e("beforetoggle",n),_e("toggle",n),_e("cancel",n),_e("close",n);break;case"iframe":case"object":_e("load",n);break;case"video":case"audio":for(d=0;d<nl.length;d++)_e(nl[d],n);break;case"image":_e("error",n),_e("load",n);break;case"details":_e("toggle",n);break;case"embed":case"source":case"link":_e("error",n),_e("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Q in l)if(l.hasOwnProperty(Q)&&(d=l[Q],d!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:Je(n,i,Q,d,l,null)}return;default:if(vf(i)){for(te in l)l.hasOwnProperty(te)&&(d=l[te],d!==void 0&&sm(n,i,te,d,l,void 0));return}}for(P in l)l.hasOwnProperty(P)&&(d=l[P],d!=null&&Je(n,i,P,d,l,null))}function ck(n,i,l,d){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var g=null,b=null,T=null,P=null,B=null,Q=null,te=null;for(Z in l){var se=l[Z];if(l.hasOwnProperty(Z)&&se!=null)switch(Z){case"checked":break;case"value":break;case"defaultValue":B=se;default:d.hasOwnProperty(Z)||Je(n,i,Z,null,d,se)}}for(var X in d){var Z=d[X];if(se=l[X],d.hasOwnProperty(X)&&(Z!=null||se!=null))switch(X){case"type":b=Z;break;case"name":g=Z;break;case"checked":Q=Z;break;case"defaultChecked":te=Z;break;case"value":T=Z;break;case"defaultValue":P=Z;break;case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(r(137,i));break;default:Z!==se&&Je(n,i,X,Z,d,se)}}xf(n,T,P,B,Q,te,b,g);return;case"select":Z=T=P=X=null;for(b in l)if(B=l[b],l.hasOwnProperty(b)&&B!=null)switch(b){case"value":break;case"multiple":Z=B;default:d.hasOwnProperty(b)||Je(n,i,b,null,d,B)}for(g in d)if(b=d[g],B=l[g],d.hasOwnProperty(g)&&(b!=null||B!=null))switch(g){case"value":X=b;break;case"defaultValue":P=b;break;case"multiple":T=b;default:b!==B&&Je(n,i,g,b,d,B)}i=P,l=T,d=Z,X!=null?oa(n,!!l,X,!1):!!d!=!!l&&(i!=null?oa(n,!!l,i,!0):oa(n,!!l,l?[]:"",!1));return;case"textarea":Z=X=null;for(P in l)if(g=l[P],l.hasOwnProperty(P)&&g!=null&&!d.hasOwnProperty(P))switch(P){case"value":break;case"children":break;default:Je(n,i,P,null,d,g)}for(T in d)if(g=d[T],b=l[T],d.hasOwnProperty(T)&&(g!=null||b!=null))switch(T){case"value":X=g;break;case"defaultValue":Z=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(r(91));break;default:g!==b&&Je(n,i,T,g,d,b)}jy(n,X,Z);return;case"option":for(var we in l)X=l[we],l.hasOwnProperty(we)&&X!=null&&!d.hasOwnProperty(we)&&(we==="selected"?n.selected=!1:Je(n,i,we,null,d,X));for(B in d)X=d[B],Z=l[B],d.hasOwnProperty(B)&&X!==Z&&(X!=null||Z!=null)&&(B==="selected"?n.selected=X&&typeof X!="function"&&typeof X!="symbol":Je(n,i,B,X,d,Z));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 ye in l)X=l[ye],l.hasOwnProperty(ye)&&X!=null&&!d.hasOwnProperty(ye)&&Je(n,i,ye,null,d,X);for(Q in d)if(X=d[Q],Z=l[Q],d.hasOwnProperty(Q)&&X!==Z&&(X!=null||Z!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(r(137,i));break;default:Je(n,i,Q,X,d,Z)}return;default:if(vf(i)){for(var et in l)X=l[et],l.hasOwnProperty(et)&&X!==void 0&&!d.hasOwnProperty(et)&&sm(n,i,et,void 0,d,X);for(te in d)X=d[te],Z=l[te],!d.hasOwnProperty(te)||X===Z||X===void 0&&Z===void 0||sm(n,i,te,X,d,Z);return}}for(var G in l)X=l[G],l.hasOwnProperty(G)&&X!=null&&!d.hasOwnProperty(G)&&Je(n,i,G,null,d,X);for(se in d)X=d[se],Z=l[se],!d.hasOwnProperty(se)||X===Z||X==null&&Z==null||Je(n,i,se,X,d,Z)}var rm=null,im=null;function su(n){return n.nodeType===9?n:n.ownerDocument}function Nw(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}
vendor: 4,510 bytes, line 9
9function Cw(n,i){if(n===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&i==="foreignObject"?0:n}function am(n,i){return n==="textarea"||n==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var om=null;function uk(){var n=window.event;return n&&n.type==="popstate"?n===om?!1:(om=n,!0):(om=null,!1)}var Ew=typeof setTimeout=="function"?setTimeout:void 0,dk=typeof clearTimeout=="function"?clearTimeout:void 0,Tw=typeof Promise=="function"?Promise:void 0,fk=typeof queueMicrotask=="function"?queueMicrotask:typeof Tw<"u"?function(n){return Tw.resolve(null).then(n).catch(hk)}:Ew;function hk(n){setTimeout(function(){throw n})}function Ir(n){return n==="head"}function Aw(n,i){var l=i,d=0,g=0;do{var b=l.nextSibling;if(n.removeChild(l),b&&b.nodeType===8)if(l=b.data,l==="/$"){if(0<d&&8>d){l=d;var T=n.ownerDocument;if(l&1&&rl(T.documentElement),l&2&&rl(T.body),l&4)for(l=T.head,rl(l),T=l.firstChild;T;){var P=T.nextSibling,B=T.nodeName;T[vo]||B==="SCRIPT"||B==="STYLE"||B==="LINK"&&T.rel.toLowerCase()==="stylesheet"||l.removeChild(T),T=P}}if(g===0){n.removeChild(b),fl(i);return}g--}else l==="$"||l==="$?"||l==="$!"?g++:d=l.charCodeAt(0)-48;else d=0;l=b}while(l);fl(i)}function lm(n){var i=n.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var l=i;switch(i=i.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":lm(l),hf(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}n.removeChild(l)}}function mk(n,i,l,d){for(;n.nodeType===1;){var g=l;if(n.nodeName.toLowerCase()!==i.toLowerCase()){if(!d&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(d){if(!n[vo])switch(i){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(b=n.getAttribute("rel"),b==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(b!==g.rel||n.getAttribute("href")!==(g.href==null||g.href===""?null:g.href)||n.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin)||n.getAttribute("title")!==(g.title==null?null:g.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(b=n.getAttribute("src"),(b!==(g.src==null?null:g.src)||n.getAttribute("type")!==(g.type==null?null:g.type)||n.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin))&&b&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(i==="input"&&n.type==="hidden"){var b=g.name==null?null:""+g.name;if(g.type==="hidden"&&n.getAttribute("name")===b)return n}else return n;if(n=ls(n.nextSibling),n===null)break}return null}function pk(n,i,l){if(i==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!l||(n=ls(n.nextSibling),n===null))return null;return n}function cm(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState==="complete"}function gk(n,i){var l=n.ownerDocument;if(n.data!=="$?"||l.readyState==="complete")i();else{var d=function(){i(),l.removeEventListener("DOMContentLoaded",d)};l.addEventListener("DOMContentLoaded",d),n._reactRetry=d}}function ls(n){for(;n!=null;n=n.nextSibling){var i=n.nodeType;if(i===1||i===3)break;if(i===8){if(i=n.data,i==="$"||i==="$!"||i==="$?"||i==="F!"||i==="F")break;if(i==="/$")return null}}return n}var um=null;function Rw(n){n=n.previousSibling;for(var i=0;n;){if(n.nodeType===8){var l=n.data;if(l==="$"||l==="$!"||l==="$?"){if(i===0)return n;i--}else l==="/$"&&i++}n=n.previousSibling}return null}function kw(n,i,l){switch(i=su(l),n){case"html":if(n=i.documentElement,!n)throw Error(r(452));return n;case"head":if(n=i.head,!n)throw Error(r(453));return n;case"body":if(n=i.body,!n)throw Error(r(454));return n;default:throw Error(r(451))}}function rl(n){for(var i=n.attributes;i.length;)n.removeAttributeNode(i[0]);hf(n)}var Wn=new Map,Mw=new Set;function ru(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var Js=L.d;L.d={f:xk,r:yk,D:vk,C:bk,L:wk,m:jk,X:Nk,S:Sk,M:Ck};function xk(){var n=Js.f(),i=Qc();return n||i}function yk(n){var i=sa(n);i!==null&&i.tag===5&&i.type==="form"?Xv(i):Js.r(n)}var Ua=typeof document>"u"?null:document;function Ow(n,i,l){var d=Ua;if(d&&typeof i=="string"&&i){var g=$n(i);g='link[rel="'+n+'"][href="'+g+'"]',typeof l=="string"&&(g+='[crossorigin="'+l+'"]'),Mw.has(g)||(Mw.add(g),n={rel:n,
vendor: 5,427 bytes, line 9
9crossOrigin:l,href:i},d.querySelector(g)===null&&(i=d.createElement("link"),Xt(i,"link",n),Bt(i),d.head.appendChild(i)))}}function vk(n){Js.D(n),Ow("dns-prefetch",n,null)}function bk(n,i){Js.C(n,i),Ow("preconnect",n,i)}function wk(n,i,l){Js.L(n,i,l);var d=Ua;if(d&&n&&i){var g='link[rel="preload"][as="'+$n(i)+'"]';i==="image"&&l&&l.imageSrcSet?(g+='[imagesrcset="'+$n(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(g+='[imagesizes="'+$n(l.imageSizes)+'"]')):g+='[href="'+$n(n)+'"]';var b=g;switch(i){case"style":b=Ia(n);break;case"script":b=za(n)}Wn.has(b)||(n=p({rel:"preload",href:i==="image"&&l&&l.imageSrcSet?void 0:n,as:i},l),Wn.set(b,n),d.querySelector(g)!==null||i==="style"&&d.querySelector(il(b))||i==="script"&&d.querySelector(al(b))||(i=d.createElement("link"),Xt(i,"link",n),Bt(i),d.head.appendChild(i)))}}function jk(n,i){Js.m(n,i);var l=Ua;if(l&&n){var d=i&&typeof i.as=="string"?i.as:"script",g='link[rel="modulepreload"][as="'+$n(d)+'"][href="'+$n(n)+'"]',b=g;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":b=za(n)}if(!Wn.has(b)&&(n=p({rel:"modulepreload",href:n},i),Wn.set(b,n),l.querySelector(g)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(al(b)))return}d=l.createElement("link"),Xt(d,"link",n),Bt(d),l.head.appendChild(d)}}}function Sk(n,i,l){Js.S(n,i,l);var d=Ua;if(d&&n){var g=ra(d).hoistableStyles,b=Ia(n);i=i||"default";var T=g.get(b);if(!T){var P={loading:0,preload:null};if(T=d.querySelector(il(b)))P.loading=5;else{n=p({rel:"stylesheet",href:n,"data-precedence":i},l),(l=Wn.get(b))&&dm(n,l);var B=T=d.createElement("link");Bt(B),Xt(B,"link",n),B._p=new Promise(function(Q,te){B.onload=Q,B.onerror=te}),B.addEventListener("load",function(){P.loading|=1}),B.addEventListener("error",function(){P.loading|=2}),P.loading|=4,iu(T,i,d)}T={type:"stylesheet",instance:T,count:1,state:P},g.set(b,T)}}}function Nk(n,i){Js.X(n,i);var l=Ua;if(l&&n){var d=ra(l).hoistableScripts,g=za(n),b=d.get(g);b||(b=l.querySelector(al(g)),b||(n=p({src:n,async:!0},i),(i=Wn.get(g))&&fm(n,i),b=l.createElement("script"),Bt(b),Xt(b,"link",n),l.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},d.set(g,b))}}function Ck(n,i){Js.M(n,i);var l=Ua;if(l&&n){var d=ra(l).hoistableScripts,g=za(n),b=d.get(g);b||(b=l.querySelector(al(g)),b||(n=p({src:n,async:!0,type:"module"},i),(i=Wn.get(g))&&fm(n,i),b=l.createElement("script"),Bt(b),Xt(b,"link",n),l.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},d.set(g,b))}}function Dw(n,i,l,d){var g=(g=le.current)?ru(g):null;if(!g)throw Error(r(446));switch(n){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(i=Ia(l.href),l=ra(g).hoistableStyles,d=l.get(i),d||(d={type:"style",instance:null,count:0,state:null},l.set(i,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){n=Ia(l.href);var b=ra(g).hoistableStyles,T=b.get(n);if(T||(g=g.ownerDocument||g,T={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},b.set(n,T),(b=g.querySelector(il(n)))&&!b._p&&(T.instance=b,T.state.loading=5),Wn.has(n)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Wn.set(n,l),b||Ek(g,n,l,T.state))),i&&d===null)throw Error(r(528,""));return T}if(i&&d!==null)throw Error(r(529,""));return null;case"script":return i=l.async,l=l.src,typeof l=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=za(l),l=ra(g).hoistableScripts,d=l.get(i),d||(d={type:"script",instance:null,count:0,state:null},l.set(i,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,n))}}function Ia(n){return'href="'+$n(n)+'"'}function il(n){return'link[rel="stylesheet"]['+n+"]"}function Pw(n){return p({},n,{"data-precedence":n.precedence,precedence:null})}function Ek(n,i,l,d){n.querySelector('link[rel="preload"][as="style"]['+i+"]")?d.loading=1:(i=n.createElement("link"),d.preload=i,i.addEventListener("load",function(){return d.loading|=1}),i.addEventListener("error",function(){return d.loading|=2}),Xt(i,"link",l),Bt(i),n.head.appendChild(i))}function za(n){return'[src="'+$n(n)+'"]'}function al(n){return"script[async]"+n}function _w(n,i,l){if(i.count++,i.instance===null)switch(i.type){case"style":var d=n.querySelector('style[data-href~="'+$n(l.href)+'"]');if(d)return i.instance=d,Bt(d),d;var g=p({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return d=(n.ownerDocument||n).createElement("style"),Bt(d),Xt(d,"style",g),iu(d,l.precedence,n),i.instance=d;case"stylesheet":g=Ia(l.href);var b=n.querySelector(il(g));if(b)return i.state.loading|=4,i.instance=b,Bt(b),b;d=Pw(l),(g=Wn.get(g))&&dm(d,g),b=(n.ownerDocument||n).createElement("link"),Bt(b);var T=b;return T._p=new Promise(function(P,B){T.onload=P,T.onerror=B}),Xt(b,"link",d),i.state.loading|=4,iu(b,l.precedence,n),i.instance=b;case"script":return b=za(l.src),(g=n.querySelector(al(b)))?(i.instance=g,Bt(g),g):(d=l,(g=Wn.get(b))&&(d=p({},l),fm(d,g)),n=n.ownerDocument||n,g=n.createElement("script"),Bt(g),Xt(g,"link",d),n.head.appendChild(g),i.instance=g);case"void":return null;default:throw Error(r(443,i.type))}
vendor: 12,157 bytes, line 9
9else i.type==="stylesheet"&&(i.state.loading&4)===0&&(d=i.instance,i.state.loading|=4,iu(d,l.precedence,n));return i.instance}function iu(n,i,l){for(var d=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=d.length?d[d.length-1]:null,b=g,T=0;T<d.length;T++){var P=d[T];if(P.dataset.precedence===i)b=P;else if(b!==g)break}b?b.parentNode.insertBefore(n,b.nextSibling):(i=l.nodeType===9?l.head:l,i.insertBefore(n,i.firstChild))}function dm(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.title==null&&(n.title=i.title)}function fm(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.integrity==null&&(n.integrity=i.integrity)}var au=null;function Lw(n,i,l){if(au===null){var d=new Map,g=au=new Map;g.set(l,d)}else g=au,d=g.get(l),d||(d=new Map,g.set(l,d));if(d.has(n))return d;for(d.set(n,null),l=l.getElementsByTagName(n),g=0;g<l.length;g++){var b=l[g];if(!(b[vo]||b[Ie]||n==="link"&&b.getAttribute("rel")==="stylesheet")&&b.namespaceURI!=="http://www.w3.org/2000/svg"){var T=b.getAttribute(i)||"";T=n+T;var P=d.get(T);P?P.push(b):d.set(T,[b])}}return d}function Uw(n,i,l){n=n.ownerDocument||n,n.head.insertBefore(l,i==="title"?n.querySelector("head > title"):null)}function Tk(n,i,l){if(l===1||i.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(n=i.disabled,typeof i.precedence=="string"&&n==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function Iw(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}var ol=null;function Ak(){}function Rk(n,i,l){if(ol===null)throw Error(r(475));var d=ol;if(i.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var g=Ia(l.href),b=n.querySelector(il(g));if(b){n=b._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(d.count++,d=ou.bind(d),n.then(d,d)),i.state.loading|=4,i.instance=b,Bt(b);return}b=n.ownerDocument||n,l=Pw(l),(g=Wn.get(g))&&dm(l,g),b=b.createElement("link"),Bt(b);var T=b;T._p=new Promise(function(P,B){T.onload=P,T.onerror=B}),Xt(b,"link",l),i.instance=b}d.stylesheets===null&&(d.stylesheets=new Map),d.stylesheets.set(i,n),(n=i.state.preload)&&(i.state.loading&3)===0&&(d.count++,i=ou.bind(d),n.addEventListener("load",i),n.addEventListener("error",i))}}function kk(){if(ol===null)throw Error(r(475));var n=ol;return n.stylesheets&&n.count===0&&hm(n,n.stylesheets),0<n.count?function(i){var l=setTimeout(function(){if(n.stylesheets&&hm(n,n.stylesheets),n.unsuspend){var d=n.unsuspend;n.unsuspend=null,d()}},6e4);return n.unsuspend=i,function(){n.unsuspend=null,clearTimeout(l)}}:null}function ou(){if(this.count--,this.count===0){if(this.stylesheets)hm(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var lu=null;function hm(n,i){n.stylesheets=null,n.unsuspend!==null&&(n.count++,lu=new Map,i.forEach(Mk,n),lu=null,ou.call(n))}function Mk(n,i){if(!(i.state.loading&4)){var l=lu.get(n);if(l)var d=l.get(null);else{l=new Map,lu.set(n,l);for(var g=n.querySelectorAll("link[data-precedence],style[data-precedence]"),b=0;b<g.length;b++){var T=g[b];(T.nodeName==="LINK"||T.getAttribute("media")!=="not all")&&(l.set(T.dataset.precedence,T),d=T)}d&&l.set(null,d)}g=i.instance,T=g.getAttribute("data-precedence"),b=l.get(T)||d,b===d&&l.set(null,g),l.set(T,g),this.count++,d=ou.bind(this),g.addEventListener("load",d),g.addEventListener("error",d),b?b.parentNode.insertBefore(g,b.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(g,n.firstChild)),i.state.loading|=4}}var ll={$$typeof:R,Provider:null,Consumer:null,_currentValue:z,_currentValue2:z,_threadCount:0};function Ok(n,i,l,d,g,b,T,P){this.tag=1,this.containerInfo=n,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=En(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=En(0),this.hiddenUpdates=En(null),this.identifierPrefix=d,this.onUncaughtError=g,this.onCaughtError=b,this.onRecoverableError=T,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=P,this.incompleteTransitions=new Map}function zw(n,i,l,d,g,b,T,P,B,Q,te,se){return n=new Ok(n,i,l,T,P,B,Q,se),i=1,b===!0&&(i|=24),b=An(3,null,null,i),n.current=b,b.stateNode=n,i=Yf(),i.refCount++,n.pooledCache=i,i.refCount++,b.memoizedState={element:d,isDehydrated:l,cache:i},Zf(b),n}function Fw(n){return n?(n=ga,n):ga}function Vw(n,i,l,d,g,b){g=Fw(g),d.context===null?d.context=g:d.pendingContext=g,d=Cr(i),d.payload={element:l},b=b===void 0?null:b,b!==null&&(d.callback=b),l=Er(n,d,i),l!==null&&(Dn(l,n,i),Io(l,n,i))}function Bw(n,i){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var l=n.retryLane;n.retryLane=l!==0&&l<i?l:i}}function mm(n,i){Bw(n,i),(n=n.alternate)&&Bw(n,i)}function $w(n){if(n.tag===13){var i=pa(n,67108864);i!==null&&Dn(i,n,67108864),mm(n,67108864)}}var cu=!0;function Dk(n,i,l,d){var g=U.T;U.T=null;var b=L.p;try{L.p=2,pm(n,i,l,d)}finally{L.p=b,U.T=g}}function Pk(n,i,l,d){var g=U.T;U.T=null;var b=L.p;try{L.p=8,pm(n,i,l,d)}finally{L.p=b,U.T=g}}function pm(n,i,l,d){if(cu){var g=gm(d);if(g===null)nm(n,i,d,uu,l),Hw(n,d);else if(Lk(g,n,i,l,d))d.stopPropagation();else if(Hw(n,d),i&4&&-1<_k.indexOf(n)){for(;g!==null;){var b=sa(g);if(b!==null)switch(b.tag){case 3:if(b=b.stateNode,b.current.memoizedState.isDehydrated){var T=Oe(b.pendingLanes);if(T!==0){var P=b;for(P.pendingLanes|=2,P.entangledLanes|=2;T;){var B=1<<31-Vt(T);P.entanglements[1]|=B,T&=~B}ws(b),(Qe&6)===0&&(Gc=Ft()+500,tl(0))}}break;case 13:P=pa(b,2),P!==null&&Dn(P,b,2),Qc(),mm(b,2)}if(b=gm(d),b===null&&nm(n,i,d,uu,l),b===g)break;g=b}g!==null&&d.stopPropagation()}else nm(n,i,d,null,l)}}function gm(n){return n=wf(n),xm(n)}var uu=null;function xm(n){if(uu=null,n=na(n),n!==null){var i=c(n);if(i===null)n=null;else{var l=i.tag;if(l===13){if(n=u(i),n!==null)return n;n=null}else if(l===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;n=null}else i!==n&&(n=null)}}return uu=n,null}function qw(n){switch(n){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(di()){case Gt:return 2;case Ji:return 8;case Vn:case _s:return 32;case Nn:return 268435456;default:return 32}default:return 32}}var ym=!1,zr=null,Fr=null,Vr=null,cl=new Map,ul=new Map,Br=[],_k="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 Hw(n,i){switch(n){case"focusin":case"focusout":zr=null;break;case"dragenter":case"dragleave":Fr=null;break;case"mouseover":case"mouseout":Vr=null;break;case"pointerover":case"pointerout":cl.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":ul.delete(i.pointerId)}}function dl(n,i,l,d,g,b){return n===null||n.nativeEvent!==b?(n={blockedOn:i,domEventName:l,eventSystemFlags:d,nativeEvent:b,targetContainers:[g]},i!==null&&(i=sa(i),i!==null&&$w(i)),n):(n.eventSystemFlags|=d,i=n.targetContainers,g!==null&&i.indexOf(g)===-1&&i.push(g),n)}function Lk(n,i,l,d,g){switch(i){case"focusin":return zr=dl(zr,n,i,l,d,g),!0;case"dragenter":return Fr=dl(Fr,n,i,l,d,g),!0;case"mouseover":return Vr=dl(Vr,n,i,l,d,g),!0;case"pointerover":var b=g.pointerId;return cl.set(b,dl(cl.get(b)||null,n,i,l,d,g)),!0;case"gotpointercapture":return b=g.pointerId,ul.set(b,dl(ul.get(b)||null,n,i,l,d,g)),!0}return!1}function Kw(n){var i=na(n.target);if(i!==null){var l=c(i);if(l!==null){if(i=l.tag,i===13){if(i=u(l),i!==null){n.blockedOn=i,De(n.priority,function(){if(l.tag===13){var d=On();d=be(d);var g=pa(l,d);g!==null&&Dn(g,l,d),mm(l,d)}});return}}else if(i===3&&l.stateNode.current.memoizedState.isDehydrated){n.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}n.blockedOn=null}function du(n){if(n.blockedOn!==null)return!1;for(var i=n.targetContainers;0<i.length;){var l=gm(n.nativeEvent);if(l===null){l=n.nativeEvent;var d=new l.constructor(l.type,l);bf=d,l.target.dispatchEvent(d),bf=null}else return i=sa(l),i!==null&&$w(i),n.blockedOn=l,!1;i.shift()}return!0}function Gw(n,i,l){du(n)&&l.delete(i)}function Uk(){ym=!1,zr!==null&&du(zr)&&(zr=null),Fr!==null&&du(Fr)&&(Fr=null),Vr!==null&&du(Vr)&&(Vr=null),cl.forEach(Gw),ul.forEach(Gw)}function fu(n,i){n.blockedOn===i&&(n.blockedOn=null,ym||(ym=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Uk)))}var hu=null;function Yw(n){hu!==n&&(hu=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){hu===n&&(hu=null);for(var i=0;i<n.length;i+=3){var l=n[i],d=n[i+1],g=n[i+2];if(typeof d!="function"){if(xm(d||l)===null)continue;break}var b=sa(l);b!==null&&(n.splice(i,3),i-=3,xh(b,{pending:!0,data:g,method:l.method,action:d},d,g))}}))}function fl(n){function i(B){return fu(B,n)}zr!==null&&fu(zr,n),Fr!==null&&fu(Fr,n),Vr!==null&&fu(Vr,n),cl.forEach(i),ul.forEach(i);for(var l=0;l<Br.length;l++){var d=Br[l];d.blockedOn===n&&(d.blockedOn=null)}for(;0<Br.length&&(l=Br[0],l.blockedOn===null);)Kw(l),l.blockedOn===null&&Br.shift();if(l=(n.ownerDocument||n).$$reactFormReplay,l!=null)for(d=0;d<l.length;d+=3){var g=l[d],b=l[d+1],T=g[Ye]||null;if(typeof b=="function")T||Yw(l);else if(T){var P=null;if(b&&b.hasAttribute("formAction")){if(g=b,T=b[Ye]||null)P=T.formAction;else if(xm(g)!==null)continue}else P=T.action;typeof P=="function"?l[d+1]=P:(l.splice(d,3),d-=3),Yw(l)}}}function vm(n){this._internalRoot=n}mu.prototype.render=vm.prototype.render=function(n){var i=this._internalRoot;if(i===null)throw Error(r(409));var l=i.current,d=On();Vw(l,d,n,i,null,null)},mu.prototype.unmount=vm.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var i=n.containerInfo;Vw(n.current,2,null,n,null,null),Qc(),i[rt]=null}};function mu(n){this._internalRoot=n}mu.prototype.unstable_scheduleHydration=function(n){if(n){var i=me();n={blockedOn:null,target:n,priority:i};for(var l=0;l<Br.length&&i!==0&&i<Br[l].priority;l++);Br.splice(l,0,n),l===0&&Kw(n)}};var Qw=t.version;if(Qw!=="19.1.0")throw Error(r(527,Qw,"19.1.0"));L.findDOMNode=function(n){var i=n._reactInternals;if(i===void 0)throw typeof n.render=="function"?Error(r(188)):(n=Object.keys(n).join(","),Error(r(268,n)));return n=h(i),n=n!==null?m(n):null,n=n===null?null:n.stateNode,n};var Ik={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.1.0"};
vendor: 6,329 bytes, line 9
9if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var pu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!pu.isDisabled&&pu.supportsFiber)try{Us=pu.inject(Ik),kt=pu}catch{}}return ml.createRoot=function(n,i){if(!o(n))throw Error(r(299));var l=!1,d="",g=db,b=fb,T=hb,P=null;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onUncaughtError!==void 0&&(g=i.onUncaughtError),i.onCaughtError!==void 0&&(b=i.onCaughtError),i.onRecoverableError!==void 0&&(T=i.onRecoverableError),i.unstable_transitionCallbacks!==void 0&&(P=i.unstable_transitionCallbacks)),i=zw(n,1,!1,null,null,l,d,g,b,T,P,null),n[rt]=i.current,tm(n),new vm(i)},ml.hydrateRoot=function(n,i,l){if(!o(n))throw Error(r(299));var d=!1,g="",b=db,T=fb,P=hb,B=null,Q=null;return l!=null&&(l.unstable_strictMode===!0&&(d=!0),l.identifierPrefix!==void 0&&(g=l.identifierPrefix),l.onUncaughtError!==void 0&&(b=l.onUncaughtError),l.onCaughtError!==void 0&&(T=l.onCaughtError),l.onRecoverableError!==void 0&&(P=l.onRecoverableError),l.unstable_transitionCallbacks!==void 0&&(B=l.unstable_transitionCallbacks),l.formState!==void 0&&(Q=l.formState)),i=zw(n,1,!0,i,l??null,d,g,b,T,P,B,Q),i.context=Fw(null),l=i.current,d=On(),d=be(d),g=Cr(d),g.callback=null,Er(l,g,d),l=d,i.current.lanes=l,xn(i,l),ws(i),n[rt]=i.current,tm(n),new mu(i)},ml.version="19.1.0",ml}var l0;function Qk(){if(l0)return jm.exports;l0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),jm.exports=Yk(),jm.exports}var Wk=Qk(),y=Ld();const Wr=Vk(y),Gi=Fk({__proto__:null,default:Wr},[y]),hS=y.createContext(void 0),mr=e=>{const t=y.useContext(hS);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Xk=({client:e,children:t})=>(y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),a.jsx(hS.Provider,{value:e,children:t})),Zk={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)};var Jk=class{#e=Zk;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};const _i=new Jk;function e3(e){setTimeout(e,0)}const t3=typeof window>"u"||"Deno"in globalThis;function un(){}function n3(e,t){return typeof e=="function"?e(t):e}function mS(e){return typeof e=="number"&&e>=0&&e!==1/0}function pS(e,t){return Math.max(e+(t||0)-Date.now(),0)}function bt(e,t){return typeof e=="function"?e(t):e}function c0(e,t){const{type:s="all",exact:r,fetchStatus:o,predicate:c,queryKey:u,stale:f}=e;if(u){if(r){if(t.queryHash!==Sg(u,t.options))return!1}else if(!Ja(t.queryKey,u))return!1}if(s!=="all"){const h=t.isActive();if(s==="active"&&!h||s==="inactive"&&h)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||o&&o!==t.state.fetchStatus||c&&!c(t))}function u0(e,t){const{exact:s,status:r,predicate:o,mutationKey:c}=e;if(c){if(!t.options.mutationKey)return!1;if(s){if(Bi(t.options.mutationKey)!==Bi(c))return!1}else if(!Ja(t.options.mutationKey,c))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Sg(e,t){return(t?.queryKeyHashFn||Bi)(e)}function Bi(e){return JSON.stringify(e,(t,s)=>hp(s)?Object.keys(s).sort().reduce((r,o)=>(r[o]=s[o],r),{}):s)}function Ja(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(Array.isArray(e)&&Array.isArray(t)){for(let r=0;r<t.length;r++)if(!Ja(e[r],t[r]))return!1;return!0}const s=Object.keys(t);for(const r of s)if(!Ja(e[r],t[r]))return!1;return!0}return!1}const s3=Object.prototype.hasOwnProperty;function gS(e,t,s=0){if(e===t)return e;if(s>500)return t;const r=d0(e)&&d0(t);if(!r&&!(hp(e)&&hp(t)))return t;const o=(r?e:Object.keys(e)).length,c=r?t:Object.keys(t),u=c.length,f=r?new Array(u):{};let h=0;for(let m=0;m<u;m++){const p=r?m:c[m],x=e[p],v=t[p];if(x===v){f[p]=x,(r?m<o:s3.call(e,p))&&h++;continue}if(x===null||v===null||typeof x!="object"||typeof v!="object"){f[p]=v;continue}const j=gS(x,v,s+1);f[p]=j,j===x&&h++}return o===u&&h===o?e:f}function zu(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const s in e)if(e[s]!==t[s])return!1;return!0}function d0(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function hp(e){if(!f0(e))return!1;const t=e.constructor;if(t===void 0)return!0;const s=t.prototype;return!(!f0(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function f0(e){return Object.prototype.toString.call(e)==="[object Object]"}function r3(e){return new Promise(t=>{_i.setTimeout(t,e)})}function mp(e,t,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,t):s.structuralSharing!==!1?gS(e,t):t}function i3(e,t,s=0){const r=[...e,t];return s&&r.length>s?r.slice(1):r}function a3(e,t,s=0){const r=[t,...e];return s&&r.length>s?r.slice(0,-1):r}const Ng=Symbol();function xS(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Ng?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Cg(e,t){return typeof e=="function"?e(...t):!!e}function o3(e,t,s){let r=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??=t(),r||(r=!0,o.aborted?s():o.addEventListener("abort",s,{once:!0})),o)}),e}let l3=()=>t3;const Eg=()=>l3();var ao=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},c3=class extends ao{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();
9this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}};const Tg=new c3,u3=e3;function d3(){let e=[],t=0,s=f=>{f()},r=f=>{f()},o=u3;const c=f=>{t?e.push(f):o(()=>{s(f)})},u=()=>{const f=e;e=[],f.length&&o(()=>{r(()=>{f.forEach(h=>{s(h)})})})};return{batch:f=>{let h;t++;try{h=f()}finally{t--,t||u()}return h},batchCalls:f=>(...h)=>{c(()=>{f(...h)})},schedule:c,setNotifyFunction:f=>{s=f},setBatchNotifyFunction:f=>{r=f},setScheduler:f=>{o=f}}}const It=d3();var f3=class extends ao{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};const od=new f3;function h3(e){return Math.min(1e3*2**e,3e4)}function yS(e){return(e??"online")==="online"?od.isOnline():!0}var pp=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function vS(e){let t=!1,s=0,r,o="pending",c,u;const f=new Promise((E,R)=>{c=E,u=R});f.catch(un);const h=()=>o!=="pending",m=E=>{if(!h()){const R=new pp(E);C(R),e.onCancel?.(R)}},p=()=>{t=!0},x=()=>{t=!1},v=()=>Tg.isFocused()&&(e.networkMode==="always"||od.isOnline())&&e.canRun(),j=()=>yS(e.networkMode)&&e.canRun(),w=E=>{h()||(r?.(),o="resolved",c(E))},C=E=>{h()||(r?.(),o="rejected",u(E))},S=()=>new Promise(E=>{r=R=>{(h()||v())&&E(R)},e.onPause?.()}).then(()=>{r=void 0,h()||e.onContinue?.()}),N=()=>{if(h())return;let E;const R=s===0?e.initialPromise:void 0;try{E=R??e.fn()}catch(D){E=Promise.reject(D)}Promise.resolve(E).then(w).catch(D=>{if(h())return;const A=e.retry??(Eg()?0:3),_=e.retryDelay??h3,F=typeof _=="function"?_(s,D):_,O=A===!0||typeof A=="number"&&s<A||typeof A=="function"&&A(s,D);if(t||!O){C(D);return}s++,e.onFail?.(s,D),r3(F).then(()=>v()?void 0:S()).then(()=>{t?C(D):N()})})};return{promise:f,status:()=>o,cancel:m,continue:()=>(r?.(),f),cancelRetry:p,continueRetry:x,canStart:j,start:()=>(j()?N():S().then(N),f)}}var bS=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),mS(this.gcTime)&&(this.#e=_i.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Eg()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(_i.clearTimeout(this.#e),this.#e=void 0)}};function m3(e){return{onFetch:(t,s)=>{const r=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,c=t.state.data?.pages||[],u=t.state.data?.pageParams||[];let f={pages:[],pageParams:[]},h=0;const m=async()=>{let p=!1;const x=w=>{o3(w,()=>t.signal,()=>p=!0)},v=xS(t.options,t.fetchOptions),j=async(w,C,S)=>{if(p)return Promise.reject(t.signal.reason);if(C==null&&w.pages.length)return Promise.resolve(w);const E=(()=>{const _={client:t.client,queryKey:t.queryKey,pageParam:C,direction:S?"backward":"forward",meta:t.options.meta};return x(_),_})(),R=await v(E),{maxPages:D}=t.options,A=S?a3:i3;return{pages:A(w.pages,R,D),pageParams:A(w.pageParams,C,D)}};if(o&&c.length){const w=o==="backward",C=w?p3:h0,S={pages:c,pageParams:u};f=await j(S,C(r,S),w)}else{const w=e??c.length;do{const C=h===0?u[0]??r.initialPageParam:h0(r,f);if(h>0&&C==null)break;f=await j(f,C),h++}while(h<w)}return f};t.options.persister?t.fetchFn=()=>t.options.persister?.(m,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s):t.fetchFn=m}}}function h0(e,{pages:t,pageParams:s}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,s[r],s):void 0}function p3(e,{pages:t,pageParams:s}){return t.length>0?e.getPreviousPageParam?.(t[0],t,s[0],s):void 0}var g3=class extends bS{#e;#t;#n;#s;#i;#r;#a;#l;constructor(e){super(),this.#l=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#s=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=p0(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#a,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=p0(this.options);t.data!==void 0&&(this.setState(m0(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#s.remove(this)}setData(e,t){const s=mp(this.state.data,e,this.options);return this.#o({data:s,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),s}setState(e){this.#o({type:"setState",state:e})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(un).catch(un):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>bt(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ng||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdate
vendor: 4,710 bytes, line 9
9Count>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>bt(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!pS(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){const t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#r&&(this.#l||this.state.fetchStatus==="paused"&&this.state.status==="pending"?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#s.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const h=this.observers.find(m=>m.options.queryFn);h&&this.setOptions(h.options)}const s=new AbortController,r=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#l=!0,s.signal)})},o=()=>{const h=xS(this.options,t),p=(()=>{const x={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(x),x})();return this.#l=!1,this.options.persister?this.options.persister(h,p,this):h(p)},u=(()=>{const h={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:o};return r(h),h})();(this.#e==="infinite"?m3(this.options.pages):this.options.behavior)?.onFetch(u,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==u.fetchOptions?.meta)&&this.#o({type:"fetch",meta:u.fetchOptions?.meta});const f=this.#r=vS({initialPromise:t?.initialPromise,fn:u.fetchFn,onCancel:h=>{h instanceof pp&&h.revert&&this.setState({...this.#n,fetchStatus:"idle"}),s.abort()},onFail:(h,m)=>{this.#o({type:"failed",failureCount:h,error:m})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0});try{const h=await f.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#s.config.onSuccess?.(h,this),this.#s.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof pp){if(h.silent)return this.#r.promise;if(h.revert){if(this.state.data===void 0)throw h;return this.state.data}}throw this.#o({type:"error",error:h}),this.#s.config.onError?.(h,this),this.#s.config.onSettled?.(this.state.data,h,this),h}finally{this.#r===f&&(this.#r=void 0),this.scheduleGc()}}#o(e){const t=s=>{switch(e.type){case"failed":return{...s,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...wS(s.data,this.options),fetchMeta:e.meta??null};case"success":const r={...s,...m0(e.data,e.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?r:void 0,r;case"error":const o=e.error;return{...s,error:o,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...e.state}}};this.state=t(this.state),It.batch(()=>{this.observers.slice().forEach(s=>{s.onQueryUpdate()}),this.#s.notify({query:this,type:"updated",action:e})})}};function wS(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:yS(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function m0(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function p0(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,s=t!==void 0,r=s?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?r??Date.now():0,error:null,errorUpdate
9Count:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var x3=class extends ao{#e;#t=void 0;#n=void 0;#s=void 0;#i;#r;#a;#l;#o;#h;#u;#d;#c;#m=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#a=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),g0(this.#t,this.options)?this.#f():this.updateResult(),this.#v())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return gp(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return gp(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,s=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof bt(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#j(),this.#t.setOptions(this.options),t._defaulted&&!zu(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&x0(this.#t,s,this.options,t)&&this.#f(),this.updateResult(),r&&(this.#t!==s||bt(this.options.enabled,this.#t)!==bt(t.enabled,this.#t)||bt(this.options.staleTime,this.#t)!==bt(t.staleTime,this.#t))&&this.#g();const o=this.#x();r&&(this.#t!==s||bt(this.options.enabled,this.#t)!==bt(t.enabled,this.#t)||o!==this.#c)&&this.#y(o)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),s=this.createResult(t,e);return zu(this.getCurrentResult(),s)||(this.#s=s,this.#r=this.options,this.#i=this.#t.state),s}getCurrentResult(){return this.#s}trackResult(e,t){return new Proxy(e,{get:(s,r)=>(this.trackProp(r),t?.(r),Reflect.get(s,r))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),s=this.#e.getQueryCache().build(this.#e,t);let r=()=>{},o;const c=new Promise(u=>{o=u,r=this.#e.getQueryCache().subscribe(f=>{f.type==="updated"&&f.query.queryHash===s.queryHash&&s.state.data!==void 0&&(r(),u(this.createResult(s,t)))})});return Promise.race([s.fetch().then(()=>{const u=this.createResult(s,t);return o?.(u),u}).finally(()=>{r()}),c])}fetch(e){return this.#f({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#f(e){this.#j();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(un)),t}#p(e){return!Eg()&&bt(this.options.enabled,this.#t)!==!1&&mS(e)}#g(){this.#b();const e=bt(this.options.staleTime,this.#t);if(this.#s.isStale||!this.#p(e))return;const t=pS(this.#s.dataUpdatedAt,e)+1;this.#u=_i.setTimeout(()=>{this.#s.isStale||this.updateResult()},t)}#x(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#w(),this.#c=e,!(this.#c===0||!this.#p(this.#c))&&(this.#d=_i.setInterval(()=>{(this.options.refetchIntervalInBackground||Tg.isFocused())&&this.#f()},this.#c))}#v(){this.#g(),this.#y(this.#x())}#b(){this.#u!==void 0&&(_i.clearTimeout(this.#u),this.#u=void 0)}#w(){this.#d!==void 0&&(_i.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){const s=this.#t,r=this.options,o=this.#s,c=this.#i,u=this.#r,f=e!==s?e.state:this.#n,{state:h}=e;let m={...h},p=!1,x;if(t._optimisticResults){const A=this.hasListeners(),_=!A&&g0(e,t),F=A&&x0(e,s,t,r);(_||F)&&(m={...m,...wS(h.data,e.options)}),t._optimisticResults==="isRestoring"&&(m.fetchStatus="idle")}let{error:v,errorUpdatedAt:j,status:w}=m;x=m.data;let C=!1;if(t.placeholderData!==void 0&&x===void 0&&w==="pending"){let A;o?.isPlaceholderData&&t.placeholderData===u?.placeholderData?(A=o.data,C=!0):A=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,A!==void 0&&(w="success",x=mp(o?.data,A,t),p=!0)}if(t.select&&x!==void 0&&!C)if(o&&x===c?.data&&t.select===this.#l)x=this.#o;else try{this.#l=t.select,x=t.select(x),x=mp(o?.data,x,t),this.#o=x,this.#a=null}catch(A){this.#a=A}else x===void 0&&(this.#a=null);this.#a&&(v=this.#a,x=this.#o,j=Date.now(),w="error",p=!1);const S=m.fetchStatus==="fetching",N=w==="pending",E=w==="error",R=N&&S,D=x!==void 0;return{status:w,fetchStatus:m.fetchStatus,isPending:N,isSuccess:w==="success",isError:E,isInitialLoading:R,isLoading:R,data:x,dataUpdatedAt:m.dataUpdatedAt,error:v,errorUpdatedAt:j,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdate
9Count:m.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:m.dataUpdateCount>f.dataUpdateCount||m.errorUpdateCount>f.errorUpdateCount,isFetching:S,isRefetching:S&&!N,isLoadingError:E&&!D,isPaused:m.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:E&&D,isStale:Ag(e,t),refetch:this.refetch,isEnabled:bt(t.enabled,e)!==!1}}updateResult(){const e=this.#s,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#r=this.options,this.#i.data!==void 0&&(this.#h=this.#t),zu(t,e))return;this.#s=t;const r=(()=>{if(!e)return!0;const{notifyOnChangeProps:o}=this.options,c=typeof o=="function"?o():o;if(c==="all"||!c&&!this.#m.size)return!0;const u=new Set(c??this.#m);return this.options.throwOnError&&u.add("error"),Object.keys(this.#s).some(f=>{const h=f;return this.#s[h]!==e[h]&&u.has(h)})})();It.batch(()=>{r&&this.listeners.forEach(o=>{o(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}#j(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#v()}};function y3(e,t){return bt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&bt(t.retryOnMount,e)===!1)}function g0(e,t){return y3(e,t)||e.state.data!==void 0&&gp(e,t,t.refetchOnMount)}function gp(e,t,s){if(bt(t.enabled,e)!==!1&&bt(t.staleTime,e)!=="static"){const r=typeof s=="function"?s(e):s;return r==="always"||r!==!1&&Ag(e,t)}return!1}function x0(e,t,s,r){return(e!==t||bt(r.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&Ag(e,s)}function Ag(e,t){return bt(t.enabled,e)!==!1&&e.isStaleByTime(bt(t.staleTime,e))}var v3=class extends bS{#e;#t;#n;#s;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||jS(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#s?.continue()??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(e){const t=()=>{this.#i({type:"continue"})},s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#s=vS({fn:()=>this.options.mutationFn?this.options.mutationFn(e,s):Promise.reject(new Error("No mutationFn found")),onFail:(u,f)=>{this.#i({type:"failed",failureCount:u,error:f})},onPause:()=>{this.#i({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),o=this.state.status==="pending",c=!r.canStart();try{if(o)t();else{this.#i({type:"pending",variables:e,isPaused:c}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,s);const f=await this.options.onMutate?.(e,s);f!==this.state.context&&this.#i({type:"pending",context:f,variables:e,isPaused:c})}const u=await r.start();return await this.#n.config.onSuccess?.(u,e,this.state.context,this,s),await this.options.onSuccess?.(u,e,this.state.context,s),await this.#n.config.onSettled?.(u,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(u,null,e,this.state.context,s),this.#i({type:"success",data:u}),u}catch(u){try{await this.#n.config.onError?.(u,e,this.state.context,this,s)}catch(f){Promise.reject(f)}try{await this.options.onError?.(u,e,this.state.context,s)}catch(f){Promise.reject(f)}try{await this.#n.config.onSettled?.(void 0,u,this.state.variables,this.state.context,this,s)}catch(f){Promise.reject(f)}try{await this.options.onSettled?.(void 0,u,e,this.state.context,s)}catch(f){Promise.reject(f)}throw this.#i({type:"error",error:u}),u}finally{this.#s===r&&(this.#s=void 0),this.#n.runNext(this)}}#i(e){const t=s=>{switch(e.type){case"failed":return{...s,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};
vendor: 2,046 bytes, line 9
9case"pending":return{...s,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...s,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:e.error,failureCount:s.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),It.batch(()=>{this.#t.forEach(s=>{s.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function jS(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var b3=class extends ao{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,s){const r=new v3({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:s});return this.add(r),r}add(e){this.#e.add(e);const t=gu(e);if(typeof t=="string"){const s=this.#t.get(t);s?s.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=gu(e);if(typeof t=="string"){const s=this.#t.get(t);if(s)if(s.length>1){const r=s.indexOf(e);r!==-1&&s.splice(r,1)}else s[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=gu(e);if(typeof t=="string"){const s=this.#t.get(t)?.find(r=>r.state.status==="pending");return!s||s===e}else return!0}runNext(e){const t=gu(e);return typeof t=="string"?this.#t.get(t)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){It.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(s=>u0(t,s))}findAll(e={}){return this.getAll().filter(t=>u0(e,t))}notify(e){It.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>
9t.state.isPaused);return It.batch(()=>Promise.all(e.map(t=>t.continue().catch(un))))}};function gu(e){return e.options.scope?.id}var w3=class extends ao{#e;#t=void 0;#n;#s;constructor(t,s){super(),this.#e=t,this.setOptions(s),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const s=this.options;this.options=this.#e.defaultMutationOptions(t),zu(this.options,s)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),s?.mutationKey&&this.options.mutationKey&&Bi(s.mutationKey)!==Bi(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#i(),this.#r(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#r()}mutate(t,s){return this.#s=s,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#i(){const t=this.#n?.state??jS();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#r(t){It.batch(()=>{if(this.#s&&this.hasListeners()){const s=this.#t.variables,r=this.#t.context,o={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#s.onSuccess?.(t.data,s,r,o)}catch(c){Promise.reject(c)}try{this.#s.onSettled?.(t.data,null,s,r,o)}catch(c){Promise.reject(c)}}else if(t?.type==="error"){try{this.#s.onError?.(t.error,s,r,o)}catch(c){Promise.reject(c)}try{this.#s.onSettled?.(void 0,t.error,s,r,o)}catch(c){Promise.reject(c)}}}this.listeners.forEach(s=>{s(this.#t)})})}},j3=class extends ao{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,s){const r=t.queryKey,o=t.queryHash??Sg(r,t);let c=this.get(o);return c||(c=new g3({client:e,queryKey:r,queryHash:o,options:e.defaultQueryOptions(t),state:s,defaultOptions:e.getQueryDefaults(r)}),this.add(c)),c}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){It.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(s=>c0(t,s))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(s=>c0(e,s)):t}notify(e){It.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){It.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){It.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},S3=class{#e;#t;#n;#s;#i;#r;#a;#l;constructor(e={}){this.#e=e.queryCache||new j3,this.#t=e.mutationCache||new b3,this.#n=e.defaultOptions||{},this.#s=new Map,this.#i=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#a=Tg.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#l=od.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#r--,this.#r===0&&(this.#a?.(),this.#a=void 0,this.#l?.(),this.#l=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),s=this.#e.build(this,t),r=s.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime(bt(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:s})=>[t,s.data])}setQueryData(e,t,s){const r=this.defaultQueryOptions({queryKey:e}),o=this.#e.get(r.queryHash)?.state.data,c=n3(t,o);if(c!==void 0)return this.#e.build(this,r).setData(c,{...s,manual:!0})}
9setQueriesData(e,t,s){return It.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,s)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;It.batch(()=>{t.findAll(e).forEach(s=>{t.remove(s)})})}resetQueries(e,t){const s=this.#e;return It.batch(()=>{const r=s.findAll(e),o=new Set(r);return r.forEach(c=>{c.reset()}),this.refetchQueries({type:"active",predicate:c=>o.has(c)},t)})}cancelQueries(e,t={}){const s={revert:!0,...t},r=It.batch(()=>this.#e.findAll(e).map(o=>o.cancel(s)));return Promise.all(r).then(un).catch(un)}invalidateQueries(e,t={}){return It.batch(()=>(this.#e.findAll(e).forEach(s=>{s.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const s={...t,cancelRefetch:t.cancelRefetch??!0},r=It.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let c=o.fetch(void 0,s);return s.throwOnError||(c=c.catch(un)),o.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(r).then(un)}async query(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const s=this.#e.build(this,t),r=s.isStaleByTime(bt(t.staleTime,s))?await s.fetch(t):s.state.data,o=t.select;return o?o(r):r}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const s=this.#e.build(this,t);return s.isStaleByTime(bt(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(un).catch(un)}infiniteQuery(e){return e._type="infinite",this.query(e)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(un).catch(un)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return od.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#s.set(Bi(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#s.values()],s={};return t.forEach(r=>{Ja(e,r.queryKey)&&Object.assign(s,r.defaultOptions)}),s}setMutationDefaults(e,t){this.#i.set(Bi(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#i.values()],s={};return t.forEach(r=>{Ja(e,r.mutationKey)&&Object.assign(s,r.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Sg(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Ng&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};const SS=y.createContext(!1),N3=()=>y.useContext(SS);SS.Provider;function C3(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const E3=y.createContext(C3()),T3=()=>y.useContext(E3),A3=(e,t,s)=>{const r=s?.state.error&&typeof e.throwOnError=="function"?Cg(e.throwOnError,[s.state.error,s]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},R3=e=>{y.useEffect(()=>{e.clearReset()},[e])},k3=({result:e,errorResetBoundary:t,throwOnError:s,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||Cg(s,[e.error,r])),M3=e=>{if(e.suspense){const s=o=>o==="static"?o:Math.max(o??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...o)=>s(r(...o)):s(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},O3=(e,t)=>e?.suspense&&t.isPending,D3=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function P3(e,t,s){const r=N3(),o=T3(),c=mr(),u=c.defaultQueryOptions(e),f=c.getQueryCache().get(u.queryHash),h=e.subscribed!==!1;u._optimisticResults=r?"isRestoring":h?"optimistic":void 0,M3(u),A3(u,o,f),R3(o);const[m]=y.useState(()=>new t(c,u)),p=m.getOptimisticResult(u),x=!r&&h;if(y.useSyncExternalStore(y.useCallback(v=>{const j=x?m.subscribe(It.batchCalls(v)):un;return m.updateResult(),j},[m,x]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),y.useEffect(()=>{m.setOptions(u)},[u,m]),O3(u,p))throw D3(u,m,o);if(k3({result:p,errorResetBoundary:o,throwOnError:u.throwOnError,query:f,suspense:u.suspense}))throw p.error;return u.notifyOnChangeProps?p:m.trackResult(p)}function pr(e,t){return P3(e,x3)}function gn(e,t){const s=mr(),[r]=y.useState(()=>new w3(s,e));y.useEffect(()=>{r.setOptions(e)},[r,e]);const o=y.useSyncExternalStore(y.useCallback(u=>r.subscribe(It.batchCalls(u)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),c=y.useCallback((...u)=>{r.mutate(u[0],u[1]).catch(un)},[r]);if(o.error&&Cg(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:c,mutateAsync:o.mutate}}function y0(e){if(e instanceof Error)return e;if(typeof e=="string")return new Error(e);try{return new Error(JSON.stringify(e))}catch{return new Error(String(e))}}function _3({error:e,resetError:t}){return a.jsx("div",{className:"min-h-screen w-full flex items-center justify-center bg-gray-50 p-6",children:a.jsxs("div",{className:"max-w-lg w-full text-center",children:[a.jsx("h1",{className:"text-xl font-semibold text-gray-900",children:"Something went wrong"}),a.jsx("p",{className:"mt-2 text-sm text-gray-600",children:"This part of the app hit an error. The rest of the app is still running."}),null,a.jsx("button",{type:"button",onClick:t,className:"mt-4 rounded bg-gray-900 px-4 py-2 text-sm text-white hover:bg-gray-700",children:"Try again"})]})})}class NS extends y.Component{state={error:null};static getDerivedStateFromError(t){return{error:y0(t)}}componentDidCatch(t,s){console.error("ErrorBoundary caught an error:",y0(t),s.componentStack)}componentDidUpdate(t){this.state.error!==null&&t.resetKey!==this.props.resetKey&&this.resetError()}resetError=()=>{this.setState({error:null})};render(){const{error:t}=this.state;if(t===null)return this.props.children;const s=this.props.FallbackComponent??_3;return a.jsx(s,{error:t,resetError:this.resetError})}}var eo=fS(),L3=Object.defineProperty,oo=(e,t)=>L3(e,"name",{value:t,configurable:!0}),CS=!!(typeof window<"u"&&window.document&&window.document.createElement);function ge(e,t,{checkForDefaultPrevented:s=!0}={}
9){return oo(function(o){if(e?.(o),s===!1||!o||!o.defaultPrevented)return t?.(o)},"handleEvent")}oo(ge,"composeEventHandlers");function U3(e){if(!CS)throw new Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window}oo(U3,"getOwnerWindow");function xp(e){if(!CS)throw new Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}oo(xp,"getOwnerDocument");function ES(e,t=!1){const{activeElement:s}=xp(e);if(!s?.nodeName)return null;if(TS(s)&&s.contentDocument)return ES(s.contentDocument.body,t);if(t){const r=s.getAttribute("aria-activedescendant");if(r){const o=xp(s).getElementById(r);if(o)return o}}return s}oo(ES,"getActiveElement");function TS(e){return e.tagName==="IFRAME"}oo(TS,"isFrame");var I3=Object.defineProperty,Rg=(e,t)=>I3(e,"name",{value:t,configurable:!0});function yp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Rg(yp,"setRef");function AS(...e){return t=>{let s=!1;const r=e.map(o=>{const c=yp(o,t);return!s&&typeof c=="function"&&(s=!0),c});if(s)return()=>{for(let o=0;o<r.length;o++){const c=r[o];typeof c=="function"?c():yp(e[o],null)}}}}Rg(AS,"composeRefs");function Ge(...e){return y.useCallback(AS(...e),e)}Rg(Ge,"useComposedRefs");var z3=Object.defineProperty,Jn=(e,t)=>z3(e,"name",{value:t,configurable:!0});function F3(e,t){const s=y.createContext(t);s.displayName=e+"Context";const r=Jn(c=>{const{children:u,...f}=c,h=y.useMemo(()=>f,Object.values(f));return a.jsx(s.Provider,{value:h,children:u})},"Provider");r.displayName=e+"Provider";function o(c,u={}){const{optional:f=!1}=u,h=y.useContext(s);if(h)return h;if(t!==void 0)return t;if(!f)throw new Error(`\`${c}\` must be used within \`${e}\``)}return Jn(o,"useContext"),[r,o]}Jn(F3,"createContext");function ss(e,t=[]){let s=[];function r(c,u){const f=y.createContext(u);f.displayName=c+"Context";const h=s.length;s=[...s,u];const m=Jn(x=>{const{scope:v,children:j,...w}=x,C=v?.[e]?.[h]||f,S=y.useMemo(()=>w,Object.values(w));return a.jsx(C.Provider,{value:S,children:j})},"Provider");m.displayName=c+"Provider";function p(x,v,j={}){const{optional:w=!1}=j,C=v?.[e]?.[h]||f,S=y.useContext(C);if(S)return S;if(u!==void 0)return u;if(!w)throw new Error(`\`${x}\` must be used within \`${c}\``)}return Jn(p,"useContext"),[m,p]}Jn(r,"createContext");const o=Jn(()=>{const c=s.map(u=>y.createContext(u));return Jn(function(f){const h=f?.[e]||c;return y.useMemo(()=>({[`__scope${e}`]:{...f,[e]:h}}),[f,h])},"useScope")},"createScope");return o.scopeName=e,[r,RS(o,...t)]}Jn(ss,"createContextScope");function RS(...e){const t=e[0];if(e.length===1)return t;const s=Jn(()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return Jn(function(c){const u=r.reduce((f,{useScope:h,scopeName:m})=>{const x=h(c)[`__scope${m}`];return{...f,...x}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])},"useComposedScopes")},"createScope");return s.scopeName=t.scopeName,s}Jn(RS,"composeContextScopes");var V3=Object.defineProperty,ps=(e,t)=>V3(e,"name",{value:t,configurable:!0});function dr(e){const t=y.forwardRef((s,r)=>{let{children:o,...c}=s,u=null,f=!1;const h=[];vp(o)&&typeof xu=="function"&&(o=xu(o._payload)),y.Children.forEach(o,v=>{if(PS(v)){f=!0;const j=v;let w="child"in j.props?j.props.child:j.props.children;vp(w)&&typeof xu=="function"&&(w=xu(w._payload)),u=$3(j,w),h.push(u?.props?.children)}else h.push(v)}),u?u=y.cloneElement(u,void 0,h):!f&&y.Children.count(o)===1&&y.isValidElement(o)&&(u=o);const m=u?DS(u):void 0,p=Ge(r,m);if(!u){if(o||o===0)throw new Error(f?K3(e):H3(e));return o}const x=OS(c,u.props??{});return u.type!==y.Fragment&&(x.ref=r?p:m),y.cloneElement(u,x)});return t.displayName=`${e}.Slot`,t}ps(dr,"createSlot");var B3=dr("Slot"),kS=Symbol.for("radix.slottable");function MS(e){const t=ps(s=>"child"in s?s.children(s.child):s.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=kS,t}ps(MS,"createSlottable");var $3=ps((e,t)=>{if("child"in e.props){const s=e.props.child;return y.isValidElement(s)?y.cloneElement(s,void 0,e.props.children(s.props.children)):null}return y.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function OS(e,t){const s={...t};for(const r in t){const o=e[r],c=t[r];/^on[A-Z]/.test(r)?o&&c?s[r]=(...f)=>{const h=c(...f);return o(...f),h}:o&&(s[r]=o):r==="style"?s[r]={...o,...c}
9:r==="className"&&(s[r]=[o,c].filter(Boolean).join(" "))}return{...e,...s}}ps(OS,"mergeProps");function DS(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}ps(DS,"getElementRef");function PS(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===kS}ps(PS,"isSlottable");var q3=Symbol.for("react.lazy");function vp(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===q3&&"_payload"in e&&_S(e._payload)}ps(vp,"isLazyComponent");function _S(e){return typeof e=="object"&&e!==null&&"then"in e}ps(_S,"isPromiseLike");var H3=ps(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),K3=ps(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),xu=Gi[" use ".trim().toString()],G3=Object.defineProperty,Kt=(e,t)=>G3(e,"name",{value:t,configurable:!0});function Ud(e){const t=e+"CollectionProvider",[s,r]=ss(t),[o,c]=s(t,{collectionRef:{current:null},itemMap:new Map}),u=Kt(C=>{const{scope:S,children:N}=C,E=y.useRef(null),R=y.useRef(new Map).current;return a.jsx(o,{scope:S,itemMap:R,collectionRef:E,children:N})},"CollectionProvider");u.displayName=t;const f=e+"CollectionSlot",h=dr(f),m=y.forwardRef((C,S)=>{const{scope:N,children:E}=C,R=c(f,N),D=Ge(S,R.collectionRef);return a.jsx(h,{ref:D,children:E})});m.displayName=f;const p=e+"CollectionItemSlot",x="data-radix-collection-item",v=dr(p),j=y.forwardRef((C,S)=>{const{scope:N,children:E,...R}=C,D=y.useRef(null),A=Ge(S,D),_=c(p,N);return y.useEffect(()=>(_.itemMap.set(D,{ref:D,...R}),()=>{_.itemMap.delete(D)})),a.jsx(v,{[x]:"",ref:A,children:E})});j.displayName=p;function w(C){const S=c(e+"CollectionConsumer",C);return y.useCallback(()=>{const E=S.collectionRef.current;if(!E)return[];const R=Array.from(E.querySelectorAll(`[${x}]`));return Array.from(S.itemMap.values()).sort((_,F)=>R.indexOf(_.ref.current)-R.indexOf(F.ref.current))},[S.collectionRef,S.itemMap])}return Kt(w,"useCollection"),[{Provider:u,Slot:m,ItemSlot:j},w,r]}Kt(Ud,"createCollection");var v0=new WeakMap,Tt,_n,Tm=(_n=class extends Map{constructor(s){super(s);Zw(this,Tt);bm(this,Tt,[...super.keys()]),v0.set(this,!0)}set(s,r){return v0.get(this)&&(this.has(s)?on(this,Tt)[on(this,Tt).indexOf(s)]=s:on(this,Tt).push(s)),super.set(s,r),this}insert(s,r,o){const c=this.has(r),u=on(this,Tt).length,f=kg(s);let h=f>=0?f:u+f;const m=h<0||h>=u?-1:h;if(m===this.size||c&&m===this.size-1||m===-1)return this.set(r,o),this;const p=this.size+(c?0:1);f<0&&h++;const x=[...on(this,Tt)];let v,j=!1;for(let w=h;w<p;w++)if(h===w){let C=x[w];x[w]===r&&(C=x[w+1]),c&&this.delete(r),v=this.get(C),this.set(r,o)}else{!j&&x[w-1]===r&&(j=!0);const C=x[j?w:w-1],S=v;v=this.get(C),this.delete(C),this.set(C,S)}return this}with(s,r,o){const c=new _n(this);return c.insert(s,r,o),c}before(s){const r=on(this,Tt).indexOf(s)-1;if(!(r<0))return this.entryAt(r)}setBefore(s,r,o){const c=on(this,Tt).indexOf(s);return c===-1?this:this.insert(c,r,o)}after(s){let r=on(this,Tt).indexOf(s);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(s,r,o){const c=on(this,Tt).indexOf(s);return c===-1?this:this.insert(c+1,r,o)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return bm(this,Tt,[]),super.clear()}delete(s){const r=super.delete(s);return r&&on(this,Tt).splice(on(this,Tt).indexOf(s),1),r}deleteAt(s){const r=this.keyAt(s);return r!==void 0?this.delete(r):!1}at(s){const r=Fu(on(this,Tt),s);if(r!==void 0)return this.get(r)}entryAt(s){const r=Fu(on(this,Tt),s);if(r!==void 0)return[r,this.get(r)]}indexOf(s){return on(this,Tt).indexOf(s)}keyAt(s){return Fu(on(this,Tt),s)}from(s,r){const o=this.indexOf(s);if(o===-1)return;let c=o+r;return c<0&&(c=0),c>=this.size&&(c=this.size-1),this.at(c)}keyFrom(s,r){const o=this.indexOf(s);if(o===-1)return;let c=o+r;return c<0&&(c=0),c>=this.size&&(c=this.size-1),this.keyAt(c)}find(s,r){let o=0;for(const c of this){if(Reflect.apply(s,r,[c,o,this]))return c;o++}}findIndex(s,r){let o=0;for(const c of this){if(Reflect.apply(s,r,[c,o,this]))return o;o++}return-1}filter(s,r){const o=[];let c=0;for(const u of this)Reflect.apply(s,r,[u,c,this])&&o.push(u),c++;return new _n(o)}map(s,r){const o=[];let c=0;for(const u of this)o.push([u[0],Reflect.apply(s,r,[u,c,this])]),c++;return new _n(o)}reduce(...s){const[r,o]=s;let c=0,u=o??this.at(0);for(const f of this)c===0&&s.length===1?u=f:u=Reflect.apply(r,this,[u,f,c,this]),c++;return u}reduceRight(...s){const[r,o]=s;let c=o??this.at(-1);for(let u=this.size-1;u>=0;u--){const f=this.at(u);u===this.size-1&&s.length===1?c=f:c=Reflect.apply(r,this,[c,f,u,this])}return c}toSorted(s){const r=[...this.entries()].sort(s);return new _n(r)}toReversed(){const s=new _n;for(let r=this.size-1;r>=0;r--){const o=this.keyAt(r),c=this.get(o);s.set(o,c)}return s}toSpliced(...s){const r=[...this.entries()];return r.splice(...s),new _n(r)}slice(s,r){const o=new _n;let c=this.size-1;if(s===void 0)return o;s<0&&(s=s+this.size),r!==void 0&&r>0&&(c=r-1);for(let u=s;u<=c;u++){const f=this.keyAt(u),h=this.get(f);o.set(f,h)}return o}every(s,r){let o=0;for(const c of this){if(!Reflect.apply(s,r,[c,o,this]))return!1;o++}return!0}some(s,r){let o=0;for(const c of this){if(Reflect.apply(s,r,[c,o,this]))return!0;o++}return!1}},Tt=new WeakMap,Kt(_n,"OrderedDict"),_n);function Fu(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const s=LS(e,t);return s===-1?void 0:e[s]}Kt(Fu,"at");function LS(e,t){const s=e.length,r=kg(t),o=r>=0?r:s+r;return o<0||o>=s?-1:o}Kt(LS,"toSafeIndex");function kg(e){return e!==e||e===0?0:Math.trunc(e)}Kt(kg,"toSafeInteger");function Y3(e){const t=e+"CollectionProvider",[s,r]=ss(t),[o,c]=s(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Tm,setItemMap:Kt(()=>{},"setItemMap")}),u=Kt(({state:R,...D})=>R?a.jsx(h,{...D,state:R}):a.jsx(f,{...D}),"CollectionProvider");u.displayName=t;const f=Kt(R=>{const D=S();return a.jsx(h,{...R,state:D})},"CollectionInit");f.displayName=t+"Init";const h=Kt(R=>{const{scope:D,children:A,state:_}=R,F=y.useRef(null),[O,I]=y.useState(null),V=Ge(F,I),[H,k]=_;return y.useEffect(()=>{if(!O)return;const q=zS(()=>{});return q.observe(O,{childList:!0,subtree:!0}),()=>{q.disconnect()}},[O]),a.jsx(o,{scope:D,itemMap:H,setItemMap:k,collectionRef:V,collectionRefObject:F,collectionElement:O,children:A})},"CollectionProviderImpl");h.displayName=t+"Impl";const m=e+"CollectionSlot",p=dr(m),x=y.forwardRef((R,D)=>{const{scope:A,children:_}=R,F=c(m,A),O=Ge(D,F.collectionRef);return a.jsx(p,{ref:O,children:_})});x.displayName=m;
9const v=e+"CollectionItemSlot",j="data-radix-collection-item",w=dr(v),C=y.forwardRef((R,D)=>{const{scope:A,children:_,...F}=R,O=y.useRef(null),[I,V]=y.useState(null),H=Ge(D,O,V),k=c(v,A),{setItemMap:q}=k,J=y.useRef(F);US(J.current,F)||(J.current=F);const re=J.current;return y.useEffect(()=>{const U=re;return q(L=>I?L.has(I)?L.set(I,{...U,element:I}).toSorted(bp):(L.set(I,{...U,element:I}),L.toSorted(bp)):L),()=>{q(L=>!I||!L.has(I)?L:(L.delete(I),new Tm(L)))}},[I,re,q]),a.jsx(w,{[j]:"",ref:H,children:_})});C.displayName=v;function S(){return y.useState(new Tm)}Kt(S,"useInitCollection");function N(R){const{itemMap:D}=c(e+"CollectionConsumer",R);return D}return Kt(N,"useCollection"),[{Provider:u,Slot:x,ItemSlot:C},{createCollectionScope:r,useCollection:N,useInitCollection:S}]}Kt(Y3,"createCollection");function US(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const s=Object.keys(e),r=Object.keys(t);if(s.length!==r.length)return!1;for(const o of s)if(!Object.prototype.hasOwnProperty.call(t,o)||e[o]!==t[o])return!1;return!0}Kt(US,"shallowEqual");function IS(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Kt(IS,"isElementPreceding");function bp(e,t){return!e[1].element||!t[1].element?0:IS(e[1].element,t[1].element)?-1:1}Kt(bp,"sortByDocumentPosition");function zS(e){return new MutationObserver(s=>{for(const r of s)if(r.type==="childList"){e();return}})}Kt(zS,"getChildListObserver");var Q3=Object.defineProperty,W3=(e,t)=>Q3(e,"name",{value:t,configurable:!0}),X3=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Xe=X3.reduce((e,t)=>{const s=dr(`Primitive.${t}`),r=y.forwardRef((o,c)=>{const{asChild:u,...f}=o,h=u?s:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(h,{...f,ref:c})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Id(e,t){e&&eo.flushSync(()=>e.dispatchEvent(t))}W3(Id,"dispatchDiscreteCustomEvent");var Z3=Object.defineProperty,J3=(e,t)=>
9Z3(e,"name",{value:t,configurable:!0});function In(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>((...s)=>t.current?.(...s)),[])}J3(In,"useCallbackRef");var eM=Object.defineProperty,Ut=(e,t)=>eM(e,"name",{value:t,configurable:!0}),wp="dismissableLayer.update",tM="dismissableLayer.pointerDownOutside",nM="dismissableLayer.focusOutside",b0,Mg=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),zd=y.forwardRef(Ut(function(t,s){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:o=!1,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:h,onDismiss:m,...p}=t,x=y.useContext(Mg),[v,j]=y.useState(null),w=v?.ownerDocument??globalThis?.document,[,C]=y.useState({}),S=Ge(s,j),N=Array.from(x.layers),[E]=[...x.layersWithOutsidePointerEventsDisabled].slice(-1),R=E?N.indexOf(E):-1,D=v?N.indexOf(v):-1,A=x.layersWithOutsidePointerEventsDisabled.size>0,_=D>=R,F=y.useRef(!1),O=VS(k=>{u?.(k),h?.(k),k.defaultPrevented||m?.()},{ownerDocument:w,deferPointerDownOutside:o,isDeferredPointerDownOutsideRef:F,dismissableSurfaces:x.dismissableSurfaces,shouldHandlePointerDownOutside:y.useCallback(k=>{if(!(k instanceof Node))return!1;const q=[...x.branches].some(J=>J.contains(k));return _&&!q},[x.branches,_])}),I=BS(k=>{if(o&&F.current)return;const q=k.target;[...x.branches].some(re=>re.contains(q))||(f?.(k),h?.(k),k.defaultPrevented||m?.())},w),V=v?D===N.length-1:!1,H=In(k=>{k.key==="Escape"&&(c?.(k),!k.defaultPrevented&&m&&(k.preventDefault(),m()))});return y.useEffect(()=>{if(V)return w.addEventListener("keydown",H,{capture:!0}),()=>w.removeEventListener("keydown",H,{capture:!0})},[w,V,H]),y.useEffect(()=>{if(v)return r&&(x.layersWithOutsidePointerEventsDisabled.size===0&&(b0=w.body.style.pointerEvents,w.body.style.pointerEvents="none"),x.layersWithOutsidePointerEventsDisabled.add(v)),x.layers.add(v),jp(),()=>{r&&(x.layersWithOutsidePointerEventsDisabled.delete(v),x.layersWithOutsidePointerEventsDisabled.size===0&&(w.body.style.pointerEvents=b0))}},[v,w,r,x]),y.useEffect(()=>()=>{v&&(x.layers.delete(v),x.layersWithOutsidePointerEventsDisabled.delete(v),jp())},[v,x]),y.useEffect(()=>{const k=Ut(()=>C({}),"handleUpdate");return document.addEventListener(wp,k),()=>document.removeEventListener(wp,k)},[]),a.jsx(Xe.div,{...p,ref:S,style:{pointerEvents:A?_?"auto":"none":void 0,...t.style},onFocusCapture:ge(t.onFocusCapture,I.onFocusCapture),onBlurCapture:ge(t.onBlurCapture,I.onBlurCapture),onPointerDownCapture:ge(t.onPointerDownCapture,O.onPointerDownCapture)})},"DismissableLayer")),sM=y.forwardRef(Ut(function(t,s){const r=y.useContext(Mg),o=y.useRef(null),c=Ge(s,o);return y.useEffect(()=>{const u=o.current;if(u)return r.branches.add(u),()=>{r.branches.delete(u)}},[r.branches]),a.jsx(Xe.div,{...t,ref:c})},"DismissableLayerBranch"));function FS(){const e=y.useContext(Mg),[t,s]=y.useState(null);return y.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),s}Ut(FS,"useDismissableLayerSurface");var rM=Ut(()=>!0,"IS_TRUE");function VS(e,t){const{ownerDocument:s=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:c,shouldHandlePointerDownOutside:u=rM}=t,f=In(e),h=y.useRef(!1),m=y.useRef(!1),p=y.useRef(new Map),x=y.useRef(()=>{});return y.useEffect(()=>{function v(){m.current=!1,o.current=!1,p.current.clear()}Ut(v,"resetOutsideInteraction");function j(){return Array.from(p.current.values()).some(Boolean)}Ut(j,"isOutsideInteractionIntercepted");function w(R){if(!m.current)return;const D=R.target;D instanceof Node&&[...c].some(_=>_.contains(D))||p.current.set(R.type,!0),R.type==="click"&&window.setTimeout(()=>{m.current&&x.current()},0)}Ut(w,"handleInteractionCapture");function C(R){m.current&&p.current.set(R.type,!1)}Ut(C,"handleInteractionBubble");const S=Ut(R=>{if(R.target&&!h.current){let D=function(){s.removeEventListener("click",x.current);const _=j();v(),_||Og(tM,f,A,{discrete:!0})};if(Ut(D,"handleAndDispatchPointerDownOutsideEvent"),!u(R.target)){s.removeEventListener("click",x.
9current),v(),h.current=!1;return}const A={originalEvent:R};m.current=!0,o.current=r&&R.button===0,p.current.clear(),!r||R.button!==0?D():(s.removeEventListener("click",x.current),x.current=D,s.addEventListener("click",x.current,{once:!0}))}else s.removeEventListener("click",x.current),v();h.current=!1},"handlePointerDown"),N=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const R of N)s.addEventListener(R,w,!0),s.addEventListener(R,C);const E=window.setTimeout(()=>{s.addEventListener("pointerdown",S)},0);return()=>{window.clearTimeout(E),s.removeEventListener("pointerdown",S),s.removeEventListener("click",x.current);for(const R of N)s.removeEventListener(R,w,!0),s.removeEventListener(R,C)}},[s,f,r,o,c,u]),{onPointerDownCapture:Ut(()=>h.current=!0,"onPointerDownCapture")}}Ut(VS,"usePointerDownOutside");function BS(e,t=globalThis?.document){const s=In(e),r=y.useRef(!1);return y.useEffect(()=>{const o=Ut(c=>{c.target&&!r.current&&Og(nM,s,{originalEvent:c},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,s]),{onFocusCapture:Ut(()=>r.current=!0,"onFocusCapture"),onBlurCapture:Ut(()=>r.current=!1,"onBlurCapture")}}Ut(BS,"useFocusOutside");function jp(){const e=new CustomEvent(wp);document.dispatchEvent(e)}Ut(jp,"dispatchUpdate");function Og(e,t,s,{discrete:r}){const o=s.originalEvent.target,c=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:s});t&&o.addEventListener(e,t,{once:!0}),r?Id(o,c):o.dispatchEvent(c)}Ut(Og,"handleAndDispatchCustomEvent");var iM=zd,aM=sM,pn=globalThis?.document?y.useLayoutEffect:()=>{},oM=Object.defineProperty,lM=(e,t)=>oM(e,"name",{value:t,configurable:!0}),Fd=y.forwardRef(lM(function(t,s){const{container:r,...o}=t,[c,u]=y.useState(!1);pn(()=>u(!0),[]);const f=r||c&&globalThis?.document?.body;return f?eo.createPortal(a.jsx(Xe.div,{...o,ref:s}),f):null},"Portal")),cM=Object.defineProperty,fr=(e,t)=>cM(e,"name",{value:t,configurable:!0});function $S(e,t){return y.useReducer((s,r)=>t[s][r]??s,e)}fr($S,"useStateMachine");var Ps=fr(e=>{const{present:t,children:s}=e,r=qS(t),o=typeof s=="function"?s({present:r.isPresent}):y.Children.only(s),c=HS(r.ref,KS(o));return typeof s=="function"||r.isPresent?y.cloneElement(o,{ref:c}):null},"Presence");function qS(e){const[t,s]=y.useState(),r=y.useRef(null),o=y.useRef(e),c=y.useRef("none"),u=y.useRef(void 0),f=e?"mounted":"unmounted",[h,m]=$S(f,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{h==="mounted"?(c.current=u.current??qa(r.current),u.current=void 0):c.current="none"},[h]),pn(()=>{const p=r.current,x=o.current;if(x!==e){const j=c.current,w=qa(p);e?(u.current=w,m("MOUNT")):w==="none"||p?.display==="none"?m("UNMOUNT"):m(x&&j!==w?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,m]),pn(()=>
9{if(t){let p;const x=t.ownerDocument.defaultView??window,v=fr(w=>{const S=qa(r.current).includes(CSS.escape(w.animationName));if(w.target===t&&S&&(m("ANIMATION_END"),!o.current)){const N=t.style.animationFillMode;t.style.animationFillMode="forwards",p=x.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=N)})}},"handleAnimationEnd"),j=fr(w=>{w.target===t&&(c.current=qa(r.current))},"handleAnimationStart");return t.addEventListener("animationstart",j),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{x.clearTimeout(p),t.removeEventListener("animationstart",j),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else m("ANIMATION_END")},[t,m]),{isPresent:["mounted","unmountSuspended"].includes(h),ref:y.useCallback(p=>{if(p){const x=getComputedStyle(p);r.current=x,u.current=qa(x)}else r.current=null;s(p)},[])}}fr(qS,"usePresence");function Sp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}fr(Sp,"setRef");function HS(...e){const t=y.useRef(e);return t.current=e,y.useCallback(s=>{const r=t.current;let o=!1;const c=r.map(u=>{const f=Sp(u,s);return!o&&typeof f=="function"&&(o=!0),f});if(o)return()=>{for(let u=0;u<c.length;u++){const f=c[u];typeof f=="function"?f():Sp(r[u],null)}}},[])}fr(HS,"useStableComposedRefs");function qa(e){return e?.animationName||"none"}fr(qa,"getAnimationName");function KS(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}fr(KS,"getElementRef");var uM=Object.defineProperty,dM=(e,t)=>uM(e,"name",{value:t,configurable:!0}),w0=Gi[" useEffectEvent ".trim().toString()],j0=Gi[" useInsertionEffect ".trim().toString()];function GS(e){if(typeof w0=="function")return w0(e);const t=y.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof j0=="function"?j0(()=>{t.current=e}):pn(()=>{t.current=e}),y.useMemo(()=>((...s)=>t.current?.(...s)),[])}dM(GS,"useEffectEvent");var fM=Object.defineProperty,Zl=(e,t)=>fM(e,"name",{value:t,configurable:!0}),hM=Gi[" useInsertionEffect ".trim().toString()]||pn;function lo({prop:e,defaultProp:t,onChange:s=Zl(()=>{},"onChange"),caller:r}){const[o,c,u]=YS({defaultProp:t,onChange:s}),f=e!==void 0,h=f?e:o,m=y.useCallback(p=>{if(f){const x=QS(p)?p(e):p;x!==e&&u.current?.(x)}else c(p)},[f,e,c,u]);return[h,m]}Zl(lo,"useControllableState");function YS({defaultProp:e,onChange:t}){const[s,r]=y.useState(e),o=y.useRef(s),c=y.useRef(t);return hM(()=>{c.current=t},[t]),y.useEffect(()=>{o.current!==s&&(c.current?.(s),o.current=s)},[s,o]),[s,r,c]}Zl(YS,"useUncontrolledState");function QS(e){return typeof e=="function"}Zl(QS,"isFunction");var S0=Symbol("RADIX:SYNC_STATE");function mM(e,t,s,r){const{prop:o,defaultProp:c,onChange:u,caller:f}=t,h=o!==void 0,m=GS(u),p=[{...s,state:c}];r&&p.push(r);const[x,v]=y.useReducer((S,N)=>{if(N.type===S0)return{...S,state:N.state};const E=e(S,N);return h&&!Object.is(E.state,S.state)&&m(E.state),E},...p),j=x.state,w=y.useRef(j);y.useEffect(()=>{w.current!==j&&(w.current=j,h||m(j))},[j,w,h]);const C=y.useMemo(()=>o!==void 0?{...x,state:o}:x,[x,o]);return y.useEffect(()=>{h&&!Object.is(o,x.state)&&v({type:S0,state:o})},[o,x.state,h]),[C,v]}Zl(mM,"useControllableStateReducer");var pM=Object.defineProperty,gM=(e,t)=>pM(e,"name",{value:t,configurable:!0}),xM=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Dg=y.forwardRef(gM(function(t,s){return a.jsx(Xe.span,{...t,ref:s,style:{...xM,...t.style}})},"VisuallyHidden")),yM=Dg,vM=Object.defineProperty,at=(e,t)=>vM(e,"name",{value:t,configurable:!0}),WS="ToastProvider",[Pg,XS,bM]=Ud("Toast"),[ZS,Lq]=ss("Toast",[bM]),[wM,Vd]=ZS(WS),jM=at(e=>{const{__scopeToast:t,label:s="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:c=50,announcerContainer:u,children:f}=e,[h,m]=y.useState(null),[p,x]=y.useState(0),v=y.useRef(!1);return s.trim()||console.error(`Invalid prop \`label\` supplied to \`${WS}\`. Expected non-empty \`string\`.`),a.jsx(Pg.Provider,{scope:t,children:a.jsx(wM,{scope:t,label:s,duration:r,swipeDirection:o,swipeThreshold:c,toastCount:p,viewport:h,onViewportChange:m,onToastAdd:y.useCallback(()=>x(j=>j+1),[]),onToastRemove:y.useCallback(()=>x(j=>j-1),[]),isClosePausedRef:v,announcerContainer:u,children:f})})},"ToastProvider"),SM="ToastViewport",NM=["F8"],Np="toast.viewportPause",Cp="toast.viewportResume",CM=y.forwardRef(at(function(t,s){const{__scopeToast:r,hotkey:o=NM,label:c="Notifications ({hotkey})",...u}=t,f=Vd(SM,r),h=XS(r),m=y.useRef(null),p=y.useRef(null),x=y.useRef(null),v=y.useRef(null),j=Ge(s,v,f.onViewportChange),w=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),C=f.toastCount>0;y.useEffect(()=>{const N=at(E=>{o.length!==0&&o.every(D=>E[D]||E.code===D)&&v.current?.focus()},"handleKeyDown");return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[o]),y.useEffect(()=>{const N=m.current,E=v.current;
9if(C&&N&&E){const R=at(()=>{if(!f.isClosePausedRef.current){const F=new CustomEvent(Np);E.dispatchEvent(F),f.isClosePausedRef.current=!0}},"handlePause"),D=at(()=>{if(f.isClosePausedRef.current){const F=new CustomEvent(Cp);E.dispatchEvent(F),f.isClosePausedRef.current=!1}},"handleResume"),A=at(F=>{!N.contains(F.relatedTarget)&&D()},"handleFocusOutResume"),_=at(()=>{N.contains(document.activeElement)||D()},"handlePointerLeaveResume");return N.addEventListener("focusin",R),N.addEventListener("focusout",A),N.addEventListener("pointermove",R),N.addEventListener("pointerleave",_),window.addEventListener("blur",R),window.addEventListener("focus",D),()=>{N.removeEventListener("focusin",R),N.removeEventListener("focusout",A),N.removeEventListener("pointermove",R),N.removeEventListener("pointerleave",_),window.removeEventListener("blur",R),window.removeEventListener("focus",D)}}},[C,f.isClosePausedRef]);const S=y.useCallback(({tabbingDirection:N})=>{const R=h().map(D=>{const A=D.ref.current,_=[A,...sN(A)];return N==="forwards"?_:_.reverse()});return(N==="forwards"?R.reverse():R).flat()},[h]);return y.useEffect(()=>{const N=v.current;if(N){const E=at(R=>{const D=R.altKey||R.ctrlKey||R.metaKey;if(R.key==="Tab"&&!D){const _=document.activeElement,F=R.shiftKey;if(R.target===N&&F){p.current?.focus();return}const V=S({tabbingDirection:F?"backwards":"forwards"}),H=V.findIndex(k=>k===_);Vu(V.slice(H+1))?R.preventDefault():F?p.current?.focus():x.current?.focus()}},"handleKeyDown");return N.addEventListener("keydown",E),()=>N.removeEventListener("keydown",E)}},[h,S]),a.jsxs(aM,{ref:m,role:"region","aria-label":c.replace("{hotkey}",w),tabIndex:-1,style:{pointerEvents:C?void 0:"none"},children:[C&&a.jsx(N0,{ref:p,onFocusFromOutsideViewport:()=>{const N=S({tabbingDirection:"forwards"});Vu(N)}}),a.jsx(Pg.Slot,{scope:r,children:a.jsx(Xe.ol,{tabIndex:-1,...u,ref:j})}),C&&a.jsx(N0,{ref:x,onFocusFromOutsideViewport:()=>{const N=S({tabbingDirection:"backwards"});Vu(N)}})]})},"ToastViewport")),EM="ToastFocusProxy",N0=y.forwardRef(at(function(t,s){const{__scopeToast:r,onFocusFromOutsideViewport:o,...c}=t,u=Vd(EM,r);return a.jsx(Dg,{tabIndex:0,...c,ref:s,style:{position:"fixed"},onFocus:f=>{const h=f.relatedTarget;!u.viewport?.contains(h)&&o()}})},"ToastFocusProxy")),Bd="Toast",TM="toast.swipeStart",AM="toast.swipeMove",RM="toast.swipeCancel",kM="toast.swipeEnd",MM=y.forwardRef(at(function(t,s){const{forceMount:r,open:o,defaultOpen:c,onOpenChange:u,...f}=t,[h,m]=lo({prop:o,defaultProp:c??!0,onChange:u,caller:Bd});return a.jsx(Ps,{present:r||h,children:a.jsx(PM,{open:h,...f,ref:s,onClose:()=>m(!1),onPause:In(t.onPause),onResume:In(t.onResume),onSwipeStart:ge(t.onSwipeStart,p=>{p.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ge(t.onSwipeMove,p=>{const{x,y:v}=p.detail.delta;p.currentTarget.setAttribute("data-swipe","move"),p.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${x}px`),p.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${v}px`)}),onSwipeCancel:ge(t.onSwipeCancel,p=>{p.currentTarget.setAttribute("data-swipe","cancel"),p.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),p.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),p.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),p.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:ge(t.onSwipeEnd,p=>{const{x,y:v}=p.detail.delta;p.currentTarget.setAttribute("data-swipe","end"),p.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),p.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),p.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${x}px`),p.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${v}px`),m(!1)})})})},"Toast")),[OM,DM]=ZS(Bd,{onClose(){}}),PM=y.forwardRef(at(function(t,s){const{__scopeToast:r,type:o="foreground",duration:c,open:u,onClose:f,onEscapeKeyDown:h,onPause:m,onResume:p,onSwipeStart:x,onSwipeMove:v,onSwipeCancel:j,onSwipeEnd:w,...C}=t,S=Vd(Bd,r),N=XS(r),[E,R]=y.useState(null),D=Ge(s,R),A=y.useRef(null),_=y.useRef(null),F=c||S.duration,O=y.useRef(0),I=y.useRef(F),V=y.useRef(0),{onToastAdd:H,onToastRemove:k}=S,q=In(()=>{E?.contains(document.activeElement)&&S.viewport?.focus(),f()}),J=y.useCallback(U=>
9{!U||U===1/0||(window.clearTimeout(V.current),O.current=new Date().getTime(),V.current=window.setTimeout(q,U))},[q]);y.useEffect(()=>{const U=S.viewport;if(U){const L=at(()=>{J(I.current),p?.()},"handleResume"),z=at(()=>{const W=new Date().getTime()-O.current;I.current=I.current-W,window.clearTimeout(V.current),m?.()},"handlePause");return U.addEventListener(Np,z),U.addEventListener(Cp,L),()=>{U.removeEventListener(Np,z),U.removeEventListener(Cp,L)}}},[S.viewport,F,m,p,J]),y.useEffect(()=>{u&&!S.isClosePausedRef.current&&J(F)},[u,F,S.isClosePausedRef,J]),y.useEffect(()=>()=>{window.clearTimeout(V.current)},[]),y.useEffect(()=>(H(),()=>k()),[H,k]);const re=y.useMemo(()=>E?_g(E):null,[E]);return S.viewport?a.jsxs(a.Fragment,{children:[re&&a.jsx(_M,{__scopeToast:r,role:"status","aria-live":o==="foreground"?"assertive":"polite",children:re}),a.jsx(OM,{scope:r,onClose:q,children:eo.createPortal(a.jsx(Pg.ItemSlot,{scope:r,children:a.jsx(iM,{asChild:!0,onEscapeKeyDown:ge(h,U=>{N().some(z=>z.ref.current?.contains(U.target))||q()}),children:a.jsx(Xe.li,{tabIndex:0,"data-state":u?"open":"closed","data-swipe-direction":S.swipeDirection,...C,ref:D,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:ge(t.onKeyDown,U=>{U.key==="Escape"&&(h?.(U.nativeEvent),U.nativeEvent.defaultPrevented||q())}),onPointerDown:ge(t.onPointerDown,U=>{U.button===0&&(A.current={x:U.clientX,y:U.clientY})}),onPointerMove:ge(t.onPointerMove,U=>{if(!A.current)return;const L=U.clientX-A.current.x,z=U.clientY-A.current.y,W=!!_.current,M=["left","right"].includes(S.swipeDirection),K=["left","up"].includes(S.swipeDirection)?Math.min:Math.max,ie=M?
9K(0,L):0,ee=M?0:K(0,z),ae=U.pointerType==="touch"?10:2,oe={x:ie,y:ee},le={originalEvent:U,delta:oe};W?(_.current=oe,jl(AM,v,le,{discrete:!1})):C0(oe,S.swipeDirection,ae)?(_.current=oe,jl(TM,x,le,{discrete:!1}),U.target.setPointerCapture(U.pointerId)):(Math.abs(L)>ae||Math.abs(z)>ae)&&(A.current=null)}),onPointerUp:ge(t.onPointerUp,U=>{const L=_.current,z=U.target;if(z.hasPointerCapture(U.pointerId)&&z.releasePointerCapture(U.pointerId),_.current=null,A.current=null,L){const W=U.currentTarget,M={originalEvent:U,delta:L};C0(L,S.swipeDirection,S.swipeThreshold)?jl(kM,w,M,{discrete:!0}):jl(RM,j,M,{discrete:!0}),W.addEventListener("click",K=>K.preventDefault(),{once:!0})}})})})}),S.viewport)})]}):null},"ToastImpl")),_M=at(e=>{const{__scopeToast:t,children:s,...r}=e,o=Vd(Bd,t),[c,u]=y.useState(!1),[f,h]=y.useState(!1);return tN(()=>u(!0)),y.useEffect(()=>{const m=window.setTimeout(()=>h(!0),1e3);return()=>window.clearTimeout(m)},[]),f?null:a.jsx(Fd,{asChild:!0,container:o.announcerContainer||void 0,children:a.jsx(Dg,{...r,children:c&&a.jsxs(a.Fragment,{children:[o.label," ",s]})})})},"ToastAnnounce"),LM=y.forwardRef(at(function(t,s){const{__scopeToast:r,...o}=t;return a.jsx(Xe.div,{...o,ref:s})},"ToastTitle")),UM=y.forwardRef(at(function(t,s){const{__scopeToast:r,...o}=t;return a.jsx(Xe.div,{...o,ref:s})},"ToastDescription")),IM="ToastAction",zM=y.forwardRef(at(function(t,s){const{altText:r,...o}=t;return r.trim()?a.jsx(eN,{altText:r,asChild:!0,children:a.jsx(JS,{...o,ref:s})}):(console.error(`Invalid prop \`altText\` supplied to \`${IM}\`. Expected non-empty \`string\`.`),null)},"ToastAction")),FM="ToastClose",JS=y.forwardRef(at(function(t,s){const{__scopeToast:r,...o}=t,c=DM(FM,r);return a.jsx(eN,{asChild:!0,children:a.jsx(Xe.button,{type:"button",...o,ref:s,onClick:ge(t.onClick,c.onClose)})})},"ToastClose")),eN=y.forwardRef(at(function(t,s){const{__scopeToast:r,altText:o,...c}=t;return a.jsx(Xe.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":o||void 0,...c,ref:s})},"ToastAnnounceExclude"));function _g(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),nN(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",c=r.dataset.radixToastAnnounceExclude==="";if(!o)if(c){const u=r.dataset.radixToastAnnounceAlt;u&&t.push(u)}else t.push(..._g(r))}}),t}at(_g,"getAnnounceTextContent");function jl(e,t,s,{discrete:r}){const o=s.originalEvent.currentTarget,c=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:s});t&&o.addEventListener(e,t,{once:!0}),r?Id(o,c):o.dispatchEvent(c)}at(jl,"handleAndDispatchCustomEvent");var C0=at((e,t,s=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),c=r>o;return t==="left"||t==="right"?c&&r>s:!c&&o>s},"isDeltaInDirection");function tN(e=()=>{}){const t=In(e);pn(()=>{let s=0,r=0;return s=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(s),window.cancelAnimationFrame(r)}},[t])}at(tN,"useNextFrame");function nN(e){return e.nodeType===e.ELEMENT_NODE}at(nN,"isHTMLElement");function sN(e){const t=[],s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:at(r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;s.nextNode();)t.push(s.currentNode);return t}at(sN,"getTabbableCandidates");function Vu(e){const t=document.activeElement;return e.some(s=>s===t?!0:(s.focus(),document.activeElement!==t))}at(Vu,"focusFirst");var VM=jM,rN=CM,iN=MM,aN=LM,oN=UM,lN=zM,cN=JS;const BM=(e,t)=>{const s=new Array(e.length+t.length);for(let r=0;r<e.length;r++)s[r]=e[r];for(let r=0;r<t.length;r++)s[e.length+r]=t[r];return s},$M=(e,t)=>({classGroupId:e,validator:t}),uN=(e=new Map,t=null,s)=>({nextPart:e,validators:t,classGroupId:s}),ld="-",E0=[],qM="arbitrary..",HM=e=>{const t=GM(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return KM(u);const f=u.split(ld),h=f[0]===""&&f.length>1?1:0;return dN(f,h,t)},getConflictingClassGroupIds:(u,f)=>{if(f){const h=r[u],m=s[u];return h?m?BM(m,h):h:m||E0}return s[u]||E0}}},dN=(e,t,s)=>{if(e.length-t===0)return s.classGroupId;const o=e[t],c=s.nextPart.get(o);if(c){const m=dN(e,t+1,c);if(m)return m}const u=s.validators;if(u===null)return;const f=t===0?e.join(ld):e.slice(t).join(ld),h=u.length;for(let m=0;m<h;m++){const p=u[m];if(p.validator(f))return p.classGroupId}},KM=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),s=t.indexOf(":"),r=t.slice(0,s);return r?qM+r:void 0})(),GM=e=>{const{theme:t,classGroups:s}=e;return YM(s,t)},YM=(e,t)=>{const s=uN();for(const r in e){const o=e[r];Lg(o,s,r,t)}return s},Lg=(e,t,s,r)=>{const o=e.length;for(let c=0;c<o;c++){const u=e[c];QM(u,t,s,r)}},QM=(e,t,s,r)=>{if(typeof e=="string"){WM(e,t,s);return}if(typeof e=="function"){XM(e,t,s,r);return}ZM(e,t,s,r)},WM=(e,t,s)=>{const r=e===""?t:fN(t,e);r.classGroupId=s},XM=(e,t,s,r)=>{if(JM(e)){Lg(e(r),t,s,r);return}t.validators===null&&(t.validators=[]),t.validators.push($M(s,e))},ZM=(e,t,s,r)=>{const o=Object.entries(e),c=o.length;for(let u=0;u<c;u++){const[f,h]=o[u];Lg(h,fN(t,f),s,r)}},fN=(e,t)=>{let s=e;const r=t.split(ld),o=r.length;for(let c=0;c<o;c++){const u=r[c];let f=s.nextPart.get(u);f||(f=uN(),s.nextPart.set(u,f)),s=f}return s},JM=e=>
vendor: 4,222 bytes, line 9
9"isThemeGetter"in e&&e.isThemeGetter===!0,eO=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,s=Object.create(null),r=Object.create(null);const o=(c,u)=>{s[c]=u,t++,t>e&&(t=0,r=s,s=Object.create(null))};return{get(c){let u=s[c];if(u!==void 0)return u;if((u=r[c])!==void 0)return o(c,u),u},set(c,u){c in s?s[c]=u:o(c,u)}}},Ep="!",T0=":",tO=[],A0=(e,t,s,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:s,maybePostfixModifierPosition:r,isExternal:o}),nO=e=>{const{prefix:t,experimentalParseClassName:s}=e;let r=o=>{const c=[];let u=0,f=0,h=0,m;const p=o.length;for(let C=0;C<p;C++){const S=o[C];if(u===0&&f===0){if(S===T0){c.push(o.slice(h,C)),h=C+1;continue}if(S==="/"){m=C;continue}}S==="["?u++:S==="]"?u--:S==="("?f++:S===")"&&f--}const x=c.length===0?o:o.slice(h);let v=x,j=!1;x.endsWith(Ep)?(v=x.slice(0,-1),j=!0):x.startsWith(Ep)&&(v=x.slice(1),j=!0);const w=m&&m>h?m-h:void 0;return A0(c,j,v,w)};if(t){const o=t+T0,c=r;r=u=>u.startsWith(o)?c(u.slice(o.length)):A0(tO,!1,u,void 0,!0)}if(s){const o=r;r=c=>s({className:c,parseClassName:o})}return r},sO=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((s,r)=>{t.set(s,1e6+r)}),s=>{const r=[];let o=[];for(let c=0;c<s.length;c++){const u=s[c],f=u[0]==="[",h=t.has(u);f||h?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(u)):o.push(u)}return o.length>0&&(o.sort(),r.push(...o)),r}},rO=e=>({cache:eO(e.cacheSize),parseClassName:nO(e),sortModifiers:sO(e),postfixLookupClassGroupIds:iO(e),...HM(e)}),iO=e=>{const t=Object.create(null),s=e.postfixLookupClassGroups;if(s)for(let r=0;r<s.length;r++)t[s[r]]=!0;return t},aO=/\s+/,oO=(e,t)=>{const{parseClassName:s,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:c,postfixLookupClassGroupIds:u}=t,f=[],h=e.trim().split(aO);let m="";for(let p=h.length-1;p>=0;p-=1){const x=h[p],{isExternal:v,modifiers:j,hasImportantModifier:w,baseClassName:C,maybePostfixModifierPosition:S}=s(x);if(v){m=x+(m.length>0?" "+m:m);continue}let N=!!S,E;if(N){const F=C.substring(0,S);E=r(F);const O=E&&u[E]?r(C):void 0;O&&O!==E&&(E=O,N=!1)}else E=r(C);if(!E){if(!N){m=x+(m.length>0?" "+m:m);continue}if(E=r(C),!E){m=x+(m.length>0?" "+m:m);continue}N=!1}const R=j.length===0?"":j.length===1?j[0]:c(j).join(":"),D=w?R+Ep:R,A=D+E;if(f.indexOf(A)>-1)continue;f.push(A);const _=o(E,N);for(let F=0;F<_.length;++F){const O=_[F];f.push(D+O)}m=x+(m.length>0?" "+m:m)}return m},lO=(...e)=>{let t=0,s,r,o="";for(;t<e.length;)(s=e[t++])&&(r=hN(s))&&(o&&(o+=" "),o+=r);return o},hN=e=>{if(typeof e=="string")return e;let t,s="";for(let r=0;r<e.length;r++)e[r]&&(t=hN(e[r]))&&(s&&(s+=" "),s+=t);return s},cO=(e,...t)=>{let s,r,o,c;const u=h=>{const m=t.reduce((p,x)=>x(p),e());return s=rO(m),r=s.cache.get,o=s.cache.set,c=f,f(h)},f=h=>{const m=r(h);if(m)return m;const p=oO(h,s);return o(h,p),p};return c=u,(...h)=>c(lO(...h))},uO=[],Pt=e=>{const t=s=>s[e]||uO;return t.isThemeGetter=!0,t},mN=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,pN=/^\((?:(\w[\w-]*):)?(.+)\)$/i,dO=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,fO=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,hO=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,mO=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,pO=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,gO=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,qr=e=>dO.test(e),Ae=e=>!!e&&!Number.isNaN(Number(e)),js=e=>!!e&&Number.isInteger(Number(e)),Am=e=>e.endsWith("%")&&Ae(e.slice(0,-1)),er=e=>fO.test(e),gN=()=>!0,xO=e=>hO.test(e)&&!mO.test(e),Ug=()=>!1,yO=e=>pO.test(e),vO=e=>gO.test(e),bO=e=>!ue(e)&&!de(e),wO=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),jO=e=>ii(e,vN,Ug),ue=e=>mN.test(e),ki=e=>ii(e,bN,xO),R0=e=>ii(e,kO,Ae),SO=e=>ii(e,jN,gN),NO=e=>ii(e,wN,Ug),k0=e=>ii(e,xN,Ug),CO=e=>ii(e,yN,vO),yu=e=>ii(e,SN,yO),de=e=>pN.test(e),pl=e=>Yi(e,bN),EO=e=>Yi(e,wN),M0=e=>Yi(e,xN),TO=e=>Yi(e,vN),AO=e=>Yi(e,yN),vu=e=>Yi(e,SN,!0),RO=e=>Yi(e,jN,!0),ii=(e,t,s)=>{const r=mN.exec(e);return r?r[1]?t(r[1]):s(r[2]):!1},Yi=(e,t,s=!1)=>{const r=pN.exec(e);return r?r[1]?t(r[1]):s:!1}
vendor: 8,964 bytes, line 9
9,xN=e=>e==="position"||e==="percentage",yN=e=>e==="image"||e==="url",vN=e=>e==="length"||e==="size"||e==="bg-size",bN=e=>e==="length",kO=e=>e==="number",wN=e=>e==="family-name",jN=e=>e==="number"||e==="weight",SN=e=>e==="shadow",MO=()=>{const e=Pt("color"),t=Pt("font"),s=Pt("text"),r=Pt("font-weight"),o=Pt("tracking"),c=Pt("leading"),u=Pt("breakpoint"),f=Pt("container"),h=Pt("spacing"),m=Pt("radius"),p=Pt("shadow"),x=Pt("inset-shadow"),v=Pt("text-shadow"),j=Pt("drop-shadow"),w=Pt("blur"),C=Pt("perspective"),S=Pt("aspect"),N=Pt("ease"),E=Pt("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],A=()=>[...D(),de,ue],_=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto","contain","none"],O=()=>[de,ue,h],I=()=>[qr,"full","auto",...O()],V=()=>[js,"none","subgrid",de,ue],H=()=>["auto",{span:["full",js,de,ue]},js,de,ue],k=()=>[js,"auto",de,ue],q=()=>["auto","min","max","fr",de,ue],J=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],re=()=>["start","end","center","stretch","center-safe","end-safe"],U=()=>["auto",...O()],L=()=>[qr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...O()],z=()=>[qr,"screen","full","dvw","lvw","svw","min","max","fit",...O()],W=()=>[qr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...O()],M=()=>[e,de,ue],K=()=>[...D(),M0,k0,{position:[de,ue]}],ie=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ee=()=>["auto","cover","contain",TO,jO,{size:[de,ue]}],ae=()=>[Am,pl,ki],oe=()=>["","none","full",m,de,ue],le=()=>["",Ae,pl,ki],Ne=()=>["solid","dashed","dotted","double"],ce=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],xe=()=>[Ae,Am,M0,k0],ut=()=>["","none",w,de,ue],nt=()=>["none",Ae,de,ue],tn=()=>["none",Ae,de,ue],nn=()=>[Ae,de,ue],Rt=()=>[qr,"full",...O()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[er],breakpoint:[er],color:[gN],container:[er],"drop-shadow":[er],ease:["in","out","in-out"],font:[bO],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[er],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[er],shadow:[er],spacing:["px",Ae],text:[er],"text-shadow":[er],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",qr,ue,de,S]}],container:["container"],"container-type":[{"@container":["","normal","size",de,ue]}],"container-named":[wO],columns:[{columns:[Ae,ue,de,f]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:A()}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:F()}],"overscroll-x":[{"overscroll-x":F()}],"overscroll-y":[{"overscroll-y":F()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{"inset-s":I(),start:I()}],end:[{"inset-e":I(),end:I()}],"inset-bs":[{"inset-bs":I()}],"inset-be":[{"inset-be":I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[js,"auto",de,ue]}],basis:[{basis:[qr,"full","auto",f,...O()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ae,qr,"auto","initial","none",ue]}],grow:[{grow:["",Ae,de,ue]}],shrink:[{shrink:["",Ae,de,ue]}],order:[{order:[js,"first","last","none",de,ue]}],"grid-cols":[{"grid-cols":V()}],"col-start-end":[{col:H()}],"col-start":[{"col-start":k()}],"col-end":[{"col-end":k()}],"grid-rows":[{"grid-rows":V()}],"row-start-end":[{row:H()}],"row-start":[{"row-start":k()}],"row-end":[{"row-end":k()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":q()}],"auto-rows":[{"auto-rows":q()}],gap:[{gap:O()}],"gap-x":[{"gap-x":O()}],"gap-y":[{"gap-y":O()}],"justify-content":[{justify:[...J(),"normal"]}],"justify-items":[{"justify-items":[...re(),"normal"]}],"justify-self":[{"justify-self":["auto",...re()]}],"align-content":[{content:["normal",...J()]}],"align-items":[{items:[...re(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...re(),{baseline:["","last"]}]}],"place-content":[{"place-content":J()}],"place-items":[{"place-items":[...re(),"baseline"]}],"place-self":[{"place-self":["auto",...re()]}],p:[{p:O()}],px:[{px:O()}],py:[{py:O()}],ps:[{ps:O()}],pe:[{pe:O()}],pbs:[{pbs:O()}],pbe:[{pbe:O()}],pt:[{pt:O()}],pr:[{pr:O()}],pb:[{pb:O()}],pl:[{pl:O()}],m:[{m:U()}],mx:[{mx:U()}],my:[{my:U()}],ms:[{ms:U()}],me:[{me:U()}],mbs:[{mbs:U()}],mbe:[{mbe:U()}],mt:[{mt:U()}],mr:[{mr:U()}],mb:[{mb:U()}],ml:[{ml:U()}],"space-x":[{"space-x":O()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":O()}],"space-y-reverse":["space-y-reverse"],size:[{size:L()}],"inline-size":[{inline:["auto",...z()]}],"min-inline-size":[{"min-inline":["auto",...z()]}],"max-inline-size":[{"max-inline":["none",...z()]}],"block-size":[{block:["auto",...W()]}],"min-block-size":[{"min-block":["auto",...W()]}],"max-block-size":[{"max-block":["none",...W()]}],w:[{w:[f,"screen",...L()]}],"min-w":[{"min-w":[f,"screen","none",...L()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[u]},...L()]}],h:[{h:["screen","lh",...L()]}],"min-h":[{"min-h":["screen","lh","none",...L()]}],"max-h":[{"max-h":["screen","lh",...L()]}],"font-size":[{text:["base",s,pl,ki]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,RO,SO]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Am,ue]}],"font-family":[{font:[EO,NO,t]}],"font-features":[{"font-features":[ue]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,de,ue]}],"line-clamp":[{"line-clamp":[Ae,"none",de,R0]}],leading:[{leading:[c,...O()]}],"list-image":[{"list-image":["none",de,ue]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",de,ue]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ae,"from-font","auto",de,ki]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[Ae,"auto",de,ue]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"tab-size":[{tab:[js,de,ue]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",de,ue]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",de,ue]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:K()}],"bg-repeat":[{bg:ie()}],"bg-size":[{bg:ee()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},js,de,ue],radial:["",de,ue],conic:[js,de,ue]},AO,CO]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:ae()}
9],"gradient-via-pos":[{via:ae()}],"gradient-to-pos":[{to:ae()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:oe()}],"rounded-s":[{"rounded-s":oe()}],"rounded-e":[{"rounded-e":oe()}],"rounded-t":[{"rounded-t":oe()}],"rounded-r":[{"rounded-r":oe()}],"rounded-b":[{"rounded-b":oe()}],"rounded-l":[{"rounded-l":oe()}],"rounded-ss":[{"rounded-ss":oe()}],"rounded-se":[{"rounded-se":oe()}],"rounded-ee":[{"rounded-ee":oe()}],"rounded-es":[{"rounded-es":oe()}],"rounded-tl":[{"rounded-tl":oe()}],"rounded-tr":[{"rounded-tr":oe()}],"rounded-br":[{"rounded-br":oe()}],"rounded-bl":[{"rounded-bl":oe()}],"border-w":[{border:le()}],"border-w-x":[{"border-x":le()}],"border-w-y":[{"border-y":le()}],"border-w-s":[{"border-s":le()}],"border-w-e":[{"border-e":le()}],"border-w-bs":[{"border-bs":le()}],"border-w-be":[{"border-be":le()}],"border-w-t":[{"border-t":le()}],"border-w-r":[{"border-r":le()}],"border-w-b":[{"border-b":le()}],"border-w-l":[{"border-l":le()}],"divide-x":[{"divide-x":le()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":le()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ne(),"hidden","none"]}],"divide-style":[{divide:[...Ne(),"hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}
vendor: 5,782 bytes, line 9
9],"divide-color":[{divide:M()}],"outline-style":[{outline:[...Ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ae,de,ue]}],"outline-w":[{outline:["",Ae,pl,ki]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",p,vu,yu]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",x,vu,yu]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:le()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[Ae,ki]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":le()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",v,vu,yu]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[Ae,de,ue]}],"mix-blend":[{"mix-blend":[...ce(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ce()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ae]}],"mask-image-linear-from-pos":[{"mask-linear-from":xe()}],"mask-image-linear-to-pos":[{"mask-linear-to":xe()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":xe()}],"mask-image-t-to-pos":[{"mask-t-to":xe()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":xe()}],"mask-image-r-to-pos":[{"mask-r-to":xe()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":xe()}],"mask-image-b-to-pos":[{"mask-b-to":xe()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":xe()}],"mask-image-l-to-pos":[{"mask-l-to":xe()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":xe()}],"mask-image-x-to-pos":[{"mask-x-to":xe()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":xe()}],"mask-image-y-to-pos":[{"mask-y-to":xe()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[de,ue]}],"mask-image-radial-from-pos":[{"mask-radial-from":xe()}],"mask-image-radial-to-pos":[{"mask-radial-to":xe()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":D()}],"mask-image-conic-pos":[{"mask-conic":[Ae]}],"mask-image-conic-from-pos":[{"mask-conic-from":xe()}],"mask-image-conic-to-pos":[{"mask-conic-to":xe()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:K()}],"mask-repeat":[{mask:ie()}],"mask-size":[{mask:ee()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",de,ue]}],filter:[{filter:["","none",de,ue]}],blur:[{blur:ut()}],brightness:[{brightness:[Ae,de,ue]}],contrast:[{contrast:[Ae,de,ue]}],"drop-shadow":[{"drop-shadow":["","none",j,vu,yu]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",Ae,de,ue]}],"hue-rotate":[{"hue-rotate":[Ae,de,ue]}],invert:[{invert:["",Ae,de,ue]}],saturate:[{saturate:[Ae,de,ue]}],sepia:[{sepia:["",Ae,de,ue]}],"backdrop-filter":[{"backdrop-filter":["","none",de,ue]}],"backdrop-blur":[{"backdrop-blur":ut()}],"backdrop-brightness":[{"backdrop-brightness":[Ae,de,ue]}],"backdrop-contrast":[{"backdrop-contrast":[Ae,de,ue]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ae,de,ue]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ae,de,ue]}],"backdrop-invert":[{"backdrop-invert":["",Ae,de,ue]}],"backdrop-opacity":[{"backdrop-opacity":[Ae,de,ue]}],"backdrop-saturate":[{"backdrop-saturate":[Ae,de,ue]}],"backdrop-sepia":[{"backdrop-sepia":["",Ae,de,ue]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":O()}],"border-spacing-x":[{"border-spacing-x":O()}],"border-spacing-y":[{"border-spacing-y":O()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",de,ue]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ae,"initial",de,ue]}],ease:[{ease:["linear","initial",N,de,ue]}],delay:[{delay:[Ae,de,ue]}],animate:[{animate:["none",E,de,ue]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,de,ue]}],"perspective-origin":[{"perspective-origin":A()}],rotate:[{rotate:nt()}],"rotate-x":[{"rotate-x":nt()}],"rotate-y":[{"rotate-y":nt()}],"rotate-z":[{"rotate-z":nt()}],scale:[{scale:tn()}],"scale-x":[{"scale-x":tn()}],"scale-y":[{"scale-y":tn()}],"scale-z":[{"scale-z":tn()}],"scale-3d":["scale-3d"],skew:[{skew:nn()}],"skew-x":[{"skew-x":nn()}],"skew-y":[{"skew-y":nn()}],transform:[{transform:[de,ue,"","none","gpu","cpu"]}],"transform-origin":[{origin:A()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Rt()}],"translate-x":[{"translate-x":Rt()}],"translate-y":[{"translate-y":Rt()}],"translate-z":[{"translate-z":Rt()}],"translate-none":["translate-none"],zoom:[{zoom:[js,de,ue]}],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}
vendor: 5,021 bytes, line 9
9],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",de,ue]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":M()}],"scrollbar-track-color":[{"scrollbar-track":M()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mbs":[{"scroll-mbs":O()}],"scroll-mbe":[{"scroll-mbe":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pbs":[{"scroll-pbs":O()}],"scroll-pbe":[{"scroll-pbe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",de,ue]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[Ae,pl,ki,R0]}],stroke:[{stroke:["none",...M()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}}
vendor: 8,832 bytes, line 9
9,OO=cO(MO);function NN(e){var t,s,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(s=NN(e[t]))&&(r&&(r+=" "),r+=s)}else for(s in e)e[s]&&(r&&(r+=" "),r+=s);return r}function CN(){for(var e,t,s=0,r="",o=arguments.length;s<o;s++)(e=arguments[s])&&(t=NN(e))&&(r&&(r+=" "),r+=t);return r}function Ee(...e){return OO(CN(e))}const O0=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,D0=CN,Ig=(e,t)=>s=>{var r;if(t?.variants==null)return D0(e,s?.class,s?.className);const{variants:o,defaultVariants:c}=t,u=Object.keys(o).map(m=>{const p=s?.[m],x=c?.[m];if(p===null)return null;const v=O0(p)||O0(x);return o[m][v]}),f=s&&Object.entries(s).reduce((m,p)=>{let[x,v]=p;return v===void 0||(m[x]=v),m},{}),h=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((m,p)=>{let{class:x,className:v,...j}=p;return Object.entries(j).every(w=>{let[C,S]=w;return Array.isArray(S)?S.includes({...c,...f}[C]):{...c,...f}[C]===S})?[...m,x,v]:m},[]);return D0(e,u,h,s?.class,s?.className)};const DO=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),PO=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,s,r)=>r?r.toUpperCase():s.toLowerCase()),P0=e=>{const t=PO(e);return t.charAt(0).toUpperCase()+t.slice(1)},EN=(...e)=>e.filter((t,s,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===s).join(" ").trim(),_O=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var LO={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"};const UO=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:r,className:o="",children:c,iconNode:u,...f},h)=>y.createElement("svg",{ref:h,...LO,width:t,height:t,stroke:e,strokeWidth:r?Number(s)*24/Number(t):s,className:EN("lucide",o),...!c&&!_O(f)&&{"aria-hidden":"true"},...f},[...u.map(([m,p])=>y.createElement(m,p)),...Array.isArray(c)?c:[c]]));const Re=(e,t)=>{const s=y.forwardRef(({className:r,...o},c)=>y.createElement(UO,{ref:c,iconNode:t,className:EN(`lucide-${DO(P0(e))}`,`lucide-${e}`,r),...o}));return s.displayName=P0(e),s};const IO=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Dl=Re("arrow-down",IO);const zO=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],TN=Re("arrow-left",zO);const FO=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],cd=Re("arrow-right",FO);const VO=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Pl=Re("arrow-up",VO);const BO=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],zg=Re("check",BO);const $O=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],qO=Re("chevron-right",$O);const HO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],KO=Re("circle-alert",HO);const GO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Fg=Re("circle-check",GO);const YO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],AN=Re("circle-x",YO);const QO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],RN=Re("circle",QO);const WO=[["path",{d:"M12 13v8l-4-4",key:"1f5nwf"}],["path",{d:"m12 21 4-4",key:"1lfcce"}],["path",{d:"M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284",key:"ui1hmy"}]],XO=Re("cloud-download",WO);const ZO=[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],JO=Re("cloud-upload",ZO);const eD=[["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"}]],tD=Re("download",eD);const nD=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],sD=Re("ellipsis-vertical",nD);const rD=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],kN=Re("file-text",rD);const iD=[["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"}]],MN=Re("film",iD);const aD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],oD=Re("globe",aD);const lD=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],_l=Re("image",lD);const cD=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],uD=Re("layout-dashboard",cD);const dD=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],ON=Re("link",dD);const fD=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ue=Re("loader-circle",fD);const hD=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],mD=Re("log-out",hD);const pD=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],DN=Re("mail",pD);const gD=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],xD=Re("menu",gD);const yD=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],vD=Re("monitor",yD);const bD=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],wD=Re("pen",bD);const jD=[["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"}]],SD=Re("play",jD);const ND=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Jt=Re("plus",ND);const CD=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],PN=Re("rotate-ccw",CD);const ED=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],co=Re("save",ED);const TD=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],AD=Re("send",TD);const RD=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],_N=Re("settings",RD);const kD=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],LN=Re("smartphone",kD);const MD=[["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}],["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}]],Tp=Re("square-play",MD);const OD=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],ms=Re("trash-2",OD);const DD=[["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],PD=Re("trash",DD);
9const _D=[["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"}]],_0=Re("upload",_D);const LD=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],Cl=Re("video",LD);const UD=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Jl=Re("x",UD),ID=VM,UN=y.forwardRef(({className:e,...t},s)=>a.jsx(rN,{ref:s,className:Ee("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));UN.displayName=rN.displayName;const zD=Ig("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),IN=y.forwardRef(({className:e,variant:t,...s},r)=>a.jsx(iN,{ref:r,className:Ee(zD({variant:t}),e),...s}));IN.displayName=iN.displayName;const FD=y.forwardRef(({className:e,...t},s)=>a.jsx(lN,{ref:s,className:Ee("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));FD.displayName=lN.displayName;const zN=y.forwardRef(({className:e,...t},s)=>a.jsx(cN,{ref:s,className:Ee("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:a.jsx(Jl,{className:"h-4 w-4"})}));zN.displayName=cN.displayName;const FN=y.forwardRef(({className:e,...t},s)=>a.jsx(aN,{ref:s,className:Ee("text-sm font-semibold",e),...t}));FN.displayName=aN.displayName;const VN=y.forwardRef(({className:e,...t},s)=>a.jsx(oN,{ref:s,className:Ee("text-sm opacity-90",e),...t}));VN.displayName=oN.displayName;const VD=1,BD=1e6;let Rm=0;function $D(){return Rm=(Rm+1)%Number.MAX_SAFE_INTEGER,Rm.toString()}const km=new Map,L0=e=>{if(km.has(e))return;const t=setTimeout(()=>{km.delete(e),El({type:"REMOVE_TOAST",toastId:e})},BD);km.set(e,t)},qD=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,VD)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(s=>s.id===t.toast.id?{...s,...t.toast}:s)};case"DISMISS_TOAST":{const{toastId:s}=t;return s?L0(s):e.toasts.forEach(r=>{L0(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===s||s===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(s=>s.id!==t.toastId)}}},Bu=[];let $u={toasts:[]};function El(e){$u=qD($u,e),Bu.forEach(t=>{t($u)})}function HD({...e}){const t=$D(),s=o=>El({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>El({type:"DISMISS_TOAST",toastId:t});return El({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:s}}function Sn(){const[e,t]=y.useState($u);return y.useEffect(()=>(Bu.push(t),()=>{const s=Bu.indexOf(t);s>-1&&Bu.splice(s,1)}),[e]),{...e,toast:HD,dismiss:s=>El({type:"DISMISS_TOAST",toastId:s}
9)}}function KD(){const{toasts:e}=Sn();return a.jsxs(ID,{children:[e.map(function({id:t,title:s,description:r,action:o,...c}){return a.jsxs(IN,{...c,children:[a.jsxs("div",{className:"grid gap-1",children:[s&&a.jsx(FN,{children:s}),r&&a.jsx(VN,{children:r})]}),o,a.jsx(zN,{})]},t)}),a.jsx(UN,{})]})}var GD=Object.defineProperty,YD=(e,t)=>GD(e,"name",{value:t,configurable:!0}),QD=Gi[" useId ".trim().toString()]||(()=>{}),WD=0;function Ii(e){const[t,s]=y.useState(QD());return pn(()=>{e||s(r=>r??String(WD++))},[e]),e||(t?`radix-${t}`:"")}YD(Ii,"useId");const XD=["top","right","bottom","left"],ei=Math.min,or=Math.max,ud=Math.round,bu=Math.floor,lr=e=>({x:e,y:e}),ZD={left:"right",right:"left",bottom:"top",top:"bottom"};function BN(e,t,s){return or(e,ei(t,s))}function hr(e,t){return typeof e=="function"?e(t):e}function ti(e){return e.split("-")[0]}function uo(e){return e.split("-")[1]}function Vg(e){return e==="x"?"y":"x"}function Bg(e){return e==="y"?"height":"width"}function Ts(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function $g(e){return Vg(Ts(e))}function JD(e,t,s){s===void 0&&(s=!1);const r=uo(e),o=$g(e),c=Bg(o);let u=o==="x"?r===(s?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[c]>t.floating[c]&&(u=dd(u)),[u,dd(u)]}function e4(e){const t=dd(e);return[Ap(e),t,Ap(t)]}function Ap(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const U0=["left","right"],I0=["right","left"],t4=["top","bottom"],n4=["bottom","top"];function s4(e,t,s){switch(e){case"top":case"bottom":return s?t?I0:U0:t?U0:I0;case"left":case"right":return t?t4:n4;default:return[]}}function r4(e,t,s,r){const o=uo(e);let c=s4(ti(e),s==="start",r);return o&&(c=c.map(u=>u+"-"+o),t&&(c=c.concat(c.map(Ap)))),c}function dd(e){const t=ti(e);return ZD[t]+e.slice(t.length)}function i4(e){var t,s,r,o;return{top:(t=e.top)!=null?t:0,right:(s=e.right)!=null?s:0,bottom:(r=e.bottom)!=null?r:0,left:(o=e.left)!=null?o:0}}function $N(e){return typeof e!="number"?i4(e):{top:e,right:e,bottom:e,left:e}}function fd(e){const{x:t,y:s,width:r,height:o}=e;return{width:r,height:o,top:s,left:t,right:t+r,bottom:s+o,x:t,y:s}}function z0(e,t,s){let{reference:r,floating:o}=e;const c=Ts(t),u=$g(t),f=Bg(u),h=ti(t),m=c==="y",p=r.x+r.width/2-o.width/2,x=r.y+r.height/2-o.height/2,v=r[f]/2-o[f]/2;let j;switch(h){case"top":j={x:p,y:r.y-o.height};break;case"bottom":j={x:p,y:r.y+r.height};break;case"right":j={x:r.x+r.width,y:x};break;case"left":j={x:r.x-o.width,y:x};break;default:j={x:r.x,y:r.y}}const w=uo(t);return w&&(j[u]+=v*(w==="end"?1:-1)*(s&&m?-1:1)),j}async function a4(e,t){var s;t===void 0&&(t={});const{x:r,y:o,platform:c,rects:u,elements:f,strategy:h}=e,{boundary:m="clippingAncestors",rootBoundary:p="viewport",elementContext:x="floating",altBoundary:v=!1,padding:j=0}=hr(t,e),w=$N(j),S=f[v?x==="floating"?"reference":"floating":x],N=fd(await c.getClippingRect({element:(s=await(c.isElement==null?void 0:c.isElement(S)))==null||s?S:S.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(f.floating)),boundary:m,rootBoundary:p,strategy:h})),E=x==="floating"?{x:r,y:o,width:u.floating.width,height:u.floating.height}:u.reference,R=await(c.getOffsetParent==null?void 0:c.getOffsetParent(f.floating)),D=await(c.isElement==null?void 0:c.isElement(R))&&await(c.getScale==null?void 0:c.getScale(R))||{x:1,y:1},A=fd(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:E,offsetParent:R,strategy:h}):E);return{top:(N.top-A.top+w.top)/D.y,bottom:(A.bottom-N.bottom+w.bottom)/D.y,left:(N.left-A.left+w.left)/D.x,right:(A.right-N.right+w.right)/D.x}}const o4=50,l4=async(e,t,s)=>{const{placement:r="bottom",strategy:o="absolute",middleware:c=[],platform:u}=s,f=u.detectOverflow?u:{...u,detectOverflow:a4},h=await(u.isRTL==null?void 0:u.isRTL(t));let m=await u.getElementRects({reference:e,floating:t,strategy:o}),{x:p,y:x}=z0(m,r,h),v=r,j=0;const w={};for(let C=0;C<c.length;C++){const S=c[C];if(!S)continue;const{name:N,fn:E}=S,{x:R,y:D,data:A,reset:_}=await E({x:p,y:x,initialPlacement:r,placement:v,strategy:o,middlewareData:w,rects:m,platform:f,elements:{reference:e,floating:t}});p=R??p,x=D??x,w[N]={...w[N],...A},_&&j<o4&&(j++,typeof _=="object"&&(_.placement&&(v=_.placement),_.rects&&(m=_.rects===!0?await u.getElementRects({reference:e,floating:t,strategy:o}):_.rects),{x:p,y:x}=z0(m,v,h)),C=-1)}return{x:p,y:x,placement:v,strategy:o,middlewareData:w}},c4=e=>({name:"arrow",options:e,async fn(t){const{x:s,y:r,placement:o,rects:c,platform:u,elements:f,middlewareData:h}=t,{element:m,padding:p=0}=hr(e,t)||{};if(m==null)return{};const x=$N(p),v={x:s,y:r},j=$g(o),w=Bg(j),C=await u.getDimensions(m),S=j==="y",N=S?"top":"left",E=S?"bottom":"right",R=S?"clientHeight":"clientWidth",D=c.reference[w]+c.reference[j]-v[j]-c.floating[w],A=v[j]-c.reference[j],_=await(u.getOffsetParent==null?void 0:u.getOffsetParent(m));let F=_?_[R]:0;(!F||!await(u.isElement==null?void 0:u.isElement(_)))&&(F=f.floating[R]||c.floating[w]);const O=D/2-A/2,I=F/2-C[w]/2-1,V=ei(x[N],I),H=ei(x[E],I),k=F-C[w]-H,q=F/2-C[w]/2+O,J=BN(V,q,k),re=!h.arrow&&uo(o)!=null&&q!==J&&c.reference[w]/2-(q<V?V:H)-C[w]/2<0,U=re?q<V?q-V:q-k:0;return{[j]:v[j]+U,data:{[j]:J,centerOffset:q-J-U,...re&&{alignmentOffset:U}},reset:re}}}),u4=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var s,r;const{placement:o,middlewareData:c,rects:u,initialPlacement:f,platform:h,elements:m}=t,{mainAxis:p=!0,crossAxis:x=!0,fallbackPlacements:v,fallbackStrategy:j="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:C=!0,...S}=hr(e,t);if((s=c.arrow)!=null&&s.alignmentOffset)return{};const N=ti(o),E=Ts(f),R=ti(f)===f,D=await(h.isRTL==null?void 0:h.isRTL(m.floating)),A=v||(R||!C?[dd(f)]:e4(f)),_=w!=="none";!v&&_&&A.push(...r4(f,C,w,D));const F=[f,...A],O=await h.detectOverflow(t,S),I=[];let V=((r=c.flip)==null?void 0:r.overflows)||[];if(p&&I.push(O[N]),x){const J=JD(o,u,D);I.push(O[J[0]],O[J[1]])}if(V=[...V,{placement:o,overflows:I}],!I.every(J=>J<=0)){var H,k;const J=(((H=c.flip)==null?void 0:H.index)||0)+1,re=F[J];if(re&&(!(x==="alignment"?E!==Ts(re):!1)||V.every(z=>Ts(z.placement)===E?z.overflows[0]>0:!0)))return{data:{index:J,overflows:V},reset:{placement:re}};let U=(k=V.filter(L=>L.overflows[0]<=0).sort((L,z)=>L.overflows[1]-z.overflows[1])[0])==null?void 0:k.placement;if(!U)switch(j){case"bestFit":{var q;const L=(q=V.filter(z=>{if(_){const W=Ts(z.placement);return W===E||W==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(W=>W>0).reduce((W,M)=>W+M,0)]).sort((z,W)=>z[1]-W[1])[0])==null?void 0:q[0];L&&(U=L);break}case"initialPlacement":U=f;break}if(o!==U)return{reset:{placement:U}}}return{}}}};function F0(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}
9function V0(e){return XD.some(t=>e[t]>=0)}const d4=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:s,platform:r}=t,{strategy:o="referenceHidden",...c}=hr(e,t);switch(o){case"referenceHidden":{const u=await r.detectOverflow(t,{...c,elementContext:"reference"}),f=F0(u,s.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:V0(f)}}}case"escaped":{const u=await r.detectOverflow(t,{...c,altBoundary:!0}),f=F0(u,s.floating);return{data:{escapedOffsets:f,escaped:V0(f)}}}default:return{}}}}},qN=new Set(["left","top"]);async function f4(e,t){const{placement:s,platform:r,elements:o}=e,c=await(r.isRTL==null?void 0:r.isRTL(o.floating)),u=ti(s),f=uo(s),h=Ts(s)==="y",m=qN.has(u)?-1:1,p=c&&h?-1:1,x=hr(t,e);let{mainAxis:v,crossAxis:j,alignmentAxis:w}=typeof x=="number"?{mainAxis:x,crossAxis:0,alignmentAxis:null}:{mainAxis:x.mainAxis||0,crossAxis:x.crossAxis||0,alignmentAxis:x.alignmentAxis};return f&&typeof w=="number"&&(j=f==="end"?w*-1:w),h?{x:j*p,y:v*m}:{x:v*m,y:j*p}}const h4=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var s,r;const{x:o,y:c,placement:u,middlewareData:f}=t,h=await f4(t,e);return u===((s=f.offset)==null?void 0:s.placement)&&(r=f.arrow)!=null&&r.alignmentOffset?{}:{x:o+h.x,y:c+h.y,data:{...h,placement:u}}}}},m4=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:s,y:r,placement:o,platform:c}=t,{mainAxis:u=!0,crossAxis:f=!1,limiter:h={fn:E=>{let{x:R,y:D}=E;return{x:R,y:D}}},...m}=hr(e,t),p={x:s,y:r},x=await c.detectOverflow(t,m),v=Ts(o),j=Vg(v);let w=p[j],C=p[v];const S=(E,R)=>BN(R+x[E==="y"?"top":"left"],R,R-x[E==="y"?"bottom":"right"]);u&&(w=S(j,w)),f&&(C=S(v,C));const N=h.fn({...t,[j]:w,[v]:C});return{...N,data:{x:N.x-s,y:N.y-r,enabled:{[j]:u,[v]:f}}}}}},p4=function(e){return e===void 0&&(e={}),{options:e,fn(t){var s,r;const{x:o,y:c,placement:u,rects:f,middlewareData:h}=t,{offset:m=0,mainAxis:p=!0,crossAxis:x=!0}=hr(e,t),v={x:o,y:c},j=Ts(u),w=Vg(j);let C=v[w],S=v[j];const N=hr(m,t),E=typeof N=="number"?{mainAxis:N,crossAxis:0}:{mainAxis:(s=N.mainAxis)!=null?s:0,crossAxis:(r=N.crossAxis)!=null?r:0};if(p){const A=w==="y"?"height":"width",_=f.reference[w]-f.floating[A]+E.mainAxis,F=f.reference[w]+f.reference[A]-E.mainAxis;C<_?C=_:C>F&&(C=F)}if(x){var R,D;const A=w==="y"?"width":"height",_=qN.has(ti(u)),F=f.reference[j]-f.floating[A]+(_&&((R=h.offset)==null?void 0:R[j])||0)+(_?0:E.crossAxis),O=f.reference[j]+f.reference[A]+(_?0:((D=h.offset)==null?void 0:D[j])||0)-(_?E.crossAxis:0);S<F?S=F:S>O&&(S=O)}return{[w]:C,[j]:S}}}},g4=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:s,rects:r,platform:o,elements:c}=t,{apply:u=()=>{},...f}=hr(e,t),h=await o.detectOverflow(t,f),m=ti(s),p=uo(s),x=Ts(s)==="y",{width:v,height:j}=r.floating;let w,C;m==="top"||m==="bottom"?(w=m,C=p===(await(o.isRTL==null?void 0:o.isRTL(c.floating))?"start":"end")?"left":"right"):(C=m,w=p==="end"?"top":"bottom");const S=j-h.top-h.bottom,N=v-h.left-h.right,E=ei(j-h[w],S),R=ei(v-h[C],N),D=t.middlewareData.shift,A=!D;let _=E,F=R;D!=null&&D.enabled.x&&(F=N),D!=null&&D.enabled.y&&(_=S),A&&!p&&(x?F=v-2*or(h.left,h.right):_=j-2*or(h.top,h.bottom)),await u({...t,availableWidth:F,availableHeight:_});const O=await o.getDimensions(c.floating);return v!==O.width||j!==O.height?{reset:{rects:!0}}:{}}}};function $d(){return typeof window<"u"}function fo(e){return HN(e)?(e.nodeName||"").toLowerCase():"#document"}function jn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function gr(e){var t;return(t=(HN(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function HN(e){return $d()?e instanceof Node||e instanceof jn(e).Node:!1}function ks(e){return $d()?e instanceof Element||e instanceof jn(e).Element:!1}function ai(e){return $d()?e instanceof HTMLElement||e instanceof jn(e).HTMLElement:!1}function B0(e){return!$d()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof jn(e).ShadowRoot}function qd(e){const{overflow:t,overflowX:s,overflowY:r,display:o}=Ms(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+s)&&o!=="inline"&&o!=="contents"}function x4(e){return/^(table|td|th)$/.test(fo(e))}function Hd(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const y4=/transform|translate|scale|rotate|perspective|filter/,v4=/paint|layout|strict|content/,Mi=e=>!!e&&e!=="none";let Mm;function qg(e){const t=ks(e)?Ms(e):e;return Mi(t.transform)||Mi(t.translate)||Mi(t.scale)||Mi(t.rotate)||Mi(t.perspective)||!Hg()&&(Mi(t.backdropFilter)||Mi(t.filter))||y4.test(t.willChange||"")||v4.test(t.contain||"")}function b4(e){let t=$i(e);for(;ai(t)&&!Ll(t);){if(qg(t))return t;if(Hd(t))return null;t=$i(t)}return null}function Hg(){return Mm==null&&(Mm=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Mm}function Ll(e){return/^(html|body|#document)$/.test(fo(e))}function Ms(e){return jn(e).getComputedStyle(e)}function Kd(e){return ks(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function $i(e){if(fo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||B0(e)&&e.host||gr(e);return B0(t)?t.host:t}function KN(e){const t=$i(e);return Ll(t)?(e.ownerDocument||e).body:ai(t)&&qd(t)?t:KN(t)}function Ul(e,t,s){var r;t===void 0&&(t=[]),s===void 0&&(s=!0);const o=KN(e),c=o===((r=e.ownerDocument)==null?void 0:r.body),u=jn(o);if(c){const f=Rp(u);
9return t.concat(u,u.visualViewport||[],qd(o)?o:[],f&&s?Ul(f):[])}else return t.concat(o,Ul(o,[],s))}function Rp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function GN(e){const t=Ms(e);let s=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ai(e),c=o?e.offsetWidth:s,u=o?e.offsetHeight:r,f=ud(s)!==c||ud(r)!==u;return f&&(s=c,r=u),{width:s,height:r,$:f}}function Kg(e){return ks(e)?e:e.contextElement}function Wa(e){const t=Kg(e);if(!ai(t))return lr(1);const s=t.getBoundingClientRect(),{width:r,height:o,$:c}=GN(t);let u=(c?ud(s.width):s.width)/r,f=(c?ud(s.height):s.height)/o;return(!u||!Number.isFinite(u))&&(u=1),(!f||!Number.isFinite(f))&&(f=1),{x:u,y:f}}const w4=lr(0);function YN(e){const t=jn(e);return!Hg()||!t.visualViewport?w4:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function j4(e,t,s){return t===void 0&&(t=!1),!!s&&t&&s===jn(e)}function qi(e,t,s,r){t===void 0&&(t=!1),s===void 0&&(s=!1);const o=e.getBoundingClientRect(),c=Kg(e);let u=lr(1);t&&(r?ks(r)&&(u=Wa(r)):u=Wa(e));const f=j4(c,s,r)?YN(c):lr(0);let h=(o.left+f.x)/u.x,m=(o.top+f.y)/u.y,p=o.width/u.x,x=o.height/u.y;if(c&&r){const v=jn(c),j=ks(r)?jn(r):r;let w=v,C=Rp(w);for(;C&&j!==w;){const S=Wa(C),N=C.getBoundingClientRect(),E=Ms(C),R=N.left+(C.clientLeft+parseFloat(E.paddingLeft))*S.x,D=N.top+(C.clientTop+parseFloat(E.paddingTop))*S.y;h*=S.x,m*=S.y,p*=S.x,x*=S.y,h+=R,m+=D,w=jn(C),C=Rp(w)}}return fd({width:p,height:x,x:h,y:m})}function Gd(e,t){const s=Kd(e).scrollLeft;return t?t.left+s:qi(gr(e)).left+s}function QN(e,t){const s=e.getBoundingClientRect(),r=s.left+t.scrollLeft-Gd(e,s),o=s.top+t.scrollTop;return{x:r,y:o}}function S4(e){let{elements:t,rect:s,offsetParent:r,strategy:o}=e;const c=o==="fixed",u=gr(r),f=t?Hd(t.floating):!1;if(r===u||f&&c)return s;let h={scrollLeft:0,scrollTop:0},m=lr(1);const p=lr(0),x=ai(r);if((x||!c)&&((fo(r)!=="body"||qd(u))&&(h=Kd(r)),x)){const j=qi(r);m=Wa(r),p.x=j.x+r.clientLeft,p.y=j.y+r.clientTop}const v=u&&!x&&!c?QN(u,h):lr(0);return{width:s.width*m.x,height:s.height*m.y,x:s.x*m.x-h.scrollLeft*m.x+p.x+v.x,y:s.y*m.y-h.scrollTop*m.y+p.y+v.y}}function N4(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function C4(e){const t=Kd(e),s=e.ownerDocument.body,r=or(e.scrollWidth,e.clientWidth,s.scrollWidth,s.clientWidth),o=or(e.scrollHeight,e.clientHeight,s.scrollHeight,s.clientHeight);let c=-t.scrollLeft+Gd(e);const u=-t.scrollTop;return Ms(s).direction==="rtl"&&(c+=or(e.clientWidth,s.clientWidth)-r),{width:r,height:o,x:c,y:u}}const E4=25;function T4(e,t,s){s===void 0&&(s="viewport");const r=s==="layoutViewport",o=jn(e),c=gr(e),u=o.visualViewport;let f=c.clientWidth,h=c.clientHeight,m=0,p=0;if(u){const v=!Hg()||t==="fixed";r?v||(m=-u.offsetLeft,p=-u.offsetTop):(f=u.width,h=u.height,v&&(m=u.offsetLeft,p=u.offsetTop))}if(Gd(c)<=0){const v=c.ownerDocument,j=v.body,w=getComputedStyle(j),C=v.compatMode==="CSS1Compat"&&parseFloat(w.marginLeft)+parseFloat(w.marginRight)||0,S=Math.abs(c.clientWidth-j.clientWidth-C),N=getComputedStyle(c).scrollbarGutter==="stable both-edges"?S/2:S;N<=E4&&(f-=N)}return{width:f,height:h,x:m,y:p}}function A4(e,t){const s=qi(e,!0,t==="fixed"),r=s.top+e.clientTop,o=s.left+e.clientLeft,c=Wa(e),u=e.clientWidth*c.x,f=e.clientHeight*c.y,h=o*c.x,m=r*c.y;return{width:u,height:f,x:h,y:m}}function $0(e,t,s){let r;if(t==="viewport"||t==="layoutViewport")r=T4(e,s,t);else if(t==="document")r=C4(gr(e));else if(ks(t))r=A4(t,s);else{const o=YN(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return fd(r)}function R4(e,t){const s=t.get(e);if(s)return s;let r=Ul(e,[],!1).filter(f=>ks(f)&&fo(f)!=="body"),o=null;const c=Ms(e).position==="fixed";let u=c?$i(e):e;for(;ks(u)&&!Ll(u);){const f=Ms(u),h=qg(u),m=o?o.position:c?"fixed":"";!h&&(m==="fixed"||m==="absolute"&&f.position==="static")?r=r.filter(x=>x!==u):o=f,u=$i(u)}return t.set(e,r),r}function k4(e){let{element:t,boundary:s,rootBoundary:r,strategy:o}=e;const u=[...s==="clippingAncestors"?Hd(t)?[]:R4(t,this._c):[].concat(s),r],f=$0(t,u[0],o);let h=f.top,m=f.right,p=f.bottom,x=f.left;for(let v=1;v<u.length;v++){const j=$0(t,u[v],o);h=or(j.top,h),m=ei(j.right,m),p=ei(j.bottom,p),x=or(j.left,x)}return{width:m-x,height:p-h,x,y:h}}function M4(e){const{width:t,height:s}=GN(e);return{width:t,height:s}}function O4(e,t,s){const r=ai(t),o=gr(t),c=s==="fixed",u=qi(e,!0,c,t);let f={scrollLeft:0,scrollTop:0};const h=lr(0);if((r||!c)&&((fo(t)!=="body"||qd(o))&&(f=Kd(t)),r)){const v=qi(t,!0,c,t);h.x=v.x+t.clientLeft,h.y=v.y+t.clientTop}!r&&o&&(h.x=Gd(o));const m=o&&!r&&!c?QN(o,f):lr(0),p=u.left+f.scrollLeft-h.x-m.x,x=u.top+f.scrollTop-h.y-m.y;return{x:p,y:x,width:u.width,height:u.height}}
vendor: 4,245 bytes, line 9
9function Om(e){return Ms(e).position==="static"}function q0(e,t){if(!ai(e)||Ms(e).position==="fixed")return null;if(t)return t(e);let s=e.offsetParent;return gr(e)===s&&(s=s.ownerDocument.body),s}function WN(e,t){const s=jn(e);if(Hd(e))return s;if(!ai(e)){let o=$i(e);for(;o&&!Ll(o);){if(ks(o)&&!Om(o))return o;o=$i(o)}return s}let r=q0(e,t);for(;r&&x4(r)&&Om(r);)r=q0(r,t);return r&&Ll(r)&&Om(r)&&!qg(r)?s:r||b4(e)||s}const D4=async function(e){const t=this.getOffsetParent||WN,s=this.getDimensions,r=await s(e.floating);return{reference:O4(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function P4(e){return Ms(e).direction==="rtl"}const _4={convertOffsetParentRelativeRectToViewportRelativeRect:S4,getDocumentElement:gr,getClippingRect:k4,getOffsetParent:WN,getElementRects:D4,getClientRects:N4,getDimensions:M4,getScale:Wa,isElement:ks,isRTL:P4};function XN(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function L4(e,t,s){let r=null,o;const c=gr(e);function u(){var p;clearTimeout(o),(p=r)==null||p.disconnect(),r=null}function f(p,x){p===void 0&&(p=!1),x===void 0&&(x=1),u();const v=e.getBoundingClientRect(),{left:j,top:w,width:C,height:S}=v;if(p||t(),!C||!S)return;const N=bu(w),E=bu(c.clientWidth-(j+C)),R=bu(c.clientHeight-(w+S)),D=bu(j),_={rootMargin:-N+"px "+-E+"px "+-R+"px "+-D+"px",threshold:or(0,ei(1,x))||1};let F=!0;function O(I){const V=I[0].intersectionRatio;if(!XN(v,e.getBoundingClientRect()))return f();if(V!==x){if(!F)return f();V?f(!1,V):o=setTimeout(()=>{f(!1,1e-7)},1e3)}F=!1}try{r=new IntersectionObserver(O,{..._,root:c.ownerDocument})}catch{r=new IntersectionObserver(O,_)}r.observe(e)}const h=jn(e),m=()=>f(s);return h.addEventListener("resize",m),f(!0),()=>{h.removeEventListener("resize",m),u()}}function U4(e,t,s,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:c=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:h=!1}=r,m=Kg(e),p=o||c?[...m?Ul(m):[],...t?Ul(t):[]]:[];p.forEach(N=>{o&&N.addEventListener("scroll",s),c&&N.addEventListener("resize",s)});const x=m&&f?L4(m,s,c):null;let v=-1,j=null;u&&(j=new ResizeObserver(N=>{let[E]=N;E&&E.target===m&&j&&t&&(j.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var R;(R=j)==null||R.observe(t)})),s()}),m&&!h&&j.observe(m),t&&j.observe(t));let w,C=h?qi(e):null;h&&S();function S(){const N=qi(e);C&&!XN(C,N)&&s(),C=N,w=requestAnimationFrame(S)}return s(),()=>{var N;p.forEach(E=>{o&&E.removeEventListener("scroll",s),c&&E.removeEventListener("resize",s)}),x?.(),(N=j)==null||N.disconnect(),j=null,h&&cancelAnimationFrame(w)}}const I4=h4,z4=m4,F4=u4,V4=g4,B4=d4,H0=c4,$4=p4,q4=(e,t,s)=>{const r=new Map,o=s??{},c={..._4,...o.platform,_c:r};return l4(e,t,{...o,platform:c})};var H4=typeof document<"u",K4=function(){},qu=H4?y.useLayoutEffect:K4;function hd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let s,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(s=e.length,s!==t.length)return!1;for(r=s;r--!==0;)if(!hd(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),s=o.length,s!==Object.keys(t).length)return!1;for(r=s;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=s;r--!==0;){const c=o[r];if(!(c==="_owner"&&e.$$typeof)&&!hd(e[c],t[c]))return!1}return!0}return e!==e&&t!==t}function ZN(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function K0(e,t){const s=ZN(e);return Math.round(t*s)/s}function Dm(e){const t=y.useRef(e);return qu(()=>{t.current=e}),t}function G4(e){e===void 0&&(e={});const{placement:t="bottom",strategy:s="absolute",middleware:r=[],platform:o,elements:{reference:c,floating:u}={},transform:f=!0,whileElementsMounted:h,open:m}=e,[p,x]=y.useState({x:0,y:0,strategy:s,placement:t,middlewareData:{},isPositioned:!1}),[v,j]=y.useState(r);hd(v,r)||j(r);const[w,C]=y.useState(null),[S,N]=y.useState(null),E=y.useCallback(z=>{z!==_.current&&(_.current=z,C(z))},[]),R=y.useCallback(z=>{z!==F.current&&(F.current=z,N(z))},[]),D=c||w,A=u||S,_=y.useRef(null),F=y.useRef(null),O=y.useRef(p),I=h!=null,V=Dm(h),H=Dm(o),k=Dm(m),q=y.useCallback(()=>
9{if(!_.current||!F.current)return;const z={placement:t,strategy:s,middleware:v};H.current&&(z.platform=H.current),q4(_.current,F.current,z).then(W=>{const M={...W,isPositioned:k.current!==!1};J.current&&!hd(O.current,M)&&(O.current=M,eo.flushSync(()=>{x(M)}))})},[v,t,s,H,k]);qu(()=>{m===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,x(z=>({...z,isPositioned:!1})))},[m]);const J=y.useRef(!1);qu(()=>(J.current=!0,()=>{J.current=!1}),[]),qu(()=>{if(D&&(_.current=D),A&&(F.current=A),D&&A){if(V.current)return V.current(D,A,q);q()}},[D,A,q,V,I]);const re=y.useMemo(()=>({reference:_,floating:F,setReference:E,setFloating:R}),[E,R]),U=y.useMemo(()=>({reference:D,floating:A}),[D,A]),L=y.useMemo(()=>{const z={position:s,left:0,top:0};if(!U.floating)return z;const W=K0(U.floating,p.x),M=K0(U.floating,p.y);return f?{...z,transform:"translate("+W+"px, "+M+"px)",...ZN(U.floating)>=1.5&&{willChange:"transform"}}:{position:s,left:W,top:M}},[s,f,U.floating,p.x,p.y]);return y.useMemo(()=>({...p,update:q,refs:re,elements:U,floatingStyles:L}),[p,q,re,U,L])}const Y4=e=>{function t(s){return{}.hasOwnProperty.call(s,"current")}return{name:"arrow",options:e,fn(s){const{element:r,padding:o}=typeof e=="function"?e(s):e;return r&&t(r)?r.current!=null?H0({element:r.current,padding:o}).fn(s):{}:r?H0({element:r,padding:o}).fn(s):{}}}},Q4=(e,t)=>{const s=I4(e);return{name:s.name,fn:s.fn,options:[e,t]}},W4=(e,t)=>{const s=z4(e);return{name:s.name,fn:s.fn,options:[e,t]}},X4=(e,t)=>({fn:$4(e).fn,options:[e,t]}),Z4=(e,t)=>{const s=F4(e);return{name:s.name,fn:s.fn,options:[e,t]}},J4=(e,t)=>{const s=V4(e);return{name:s.name,fn:s.fn,options:[e,t]}},eP=(e,t)=>{const s=B4(e);return{name:s.name,fn:s.fn,options:[e,t]}},tP=(e,t)=>{const s=Y4(e);return{name:s.name,fn:s.fn,options:[e,t]}};var nP=Object.defineProperty,sP=(e,t)=>nP(e,"name",{value:t,configurable:!0});function Gg(e){const[t,s]=y.useState(void 0);return pn(()=>{if(e){s({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const c=o[0];let u,f;if("borderBoxSize"in c){const h=c.borderBoxSize,m=Array.isArray(h)?h[0]:h;u=m.inlineSize,f=m.blockSize}else u=e.offsetWidth,f=e.offsetHeight;s({width:u,height:f})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else s(void 0)},[e]),t}sP(Gg,"useSize");var rP=Object.defineProperty,Xr=(e,t)=>rP(e,"name",{value:t,configurable:!0}),JN="Popper",[eC,Yd]=ss(JN),[iP,tC]=eC(JN),aP=Xr(e=>{const{__scopePopper:t,children:s}=e,[r,o]=y.useState(null),[c,u]=y.useState(void 0);return a.jsx(iP,{scope:t,anchor:r,onAnchorChange:o,placementState:c,setPlacementState:u,children:s})},"Popper"),oP="PopperAnchor",lP=y.forwardRef(Xr(function(t,s){const{__scopePopper:r,virtualRef:o,...c}=t,u=tC(oP,r),f=y.useRef(null),h=u.onAnchorChange,m=y.useCallback(C=>{f.current=C,C&&h(C)},[h]),p=Ge(s,m),x=y.useRef(null);y.useEffect(()=>{if(!o)return;const C=x.current;x.current=o.current,C!==x.current&&h(x.current)});const v=u.placementState&&Qd(u.placementState),j=v?.[0],w=v?.[1];return o?null:a.jsx(Xe.div,{"data-radix-popper-side":j,"data-radix-popper-align":w,...c,ref:p})},"PopperAnchor")),nC="PopperContent",[cP,Uq]=eC(nC),uP=y.forwardRef(Xr(function(t,s){const{__scopePopper:r,side:o="bottom",sideOffset:c=0,align:u="center",alignOffset:f=0,arrowPadding:h=0,avoidCollisions:m=!0,collisionBoundary:p=[],collisionPadding:x=0,sticky:v="partial",hideWhenDetached:j=!1,updatePositionStrategy:w="optimized",onPlaced:C,...S}=t,N=tC(nC,r),[E,R]=y.useState(null),D=Ge(s,R),[A,_]=y.useState(null),F=Gg(A),O=F?.width??0,I=F?.height??0,V=o+(u!=="center"?"-"+u:""),H=typeof x=="number"?x:{top:0,right:0,bottom:0,left:0,...x},k=Array.isArray(p)?p:[p],q=k.length>0,J={padding:H,boundary:k.filter(sC),altBoundary:q},{refs:re,floatingStyles:U,placement:L,isPositioned:z,middlewareData:W}=G4({strategy:"fixed",placement:V,whileElementsMounted:Xr((...xe)=>U4(...xe,{animationFrame:w==="always"}),"whileElementsMounted"),elements:{reference:N.anchor},middleware:[Q4({mainAxis:c+I,alignmentAxis:f}),m&&W4({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?X4():void 0,...J}),m&&Z4({...J}),J4({...J,apply:Xr(({elements:xe,rects:ut,availableWidth:nt,availableHeight:tn})=>{const{width:nn,height:Rt}=ut.reference,jt=xe.floating.style;jt.setProperty("--radix-popper-available-width",`${nt}px`),jt.setProperty("--radix-popper-available-height",`${tn}px`),jt.setProperty("--radix-popper-anchor-width",`${nn}px`),jt.setProperty("--radix-popper-anchor-height",`${Rt}px`)},"apply")}),A&&tP({element:A,padding:h}),dP({arrowWidth:O,arrowHeight:I}),j&&eP({strategy:"referenceHidden",...J,boundary:q?J.boundary:void 0})]}),M=N.setPlacementState;pn(()=>(M(L),()=>{M(void 0)}),[L,M]);const[K,ie]=Qd(L),ee=In(C);pn(()=>{z&&ee?.()},[z,ee]);const ae=W.arrow?.x,oe=W.arrow?.y,le=W.arrow?.centerOffset!==0,[Ne,ce]=y.useState();return pn(()=>{E&&ce(window.getComputedStyle(E).zIndex)},[E]),a.jsx("div",{ref:re.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:z?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ne,"--radix-popper-transform-origin":[W.transformOrigin?.x,W.transformOrigin?.y].join(" "),...W.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:a.jsx(cP,{scope:r,placedSide:K,placedAlign:ie,onArrowChange:_,arrowX:ae,arrowY:oe,shouldHideArrow:le,children:a.jsx(Xe.div,{"data-side":K,"data-align":ie,...S,ref:D,style:{...S.style,animation:z?S.style?.animation:"none"}})})})},"PopperContent"));function sC(e){return e!==null}Xr(sC,"isNotNull");var dP=Xr(e=>({name:"transformOrigin",options:e,fn(t){const{placement:s,rects:r,middlewareData:o}=t,u=o.arrow?.centerOffset!==0,f=u?0:e.arrowWidth,h=u?0:e.arrowHeight,[m,p]=Qd(s),x={start:"0%",center:"50%",end:"100%"}[p],v=(o.arrow?.x??0)+f/2,j=(o.arrow?.y??0)+h/2;let w="",C="";return m==="bottom"?(w=u?x:`${v}px`,C=`${-h}px`):m==="top"?(w=u?x:`${v}px`,C=`${r.floating.height+h}px`):m==="right"?(w=`${-h}px`,C=u?x:`${j}px`):m==="left"&&(w=`${r.floating.width+h}px`,C=u?x:`${j}px`),{data:{x:w,y:C}}}}),"transformOrigin");function Qd(e){const[t,s="center"]=e.split("-");return[t,s]}Xr(Qd,"getSideAndAlignFromPlacement");var fP=aP,hP=lP,rC=uP,mP=Object.defineProperty,dn=(e,t)=>mP(e,"name",{value:t,configurable:!0}),[Yg,Iq]=ss("Tooltip",[Yd]),pP=Yd(),gP="TooltipProvider",xP=700,G0="tooltip.open",[yP,vP]=Yg(gP),bP=dn(e=>{const{__scopeTooltip:t,delayDuration:s=xP,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:c}=e,u=y.useRef(!0),f=y.useRef(!1),h=y.useRef(0);return y.useEffect(()=>{const m=h.current;return()=>window.clearTimeout(m)},[]),a.jsx(yP,{scope:t,isOpenDelayedRef:u,delayDuration:s,onOpen:y.useCallback(()=>{r<=0||(window.clearTimeout(h.current),u.current=!1)},[r]),onClose:y.useCallback(()=>{r<=0||(window.clearTimeout(h.current),h.current=window.setTimeout(()=>u.current=!0,r))},[r]),isPointerInTransitRef:f,onPointerInTransitChange:y.useCallback(m=>{f.current=m},[]),disableHoverableContent:o,children:c})},"TooltipProvider"),wP="Tooltip",[zq,Wd]=Yg(wP),iC="TooltipPortal",[jP,SP]=Yg(iC,{forceMount:void 0}),NP=dn(e=>{const{__scopeTooltip:t,forceMount:s,children:r,container:o}=e,c=Wd(iC,t);return a.jsx(jP,{scope:t,forceMount:s,children:a.jsx(Ps,{present:s||c.open,children:a.jsx(Fd,{asChild:!0,container:o,children:r})})})},"TooltipPortal"),Il="TooltipContent",CP=y.forwardRef(dn(function(t,s){const r=SP(Il,t.__scopeTooltip),{forceMount:o=r.forceMount,side:c="top",...u}=t,f=Wd(Il,t.__scopeTooltip);return a.jsx(Ps,{present:o||f.open,children:f.disableHoverableContent?a.jsx(aC,{side:c,...u,ref:s}):a.jsx(EP,{side:c,...u,ref:s})})},"TooltipContent")),EP=y.forwardRef(dn(function(t,s){const r=Wd(Il,t.__scopeTooltip),o=vP(Il,t.__scopeTooltip),c=y.useRef(null),u=Ge(s,c),[f,h]=y.useState(null),{trigger:m,onClose:p}=r,x=c.current,{onPointerInTransitChange:v}=o,j=y.useCallback(()=>{h(null),v(!1)},[v]),w=y.useCallback((C,S)=>{const N=C.currentTarget,E={x:C.clientX,y:C.clientY},R=oC(E,N.getBoundingClientRect()),D=lC(E,R),A=cC(S.getBoundingClientRect()),_=dC([...D,...A]);h(_),v(!0)},[v]);return y.useEffect(()=>()=>j(),[j]),y.useEffect(()=>{if(m&&x){const C=dn(N=>w(N,x),"handleTriggerLeave"),S=dn(N=>w(N,m),"handleContentLeave");return m.addEventListener("pointerleave",C),x.addEventListener("pointerleave",S),()=>{m.removeEventListener("pointerleave",C),x.removeEventListener("pointerleave",S)}}},[m,x,w,j]),y.useEffect(()=>{if(f){const C=dn(S=>{const N=S.target,E={x:S.clientX,y:S.clientY},R=m?.contains(N)||x?.contains(N),D=!uC(E,f);R?j():D&&(j(),p())},"handleTrackPointerGrace");return document.addEventListener("pointermove",C),()=>document.removeEventListener("pointermove",C)}},[m,x,f,p,j]),a.jsx(aC,{...t,ref:u})},"TooltipContentHoverable")),TP=MS("TooltipContent"),aC=y.forwardRef(dn(function(t,s){const{__scopeTooltip:r,children:o,"aria-label":c,id:u,onEscapeKeyDown:f,onPointerDownOutside:h,...m}=t,p=Wd(Il,r),x=pP(r),{onClose:v}=p;y.useEffect(()=>(document.addEventListener(G0,v),()=>document.removeEventListener(G0,v)),[v]),y.useEffect(()=>{if(p.trigger){const w=dn(C=>{C.target instanceof Node&&C.target.contains(p.trigger)&&v()},"handleScroll");return window.addEventListener("scroll",w,{capture:!0}),()=>window.removeEventListener("scroll",w,{capture:!0})}},[p.trigger,v]);const{setContentId:j}=p;return pn(()=>(j(u),()=>{j(void 0)}),[u,j]),a.jsx(zd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:w=>w.preventDefault(),onDismiss:v,children:a.jsxs(rC,{"data-state":p.stateAttribute,role:c?void 0:"tooltip",id:c?void 0:p.contentId,...x,...m,ref:s,style:{...m.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[a.jsx(TP,{children:o}),c?a.jsx(yM,{id:p.contentId,role:"tooltip",children:c}):null]})})},"TooltipContentImpl"));function oC(e,t){const s=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),c=Math.abs(t.left-e.x);switch(Math.min(s,r,o,c)){case c:return"left";case o:return"right";case s:return"top";case r:return"bottom";default:throw new Error("unreachable")}}dn(oC,"getExitSideFromRect");function lC(e,t,s=5){const r=[];switch(t){case"top":r.push({x:e.x-s,y:e.y+s},{x:e.x+s,y:e.y+s});break;case"bottom":r.push({x:e.x-s,y:e.y-s},{x:e.x+s,y:e.y-s});break;case"left":r.push({x:e.x+s,y:e.y-s},{x:e.x+s,y:e.y+s});break;case"right":r.push({x:e.x-s,y:e.y-s},{x:e.x-s,y:e.y+s});break}return r}dn(lC,"getPaddedExitPoints");function cC(e){const{top:t,right:s,bottom:r,left:o}=e;return[{x:o,y:t},{x:s,y:t},{x:s,y:r},{x:o,y:r}]}dn(cC,"getPointsFromRect");function uC(e,t){const{x:s,y:r}=e;let o=!1;for(let c=0,u=t.length-1;c<t.length;u=c++){const f=t[c],h=t[u],m=f.x,p=f.y,x=h.x,v=h.y;p>r!=v>r&&s<(x-m)*(r-p)/(v-p)+m&&(o=!o)}return o}dn(uC,"isPointInPolygon");function dC(e){const t=e.slice();return t.sort((s,r)=>s.x<r.x?-1:s.x>r.x?1:s.y<r.y?-1:s.y>r.y?1:0),fC(t)}dn(dC,"getHull");function fC(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const c=t[t.length-1],u=t[t.length-2];if((c.x-u.x)*(o.y-u.y)>=(c.y-u.y)*(o.x-u.x))t.pop();else break}t.push(o)}t.pop();const s=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;s.length>=2;){const c=s[s.length-1],u=s[s.length-2];if((c.x-u.x)*(o.y-u.y)>=(c.y-u.y)*(o.x-u.x))s.pop();else break}s.push(o)}return s.pop(),t.length===1&&s.length===1&&t[0].x===s[0].x&&t[0].y===s[0].y?t:t.concat(s)}dn(fC,"getHullPresorted");var AP=bP,RP=NP,hC=CP;
9const kP=AP,MP=y.forwardRef(({className:e,sideOffset:t=4,...s},r)=>a.jsx(RP,{children:a.jsx(hC,{ref:r,sideOffset:t,className:Ee("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",e),...s})}));MP.displayName=hC.displayName;function OP(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var s,r,o,c,u=[],f="",h=e.split("/");for(h[0]||h.shift();o=h.shift();)s=o[0],s==="*"?(u.push(s),f+=o[1]==="?"?"(?:/(.*))?":"/(.*)"):s===":"?(r=o.indexOf("?",1),c=o.indexOf(".",1),u.push(o.substring(1,~r?r:~c?c:o.length)),f+=~r&&!~c?"(?:/([^/]+?))?":"/([^/]+?)",~c&&(f+=(~r?"?":"")+"\\"+o.substring(c))):f+="/"+o;return{keys:u,pattern:new RegExp("^"+f+(t?"(?=$|/)":"/?$"),"i")}}var Pm={exports:{}},_m={};var Y0;function DP(){if(Y0)return _m;Y0=1;var e=Ld();function t(x,v){return x===v&&(x!==0||1/x===1/v)||x!==x&&v!==v}var s=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,c=e.useLayoutEffect,u=e.useDebugValue;function f(x,v){var j=v(),w=r({inst:{value:j,getSnapshot:v}}),C=w[0].inst,S=w[1];return c(function(){C.value=j,C.getSnapshot=v,h(C)&&S({inst:C})},[x,j,v]),o(function(){return h(C)&&S({inst:C}),x(function(){h(C)&&S({inst:C})})},[x]),u(j),j}function h(x){var v=x.getSnapshot;x=x.value;try{var j=v();return!s(x,j)}catch{return!0}}function m(x,v){return v()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:f;return _m.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,_m}var Q0;function PP(){return Q0||(Q0=1,Pm.exports=DP()),Pm.exports}var _P=PP();const LP=Gi.useInsertionEffect,UP=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",mC=UP?y.useLayoutEffect:y.useEffect,IP=LP||mC,Qg=e=>{const t=y.useRef([e,(...s)=>t[0](...s)]).current;return IP(()=>{t[0]=e}),t[1]},W0=["popstate","pushState","replaceState","hashchange"];let Sl=[];const X0=()=>Sl.forEach(e=>e()),zP=e=>(Sl.push(e)===1&&W0.forEach(t=>addEventListener(t,X0)),()=>{Sl=Sl.filter(t=>t!==e),Sl.length||W0.forEach(t=>removeEventListener(t,X0))}),pC=(e,t)=>_P.useSyncExternalStore(zP,e,t),Z0=()=>location.search,FP=({ssrSearch:e}={})=>pC(Z0,e!=null?()=>e:Z0),J0=()=>location.pathname,VP=({ssrPath:e}={})=>pC(J0,e!=null?()=>e:J0),BP=(e,{replace:t=!1,state:s=null}={})=>history[t?"replaceState":"pushState"](s,"",e),$P=e=>[VP(e),BP],e1=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[e1]>"u"){for(const e of["pushState","replaceState"]){const t=history[e];history[e]=function(){const s=t.apply(this,arguments),r=new Event(e);return r.arguments=arguments,dispatchEvent(r),s}}Object.defineProperty(window,e1,{value:!0})}const gC=(e="")=>e==="/"?"":e,qP=(e,t)=>e[0]==="~"?e.slice(1):gC(t)+e,xC=(e,t)=>(e=kp(gC(e)),t=kp(t),!e||!t.toLowerCase().indexOf(e.toLowerCase())?t.slice(e.length)||"/":"~"+t),kp=e=>{try{return e.includes("%")?decodeURI(e):e}catch{return e}},HP=e=>kp(e[0]==="?"?e.slice(1):e),yC={hook:$P,searchHook:FP,parser:OP,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e,aroundNav:(e,t,s)=>e(t,s)},vC=y.createContext(yC),oi=()=>y.useContext(vC),bC={},wC=y.createContext(bC),KP=()=>y.useContext(wC),Wg=(e,t=e.base)=>xC(t,e.hook(e)[0]),Xg=e=>{const[t,s]=e.hook(e);return[xC(e.base,t),Qg((r,o)=>e.aroundNav(s,qP(r,e.base),o))]},zn=()=>Xg(oi()),ho=()=>{const e=oi();return HP(e.searchHook(e))},Zg=(e,t,s,r)=>{const{pattern:o,keys:c}=t instanceof RegExp?{pattern:t}:e(t||"*",r),u=o.exec(s);if(!u)return[!1,null];const f={};for(let h=1;h<u.length;h++)f[h-1]=u[h];if(c)for(let h=0;h<c.length;h++)f[c[h]]=u[h+1];else Object.assign(f,u.groups);return r?[!0,f,u[0]]:[!0,f]},Qi=e=>{const t=oi(),s=/^~\//.test(e);return Zg(t.parser,s?e.slice(1):e,Wg(t,s?"":t.base))},jC=({children:e,...t})=>{const s=oi(),r=t.hook?yC:s;let o=r;if(t.ssrPath){const[h,m=t.ssrSearch??""]=t.ssrPath.split("?");h&&(t.ssrSearch=m,t.ssrPath=h)}t.hrefs=t.hrefs??t.hook?.hrefs,t.searchHook=t.searchHook??t.hook?.searchHook;let c=y.useRef(r),u=c.current,f=u;for(let h in r){const m=h==="base"?r[h]+(t[h]??""):t[h]??r[h];m!==f[h]&&(u===f&&(c.current=f={...f}),f[h]=m),(m!==r[h]||m!==o[h])&&(o=f)}return y.createElement(vC.Provider,{value:o},e)},GP=({children:e,component:t},s)=>t?y.createElement(t,{params:s}):typeof e=="function"?e(s):e,YP=e=>{let t=y.useRef(bC);const s=t.current,r=Object.keys(e);return t.current=r.length!==Object.keys(s).length||r.some(o=>e[o]!==s[o])?e:s},Se=({path:e,nest:t,match:s,...r})=>{const o=oi(),c=Wg(o),[u,f,h]=s??Zg(o.parser,e,c,t),m=YP({...KP(),...f});if(!u)return null;const p=GP(r,m);return y.createElement(wC.Provider,{value:m},h?y.createElement(jC,{base:h},p):p)},xt=y.forwardRef((e,t)=>
9{const s=oi(),[r,o]=Xg(s),{to:c="",href:u=c,onClick:f,asChild:h,children:m,className:p,replace:x,state:v,transition:j,...w}=e;return w.onClick=Qg(C=>{C.ctrlKey||C.metaKey||C.altKey||C.shiftKey||C.button!==0||(f?.(C),C.defaultPrevented||(C.preventDefault(),o(u,e)))}),w.href=s.hrefs(u[0]==="~"?u.slice(1):s.base+u,s),p!==void 0&&(w.className=p?.call?p(r===u):p),t&&(w.ref=t),h&&y.isValidElement(m)?y.cloneElement(m,w):y.createElement("a",w,m)}),SC=(e,t=[])=>{if(Array.isArray(e))for(const s of e)SC(s&&s.type===y.Fragment?s.props.children:s,t);else t.push(e);return t},md=({children:e,location:t})=>{const s=oi(),r=Wg(s);for(const o of SC(e)){let c=0;if(y.isValidElement(o)&&(c=Zg(s.parser,o.props.path,t||r,o.props.nest))[0])return y.cloneElement(o,{match:c})}return null},wu=e=>{const{to:t,href:s=t}=e,r=oi(),[,o]=Xg(r),c=Qg(()=>o(t||s,e)),{ssrContext:u}=r;return mC(()=>{c()},[]),u&&(u.redirectTo=t),null};function QP(e,t="",s="/"){const r=c=>c.startsWith("/")&&!/^\/[\\/]/.test(c)&&!/[\r\n\\]/.test(c),o=r(e)?e+t:r(s)?s:"/";return`/api/login?returnTo=${encodeURIComponent(o)}`}function t1(){return"/".replace(/\/+$/,"")||"/"}function Jg(){const[e,t]=y.useState(null),[s,r]=y.useState(!0),[o,c]=y.useState(null),[u,f]=y.useState(0),h=y.useCallback(()=>f(x=>x+1),[]);y.useEffect(()=>{let x=!1;return r(!0),c(null),fetch("/api/auth/user",{credentials:"include",cache:"no-store"}).then(v=>{if(!v.ok)throw new Error(`HTTP ${v.status}`);return v.json()}).then(v=>{x||(t(v.user??null),r(!1))}).catch(()=>{x||(t(null),c("We couldn’t check your login. Please try again before signing in again."),r(!1))}),()=>{x=!0}},[u]);const m=y.useCallback(()=>{const x=QP(window.location.pathname,window.location.search,t1());window.self!==window.top?window.open(x,"_blank","noopener,noreferrer"):window.location.href=x},[]),p=y.useCallback(()=>{const x=t1();window.location.href=`/api/logout?returnTo=${encodeURIComponent(x)}`},[]);return{user:e,isLoading:s,isAuthenticated:!!e,authError:o,retryAuth:h,login:m,logout:p}}const WP=new Set([204,205,304]),XP="application/json, application/problem+json";function NC(e){return typeof Request<"u"&&e instanceof Request}function ZP(e,t){return t?t.toUpperCase():NC(e)?e.method.toUpperCase():"GET"}function JP(e){return typeof URL<"u"&&e instanceof URL}function CC(e){return typeof e=="string"?e:JP(e)?e.toString():e.url}function e5(e,t){if(typeof window>"u")return e;const s=CC(e);if(!s.startsWith("/api/"))return e;const r=new URL(s,window.location.origin),o=r.pathname;if(!(o==="/api/site"||o.startsWith("/api/admin/")||o.startsWith("/api/owner/newsletter/")||o.startsWith("/api/newsletter/")||o.startsWith("/api/storage/")))return e;const u=window.location.hostname.toLowerCase(),f=u==="alreadyalive.com"||u==="www.alreadyalive.com";if(f||(u==="michaelmarantz.com"||u==="www.michaelmarantz.com"))r.searchParams.set("site",f?"alreadyalive":"michael");else{if(!t&&r.searchParams.has("site"))return e;if(t)r.searchParams.set("site",t);else{let m="michael";const p=new URLSearchParams(window.location.search).get("site");if((p==="alreadyalive"||p==="michael")&&(m=p),window.location.pathname.startsWith("/admin")&&p!=="alreadyalive"&&p!=="michael")try{const x=window.localStorage.getItem("portfolio-admin-site");(x==="alreadyalive"||x==="michael")&&(m=x)}catch{}r.searchParams.set("site",m)}}return typeof e=="string"?`${r.pathname}${r.search}`:r}function t5(...e){const t=new Headers;for(const s of e)s&&new Headers(s).forEach((r,o)=>{t.set(o,r)});return t}function EC(e){const t=e.get("content-type");return t?t.split(";",1)[0].trim().toLowerCase():null}function Mp(e){return e==="application/json"||!!e?.endsWith("+json")}function TC(e){return!!(e&&(e.startsWith("text/")||e==="application/xml"||e==="text/xml"||e.endsWith("+xml")||e==="application/x-www-form-urlencoded"))}function AC(e,t){return!!(t==="HEAD"||WP.has(e.status)||e.headers.get("content-length")==="0"||e.body===null)}function RC(e){return e.charCodeAt(0)===65279?e.slice(1):e}function kC(e){const t=e.trimStart();return t.startsWith("{")||t.startsWith("[")}function gl(e,t){if(!e||typeof e!="object")return;const s=e[t];
9if(typeof s!="string")return;const r=s.trim();return r===""?void 0:r}function n5(e,t=300){return e.length>t?`${e.slice(0,t-1)}…`:e}function s5(e,t){const s=`HTTP ${e.status} ${e.statusText}`;if(typeof t=="string"){const u=t.trim();return u?`${s}: ${n5(u)}`:s}const r=gl(t,"title"),o=gl(t,"detail"),c=gl(t,"message")??gl(t,"error_description")??gl(t,"error");return r&&o?`${s}: ${r} — ${o}`:o?`${s}: ${o}`:c?`${s}: ${c}`:r?`${s}: ${r}`:s}class r5 extends Error{name="ApiError";status;statusText;data;headers;response;method;url;constructor(t,s,r){super(s5(t,s)),Object.setPrototypeOf(this,new.target.prototype),this.status=t.status,this.statusText=t.statusText,this.data=s,this.headers=t.headers,this.response=t,this.method=r.method,this.url=t.url||r.url}}class i5 extends Error{name="ResponseParseError";status;statusText;headers;response;method;url;rawBody;cause;constructor(t,s,r,o){super(`Failed to parse response from ${o.method} ${t.url||o.url} (${t.status} ${t.statusText}) as JSON`),Object.setPrototypeOf(this,new.target.prototype),this.status=t.status,this.statusText=t.statusText,this.headers=t.headers,this.response=t,this.method=o.method,this.url=t.url||o.url,this.rawBody=s,this.cause=r}}async function a5(e,t){const s=await e.text(),r=RC(s);if(r.trim()==="")return null;try{return JSON.parse(r)}catch(o){throw new i5(e,s,o,t)}}async function o5(e,t){if(AC(e,t))return null;const s=EC(e.headers);if(s&&!Mp(s)&&!TC(s))return typeof e.blob=="function"?e.blob():e.text();const r=await e.text(),o=RC(r);if(o.trim()==="")return null;if(Mp(s)||kC(o))try{return JSON.parse(o)}catch{return r}return r}function l5(e){const t=EC(e.headers);return Mp(t)?"json":TC(t)||t==null?"text":"blob"}async function c5(e,t,s){if(AC(e,s.method))return null;switch(t==="auto"?l5(e):t){case"json":return a5(e,s);case"text":{const o=await e.text();return o===""?null:o}case"blob":if(typeof e.blob!="function")throw new TypeError('Blob responses are not supported in this runtime. Use responseType "json" or "text" instead.');return e.blob()}}async function tt(e,t={}){e=e,e=e5(e,t.portfolioSite);const{responseType:s="auto",portfolioSite:r,headers:o,...c}=t,u=ZP(e,c.method);if(c.body!=null&&(u==="GET"||u==="HEAD"))throw new TypeError(`customFetch: ${u} requests cannot have a body.`);const f=t5(NC(e)?e.headers:void 0,o);typeof c.body=="string"&&!f.has("content-type")&&kC(c.body)&&f.set("content-type","application/json"),s==="json"&&!f.has("accept")&&f.set("accept",XP);const h={method:u,url:CC(e)},m=await fetch(e,{...c,method:u,headers:f});if(!m.ok){const p=await o5(m,u);throw new r5(m,p,h)}return await c5(m,s,h)}const xr=(e,t)=>{const s={queryKey:t};for(const r of Object.keys(e))r!=="queryKey"&&Object.defineProperty(s,r,{enumerable:!0,configurable:!0,get:()=>e[r]});return s},u5=e=>{const t=new URLSearchParams;Object.entries(e||{}).forEach(([r,o])=>{o!==void 0&&t.append(r,o===null?"null":String(o))});const s=t.toString();return s.length>0?`/api/site?${s}`:"/api/site"},MC=async(e,t)=>tt(u5(e),{...t,method:"GET"}),ex=e=>["/api/site",...e?[e]:[]],d5=(e,t)=>{const{query:s,request:r}=t??{};return{queryKey:s?.queryKey??ex(e),queryFn:({signal:u})=>MC(e,{signal:u,...r}),...s}};function tx(e,t){const s=d5(e,t),r=pr(s);return xr(r,s.queryKey)}const f5=e=>{const t=new URLSearchParams;Object.entries(e||{}).forEach(([r,o])=>{o!==void 0&&t.append(r,o===null?"null":String(o))});const s=t.toString();return s.length>0?`/api/admin/content?${s}`:"/api/admin/content"},zi=async(e,t)=>tt(f5(e),{...t,method:"GET"}),cr=e=>["/api/admin/content",...e?[e]:[]],h5=(e,t)=>{const{query:s,request:r}=t??{};return{queryKey:s?.queryKey??cr(e),queryFn:({signal:u})=>zi(e,{signal:u,...r}),...s}};function Os(e,t){const s=h5(e,t),r=pr(s);return xr(r,s.queryKey)}const m5=e=>{const t=new URLSearchParams;Object.entries(e||{}).forEach(([r,o])=>{o!==void 0&&t.append(r,o===null?"null":String(o))});const s=t.toString();return s.length>0?`/api/admin/content?${s}`:"/api/admin/content"},nx=async(e,t,s)=>{const r=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,u=>Array.from(u)));const c={};for(const[u,f]of Object.entries(o))f!==void 0&&(c[u]=f);return c};return tt(m5(t),{...s,method:"PUT",headers:{"Content-Type":"application/json",...r(s?.headers)},body:JSON.stringify(e)})},p5=()=>["saveAdminContent"],g5=e=>{const t=p5(),{mutation:s,request:r}={mutation:{mutationKey:t},request:void 0};return{mutationFn:c=>{const{data:u,params:f}=c??{};return nx(u,f,r)},...s}},Xd=e=>gn(g5()),x5=e=>{const t=new URLSearchParams;Object.entries(e||{}
9).forEach(([r,o])=>{o!==void 0&&t.append(r,o===null?"null":String(o))});const s=t.toString();return s.length>0?`/api/admin/publish?${s}`:"/api/admin/publish"},y5=async(e,t)=>tt(x5(e),{...t,method:"POST"}),v5=()=>["publishSite"],b5=e=>{const t=v5(),{mutation:s,request:r}={mutation:{mutationKey:t},request:void 0};return{mutationFn:c=>{const{params:u}=c??{};return y5(u,r)},...s}},w5=e=>gn(b5()),j5=()=>"/api/admin/status",S5=async e=>tt(j5(),{...e,method:"GET"}),N5=()=>["/api/admin/status"],C5=e=>{const{query:t,request:s}=e??{};return{queryKey:t?.queryKey??N5(),queryFn:({signal:c})=>S5({signal:c,...s}),...t}};function OC(e){const t=C5(e),s=pr(t);return xr(s,t.queryKey)}const E5=e=>{const t=new URLSearchParams;Object.entries(e||{}).forEach(([r,o])=>{o!==void 0&&t.append(r,o===null?"null":String(o))});const s=t.toString();return s.length>0?`/api/admin/pull-live-content?${s}`:"/api/admin/pull-live-content"},T5=async(e,t)=>tt(E5(e),{...t,method:"POST"}),A5=()=>["pullLiveContent"],R5=e=>{const t=A5(),{mutation:s,request:r}={mutation:{mutationKey:t},request:void 0};return{mutationFn:c=>{const{params:u}=c??{};return T5(u,r)},...s}},k5=e=>gn(R5()),M5=()=>"/api/storage/uploads/request-url",O5=async(e,t)=>{const s=r=>{if(!r)return{};if(r instanceof Headers)return Object.fromEntries(r.entries());if(Symbol.iterator in r)return Object.fromEntries(Array.from(r,c=>Array.from(c)));const o={};for(const[c,u]of Object.entries(r))u!==void 0&&(o[c]=u);return o};return tt(M5(),{...t,method:"POST",headers:{"Content-Type":"application/json",...s(t?.headers)},body:JSON.stringify(e)})},D5=()=>"/api/storage/uploads/complete",P5=async(e,t)=>{const s=r=>{if(!r)return{};if(r instanceof Headers)return Object.fromEntries(r.entries());if(Symbol.iterator in r)return Object.fromEntries(Array.from(r,c=>Array.from(c)));const o={};for(const[c,u]of Object.entries(r))u!==void 0&&(o[c]=u);return o};return tt(D5(),{...t,method:"POST",headers:{"Content-Type":"application/json",...s(t?.headers)},body:JSON.stringify(e)})},_5=e=>{const t=new URLSearchParams;Object.entries(e||{}).forEach(([r,o])=>{o!==void 0&&t.append(r,o===null?"null":String(o))});const s=t.toString();return s.length>0?`/api/storage/media/original-preview?${s}`:"/api/storage/media/original-preview"},L5=async(e,t)=>tt(_5(e),{...t,method:"GET"}),U5=()=>"/api/storage/media/recrop",I5=async(e,t)=>{const s=r=>{if(!r)return{};if(r instanceof Headers)return Object.fromEntries(r.entries());if(Symbol.iterator in r)return Object.fromEntries(Array.from(r,c=>Array.from(c)));const o={};for(const[c,u]of Object.entries(r))u!==void 0&&(o[c]=u);return o};return tt(U5(),{...t,method:"POST",headers:{"Content-Type":"application/json",...s(t?.headers)},body:JSON.stringify(e)})},z5=()=>"/api/newsletter/signup",F5=async(e,t)=>{const s=r=>{if(!r)return{};if(r instanceof Headers)return Object.fromEntries(r.entries());if(Symbol.iterator in r)return Object.fromEntries(Array.from(r,c=>Array.from(c)));const o={};for(const[c,u]of Object.entries(r))u!==void 0&&(o[c]=u);return o};return tt(z5(),{...t,method:"POST",headers:{"Content-Type":"application/json",...s(t?.headers)},body:JSON.stringify(e)})},V5=()=>["signupNewsletter"],B5=e=>{const t=V5(),{mutation:s,request:r}={mutation:{mutationKey:t},request:void 0};return{mutationFn:c=>{const{data:u}=c??{};return F5(u,r)},...s}},$5=e=>gn(B5()),q5=(e,t)=>{const s=new URLSearchParams;Object.entries(t||{}).forEach(([o,c])=>{c!==void 0&&s.append(o,c===null?"null":String(c))});const r=s.toString();return r.length>0?`/api/newsletter/confirm/${e}?${r}`:`/api/newsletter/confirm/${e}`},H5=async(e,t,s)=>tt(q5(e,t),{...s,method:"POST"}),K5=()=>["confirmNewsletterTokenAction"],G5=e=>{const t=K5(),{mutation:s,request:r}={mutation:{mutationKey:t},request:void 0};return{mutationFn:c=>{const{token:u,params:f}=c??{};return H5(u,f,r)},...s}},Y5=e=>gn(G5()),Q5=(e,t)=>{const s=new URLSearchParams;Object.entries(t||{}).forEach(([o,c])=>{c!==void 0&&s.append(o,c===null?"null":String(c))});const r=s.toString();return r.length>0?`/api/newsletter/unsubscribe/${e}?${r}`:`/api/newsletter/unsubscribe/${e}`},W5=async(e,t,s)=>tt(Q5(e,t),{...s,method:"POST"}),X5=()=>["unsubscribeNewsletterTokenAction"],Z5=e=>{const t=X5(),{mutation:s,request:r}={mutation:{mutationKey:t},request:void 0};return{mutationFn:c=>{const{token:u,params:f}=c??{};return W5(u,f,r)},...s}},J5=e=>gn(Z5()),e8=()=>"/api/owner/newsletter/dashboard",t8=async e=>tt(e8(),{...e,method:"GET"}),n8=()=>["/api/owner/newsletter/dashboard"],s8=e=>{const{query:t,request:s}=e??{};return{queryKey:t?.queryKey??n8(),queryFn:({signal:c})=>t8({signal:c,...s}),...t}};function r8(e){const t=s8(e),s=pr(t);return xr(s,t.queryKey)}const i8=e=>{const t=new URLSearchParams;Object.entries(e||{}
9).forEach(([r,o])=>{o!==void 0&&t.append(r,o===null?"null":String(o))});const s=t.toString();return s.length>0?`/api/owner/newsletter/summary?${s}`:"/api/owner/newsletter/summary"},a8=async(e,t)=>tt(i8(e),{...t,method:"GET"}),zl=e=>["/api/owner/newsletter/summary",...e?[e]:[]],o8=(e,t)=>{const{query:s,request:r}=t??{};return{queryKey:s?.queryKey??zl(e),queryFn:({signal:u})=>a8(e,{signal:u,...r}),...s}};function DC(e,t){const s=o8(e,t),r=pr(s);return xr(r,s.queryKey)}const l8=e=>{const t=new URLSearchParams;Object.entries(e||{}).forEach(([r,o])=>{o!==void 0&&t.append(r,o===null?"null":String(o))});const s=t.toString();return s.length>0?`/api/owner/newsletter/images/approve?${s}`:"/api/owner/newsletter/images/approve"},c8=async(e,t,s)=>{const r=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,u=>Array.from(u)));const c={};for(const[u,f]of Object.entries(o))f!==void 0&&(c[u]=f);return c};return tt(l8(t),{...s,method:"POST",headers:{"Content-Type":"application/json",...r(s?.headers)},body:JSON.stringify(e)})},u8=()=>["approveNewsletterImagePublication"],d8=e=>{const t=u8(),{mutation:s,request:r}=e?e.mutation&&"mutationKey"in e.mutation&&e.mutation.mutationKey?e:{...e,mutation:{...e.mutation,mutationKey:t}}:{mutation:{mutationKey:t},request:void 0};return{mutationFn:c=>{const{data:u,params:f}=c??{};return c8(u,f,r)},...s}},f8=e=>gn(d8(e)),h8=e=>{const t=new URLSearchParams;Object.entries(e||{}).forEach(([r,o])=>{o!==void 0&&t.append(r,o===null?"null":String(o))});const s=t.toString();return s.length>0?`/api/owner/newsletter/settings?${s}`:"/api/owner/newsletter/settings"},m8=async(e,t)=>tt(h8(e),{...t,method:"GET"}),pd=e=>["/api/owner/newsletter/settings",...e?[e]:[]],p8=(e,t)=>{const{query:s,request:r}=t??{};return{queryKey:s?.queryKey??pd(e),queryFn:({signal:u})=>m8(e,{signal:u,...r}),...s}};function PC(e,t){const s=p8(e,t),r=pr(s);return xr(r,s.queryKey)}const g8=e=>{const t=new URLSearchParams;Object.entries(e||{}).forEach(([r,o])=>{o!==void 0&&t.append(r,o===null?"null":String(o))});const s=t.toString();return s.length>0?`/api/owner/newsletter/settings?${s}`:"/api/owner/newsletter/settings"},x8=async(e,t,s)=>{const r=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,u=>Array.from(u)));const c={};for(const[u,f]of Object.entries(o))f!==void 0&&(c[u]=f);return c};return tt(g8(t),{...s,method:"PUT",headers:{"Content-Type":"application/json",...r(s?.headers)},body:JSON.stringify(e)})},y8=()=>["updateNewsletterSettings"],v8=e=>{const t=y8(),{mutation:s,request:r}=e?e.mutation&&"mutationKey"in e.mutation&&e.mutation.mutationKey?e:{...e,mutation:{...e.mutation,mutationKey:t}}:{mutation:{mutationKey:t},request:void 0};return{mutationFn:c=>{const{data:u,params:f}=c??{};return x8(u,f,r)},...s}},b8=e=>gn(v8(e)),w8=e=>{const t=new URLSearchParams;Object.entries(e||{}).forEach(([r,o])=>{o!==void 0&&t.append(r,o===null?"null":String(o))});const s=t.toString();return s.length>0?`/api/owner/newsletter/subscribers?${s}`:"/api/owner/newsletter/subscribers"},j8=async(e,t)=>tt(w8(e),{...t,method:"GET"}),_C=e=>["/api/owner/newsletter/subscribers",...e?[e]:[]],S8=(e,t)=>{const{query:s,request:r}=t??{};return{queryKey:s?.queryKey??_C(e),queryFn:({signal:u})=>j8(e,{signal:u,...r}),...s}};function N8(e,t){const s=S8(e,t),r=pr(s);return xr(r,s.queryKey)}const C8=e=>{const t=new URLSearchParams;Object.entries(e||{}).forEach(([r,o])=>{o!==void 0&&t.append(r,o===null?"null":String(o))});const s=t.toString();return s.length>0?`/api/owner/newsletter/subscribers/import?${s}`:"/api/owner/newsletter/subscribers/import"},E8=async(e,t,s)=>{const r=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,u=>Array.from(u)));const c={};for(const[u,f]of Object.entries(o))f!==void 0&&(c[u]=f);return c};return tt(C8(t),{...s,method:"POST",headers:{"Content-Type":"application/json",...r(s?.headers)},body:JSON.stringify(e)})},T8=()=>["importNewsletterSubscribers"],A8=e=>{const t=T8(),{mutation:s,request:r}=e?e.mutation&&"mutationKey"in e.mutation&&e.mutation.mutationKey?e:{...e,mutation:{...e.mutation,mutationKey:t}}:{mutation:{mutationKey:t},request:void 0};return{mutationFn:c=>{const{data:u,params:f}=c??{};return E8(u,f,r)},...s}},R8=e=>gn(A8(e)),k8=e=>{const t=new URLSearchParams;Object.entries(e||{}
9).forEach(([r,o])=>{o!==void 0&&t.append(r,o===null?"null":String(o))});const s=t.toString();return s.length>0?`/api/owner/newsletter/subscribers/export?${s}`:"/api/owner/newsletter/subscribers/export"},M8=e=>`/api/owner/newsletter/subscribers/${e}/suppress`,O8=async(e,t)=>tt(M8(e),{...t,method:"POST"}),D8=()=>["suppressNewsletterSubscriber"],P8=e=>{const t=D8(),{mutation:s,request:r}=e?e.mutation&&"mutationKey"in e.mutation&&e.mutation.mutationKey?e:{...e,mutation:{...e.mutation,mutationKey:t}}:{mutation:{mutationKey:t},request:void 0};return{mutationFn:c=>{const{id:u}=c??{};return O8(u,r)},...s}},_8=e=>gn(P8(e)),L8=e=>{const t=new URLSearchParams;Object.entries(e||{}).forEach(([r,o])=>{o!==void 0&&t.append(r,o===null?"null":String(o))});const s=t.toString();return s.length>0?`/api/owner/newsletter/campaigns?${s}`:"/api/owner/newsletter/campaigns"},U8=async(e,t)=>tt(L8(e),{...t,method:"GET"}),Ka=e=>["/api/owner/newsletter/campaigns",...e?[e]:[]],I8=(e,t)=>{const{query:s,request:r}=t??{};return{queryKey:s?.queryKey??Ka(e),queryFn:({signal:u})=>U8(e,{signal:u,...r}),...s}};function z8(e,t){const s=I8(e,t),r=pr(s);return xr(r,s.queryKey)}const F8=e=>{const t=new URLSearchParams;Object.entries(e||{}).forEach(([r,o])=>{o!==void 0&&t.append(r,o===null?"null":String(o))});const s=t.toString();return s.length>0?`/api/owner/newsletter/campaigns?${s}`:"/api/owner/newsletter/campaigns"},V8=async(e,t,s)=>{const r=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,u=>Array.from(u)));const c={};for(const[u,f]of Object.entries(o))f!==void 0&&(c[u]=f);return c};return tt(F8(t),{...s,method:"POST",headers:{"Content-Type":"application/json",...r(s?.headers)},body:JSON.stringify(e)})},B8=()=>["createNewsletterCampaign"],$8=e=>{const t=B8(),{mutation:s,request:r}=e?e.mutation&&"mutationKey"in e.mutation&&e.mutation.mutationKey?e:{...e,mutation:{...e.mutation,mutationKey:t}}:{mutation:{mutationKey:t},request:void 0};return{mutationFn:c=>{const{data:u,params:f}=c??{};return V8(u,f,r)},...s}},q8=e=>gn($8(e)),H8=e=>`/api/owner/newsletter/campaigns/${e}`,K8=async(e,t)=>tt(H8(e),{...t,method:"GET"}),Hu=e=>[`/api/owner/newsletter/campaigns/${e}`],G8=(e,t)=>{const{query:s,request:r}=t??{};return{queryKey:s?.queryKey??Hu(e),queryFn:({signal:u})=>K8(e,{signal:u,...r}),enabled:e!=null,...s}};function Y8(e,t){const s=G8(e,t),r=pr(s);return xr(r,s.queryKey)}const Q8=e=>`/api/owner/newsletter/campaigns/${e}`,W8=async(e,t,s)=>{const r=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,u=>Array.from(u)));const c={};for(const[u,f]of Object.entries(o))f!==void 0&&(c[u]=f);return c};return tt(Q8(e),{...s,method:"PATCH",headers:{"Content-Type":"application/json",...r(s?.headers)},body:JSON.stringify(t)})},X8=()=>["updateNewsletterCampaign"],Z8=e=>{const t=X8(),{mutation:s,request:r}=e?e.mutation&&"mutationKey"in e.mutation&&e.mutation.mutationKey?e:{...e,mutation:{...e.mutation,mutationKey:t}}:{mutation:{mutationKey:t},request:void 0};return{mutationFn:c=>{const{id:u,data:f}=c??{};return W8(u,f,r)},...s}},J8=e=>gn(Z8(e)),e_=e=>`/api/owner/newsletter/campaigns/${e}/test`,t_=async(e,t,s)=>{const r=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,u=>Array.from(u)));const c={};for(const[u,f]of Object.entries(o))f!==void 0&&(c[u]=f);return c};return tt(e_(e),{...s,method:"POST",headers:{"Content-Type":"application/json",...r(s?.headers)},body:JSON.stringify(t)})},n_=()=>["sendNewsletterTest"],s_=e=>{const t=n_(),{mutation:s,request:r}=e?e.mutation&&"mutationKey"in e.mutation&&e.mutation.mutationKey?e:{...e,mutation:{...e.mutation,mutationKey:t}}:{mutation:{mutationKey:t},request:void 0};return{mutationFn:c=>{const{id:u,data:f}=c??{};return t_(u,f,r)},...s}},r_=e=>gn(s_(e)),i_=e=>`/api/owner/newsletter/campaigns/${e}/send`,a_=async(e,t,s)=>{const r=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,u=>Array.from(u)));const c={};for(const[u,f]of Object.entries(o))f!==void 0&&(c[u]=f);return c};return tt(i_(e),{...s,method:"POST",headers:{"Content-Type":"application/json",...r(s?.headers)},body:JSON.stringify(t)})},o_=()=>["sendNewsletterCampaign"],l_=e=>{const t=o_(),{mutation:s,request:r}=e?e.mutation&&"mutationKey"in e.mutation&&e.mutation.mutationKey?e:{...e,mutation:{...e.mutation,mutationKey:t}}:{mutation:{mutationKey:t},request:void 0};return{mutationFn:c=>{const{id:u,data:f}=c??{};return a_(u,f,r)},...s}},c_=e=>gn(l_(e)),u_=e=>`/api/owner/newsletter/subscribers/${e}/confirmation`,d_=async(e,t,s)=>{const r=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,u=>Array.from(u)));const c={};for(const[u,f]of Object.entries(o))f!==void 0&&(c[u]=f);return c};return tt(u_(e),{...s,method:"POST",headers:{"Content-Type":"application/json",...r(s?.headers)},body:JSON.stringify(t)})},f_=()=>["sendNewsletterConfirmation"],h_=e=>{const t=f_(),{mutation:s,request:r}=e?e.mutation&&"mutationKey"in e.mutation&&e.mutation.mutationKey?e:{...e,mutation:{...e.mutation,mutationKey:t}}:{mutation:{mutationKey:t},request:void 0};return{mutationFn:c=>{const{id:u,data:f}=c??{};return d_(u,f,r)},...s}},m_=e=>gn(h_(e)),p_={still:"still"};function Fl({children:e,className:t,as:s="div"}){return a.jsx(s,{className:t,children:e})}function LC({text:e,className:t="",label:s="More content",titleIdentity:r}){const o=y.useRef(null),c=y.useRef(null),[u,f]=y.useState([e]),[h,m]=y.useState(0);y.useLayoutEffect(()=>{const j=o.current,w=c.current;if(!j||!w)return;m(0);const C=()=>{const N=Math.max(44,j.clientHeight-34),E=e.trim().split(/(\s+)/).filter(
9Boolean),R=[];let D=0;for(;D<E.length;){let A=D+1,_=E.length,F=D+1;for(;A<=_;){const O=Math.floor((A+_)/2);w.textContent=E.slice(D,O).join(""),w.scrollHeight<=N?(F=O,A=O+1):_=O-1}R.push(E.slice(D,F).join("").trim()),D=F}f(R.length?R:[""]),m(A=>Math.min(A,Math.max(0,R.length-1)))};if(C(),typeof ResizeObserver>"u")return;const S=new ResizeObserver(C);return S.observe(j),()=>S.disconnect()},[e]);const p=u.length,x=y.useMemo(()=>u[h]||"",[u,h]),v=()=>{if(h===0&&r){const j=x.indexOf(`
10`);if(j!==-1){const w=x.slice(0,j),C=x.slice(j);return a.jsxs(a.Fragment,{children:[a.jsx(Fl,{identity:r,as:"span",children:w}),C]})}return a.jsx(Fl,{identity:r,as:"span",children:x})}return x};return a.jsxs("div",{ref:o,className:"relative min-h-0 h-full flex flex-col",children:[a.jsx("div",{ref:c,"aria-hidden":!0,className:`invisible absolute inset-x-0 top-0 pointer-events-none ${t}`}),a.jsx("div",{className:`min-h-0 flex-1 overflow-hidden ${t}`,children:v()}),p>1&&a.jsxs("div",{className:"pt-3 flex items-center gap-4 text-[13px] leading-none text-muted-foreground",children:[a.jsx("button",{type:"button",disabled:h===0,onClick:()=>m(j=>j-1),className:"disabled:opacity-30 hover:text-foreground transition-colors",children:"Previous"}),a.jsxs("span",{children:[s," ",h+1,"/",p]}),a.jsx("button",{type:"button",disabled:h===p-1,onClick:()=>m(j=>j+1),className:"disabled:opacity-30 hover:text-foreground transition-colors",children:"Next"})]})]})}const UC=new Set(["p","em","i","a","section","br"]),g_=new Set(["audio","canvas","embed","iframe","img","math","object","script","style","svg","template","video"]);function x_(e,t,s){const r=/([*_])(?=\S)([^*_]*?\S)\1(?!\1)/g;let o=0,c;for(;c=r.exec(e);){const u=c[1],f=e[c.index-1],h=e[r.lastIndex];if(c.index>0&&f===u||h===u||u==="_"&&/[A-Za-z0-9]/.test(f||"")&&/[A-Za-z0-9]/.test(h||""))continue;c.index>o&&t.appendChild(s.createTextNode(e.slice(o,c.index)));const m=s.createElement("em");m.appendChild(s.createTextNode(c[2])),t.appendChild(m),o=r.lastIndex}o<e.length&&t.appendChild(s.createTextNode(e.slice(o)))}function y_(e){const t=e.trim();if(!(!t||/[\u0000-\u001f\u007f]/.test(t)))try{const s=new URL(t,document.baseURI);return s.protocol!=="https:"&&s.protocol!=="mailto:"?void 0:s.href}catch{return}}function Op(e,t,s){if(e.nodeType===Node.TEXT_NODE){x_(e.nodeValue||"",t,s);return}if(e.nodeType!==Node.ELEMENT_NODE)return;const r=e,o=r.tagName.toLowerCase();if(g_.has(o))return;if(!UC.has(o)){r.childNodes.forEach(f=>Op(f,t,s));return}const c=s.createElement(o),u=r.getAttribute("class");if(u&&!/[\u0000-\u001f\u007f]/.test(u)&&c.setAttribute("class",u),o==="a"){const f=r.getAttribute("href"),h=f?y_(f):void 0;if(h&&c.setAttribute("href",h),r.getAttribute("target")==="_blank")c.setAttribute("target","_blank"),c.setAttribute("rel","noopener noreferrer");else{const m=r.getAttribute("rel");m&&/^[\w -]+$/.test(m)&&c.setAttribute("rel",m.trim())}}o!=="br"&&r.childNodes.forEach(f=>Op(f,c,s)),t.appendChild(c)}function IC(e){const t=new DOMParser().parseFromString(e,"text/html"),s=document.implementation.createHTMLDocument("");return t.body.childNodes.forEach(r=>Op(r,s.body,s)),s}function Tl(e){return e.some(t=>
10{if(t.nodeType===Node.TEXT_NODE)return!!t.nodeValue;if(t.nodeType!==Node.ELEMENT_NODE)return!1;const s=t;return!!s.textContent||!!s.querySelector("br")})}function v_(e){const t=[];let s=[];const r=()=>{if(!s.length)return;const o=e.createElement("p");s.forEach(c=>o.appendChild(c.cloneNode(!0))),t.push(o),s=[]};return e.body.childNodes.forEach(o=>{o.nodeType===Node.ELEMENT_NODE&&["p","section"].includes(o.tagName.toLowerCase())?(r(),t.push(o.cloneNode(!0))):o.nodeType===Node.TEXT_NODE&&!(o.nodeValue||"").trim()||s.push(o)}),r(),t}function b_(e){return e.map(t=>t.cloneNode(!0))}function gd(e,t,s){return e.replaceChildren(...b_(t)),e.scrollHeight<=s}function w_(e){return e.textContent?.length||0}function j_(e,t){const s=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let r,o=t,c;for(;c=s.nextNode();){const u=c;if(r=u,o<=u.length)return{node:u,offset:o};o-=u.length}return r?{node:r,offset:r.length}:void 0}function S_(e,t){const s=document.createRange();s.setStartBefore(e),s.setEnd(t.node,t.offset);const r=document.createRange();return r.setStart(t.node,t.offset),r.setEndAfter(e),[Array.from(s.cloneContents().childNodes),Array.from(r.cloneContents().childNodes)]}function N_(e){const t=[],s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);let r;for(;r=s.nextNode();){const o=r;if(o.tagName.toLowerCase()!=="br"||!o.parentNode)continue;const c=Array.prototype.indexOf.call(o.parentNode.childNodes,o);t.push({container:o.parentNode,offset:c+1})}return t}function C_(e,t){const s=document.createRange();s.setStartBefore(e),s.setEnd(t.container,t.offset);const r=document.createRange();return r.setStart(t.container,t.offset),r.setEndAfter(e),[Array.from(s.cloneContents().childNodes),Array.from(r.cloneContents().childNodes)]}function E_(e,t,s){e.parentNode||e.ownerDocument.createDocumentFragment().appendChild(e);const r=w_(e);if(r>0){let h=1,m=r,p;for(;h<=m;){const x=Math.floor((h+m)/2),v=j_(e,x);if(!v)break;const j=S_(e,v);Tl(j[0])&&gd(t,j[0],s)?(p=j,h=x+1):m=x-1}if(p)return p}const o=N_(e);let c=0,u=o.length-1,f;for(;c<=u;){const h=Math.floor((c+u)/2),m=C_(e,o[h]);Tl(m[0])&&gd(t,m[0],s)?(f=m,c=h+1):u=h-1}return f}function T_(e,t,s){const r=[];let o=[];const c=()=>{Tl(o)&&r.push(o),o=[]};for(const u of v_(e)){const f=[u.cloneNode(!0)];if(gd(t,[...o,...f],s)){o.push(...f);continue}c();let h=u.cloneNode(!0);for(;h;){if(gd(t,[h],s)){o.push(h),h=void 0;continue}const p=E_(h,t,s);if(!p||!Tl(p[0])){r.push([h]),h=void 0;continue}r.push(p[0]);const x=p[1].filter(v=>v.nodeType!==Node.TEXT_NODE||!!v.nodeValue);h=x.find(v=>v.nodeType===Node.ELEMENT_NODE),!h&&Tl(x)&&(o=x,h=void 0)}}return c(),r}function zC(e,t){return e.map((s,r)=>{const o=`${t}-${r}`;if(s.nodeType===Node.TEXT_NODE)return s.nodeValue||"";if(s.nodeType!==Node.ELEMENT_NODE)return null;const c=s,u=c.tagName.toLowerCase();if(!UC.has(u))return null;const f={key:o},h=c.getAttribute("class");if(h&&(f.className=h),u==="a"){const m=c.getAttribute("href");m&&(f.href=m);const p=c.getAttribute("target"),x=c.getAttribute("rel");p&&(f.target=p),x&&(f.rel=x)}return u==="br"?y.createElement("br",f):y.createElement(u,f,zC(Array.from(c.childNodes),o))})}function A_({html:e,className:t=""}){const s=y.useRef(null);return y.useLayoutEffect(()=>{const r=IC(e);s.current?.replaceChildren(...Array.from(r.body.childNodes))},[e]),a.jsx("div",{ref:s,className:"public-about-bio tracking-normal md:text-[21px] md:leading-[1.55] [&_p]:mb-6 [&_section]:mb-8 last:[&_p]:mb-0 last:[&_section]:mb-0 [&_a]:underline [&_a]:underline-offset-4 [&_a]:hover:text-muted-foreground [&_a]:transition-colors font-extralight text-[14px] text-foreground"})}function R_({html:e,className:t="",label:s="Biography"}){const r=y.useRef(null),o=y.useRef(null),[c,u]=y.useState([[]]),[f,h]=y.useState(0);y.useLayoutEffect(()=>{const p=r.current,x=o.current;if(!p||!x)return;h(0),u([[]]);const v=()=>{const w=Math.max(45,p.clientHeight-34),C=IC(e),S=T_(C,x,w),N=S.length?S.map((E,R)=>zC(E,`page-${R}`)):[[]];u(N),h(E=>Math.min(E,Math.max(0,N.length-1)))};if(v(),typeof ResizeObserver>"u")return;const j=new ResizeObserver(v);return j.observe(p),()=>j.disconnect()},[e]);const m=c[f]||[];return a.jsxs("div",{ref:r,className:"relative min-h-0 h-full flex flex-col",children:[a.jsx("div",{ref:o,"aria-hidden":!0,
10className:`invisible absolute inset-x-0 top-0 pointer-events-none ${t}`}),a.jsx("div",{className:`min-h-0 flex-1 overflow-hidden ${t}`,children:m}),c.length>1&&a.jsxs("div",{className:"pt-3 flex gap-4 text-[13px] leading-none text-muted-foreground",children:[a.jsx("button",{type:"button",disabled:f===0,onClick:()=>h(p=>p-1),className:"disabled:opacity-30 hover:text-foreground",children:"Previous"}),a.jsxs("span",{children:[s," ",f+1,"/",c.length]}),a.jsx("button",{type:"button",disabled:f===c.length-1,onClick:()=>h(p=>p+1),className:"disabled:opacity-30 hover:text-foreground",children:"Next"})]})]})}const k_=new Set(["localhost","127.0.0.1","0.0.0.0"]);function sx(e){const t=e.toLowerCase();return t==="alreadyalive.com"||t==="www.alreadyalive.com"?"alreadyalive":t==="michaelmarantz.com"||t==="www.michaelmarantz.com"?"michael":null}function mo(e){return k_.has(e.toLowerCase())||e.toLowerCase().endsWith(".replit.dev")}function n1(e,t,s){const r=sx(e);if(r)return r;if(!mo(e))return"michael";const o=new URLSearchParams(t).get("site");return o==="michael"||o==="alreadyalive"?o:s==="michael"||s==="alreadyalive"?s:"michael"}function sr(e,t,s=typeof window>"u"?"localhost":window.location.hostname){const r=new URL(t,"https://preview.invalid");return mo(s)?r.searchParams.set("site",e):r.searchParams.delete("site"),`${r.pathname}${r.search}${r.hash}`}function Vl(e,t,s=typeof window>"u"?"localhost":window.location.hostname){if(mo(s))return sr(e,t,s);const r=e==="alreadyalive"?"https://alreadyalive.com":"https://michaelmarantz.com";return new URL(sr(e,t,s),r).href}function M_(e,t,s=typeof window>"u"?"localhost":window.location.hostname){return/^https?:\/\//.test(t)?t:sr(e,t,s)}function O_(){if(typeof window>"u")return"michael";const e=window.location.hostname.toLowerCase(),t=sx(e);if(t)return t;const s=mo(e),r=new URLSearchParams(window.location.search).get("site");return s&&r==="alreadyalive"?"alreadyalive":"michael"}const rr={michael:{label:"Michael Marantz",title:"Michael Marantz",newsletter:"Michael Marantz"},alreadyalive:{label:"Already Alive",title:"Already Alive",newsletter:"Already Alive"}},rx=y.createContext({adminSite:"michael",setAdminSite:()=>{},initialSite:"michael"});function D_({children:e}){const t=ho(),s=typeof window>"u"?"localhost":window.location.hostname,r=O_(),[o,c]=y.useState(()=>{try{const h=localStorage.getItem("portfolio-admin-site");return n1(s,t,h)}catch{return r}}),u=n1(s,t,o);y.useEffect(()=>{if(u!==o){c(u);try{localStorage.setItem("portfolio-admin-site",u)}catch{}}},[u,o]);const f=h=>{if(!(!mo(s)||sx(s))){c(h);try{localStorage.setItem("portfolio-admin-site",h)}catch{}}};return a.jsx(rx.Provider,{value:{adminSite:u,setAdminSite:f,initialSite:r},children:e})}function mt(){const[e]=zn(),t=y.useContext(rx);return e.startsWith("/admin")?t.adminSite:t.initialSite}function P_(){const e=y.useContext(rx),t=typeof window>"u"?"localhost":window.location.hostname;return{site:e.adminSite,setSite:e.setAdminSite,locked:!mo(t)}}function Zd(){return rr[mt()]}function __(){const[e,t]=y.useState(""),[s,r]=y.useState(!1),o=$5(),c=mt(),u=Zd(),f=async h=>{if(h.preventDefault(),!(!e||o.isPending))try{await o.mutateAsync({data:{email:e,site:c}}),r(!0),t("")}catch{}};return s?a.jsxs("div",{className:"pt-6 border-t border-border mt-8",children:[a.jsxs("h3",{className:"text-muted-foreground font-mono text-[10px] tracking-[0.035em] uppercase mb-4",children:[u.newsletter," Newsletter"]}),a.jsxs("div",{className:"flex items-center gap-2 text-foreground text-[14px]",children:[a.jsx(zg,{className:"w-4 h-4"}),a.jsx("span",{children:"Thanks for subscribing. Your request is pending review."})]})]}):a.jsxs("div",{className:"pt-6 border-t border-border mt-8 shrink-0",children:[a.jsxs("h3",{className:"text-muted-foreground font-mono text-[10px] tracking-[0.035em] uppercase mb-4",children:[u.newsletter," Newsletter"]}),a.jsxs("form",{onSubmit:f,className:"flex gap-2",children:[a.jsx("label",{htmlFor:"newsletter-email",className:"sr-only",children:"Email address"}),a.jsx("input",{id:"newsletter-email",type:"email",value:e,onChange:h=>t(h.target.value),placeholder:"Email address",required:!0,className:"flex-1 bg-transparent border-b border-border py-2 text-[14px] text-foreground placeholder:text-muted-foreground focus:outline-none focus:border-foreground transition-colors rounded-none",disabled:o.isPending}),a.jsx("button",{type:"submit",disabled:o.isPending||!e,className:"font-mono text-[10px] uppercase tracking-[0.035em] text-muted-foreground hover:text-foreground transition-colors disabled:opacity-50 flex items-center justify-center px-2",children:o.isPending?a.jsx(Ue,{className:"w-3 h-3 animate-spin"}):"Subscribe"})]}),o.isError&&!s&&a.jsx("p",{className:"text-destructive text-xs mt-2",children:"Something went wrong. Please try again."})]})}function Oi(e){return String(e??"").replace(/[&<>"']/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[t]||t)}function L_({open:e,onOpenChange:t,settings:s}){const r=y.useRef(null),o=y.useRef(null),c=y.useRef(null);if(y.useEffect(()=>{if(!e)return;c.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const p=r.current;
10if(!p)return;const x=()=>Array.from(p.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')),v=()=>{(x()[0]||o.current||p).focus()},j=window.requestAnimationFrame(v),w=S=>{if(S.key==="Escape"){S.preventDefault(),t(!1);return}if(S.key!=="Tab")return;const N=x();if(!N.length){S.preventDefault(),p.focus();return}const E=N[0],R=N[N.length-1];S.shiftKey&&document.activeElement===E?(S.preventDefault(),R.focus()):!S.shiftKey&&document.activeElement===R&&(S.preventDefault(),E.focus())},C=S=>{S.target instanceof Node&&!p.contains(S.target)&&v()};return document.addEventListener("keydown",w),document.addEventListener("focusin",C),()=>{window.cancelAnimationFrame(j),document.removeEventListener("keydown",w),document.removeEventListener("focusin",C),c.current&&document.contains(c.current)&&c.current.focus(),c.current=null}},[e,t]),!e)return null;const f=(s.contacts?.filter(p=>p.visible)||[]).map(p=>{const x=p.email?.trim();return`<section><p class="text-muted-foreground text-[15px] mb-1">${Oi(p.label||p.group||"")}</p>${p.company?`<p>${Oi(p.company)}</p>`:""}${p.name&&p.name!==p.company?`<p>${Oi(p.name)}</p>`:""}${x?`<p><a href="mailto:${Oi(x)}">${Oi(x)}</a></p>`:""}</section>`}).join(""),h=[s.instagramUrl?.trim()?`<section><p><a href="${Oi(s.instagramUrl.trim())}" target="_blank" rel="noreferrer">Instagram</a></p></section>`:"",s.vimeoUrl?.trim()?`<section><p><a href="${Oi(s.vimeoUrl.trim())}" target="_blank" rel="noreferrer">Vimeo</a></p></section>`:""].join(""),m=f+h;return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"public-contact-backdrop fixed inset-0 bg-background/60 z-[100] animate-in fade-in",onClick:()=>t(!1),"aria-hidden":"true"}),a.jsxs("div",{ref:r,role:"dialog","aria-modal":"true","aria-label":"Contact information",tabIndex:-1,className:"public-contact-panel fixed top-0 right-0 bottom-0 w-full sm:w-[400px] bg-background border-l border-border z-[101] p-6 sm:p-8 animate-in slide-in-from-right overflow-hidden flex flex-col",children:[a.jsx("div",{className:"public-contact-close-row flex justify-end mb-6 shrink-0",children:a.jsx("button",{ref:o,type:"button",onClick:()=>t(!1),"aria-label":"Close contact information",className:"public-contact-close flex items-center justify-center w-11 h-11 -mr-2 text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(Jl,{className:"w-6 h-6",strokeWidth:1})})}),a.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:a.jsx(R_,{html:m,label:"Contact",className:"public-contact-reading text-foreground text-[16px] leading-[1.5] [overflow-wrap:anywhere] [&_p]:mb-1 [&_section]:mb-7 [&_section>p:first-child]:mb-2 [&_a]:hover:text-muted-foreground"})}),a.jsx(__,{})]})]})}function FC({settings:e}){return a.jsxs("span",{className:"public-brand-mark inline-flex items-baseline gap-1.5 whitespace-nowrap leading-[22px]",children:[a.jsx("span",{className:"public-brand-name text-foreground",children:e.name||"Michael Marantz"}),a.jsx("span",{className:"public-brand-role text-[15px] font-normal text-muted-foreground",children:e.role||"Director"})]})}function U_({settings:e,onContactClick:t,isHome:s,introActive:r=!1}){const[o]=zn(),[c,u]=y.useState(!1),f=[{label:"Work",path:"/work"},{label:"About",path:"/about"}];y.useEffect(()=>{u(!1)},[o]);const h=()=>{u(!1),t()};return a.jsxs(a.Fragment,{children:[a.jsxs("header",{className:"public-nav w-full px-6 md:px-8 py-6 md:py-8 flex justify-between items-center z-50 text-[15px] absolute top-0 left-0 right-0",children:[a.jsx("div",{className:"public-nav-brand",children:a.jsx(xt,{href:"/","data-brand-target":!0,className:"inline-flex whitespace-nowrap",style:{opacity:r?0:1},children:a.jsx(FC,{settings:e})})}),a.jsxs("nav",{className:"public-nav-links hidden md:flex gap-6 items-center","aria-label":"Primary navigation",children:[f.map(m=>{const p=o.startsWith(m.path);return a.jsx(xt,{href:m.path,className:`public-nav-link transition-colors ${p?"text-foreground":"text-muted-foreground hover:text-foreground"}`,children:m.label},m.path)}),a.jsx("button",{onClick:h,className:"public-nav-link text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:e.labels?.contact||"Contact"})]}),a.jsx("div",{className:"md:hidden",children:a.jsx("button",{onClick:()=>u(!c),className:"public-menu-toggle text-muted-foreground hover:text-foreground transition-colors","aria-expanded":c,"aria-controls":"public-mobile-menu",children:c?"Close":"Menu"})})]}),c&&a.jsxs("div",{id:"public-mobile-menu",className:"public-mobile-menu fixed inset-0 bg-background z-[40] flex flex-col pt-24 px-6 gap-6 text-[15px] md:hidden animate-in fade-in",children:[f.map(m=>{const p=o.startsWith(m.path);return a.jsx(xt,{href:m.path,className:`public-mobile-link transition-colors ${p?"text-foreground":"text-muted-foreground"}`,children:m.label},m.path)}),a.jsx("button",{onClick:h,className:"public-mobile-link text-left text-muted-foreground transition-colors",children:e.labels?.contact||"Contact"})]})]})}function I_({onComplete:e,settings:t}){const[s,r]=y.useState("black"),[o,c]=y.useState({centerX:0,centerY:0,x:24,y:24,scale:1}),u=y.useRef(null),f=y.useRef(e);f.current=e,y.useLayoutEffect(()=>{const m=u.current,p=document.querySelector("[data-brand-target]")?.getBoundingClientRect();if(!m||!p)return;const x=Math.min(window.innerWidth>=768?1.6:1.45,(window.innerWidth-48)/m.offsetWidth);c({centerX:(window.innerWidth-m.offsetWidth*x)/2,centerY:(window.innerHeight-m.offsetHeight*x)/2,x:p.left,y:p.top,scale:x})},[]),y.useEffect(()=>{let m=!1;const p=()=>{m||(m=!0,f.current())},x=window.matchMedia("(prefers-reduced-motion: reduce)");
10if(x.matches){p();return}const v=["keydown","click","touchstart","scroll","wheel","resize"];v.forEach(w=>window.addEventListener(w,p,{passive:!0})),x.addEventListener("change",p);const j=[window.setTimeout(()=>r("fade-in"),200),window.setTimeout(()=>r("dock"),1300),window.setTimeout(p,2250)];return()=>{v.forEach(w=>window.removeEventListener(w,p)),x.removeEventListener("change",p),j.forEach(window.clearTimeout)}},[]);const h=s==="dock";return a.jsxs("div",{className:"fixed inset-0 z-[100] cursor-pointer","aria-label":"Michael Marantz, Director",children:[a.jsx("div",{className:"absolute inset-0 bg-background transition-opacity duration-[900ms] ease-in-out",style:{opacity:h?0:1}}),a.jsx("div",{ref:u,className:"absolute left-0 top-0 inline-flex origin-top-left will-change-transform",style:{opacity:s==="black"?0:1,transform:`translate3d(${h?o.x:o.centerX}px, ${h?o.y:o.centerY}px, 0) scale(${h?1:o.scale})`,transition:s==="black"?"none":"opacity 450ms ease-in-out, transform 900ms cubic-bezier(0.65, 0, 0.25, 1)"},children:a.jsx(FC,{settings:t})})]})}function z_({theme:e,onChange:t}){return a.jsx("div",{role:"group","aria-label":"Color theme",className:"public-theme-switch fixed right-6 md:right-8 bottom-1 z-[90] flex items-center gap-3 bg-background text-[12px]",style:{paddingBottom:"env(safe-area-inset-bottom, 0px)"},children:["light","dark"].map(s=>a.jsx("button",{type:"button","aria-pressed":e===s,onClick:()=>t(s),className:`public-theme-option min-h-10 px-1 cursor-pointer focus-visible:outline focus-visible:outline-1 focus-visible:outline-offset-2 ${e===s?"text-foreground":"text-muted-foreground hover:text-foreground"}`,children:s==="light"?"Light":"Dark"},s))})}function ur({identity:e,label:t,titleSelector:s,...r}){return a.jsx(xt,{...r})}function F_({item:e}){const[t,s]=y.useState({current:e,previous:null});t.current?.id!==e?.id&&s({current:e,previous:t.current}),y.useEffect(()=>{if(!t.previous)return;const o=setTimeout(()=>s(c=>({...c,previous:null})),850);return()=>clearTimeout(o)},[t.current?.id,t.previous]);const r=o=>a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"public-home-title text-foreground text-[17px] leading-tight",children:o.title}),o.client&&a.jsx("div",{className:"public-home-client text-foreground/80 text-[13.5px] leading-tight mt-1",children:o.client}),a.jsx("div",{className:"public-home-meta text-muted-foreground text-[13.5px] leading-tight min-h-[1.25em] mt-1",children:o.homepageCaption!==o.client?o.homepageCaption:null})]});return a.jsxs("div",{className:"grid w-full min-w-0",children:[t.previous&&a.jsx("div",{"aria-hidden":"true",className:"[grid-area:1/1] pointer-events-none animate-out fade-out duration-[800ms]",style:{animationFillMode:"both",animationTimingFunction:"ease-in-out"},children:r(t.previous)},`previous-${t.previous.id}`),e&&a.jsx("div",{className:`[grid-area:1/1] ${t.previous?"animate-in fade-in duration-[800ms]":""}`,style:{animationTimingFunction:"ease-in-out"},children:r(e)},e.id)]})}const V_=16,B_=9;function $_(e,t,s,r){if(!Number.isFinite(e)||!Number.isFinite(t)||!Number.isFinite(s)||!Number.isFinite(r)||e<=0||t<=0||s<=0||r<=0)return null;const o=Math.max(e/s,t/r),c=Math.ceil(s*o),u=Math.ceil(r*o);return c>0&&u>0?{width:c,height:u}:null}const s1="https://player.vimeo.com";function q_({url:e,active:t,title:s,startSeconds:r=0,endSeconds:o}){const c=y.useRef(null),u=y.useRef(null),f=y.useRef(t);f.current=t;const h=y.useRef(()=>{}),m=y.useRef(!1),p=y.useRef(()=>{}),[x,v]=y.useState(!1),[j,w]=y.useState(null),[C,S]=y.useState(null);y.useEffect(()=>{const E=c.current;if(!E)return;const R=()=>{const A=E.getBoundingClientRect(),_=A.width>0&&A.height>0?{width:A.width,height:A.height}:null;S(F=>F?.width===_?.width&&F?.height===_?.height?F:_)};if(R(),typeof ResizeObserver>"u")return window.addEventListener("resize",R),()=>window.removeEventListener("resize",R);const D=new ResizeObserver(R);return D.observe(E),()=>D.disconnect()},[]);const N=y.useMemo(()=>!j||!C?null:$_(C.width,C.height,j.width,j.height),[C,j]);return y.useEffect(()=>{let E=!1,R=!1,D=!1,A=!0,_,F,O,I=0,V=0,H=0,k,q,J=!1;const re=Number.isFinite(r)&&r>=0?r:0,U=o!==void 0&&Number.isFinite(o)&&o>re?o:void 0;v(!1),w(null);function L(oe){return typeof oe=="number"&&Number.isFinite(oe)&&oe>0}function z(oe,le){m.current&&u.current?.contentWindow?.postMessage(JSON.stringify({method:oe,value:le}),s1)}function W(){D=!0,R=!1,clearTimeout(_),clearTimeout(F),clearTimeout(O),v(!1),z("pause"),console.warn("Vimeo preview could not start; keeping its still image visible.")}function M(){if(!E||R||D)return;R=!0,H=0;function oe(){D||!R||(z("setCurrentTime",re),H+=1,_=setTimeout(()=>{H<3?oe():W()},3e3))}oe()}function K(){!E||D||(z("getVideoWidth"),z("getVideoHeight"),V+=1,(k===void 0||q===void 0)&&V<5&&(O=setTimeout(K,1e3)))}function ie(){if(!E){E=!0,clearTimeout(F);
10for(const oe of["playing","timeupdate","ended","error"])z("addEventListener",oe);z("setLoop",!1),z("getDuration"),K(),re===0?(f.current||A)&&z("play"):M()}}function ee(oe){if(!m.current||oe.origin!==s1||oe.source!==u.current?.contentWindow)return;let le;try{le=typeof oe.data=="string"?JSON.parse(oe.data):oe.data}catch{return}if((le?.event==="ready"||le?.method==="ping")&&ie(),!D){if(le?.method==="getDuration"&&typeof le.value=="number"&&le.value>0&&re>=le.value){W();return}if(le?.method==="getVideoWidth"&&L(le.value)&&(k=le.value),le?.method==="getVideoHeight"&&L(le.value)&&(q=le.value),k!==void 0&&q!==void 0&&!J&&(J=!0,clearTimeout(O),w({width:k,height:q})),le?.method==="setCurrentTime"&&R&&(R=!1,clearTimeout(_),f.current||A?z("play"):z("pause")),le?.event==="playing"){if(R)return;A=!1,v(f.current),f.current||z("pause")}if(le?.event==="timeupdate"&&!R&&f.current){const Ne=le.data?.seconds;typeof Ne=="number"&&(Ne<re-.1||U!==void 0&&Ne>=U)&&M()}le?.event==="ended"&&f.current&&M(),le?.event==="error"&&W()}}h.current=()=>{v(!1),!(!E||D)&&(A=!1,f.current?M():z("pause"))};function ae(){E||D||!m.current||(z("ping"),I+=1,F=setTimeout(()=>{I<10?ae():W()},1e3))}return p.current=()=>{m.current=!0,clearTimeout(F),ae()},window.addEventListener("message",ee),m.current&&ae(),()=>{clearTimeout(_),clearTimeout(F),clearTimeout(O),h.current=()=>{},p.current=()=>{},window.removeEventListener("message",ee)}},[e,r,o]),y.useEffect(()=>{h.current()},[t]),a.jsx("div",{ref:c,className:"absolute inset-0 overflow-hidden",children:a.jsx("iframe",{ref:u,title:s,src:e,onLoad:()=>{m.current=!0,p.current()},className:"preview-video-fade absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 pointer-events-none bg-black border-0","data-
10playing":t&&x&&N!==null,style:N?{width:`${N.width}px`,height:`${N.height}px`}:{width:"100%",height:"auto",aspectRatio:`${V_} / ${B_}`},allow:"autoplay; fullscreen; picture-in-picture",tabIndex:-1,"aria-hidden":"true"})})}function H_({src:e}){const t=y.useRef(null),[s,r]=y.useState(!1);return y.useEffect(()=>{const o=t.current;if(o)return o.play().catch(()=>{}),()=>{o.pause(),o.currentTime=0}},[]),a.jsx("video",{ref:t,src:e,className:"preview-video-fade absolute inset-0 w-full h-full object-cover",style:{objectFit:"cover",objectPosition:"center"},"data-playing":s,onPlaying:()=>r(!0),onError:()=>r(!1),muted:!0,playsInline:!0,loop:!0,autoPlay:!0,"aria-hidden":"true"})}function Bl(e,t){return e.featuredOnHomepage??(t==="films"?!0:e.showInBrandRow===!0)}function K_(e,t=0){const s=e.match(/vimeo\.com\/(?:video\/)?(\d+)(?:\/([a-zA-Z0-9]+))?/);if(!s)return null;const[,r,o]=s,c=e.includes("?")?e.slice(e.indexOf("?")+1):"",u=new URLSearchParams(c).get("h")||void 0,f=o||u,h=Number.isFinite(t)&&t>0?`#t=${t}s`:"";return`https://player.vimeo.com/video/${r}?background=1&autoplay=1&muted=1&loop=1&autopause=0&transparent=0${f?`&h=${f}`:""}${h}`}function G_(e){return e.still||e.workGridImage||e.shareImage||e.poster}function r1(e,t){const s=e.still||t,r={source:e.source};return e.clip&&(r.clip=e.clip),e.vimeoUrl&&(r.vimeoUrl=e.vimeoUrl),s&&(r.still=s),e.startSeconds!==void 0&&(r.startSeconds=e.startSeconds),e.endSeconds!==void 0&&(r.endSeconds=e.endSeconds),r}function Zr(e,t){const s=G_(t);if(t.previewMedia)return r1(t.previewMedia,s);const r=(e.cycle||[]).find(o=>o.itemId===t.id&&o.enabled);return r?r1(r,s):s?{source:"still",still:s}:{source:"still"}}function to(e,t,s){const r=Zr(e,t);return s==="films"&&t.workGridImage?{...r,still:t.workGridImage}:r}const Dp="/api/storage/objects/",Y_=new Set(["localhost","127.0.0.1","0.0.0.0"]);function VC(e){const t=e.toLowerCase();return Y_.has(t)||t.endsWith(".replit.dev")}function Pp(e){return e.startsWith(Dp)&&e.length>Dp.length}function i1(e,t){if(!t)return e;const s=e.indexOf("#"),r=s>=0?e.slice(0,s):e,o=s>=0?e.slice(s):"",c=r.indexOf("?"),u=c>=0?r.slice(0,c):r,f=c>=0?r.slice(c+1):"",h=new URLSearchParams(f);return h.set("site","alreadyalive"),`${u}?${h.toString()}${o}`}function zt(e,t="michael"){if(!e)return;if(typeof window>"u"||!VC(window.location.hostname))return e;const s=window.location.origin;try{const r=new URL(e,s);return!Pp(r.pathname)||r.origin!==s?e:(r.searchParams.set("site",t),e.startsWith("/")?`${r.pathname}${r.search}${r.hash}`:r.toString())}catch{return e}}function BC(e){if(!e)return;const t=typeof window>"u"?void 0:window.location.origin,s=typeof window>"u"?"":window.location.hostname,r=VC(s);if(e.startsWith(Dp)){try{const f=new URL(e,t||"https://alreadyalive.invalid");if(!Pp(f.pathname))return e}catch{return e}return i1(e,r)}let o;try{o=new URL(e)}catch{return e}if(o.protocol!=="http:"&&o.protocol!=="https:"||o.username||o.password||o.port||!Pp(o.pathname))return e;if(o.hostname.toLowerCase()==="michael-marantz.replit.app")return o.protocol="https:",o.hostname="michaelmarantz.com",o.toString();if(!(r&&o.origin===t))return e;const u=`${o.pathname}${o.search}${o.hash}`;return i1(u,r)}function Q_(e){const[t,s]=y.useState(()=>typeof window>"u"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches||!e&&window.matchMedia("(hover: none), (pointer: coarse)").matches);return y.useEffect(()=>{const r=window.matchMedia("(prefers-reduced-motion: reduce)"),o=window.matchMedia("(hover: none), (pointer: coarse)"),c=()=>s(r.matches||!e&&o.matches);return c(),r.addEventListener?.("change",c),o.addEventListener?.("change",c),()=>{r.removeEventListener?.("change",c),o.removeEventListener?.("change",c)}},[e]),t}function Hi({media:e,active:t,alt:s,className:r="",allowTouchPlayback:o=!1,preload:c=!1}){const u=mt(),f=x=>zt(u==="alreadyalive"?BC(x):x,u),h=Q_(o),m=t&&!h,p=e.source==="vimeo"&&e.vimeoUrl?K_(e.vimeoUrl,e.startSeconds):null;return a.jsxs("div",{className:`absolute inset-0 overflow-hidden bg-black ${r}`,children:[e.still?a.jsx("img",{src:f(e.still),alt:s,className:"absolute inset-0 w-full h-full object-cover"}):a.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-muted text-muted-foreground text-sm",children:"[Still placeholder]"}),m&&e.source==="upload"&&e.clip?a.jsx(H_,{src:f(e.clip)||e.clip},e.clip):null,(m||c&&!h)&&p?a.jsx(q_,{url:p,active:m,startSeconds:e.startSeconds,endSeconds:e.endSeconds,title:`${s} preview`},`${p}:${e.endSeconds??""}`):null]})}function W_(e){return[e.title,e.type,e.year,e.status,e.homepageCaption,e.logline,e.client,e.context,e.agency,e.productionCompany,e.brandLabel,...(e.keyCredits||[]).flatMap(t=>[t.role,t.name]),...(e.fullCredits||[]).flatMap(t=>
10[t.role,t.name])].filter(Boolean).join(" ")}function X_(e){const t=W_(e),s=/\bshort(?:\s+film)?\b/i.test([e.type,e.homepageCaption,e.logline,e.context].filter(Boolean).join(" ")),r=s&&/\btribeca\b/i.test(t)&&/\bpremier(?:e|ed|ing)\b/i.test(t),o=s&&/\bpalm\s+springs\b/i.test(t)&&/\bshort\s*fest\b/i.test(t)&&/\bpremier(?:e|ed|ing)\b/i.test(t);return{afterTheSilenceTheatricalRelease:e.slug==="after-the-silence"||e.title.trim().toLowerCase()==="after the silence",tribecaPremiere:r,palmSpringsShortFestPremiere:o,vimeoStaffPick:/\bvimeo\s+staff\s+pick(?:s)?\b/i.test(t),superBowlCommercial:/\bsuper\s*bowl\b/i.test(t)}}function ec({label:e,title:t,footer:s,className:r}){return a.jsxs("div",{className:`public-recognition public-recognition-award ${r}`,role:"img","aria-label":[e,t,s].filter(Boolean).join(" "),children:[a.jsx("span",{className:"public-recognition-award-label",children:e}),a.jsx("span",{className:"public-recognition-award-title",children:t}),s?a.jsx("span",{className:"public-recognition-award-footer",children:s}):null]})}function Z_(){return a.jsx(ec,{className:"public-recognition-tribeca",label:"Official Selection",title:"Tribeca Film Festival",footer:"Premiere"})}function J_(){return a.jsx(ec,{className:"public-recognition-theatrical",label:"In Select Theaters",title:"December",footer:"2026"})}function e6(){return a.jsx(ec,{className:"public-recognition-vimeo",label:"Vimeo",title:"Staff Pick"})}function t6(){return a.jsx(ec,{className:"public-recognition-palm-springs",label:"Palm Springs",title:"ShortFest",footer:"Premiere"})}function n6(){return a.jsx(ec,{className:"public-recognition-super-bowl",label:"Super Bowl",title:"Commercial"})}function _p({item:e}){const t=X_(e);return!t.afterTheSilenceTheatricalRelease&&!t.tribecaPremiere&&!t.palmSpringsShortFestPremiere&&!t.vimeoStaffPick&&!t.superBowlCommercial?null:a.jsxs("div",{className:"public-recognition-badges pointer-events-none",children:[t.afterTheSilenceTheatricalRelease?a.jsx(J_,{}):null,t.tribecaPremiere?a.jsx(Z_,{}):null,t.palmSpringsShortFestPremiere?a.jsx(t6,{}):null,t.vimeoStaffPick?a.jsx(e6,{}):null,t.superBowlCommercial?a.jsx(n6,{}):null]})}function a1(e){return Number.isInteger(e.workPageOrder)&&e.workPageOrder!==void 0&&e.workPageOrder>=0?e.workPageOrder:void 0}function ju(e){return e==="films"?0:1}function s6(e,t){const s=a1(e.item),r=a1(t.item);return s!==void 0&&r!==void 0?s-r||ju(e.collection)-ju(t.collection)||e.item.order-t.item.order||e.item.id.localeCompare(t.item.id):s!==void 0!=(r!==void 0)?s!==void 0?-1:1:ju(e.collection)-ju(t.collection)||e.item.order-t.item.order||e.item.id.localeCompare(t.item.id)||e.sourceIndex-t.sourceIndex}function r6(e){return[...e].sort(s6)}function li(e,t={}){const s=t.includeUnpublished??!1,r=[...e.films.map((o,c)=>({item:o,collection:"films",sourceIndex:c})),...e.work.map((o,c)=>({item:o,collection:"work",sourceIndex:c}))].filter(({item:o})=>!o.deletedAt&&(s||o.published));return r6(r)}function $C(e,t){const s=li(e,{includeUnpublished:!0}),r=new Map(s.map(h=>[h.item.id,h])),o=new Set,c=[];for(const h of t){const m=r.get(h);m&&!o.has(h)&&(c.push(m),o.add(h))}for(const h of s)o.has(h.item.id)||c.push(h);const u=new Map(c.map((h,m)=>[h.item.id,m])),f=new Map;for(const h of["films","work"])c.filter(m=>m.collection===h).forEach((m,p)=>f.set(m.item.id,p));return{...e,films:e.films.map(h=>{const m=u.get(h.id);return m===void 0||h.deletedAt?h:{...h,workPageOrder:m,order:f.get(h.id)}}),work:e.work.map(h=>{const m=u.get(h.id);return m===void 0||h.deletedAt?h:{...h,workPageOrder:m,order:f.get(h.id)}})}}function Lm(e){const t=new Set;return e.filter(s=>t.has(s.id)?!1:(t.add(s.id),!0))}function i6(e,t){const s=e.cycle?.find(r=>r.itemId===t&&r.enabled)?.duration;return typeof s=="number"&&Number.isFinite(s)&&s>=1&&s<=12?s:5}function a6(e,t){const s=e.films.some(o=>o.id===t.id)?"films":"work",r=to(e,t,s);return{id:`home-${t.id}`,itemId:t.id,...r,duration:i6(e,t.id),enabled:!0}}function qC(e){const t=li(e),s=Lm(t.filter(m=>m.collection==="films"&&Bl(m.item,"films")).map(m=>m.item)),r=Lm(t.filter(m=>m.collection==="work"&&Bl(m.item,"work")).map(m=>m.item)),o=Lm([...s,...r]),c=new Map(o.map(m=>[m.id,m])),u=[],f=new Set;if(e.settings?.homepageCycleOrderOverride)for(const m of e.cycle||[]){const p=c.get(m.itemId);p&&!f.has(p.id)&&(u.push(p),f.add(p.id))}for(const m of o)f.has(m.id)||(u.push(m),f.add(m.id));const h=u.map(m=>a6(e,m));return{films:s,work:r,cycle:h}}function o6({site:e,introActive:t=!1}){const[s,r]=y.useState(null),[o,c]=y.useState(null),[u,f]=y.useState(null),h=y.useMemo(()=>qC(e),[e]),m=h.cycle,p=m.map(O=>O.itemId).join("\0"),x=m.findIndex(O=>
10O.itemId===s),v=x>=0?x:0;y.useEffect(()=>{r(O=>O&&m.some(I=>I.itemId===O)?O:m[0]?.itemId||null),c(null),f(null)},[p]);const j=y.useMemo(()=>[...e.films,...e.work],[e.films,e.work]),w=y.useMemo(()=>{const O=u||s;return O&&j.find(I=>I.id===O)||null},[s,j,u]),C=m[v],S=C?.duration;y.useEffect(()=>{if(t||m.length<=1||u!==null||!C||!s)return;const O=window.setTimeout(()=>{const I=m[(v+1)%m.length];c(s),r(I.itemId)},(S??5)*1e3);return()=>window.clearTimeout(O)},[S,v,s,p,u,t]),y.useEffect(()=>{if(!o)return;const O=window.setTimeout(()=>c(null),850);return()=>window.clearTimeout(O)},[o,s]);const N=O=>h.films.some(I=>I.id===O.id)?"films":"work",E=O=>m.findIndex(I=>I.itemId===O),R=w?`/${N(w)}/${w.slug}`:"/",D=w?`${N(w)==="films"?"film":"work"}/${w.slug}`:void 0,A=(O,I)=>{O.pointerType==="mouse"&&window.matchMedia("(hover: hover)").matches&&f(I)},_=(O,I)=>{O.currentTarget.matches(":focus-visible")&&f(I)},F=()=>f(null);return a.jsxs("div",{className:"public-home flex-1 min-h-0 flex flex-col relative w-full h-full overflow-x-hidden overflow-y-auto md:overflow-hidden bg-background text-[15px]",children:[a.jsx("div",{className:"public-home-stage relative flex flex-col shrink-0 pt-[clamp(128px,22dvh,192px)] md:pt-0 md:absolute md:inset-0 md:flex-row md:items-center md:justify-center md:overflow-hidden z-0",children:a.jsxs(ur,{href:R,identity:D,className:"flex flex-col w-full cursor-pointer group",titleSelector:"[data-transition-title='true']",children:[a.jsx("div",{className:"public-home-frame w-[100vw] aspect-[2.39/1] relative shrink-0 overflow-hidden bg-black",children:m.map((O,I)=>{const V=j.find(J=>J.id===O.itemId),H=u===O.itemId,k=!u&&I===v||H,q=O.itemId===o;return a.jsxs("div",{className:"public-home-slide absolute inset-0 transition-opacity duration-[800ms] ease-in-out",style:{opacity:k||q?1:0,zIndex:k?2:q?1:0},children:[a.jsx(Hi,{media:O,active:k||q,preload:!u&&I===(v+1)%m.length,alt:"",className:"z-10",allowTouchPlayback:!0}),V?a.jsx(_p,{item:V}):null,a.jsx("div",{className:"public-home-caption absolute bottom-6 md:bottom-8 left-6 md:left-8 z-30 pointer-events-none hidden md:block",children:V?a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-transition-title":k?"true":void 0,className:"public-home-title text-foreground text-[17px] leading-tight",children:V.title}),V.client&&a.jsx("div",{className:"public-home-client text-foreground/80 text-[13px] leading-tight mt-1",children:V.client}),a.jsx("div",{className:"public-home-meta text-muted-foreground text-[13px] leading-tight mt-1",children:V.homepageCaption!==V.client?V.homepageCaption:null})]}):null})]},O.id)})}),a.jsx("div",{className:"public-home-mobile-caption w-full min-h-[88px] pt-4 px-6 md:hidden",children:a.jsx("div",{className:"text-foreground text-[15px] leading-tight flex justify-between items-start gap-4",children:a.jsx(F_,{item:w})})})]})}),a.jsx("div",{className:"hidden md:block flex-1 min-h-[80px] pointer-events-none z-10"}),a.jsx("div",{className:"public-home-index flex-1 shrink-0 mt-[clamp(24px,7dvh,64px)] md:mt-0 md:min-h-[120px] flex flex-col justify-start md:justify-end px-6 md:px-8 pb-[calc(64px+env(safe-area-inset-bottom,0px))] relative z-50 pointer-events-none",children:a.jsxs("div",{className:"public-home-index-rows grid grid-cols-2 items-start gap-4 md:flex md:flex-col md:items-stretch md:gap-1 pointer-events-auto",children:[a.jsxs("div",{className:"public-home-index-row public-home-films flex flex-col items-start md:flex-row md:flex-wrap md:items-stretch gap-x-3 md:gap-x-8 gap-y-0 md:gap-y-2 text-[15px] leading-[22px] md:leading-normal",children:[a.jsx("div",{className:"public-home-index-label",children:"FILMS"}),a.jsx("div",{className:"public-home-index-links",children:h.films.map(O=>{const I=u===O.id,V=!u&&E(O.id)===v,H=I||V;return a.jsx(ur,{href:`/films/${O.slug}`,identity:`film/${O.slug}`,className:`public-home-index-link flex items-center w-full min-h-11 py-2.5 md:w-auto md:min-h-0 md:py-0 transition-colors duration-[800ms] ease-in-out whitespace-normal md:whitespace-nowrap touch-manipulation ${H?"text-foreground":"text-muted-foreground hover:text-foreground"}`,onPointerEnter:k=>A(k,O.id),onPointerLeave:F,onFocus:k=>_(k,O.id),onBlur:F,children:a.jsx("span",{className:"public-home-index-text",children:O.title})},O.id)})})]}),a.jsxs("div",{className:"public-home-index-row public-home-work flex flex-col items-start md:flex-row md:flex-wrap md:items-stretch gap-x-4 md:gap-x-8 gap-y-0 md:gap-y-2 text-[13.5px] md:text-[13px] leading-[22px] md:leading-normal md:mt-1",children:[a.jsx("div",{className:"public-home-index-label",children:"Selected Work"}),a.jsx("div",{className:"public-home-index-links",children:h.work.map(O=>{const I=u===O.id,V=!u&&E(O.id)===v,H=I||V;return a.jsx(ur,{href:`/work/${O.slug}`,identity:`work/${O.slug}`,className:`public-home-index-link flex items-center w-full min-h-11 py-2.5 md:w-auto md:min-
10h-0 md:py-0 transition-colors duration-[800ms] ease-in-out whitespace-normal md:whitespace-nowrap touch-manipulation ${H?"text-foreground":"text-muted-foreground hover:text-foreground"}`,onPointerEnter:k=>A(k,O.id),onPointerLeave:F,onFocus:k=>_(k,O.id),onBlur:F,children:a.jsx("span",{className:"public-home-index-text",children:O.brandLabel||O.client||O.title})},O.id)})})]})]})})]})}const l6=new Set(["vimeo.com","www.vimeo.com","player.vimeo.com"]),c6=new Set(["youtube.com","www.youtube.com","m.youtube.com","youtu.be"]),o1=/^[A-Za-z0-9_-]+$/,u6=/^[A-Za-z0-9_-]+$/;function HC(e){return e.protocol==="https:"&&l6.has(e.hostname.toLowerCase())&&!e.username&&!e.password&&!e.port}function d6(e,t=!0,s=!0){const r=new URLSearchParams;return r.set("autoplay",s?"1":"0"),r.set("muted","0"),r.set("controls","1"),r.set("playsinline",t?"1":"0"),r.set("loop","0"),r.set("dnt","1"),e&&r.set("h",e),r.toString()}function KC(e,t={}){if(typeof e!="string")return null;try{const s=new URL(e);if(!HC(s))return null;let r,o;const c=s.pathname.replace(/\/+$/,"");if(s.hostname.toLowerCase()==="player.vimeo.com"){const h=c.match(/^\/video\/([0-9]+)$/);if(!h)return null;r=h[1]}else{const h=c.match(/^\/(?:video\/)?([0-9]+)(?:\/([^/]+))?$/);if(!h||(r=h[1],o=h[2],o&&!o1.test(o)))return null}const u=s.searchParams.get("h")||void 0,f=o||(u&&o1.test(u)?u:void 0);return`https://player.vimeo.com/video/${r}
10?${d6(f,t.playsInline,t.autoplay)}`}catch{return null}}function f6(e){if(typeof e!="string")return null;try{const t=new URL(e);return HC(t)?t.href:null}catch{return null}}function GC(e){return e.protocol==="https:"&&c6.has(e.hostname.toLowerCase())&&!e.username&&!e.password&&!e.port}function h6(e){const t=e.hostname.toLowerCase(),s=e.pathname.replace(/\/+$/,"");let r=null;return t==="youtu.be"?r=s.match(/^\/([^/]+)$/)?.[1]||null:s==="/watch"?r=e.searchParams.get("v"):r=s.match(/^\/(?:shorts|embed)\/([^/]+)$/)?.[1]||null,r&&u6.test(r)?r:null}function m6(e,t={}){if(typeof e!="string")return null;try{const s=new URL(e);if(!GC(s))return null;const r=h6(s);if(!r)return null;const o=new URLSearchParams({autoplay:t.autoplay===!1?"0":"1",playsinline:t.playsInline===!1?"0":"1",controls:"1",rel:"0"});return`https://www.youtube-nocookie.com/embed/${r}?${o.toString()}`}catch{return null}}function xd(e,t={}){const s=KC(e,t);if(s)return{provider:"vimeo",embedUrl:s};const r=m6(e,t);return r?{provider:"youtube",embedUrl:r}:null}function p6(e){const t=f6(e);if(t)return t;if(typeof e!="string")return null;try{const s=new URL(e);return GC(s)?s.href:null}catch{return null}}const l1="https://player.vimeo.com";function g6({src:e,title:t,autoplay:s}){const r=y.useRef(null),o=y.useRef(!1);function c(u,f){r.current?.contentWindow?.postMessage(JSON.stringify({method:u,value:f}),l1)}return y.useEffect(()=>{o.current=!1;function u(f){if(f.origin!==l1||f.source!==r.current?.contentWindow)return;let h;try{h=typeof f.data=="string"?JSON.parse(f.data):f.data}catch{return}o.current||h?.event!=="ready"&&h?.method!=="ping"||(o.current=!0,c("setMuted",!1),c("setVolume",1),s&&c("play"))}return window.addEventListener("message",u),()=>window.removeEventListener("message",u)},[e,s]),a.jsx("iframe",{ref:r,src:e,onLoad:()=>c("ping"),className:"absolute inset-0 h-full w-full",frameBorder:"0",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,title:t})}const ix=y.createContext({});function ax(e){const t=y.useRef(null);return t.current===null&&(t.current=e()),t.current}const x6=typeof window<"u",ox=x6?y.useLayoutEffect:y.useEffect,Jd=y.createContext(null);function lx(e,t){e.indexOf(t)===-1&&e.push(t)}function yd(e,t){const s=e.indexOf(t);s>-1&&e.splice(s,1)}const Ds=(e,t,s)=>s>t?t:s<e?e:s;let ef=()=>{};const ni={},YC=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),QC=e=>typeof e=="object"&&e!==null,WC=e=>/^0[^.\s]+$/u.test(e);function XC(e){let t;return()=>(t===void 0&&(t=e()),t)}const ts=e=>e,tc=(...e)=>e.reduce((t,s)=>r=>s(t(r))),$l=(e,t,s)=>{const r=t-e;return r?(s-e)/r:1};class cx{constructor(){this.subscriptions=[]}add(t){return lx(this.subscriptions,t),()=>yd(this.subscriptions,t)}notify(t,s,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,s,r);else for(let c=0;c<o;c++){const u=this.subscriptions[c];u&&u(t,s,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Un=e=>e*1e3,es=e=>e/1e3,ZC=(e,t)=>t?e*(1e3/t):0,JC=(e,t,s)=>(((1-3*s+3*t)*e+(3*s-6*t))*e+3*t)*e,y6=1e-7,v6=12;function b6(e,t,s,r,o){let c,u,f=0;do u=t+(s-t)/2,c=JC(u,r,o)-e,c>0?s=u:t=u;while(Math.abs(c)>y6&&++f<v6);return u}function nc(e,t,s,r){if(e===t&&s===r)return ts;const o=c=>b6(c,0,1,e,s);return c=>c===0||c===1?c:JC(o(c),t,r)}const eE=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,tE=e=>t=>1-e(1-t),nE=nc(.33,1.53,.69,.99),ux=tE(nE),sE=eE(ux),rE=e=>e>=1?1:(e*=2)<1?.5*ux(e):.5*(2-Math.pow(2,-10*(e-1))),dx=e=>1-Math.sin(Math.acos(e)),iE=tE(dx),aE=eE(dx),w6=nc(.42,0,1,1),j6=nc(0,0,.58,1),oE=nc(.42,0,.58,1),S6=e=>Array.isArray(e)&&typeof e[0]!="number",lE=e=>Array.isArray(e)&&typeof e[0]=="number",N6={linear:ts,easeIn:w6,easeInOut:oE,easeOut:j6,circIn:dx,circInOut:aE,circOut:iE,backIn:ux,backInOut:sE,backOut:nE,anticipate:rE},C6=e=>typeof e=="string",c1=e=>{if(lE(e)){ef(e.length===4);const[t,s,r,o]=e;return nc(t,s,r,o)}else if(C6(e))return N6[e];return e},Su=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function E6(e){let t=new Set,s=new Set,r=!1,o=!1;const c=new WeakSet;let u={delta:0,timestamp:0,isProcessing:!1};function f(m){c.has(m)&&(h.schedule(m),e()),m(u)}const h={schedule:(m,p=!1,x=!1)=>{const j=x&&r?t:s;
vendor: 39,396 bytes, line 10
10return p&&c.add(m),j.add(m),m},cancel:m=>{s.delete(m),c.delete(m)},process:m=>{if(u=m,r){o=!0;return}r=!0;const p=t;t=s,s=p,t.forEach(f),t.clear(),r=!1,o&&(o=!1,h.process(m))}};return h}const T6=40;function cE(e,t){let s=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},c=()=>s=!0,u=Su.reduce((R,D)=>(R[D]=E6(c),R),{}),{setup:f,read:h,resolveKeyframes:m,preUpdate:p,update:x,preRender:v,render:j,postRender:w}=u,C=()=>{const R=ni.useManualTiming,D=R?o.timestamp:performance.now();s=!1,R||(o.delta=r?1e3/60:Math.max(Math.min(D-o.timestamp,T6),1)),o.timestamp=D,o.isProcessing=!0,f.process(o),h.process(o),m.process(o),p.process(o),x.process(o),v.process(o),j.process(o),w.process(o),o.isProcessing=!1,s&&t&&(r=!1,e(C))},S=()=>{s=!0,r=!0,o.isProcessing||e(C)};return{schedule:Su.reduce((R,D)=>{const A=u[D];return R[D]=(_,F=!1,O=!1)=>(s||S(),A.schedule(_,F,O)),R},{}),cancel:R=>{for(let D=0;D<Su.length;D++)u[Su[D]].cancel(R)},state:o,steps:u}}const{schedule:lt,cancel:si,state:Zt,steps:Um}=cE(typeof requestAnimationFrame<"u"?requestAnimationFrame:ts,!0);let Ku;function A6(){Ku=void 0}const fn={now:()=>(Ku===void 0&&fn.set(Zt.isProcessing||ni.useManualTiming?Zt.timestamp:performance.now()),Ku),set:e=>{Ku=e,queueMicrotask(A6)}},uE=e=>t=>typeof t=="string"&&t.startsWith(e),dE=uE("--"),R6=uE("var(--"),fx=e=>R6(e)?k6.test(e.split("/*")[0].trim()):!1,k6=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function u1(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const po={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ql={...po,transform:e=>Ds(0,1,e)},Nu={...po,default:1},Al=e=>Math.round(e*1e5)/1e5,hx=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function M6(e){return e==null}const O6=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,mx=(e,t)=>s=>!!(typeof s=="string"&&O6.test(s)&&s.startsWith(e)||t&&!M6(s)&&Object.prototype.hasOwnProperty.call(s,t)),fE=(e,t,s)=>r=>{if(typeof r!="string")return r;const[o,c,u,f]=r.match(hx);return{[e]:parseFloat(o),[t]:parseFloat(c),[s]:parseFloat(u),alpha:f!==void 0?parseFloat(f):1}},D6=e=>Ds(0,255,e),Im={...po,transform:e=>Math.round(D6(e))},Li={test:mx("rgb","red"),parse:fE("red","green","blue"),transform:({red:e,green:t,blue:s,alpha:r=1})=>"rgba("+Im.transform(e)+", "+Im.transform(t)+", "+Im.transform(s)+", "+Al(ql.transform(r))+")"};function P6(e){let t="",s="",r="",o="";return e.length>5?(t=e.substring(1,3),s=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),s=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,s+=s,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(s,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const Lp={test:mx("#"),parse:P6,transform:Li.transform},sc=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),tr=sc("deg"),As=sc("%"),he=sc("px"),_6=sc("vh"),L6=sc("vw"),d1={...As,parse:e=>As.parse(e)/100,transform:e=>As.transform(e*100)},Ga={test:mx("hsl","hue"),parse:fE("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:s,alpha:r=1})=>"hsla("+Math.round(e)+", "+As.transform(Al(t))+", "+As.transform(Al(s))+", "+Al(ql.transform(r))+")"},At={test:e=>Li.test(e)||Lp.test(e)||Ga.test(e),parse:e=>Li.test(e)?Li.parse(e):Ga.test(e)?Ga.parse(e):Lp.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Li.transform(e):Ga.transform(e),getAnimatableNone:e=>{const t=At.parse(e);return t.alpha=0,At.transform(t)}},U6=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function I6(e){return isNaN(e)&&typeof e=="string"&&(e.match(hx)?.length||0)+(e.match(U6)?.length||0)>0}const hE="number",mE="color",z6="var",F6="var(",f1="${}",V6=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function no(e){const t=e.toString(),s=[],r={color:[],number:[],var:[]},o=[];let c=0;const f=t.replace(V6,h=>(At.test(h)?(r.color.push(c),o.push(mE),s.push(At.parse(h))):h.startsWith(F6)?(r.var.push(c),o.push(z6),s.push(h)):(r.number.push(c),o.push(hE),s.push(parseFloat(h))),++c,f1)).split(f1);return{values:s,split:f,indexes:r,types:o}}function B6(e){return no(e).values}function pE({split:e,types:t}){const s=e.length;return r=>{let o="";for(let c=0;c<s;c++)if(o+=e[c],r[c]!==void 0){const u=t[c];u===hE?o+=Al(r[c]):u===mE?o+=At.transform(r[c]):o+=r[c]}return o}}function $6(e){return pE(no(e))}const q6=e=>typeof e=="number"?0:At.test(e)?At.getAnimatableNone(e):e,H6=(e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:q6(e);function K6(e){const t=no(e);return pE(t)(t.values.map((r,o)=>H6(r,t.split[o])))}const fs={test:I6,parse:B6,createTransformer:$6,getAnimatableNone:K6};function zm(e,t,s){return s<0&&(s+=1),s>1&&(s-=1),s<1/6?e+(t-e)*6*s:s<1/2?t:s<2/3?e+(t-e)*(2/3-s)*6:e}function G6({hue:e,saturation:t,lightness:s,alpha:r}){e/=360,t/=100,s/=100;let o=0,c=0,u=0;if(!t)o=c=u=s;else{const f=s<.5?s*(1+t):s+t-s*t,h=2*s-f;o=zm(h,f,e+1/3),c=zm(h,f,e),u=zm(h,f,e-1/3)}return{red:Math.round(o*255),green:Math.round(c*255),blue:Math.round(u*255),alpha:r}}function vd(e,t){return s=>s>0?t:e}const ot=(e,t,s)=>e+(t-e)*s,Fm=(e,t,s)=>{const r=e*e,o=s*(t*t-r)+r;return o<0?0:Math.sqrt(o)},Y6=[Lp,Li,Ga],Q6=e=>Y6.find(t=>t.test(e));function h1(e){const t=Q6(e);if(!t)return!1;let s=t.parse(e);return t===Ga&&(s=G6(s)),s}const m1=(e,t)=>{const s=h1(e),r=h1(t);if(!s||!r)return vd(e,t);const o={...s};return c=>(o.red=Fm(s.red,r.red,c),o.green=Fm(s.green,r.green,c),o.blue=Fm(s.blue,r.blue,c),o.alpha=ot(s.alpha,r.alpha,c),Li.transform(o))},Up=new Set(["none","hidden"]);function W6(e,t){return Up.has(e)?s=>s<=0?e:t:s=>s>=1?t:e}function X6(e,t){return s=>ot(e,t,s)}function px(e){return typeof e=="number"?X6:typeof e=="string"?fx(e)?vd:At.test(e)?m1:eL:Array.isArray(e)?gE:typeof e=="object"?At.test(e)?m1:Z6:vd}function gE(e,t){const s=[...e],r=s.length,o=e.map((c,u)=>px(c)(c,t[u]));return c=>{for(let u=0;u<r;u++)s[u]=o[u](c);return s}}function Z6(e,t){const s={...e,...t},r={};for(const o in s)e[o]!==void 0&&t[o]!==void 0&&(r[o]=px(e[o])(e[o],t[o]));return o=>{for(const c in r)s[c]=r[c](o);return s}}function J6(e,t){const s=[],r={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const c=t.types[o],u=e.indexes[c][r[c]],f=e.values[u]??0;s[o]=f,r[c]++}return s}const eL=(e,t)=>{const s=fs.createTransformer(t),r=no(e),o=no(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?Up.has(e)&&!o.values.length||Up.has(t)&&!r.values.length?W6(e,t):tc(gE(J6(r,o),o.values),s):vd(e,t)};function xE(e,t,s){return typeof e=="number"&&typeof t=="number"&&typeof s=="number"?ot(e,t,s):px(e)(e,t)}const tL=e=>{const t=({timestamp:s})=>e(s);return{start:(s=!0)=>lt.update(t,s),stop:()=>si(t),now:()=>Zt.isProcessing?Zt.timestamp:fn.now()}},yE=(e,t,s=10)=>{let r="";const o=Math.max(Math.round(t/s),2);for(let c=0;c<o;c++)r+=Math.round(e(c/(o-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},bd=2e4;function gx(e){let t=0;const s=50;let r=e.next(t);for(;!r.done&&t<bd;)t+=s,r=e.next(t);return t>=bd?1/0:t}function nL(e,t=100,s){const r=s({...e,keyframes:[0,t]}),o=Math.min(gx(r),bd);return{type:"keyframes",ease:c=>r.next(o*c).value/t,duration:es(o)}}const wt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Ip(e,t){return e*Math.sqrt(1-t*t)}const sL=12;function rL(e,t,s){let r=s;for(let o=1;o<sL;o++)r=r-e(r)/t(r);return r}const Vm=.001;function iL({duration:e=wt.duration,bounce:t=wt.bounce,velocity:s=wt.velocity,mass:r=wt.mass}){let o,c,u=1-t;u=Ds(wt.minDamping,wt.maxDamping,u),e=Ds(wt.minDuration,wt.maxDuration,es(e)),u<1?(o=m=>{const p=m*u,x=p*e,v=p-s,j=Ip(m,u),w=Math.exp(-x);return Vm-v/j*w},c=m=>{const x=m*u*e,v=x*s+s,j=Math.pow(u,2)*Math.pow(m,2)*e,w=Math.exp(-x),C=Ip(Math.pow(m,2),u);return(-o(m)+Vm>0?-1:1)*((v-j)*w)/C}):(o=m=>{const p=Math.exp(-m*e),x=(m-s)*e+1;return-Vm+p*x},c=m=>{const p=Math.exp(-m*e),x=(s-m)*(e*e);return p*x});const f=5/e,h=rL(o,c,f);if(e=Un(e),isNaN(h))return{stiffness:wt.stiffness,damping:wt.damping,duration:e};{const m=Math.pow(h,2)*r;return{stiffness:m,damping:u*2*Math.sqrt(r*m),duration:e}}}const aL=["duration","bounce"],oL=["stiffness","damping","mass"];function p1(e,t){return t.some(s=>e[s]!==void 0)}function lL(e){let t={velocity:wt.velocity,stiffness:wt.stiffness,damping:wt.damping,mass:wt.mass,isResolvedFromDuration:!1,...e};if(!p1(e,oL)&&p1(e,aL))if(t.velocity=0,e.visualDuration){const s=e.visualDuration,r=2*Math.PI/(s*1.2),o=r*r,c=2*Ds(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:wt.mass,stiffness:o,damping:c}}else{const s=iL({...e,velocity:0});t={...t,...s,mass:wt.mass},t.isResolvedFromDuration=!0}return t}function wd(e=wt.visualDuration,t=wt.bounce){const s=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=s;const c=s.keyframes[0],u=s.keyframes[s.keyframes.length-1],f={done:!1,value:c},{stiffness:h,damping:m,mass:p,duration:x,velocity:v,isResolvedFromDuration:j}=lL({...s,velocity:-es(s.velocity||0)}),w=v||0,C=m/(2*Math.sqrt(h*p)),S=u-c,N=es(Math.sqrt(h/p)),E=Math.abs(S)<5;r||(r=E?wt.restSpeed.granular:wt.restSpeed.default),o||(o=E?wt.restDelta.granular:wt.restDelta.default);let R,D,A,_,F,O;if(C<1)A=Ip(N,C),_=(w+C*N*S)/A,R=V=>{const H=Math.exp(-C*N*V);return u-H*(_*Math.sin(A*V)+S*Math.cos(A*V))},F=C*N*_+S*A,O=C*N*S-_*A,D=V=>Math.exp(-C*N*V)*(F*Math.sin(A*V)+O*Math.cos(A*V));else if(C===1){R=H=>u-Math.exp(-N*H)*(S+(w+N*S)*H);const V=w+N*S;D=H=>Math.exp(-N*H)*(N*V*H-w)}else{const V=N*Math.sqrt(C*C-1);R=J=>{const re=Math.exp(-C*N*J),U=Math.min(V*J,300);return u-re*((w+C*N*S)*Math.sinh(U)+V*S*Math.cosh(U))/V};const H=(w+C*N*S)/V,k=C*N*H-S*V,q=C*N*S-H*V;D=J=>{const re=Math.exp(-C*N*J),U=Math.min(V*J,300);return re*(k*Math.sinh(U)+q*Math.cosh(U))}}const I={calculatedDuration:j&&x||null,velocity:V=>Un(D(V)),next:V=>{if(!j&&C<1){const k=Math.exp(-C*N*V),q=Math.sin(A*V),J=Math.cos(A*V),re=u-k*(_*q+S*J),U=Un(k*(F*q+O*J));return f.done=Math.abs(U)<=r&&Math.abs(u-re)<=o,f.value=f.done?u:re,f}const H=R(V);if(j)f.done=V>=x;else{const k=Un(D(V));f.done=Math.abs(k)<=r&&Math.abs(u-H)<=o}return f.value=f.done?u:H,f},toString:()=>{const V=Math.min(gx(I),bd),H=yE(k=>I.next(V*k).value,V,30);return V+"ms "+H},toTransition:()=>{}};return I}wd.applyToOptions=e=>{const t=nL(e,100,wd);return e.ease=t.ease,e.duration=Un(t.duration),e.type="keyframes",e};const cL=5;function vE(e,t,s){const r=Math.max(t-cL,0);return ZC(s-e(r),t-r)}function zp({keyframes:e,velocity:t=0,power:s=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:c=500,modifyTarget:u,min:f,max:h,restDelta:m=.5,restSpeed:p}){const x=e[0],v={done:!1,value:x},j=O=>f!==void 0&&O<f||h!==void 0&&O>h,w=O=>f===void 0?h:h===void 0||Math.abs(f-O)<Math.abs(h-O)?f:h;let C=s*t;const S=x+C,N=u===void 0?S:u(S);N!==S&&(C=N-x);const E=O=>-C*Math.exp(-O/r),R=O=>N+E(O),D=O=>{const I=E(O),V=R(O);v.done=Math.abs(I)<=m,v.value=v.done?N:V};let A,_;const F=O=>{j(v.value)&&(A=O,_=wd({keyframes:[v.value,w(v.value)],velocity:vE(R,O,v.value),damping:o,stiffness:c,restDelta:m,restSpeed:p}))};return F(0),{calculatedDuration:null,next:O=>{let I=!1;return!_&&A===void 0&&(I=!0,D(O),F(O)),A!==void 0&&O>=A?_.next(O-A):(!I&&D(O),v)}}}function uL(e,t,s){const r=[],o=s||ni.mix||xE,c=e.length-1;for(let u=0;u<c;u++){let f=o(e[u],e[u+1]);if(t){const h=Array.isArray(t)?t[u]||ts:t;f=tc(h,f)}r.push(f)}return r}function dL(e,t,{clamp:s=!0,ease:r,mixer:o}={}){const c=e.length;if(ef(c===t.length),c===1)return()=>t[0];if(c===2&&t[0]===t[1])return()=>t[1];const u=e[0]===e[1];e[0]>e[c-1]&&(e=[...e].reverse(),t=[...t].reverse());const f=uL(t,r,o),h=f.length,m=p=>{if(u&&p<e[0])return t[0];let x=0;if(h>1)for(;x<e.length-2&&!(p<e[x+1]);x++);const v=$l(e[x],e[x+1],p);return f[x](v)};return s?p=>m(Ds(e[0],e[c-1],p)):m}function fL(e,t){const s=e[e.length-1];for(let r=1;r<=t;r++){const o=$l(0,t,r);e.push(ot(s,1,o))}}function hL(e){const t=[0];return fL(t,e.length-1),t}function mL(e,t){return e.map(s=>s*t)}function pL(e,t){return e.map(()=>t||oE).splice(0,e.length-1)}function Rl({duration:e=300,keyframes:t,times:s,ease:r="easeInOut"}){const o=S6(r)?r.map(c1):c1(r),c={done:!1,value:t[0]},u=mL(s&&s.length===t.length?s:hL(t),e),f=dL(u,t,{ease:Array.isArray(o)?o:pL(t,o)});return{calculatedDuration:e,next:h=>(c.value=f(h),c.done=h>=e,c)}}const gL=e=>e!==null;function tf(e,{repeat:t,repeatType:s="loop"},r,o=1){const c=e.filter(gL),f=o<0||t&&s!=="loop"&&t%2===1?0:c.length-1;return!f||r===void 0?c[f]:r}const xL={decay:zp,inertia:zp,tween:Rl,keyframes:Rl,spring:wd};function bE(e){typeof e.type=="string"&&(e.type=xL[e.type])}class xx{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,s){return this.finished.then(t,s)}}const yL=e=>e/100;class jd extends xx{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:s}=this.options;s&&s.updatedAt!==fn.now()&&this.tick(fn.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;bE(t);const{type:s=Rl,repeat:r=0,repeatDelay:o=0,repeatType:c,velocity:u=0}=t;let{keyframes:f}=t;const h=s||Rl;h!==Rl&&typeof f[0]!="number"&&(this.mixKeyframes=tc(yL,xE(f[0],f[1])),f=[0,100]);const m=h({...t,keyframes:f});c==="mirror"&&(this.mirroredGenerator=h({...t,keyframes:[...f].reverse(),velocity:-u})),m.calculatedDuration===null&&(m.calculatedDuration=gx(m));const{calculatedDuration:p}=m;this.calculatedDuration=p,this.resolvedDuration=p+o,this.totalDuration=this.resolvedDuration*(r+1)-o,this.generator=m}updateTime(t){const s=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=s}tick(t,s=!1){const{generator:r,totalDuration:o,mixKeyframes:c,mirroredGenerator:u,resolvedDuration:f,calculatedDuration:h}=this;if(this.startTime===null)return r.next(0);const{delay:m=0,keyframes:p,repeat:x,repeatType:v,repeatDelay:j,type:w,onUpdate:C,finalKeyframe:S}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),s?this.currentTime=t:this.updateTime(t);const N=this.currentTime-m*(this.playbackSpeed>=0?1:-1),E=this.playbackSpeed>=0?N<0:N>o;this.currentTime=Math.max(N,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let R=this.currentTime,D=r;if(x){const O=Math.min(this.currentTime,o)/f;let I=Math.floor(O),V=O%1;!V&&O>=1&&(V=1),V===1&&I--,I=Math.min(I,x+1),I%2&&(v==="reverse"?(V=1-V,j&&(V-=j/f)):v==="mirror"&&(D=u)),R=Ds(0,1,V)*f}let A;E?(this.delayState.value=p[0],A=this.delayState):A=D.next(R),c&&!E&&(A.value=c(A.value));let{done:_}=A;!E&&h!==null&&(_=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const F=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&_);return F&&w!==zp&&(A.value=tf(p,this.options,S,this.speed)),C&&C(A.value),F&&this.finish(),A}then(t,s){return this.finished.then(t,s)}get duration(){return es(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+es(t)}get time(){return es(this.currentTime)}set time(t){t=Un(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const s=this.generator.next(t).value;return vE(r=>this.generator.next(r).value,t,s)}get speed(){return this.playbackSpeed}set speed(t){const s=this.playbackSpeed!==t;s&&this.driver&&this.updateTime(fn.now()),this.playbackSpeed=t,s&&this.driver&&(this.time=es(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=tL,startTime:s}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=s??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(fn.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function vL(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Ui=e=>e*180/Math.PI,Fp=e=>{const t=Ui(Math.atan2(e[1],e[0]));return Vp(t)},bL={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Fp,rotateZ:Fp,skewX:e=>Ui(Math.atan(e[1])),skewY:e=>Ui(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Vp=e=>(e=e%360,e<0&&(e+=360),e),g1=Fp,x1=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),y1=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),wL={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:x1,scaleY:y1,scale:e=>(x1(e)+y1(e))/2,rotateX:e=>Vp(Ui(Math.atan2(e[6],e[5]))),rotateY:e=>Vp(Ui(Math.atan2(-e[2],e[0]))),rotateZ:g1,rotate:g1,skewX:e=>Ui(Math.atan(e[4])),skewY:e=>Ui(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Bp(e){return e.includes("scale")?1:0}function $p(e,t){if(!e||e==="none")return Bp(t);const s=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(s)r=wL,o=s;else{const f=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=bL,o=f}if(!o)return Bp(t);const c=r[t],u=o[1].split(",").map(SL);return typeof c=="function"?c(u):u[c]}const jL=(e,t)=>{const{transform:s="none"}=getComputedStyle(e);return $p(s,t)};function SL(e){return parseFloat(e.trim())}const go=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],xo=new Set([...go,"pathRotation"]),v1=e=>e===po||e===he,NL=new Set(["x","y","z"]),CL=go.filter(e=>!NL.has(e));function EL(e){const t=[];return CL.forEach(s=>{const r=e.getValue(s);r!==void 0&&(t.push([s,r.get()]),r.set(s.startsWith("scale")?1:0))}),t}const Yr={width:({x:e},{paddingLeft:t="0",paddingRight:s="0",boxSizing:r})=>{const o=e.max-e.min;return r==="border-box"?o:o-parseFloat(t)-parseFloat(s)},height:({y:e},{paddingTop:t="0",paddingBottom:s="0",boxSizing:r})=>{const o=e.max-e.min;return r==="border-box"?o:o-parseFloat(t)-parseFloat(s)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>$p(t,"x"),y:(e,{transform:t})=>$p(t,"y")};Yr.translateX=Yr.x;Yr.translateY=Yr.y;const Fi=new Set;let qp=!1,Hp=!1,Kp=!1;function wE(){if(Hp){const e=Array.from(Fi).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),s=new Map;t.forEach(r=>{const o=EL(r);o.length&&(s.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const o=s.get(r);o&&o.forEach(([c,u])=>{r.getValue(c)?.set(u)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Hp=!1,qp=!1,Fi.forEach(e=>e.complete(Kp)),Fi.clear()}function jE(){Fi.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Hp=!0)})}function TL(){Kp=!0,jE(),wE(),Kp=!1}class yx{constructor(t,s,r,o,c,u=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=s,this.name=r,this.motionValue=o,this.element=c,this.isAsync=u}scheduleResolve(){this.state="scheduled",this.isAsync?(Fi.add(this),qp||(qp=!0,lt.read(jE),lt.resolveKeyframes(wE))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:s,element:r,motionValue:o}=this;if(t[0]===null){const c=o?.get(),u=t[t.length-1];if(c!==void 0)t[0]=c;else if(r&&s){const f=r.readValue(s,u);f!=null&&(t[0]=f)}t[0]===void 0&&(t[0]=u),o&&c===void 0&&o.set(t[0])}vL(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Fi.delete(this)}cancel(){this.state==="scheduled"&&(Fi.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const AL=e=>e.startsWith("--");function SE(e,t,s){AL(t)?e.style.setProperty(t,s):e.style[t]=s}const RL={};function NE(e,t){const s=XC(e);return()=>RL[t]??s()}const kL=NE(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),CE=NE(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Nl=([e,t,s,r])=>`cubic-bezier(${e}, ${t}, ${s}, ${r})`,b1={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Nl([0,.65,.55,1]),circOut:Nl([.55,0,1,.45]),backIn:Nl([.31,.01,.66,-.59]),backOut:Nl([.33,1.53,.69,.99])};function EE(e,t){if(e)return typeof e=="function"?CE()?yE(e,t):"ease-out":lE(e)?Nl(e):Array.isArray(e)?e.map(s=>EE(s,t)||b1.easeOut):b1[e]}function ML(e,t,s,{delay:r=0,duration:o=300,repeat:c=0,repeatType:u="loop",ease:f="easeOut",times:h}={},m=void 0){const p={[t]:s};h&&(p.offset=h);const x=EE(f,o);Array.isArray(x)&&(p.easing=x);const v={delay:r,duration:o,easing:Array.isArray(x)?"linear":x,fill:"both",iterations:c+1,direction:u==="reverse"?"alternate":"normal"};return m&&(v.pseudoElement=m),e.animate(p,v)}function TE(e){return typeof e=="function"&&"applyToOptions"in e}function OL({type:e,...t}){return TE(e)&&CE()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class AE extends xx{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:s,name:r,keyframes:o,pseudoElement:c,allowFlatten:u=!1,finalKeyframe:f,onComplete:h}=t;this.isPseudoElement=!!c,this.allowFlatten=u,this.options=t,ef(typeof t.type!="string");const m=OL(t);this.animation=ML(s,r,o,m,c),m.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!c){const p=tf(o,this.options,f,this.speed);this.updateMotionValue&&this.updateMotionValue(p),SE(s,r,p),this.animation.cancel()}h?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return es(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+es(t)}get time(){return es(Number(this.animation.currentTime)||0)}set time(t){const s=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Un(t),s&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:s,rangeEnd:r,observe:o}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&kL()?(this.animation.timeline=t,s&&(this.animation.rangeStart=s),r&&(this.animation.rangeEnd=r),ts):o(this)}}const RE={anticipate:rE,backInOut:sE,circInOut:aE};function DL(e){return e in RE}function PL(e){typeof e.ease=="string"&&DL(e.ease)&&(e.ease=RE[e.ease])}const Bm=10;class _L extends AE{constructor(t){PL(t),bE(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:s,onUpdate:r,onComplete:o,element:c,...u}=this.options;if(!s)return;if(t!==void 0){s.set(t);return}const f=new jd({...u,autoplay:!1}),h=Math.max(Bm,fn.now()-this.startTime),m=Ds(0,Bm,h-Bm),p=f.sample(h).value,{name:x}=this.options;c&&x&&SE(c,x,p),s.setWithVelocity(f.sample(Math.max(0,h-m)).value,p,m),f.stop()}}const w1=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(fs.test(e)||e==="0")&&!e.startsWith("url("));function LL(e){const t=e[0];if(e.length===1)return!0;for(let s=0;s<e.length;s++)if(e[s]!==t)return!0}function UL(e,t,s,r){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const c=e[e.length-1],u=w1(o,t),f=w1(c,t);return!u||!f?!1:LL(e)||(s==="spring"||TE(s))&&r}function Gp(e){e.duration=0,e.type="keyframes"}const kE=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),IL=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function zL(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&IL.test(e[t]))return!0;return!1}const FL=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),VL=XC(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function BL(e){const{motionValue:t,name:s,repeatDelay:r,repeatType:o,damping:c,type:u,keyframes:f}=e,h=t?.owner?.current;if(!(h instanceof HTMLElement)&&!(h instanceof SVGElement))return!1;const{onUpdate:m,transformTemplate:p}=t.owner.getProps();return VL()&&s&&(kE.has(s)||FL.has(s)&&zL(f))&&(s!=="transform"||!p)&&!m&&!r&&o!=="mirror"&&c!==0&&u!=="inertia"}const $L=40;class qL extends xx{constructor({autoplay:t=!0,delay:s=0,type:r="keyframes",repeat:o=0,repeatDelay:c=0,repeatType:u="loop",keyframes:f,name:h,motionValue:m,element:p,...x}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=fn.now();const v={autoplay:t,delay:s,type:r,repeat:o,repeatDelay:c,repeatType:u,name:h,motionValue:m,element:p,...x},j=p?.KeyframeResolver||yx;this.keyframeResolver=new j(f,(w,C,S)=>this.onKeyframesResolved(w,C,v,!S),h,m,p),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,s,r,o){this.keyframeResolver=void 0;const{name:c,type:u,velocity:f,delay:h,isHandoff:m,onUpdate:p}=r;this.resolvedAt=fn.now();let x=!0;UL(t,c,u,f)||(x=!1,(ni.instantAnimations||!h)&&p?.(tf(t,r,s)),t[0]=t[t.length-1],Gp(r),r.repeat=0);const j={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>$L?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:s,...r,keyframes:t},w=x&&!m&&BL(j),C=j.motionValue?.owner?.current;let S;if(w)try{S=new _L({...j,element:C})}catch{S=new jd(j)}else S=new jd(j);S.finished.then(()=>{this.notifyFinished()}).catch(ts),this.pendingTimeline&&(this.stopTimeline=S.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=S}get finished(){return this._animation?this.animation.finished:this._finished}then(t,s){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),TL()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function ME(e,t,s,r=0,o=1){const c=Array.from(e).sort((m,p)=>m.sortNodePosition(p)).indexOf(t),u=e.size,f=(u-1)*r;return typeof s=="function"?s(c,u):o===1?c*r:f-c*r}const j1=30,HL=e=>!isNaN(parseFloat(e));class KL{constructor(t,s={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const o=fn.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const c of this.dependents)c.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=s.owner}setCurrent(t){this.current=t,this.updatedAt=fn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=HL(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,s){this.events[t]||(this.events[t]=new cx);const r=this.events[t].add(s);return t==="change"?()=>{r(),lt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,s){this.passiveEffect=t,this.stopPassiveEffect=s}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,s,r){this.set(s),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,s=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,s&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=fn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>j1)return 0;const s=Math.min(this.updatedAt-this.prevUpdatedAt,j1);return ZC(parseFloat(this.current)-parseFloat(this.prevFrameValue),s)}start(t){return this.stop(),new Promise(s=>{this.hasAnimated=!0,this.animation=t(s),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function so(e,t){return new KL(e,t)}function OE(e,t){if(e?.inherit&&t){const{inherit:s,...r}=e;return{...t,...r}}return e}function vx(e,t){const s=e?.[t]??e?.default??e;return s!==e?OE(s,e):s}const GL={type:"spring",stiffness:500,damping:25,restSpeed:10},YL=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),QL={type:"keyframes",duration:.8},WL={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},XL=(e,{keyframes:t})=>t.length>2?QL:xo.has(e)?e.startsWith("scale")?YL(t[1]):GL:WL,ZL=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function JL(e){for(const t in e)if(!ZL.has(t))return!0;return!1}const bx=(e,t,s,r={},o,c)=>u=>{const f=vx(r,e)||{},h=f.delay||r.delay||0;let{elapsed:m=0}=r;m=m-Un(h);const p={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:t.getVelocity(),...f,delay:-m,onUpdate:v=>{t.set(v),f.onUpdate&&f.onUpdate(v)},onComplete:()=>{u(),f.onComplete&&f.onComplete()},name:e,motionValue:t,element:c?void 0:o};JL(f)||Object.assign(p,XL(e,p)),p.duration&&(p.duration=Un(p.duration)),p.repeatDelay&&(p.repeatDelay=Un(p.repeatDelay)),p.from!==void 0&&(p.keyframes[0]=p.from);let x=!1;if((p.type===!1||p.duration===0&&!p.repeatDelay)&&(Gp(p),p.delay===0&&(x=!0)),(ni.instantAnimations||ni.skipAnimations||o?.shouldSkipAnimations||f.skipAnimations)&&(x=!0,Gp(p),p.delay=0),p.allowFlatten=!f.type&&!f.ease,x&&!c&&t.get()!==void 0){const v=tf(p.keyframes,f);if(v!==void 0){lt.update(()=>{p.onUpdate(v),p.onComplete()});return}}return f.isSync?new jd(p):new qL(p)},eU=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function tU(e){const t=eU.exec(e);if(!t)return[,];const[,s,r,o]=t;return[`--${s??r}`,o]}function DE(e,t,s=1){const[r,o]=tU(e);if(!r)return;const c=window.getComputedStyle(t).getPropertyValue(r);if(c){const u=c.trim();return YC(u)?parseFloat(u):u}return fx(o)?DE(o,t,s+1):o}function S1(e){const t=[{},{}];return e?.values.forEach((s,r)=>{t[0][r]=s.get(),t[1][r]=s.getVelocity()}),t}function wx(e,t,s,r){if(typeof t=="function"){const[o,c]=S1(r);t=t(s!==void 0?s:e.custom,o,c)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,c]=S1(r);t=t(s!==void 0?s:e.custom,o,c)}return t}function Vi(e,t,s){const r=e.getProps();return wx(r,t,s!==void 0?s:r.custom,e)}const PE=new Set(["width","height","top","left","right","bottom",...go]),Yp=e=>Array.isArray(e);function nU(e,t,s){e.hasValue(t)?e.getValue(t).set(s):e.addValue(t,so(s))}function sU(e){return Yp(e)?e[e.length-1]||0:e}function rU(e,t){const s=Vi(e,t);let{transitionEnd:r={},transition:o={},...c}=s||{};c={...c,...r};for(const u in c){const f=sU(c[u]);nU(e,u,f)}}const en=e=>!!(e&&e.getVelocity);function iU(e){return!!(en(e)&&e.add)}function Qp(e,t){const s=e.getValue("willChange");if(iU(s))return s.add(t);if(!s&&ni.WillChange){const r=new ni.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function jx(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const aU="framerAppearId",_E="data-"+jx(aU);function LE(e){return e.props[_E]}function oU({protectedKeys:e,needsAnimating:t},s){const r=e.hasOwnProperty(s)&&t[s]!==!0;return t[s]=!1,r}function UE(e,t,{delay:s=0,transitionOverride:r,type:o}={}){let{transition:c,transitionEnd:u,...f}=t;const h=e.getDefaultTransition();c=c?OE(c,h):h;const m=c?.reduceMotion,p=c?.skipAnimations;r&&(c=r);const x=[],v=o&&e.animationState&&e.animationState.getState()[o],j=c?.path;j&&j.animateVisualElement(e,f,c,s,x);for(const w in f){const C=e.getValue(w,e.latestValues[w]??null),S=f[w];if(S===void 0||v&&oU(v,w))continue;const N={delay:s,...vx(c||{},w)};p&&(N.skipAnimations=!0);const E=C.get();if(E!==void 0&&!C.isAnimating()&&!Array.isArray(S)&&S===E&&!N.velocity){lt.update(()=>C.set(S));continue}let R=!1;if(window.MotionHandoffAnimation){const _=LE(e);if(_){const F=window.MotionHandoffAnimation(_,w,lt);F!==null&&(N.startTime=F,R=!0)}}Qp(e,w);const D=m??e.shouldReduceMotion;C.start(bx(w,C,S,D&&PE.has(w)?{type:!1}:N,e,R));const A=C.animation;A&&x.push(A)}if(u){const w=()=>lt.update(()=>{u&&rU(e,u)});x.length?Promise.all(x).then(w):w()}return x}function Wp(e,t,s={}){const r=Vi(e,t,s.type==="exit"?e.presenceContext?.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};s.transitionOverride&&(o=s.transitionOverride);const c=r?()=>Promise.all(UE(e,r,s)):()=>Promise.resolve(),u=e.variantChildren&&e.variantChildren.size?(h=0)=>{const{delayChildren:m=0,staggerChildren:p,staggerDirection:x}=o;return lU(e,t,h,m,p,x,s)}:()=>Promise.resolve(),{when:f}=o;if(f){const[h,m]=f==="beforeChildren"?[c,u]:[u,c];return h().then(()=>m())}else return Promise.all([c(),u(s.delay)])}function lU(e,t,s=0,r=0,o=0,c=1,u){const f=[];for(const h of e.variantChildren)h.notify("AnimationStart",t),f.push(Wp(h,t,{...u,delay:s+(typeof r=="function"?0:r)+ME(e.variantChildren,h,r,o,c)}).then(()=>h.notify("AnimationComplete",t)));return Promise.all(f)}function cU(e,t,s={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(c=>Wp(e,c,s));r=Promise.all(o)}else if(typeof t=="string")r=Wp(e,t,s);else{const o=typeof t=="function"?Vi(e,t,s.custom):t;r=Promise.all(UE(e,o,s))}return r.then(()=>{e.notify("AnimationComplete",t)})}const uU={test:e=>e==="auto",parse:e=>e},IE=e=>t=>t.test(e),zE=[po,he,As,tr,L6,_6,uU],N1=e=>zE.find(IE(e));function dU(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||WC(e):!0}const fU=new Set(["brightness","contrast","saturate","opacity"]);function hU(e){const[t,s]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=s.match(hx)||[];if(!r)return e;const o=s.replace(r,"");let c=fU.has(t)?1:0;return r!==s&&(c*=100),t+"("+c+o+")"}const mU=/\b([a-z-]*)\(.*?\)/gu,Xp={...fs,getAnimatableNone:e=>{const t=e.match(mU);return t?t.map(hU).join(" "):e}},Zp={...fs,getAnimatableNone:e=>{const t=fs.parse(e);return fs.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},C1={...po,transform:Math.round},pU={rotate:tr,pathRotation:tr,rotateX:tr,rotateY:tr,rotateZ:tr,scale:Nu,scaleX:Nu,scaleY:Nu,scaleZ:Nu,skew:tr,skewX:tr,skewY:tr,distance:he,translateX:he,translateY:he,translateZ:he,x:he,y:he,z:he,perspective:he,transformPerspective:he,opacity:ql,originX:d1,originY:d1,originZ:he},Sd={borderWidth:he,borderTopWidth:he,borderRightWidth:he,borderBottomWidth:he,borderLeftWidth:he,borderRadius:he,borderTopLeftRadius:he,borderTopRightRadius:he,borderBottomRightRadius:he,borderBottomLeftRadius:he,width:he,maxWidth:he,height:he,maxHeight:he,top:he,right:he,bottom:he,left:he,inset:he,insetBlock:he,insetBlockStart:he,insetBlockEnd:he,insetInline:he,insetInlineStart:he,insetInlineEnd:he,padding:he,paddingTop:he,paddingRight:he,paddingBottom:he,paddingLeft:he,paddingBlock:he,paddingBlockStart:he,paddingBlockEnd:he,paddingInline:he,paddingInlineStart:he,paddingInlineEnd:he,margin:he,marginTop:he,marginRight:he,marginBottom:he,marginLeft:he,marginBlock:he,marginBlockStart:he,marginBlockEnd:he,marginInline:he,marginInlineStart:he,marginInlineEnd:he,fontSize:he,backgroundPositionX:he,backgroundPositionY:he,...pU,zIndex:C1,fillOpacity:ql,strokeOpacity:ql,numOctaves:C1},gU={...Sd,color:At,backgroundColor:At,outlineColor:At,fill:At,stroke:At,borderColor:At,borderTopColor:At,borderRightColor:At,borderBottomColor:At,borderLeftColor:At,filter:Xp,WebkitFilter:Xp,mask:Zp,WebkitMask:Zp},FE=e=>gU[e],xU=new Set([Xp,Zp]);function VE(e,t){let s=FE(e);return xU.has(s)||(s=fs),s.getAnimatableNone?s.getAnimatableNone(t):void 0}
vendor: 1,699 bytes, line 10
10const yU=new Set(["auto","none","0"]);function vU(e,t,s){let r=0,o;for(;r<e.length&&!o;){const c=e[r];typeof c=="string"&&!yU.has(c)&&no(c).values.length&&(o=e[r]),r++}if(o&&s)for(const c of t)e[c]=VE(s,o)}class bU extends yx{constructor(t,s,r,o,c){super(t,s,r,o,c,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:s,name:r}=this;if(!s||!s.current)return;super.readKeyframes();for(let p=0;p<t.length;p++){let x=t[p];if(typeof x=="string"&&(x=x.trim(),fx(x))){const v=DE(x,s.current);v!==void 0&&(t[p]=v),p===t.length-1&&(this.finalKeyframe=x)}}if(this.resolveNoneKeyframes(),!PE.has(r)||t.length!==2)return;const[o,c]=t,u=N1(o),f=N1(c),h=u1(o),m=u1(c);if(h!==m&&Yr[r]){this.needsMeasurement=!0;return}if(u!==f)if(v1(u)&&v1(f))for(let p=0;p<t.length;p++){const x=t[p];typeof x=="string"&&(t[p]=parseFloat(x))}else Yr[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:s}=this,r=[];for(let o=0;o<t.length;o++)(t[o]===null||dU(t[o]))&&r.push(o);r.length&&vU(t,r,s)}measureInitialState(){const{element:t,unresolvedKeyframes:s,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Yr[r](t.measureViewportBox(),window.getComputedStyle(t.current)),s[0]=this.measuredOrigin;const o=s[s.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){const{element:t,name:s,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const o=t.getValue(s);o&&o.jump(this.measuredOrigin,!1);const c=r.length-1,u=r[c];r[c]=Yr[s](t.measureViewportBox(),window.getComputedStyle(t.current)),u!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=u),this.removedTransforms?.length&&this.removedTransforms.forEac
vendor: 50,232 bytes, line 10
10h(([f,h])=>{t.getValue(f).set(h)}),this.resolveNoneKeyframes()}}const Sx=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function BE(e,t,s){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const o=s?.[e]??r.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e).filter(r=>r!=null)}const Jp=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Gu(e){return QC(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Nx}=cE(queueMicrotask,!1),us={x:!1,y:!1};function $E(){return us.x||us.y}function wU(e){return e==="x"||e==="y"?us[e]?null:(us[e]=!0,()=>{us[e]=!1}):us.x||us.y?null:(us.x=us.y=!0,()=>{us.x=us.y=!1})}function qE(e,t){const s=BE(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[s,o,()=>r.abort()]}function jU(e){return!(e.pointerType==="touch"||$E())}function SU(e,t,s={}){const[r,o,c]=qE(e,s);return r.forEach(u=>{let f=!1,h=!1,m;const p=()=>{u.removeEventListener("pointerleave",w)},x=S=>{m&&(m(S),m=void 0),p()},v=S=>{f=!1,window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",v),h&&(h=!1,x(S))},j=()=>{f=!0,window.addEventListener("pointerup",v,o),window.addEventListener("pointercancel",v,o)},w=S=>{if(S.pointerType!=="touch"){if(f){h=!0;return}x(S)}},C=S=>{if(!jU(S))return;h=!1;const N=t(u,S);typeof N=="function"&&(m=N,u.addEventListener("pointerleave",w,o))};u.addEventListener("pointerenter",C,o),u.addEventListener("pointerdown",j,o)}),c}const HE=(e,t)=>t?e===t?!0:HE(e,t.parentElement):!1,Cx=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,NU=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function CU(e){return NU.has(e.tagName)||e.isContentEditable===!0}const EU=new Set(["INPUT","SELECT","TEXTAREA"]);function TU(e){return EU.has(e.tagName)||e.isContentEditable===!0}const Yu=new WeakSet;function E1(e){return t=>{t.key==="Enter"&&e(t)}}function $m(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const AU=(e,t)=>{const s=e.currentTarget;if(!s)return;const r=E1(()=>{if(Yu.has(s))return;$m(s,"down");const o=E1(()=>{$m(s,"up")}),c=()=>$m(s,"cancel");s.addEventListener("keyup",o,t),s.addEventListener("blur",c,t)});s.addEventListener("keydown",r,t),s.addEventListener("blur",()=>s.removeEventListener("keydown",r),t)};function T1(e){return Cx(e)&&!$E()}const A1=new WeakSet;function RU(e,t,s={}){const[r,o,c]=qE(e,s),u=f=>{const h=f.currentTarget;if(!T1(f)||A1.has(f))return;Yu.add(h),s.stopPropagation&&A1.add(f);const m=t(h,f),p={...o,capture:!0},x=(w,C)=>{window.removeEventListener("pointerup",v,p),window.removeEventListener("pointercancel",j,p),Yu.has(h)&&Yu.delete(h),T1(w)&&typeof m=="function"&&m(w,{success:C})},v=w=>{x(w,h===window||h===document||s.useGlobalTarget||HE(h,w.target))},j=w=>{x(w,!1)};window.addEventListener("pointerup",v,p),window.addEventListener("pointercancel",j,p)};return r.forEach(f=>{(s.useGlobalTarget?window:f).addEventListener("pointerdown",u,o),Gu(f)&&(f.addEventListener("focus",m=>AU(m,o)),!CU(f)&&!f.hasAttribute("tabindex")&&(f.tabIndex=0))}),c}function Ex(e){return QC(e)&&"ownerSVGElement"in e}const Qu=new WeakMap;let Wu;const KE=(e,t,s)=>(r,o)=>o&&o[0]?o[0][e+"Size"]:Ex(r)&&"getBBox"in r?r.getBBox()[t]:r[s],kU=KE("inline","width","offsetWidth"),MU=KE("block","height","offsetHeight");function OU({target:e,borderBoxSize:t}){Qu.get(e)?.forEach(s=>{s(e,{get width(){return kU(e,t)},get height(){return MU(e,t)}})})}function DU(e){e.forEach(OU)}function PU(){typeof ResizeObserver>"u"||(Wu=new ResizeObserver(DU))}function _U(e,t){Wu||PU();const s=BE(e);return s.forEach(r=>{let o=Qu.get(r);o||(o=new Set,Qu.set(r,o)),o.add(t),Wu?.observe(r)}),()=>{s.forEach(r=>{const o=Qu.get(r);o?.delete(t),o?.size||Wu?.unobserve(r)})}}const Xu=new Set;let Ya;function LU(){Ya=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Xu.forEach(t=>t(e))},window.addEventListener("resize",Ya)}function UU(e){return Xu.add(e),Ya||LU(),()=>{Xu.delete(e),!Xu.size&&typeof Ya=="function"&&(window.removeEventListener("resize",Ya),Ya=void 0)}}function R1(e,t){return typeof e=="function"?UU(e):_U(e,t)}function IU(e){return Ex(e)&&e.tagName==="svg"}const zU=[...zE,At,fs],FU=e=>zU.find(IE(e)),k1=()=>({translate:0,scale:1,origin:0,originPoint:0}),Qa=()=>({x:k1(),y:k1()}),M1=()=>({min:0,max:0}),Lt=()=>({x:M1(),y:M1()}),VU=new WeakMap;function nf(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Hl(e){return typeof e=="string"||Array.isArray(e)}const Tx=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ax=["initial",...Tx];function sf(e){return nf(e.animate)||Ax.some(t=>Hl(e[t]))}function GE(e){return!!(sf(e)||e.variants)}function BU(e,t,s){for(const r in t){const o=t[r],c=s[r];if(en(o))e.addValue(r,o);else if(en(c))e.addValue(r,so(o,{owner:e}));else if(c!==o)if(e.hasValue(r)){const u=e.getValue(r);u.liveStyle===!0?u.jump(o):u.hasAnimated||u.set(o)}else{const u=e.getStaticValue(r);e.addValue(r,so(u!==void 0?u:o,{owner:e}))}}for(const r in s)t[r]===void 0&&e.removeValue(r);return t}const Nd={current:null},Rx={current:!1},$U=typeof window<"u";function YE(){if(Rx.current=!0,!!$U)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Nd.current=e.matches;e.addEventListener("change",t),t()}else Nd.current=!1}const O1=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Cd={};function QE(e){Cd=e}function qU(){return Cd}class HU{scrapeMotionValuesFromProps(t,s,r){return{}}constructor({parent:t,props:s,presenceContext:r,reducedMotionConfig:o,skipAnimations:c,blockInitialAnimation:u,visualState:f},h={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=yx,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const j=fn.now();this.renderScheduledAt<j&&(this.renderScheduledAt=j,lt.render(this.render,!1,!0))};const{latestValues:m,renderState:p}=f;this.latestValues=m,this.baseTarget={...m},this.initialValues=s.initial?{...m}:{},this.renderState=p,this.parent=t,this.props=s,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.skipAnimationsConfig=c,this.options=h,this.blockInitialAnimation=!!u,this.isControllingVariants=sf(s),this.isVariantNode=GE(s),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:x,...v}=this.scrapeMotionValuesFromProps(s,{},this);for(const j in v){const w=v[j];m[j]!==void 0&&en(w)&&w.set(m[j])}}mount(t){if(this.hasBeenMounted)for(const s in this.initialValues)this.values.get(s)?.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=t,VU.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,r)=>this.bindToMotionValue(r,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Rx.current||YE(),this.shouldReduceMotion=Nd.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),si(this.notifyUpdate),si(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const s=this.features[t];s&&(s.unmount(),s.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,s){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),s.accelerate&&kE.has(t)&&this.current instanceof HTMLElement){const{factory:u,keyframes:f,times:h,ease:m,duration:p}=s.accelerate,x=new AE({element:this.current,name:t,keyframes:f,times:h,ease:m,duration:Un(p)}),v=u(x);this.valueSubscriptions.set(t,()=>{v(),x.cancel()});return}const r=xo.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=s.on("change",u=>{this.latestValues[t]=u,this.props.onUpdate&&lt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let c;typeof window<"u"&&window.MotionCheckAppearSync&&(c=window.MotionCheckAppearSync(this,t,s)),this.valueSubscriptions.set(t,()=>{o(),c&&c()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Cd){const s=Cd[t];if(!s)continue;const{isEnabled:r,Feature:o}=s;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const c=this.features[t];c.isMounted?c.update():(c.mount(),c.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Lt()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,s){this.latestValues[t]=s}update(t,s){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=s;for(let r=0;r<O1.length;r++){const o=O1[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const c="on"+o,u=t[c];u&&(this.propEventSubscriptions[o]=this.on(o,u))}this.prevMotionValues=BU(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const s=this.getClosestVariantNode();if(s)return s.variantChildren&&s.variantChildren.add(t),()=>s.variantChildren.delete(t)}addValue(t,s){const r=this.values.get(t);s!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,s),this.values.set(t,s),this.latestValues[t]=s.get())}removeValue(t){this.values.delete(t);const s=this.valueSubscriptions.get(t);s&&(s(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,s){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&s!==void 0&&(r=so(s===null?void 0:s,{owner:this}),this.addValue(t,r)),r}readValue(t,s){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(YC(r)||WC(r))?r=parseFloat(r):!FU(r)&&fs.test(s)&&(r=VE(t,s)),this.setBaseTarget(t,en(r)?r.get():r)),en(r)?r.get():r}setBaseTarget(t,s){this.baseTarget[t]=s}getBaseTarget(t){const{initial:s}=this.props;let r;if(typeof s=="string"||typeof s=="object"){const c=wx(this.props,s,this.presenceContext?.custom);c&&(r=c[t])}if(s&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!en(o)?o:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,s){return this.events[t]||(this.events[t]=new cx),this.events[t].add(s)}notify(t,...s){this.events[t]&&this.events[t].notify(...s)}scheduleRenderMicrotask(){Nx.render(this.render)}}class WE extends HU{constructor(){super(...arguments),this.KeyframeResolver=bU}sortInstanceNodePosition(t,s){return t.compareDocumentPosition(s)&2?1:-1}getBaseTargetFromProps(t,s){const r=t.style;return r?r[s]:void 0}removeValueFromRenderState(t,{vars:s,style:r}){delete s[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;en(t)&&(this.childSubscription=t.on("change",s=>{this.current&&(this.current.textContent=`${s}`)}))}}class ci{constructor(t){this.isMounted=!1,this.node=t}update(){}}function XE({top:e,left:t,right:s,bottom:r}){return{x:{min:t,max:s},y:{min:e,max:r}}}function KU({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function GU(e,t){if(!t)return e;const s=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:s.y,left:s.x,bottom:r.y,right:r.x}}function qm(e){return e===void 0||e===1}function eg({scale:e,scaleX:t,scaleY:s}){return!qm(e)||!qm(t)||!qm(s)}function Pi(e){return eg(e)||ZE(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function ZE(e){return D1(e.x)||D1(e.y)}function D1(e){return e&&e!=="0%"}function Ed(e,t,s){const r=e-s,o=t*r;return s+o}function P1(e,t,s,r,o){return o!==void 0&&(e=Ed(e,o,r)),Ed(e,s,r)+t}function tg(e,t=0,s=1,r,o){e.min=P1(e.min,t,s,r,o),e.max=P1(e.max,t,s,r,o)}function JE(e,{x:t,y:s}){tg(e.x,t.translate,t.scale,t.originPoint),tg(e.y,s.translate,s.scale,s.originPoint)}const _1=.999999999999,L1=1.0000000000001;function YU(e,t,s,r=!1){const o=s.length;if(!o)return;t.x=t.y=1;let c,u;for(let f=0;f<o;f++){c=s[f],u=c.projectionDelta;const{visualElement:h}=c.options;h&&h.props.style&&h.props.style.display==="contents"||(r&&c.options.layoutScroll&&c.scroll&&c!==c.root&&(Ns(e.x,-c.scroll.offset.x),Ns(e.y,-c.scroll.offset.y)),u&&(t.x*=u.x.scale,t.y*=u.y.scale,JE(e,u)),r&&Pi(c.latestValues)&&Zu(e,c.latestValues,c.layout?.layoutBox))}t.x<L1&&t.x>_1&&(t.x=1),t.y<L1&&t.y>_1&&(t.y=1)}function Ns(e,t){e.min+=t,e.max+=t}function U1(e,t,s,r,o=.5){const c=ot(e.min,e.max,o);tg(e,t,s,c,r)}function I1(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Zu(e,t,s){const r=s??e;U1(e.x,I1(t.x,r.x),t.scaleX,t.scale,t.originX),U1(e.y,I1(t.y,r.y),t.scaleY,t.scale,t.originY)}function eT(e,t){return XE(GU(e.getBoundingClientRect(),t))}function QU(e,t,s){const r=eT(e,s),{scroll:o}=t;return o&&(Ns(r.x,o.offset.x),Ns(r.y,o.offset.y)),r}const WU={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},XU=go.length;function ZU(e,t,s){let r="",o=!0;for(let u=0;u<XU;u++){const f=go[u],h=e[f];if(h===void 0)continue;let m=!0;if(typeof h=="number")m=h===(f.startsWith("scale")?1:0);else{const p=parseFloat(h);m=f.startsWith("scale")?p===1:p===0}if(!m||s){const p=Jp(h,Sd[f]);if(!m){o=!1;const x=WU[f]||f;r+=`${x}(${p}) `}s&&(t[f]=p)}}const c=e.pathRotation;return c&&(o=!1,r+=`rotate(${Jp(c,Sd.pathRotation)}) `),r=r.trim(),s?r=s(t,o?"":r):o&&(r="none"),r}function kx(e,t,s){const{style:r,vars:o,transformOrigin:c}=e;let u=!1,f=!1;for(const h in t){const m=t[h];if(xo.has(h)){u=!0;continue}else if(dE(h)){o[h]=m;continue}else{const p=Jp(m,Sd[h]);h.startsWith("origin")?(f=!0,c[h]=p):r[h]=p}}if(t.transform||(u||s?r.transform=ZU(t,e.transform,s):r.transform&&(r.transform="none")),f){const{originX:h="50%",originY:m="50%",originZ:p=0}=c;r.transformOrigin=`${h} ${m} ${p}`}}function tT(e,{style:t,vars:s},r,o){const c=e.style;let u;for(u in t)c[u]=t[u];o?.applyProjectionStyles(c,r);for(u in s)c.setProperty(u,s[u])}function z1(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const xl={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(he.test(e))e=parseFloat(e);else return e;const s=z1(e,t.target.x),r=z1(e,t.target.y);return`${s}% ${r}%`}},JU={correct:(e,{treeScale:t,projectionDelta:s})=>{const r=e,o=fs.parse(e);if(o.length>5)return r;const c=fs.createTransformer(e),u=typeof o[0]!="number"?1:0,f=s.x.scale*t.x,h=s.y.scale*t.y;o[0+u]/=f,o[1+u]/=h;const m=ot(f,h,.5);return typeof o[2+u]=="number"&&(o[2+u]/=m),typeof o[3+u]=="number"&&(o[3+u]/=m),c(o)}},ng={borderRadius:{...xl,applyTo:[...Sx]},borderTopLeftRadius:xl,borderTopRightRadius:xl,borderBottomLeftRadius:xl,borderBottomRightRadius:xl,boxShadow:JU};function nT(e,{layout:t,layoutId:s}){return xo.has(e)||e.startsWith("origin")||(t||s!==void 0)&&(!!ng[e]||e==="opacity")}function Mx(e,t,s){const r=e.style,o=t?.style,c={};if(!r)return c;for(const u in r)(en(r[u])||o&&en(o[u])||nT(u,e)||s?.getValue(u)?.liveStyle!==void 0)&&(c[u]=r[u]);return c}function eI(e){return window.getComputedStyle(e)}class tI extends WE{constructor(){super(...arguments),this.type="html",this.renderInstance=tT}mount(t){ef(!!t.style),super.mount(t)}readValueFromInstance(t,s){if(xo.has(s))return this.projection?.isProjecting?Bp(s):jL(t,s);{const r=eI(t),o=(dE(s)?r.getPropertyValue(s):r[s])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:s}){return eT(t,s)}build(t,s,r){kx(t,s,r.transformTemplate)}scrapeMotionValuesFromProps(t,s,r){return Mx(t,s,r)}}const nI={offset:"stroke-dashoffset",array:"stroke-dasharray"},sI={offset:"strokeDashoffset",array:"strokeDasharray"};function rI(e,t,s=1,r=0,o=!0){e.pathLength=1;const c=o?nI:sI;e[c.offset]=`${-r}`,e[c.array]=`${t} ${s}`}const iI=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function sT(e,{attrX:t,attrY:s,attrScale:r,pathLength:o,pathSpacing:c=1,pathOffset:u=0,...f},h,m,p){if(kx(e,f,m),h){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:x,style:v}=e;x.transform&&(v.transform=x.transform,delete x.transform),(v.transform||x.transformOrigin)&&(v.transformOrigin=x.transformOrigin??"50% 50%",delete x.transformOrigin),v.transform&&(v.transformBox=p?.transformBox??"fill-box",delete x.transformBox);for(const j of iI)x[j]!==void 0&&(v[j]=x[j],delete x[j]);t!==void 0&&(x.x=t),s!==void 0&&(x.y=s),r!==void 0&&(x.scale=r),o!==void 0&&rI(x,o,c,u,!1)}const rT=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),iT=e=>typeof e=="string"&&e.toLowerCase()==="svg";function aI(e,t,s,r){tT(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(rT.has(o)?o:jx(o),t.attrs[o])}function aT(e,t,s){const r=Mx(e,t,s);for(const o in e)if(en(e[o])||en(t[o])){const c=go.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[c]=e[o]}return r}class oI extends WE{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Lt}getBaseTargetFromProps(t,s){return t[s]}readValueFromInstance(t,s){if(xo.has(s)){const r=FE(s);return r&&r.default||0}return s=rT.has(s)?s:jx(s),t.getAttribute(s)}scrapeMotionValuesFromProps(t,s,r){return aT(t,s,r)}build(t,s,r){sT(t,s,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,s,r,o){aI(t,s,r,o)}mount(t){this.isSVGTag=iT(t.tagName),super.mount(t)}}const lI=Ax.length;function oT(e){if(!e)return;if(!e.isControllingVariants){const s=e.parent?oT(e.parent)||{}:{};return e.props.initial!==void 0&&(s.initial=e.props.initial),s}const t={};for(let s=0;s<lI;s++){const r=Ax[s],o=e.props[r];(Hl(o)||o===!1)&&(t[r]=o)}return t}function lT(e,t){if(!Array.isArray(t))return!1;const s=t.length;if(s!==e.length)return!1;for(let r=0;r<s;r++)if(t[r]!==e[r])return!1;return!0}const cI=[...Tx].reverse(),uI=Tx.length;function dI(e){return t=>Promise.all(t.map(({animation:s,options:r})=>cU(e,s,r)))}function fI(e){let t=dI(e),s=F1(),r=!0,o=!1;const c=m=>(p,x)=>{const v=Vi(e,x,m==="exit"?e.presenceContext?.custom:void 0);if(v){const{transition:j,transitionEnd:w,...C}=v;p={...p,...C,...w}}return p};function u(m){t=m(e)}function f(m){const{props:p}=e,x=oT(e.parent)||{},v=[],j=new Set;let w={},C=1/0;for(let N=0;N<uI;N++){const E=cI[N],R=s[E],D=p[E]!==void 0?p[E]:x[E],A=Hl(D),_=E===m?R.isActive:null;_===!1&&(C=N);let F=D===x[E]&&D!==p[E]&&A;if(F&&(r||o)&&e.manuallyAnimateOnMount&&(F=!1),R.protectedKeys={...w},!R.isActive&&_===null||!D&&!R.prevProp||nf(D)||typeof D=="boolean")continue;if(E==="exit"&&R.isActive&&_!==!0){R.prevResolvedValues&&(w={...w,...R.prevResolvedValues});continue}const O=hI(R.prevProp,D);let I=O||E===m&&R.isActive&&!F&&A||N>C&&A,V=!1;const H=Array.isArray(D)?D:[D];let k=H.reduce(c(E),{});_===!1&&(k={});const{prevResolvedValues:q={}}=R,J={...q,...k},re=z=>{I=!0,j.has(z)&&(V=!0,j.delete(z)),R.needsAnimating[z]=!0;const W=e.getValue(z);W&&(W.liveStyle=!1)};for(const z in J){const W=k[z],M=q[z];if(w.hasOwnProperty(z))continue;let K=!1;Yp(W)&&Yp(M)?K=!lT(W,M)||O:K=W!==M,K?W!=null?re(z):j.add(z):W!==void 0&&j.has(z)?re(z):R.protectedKeys[z]=!0}R.prevProp=D,R.prevResolvedValues=k,R.isActive&&(w={...w,...k}),(r||o)&&e.blockInitialAnimation&&(I=!1);const U=F&&O;I&&(!U||V)&&v.push(...H.map(z=>{const W={type:E};if(typeof z=="string"&&(r||o)&&!U&&e.manuallyAnimateOnMount&&e.parent){const{parent:M}=e,K=Vi(M,z);if(M.enteringChildren&&K){const{delayChildren:ie}=K.transition||{};W.delay=ME(M.enteringChildren,e,ie)}}return{animation:z,options:W}}))}if(j.size){const N={};if(typeof p.initial!="boolean"){const E=Vi(e,Array.isArray(p.initial)?p.initial[0]:p.initial);E&&E.transition&&(N.transition=E.transition)}j.forEach(E=>{const R=e.getBaseTarget(E),D=e.getValue(E);D&&(D.liveStyle=!0),N[E]=R??null}),v.push({animation:N})}let S=!!v.length;return r&&(p.initial===!1||p.initial===p.animate)&&!e.manuallyAnimateOnMount&&(S=!1),r=!1,o=!1,S?t(v):Promise.resolve()}function h(m,p){if(s[m].isActive===p)return Promise.resolve();e.variantChildren?.forEach(v=>v.animationState?.setActive(m,p)),s[m].isActive=p;const x=f(m);for(const v in s)s[v].protectedKeys={};return x}return{animateChanges:f,setActive:h,setAnimateFunction:u,getState:()=>s,reset:()=>{s=F1(),o=!0}}}function hI(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!lT(t,e):!1}function Di(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function F1(){return{animate:Di(!0),whileInView:Di(),whileHover:Di(),whileTap:Di(),whileDrag:Di(),whileFocus:Di(),exit:Di()}}function sg(e,t){e.min=t.min,e.max=t.max}function cs(e,t){sg(e.x,t.x),sg(e.y,t.y)}function V1(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const cT=1e-4,mI=1-cT,pI=1+cT,uT=.01,gI=0-uT,xI=0+uT;function hn(e){return e.max-e.min}function yI(e,t,s){return Math.abs(e-t)<=s}function B1(e,t,s,r=.5){e.origin=r,e.originPoint=ot(t.min,t.max,e.origin),e.scale=hn(s)/hn(t),e.translate=ot(s.min,s.max,e.origin)-e.originPoint,(e.scale>=mI&&e.scale<=pI||isNaN(e.scale))&&(e.scale=1),(e.translate>=gI&&e.translate<=xI||isNaN(e.translate))&&(e.translate=0)}function kl(e,t,s,r){B1(e.x,t.x,s.x,r?r.originX:void 0),B1(e.y,t.y,s.y,r?r.originY:void 0)}function $1(e,t,s,r=0){const o=r?ot(s.min,s.max,r):s.min;e.min=o+t.min,e.max=e.min+hn(t)}function vI(e,t,s,r){$1(e.x,t.x,s.x,r?.x),$1(e.y,t.y,s.y,r?.y)}function q1(e,t,s,r=0){const o=r?ot(s.min,s.max,r):s.min;e.min=t.min-o,e.max=e.min+hn(t)}function Td(e,t,s,r){q1(e.x,t.x,s.x,r?.x),q1(e.y,t.y,s.y,r?.y)}function H1(e,t,s,r,o){return e-=t,e=Ed(e,1/s,r),o!==void 0&&(e=Ed(e,1/o,r)),e}function bI(e,t=0,s=1,r=.5,o,c=e,u=e){if(As.test(t)&&(t=parseFloat(t),t=ot(u.min,u.max,t/100)-u.min),typeof t!="number")return;let f=ot(c.min,c.max,r);e===c&&(f-=t),e.min=H1(e.min,t,s,f,o),e.max=H1(e.max,t,s,f,o)}function K1(e,t,[s,r,o],c,u){bI(e,t[s],t[r],t[o],t.scale,c,u)}const wI=["x","scaleX","originX"],jI=["y","scaleY","originY"];function G1(e,t,s,r){K1(e.x,t,wI,s?s.x:void 0,r?r.x:void 0),K1(e.y,t,jI,s?s.y:void 0,r?r.y:void 0)}function Y1(e){return e.translate===0&&e.scale===1}function dT(e){return Y1(e.x)&&Y1(e.y)}function Q1(e,t){return e.min===t.min&&e.max===t.max}function SI(e,t){return Q1(e.x,t.x)&&Q1(e.y,t.y)}function W1(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function fT(e,t){return W1(e.x,t.x)&&W1(e.y,t.y)}function X1(e){return hn(e.x)/hn(e.y)}function Z1(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Ss(e){return[e("x"),e("y")]}function NI(e,t,s){let r="";const o=e.x.translate/t.x,c=e.y.translate/t.y,u=s?.z||0;if((o||c||u)&&(r=`translate3d(${o}px, ${c}px, ${u}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),s){const{transformPerspective:m,rotate:p,pathRotation:x,rotateX:v,rotateY:j,skewX:w,skewY:C}=s;m&&(r=`perspective(${m}px) ${r}`),p&&(r+=`rotate(${p}deg) `),x&&(r+=`rotate(${x}deg) `),v&&(r+=`rotateX(${v}deg) `),j&&(r+=`rotateY(${j}deg) `),w&&(r+=`skewX(${w}deg) `),C&&(r+=`skewY(${C}deg) `)}const f=e.x.scale*t.x,h=e.y.scale*t.y;return(f!==1||h!==1)&&(r+=`scale(${f}, ${h})`),r||"none"}const CI=Sx.length,J1=e=>typeof e=="string"?parseFloat(e):e,ej=e=>typeof e=="number"||he.test(e);function EI(e,t,s,r,o,c){o?(e.opacity=ot(0,s.opacity??1,TI(r)),e.opacityExit=ot(t.opacity??1,0,AI(r))):c&&(e.opacity=ot(t.opacity??1,s.opacity??1,r));for(let u=0;u<CI;u++){const f=Sx[u];let h=tj(t,f),m=tj(s,f);if(h===void 0&&m===void 0)continue;h||(h=0),m||(m=0),h===0||m===0||ej(h)===ej(m)?(e[f]=Math.max(ot(J1(h),J1(m),r),0),(As.test(m)||As.test(h))&&(e[f]+="%")):e[f]=m}(t.rotate||s.rotate)&&(e.rotate=ot(t.rotate||0,s.rotate||0,r))}function tj(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const TI=hT(0,.5,iE),AI=hT(.5,.95,ts);function hT(e,t,s){return r=>r<e?0:r>t?1:s($l(e,t,r))}function RI(e,t,s){const r=en(e)?e:so(e);return r.start(bx("",r,t,s)),r.animation}function Kl(e,t,s,r={passive:!0}){return e.addEventListener(t,s,r),()=>e.removeEventListener(t,s,r)}const kI=(e,t)=>e.depth-t.depth;class MI{constructor(){this.children=[],this.isDirty=!1}add(t){lx(this.children,t),this.isDirty=!0}remove(t){yd(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(kI),this.isDirty=!1,this.children.forEach(t)}}function OI(e,t){const s=fn.now(),r=({timestamp:o})=>{const c=o-s;c>=t&&(si(r),e(c-t))};return lt.setup(r,!0),()=>si(r)}function Ju(e){return en(e)?e.get():e}class DI{constructor(){this.members=[]}add(t){lx(this.members,t);for(let s=this.members.length-1;s>=0;s--){const r=this.members[s];if(r===t||r===this.lead||r===this.prevLead)continue;const o=r.instance;(!o||o.isConnected===!1)&&!r.snapshot&&(yd(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(yd(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const s=this.members[this.members.length-1];s&&this.promote(s)}}relegate(t){for(let s=this.members.indexOf(t)-1;s>=0;s--){const r=this.members[s];if(r.isPresent!==!1&&r.instance?.isConnected!==!1)return this.promote(r),!0}return!1}promote(t,s){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.updateSnapshot(),t.scheduleRender();const{layoutDependency:o}=r.options,{layoutDependency:c}=t.options;(o===void 0||o!==c)&&(t.resumeFrom=r,s&&(r.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const ed={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Hm=["","X","Y","Z"],PI=1e3;let _I=0;function Km(e,t,s,r){const{latestValues:o}=t;o[e]&&(s[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function mT(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const s=LE(t);if(window.MotionHasOptimisedAnimation(s,"transform")){const{layout:o,layoutId:c}=e.options;window.MotionCancelOptimisedAnimation(s,"transform",lt,!(o||c))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&mT(r)}function pT({attachResizeListener:e,defaultParent:t,measureScroll:s,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(u={},f=t?.()){this.id=_I++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(II),this.nodes.forEach(qI),this.nodes.forEach(HI),this.nodes.forEach(zI)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=u,this.root=f?f.root||f:this,this.path=f?[...f.path,f]:[],this.parent=f,this.depth=f?f.depth+1:0;for(let h=0;h<this.path.length;h++)this.path[h].shouldResetTransform=!0;this.root===this&&(this.nodes=new MI)}addEventListener(u,f){return this.eventHandlers.has(u)||this.eventHandlers.set(u,new cx),this.eventHandlers.get(u).add(f)}notifyListeners(u,...f){const h=this.eventHandlers.get(u);h&&h.notify(...f)}hasListeners(u){return this.eventHandlers.has(u)}mount(u){if(this.instance)return;this.isSVG=Ex(u)&&!IU(u),this.instance=u;const{layoutId:f,layout:h,visualElement:m}=this.options;if(m&&!m.current&&m.mount(u),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(h||f)&&(this.isLayoutDirty=!0),e){let p,x=0;const v=()=>this.root.updateBlockedByResize=!1;lt.read(()=>{x=window.innerWidth}),e(u,()=>{const j=window.innerWidth;j!==x&&(x=j,this.root.updateBlockedByResize=!0,p&&p(),p=OI(v,250),ed.hasAnimatedSinceResize&&(ed.hasAnimatedSinceResize=!1,this.nodes.forEach(rj)))})}f&&this.root.registerSharedNode(f,this),this.options.animate!==!1&&m&&(f||h)&&this.addEventListener("didUpdate",({delta:p,hasLayoutChanged:x,hasRelativeLayoutChanged:v,layout:j})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const w=this.options.transition||m.getDefaultTransition()||WI,{onLayoutAnimationStart:C,onLayoutAnimationComplete:S}=m.getProps(),N=!this.targetLayout||!fT(this.targetLayout,j),E=!x&&v;if(this.options.layoutRoot||this.resumeFrom||E||x&&(N||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const R={...vx(w,"layout"),onPlay:C,onComplete:S};(m.shouldReduceMotion||this.options.layoutRoot)&&(R.delay=0,R.type=!1),this.startAnimation(R),this.setAnimationOrigin(p,E,R.path)}else x||rj(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=j})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const u=this.getStack();u&&u.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),si(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(KI),this.animationId++)}getTransformTemplate(){const{visualElement:u}=this.options;return u&&u.getProps().transformTemplate}willUpdate(u=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&mT(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let p=0;p<this.path.length;p++){const x=this.path[p];x.shouldResetTransform=!0,(typeof x.latestValues.x=="string"||typeof x.latestValues.y=="string")&&(x.isLayoutDirty=!0),x.updateScroll("snapshot"),x.options.layoutRoot&&x.willUpdate(!1)}const{layoutId:f,layout:h}=this.options;if(f===void 0&&!h)return;const m=this.getTransformTemplate();this.prevTransformTemplateValue=m?m(this.latestValues,""):void 0,this.updateSnapshot(),u&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const h=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),h&&this.nodes.forEach(VI),this.nodes.forEach(nj);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(sj);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(BI),this.nodes.forEach($I),this.nodes.forEach(LI),this.nodes.forEach(UI)):this.nodes.forEach(sj),this.clearAllSnapshots();const f=fn.now();Zt.delta=Ds(0,1e3/60,f-Zt.timestamp),Zt.timestamp=f,Zt.isProcessing=!0,Um.update.process(Zt),Um.preRender.process(Zt),Um.render.process(Zt),Zt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Nx.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(FI),this.sharedNodes.forEach(GI)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,lt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){lt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!hn(this.snapshot.measuredBox.x)&&!hn(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let h=0;h<this.path.length;h++)this.path[h].updateScroll();const u=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Lt()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:f}=this.options;f&&f.notify("LayoutMeasure",this.layout.layoutBox,u?u.layoutBox:void 0)}updateScroll(u="measure"){let f=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===u&&(f=!1),f&&this.instance){const h=r(this.instance);this.scroll={animationId:this.root.animationId,phase:u,isRoot:h,offset:s(this.instance),wasRoot:this.scroll?this.scroll.isRoot:h}}}resetTransform(){if(!o)return;const u=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,f=this.projectionDelta&&!dT(this.projectionDelta),h=this.getTransformTemplate(),m=h?h(this.latestValues,""):void 0,p=m!==this.prevTransformTemplateValue;u&&this.instance&&(f||Pi(this.latestValues)||p)&&(o(this.instance,m),this.shouldResetTransform=!1,this.scheduleRender())}measure(u=!0){const f=this.measurePageBox();let h=this.removeElementScroll(f);return u&&(h=this.removeTransform(h)),XI(h),{animationId:this.root.animationId,measuredBox:f,layoutBox:h,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:u}=this.options;if(!u)return Lt();const f=u.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(ZI))){const{scroll:m}=this.root;m&&(Ns(f.x,m.offset.x),Ns(f.y,m.offset.y))}return f}removeElementScroll(u){const f=Lt();if(cs(f,u),this.scroll?.wasRoot)return f;for(let h=0;h<this.path.length;h++){const m=this.path[h],{scroll:p,options:x}=m;m!==this.root&&p&&x.layoutScroll&&(p.wasRoot&&cs(f,u),Ns(f.x,p.offset.x),Ns(f.y,p.offset.y))}return f}applyTransform(u,f=!1,h){const m=h||Lt();cs(m,u);for(let p=0;p<this.path.length;p++){const x=this.path[p];!f&&x.options.layoutScroll&&x.scroll&&x!==x.root&&(Ns(m.x,-x.scroll.offset.x),Ns(m.y,-x.scroll.offset.y)),Pi(x.latestValues)&&Zu(m,x.latestValues,x.layout?.layoutBox)}return Pi(this.latestValues)&&Zu(m,this.latestValues,this.layout?.layoutBox),m}removeTransform(u){const f=Lt();cs(f,u);for(let h=0;h<this.path.length;h++){const m=this.path[h];if(!Pi(m.latestValues))continue;let p;m.instance&&(eg(m.latestValues)&&m.updateSnapshot(),p=Lt(),cs(p,m.measurePageBox())),G1(f,m.latestValues,m.snapshot?.layoutBox,p)}return Pi(this.latestValues)&&G1(f,this.latestValues),f}setTargetDelta(u){this.targetDelta=u,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(u){this.options={...this.options,...u,crossfade:u.crossfade!==void 0?u.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Zt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(u=!1){const f=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=f.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=f.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=f.isSharedProjectionDirty);const h=!!this.resumingFrom||this!==f;if(!(u||h&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:p,layoutId:x}=this.options;if(!this.layout||!(p||x))return;this.resolvedRelativeTargetAt=Zt.timestamp;const v=this.getClosestProjectingParent();v&&this.linkedParentVersion!==v.layoutVersion&&!v.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&v&&v.layout?this.createRelativeTarget(v,this.layout.layoutBox,v.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Lt(),this.targetWithTransforms=Lt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),vI(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):cs(this.target,this.layout.layoutBox),JE(this.target,this.targetDelta)):cs(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&v&&!!v.resumingFrom==!!this.resumingFrom&&!v.options.layoutScroll&&v.target&&this.animationProgress!==1?this.createRelativeTarget(v,this.target,v.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||eg(this.parent.latestValues)||ZE(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(u,f,h){this.relativeParent=u,this.linkedParentVersion=u.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Lt(),this.relativeTargetOrigin=Lt(),Td(this.relativeTargetOrigin,f,h,this.options.layoutAnchor||void 0),cs(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const u=this.getLead(),f=!!this.resumingFrom||this!==u;let h=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(h=!1),f&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(h=!1),this.resolvedRelativeTargetAt===Zt.timestamp&&(h=!1),h)return;const{layout:m,layoutId:p}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(m||p))return;cs(this.layoutCorrected,this.layout.layoutBox);const x=this.treeScale.x,v=this.treeScale.y;YU(this.layoutCorrected,this.treeScale,this.path,f),u.layout&&!u.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(u.target=u.layout.layoutBox,u.targetWithTransforms=Lt());const{target:j}=u;if(!j){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(V1(this.prevProjectionDelta.x,this.projectionDelta.x),V1(this.prevProjectionDelta.y,this.projectionDelta.y)),kl(this.projectionDelta,this.layoutCorrected,j,this.latestValues),(this.treeScale.x!==x||this.treeScale.y!==v||!Z1(this.projectionDelta.x,this.prevProjectionDelta.x)||!Z1(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",j))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(u=!0){if(this.options.visualElement?.scheduleRender(),u){const f=this.getStack();f&&f.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Qa(),this.projectionDelta=Qa(),this.projectionDeltaWithTransform=Qa()}setAnimationOrigin(u,f=!1,h){const m=this.snapshot,p=m?m.latestValues:{},x={...this.latestValues},v=Qa();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!f;const j=Lt(),w=m?m.source:void 0,C=this.layout?this.layout.source:void 0,S=w!==C,N=this.getStack(),E=!N||N.members.length<=1,R=!!(S&&!E&&this.options.crossfade===!0&&!this.path.some(QI));this.animationProgress=0;let D;const A=h?.interpolateProjection(u);this.mixTargetDelta=_=>{const F=_/1e3,O=A?.(F);O?(v.x.translate=O.x,v.x.scale=ot(u.x.scale,1,F),v.x.origin=u.x.origin,v.x.originPoint=u.x.originPoint,v.y.translate=O.y,v.y.scale=ot(u.y.scale,1,F),v.y.origin=u.y.origin,v.y.originPoint=u.y.originPoint):(ij(v.x,u.x,F),ij(v.y,u.y,F)),this.setTargetDelta(v),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Td(j,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),YI(this.relativeTarget,this.relativeTargetOrigin,j,F),D&&SI(this.relativeTarget,D)&&(this.isProjectionDirty=!1),D||(D=Lt()),cs(D,this.relativeTarget)),S&&(this.animationValues=x,EI(x,p,this.latestValues,F,R,E)),O&&O.rotate!==void 0&&(this.animationValues||(this.animationValues=x),this.animationValues.pathRotation=O.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=F},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(u){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(si(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=lt.update(()=>{ed.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=so(0)),this.motionValue.jump(0,!1),this.currentAnimation=RI(this.motionValue,[0,1e3],{...u,velocity:0,isSync:!0,onUpdate:f=>{this.mixTargetDelta(f),u.onUpdate&&u.onUpdate(f)},onComplete:()=>{u.onComplete&&u.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const u=this.getStack();u&&u.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(PI),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const u=this.getLead();let{targetWithTransforms:f,target:h,layout:m,latestValues:p}=u;if(!(!f||!h||!m)){if(this!==u&&this.layout&&m&&gT(this.options.animationType,this.layout.layoutBox,m.layoutBox)){h=this.target||Lt();const x=hn(this.layout.layoutBox.x);h.x.min=u.target.x.min,h.x.max=h.x.min+x;const v=hn(this.layout.layoutBox.y);h.y.min=u.target.y.min,h.y.max=h.y.min+v}cs(f,h),Zu(f,p),kl(this.projectionDeltaWithTransform,this.layoutCorrected,f,p)}}registerSharedNode(u,f){this.sharedNodes.has(u)||this.sharedNodes.set(u,new DI),this.sharedNodes.get(u).add(f);const m=f.options.initialPromotionConfig;f.promote({transition:m?m.transition:void 0,preserveFollowOpacity:m&&m.shouldPreserveFollowOpacity?m.shouldPreserveFollowOpacity(f):void 0})}isLead(){const u=this.getStack();return u?u.lead===this:!0}getLead(){const{layoutId:u}=this.options;return u?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:u}=this.options;return u?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:u}=this.options;if(u)return this.root.sharedNodes.get(u)}promote({needsReset:u,transition:f,preserveFollowOpacity:h}={}){const m=this.getStack();m&&m.promote(this,h),u&&(this.projectionDelta=void 0,this.needsReset=!0),f&&this.setOptions({transition:f})}relegate(){const u=this.getStack();return u?u.relegate(this):!1}resetSkewAndRotation(){const{visualElement:u}=this.options;if(!u)return;let f=!1;const{latestValues:h}=u;if((h.z||h.rotate||h.rotateX||h.rotateY||h.rotateZ||h.skewX||h.skewY)&&(f=!0),!f)return;const m={};h.z&&Km("z",u,m,this.animationValues);for(let p=0;p<Hm.length;p++)Km(`rotate${Hm[p]}`,u,m,this.animationValues),Km(`skew${Hm[p]}`,u,m,this.animationValues);u.render();for(const p in m)u.setStaticValue(p,m[p]),this.animationValues&&(this.animationValues[p]=m[p]);u.scheduleRender()}applyProjectionStyles(u,f){if(!this.instance||this.isSVG)return;if(!this.isVisible){u.visibility="hidden";return}const h=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,u.visibility="",u.opacity="",u.pointerEvents=Ju(f?.pointerEvents)||"",u.transform=h?h(this.latestValues,""):"none";return}const m=this.getLead();if(!this.projectionDelta||!this.layout||!m.target){this.options.layoutId&&(u.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,u.pointerEvents=Ju(f?.pointerEvents)||""),this.hasProjected&&!Pi(this.latestValues)&&(u.transform=h?h({},""):"none",this.hasProjected=!1);return}u.visibility="";const p=m.animationValues||m.latestValues;this.applyTransformsToTarget();let x=NI(this.projectionDeltaWithTransform,this.treeScale,p);h&&(x=h(p,x)),u.transform=x;const{x:v,y:j}=this.projectionDelta;u.transformOrigin=`${v.origin*100}% ${j.origin*100}% 0`,m.animationValues?u.opacity=m===this?p.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:p.opacityExit:u.opacity=m===this?p.opacity!==void 0?p.opacity:"":p.opacityExit!==void 0?p.opacityExit:0;for(const w in ng){if(p[w]===void 0)continue;const{correct:C,applyTo:S,isCSSVariable:N}=ng[w],E=x==="none"?p[w]:C(p[w],m);if(S){const R=S.length;for(let D=0;D<R;D++)u[S[D]]=E}else N?this.options.visualElement.renderState.vars[w]=E:u[w]=E}this.options.layoutId&&(u.pointerEvents=m===this?Ju(f?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(u=>u.currentAnimation?.stop()),this.root.nodes.forEach(nj),this.root.sharedNodes.clear()}}}function LI(e){e.updateLayout()}function UI(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:r}=e.layout,{animationType:o}=e.options,c=t.source!==e.layout.source;if(o==="size")Ss(p=>{const x=c?t.measuredBox[p]:t.layoutBox[p],v=hn(x);x.min=s[p].min,x.max=x.min+v});else if(o==="x"||o==="y"){const p=o==="x"?"y":"x";sg(c?t.measuredBox[p]:t.layoutBox[p],s[p])}else gT(o,t.layoutBox,s)&&Ss(p=>{const x=c?t.measuredBox[p]:t.layoutBox[p],v=hn(s[p]);x.max=x.min+v,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[p].max=e.relativeTarget[p].min+v)});const u=Qa();kl(u,s,t.layoutBox);const f=Qa();c?kl(f,e.applyTransform(r,!0),t.measuredBox):kl(f,s,t.layoutBox);const h=!dT(u);let m=!1;if(!e.resumeFrom){const p=e.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:x,layout:v}=p;if(x&&v){const j=e.options.layoutAnchor||void 0,w=Lt();Td(w,t.layoutBox,x.layoutBox,j);const C=Lt();Td(C,s,v.layoutBox,j),fT(w,C)||(m=!0),p.options.layoutRoot&&(e.relativeTarget=C,e.relativeTargetOrigin=w,e.relativeParent=p)}}}e.notifyListeners("didUpdate",{layout:s,snapshot:t,delta:f,layoutDelta:u,hasLayoutChanged:h,hasRelativeLayoutChanged:m})}else if(e.isLead()){const{onExitComplete:s}=e.options;s&&s()}e.options.transition=void 0}function II(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function zI(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function FI(e){e.clearSnapshot()}function nj(e){e.clearMeasurements()}function VI(e){e.isLayoutDirty=!0,e.updateLayout()}function sj(e){e.isLayoutDirty=!1}function BI(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function $I(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function rj(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function qI(e){e.resolveTargetDelta()}function HI(e){e.calcProjection()}
10function KI(e){e.resetSkewAndRotation()}function GI(e){e.removeLeadSnapshot()}function ij(e,t,s){e.translate=ot(t.translate,0,s),e.scale=ot(t.scale,1,s),e.origin=t.origin,e.originPoint=t.originPoint}function aj(e,t,s,r){e.min=ot(t.min,s.min,r),e.max=ot(t.max,s.max,r)}function YI(e,t,s,r){aj(e.x,t.x,s.x,r),aj(e.y,t.y,s.y,r)}function QI(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const WI={duration:.45,ease:[.4,0,.1,1]},oj=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),lj=oj("applewebkit/")&&!oj("chrome/")?Math.round:ts;function cj(e){e.min=lj(e.min),e.max=lj(e.max)}function XI(e){cj(e.x),cj(e.y)}function gT(e,t,s){return e==="position"||e==="preserve-aspect"&&!yI(X1(t),X1(s),.2)}function ZI(e){return e!==e.root&&e.scroll?.wasRoot}const JI=pT({attachResizeListener:(e,t)=>Kl(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Gm={current:void 0},xT=pT({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Gm.current){const e=new JI({});e.mount(window),e.setOptions({layoutScroll:!0}),Gm.current=e}return Gm.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Ox=y.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function uj(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ez(...e){return t=>{let s=!1;const r=e.map(o=>{const c=uj(o,t);return!s&&typeof c=="function"&&(s=!0),c});if(s)return()=>{for(let o=0;o<r.length;o++){const c=r[o];typeof c=="function"?c():uj(e[o],null)}}}}function tz(...e){return y.useCallback(ez(...e),e)}class nz extends y.Component{getSnapshotBeforeUpdate(t){const s=this.props.childRef.current;if(Gu(s)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=s.offsetParent,o=Gu(r)&&r.offsetWidth||0,c=Gu(r)&&r.offsetHeight||0,u=getComputedStyle(s),f=this.props.sizeRef.current;f.height=parseFloat(u.height),f.width=parseFloat(u.width),f.top=s.offsetTop,f.left=s.offsetLeft,f.right=o-f.width-f.left,f.bottom=c-f.height-f.top,f.direction=u.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function sz({children:e,isPresent:t,anchorX:s,anchorY:r,root:o,pop:c}){const u=y.useId(),f=y.useRef(null),h=y.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:m}=y.useContext(Ox),p=c!==!1?e.props?.ref??e?.ref:void 0,x=tz(f,p);return y.useInsertionEffect(()=>{const{width:v,height:j,top:w,left:C,right:S,bottom:N,direction:E}=h.current;if(t||c===!1||!f.current||!v||!j)return;const R=E==="rtl",D=s==="left"?R?`right: ${S}`:`left: ${C}`:R?`left: ${C}`:`right: ${S}`,A=r==="bottom"?`bottom: ${N}`:`top: ${w}`;f.current.dataset.motionPopId=u;const _=document.createElement("style");m&&(_.nonce=m);const F=o??document.head;return F.appendChild(_),_.sheet&&_.sheet.insertRule(`
11          [data-motion-pop-id="${u}"] {
12            position: absolute !important;
13            width: ${v}px !important;
14            height: ${j}px !important;
15            ${D}px !important;
16            ${A}px !important;
17          }
18        `),()=>{f.current?.removeAttribute("data-motion-pop-id"),F.contains(_)&&F.removeChild(_)}},[t]),a.jsx(nz,{isPresent:t,childRef:f,sizeRef:h,pop:c,children:c===!1?e:y.cloneElement(e,{ref:x})})}const rz=({children:e,initial:t,isPresent:s,onExitComplete:r,custom:o,presenceAffectsLayout:c,mode:u,anchorX:f,anchorY:h,root:m})=>{const p=ax(iz),x=y.useId(),v=y.useRef(s),j=y.useRef(r);ox(()=>{v.current=s,j.current=r});let w=!0,C=y.useMemo(()=>(w=!1,{id:x,initial:t,isPresent:s,custom:o,onExitComplete:S=>{p.set(S,!0);for(const N of p.values())if(!N)return;r&&r()},register:S=>(p.set(S,!1),()=>{p.delete(S),!v.current&&!p.size&&j.current?.()})}),[s,p,r]);return c&&w&&(C={...C}),y.useMemo(()=>{p.forEach((S,N)=>p.set(N,!1))},[s]),y.useEffect(()=>{!s&&!p.size&&r&&r()},[s]),e=a.jsx(sz,{pop:u==="popLayout",isPresent:s,anchorX:f,anchorY:h,root:m,children:e}),a.jsx(Jd.Provider,{value:C,children:e})};function iz(){return new Map}function yT(e=!0){const t=y.useContext(Jd);if(t===null)return[!0,null];const{isPresent:s,onExitComplete:r,register:o}=t,c=y.useId();y.useEffect(()=>{if(e)return o(c)},[e]);const u=y.useCallback(()=>e&&r&&r(c),[c,r,e]);return!s&&r?[!1,u]:[!0]}const Cu=e=>e.key||"";function dj(e){const t=[];
vendor: 6,251 bytes, line 18
18return y.Children.forEach(e,s=>{y.isValidElement(s)&&t.push(s)}),t}const az=({children:e,custom:t,initial:s=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:c="sync",propagate:u=!1,anchorX:f="left",anchorY:h="top",root:m})=>{const[p,x]=yT(u),v=y.useMemo(()=>dj(e),[e]),j=u&&!p?[]:v.map(Cu),w=y.useRef(!0),C=y.useRef(v),S=ax(()=>new Map),N=y.useRef(new Set),[E,R]=y.useState(v),[D,A]=y.useState(v);ox(()=>{w.current=!1,C.current=v;for(let O=0;O<D.length;O++){const I=Cu(D[O]);j.includes(I)?(S.delete(I),N.current.delete(I)):S.get(I)!==!0&&S.set(I,!1)}},[D,j.length,j.join("-")]);const _=[];if(v!==E){let O=[...v];for(let I=0;I<D.length;I++){const V=D[I],H=Cu(V);j.includes(H)||(O.splice(I,0,V),_.push(V))}return c==="wait"&&_.length&&(O=_),A(dj(O)),R(v),null}const{forceRender:F}=y.useContext(ix);return a.jsx(a.Fragment,{children:D.map(O=>{const I=Cu(O),V=u&&!p?!1:v===D||j.includes(I),H=()=>{if(N.current.has(I))return;if(S.has(I))N.current.add(I),S.set(I,!0);else return;let k=!0;S.forEach(q=>{q||(k=!1)}),k&&(F?.(),A(C.current),u&&x?.(),r&&r())};return a.jsx(rz,{isPresent:V,initial:!w.current||s?void 0:!1,custom:t,presenceAffectsLayout:o,mode:c,root:m,onExitComplete:V?void 0:H,anchorX:f,anchorY:h,children:O},I)})})},vT=y.createContext({strict:!1}),fj={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let hj=!1;function oz(){if(hj)return;const e={};for(const t in fj)e[t]={isEnabled:s=>fj[t].some(r=>!!s[r])};QE(e),hj=!0}function bT(){return oz(),qU()}function lz(e){const t=bT();for(const s in e)t[s]={...t[s],...e[s]};QE(t)}const cz=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Ad(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||cz.has(e)}let wT=e=>!Ad(e);function uz(e){typeof e=="function"&&(wT=t=>t.startsWith("on")?!Ad(t):e(t))}try{uz(require("@emotion/is-prop-valid").default)}catch{}function dz(e,t,s){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||en(e[o])||(wT(o)||s===!0&&Ad(o)||!t&&!Ad(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}const rf=y.createContext({});function fz(e,t){if(sf(e)){const{initial:s,animate:r}=e;return{initial:s===!1||Hl(s)?s:void 0,animate:Hl(r)?r:void 0}}return e.inherit!==!1?t:{}}function hz(e){const{initial:t,animate:s}=fz(e,y.useContext(rf));return y.useMemo(()=>({initial:t,animate:s}),[mj(t),mj(s)])}function mj(e){return Array.isArray(e)?e.join(" "):e}const Dx=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function jT(e,t,s){for(const r in t)!en(t[r])&&!nT(r,s)&&(e[r]=t[r])}function mz({transformTemplate:e},t){return y.useMemo(()=>{const s=Dx();return kx(s,t,e),Object.assign({},s.vars,s.style)},[t])}function pz(e,t){const s=e.style||{},r={};return jT(r,s,e),Object.assign(r,mz(e,t)),r}function gz(e,t){const s={},r=pz(e,t);return e.drag&&e.dragListener!==!1&&(s.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(s.tabIndex=0),s.style=r,s}const ST=()=>({...Dx(),attrs:{}});function xz(e,t,s,r){const o=y.useMemo(()=>{const c=ST();return sT(c,t,iT(r),e.transformTemplate,e.style),{...c.attrs,style:{...c.style}}},[t]);if(e.style){const c={};jT(c,e.style,e),o.style={...c,...o.style}}return o}const yz=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Px(e){return typeof e!="string"||e.includes("-")?!1:!!(yz.indexOf(e)>-1||/[A-Z]/u.test(e))}function vz(e,t,s,{latestValues:r},o,c=!1,u){const h=(u??Px(e)?xz:gz)(t,r,o,e),m=dz(t,typeof e=="string",c),p=e!==y.Fragment?{...m,...h,ref:s}:{},{children:x}=t,v=y.useMemo(()=>en(x)?x.get():x,[x]);return y.createElement(e,{...p,children:v})}function bz({scrapeMotionValuesFromProps:e,createRenderState:t},s,r,o){return{latestValues:wz(s,r,o,e),renderState:t()}}function wz(e,t,s,r){const o={},c=r(e,{});for(const v in c)o[v]=Ju(c[v]);let{initial:u,animate:f}=e;const h=sf(e),m=GE(e);t&&m&&!h&&e.inherit!==!1&&(u===void 0&&(u=t.initial),f===void 0&&(f=t.animate));let p=s?s.initial===!1:!1;p=p||u===!1;const x=p?f:u;if(x&&typeof x!="boolean"&&!nf(x)){const v=Array.isArray(x)?x:[x];for(let j=0;j<v.length;j++){const w=wx(e,v[j]);if(w){const{transitionEnd:C,transition:S,...N}=w;for(const E in N){let R=N[E];if(Array.isArray(R)){const D=p?R.length-1:0;R=R[D]}R!==null&&(o[E]=R)}for(const E in C)o[E]=C[E]}}}return o}const NT=e=>(t,s)=>{const r=y.useContext(rf),o=y.useContext(Jd),c=()=>bz(e,t,r,o);return s?c():ax(c)},jz=NT({scrapeMotionValuesFromProps:Mx,createRenderState:Dx}),Sz=NT({scrapeMotionValuesFromProps:aT,createRenderState:ST}),Nz=Symbol.for("motionComponentSymbol");function Cz(e,t,s){const r=y.useRef(s);y.useInsertionEffect(()=>{r.current=s});const o=y.useRef(null);return y.useCallback(c=>{c&&e.onMount?.(c),t&&(c?t.mount(c):t.unmount());const u=r.current;if(typeof u=="function")if(c){const f=u(c);typeof f=="function"&&(o.current=f)}else o.current?(o.current(),o.current=null):u(c);else u&&(u.current=c)},[t])}const CT=y.createContext({});function Ha(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Ez(e,t,s,r,o,c){const{visualElement:u}=y.useContext(rf),f=y.useContext(vT),h=y.useContext(Jd),m=y.useContext(Ox),p=m.reducedMotion,x=m.ski
vendor: 18,079 bytes, line 18
18pAnimations,v=y.useRef(null),j=y.useRef(!1);r=r||f.renderer,!v.current&&r&&(v.current=r(e,{visualState:t,parent:u,props:s,presenceContext:h,blockInitialAnimation:h?h.initial===!1:!1,reducedMotionConfig:p,skipAnimations:x,isSVG:c}),j.current&&v.current&&(v.current.manuallyAnimateOnMount=!0));const w=v.current,C=y.useContext(CT);w&&!w.projection&&o&&(w.type==="html"||w.type==="svg")&&Tz(v.current,s,o,C);const S=y.useRef(!1);y.useInsertionEffect(()=>{w&&S.current&&w.update(s,h)});const N=s[_E],E=y.useRef(!!N&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(N)&&window.MotionHasOptimisedAnimation?.(N));return ox(()=>{j.current=!0,w&&(S.current=!0,window.MotionIsMounted=!0,w.updateFeatures(),w.scheduleRenderMicrotask(),E.current&&w.animationState&&w.animationState.animateChanges())}),y.useEffect(()=>{w&&(!E.current&&w.animationState&&w.animationState.animateChanges(),E.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(N)}),E.current=!1),w.enteringChildren=void 0)}),w}function Tz(e,t,s,r){const{layoutId:o,layout:c,drag:u,dragConstraints:f,layoutScroll:h,layoutRoot:m,layoutAnchor:p,layoutCrossfade:x}=t;e.projection=new s(e.latestValues,t["data-framer-portal-id"]?void 0:ET(e.parent)),e.projection.setOptions({layoutId:o,layout:c,alwaysMeasureLayout:!!u||f&&Ha(f),visualElement:e,animationType:typeof c=="string"?c:"both",initialPromotionConfig:r,crossfade:x,layoutScroll:h,layoutRoot:m,layoutAnchor:p})}function ET(e){if(e)return e.options.allowProjection!==!1?e.projection:ET(e.parent)}function Ym(e,{forwardMotionProps:t=!1,type:s}={},r,o){r&&lz(r);const c=s?s==="svg":Px(e),u=c?Sz:jz;function f(m,p){let x;const v={...y.useContext(Ox),...m,layoutId:Az(m)},{isStatic:j}=v,w=hz(m),C=u(m,j);if(!j&&typeof window<"u"){Rz();const S=kz(v);x=S.MeasureLayout,w.visualElement=Ez(e,C,v,o,S.ProjectionNode,c)}return a.jsxs(rf.Provider,{value:w,children:[x&&w.visualElement?a.jsx(x,{visualElement:w.visualElement,...v}):null,vz(e,m,Cz(C,w.visualElement,p),C,j,t,c)]})}f.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const h=y.forwardRef(f);return h[Nz]=e,h}function Az({layoutId:e}){const t=y.useContext(ix).id;return t&&e!==void 0?t+"-"+e:e}function Rz(e,t){y.useContext(vT).strict}function kz(e){const t=bT(),{drag:s,layout:r}=t;if(!s&&!r)return{};const o={...s,...r};return{MeasureLayout:s?.isEnabled(e)||r?.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function Mz(e,t){if(typeof Proxy>"u")return Ym;const s=new Map,r=(c,u)=>Ym(c,u,e,t),o=(c,u)=>r(c,u);return new Proxy(o,{get:(c,u)=>u==="create"?r:(s.has(u)||s.set(u,Ym(u,void 0,e,t)),s.get(u))})}const Oz=(e,t)=>t.isSVG??Px(e)?new oI(t):new tI(t,{allowProjection:e!==y.Fragment});class Dz extends ci{constructor(t){super(t),t.animationState||(t.animationState=fI(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();nf(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:s}=this.node.prevProps||{};t!==s&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let Pz=0;class _z extends ci{constructor(){super(...arguments),this.id=Pz++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:s}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;if(t&&r===!1){if(this.isExitComplete){const{initial:c,custom:u}=this.node.getProps();if(typeof c=="string"||typeof c=="object"&&c!==null&&!Array.isArray(c)){const f=Vi(this.node,c,u);if(f){const{transition:h,transitionEnd:m,...p}=f;for(const x in p)this.node.getValue(x)?.jump(p[x])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const o=this.node.animationState.setActive("exit",!t);s&&!t&&o.then(()=>{this.isExitComplete=!0,s(this.id)})}mount(){const{register:t,onExitComplete:s}=this.node.presenceContext||{};s&&s(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Lz={animation:{Feature:Dz},exit:{Feature:_z}};function rc(e){return{point:{x:e.pageX,y:e.pageY}}}const Uz=e=>t=>Cx(t)&&e(t,rc(t));function Ml(e,t,s,r){return Kl(e,t,Uz(s),r)}const TT=({current:e})=>e?e.ownerDocument.defaultView:null,pj=(e,t)=>Math.abs(e-t);function Iz(e,t){const s=pj(e.x,t.x),r=pj(e.y,t.y);return Math.sqrt(s**2+r**2)}const gj=new Set(["auto","scroll"]);class AT{constructor(t,s,{transformPagePoint:r,contextWindow:o=window,dragSnapToOrigin:c=!1,distanceThreshold:u=3,element:f}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=w=>{this.handleScroll(w.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Eu(this.lastRawMoveEventInfo,this.transformPagePoint));const w=Qm(this.lastMoveEventInfo,this.history),C=this.startEvent!==null,S=Iz(w.offset,{x:0,y:0})>=this.distanceThreshold;if(!C&&!S)return;const{point:N}=w,{timestamp:E}=Zt;this.history.push({...N,timestamp:E});const{onStart:R,onMove:D}=this.handlers;C||(R&&R(this.lastMoveEvent,w),this.startEvent=this.lastMoveEvent),D&&D(this.lastMoveEvent,w)},this.handlePointerMove=(w,C)=>{this.lastMoveEvent=w,this.lastRawMoveEventInfo=C,this.lastMoveEventInfo=Eu(C,this.transformPagePoint),lt.update(this.updatePoint,!0)},this.handlePointerUp=(w,C)=>{this.end();const{onEnd:S,onSessionEnd:N,resumeAnimation:E}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&E&&E(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const R=Qm(w.type==="pointercancel"?this.lastMoveEventInfo:Eu(C,this.transformPagePoint),this.history);this.startEvent&&S&&S(w,R),N&&N(w,R)},!Cx(t))return;this.dragSnapToOrigin=c,this.handlers=s,this.transformPagePoint=r,this.distanceThreshold=u,this.contextWindow=o||window;const h=rc(t),m=Eu(h,this.transformPagePoint),{point:p}=m,{timestamp:x}=Zt;this.history=[{...p,timestamp:x}];const{onSessionStart:v}=s;v&&v(t,Qm(m,this.history));const j={passive:!0,capture:!0};this.removeListeners=tc(Ml(this.contextWindow,"pointermove",this.handlePointerMove,j),Ml(this.contextWindow,"pointerup",this.handlePointerUp,j),Ml(this.contextWindow,"pointercancel",this.handlePointerUp,j)),f&&this.startScrollTracking(f)}startScrollTracking(t){let s=t.parentElement;for(;s;){const r=getComputedStyle(s);(gj.has(r.overflowX)||gj.has(r.overflowY))&&this.scrollPositions.set(s,{x:s.scrollLeft,y:s.scrollTop}),s=s.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const s=this.scrollPositions.get(t);if(!s)return;const r=t===window,o=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},c={x:o.x-s.x,y:o.y-s.y};c.x===0&&c.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=c.x,this.lastMoveEventInfo.point.y+=c.y):this.history.length>0&&(this.history[0].x-=c.x,this.history[0].y-=c.y),this.scrollPositions.set(t,o),lt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),si(this.updatePoint)}}function Eu(e,t){return t?{point:t(e.point)}:e}function xj(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Qm({point:e},t){return{point:e,delta:xj(e,RT(t)),offset:xj(e,zz(t)),velocity:Fz(t,.1)}}function zz(e){return e[0]}function RT(e){return e[e.length-1]}function Fz(e,t){if(e.length<2)return{x:0,y:0};let s=e.length-1,r=null;const o=RT(e);for(;s>=0&&(r=e[s],!(o.timestamp-r.timestamp>Un(t)));)s--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&o.timestamp-r.timestamp>Un(t)*2&&(r=e[1]);const c=es(o.timestamp-r.timestamp);if(c===0)return{x:0,y:0};const u={x:(o.x-r.x)/c,y:(o.y-r.y)/c};return u.x===1/0&&(u.x=0),u.y===1/0&&(u.y=0),u}function Vz(e,{min:t,max:s},r){return t!==void 0&&e<t?e=r?ot(t,e,r.min):Math.max(e,t):s!==void 0&&e>s&&(e=r?ot(s,e,r.max):Math.min(e,s)),e}function yj(e,t,s){return{min:t!==void 0?e.min+t:void 0,max:s!==void 0?e.max+s-(e.max-e.min):void 0}}function Bz(e,{top:t,left:s,bottom:r,right:o}){return{x:yj(e.x,s,o),y:yj(e.y,t,r)}}function vj(e,t){let s=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([s,r]=[r,s]),{min:s,max:r}}function $z(e,t){return{x:vj(e.x,t.x),y:vj(e.y,t.y)}}function qz(e,t){let s=.5;const r=hn(e),o=hn(t);return o>r?s=$l(t.min,t.max-r,e.min):r>o&&(s=$l(e.min,e.max-o,t.min)),Ds(0,1,s)}function Hz(e,t){const s={};return t.min!==void 0&&(s.min=t.min-e.min),t.max!==void 0&&(s.max=t.max-e.min),s}const rg=.35;function Kz(e=rg){return e===!1?e=0:e===!0&&(e=rg),{x:bj(e,"left","right"),y:bj(e,"top","bottom")}}function bj(e,t,s){return{min:wj(e,t),max:wj(e,s)}}function wj(e,t){return typeof e=="number"?e:e[t]||0}const Gz=new WeakMap;class Yz{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Lt(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:s=!1,distanceThreshold:r}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const c=x=>{s&&this.snapToCursor(rc(x).point),this.stopAnimation()},u=(x,v)=>{const{drag:j,dragPropagation:w,onDragStart:C}=this.getProps();if(j&&!w&&(this.openDragLock&&this.openDragLock(),this.openDragLock=wU(j),!this.openDragLock))return;this.latestPointerEvent=x,this.latestPanInfo=v,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ss(N=>{let E=this.getAxisMotionValue(N).get()||0;if(As.test(E)){const{projection:R}=this.visualElement;if(R&&R.layout){const D=R.layout.layoutBox[N];D&&(E=hn(D)*(parseFloat(E)/100))}}this.originPoint[N]=E}),C&&lt.update(()=>C(x,v),!1,!0),Qp(this.visualElement,"transform");const{animationState:S}=this.visualElement;S&&S.setActive("whileDrag",!0)},f=(x,v)=>{this.latestPointerEvent=x,this.latestPanInfo=v;const{dragPropagation:j,dragDirectionLock:w,onDirectionLock:C,onDrag:S}=this.getProps();if(!j&&!this.openDragLock)return;const{offset:N}=v;if(w&&this.currentDirection===null){this.currentDirection=Wz(N),this.currentDirection!==null&&C&&C(this.currentDirection);return}this.updateAxis("x",v.point,N),this.updateAxis("y",v.point,N),this.visualElement.render(),S&&lt.update(()=>S(x,v),!1,!0)},h=(x,v)=>{this.latestPointerEvent=x,this.latestPanInfo=v,this.stop(x,v),this.latestPointerEvent=null,this.latestPanInfo=null},m=()=>{const{dragSnapToOrigin:x}=this.getProps();(x||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:p}=this.getProps();this.panSession=new AT(t,{onSessionStart:c,onStart:u,onMove:f,onSessionEnd:h,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:p,distanceThreshold:r,contextWindow:TT(this.visualElement),element:this.visualElement.current})}stop(t,s){const r=t||this.latestPointerEvent,o=s||this.latestPanInfo,c=this.isDragging;if(this.cancel(),!c||!o||!r)return;const{velocity:u}=o;this.startAnimation(u);const{onDragEnd:f}=this.getProps();f&&lt.postRender(()=>f(r,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:s}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),s&&s.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,s,r){const{drag:o}=this.getProps();if(!r||!Tu(t,o,this.currentDirection))return;const c=this.getAxisMotionValue(t);let u=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(u=Vz(u,this.constraints[t],this.elastic[t])),c.set(u)}resolveConstraints(){const{dragConstraints:t,dragElastic:s}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,o=this.constraints;t&&Ha(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=Bz(r.layoutBox,t):this.constraints=!1,this.elastic=Kz(s),o!==this.constraints&&!Ha(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&Ss(c=>{this.constraints!==!1&&this.getAxisMotionValue(c)&&(this.constraints[c]=Hz(r.layoutBox[c],this.constraints[c]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:s}=this.getProps();if(!t||!Ha(t))return!1;const r=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;o.root&&(o.root.scroll=void 0,o.root.updateScroll());const c=QU(r,o.root,this.visualElement.getTransformPagePoint());let u=$z(o.layout.layoutBox,c);if(s){const f=s(KU(u));this.hasMutatedConstraints=!!f,f&&(u=XE(f))}return u}startAnimation(t){const{drag:s,dragMomentum:r,dragElastic:o,dragTransition:c,dragSnapToOrigin:u,onDragTransitionEnd:f}=this.getProps(),h=this.constraints||{},m=Ss(p=>{if(!Tu(p,s,this.currentDirection))return;let x=h&&h[p]||{};(u===!0||u===p)&&(x={min:0,max:0});const v=o?200:1e6,j=o?40:1e7,w={type:"inertia",velocity:r?t[p]:0,bounceStiffness:v,bounceDamping:j,timeConstant:750,restDelta:1,restSpeed:10,...c,...x};return this.startAxisValueAnimation(p,w)});return Promise.all(m).then(f)}startAxisValueAnimation(t,s){const r=this.getAxisMotionValue(t);return Qp(this.visualElement,t),r.start(bx(t,r,0,s,this.visualElement,!1))}stopAnimation(){Ss(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const s=`_drag${t.toUpperCase()}`,o=this.visualElement.getProps()[s];return o||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){Ss(s=>{const{drag:r}=this.getProps();if(!Tu(s,r,this.currentDirection))return;const{projection:o}=this.visualElement,c=this.getAxisMotionValue(s);if(o&&o.layout){const{min:u,max:f}=o.layout.layoutBox[s],h=c.get()||0;c.set(t[s]-ot(u,f,.5)+h)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:s}=this.getProps(),{projection:r}=this.visualElement;if(!Ha(s)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Ss(u=>{const f=this.getAxisMotionValue(u);if(f&&this.constraints!==!1){const h=f.get();o[u]=qz({min:h,max:h},this.constraints[u])}});const{transformTemplate:c}=this.visualElement.getProps();this.visualElement.current.style.transform=c?c({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),Ss(u=>{if(!Tu(u,t,null))return;const f=this.getAxisMotionValue(u),{min:h,max:m}=this.constraints[u];f.set(ot(h,m,o[u]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Gz.set(this.visualElement,this);const t=this.visualElement.current,s=Ml(t,"pointerdown",m=>{const{drag:p,dragListener:x=!0}=this.getProps(),v=m.target,j=v!==t&&TU(v);p&&x&&!j&&this.start(m)});let r;const o=()=>{const{dragConstraints:m}=this.getProps();Ha(m)&&m.current&&(this.constraints=this.resolveRefConstraints(),r||(r=Qz(t,m.current,()=>this.scalePositionWithinConstraints())))},{projection:c}=this.visualElement,u=c.addEventListener("measure",o);c&&!c.layout&&(c.root&&c.root.updateScroll(),c.updateLayout()),lt.read(o);const f=Kl(window,"resize",()=>this.scalePositionWithinConstraints()),h=c.addEventListener("didUpdate",(({delta:m,hasLayoutChanged:p})=>{this.isDragging&&p&&(Ss(x=>{const v=this.getAxisMotionValue(x);v&&(this.originPoint[x]+=m[x].translate,v.set(v.get()+m[x].translate))}),this.visualElement.render())}));return()=>{f(),s(),u(),h&&h(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:s=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:c=!1,dragElastic:u=rg,dragMomentum:f=!0}=t;return{...t,drag:s,dragDirectionLock:r,dragPropagation:o,dragConstraints:c,dragElastic:u,dragMomentum:f}}}function jj(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Qz(e,t,s){const r=R1(e,jj(s)),o=R1(t,jj(s));return()=>{r(),o()}}function Tu(e,t,s){return(t===!0||t===e)&&(s===null||s===e)}function Wz(e,t=10){let s=null;return Math.abs(e.y)>t?s="y":Math.abs(e.x)>t&&(s="x"),s}class Xz extends ci{constructor(t){super(t),this.removeGroupControls=ts,this.removeListeners=ts,this.controls=new Yz(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ts}update(){const{dragControls:t}=this.node.getProps(),{dragControls:s}=this.node.prevProps||{};t!==s&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Wm=e=>(t,s)=>{e&&lt.update(()=>e(t,s),!1,!0)};class Zz extends ci{constructor(){super(...arguments),this.removePointerDownListener=ts}onPointerDown(t){this.session=new AT(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:TT(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:s,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:Wm(t),onStart:Wm(s),onMove:Wm(r),onEnd:(c,u)=>{delete this.session,o&&lt.postRender(()=>o(c,u))}}}mount(){this.removePointerDownListener=Ml(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}
18let Xm=!1;class Jz extends y.Component{componentDidMount(){const{visualElement:t,layoutGroup:s,switchLayoutGroup:r,layoutId:o}=this.props,{projection:c}=t;c&&(s.group&&s.group.add(c),r&&r.register&&o&&r.register(c),Xm&&c.root.didUpdate(),c.addEventListener("animationComplete",()=>{this.safeToRemove()}),c.setOptions({...c.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),ed.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:s,visualElement:r,drag:o,isPresent:c}=this.props,{projection:u}=r;return u&&(u.isPresent=c,t.layoutDependency!==s&&u.setOptions({...u.options,layoutDependency:s}),Xm=!0,o||t.layoutDependency!==s||s===void 0||t.isPresent!==c?u.willUpdate():this.safeToRemove(),t.isPresent!==c&&(c?u.promote():u.relegate()||lt.postRender(()=>{const f=u.getStack();(!f||!f.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:s}=this.props,{projection:r}=t;r&&(r.options.layoutAnchor=s,r.root.didUpdate(),Nx.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:s,switchLayoutGroup:r}=this.props,{projection:o}=t;Xm=!0,o&&(o.scheduleCheckAfterUnmount(),s&&s.group&&s.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function kT(e){const[t,s]=yT(),r=y.useContext(ix);return a.jsx(Jz,{...e,layoutGroup:r,switchLayoutGroup:y.useContext(CT),isPresent:t,safeToRemove:s})}const eF={pan:{Feature:Zz},drag:{Feature:Xz,ProjectionNode:xT,MeasureLayout:kT}};function Sj(e,t,s){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",s==="Start");const o="onHover"+s,c=r[o];c&&lt.postRender(()=>c(t,rc(t)))}class tF extends ci{mount(){const{current:t}=this.node;t&&(this.unmount=SU(t,(s,r)=>(Sj(this.node,r,"Start"),o=>Sj(this.node,o,"End"))))}unmount(){}}class nF extends ci{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=tc(Kl(this.node.current,"focus",()=>this.onFocus()),Kl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Nj(e,t,s){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",s==="Start");const o="onTap"+(s==="End"?"":s),c=r[o];c&&lt.postRender(()=>c(t,rc(t)))}class sF extends ci{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:s,propagate:r}=this.node.props;this.unmount=RU(t,(o,c)=>(Nj(this.node,c,"Start"),(u,{success:f})=>Nj(this.node,u,f?"End":"Cancel")),{useGlobalTarget:s,stopPropagation:r?.tap===!1})}unmount(){}}const ig=new WeakMap,Zm=new WeakMap,rF=e=>{const t=ig.get(e.target);t&&t(e)},iF=e=>{e.forEach(rF)};function aF({root:e,...t}){const s=e||document;Zm.has(s)||Zm.set(s,{});const r=Zm.get(s),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(iF,{root:e,...t})),r[o]}function oF(e,t,s){const r=aF(t);return ig.set(e,s),r.observe(e),()=>{ig.delete(e),r.unobserve(e)}}const lF={some:0,all:1};class cF extends ci{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:s,margin:r,amount:o="some",once:c}=t,u={root:s?s.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:lF[o]},f=h=>{const{isIntersecting:m}=h;if(this.isInView===m||(this.isInView=m,c&&!m&&this.hasEnteredView))return;m&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",m);const{onViewportEnter:p,onViewportLeave:x}=this.node.getProps(),v=m?p:x;v&&v(h)};this.stopObserver=oF(this.node.current,u,f)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:s}=this.node;["amount","margin","root"].some(uF(t,s))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function uF({viewport:e={}},{viewport:t={}}={}){return s=>e[s]!==t[s]}const dF={inView:{Feature:cF},tap:{Feature:sF},focus:{Feature:nF},hover:{Feature:tF}},fF={layout:{ProjectionNode:xT,MeasureLayout:kT}},hF={...Lz,...dF,...eF,...fF},Ol=Mz(hF,Oz);function MT(){!Rx.current&&YE();const[e]=y.useState(Nd.current);return e}const OT=1800;function mF({onContinue:e}){return a.jsxs("div",{className:"absolute inset-0 z-20 flex flex-col items-center justify-center gap-8 bg-black text-white","data-testid":"phone-rotation-cue",children:[a.jsx(Ol.div,{"aria-hidden":"true",animate:{rotate:[0,0,-90,-90],opacity:[0,1,1,1]},transition:{duration:OT/1e3,times:[0,.2,.75,1],ease:"easeInOut"},children:a.jsx(LN,{size:64,strokeWidth:1})}),a.jsx("p",{role:"status",className:"text-xs tracking-[0.16em] text-white/65",children:"Best viewed horizontally"}),a.jsx("button",{type:"button",onClick:e,className:"px-5 py-3 text-xs text-white/50 underline underline-offset-4 hover:text-white focus-visible:outline focus-visible:outline-white",children:"Continue"})]})}const Cj=200,Ej=250;function _x(){if(typeof document>"u")return null;const e=document;return document.fullscreenElement??e.webkitFullscreenElement??null}function DT(e,t){if(!e)return Promise.resolve();try{const s=e.call(t);return Promise.resolve(s).catch(()=>{})}catch{return Promise.resolve()}}function pF(e,t){const s=e,r=s.requestFullscreen||s.webkitRequestFullscreen||s.msRequestFullscreen;r&&DT(r,s).then(()=>{_x()===e&&(t.current=!0)})}function gF(e,t){const s=e.current;if(!t.current||!s||_x()!==s){t.current=!1;return}t.current=!1;const r=document,o=document.exitFullscreen||r.webkitExitFullscreen;DT(o,document)}function Jm(e){return typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(e).matches:!1}function Tj(e,t){if(typeof window>"u"||typeof window.matchMedia!="function")return;const s=window.matchMedia(e);return s.addEventListener?.("change",t),()=>s.removeEventListener?.("change",t)}function ep(e){if(!(!e||!e.isConnected))try{e.focus({preventScroll:!0})}catch{e.focus()}}function xF(e){const t=["button:not([disabled])","[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not
18([tabindex="-1"])',"iframe"].join(",");return Array.from(e.querySelectorAll(t)).filter(s=>s.getAttribute("aria-hidden")!=="true")}const Rd=y.forwardRef(({url:e,open:t,onOpenChange:s,title:r},o)=>{const c=y.useRef(null),u=y.useRef(null),f=y.useRef(null),h=y.useRef(!1),m=y.useRef(null),p=y.useRef(null),x=y.useRef(!1),v=y.useRef(!1),j=y.useRef(t),w=y.useRef(t),C=y.useRef(e),[S,N]=y.useState(t),[E,R]=y.useState(!1),[D,A]=y.useState(()=>Jm("(pointer: coarse)")),[_,F]=y.useState(()=>Jm("(prefers-reduced-motion: reduce)")),[O,I]=y.useState(!1),[V,H]=y.useState(!1),[k,q]=y.useState(!1),J=t||S;j.current=J;const re=y.useCallback(()=>{if(typeof document>"u"||f.current)return;const ee=document.activeElement;ee instanceof HTMLElement&&ee!==document.body&&!c.current?.contains(ee)&&(f.current=ee)},[]),U=y.useCallback(()=>{const ee=f.current;f.current=null,ep(ee)},[]),L=y.useCallback(()=>{gF(c,h)},[]),z=y.useCallback(ee=>{if(v.current){ee&&s(!1);return}v.current=!0,R(!0),H(!1),I(!1),L(),ee&&s(!1),m.current!==null&&window.clearTimeout(m.current);const ae=_?0:Ej;m.current=window.setTimeout(()=>{w.current=!1,N(!1),R(!1),v.current=!1,m.current=null},ae)},[L,s,_]);y.useImperativeHandle(o,()=>({openFromGesture:()=>{re(),eo.flushSync(()=>{s(!0)}),c.current&&!v.current&&pF(c.current,h)}}),[re,s]),y.useEffect(()=>{t?(w.current=!0,v.current=!1,m.current!==null&&(window.clearTimeout(m.current),m.current=null),N(!0),R(!1)):w.current&&z(!1)},[z,t]),y.useEffect(()=>{const ee=Tj("(pointer: coarse)",oe=>A(oe.matches)),ae=Tj("(prefers-reduced-motion: reduce)",oe=>F(oe.matches));return()=>{ee?.(),ae?.()}},[]),y.useEffect(()=>{C.current!==e&&(C.current=e,L(),j.current&&z(!0))},[z,L,e]),y.useEffect(()=>{if(!J)return;const ee=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ee}},[J]),y.useEffect(()=>{if(!J){x.current&&(x.current=!1,U());return}const ee=document.getElementById("root"),ae=ee?.inert;if(ee&&(ee.inert=!0),!x.current){x.current=!0,re();const oe=window.setTimeout(()=>{j.current&&ep(u.current||c.current)},0);return()=>{window.clearTimeout(oe),ee&&(ee.inert=ae??!1)}}return()=>{ee&&(ee.inert=ae??!1)}},[re,J,U]),y.useEffect(()=>{if(!J)return;const ee=ae=>{if(!j.current)return;if(ae.key==="Escape"){ae.preventDefault(),z(!0);return}if(ae.key!=="Tab"||!c.current)return;const oe=xF(c.current);if(oe.length===0){ae.preventDefault(),c.current.focus();return}const le=oe[0],Ne=oe[oe.length-1],ce=document.activeElement;ae.shiftKey&&(ce===le||!c.current.contains(ce))?(ae.preventDefault(),Ne.focus()):!ae.shiftKey&&(ce===Ne||!c.current.contains(ce))&&(ae.preventDefault(),le.focus())};return document.addEventListener("keydown",ee,!0),()=>document.removeEventListener("keydown",ee,!0)},[z,J]),y.useEffect(()=>{if(!J)return;const ee=()=>{const ae=_x();ae===c.current?h.current=!0:ae===null&&h.current?(h.current=!1,z(!0)):ae!==null&&(h.current=!1)};return document.addEventListener("fullscreenchange",ee),document.addEventListener("webkitfullscreenchange",ee),()=>{document.removeEventListener("fullscreenchange",ee),document.removeEventListener("webkitfullscreenchange",ee)}},[z,J]),y.useEffect(()=>()=>{m.current!==null&&window.clearTimeout(m.current),p.current!==null&&window.clearTimeout(p.current),L(),x.current&&U()},[L,U]),y.useEffect(()=>{if(!J||E){I(!1),H(!1),q(!1);return}I(!1),H(!1),p.current!==null&&window.clearTimeout(p.current);const ee=window.requestAnimationFrame?window.requestAnimationFrame(()=>I(!0)):window.setTimeout(()=>I(!0),0),ae=D&&!_&&Jm("(orientation: portrait)")&&!!xd(e);q(ae);const oe=_?0:ae?OT:Cj;return p.current=window.setTimeout(()=>{q(!1),H(!0),p.current=null},oe),()=>{window.cancelAnimationFrame?window.cancelAnimationFrame(ee):window.clearTimeout(ee),p.current!==null&&(window.clearTimeout(p.current),p.current=null)}},[E,J,_,D,e]);const W=xd(e,{playsInline:!D,autoplay:!D}),M=W?null:p6(e),K=_?"0ms":`${Ej}ms`;if(!J)return null;const ie=a.jsxs("div",{ref:c,role:"dialog","aria-modal":"true","aria-label":r||"Video player",tabIndex:-1,className:"fixed inset-0 z-[9999] flex items-center justify-center outline-none",style:{width:"100%",height:"100dvh"},children:[a.jsx("div",{className:"absolute inset-0 bg-black",style:{opacity:O?1:0,transition:`opacity ${_?0:Cj}ms ease`}}),a.jsx("button",{ref:u,type:"button",onClick:()=>z(!0),className:"absolute z-[200] rounded-full bg-black/20 p-2 text-white/70 backdrop-blur-sm transition-colors hover:bg-black/40 hover:text-white",style:{to
18p:"max(1rem, env(safe-area-inset-top))",right:"max(1rem, env(safe-area-inset-right))"},"aria-label":"Close video",children:a.jsx(Jl,{className:"h-8 w-8",strokeWidth:1.5})}),t&&!E&&k&&a.jsx(mF,{onContinue:()=>{p.current!==null&&(window.clearTimeout(p.current),p.current=null),q(!1),H(!0),ep(u.current)}}),a.jsx("div",{className:"relative z-10 flex h-full w-full items-center justify-center",style:{containerType:"size"},children:a.jsx("div",{className:"relative shrink-0",style:{width:D?"100%":"min(100cqw, calc(100cqh * 16 / 9))",height:D?"100%":void 0,aspectRatio:D?void 0:"16 / 9",opacity:V&&!E?1:0,visibility:V&&!E?"visible":"hidden",transition:`opacity ${K} ease`},children:t&&!E&&C.current===e&&W?.provider==="vimeo"?a.jsx(g6,{src:W.embedUrl,autoplay:!D,title:r||"Video player"},W.embedUrl):t&&!E&&C.current===e&&W?.provider==="youtube"?a.jsx("iframe",{src:W.embedUrl,className:"absolute inset-0 h-full w-full",frameBorder:"0",allow:"autoplay; fullscreen; encrypted-media; picture-in-picture",allowFullScreen:!0,referrerPolicy:"strict-origin-when-cross-origin",title:r||"Video player"},W.embedUrl):t&&!E&&!W?a.jsxs("div",{role:"alert",className:"absolute inset-0 flex flex-col items-center justify-center gap-3 bg-black px-6 text-center text-white",children:[a.jsx("p",{className:"text-base font-medium",children:"Video unavailable"}),a.jsx("p",{className:"max-w-sm text-sm text-white/65",children:"This video link is not a supported YouTube or Vimeo video."}),M&&a.jsx("a",{href:M,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-white underline underline-offset-4 hover:text-white/75",children:"Open video link"})]}):null})})]});return eo.createPortal(ie,document.body)});Rd.displayName="VideoModal";function yF({className:e=""}){return a.jsxs("svg",{viewBox:"0 0 26 22",fill:"none",className:e,"aria-hidden":"true",children:[a.jsx("rect",{x:"1",y:"2",width:"24",height:"18",rx:"1",stroke:"currentColor",strokeWidth:"1.3"}),a.jsx("path",{d:"M6 2v18M20 2v18M1 7h5M1 15h5M20 7h5M20 15h5",stroke:"currentColor",strokeWidth:"1.3"}),a.jsx("path",{d:"m11 7 6 4-6 4V7Z",fill:"currentColor"})]})}function vF({className:e=""}){return a.jsxs("svg",{viewBox:"0 0 26 22",fill:"none",className:e,"aria-hidden":"true",children:[a.jsx("rect",{x:"1",y:"3",width:"24",height:"16",rx:"1",stroke:"currentColor",strokeWidth:"1.3"}),a.jsx("path",{d:"m11 7 6 4-6 4V7Z",fill:"currentColor"}),a.jsx("path",{d:"M8 1h10",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]})}function bF(){const[,e]=Qi("/films/:slug"),t=mt(),{data:s}=tx({site:t}),[r,o]=y.useState(null),c=!!e?.slug&&r===e.slug,u=y.useCallback(D=>{o(D?e?.slug??null:null)},[e?.slug]),f=y.useRef(null),[h,m]=y.useState(null),p=!!e?.slug&&h===e.slug,x=y.useCallback(D=>{m(D?e?.slug??null:null)},[e?.slug]),v=y.useRef(null),[j,w]=y.useState(!1),C=y.useRef(null);y.useEffect(()=>{C.current?.scrollTo({top:0}),w(!1),u(!1),x(!1)},[e?.slug]);const S=y.useMemo(()=>
18s?.films.find(D=>D.slug===e?.slug&&D.published),[s,e?.slug]),N=y.useMemo(()=>{if(!s||!S)return null;const D=li(s).filter(({collection:A})=>A==="films").map(({item:A})=>A);return D[(D.findIndex(A=>A.id===S.id)+1)%D.length]},[s,S]);if(!s)return null;if(!S)return a.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Film not found."});const E=s.press?.find(D=>D.filmId===S.id&&D.featured&&D.published),R=[E?`"${E.quote}"
19— ${E.outlet}`:"",S.showDistributor&&S.distributor?`Releasing ${S.year||""} from ${S.distributor}`:S.status||"",S.logline||"",[...S.keyCredits||[],...j?S.fullCredits||[]:[]].map(D=>`${D.role}  ${D.name}`).join(`
20`),S.showScreenerLine?s.settings.labels?.screenerLine||"Full film available on request":""].filter(Boolean).join(`
21
22`);return a.jsxs("div",{className:"public-film relative isolate flex-1 min-h-0 overflow-y-auto overflow-x-hidden md:overflow-hidden flex flex-col md:grid md:grid-rows-[minmax(0,27dvh)_minmax(0,1fr)] lg:grid-rows-1 lg:grid-cols-[minmax(0,1fr)_minmax(0,1fr)] items-center w-full px-6 md:px-8 lg:px-16 py-4 lg:py-7 gap-5 lg:gap-6 max-w-[1440px] mx-auto",children:[a.jsx("div",{className:Ee("shrink-0 w-full md:w-auto min-h-0 md:h-full flex items-center justify-center lg:items-start lg:justify-end md:[container-type:size]"),children:a.jsx("div",{className:Ee("public-film-poster relative shrink-0 w-full max-w-[320px] md:max-w-none md:w-[min(520px,100cqw,calc(100cqh*2/3))] aspect-[2/3]"),children:S.poster?a.jsx("img",{src:zt(S.poster,t),alt:`Poster for ${S.title}`,className:"absolute inset-0 h-full w-full object-cover"},S.slug):a.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground text-sm",children:"Poster unavailable"})})}),a.jsxs("div",{ref:C,className:"public-film-copy flex-1 md:flex-none shrink-0 w-full min-h-0 md:h-full overflow-visible md:overflow-y-auto overscroll-contain flex flex-col max-w-[65ch] text-[16px] leading-[1.55] relative z-10",children:[a.jsx(Fl,{identity:`film/${S.slug}`,as:"h1",className:"public-project-heading text-foreground text-[17px] leading-tight mb-1 shrink-0",children:S.title}),S.showTrailer&&S.vimeoUrl||S.watchFilmUrl?a.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 self-start shrink-0 mb-3",children:[S.showTrailer&&S.vimeoUrl?a.jsxs("button",{type:"button",onClick:()=>f.current?.openFromGesture(),className:"public-film-trailer inline-flex items-center gap-2.5 text-left py-1 text-[13px] text-foreground hover:text-muted-foreground transition-colors focus-visible:outline focus-visible:outline-1 focus-visible:outline-offset-4",children:[a.jsx(yF,{className:"w-6 h-5 shrink-0"}),s.settings.labels?.watchTrailer||"Watch Trailer"]}):null,S.watchFilmUrl?a.jsx("button",{type:"button",onClick:()=>v.current?.openFromGesture(),"aria-label":`Play full film: ${S.title}`,title:"Play full film",className:"public-film-trailer public-film-watch inline-flex items-center justify-center py-1 text-foreground hover:text-muted-foreground transition-colors focus-visible:outline focus-visible:outline-1 focus-visible:outline-offset-4",children:a.jsx(vF,{className:"w-6 h-5 shrink-0"})}):null]}):null,a.jsx("div",{"aria-label":"Film details",className:"public-film-details film-mobile-copy md:hidden shrink-0 whitespace-pre-line text-foreground/85 break-words",children:R}),a.jsx("div",{className:"hidden md:block min-h-0 flex-1",children:a.jsx(LC,{text:R,label:"Film details",className:"public-film-details whitespace-pre-line text-muted-foreground"})}),S.fullCredits&&S.fullCredits.length>0&&!j&&a.jsx("button",{onClick:()=>w(!0),className:"public-film-full-credits text-left pt-2 shrink-0 text-[13px] text-muted-foreground hover:text-foreground",children:s.settings.labels?.fullCredits||"Full credits"}),a.jsxs("nav",{className:"public-film-navigation mt-auto pt-4 shrink-0 flex items-end justify-between gap-6 text-[13px]","aria-label":"Film navigation",children:[a.jsx(ur,{href:"/work",className:"text-foreground hover:text-muted-foreground",children:"Back to Work"}),N&&a.jsxs("div",{className:"public-film-next text-right",children:[a.jsxs("span",{className:"text-muted-foreground",children:[s.settings.labels?.nextFilm||"Next film",": "]}
22),a.jsx(ur,{href:`/films/${N.slug}`,identity:`film/${N.slug}`,className:"text-foreground hover:text-muted-foreground",children:N.title})]})]})]}),S.showTrailer&&S.vimeoUrl&&a.jsx(Rd,{ref:f,url:S.vimeoUrl,title:`${S.title} — Trailer`,open:c,onOpenChange:u}),S.watchFilmUrl&&a.jsx(Rd,{ref:v,url:S.watchFilmUrl,title:`${S.title} — Full Film`,open:p,onOpenChange:x})]})}const PT=200,ag=250;function wF(e,t){const[s,r]=y.useState(e),[o,c]=y.useState("idle"),u=y.useRef(e);return y.useEffect(()=>{let f;if(t){u.current=e,r(e),c("idle");return}return e===u.current?(c(h=>h==="idle"?"idle":"in"),f=setTimeout(()=>c("idle"),ag)):(c("out"),f=setTimeout(()=>{u.current=e,r(e),c("in"),f=setTimeout(()=>c("idle"),ag)},PT)),()=>clearTimeout(f)},[e,t]),{displayedView:s,viewPhase:o}}function jF(e){return e.collection==="films"||/^passion projects?$/i.test(e.type?.trim()||"")}function SF(e){if(e.collection==="films")return e.status?.trim()||"";const t=e.client?.trim()||e.brandLabel?.trim()||"",s=(e.context||"").trim();return[t,s].filter(Boolean).join(" — ")}function NF(e,t,s){if(s)return"none";let r=0;for(const c of e)t.has(c)||r++;let o=0;for(const c of t)e.has(c)||o++;return r>0&&o===0?"narrowing":o>0&&r===0?"expanding":r>0&&o>0?"disjoint":"none"}function CF(e,t,s){const[r,o]=y.useState({displayItems:e,phase:"idle",exitingIds:new Set,enteringIds:new Set}),c=y.useRef(e),u=y.useRef(t),f=y.useRef(s),h=y.useRef(void 0),m=y.useRef(r);return m.current=r,y.useEffect(()=>{if(e===c.current&&t===u.current&&s===f.current)return;const p=t!==u.current;c.current=e,u.current=t,f.current=s;const x=m.current.displayItems,v=new Set(x.map(N=>N.id)),j=new Set(e.map(N=>N.id)),w=x.filter(N=>!j.has(N.id)),C=e.filter(N=>
22!v.has(N.id)),S=NF(v,j,p);if(s||S==="none"){clearTimeout(h.current),o({displayItems:e,phase:"idle",exitingIds:new Set,enteringIds:new Set});return}clearTimeout(h.current),S==="narrowing"?(o({displayItems:x,phase:"narrowing-fade",exitingIds:new Set(w.map(N=>N.id)),enteringIds:new Set}),h.current=setTimeout(()=>{o({displayItems:e,phase:"narrowing-reflow",exitingIds:new Set,enteringIds:new Set}),h.current=setTimeout(()=>{o({displayItems:e,phase:"idle",exitingIds:new Set,enteringIds:new Set})},400)},500)):S==="expanding"?(o({displayItems:e,phase:"expanding-reflow",exitingIds:new Set,enteringIds:new Set(C.map(N=>N.id))}),h.current=setTimeout(()=>{o({displayItems:e,phase:"expanding-fade",exitingIds:new Set,enteringIds:new Set(C.map(N=>N.id))}),h.current=setTimeout(()=>{o({displayItems:e,phase:"idle",exitingIds:new Set,enteringIds:new Set})},500)},400)):S==="disjoint"&&(o({displayItems:x,phase:"disjoint-fade-out",exitingIds:new Set(w.map(N=>N.id)),enteringIds:new Set}),h.current=setTimeout(()=>{o({displayItems:e,phase:"disjoint-fade-in",exitingIds:new Set,enteringIds:new Set(C.map(N=>N.id))}),h.current=setTimeout(()=>{o({displayItems:e,phase:"idle",exitingIds:new Set,enteringIds:new Set})},500)},500))},[e,t,s]),y.useEffect(()=>()=>clearTimeout(h.current),[]),r}function EF({site:e}){const[t,s]=zn(),r=ho(),o=new URLSearchParams(r),c=o.get("type")||"all",u=o.get("view")==="list"?"list":"grid",f=MT(),[h,m]=y.useState(null),[p,x]=y.useState({x:0,y:0}),v=y.useRef(null);y.useEffect(()=>{if(u!=="list"||!h)return;const k=q=>{x({x:q.clientX,y:q.clientY})};return window.addEventListener("mousemove",k),()=>window.removeEventListener("mousemove",k)},[u,h]);const j=y.useMemo(()=>li(e).map(({item:k,collection:q})=>({...k,type:q==="films"?"Narrative":k.type,collection:q})),[e]),w=y.useMemo(()=>{const k=new Set;return j.forEach(J=>{J.type&&k.add(J.type)}),(e.settings.types||["Narrative","Commercial","Non-Profit","Music Video","Documentary"]).filter(J=>k.has(J))},[j,e.settings.types]),C=y.useMemo(()=>c==="all"?j:j.filter(k=>k.type?.toLowerCase()===c.toLowerCase()),[j,c]),{displayedView:S,viewPhase:N}=wF(u,f),{displayItems:E,phase:R,exitingIds:D,enteringIds:A}=CF(C,S,f);y.useEffect(()=>{m(null)},[c,u]),y.useEffect(()=>{v.current?.scrollTo({top:0})},[S]);const _=(k,q)=>{const J=new URLSearchParams;k!=="all"&&J.set("type",k),q!=="grid"&&J.set("view",q);const re=J.toString();s(re?`${t}?${re}`:t)},F=k=>{const q=`/${k.collection==="films"?"films":"work"}/${k.slug}`;if(k.collection==="films")return q;const J=new URLSearchParams;c!=="all"&&J.set("type",c),u!=="grid"&&J.set("view",u);const re=J.toString();return re?`${q}?${re}`:q},O=j.find(k=>k.id===h),I=k=>{m(k.id)},V=()=>m(null),H=(k,q)=>{const J=D.has(k.id),re=A.has(k.id),U=re&&(R==="disjoint-fade-in"||R==="expanding-reflow"||R==="expanding-fade")?0:1,L=R==="narrowing-fade"&&J||R==="expanding-reflow"&&re||R==="disjoint-fade-out"&&J?0:1,z=L===0?"none":void 0,W=SF(k),M=k.client?.trim()||k.brandLabel?.trim(),K=!jF(k)&&!!M,ie=a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"public-project-title text-foreground",children:K?M:a.jsx("span",{"data-transition-title":"true",children:k.title})}),K?a.jsxs("div",{className:"public-project-secondary mt-1 text-sm text-muted-foreground",children:[a.jsx("span",{"data-transition-title":"true",children:k.title}),k.context?.trim()&&a.jsxs(a.Fragment,{children:[" — ",k.context.trim()]})]}):W?a.jsx("div",{className:"public-project-secondary mt-1 text-sm text-muted-foreground",children:W}):null]}),ee=h===k.id,ae=f?!1:"position",oe=f?{duration:0}:{layout:{duration:.4,ease:"easeInOut"},opacity:{duration:.5,ease:"easeInOut"}};return q==="list"?a.jsx(Ol.div,{layout:ae,initial:f?!1:{opacity:U},animate:{opacity:f?1:L},transition:oe,style:{pointerEvents:z},className:"w-full",children:a.jsxs(ur,{href:F(k),identity:`${k.collection==="films"?"film":"work"}/${k.slug}`,titleSelector:"[data-transition-title]",className:"public-work-list-link group flex flex-col sm:flex-row sm:items-center py-3 transition-colors break-words",onMouseEnter:()=>I(k),onMouseLeave:V,onFocus:()=>I(k),onBlur:V,tabIndex:L===0?-1:void 0,"aria-hidden":L===0?!0:void 0,children:[a.jsx("div",{className:"public-work-list-copy w-full sm:w-2/3 text-foreground pr-4",children:ie}),a.jsx("div",{className:"public-work-list-type w-full sm:w-1/3 text-muted-foreground text-left sm:text-right mt-1 sm:mt-0",children:k.type})]})},k.id):a.jsx(Ol.div,{layout:ae,initial:f?!1:{opacity:U}
22,animate:{opacity:f?1:L},transition:oe,style:{pointerEvents:z},className:"flex flex-col group",children:a.jsx(ur,{href:F(k),identity:`${k.collection==="films"?"film":"work"}/${k.slug}`,titleSelector:"[data-transition-title]",className:"public-work-card-link flex flex-col group h-full w-full",onMouseEnter:()=>I(k),onMouseLeave:V,onFocus:()=>I(k),onBlur:V,tabIndex:L===0?-1:void 0,"aria-hidden":L===0?!0:void 0,children:a.jsxs("div",{className:"public-work-card-media w-full aspect-[2.39/1] bg-muted relative overflow-hidden",children:[a.jsx(Hi,{media:to(e,k,k.collection),active:ee,alt:k.title,className:"group-hover:brightness-110 transition-all duration-500"}),a.jsx(_p,{item:k}),a.jsx("div",{className:"public-work-card-caption",children:ie})]})})},k.id)};return a.jsxs("div",{ref:v,"aria-label":"Work",style:{overflowAnchor:"none"},tabIndex:0,className:"public-work flex-1 min-h-0 overflow-y-auto overflow-x-hidden overscroll-contain pt-4 md:pt-7 px-6 md:px-12 lg:px-24 pb-12 max-w-[1800px] mx-auto w-full text-[17px]",children:[a.jsxs("div",{className:"public-work-header flex flex-col md:flex-row justify-between items-start md:items-center mb-6 md:mb-10 gap-4 shrink-0",children:[a.jsxs("nav",{className:"public-work-filters flex flex-wrap gap-x-6 gap-y-2","aria-label":"Work filters",children:[a.jsx("button",{onClick:()=>_("all",u),className:`transition-colors ${c==="all"?"text-foreground":"text-muted-foreground hover:text-foreground"}`,children:"All"}),w.map(k=>a.jsx("button",{onClick:()=>_(k.toLowerCase(),u),className:`transition-colors ${c===k.toLowerCase()?"text-foreground":"text-muted-foreground hover:text-foreground"}`,children:k},k))]}),a.jsxs("div",{className:"public-work-view-switch flex gap-6",role:"group","aria-label":"Work view",children:[a.jsx("span",{className:"public-work-view-label md:hidden",children:"View"}),a.jsx("button",{onClick:()=>_(c,"list"),className:`transition-colors ${u==="list"?"text-foreground":"text-muted-foreground hover:text-foreground"}`,"aria-pressed":u==="list",children:"List"}),a.jsx("button",{onClick:()=>_(c,"grid"),className:`transition-colors ${u==="grid"?"text-foreground":"text-muted-foreground hover:text-foreground"}`,"aria-pressed":u==="grid",children:"Grid"})]})]}),a.jsx(Ol.div,{initial:{opacity:!f&&N==="in"?0:1},animate:{opacity:!f&&N==="out"?0:1},transition:{duration:f?0:(N==="out"?PT:ag)/1e3,ease:[.4,0,.2,1]},inert:N!=="idle",children:S==="list"?a.jsx("div",{className:"public-work-list flex flex-col",children:E.map(k=>H(k,"list"))}):a.jsx("div",{className:"public-work-grid grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-x-6 gap-y-12 items-start",children:E.map(k=>H(k,"grid"))})},S),S==="list"&&N==="idle"&&O?a.jsxs("div",{className:"fixed pointer-events-none z-50 w-[300px] aspect-[2.39/1] bg-muted hidden md:block overflow-hidden",style:{left:p.x+20,top:p.y+20},children:[a.jsx(Hi,{media:to(e,O,O.collection),active:!0,alt:""}),a.jsx(_p,{item:O})]}):null,E.length===0?a.jsx("div",{className:"py-12 text-muted-foreground",children:"No projects found for this filter."}):null]})}function TF(){const[,e]=Qi("/work/:slug"),t=y.useRef(null),s=y.useRef(null),[r,o]=y.useState(null),c=!!e?.slug&&r===e.slug,u=y.useCallback(S=>{o(S?e?.slug??null:null)},[e?.slug]);y.useEffect(()=>{t.current?.scrollTo({top:0}),u(!1)},[e?.slug]);const f=new URLSearchParams(ho()),h=mt(),{data:m}=tx({site:h}),p=f.get("type")||"all",x=f.get("view")==="list"?"list":"grid",v=y.useMemo(()=>m?.work.find(S=>S.slug===e?.slug&&S.published),[m,e?.slug]),j=y.useMemo(()=>{const S=p==="all"&&x==="grid"?"/work":`/work?${new URLSearchParams(p!=="all"?{type:p,view:x}:{view:x})}`;if(!m||!v)return{back:S,next:null};const N=li(m).filter(R=>R.collection==="work"&&(p==="all"||R.item.type?.toLowerCase()===p.toLowerCase())),E=N.findIndex(R=>R.item.id===v.id);return{back:S,next:E===-1||N.length<2?null:N[(E+1)%N.length]}},[m,v,p,x]);if(!m)return null;if(!v)return a.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Work not found."});const w=Zr(m,v),C=[[v.client,v.context].filter(Boolean).join(" — "),[v.agency,v.productionCompany].filter(
22Boolean).join(" / ")].filter(Boolean).join(`
23`);return a.jsxs("div",{ref:t,className:"public-work-item flex-1 min-h-0 overflow-y-auto overflow-x-hidden overscroll-contain md:overflow-hidden flex flex-col w-full",children:[a.jsx("div",{className:"public-work-item-media-zone shrink-0 min-h-0 md:flex-1 flex items-center justify-center md:[container-type:size]",children:a.jsxs("div",{className:"public-work-item-media relative shrink-0 w-full md:w-[min(100cqw,calc(100cqh*2.39))] aspect-[2.39/1]",children:[a.jsx(Hi,{media:w,active:!c,allowTouchPlayback:!0,alt:""},v.id),v.vimeoUrl?a.jsx("button",{type:"button","aria-label":`Play full film: ${v.title}`,onClick:()=>s.current?.openFromGesture(),className:"public-work-item-play absolute inset-0 z-20 flex items-center justify-center group bg-black/10 hover:bg-black/20 transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-white focus-visible:-outline-offset-4",children:a.jsx("span",{className:"flex items-center justify-center w-16 h-16 md:w-20 md:h-20 rounded-full border border-white/70 bg-black/35 text-white backdrop-blur-sm group-hover:bg-black/60 group-focus-visible:bg-black/60 transition-colors",children:a.jsx(SD,{className:"w-6 h-6 ml-1",fill:"currentColor",strokeWidth:1,"aria-hidden":"true"})})}):a.jsx("div",{className:"absolute inset-x-0 bottom-4 text-center text-white text-[13px]",children:a.jsx("span",{className:"bg-black/60 px-3 py-1",children:"Full video unavailable"})})]})}),a.jsxs("div",{className:"public-work-item-footer shrink-0 md:h-[7.5rem] px-6 md:px-12 lg:px-24 py-6 md:py-3 flex flex-col md:flex-row justify-between gap-6 md:gap-5",children:[a.jsxs("div",{"aria-label":"Project details",className:"public-work-item-copy md:hidden flex flex-col text-[15px] leading-snug break-words",children:[a.jsx(Fl,{identity:`work/${v.slug}`,className:"public-project-heading text-foreground pb-1",children:v.title}),C&&a.jsx("div",{className:"whitespace-pre-line text-muted-foreground",children:C})]}),a.jsxs("div",{className:"public-work-item-copy hidden md:flex flex-col min-h-0 flex-1",children:[a.jsx(Fl,{identity:`work/${v.slug}`,className:"public-project-heading text-foreground pb-1 text-[15px] leading-snug shrink-0",children:v.title}),C&&a.jsx("div",{className:"min-h-0 flex-1",children:a.jsx(LC,{text:C,label:"Project details",className:"whitespace-pre-line text-[15px] leading-snug text-muted-foreground"})})]}),a.jsxs("div",{className:"public-work-item-nav shrink-0 flex flex-col items-end gap-2 text-[13px]",children:[a.jsx(ur,{href:j.back,className:"text-muted-foreground hover:text-foreground",children:m.settings.labels?.backToWork||"Back to work"}),j.next&&a.jsx(ur,{href:`${j.next.collection==="films"?"/films":"/work"}/${j.next.item.slug}?type=${p}&view=${x}`,identity:`${j.next.collection==="films"?"film":"work"}/${j.next.item.slug}`,className:"text-foreground hover:text-muted-foreground",children:m.settings.labels?.nextItem||"Next"})]})]}),v.vimeoUrl&&a.jsx(Rd,{ref:s,url:v.vimeoUrl,title:v.title,open:c,onOpenChange:u})]})}var _T={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Aj=Wr.createContext&&Wr.createContext(_T),AF=["attr","size","title"];function RF(e,t){if(e==null)return{};var s,r,o=kF(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r<c.length;r++)s=c[r],t.indexOf(s)===-1&&{}.propertyIsEnumerable.call(e,s)&&(o[s]=e[s])}return o}function kF(e,t){if(e==null)return{};var s={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;s[r]=e[r]}return s}function kd(){return kd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)({}).hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},kd.apply(null,arguments)}function Rj(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),s.push.apply(s,r)}return s}function Md(e){for(var t=1;t<arguments.length;t++){var s=arguments[t]!=null?arguments[t]:{};
23t%2?Rj(Object(s),!0).forEach(function(r){MF(e,r,s[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):Rj(Object(s)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(s,r))})}return e}function MF(e,t,s){return(t=OF(t))in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}function OF(e){var t=DF(e,"string");return typeof t=="symbol"?t:t+""}function DF(e,t){if(typeof e!="object"||!e)return e;var s=e[Symbol.toPrimitive];if(s!==void 0){var r=s.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function LT(e){return e&&e.map((t,s)=>Wr.createElement(t.tag,Md({key:s},t.attr),LT(t.child)))}function PF(e){return t=>Wr.createElement(_F,kd({attr:Md({},e.attr)},t),LT(e.child))}function _F(e){var t=s=>{var r=e.attr,o=e.size,c=e.title,u=RF(e,AF),f=o||s.size||"1em",h;return s.className&&(h=s.className),e.className&&(h=(h?h+" ":"")+e.className),Wr.createElement("svg",kd({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},s.attr,r,u,{className:h,style:Md(Md({color:e.color||s.color},s.style),e.style),height:f,width:f,xmlns:"http://www.w3.org/2000/svg"}),c&&Wr.createElement("title",null,c),e.children)};return Aj!==void 0?Wr.createElement(Aj.Consumer,null,s=>t(s)):t(_T)}function LF(e){return PF({attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M0 7.664v2.223h2.43v6.449H5.1v-6.45h2.43V7.665zm7.945 0v8.672h7.31v-2.223h-4.638v-1.08h4.637v-2.066h-4.637v-1.08h4.637V7.664zm7.759 0v8.672h3.863c3.024 0 4.433-1.688 4.433-4.349 0-2.185-1.021-4.323-3.912-4.323zm2.672 2.223h.85c1.931 0 2.102 1.518 2.102 2.063 0 .815-.243 2.163-1.907 2.163h-1.045z"},child:[]}]})(e)}var UF=Object.defineProperty,mn=(e,t)=>UF(e,"name",{value:t,configurable:!0}),tp="focusScope.autoFocusOnMount",np="focusScope.autoFocusOnUnmount",kj={bubbles:!1,cancelable:!0},UT=y.forwardRef(mn(function(t,s){const{loop:r=!1,trapped:o=!1,onMountAutoFocus:c,onUnmountAutoFocus:u,...f}=t,[h,m]=y.useState(null),p=In(c),x=In(u),v=y.useRef(null),j=Ge(s,m),w=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(o){let S=function(D){if(w.paused||!h)return;const A=D.target;h.contains(A)?v.current=A:nr(v.current,{select:!0})},N=function(D){if(w.paused||!h)return;const A=D.relatedTarget;A!==null&&(h.contains(A)||nr(v.current,{select:!0}))},E=function(D){if(document.activeElement===document.body)for(const _ of D)_.removedNodes.length>0&&nr(h)};mn(S,"handleFocusIn"),mn(N,"handleFocusOut"),mn(E,"handleMutations"),document.addEventListener("focusin",S),document.addEventListener("focusout",N);const R=new MutationObserver(E);return h&&R.observe(h,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",N),R.disconnect()}}},[o,h,w.paused]),y.useEffect(()=>{if(h){Mj.add(w);const S=document.activeElement;if(!h.contains(S)){const E=new CustomEvent(tp,kj);h.addEventListener(tp,p),h.dispatchEvent(E),E.defaultPrevented||(IT($T(Lx(h)),{select:!0}),document.activeElement===S&&nr(h))}return()=>{h.removeEventListener(tp,p),setTimeout(()=>{const E=new CustomEvent(np,kj);h.addEventListener(np,x),h.dispatchEvent(E),E.defaultPrevented||nr(S??document.body,{select:!0}),h.removeEventListener(np,x),Mj.remove(w)},0)}}},[h,p,x,w]);const C=y.useCallback(S=>{if(!r&&!o||w.paused)return;const N=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,E=document.activeElement;if(N&&E){const R=S.currentTarget,[D,A]=zT(R);D&&A?!S.shiftKey&&E===A?(S.preventDefault(),r&&nr(D,{select:!0})):S.shiftKey&&E===D&&(S.preventDefault(),r&&nr(A,{select:!0})):E===R&&S.preventDefault()}},[r,o,w.paused]);return a.jsx(Xe.div,{tabIndex:-1,...f,ref:j,onKeyDown:C})},"FocusScope"));function IT(e,{select:t=!1}={}){const s=document.activeElement;for(const r of e)if(nr(r,{select:t}),document.activeElement!==s)return}mn(IT,"focusFirst");function zT(e){const t=Lx(e),s=og(t,e),r=og(t.reverse(),e);return[s,r]}mn(zT,"getTabbableEdges");function Lx(e){const t=[],s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:mn(r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;s.nextNode();)t.push(s.currentNode);return t}mn(Lx,"getTabbableCandidates");function og(e,t){const s=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const r of e)if(!(s?!r.checkVisibility({checkVisibilityCSS:!0}):FT(r,{upTo:t})))return r}mn(og,"findVisible");function FT(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}mn(FT,"isHidden");function VT(e){return e instanceof HTMLInputElement&&"select"in e}mn(VT,"isSelectableInput");function nr(e,{select:t=!1}={}){if(e&&e.focus){const s=document.activeElement;e.focus({preventScroll:!0}),e!==s&&VT(e)&&t&&e.select()}}mn(nr,"focus");var Mj=BT();function BT(){let e=[];return{add(t){const s=e[0];t!==s&&s?.pause(),e=lg(e,t),e.unshift(t)},remove(t){e=lg(e,t),e[0]?.resume()}}}mn(BT,"createFocusScopesStack");function lg(e,t){const s=[...e],r=s.indexOf(t);return r!==-1&&s.splice(r,1),s}mn(lg,"arrayRemove");function $T(e){return e.filter(t=>t.tagName!=="A")}mn($T,"removeLinks");var IF=Object.defineProperty,Ux=(e,t)=>IF(e,"name",{value:t,configurable:!0}),Au=0,Fa=null;function zF(e){return af(),e.children}Ux(zF,"FocusGuards");function af(){y.useEffect(()=>{Fa||(Fa={start:cg(),end:cg()});const{start:e,end:t}=Fa;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Au++,
vendor: 5,948 bytes, lines 23-38
23()=>{Au===1&&(Fa?.start.remove(),Fa?.end.remove(),Fa=null),Au=Math.max(0,Au-1)}},[])}Ux(af,"useFocusGuards");function cg(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}Ux(cg,"createFocusGuard");var Es=function(){return Es=Object.assign||function(t){for(var s,r=1,o=arguments.length;r<o;r++){s=arguments[r];for(var c in s)Object.prototype.hasOwnProperty.call(s,c)&&(t[c]=s[c])}return t},Es.apply(this,arguments)};function qT(e,t){var s={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(s[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(s[r[o]]=e[r[o]]);return s}function FF(e,t,s){if(s||arguments.length===2)for(var r=0,o=t.length,c;r<o;r++)(c||!(r in t))&&(c||(c=Array.prototype.slice.call(t,0,r)),c[r]=t[r]);return e.concat(c||Array.prototype.slice.call(t))}var td="right-scroll-bar-position",nd="width-before-scroll-bar",VF="with-scroll-bars-hidden",BF="--removed-body-scroll-bar-size";function sp(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function $F(e,t){var s=y.useState(function(){return{value:e,callback:t,facade:{get current(){return s.value},set current(r){var o=s.value;o!==r&&(s.value=r,s.callback(r,o))}}}})[0];return s.callback=t,s.facade}var qF=typeof window<"u"?y.useLayoutEffect:y.useEffect,Oj=new WeakMap;function HF(e,t){var s=$F(null,function(r){return e.forEach(function(o){return sp(o,r)})});return qF(function(){var r=Oj.get(s);if(r){var o=new Set(r),c=new Set(e),u=s.current;o.forEach(function(f){c.has(f)||sp(f,null)}),c.forEach(function(f){o.has(f)||sp(f,u)})}Oj.set(s,e)},[e]),s}function KF(e){return e}function GF(e,t){t===void 0&&(t=KF);var s=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return s.length?s[s.length-1]:e},useMedium:function(c){var u=t(c,r);return s.push(u),function(){s=s.filter(function(f){return f!==u})}},assignSyncMedium:function(c){for(r=!0;s.length;){var u=s;s=[],u.forEach(c)}s={push:function(f){return c(f)},filter:function(){return s}}},assignMedium:function(c){r=!0;var u=[];if(s.length){var f=s;s=[],f.forEach(c),u=s}var h=function(){var p=u;u=[],p.forEach(c)},m=function(){return Promise.resolve().then(h)};m(),s={push:function(p){u.push(p),m()},filter:function(p){return u=u.filter(p),s}}}};return o}function YF(e){e===void 0&&(e={});var t=GF(null);return t.options=Es({async:!0,ssr:!1},e),t}var HT=function(e){var t=e.sideCar,s=qT(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return y.createElement(r,Es({},s))};HT.isSideCarExport=!0;function QF(e,t){return e.useMedium(t),HT}var KT=YF(),rp=function(){},of=y.forwardRef(function(e,t){var s=y.useRef(null),r=y.useState({onScrollCapture:rp,onWheelCapture:rp,onTouchMoveCapture:rp}),o=r[0],c=r[1],u=e.forwardProps,f=e.children,h=e.className,m=e.removeScrollBar,p=e.enabled,x=e.shards,v=e.sideCar,j=e.noRelative,w=e.noIsolation,C=e.inert,S=e.allowPinchZoom,N=e.as,E=N===void 0?"div":N,R=e.gapMode,D=qT(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=v,_=HF([s,t]),F=Es(Es({},D),o);return y.createElement(y.Fragment,null,p&&y.createElement(A,{sideCar:KT,removeScrollBar:m,shards:x,noRelative:j,noIsolation:w,inert:C,setCallbacks:c,allowPinchZoom:!!S,lockRef:s,gapMode:R}),u?y.cloneElement(y.Children.only(f),Es(Es({},F),{ref:_})):y.createElement(E,Es({},F,{className:h,ref:_}),f))});of.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};of.classNames={fullWidth:nd,zeroRight:td};var WF=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function XF(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=WF();return t&&e.setAttribute("nonce",t),e}function ZF(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function JF(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var eV=function(){var e=0,t=null;return{add:function(s){e==0&&(t=XF())&&(ZF(t,s),JF(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},tV=function(){var e=eV();return function(t,s){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&s])}},GT=function(){var e=tV(),t=function(s){var r=s.styles,o=s.dynamic;return e(r,o),null};return t},nV={left:0,top:0,right:0,gap:0},ip=function(e){return parseInt(e||"",10)||0},sV=function(e){var t=window.getComputedStyle(document.body),s=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[ip(s),ip(r),ip(o)]},rV=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return nV;var t=sV(e),s=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-s+t[2]-t[0])}},iV=GT(),Xa="data-scroll-locked",aV=function(e,t,s,r){var o=e.left,c=e.top,u=e.right,f=e.gap;return s===void 0&&(s="margin"),`
24  .`.concat(VF,` {
25   overflow: hidden `).concat(r,`;
26   padding-right: `).concat(f,"px ").concat(r,`;
27  }
28  body[`).concat(Xa,`] {
29    overflow: hidden `).concat(r,`;
30    overscroll-behavior: contain;
31    `).concat([t&&"position: relative ".concat(r,";"),s==="margin"&&`
32    padding-left: `.concat(o,`px;
33    padding-top: `).concat(c,`px;
34    padding-right: `).concat(u,`px;
35    margin-left:0;
36    margin-top:0;
37    margin-right: `).concat(f,"px ").concat(r,`;
38    `),s==="padding"&&"padding-right: ".concat(f,"px ").concat(r,";
38")].filter(Boolean).join(""),`
39  }
40  
41  .`).concat(td,` {
42    right: `).concat(f,"px ").concat(r,`;
43  }
44  
45  .`).concat(nd,` {
46    margin-right: `).concat(f,"px ").concat(r,`;
47  }
48  
49  .`).concat(td," .").concat(td,` {
50    right: 0 `).concat(r,`;
51  }
52  
53  .`).concat(nd," .").concat(nd,` {
54    margin-right: 0 `).concat(r,`;
55  }
56  
57  body[`).concat(Xa,`] {
58    `).concat(BF,": ").concat(f,`px;
59  }
60`)},Dj=function(){var e=parseInt(document.body.getAttribute(Xa)||"0",10);return isFinite(e)?e:0},oV=function(){y.useEffect(function(){return document.body.setAttribute(Xa,(Dj()+1).toString()),function(){var e=Dj()-1;e<=0?document.body.removeAttribute(Xa):document.body.setAttribute(Xa,e.toString())}},[])},lV=function(e){var t=e.noRelative,s=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;oV();var c=y.useMemo(function(){return rV(o)},[o]);return y.createElement(iV,{styles:aV(c,!t,o,s?"":"!important")})},ug=!1;if(typeof window<"u")try{var Ru=Object.defineProperty({},"passive",{get:function(){return ug=!0,!0}});window.addEventListener("test",Ru,Ru),window.removeEventListener("test",Ru,Ru)}catch{ug=!1}var Va=ug?{passive:!1}:!1,cV=function(e){return e.tagName==="TEXTAREA"},YT=function(e,t){if(!(e instanceof Element))return!1;var s=window.getComputedStyle(e);return s[t]!=="hidden"&&!(s.overflowY===s.overflowX&&!cV(e)&&s[t]==="visible")},uV=function(e){return YT(e,"overflowY")},dV=function(e){return YT(e,"overflowX")},Pj=function(e,t){var s=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=QT(e,r);if(o){var c=WT(e,r),u=c[1],f=c[2];if(u>f)return!0}r=r.parentNode}while(r&&r!==s.body);return!1},fV=function(e){var t=e.scrollTop,s=e.scrollHeight,r=e.clientHeight;return[t,s,r]},hV=function(e){var t=e.scrollLeft,s=e.scrollWidth,r=e.clientWidth;return[t,s,r]},QT=function(e,t){return e==="v"?uV(t):dV(t)},WT=function(e,t){return e==="v"?fV(t):hV(t)},mV=function(e,t){return e==="h"&&t==="rtl"?-1:1},pV=function(e,t,s,r,o){var c=mV(e,window.getComputedStyle(t).direction),u=c*r,f=s.target,h=t.contains(f),m=!1,p=u>0,x=0,v=0;do{if(!f)break;var j=WT(e,f),w=j[0],C=j[1],S=j[2],N=C-S-c*w;(w||N)&&QT(e,f)&&(x+=N,v+=w);var E=f.parentNode;f=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!h&&f!==document.body||h&&(t.contains(f)||t===f));return(p&&Math.abs(x)<1||!p&&Math.abs(v)<1)&&(m=!0),m},ku=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},_j=function(e){return[e.deltaX,e.deltaY]},Lj=function(e){return e&&"current"in e?e.current:e},gV=function(e,t){return e[0]===t[0]&&e[1]===t[1]},xV=function(e){return`
61  .block-interactivity-`.concat(e,` {pointer-events: none;}
62  .allow-interactivity-`).concat(e,` {pointer-events: all;}
63`)},yV=0,Ba=[];function vV(e){var t=y.useRef([]),s=y.useRef([0,0]),r=y.useRef(),o=y.useState(yV++)[0],c=y.useState(GT)[0],u=y.useRef(e);y.useEffect(function(){u.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var C=FF([e.lockRef.current],(e.shards||[]).map(Lj),!0).filter(Boolean);
vendor: 5,017 bytes, line 63
63return C.forEach(function(S){return S.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),C.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var f=y.useCallback(function(C,S){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!u.current.allowPinchZoom;var N=ku(C),E=s.current,R="deltaX"in C?C.deltaX:E[0]-N[0],D="deltaY"in C?C.deltaY:E[1]-N[1],A,_=C.target,F=Math.abs(R)>Math.abs(D)?"h":"v";if("touches"in C&&F==="h"&&_.type==="range")return!1;var O=window.getSelection(),I=O&&O.anchorNode,V=I?I===_||I.contains(_):!1;if(V)return!1;var H=Pj(F,_);if(!H)return!0;if(H?A=F:(A=F==="v"?"h":"v",H=Pj(F,_)),!H)return!1;if(!r.current&&"changedTouches"in C&&(R||D)&&(r.current=A),!A)return!0;var k=r.current||A;return pV(k,S,C,k==="h"?R:D)},[]),h=y.useCallback(function(C){var S=C;if(!(!Ba.length||Ba[Ba.length-1]!==c)){var N="deltaY"in S?_j(S):ku(S),E=t.current.filter(function(A){return A.name===S.type&&(A.target===S.target||S.target===A.shadowParent)&&gV(A.delta,N)})[0];if(E&&E.should){S.cancelable&&S.preventDefault();return}if(!E){var R=(u.current.shards||[]).map(Lj).filter(Boolean).filter(function(A){return A.contains(S.target)}),D=R.length>0?f(S,R[0]):!u.current.noIsolation;D&&S.cancelable&&S.preventDefault()}}},[]),m=y.useCallback(function(C,S,N,E){var R={name:C,delta:S,target:N,should:E,shadowParent:bV(N)};t.current.push(R),setTimeout(function(){t.current=t.current.filter(function(D){return D!==R})},1)},[]),p=y.useCallback(function(C){s.current=ku(C),r.current=void 0},[]),x=y.useCallback(function(C){m(C.type,_j(C),C.target,f(C,e.lockRef.current))},[]),v=y.useCallback(function(C){m(C.type,ku(C),C.target,f(C,e.lockRef.current))},[]);y.useEffect(function(){return Ba.push(c),e.setCallbacks({onScrollCapture:x,onWheelCapture:x,onTouchMoveCapture:v}),document.addEventListener("wheel",h,Va),document.addEventListener("touchmove",h,Va),document.addEventListener("touchstart",p,Va),function(){Ba=Ba.filter(function(C){return C!==c}),document.removeEventListener("wheel",h,Va),document.removeEventListener("touchmove",h,Va),document.removeEventListener("touchstart",p,Va)}},[]);var j=e.removeScrollBar,w=e.inert;return y.createElement(y.Fragment,null,w?y.createElement(c,{styles:xV(o)}):null,j?y.createElement(lV,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function bV(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const wV=QF(KT,vV);var Ix=y.forwardRef(function(e,t){return y.createElement(of,Es({},e,{ref:t,sideCar:wV}))});Ix.classNames=of.classNames;var jV=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},$a=new WeakMap,Mu=new WeakMap,Ou={},ap=0,XT=function(e){return e&&(e.host||XT(e.parentNode))},SV=function(e,t){return t.map(function(s){if(e.contains(s))return s;var r=XT(s);return r&&e.contains(r)?r:(console.error("aria-hidden",s,"in not contained inside",e,". Doing nothing"),null)}).filter(function(s){return!!s})},NV=function(e,t,s,r){var o=SV(t,Array.isArray(e)?e:[e]);Ou[s]||(Ou[s]=new WeakMap);var c=Ou[s],u=[],f=new Set,h=new Set(o),m=function(x){!x||f.has(x)||(f.add(x),m(x.parentNode))};o.forEach(m);var p=function(x){!x||h.has(x)||Array.prototype.forEach.call(x.children,function(v){if(f.has(v))p(v);else try{var j=v.getAttribute(r),w=j!==null&&j!=="false",C=($a.get(v)||0)+1,S=(c.get(v)||0)+1;$a.set(v,C),c.set(v,S),u.push(v),C===1&&w&&Mu.set(v,!0),S===1&&v.setAttribute(s,"true"),w||v.setAttribute(r,"true")}catch(N){console.error("aria-hidden: cannot operate on ",v,N)}})};return p(t),f.clear(),ap++,function(){u.forEach(function(x){var v=$a.get(x)-1,j=c.get(x)-1;$a.set(x,v),c.set(x,j),v||(Mu.has(x)||x.removeAttribute(r),Mu.delete(x)),j||x.removeAttribute(s)}),ap--,ap||($a=new WeakMap,$a=new WeakMap,Mu=new WeakMap,Ou={})}},ZT=function(e,t,s){s===void 0&&(s="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=jV(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),NV(r,o,s,"aria-hidden")):function(){return null}},CV=Object.defineProperty,Fn=(e,t)=>CV(e,"name",{value:t,configurable:!0}),zx="Dialog",[JT,e2]=ss(zx),[EV,gs]=JT(zx),t2=Fn(e=>{const{__scopeDialog:t,children:s,open:r,defaultOpen:o,onOpenChange:c,modal:u=!0}=e,f=y.useRef(null),h=y.useRef(null),[m,p]=lo({prop:r,defaultProp:o??!1,onChange:c,caller:zx}),[x,v]=y.useState(0),[j,w]=y.useState(0);return a.jsx(EV,{scope:t,triggerRef:f,contentRef:h,contentId:Ii(),titleId:Ii(),descriptionId:Ii(),titlePresent:x>0,descriptionPresent:j>0,setTitleCount:v,setDescriptionCount:w,open:m,onOpenChange:p,onOpenToggle:y.useCallback(()=>p(C=>!C),[p]),modal:u,children:s})},"Dialog"),TV="DialogTrigger",n2=y.forwardRef(Fn(function(t,s){const{__scopeDialog:r,...o}=t,c=gs(TV,r),u=Ge(s,c.triggerRef);return a.jsx(Xe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":c.open,"aria-controls":c.open?c.c
63ontentId:void 0,"data-state":lf(c.open),...o,ref:u,onClick:ge(t.onClick,c.onOpenToggle)})},"DialogTrigger")),s2="DialogPortal",[AV,r2]=JT(s2,{forceMount:void 0}),i2=Fn(e=>{const{__scopeDialog:t,forceMount:s,children:r,container:o}=e,c=gs(s2,t);return a.jsx(AV,{scope:t,forceMount:s,children:y.Children.map(r,u=>a.jsx(Ps,{present:s||c.open,children:a.jsx(Fd,{asChild:!0,container:o,children:u})}))})},"DialogPortal"),dg="DialogOverlay",Fx=y.forwardRef(Fn(function(t,s){const r=r2(dg,t.__scopeDialog),{forceMount:o=r.forceMount,...c}=t,u=gs(dg,t.__scopeDialog);return u.modal?a.jsx(Ps,{present:o||u.open,children:a.jsx(kV,{...c,ref:s})}):null},"DialogOverlay")),RV=dr("DialogOverlay.RemoveScroll"),kV=y.forwardRef(Fn(function(t,s){const{__scopeDialog:r,...o}=t,c=gs(dg,r),u=FS(),f=Ge(s,u);return a.jsx(Ix,{as:RV,allowPinchZoom:!0,shards:[c.contentRef],children:a.jsx(Xe.div,{"data-state":lf(c.open),...o,ref:f,style:{pointerEvents:"auto",...o.style}})})},"DialogOverlayImpl")),Gl="DialogContent",Vx=y.forwardRef(Fn(function(t,s){const r=r2(Gl,t.__scopeDialog),{forceMount:o=r.forceMount,...c}=t,u=gs(Gl,t.__scopeDialog);return a.jsx(Ps,{present:o||u.open,children:u.modal?a.jsx(MV,{...c,ref:s}):a.jsx(OV,{...c,ref:s})})},"DialogContent")),MV=y.forwardRef(Fn(function(t,s){const r=gs(Gl,t.__scopeDialog),o=y.useRef(null),c=Ge(s,r.contentRef,o);return y.useEffect(()=>{const u=o.current;if(u)return ZT(u)},[]),a.jsx(a2,{...t,ref:c,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:ge(t.onCloseAutoFocus,u=>{u.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:ge(t.onPointerDownOutside,u=>{const f=u.detail.originalEvent,h=f.button===0&&f.ctrlKey===!0;(f.button===2||h)&&u.preventDefault()}),onFocusOutside:ge(t.onFocusOutside,u=>u.preventDefault())})},"DialogContentModal")),OV=y.forwardRef(Fn(function(t,s){const r=gs(Gl,t.__scopeDialog),o=y.useRef(!1),c=y.useRef(!1);return a.jsx(a2,{...t,ref:s,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{t.onCloseAutoFocus?.(u),u.defaultPrevented||(o.current||r.triggerRef.current?.focus(),u.preventDefault()),o.current=!1,c.current=!1},onInteractOutside:u=>{t.onInteractOutside?.(u),u.defaultPrevented||(o.current=!0,u.detail.originalEvent.type==="pointerdown"&&(c.current=!0));const f=u.target;r.triggerRef.current?.contains(f)&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&c.current&&u.preventDefault()}})},"DialogContentNonModal")),a2=y.forwardRef(Fn(function(t,s){const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:c,onCloseAutoFocus:u,...f}=t,h=gs(Gl,r);return af(),a.jsx(a.Fragment,{children:a.jsx(UT,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:c,onUnmountAutoFocus:u,children:a.jsx(zd,{role:"dialog",id:h.contentId,"aria-describedby":h.descriptionPresent?h.descriptionId:void 0,"aria-labelledby":h.titlePresent?h.titleId:void 0,"data-state":lf(h.open),...f,ref:s,deferPointerDownOutside:!0,onDismiss:()=>h.onOpenChange(!1)})})})},"DialogContentImpl")),DV="DialogTitle",Bx=y.forwardRef(Fn(function(t,s){const{__scopeDialog:r,...o}=t,c=gs(DV,r),{setTitleCount:u}=c;return pn(()=>(u(f=>f+1),()=>u(f=>f-1)),[u]),a.jsx(Xe.h2,{id:c.titleId,...o,ref:s})},"DialogTitle")),PV="DialogDescription",$x=y.forwardRef(Fn(function(t,s){const{__scopeDialog:r,...o}=t,c=gs(PV,r),{setDescriptionCount:u}=c;return pn(()=>(u(f=>f+1),()=>u(f=>f-1)),[u]),a.jsx(Xe.p,{id:c.descriptionId,...o,ref:s})},"DialogDescription")),_V="DialogClose",qx=y.forwardRef(Fn(function(t,s){const{__scopeDialog:r,...o}=t,c=gs(_V,r);return a.jsx(Xe.button,{type:"button",...o,ref:s,onClick:ge(t.onClick,()=>c.onOpenChange(!1))})},"DialogClose"));function lf(e){return e?"open":"closed"}Fn(lf,"getState");const o2=t2,LV=n2,UV=i2,l2=y.forwardRef(({className:e,...t},s)=>a.jsx(Fx,{ref:s,className:Ee("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));l2.displayName=Fx.displayName;const Hx=y.forwardRef(({className:e,children:t,...s},r)=>a.jsxs(UV,{children:[a.jsx(l2,{}),a.jsxs(Vx,{ref:r,className:Ee("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg max-h-[85vh] translate-x-[-50%] translate-y-[-50%] gap-4 overflow-y-auto border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rou
63nded-lg",e),...s,children:[t,a.jsxs(qx,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[a.jsx(Jl,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Hx.displayName=Vx.displayName;const c2=({className:e,...t})=>a.jsx("div",{className:Ee("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});c2.displayName="DialogHeader";const u2=({className:e,...t})=>a.jsx("div",{className:Ee("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});u2.displayName="DialogFooter";const Kx=y.forwardRef(({className:e,...t},s)=>a.jsx(Bx,{ref:s,className:Ee("text-lg font-semibold leading-none tracking-tight",e),...t}));Kx.displayName=Bx.displayName;const Gx=y.forwardRef(({className:e,...t},s)=>a.jsx($x,{ref:s,className:Ee("text-sm text-muted-foreground",e),...t}));Gx.displayName=$x.displayName;function IV(e){try{const t=new URL(e);if(t.protocol!=="https:")return null;const s=t.hostname.toLowerCase();if(["www.ted.com","ted.com","embed.ted.com"].includes(s)&&/^\/talks\/[a-z0-9_-]+\/?$/i.test(t.pathname))return`https://embed.ted.com${t.pathname}`;let r=null;if(s==="youtu.be"&&(r=t.pathname.slice(1)),["youtube.com","www.youtube.com","m.youtube.com","www.youtube-nocookie.com"].includes(s)&&(r=t.pathname==="/watch"?t.searchParams.get("v"):/^\/(?:embed|shorts)\/([^/]+)\/?$/.exec(t.pathname)?.[1]??null),r&&/^[A-Za-z0-9_-]{11}$/.test(r))return`https://www.youtube-nocookie.com/embed/${r}?playsinline=1&rel=0`}catch{}return null}function zV({url:e}){const[t,s]=y.useState(!1),r=IV(e.trim()),o=/^https:\/\/[^/]/i.test(e.trim())?e.trim():null;return a.jsxs(o2,{open:t,onOpenChange:s,children:[a.jsx(LV,{asChild:!0,children:a.jsxs("button",{type:"button",className:"public-ted-link inline-flex items-center gap-3 min-h-11 text-[15px] text-muted-foreground hover:text-foreground transition-colors w-fit",children:[a.jsx(LF,{"aria-hidden":"true",className:"w-10 h-10 shrink-0 text-[#EB0028]"}),a.jsx("span",{children:"Watch my TED Talk"})]})}),a.jsxs(Hx,{className:"w-[calc(100vw-2rem)] max-w-5xl p-4 pt-12 sm:rounded-none",children:[a.jsx(Kx,{className:"sr-only",children:"TED Talk"}),a.jsx(Gx,{className:"sr-only",children:"Watch the talk here. Close this window to return to the About page."}),t&&r?a.jsx("div",{className:"mx-auto aspect-video bg-black",style:{width:"min(100%, calc((85dvh - 8rem) * 16 / 9))"},children:a.jsx("iframe",{src:r,title:"Michael Marantz TED Talk",className:"w-full h-full border-0",allow:"autoplay; encrypted-media; fullscreen; picture-in-picture",allowFullScreen:!0,referrerPolicy:"strict-origin-when-cross-origin"})}):t?a.jsx("p",{className:"text-sm text-muted-foreground",children:"This video link cannot be embedded. You can watch it using the link below."}):null,o&&a.jsx("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-muted-foreground hover:text-foreground underline underline-offset-4 w-fit",children:"Video not loading? Open the original"})]})]})}function FV({site:e}){const t=mt(),{settings:s}=e,r=(s.contacts||[]).filter(o=>o.visible);return a.jsx("div",{"aria-label":"About",tabIndex:0,className:"public-about flex-1 min-h-0 overflow-y-auto overflow-x-hidden overscroll-contain w-full",children:a.jsxs("div",{className:"public-about-layout max-w-[1800px] mx-auto w-full px-6 md:px-12 lg:px-24 pt-4 md:pt-7 pb-12 grid grid-cols-1 md:grid-cols-[minmax(0,1fr)_minmax(0,1.2fr)] lg:grid-cols-[minmax(0,5fr)_minmax(0,7fr)] gap-8 md:gap-12 lg:gap-20 items-start",children:[a.jsx("div",{className:"public-about-portrait-wrap w-full flex justify-center md:justify-end md:sticky md:top-7",children:a.jsx("div",{className:"public-about-portrait relative bg-muted shrink-0 w-full md:max-w-[465px]",style:{aspectRatio:"3/4"},children:s.headshot?a.jsx("img",{src:zt(s.headshot,t),alt:`Headshot of ${s.name}`,className:"absolute inset-0 w-full h-full object-cover"}):a.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground text-sm",children:"Headsh
63ot unavailable"})})}),a.jsxs("div",{className:"public-about-copy flex flex-col gap-8 max-w-[65ch] min-w-0 w-full",children:[a.jsx("div",{className:"flex flex-col",children:s.bio?a.jsx(A_,{className:"public-about-bio text-foreground leading-[1.55] tracking-normal [&_p]:mb-6 [&_section]:mb-8 last:[&_p]:mb-0 last:[&_section]:mb-0 [&_a]:underline [&_a]:underline-offset-4 [&_a]:hover:text-muted-foreground [&_a]:transition-colors",html:s.bio}):a.jsx("p",{className:"public-about-bio text-foreground leading-[1.55] tracking-normal",children:"Biography forthcoming."})}),(s.tedUrl||s.instagramUrl||s.vimeoUrl)&&a.jsxs("div",{className:"public-about-links flex flex-wrap gap-x-6 gap-y-3",children:[s.tedUrl&&a.jsx(zV,{url:s.tedUrl},s.tedUrl),s.instagramUrl&&a.jsx("a",{href:s.instagramUrl.trim(),target:"_blank",rel:"noreferrer",className:"public-about-link text-[15px] text-muted-foreground hover:text-foreground transition-colors w-fit",children:"Instagram"}),s.vimeoUrl&&a.jsx("a",{href:s.vimeoUrl.trim(),target:"_blank",rel:"noreferrer",className:"public-about-link text-[15px] text-muted-foreground hover:text-foreground transition-colors w-fit",children:"Vimeo"})]}),r.length>0&&a.jsx("div",{className:"public-about-contacts grid grid-cols-1 xl:grid-cols-2 gap-x-8 gap-y-7 pt-7 border-t border-border/40",children:r.map((o,c)=>a.jsxs("div",{className:"public-about-contact flex flex-col min-w-0 [overflow-wrap:anywhere] gap-1 text-[15px] leading-[1.5]",children:[a.jsx("h3",{className:"text-muted-foreground text-[15px] mb-1",children:o.label||o.group||"Contact"}),o.company&&a.jsx("p",{className:"text-foreground",children:o.company}),o.name&&o.name!==o.company&&a.jsx("p",{className:"text-foreground",children:o.name}),o.email&&a.jsx("a",{href:`mailto:${o.email.trim()}`,className:"text-foreground hover:text-muted-foreground transition-colors underline underline-offset-4 mt-1",children:o.email.trim()})]},c))})]})]})})}function d2({params:e}){const t=e?.token,s=mt(),r=Zd(),o=Y5();return a.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center animate-in fade-in min-h-[50vh]",children:a.jsxs("div",{className:"max-w-md w-full space-y-6",children:[o.isIdle&&a.jsxs("div",{className:"flex flex-col items-center gap-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("h1",{className:"font-serif text-3xl",children:"Confirm Subscription"}),a.jsxs("p",{className:"text-muted-foreground text-sm",children:["Confirm that you want to receive occasional news and new work from ",r.newsletter,"."]})]}),a.jsx("button",{type:"button",disabled:!t,onClick:()=>t&&o.mutate({token:t,params:{site:s}}),className:"min-h-11 border border-foreground px-6 font-mono text-[10px] uppercase tracking-[0.035em] transition-colors hover:bg-foreground hover:text-background disabled:opacity-50",children:"Confirm Subscription"})]}),o.isPending&&a.jsxs("div",{className:"flex flex-col items-center gap-4 text-muted-foreground",children:[a.jsx(Ue,{className:"w-8 h-8 animate-spin"}),a.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.035em]",children:"Confirming your subscription..."})]}),o.isSuccess&&a.jsxs("div",{className:"flex flex-col items-center gap-6",children:[a.jsx("div",{className:"w-12 h-12 rounded-full border border-border flex items-center justify-center text-foreground",children:a.jsx(Fg,{className:"w-6 h-6",strokeWidth:1})}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("h1",{className:"font-serif text-3xl",children:"Subscription Confirmed"}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"Thank you for subscribing. You'll hear from us soon."})]}),a.jsxs(xt,{href:"/",className:"inline-flex items-center gap-2 font-mono text-[10px] uppercase tracking-[0.035em] text-muted-foreground hover:text-foreground transition-colors mt-4",children:["Return to site ",a.jsx(cd,{className:"w-3 h-3"})]})]}),o.isError&&a.jsxs("div",{className:"flex flex-col items-center gap-6",children:[a.jsx("div",{className:"w-12 h-12 rounded-full border border-destructive/30 flex items-center justify-center text-destructive",children:a.jsx(AN,{className:"w-6 h-6",strokeWidth:1})}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("h1",{className:"font-serif text-3xl",children:"Link Expired or Invalid"}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"This confirmation link is no longer valid. You may have already confirmed your subscription, or the link may have expired."})]}),a.jsxs(xt,{href:"/",className:"inline-flex items-center gap-2 font-mono text-[10px] uppercase tracking-[0.035em] text-muted-foreground hover:text-foreground transition-colors mt-4",children:["Return to 
63site ",a.jsx(cd,{className:"w-3 h-3"})]})]})]})})}function f2({params:e}){const t=e?.token,s=mt(),r=Zd(),o=J5();return a.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center animate-in fade-in min-h-[50vh]",children:a.jsxs("div",{className:"max-w-md w-full space-y-6",children:[o.isIdle&&a.jsxs("div",{className:"flex flex-col items-center gap-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("h1",{className:"font-serif text-3xl",children:"Unsubscribe"}),a.jsxs("p",{className:"text-muted-foreground text-sm",children:["Confirm that you no longer want to receive the ",r.newsletter," newsletter."]})]}),a.jsx("button",{type:"button",disabled:!t,onClick:()=>t&&o.mutate({token:t,params:{site:s}}),className:"min-h-11 border border-foreground px-6 font-mono text-[10px] uppercase tracking-[0.035em] transition-colors hover:bg-foreground hover:text-background disabled:opacity-50",children:"Unsubscribe"})]}),o.isPending&&a.jsxs("div",{className:"flex flex-col items-center gap-4 text-muted-foreground",children:[a.jsx(Ue,{className:"w-8 h-8 animate-spin"}),a.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.035em]",children:"Unsubscribing..."})]}),o.isSuccess&&a.jsxs("div",{className:"flex flex-col items-center gap-6",children:[a.jsx("div",{className:"w-12 h-12 rounded-full border border-border flex items-center justify-center text-foreground",children:a.jsx(Fg,{className:"w-6 h-6",strokeWidth:1})}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("h1",{className:"font-serif text-3xl",children:"Unsubscribed"}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"You have been successfully removed from the newsletter and will not receive further emails."})]}),a.jsxs(xt,{href:"/",className:"inline-flex items-center gap-2 font-mono text-[10px] uppercase tracking-[0.035em] text-muted-foreground hover:text-foreground transition-colors mt-4",children:["Return to site ",a.jsx(cd,{className:"w-3 h-3"})]})]}),o.isError&&a.jsxs("div",{className:"flex flex-col items-center gap-6",children:[a.jsx("div",{className:"w-12 h-12 rounded-full border border-destructive/30 flex items-center justify-center text-destructive",children:a.jsx(AN,{className:"w-6 h-6",strokeWidth:1})}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("h1",{className:"font-serif text-3xl",children:"Link Expired or Invalid"}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"This unsubscribe link is no longer valid. If you continue receiving emails, please reply to them or contact us directly."})]}),a.jsxs(xt,{href:"/",className:"inline-flex items-center gap-2 font-mono text-[10px] uppercase tracking-[0.035em] text-muted-foreground hover:text-foreground transition-colors mt-4",children:["Return to site ",a.jsx(cd,{className:"w-3 h-3"})]})]})]})})}const fg=new Set;function h2(e){return fg.add(e),()=>{fg.delete(e)}}async function Za(){for(const e of[...fg])await e()}function Xn({href:e,targetSite:t,onClick:s,...r}){const o=mt(),[,c]=zn(),{toast:u}=Sn(),[f,h]=y.useState(!1),m=M_(t??o,e||"/admin");return a.jsx(xt,{...r,href:m,"aria-busy":f||void 0,onClick:async p=>{if(s?.(p),!(p.defaultPrevented||p.button!==0||p.ctrlKey||p.metaKey||p.shiftKey||p.altKey||r.target==="_blank")&&(p.preventDefault(),!f)){h(!0);try{await Za(),/^https?:\/\//.test(m)?window.location.assign(m):c(m)}catch(x){u({title:"Navigation paused: draft not saved",description:x instanceof Error?x.message:"Retry saving before leaving this page.",variant:"destructive"})}finally{h(!1)}}}})}const VV=["homepage","work","films","studio"];function BV(e){return VV.includes(e)?e:null}function m2(e){return e==="alreadyalive"?[{label:"Dashboard",path:"/admin",icon:"dashboard"},{label:"Homepage & Intro",path:"/admin/alreadyalive/homepage",icon:"homepage"},{label:"Work / Case Studies",path:"/admin/alreadyalive/work",icon:"work"},{label:"Films & Presentations",path:"/admin/alreadyalive/films",icon:"films"},{label:"Studio, Contact & SEO",path:"/admin/alreadyalive/studio",icon:"settings"},{label:"Newsletter",path:"/admin/newsletter",icon:"newsletter"}]:[{label:"Dashboard",path:"/admin",icon:"dashboard"},{label:"Films & Work",path:"/admin/work",icon:"work"},{label:"Homepage Cycle",path:"/admin/cycle",icon:"homepage"},{label:"Press",path:"/admin/press",icon:"press"},{label:"Newsletter",path:"/admin/newsletter",icon:"newsletter"},{label:"Settings",path:"/admin/settings",icon:"settings"}]}function $V(e,t){const s=t.replace(/\/$/,"")||"/";return[...m2(e)].sort((r,o)=>o.path.length-r.path.length).find(r=>s===r.path||r.path!=="/admin"&&s.startsWith(`${r.path}/`))?.path}function qV({children:e}){const[t,s]=zn(),{logout:r}=Jg(),o=mt(),{setSite:c,locked:u}=P_(),{isLoading:f,isError:h,refetch:m}=Os({site:o}),p=w5(),x=mr(),{toast:v}=Sn(),[j,w]=y.useState(!1),[C,S]=y.useState(!1),[N,E]=y.useState(!1),R=y.useRef(o);R.current=o;const D=async()=>
63{if(j||!window.confirm(`Publish changes for ${o==="alreadyalive"?"Already Alive":"Michael Marantz"}?`))return;w(!0);const I=o;let V=!1;try{if(await Za(),R.current!==I)throw new Error("The editing website changed. Review it before publishing.");await p.mutateAsync({params:{site:I}}),V=!0,await x.invalidateQueries({queryKey:cr({site:I})});const H=await MC({site:I},{cache:"no-store"});x.setQueryData(ex({site:I}),H),v({title:"Published successfully",description:`Your changes are now live on ${rr[I].label} only.`})}catch(H){v({title:V?"Published; preview refresh failed":"Publish failed",description:V?`The ${rr[I].label} content was published. Reload the public preview to fetch it.`:H instanceof Error?H.message:"There was an error publishing your changes.",variant:"destructive"})}finally{w(!1)}},A=async()=>{try{await Za(),r()}catch(I){v({title:"Draft not saved",description:I instanceof Error?I.message:"Please wait for autosave before logging out.",variant:"destructive"})}},_=m2(o),F=$V(o,t),O={dashboard:uD,work:Cl,homepage:Tp,press:kN,newsletter:DN,settings:_N,films:MN};return f?a.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:a.jsx(Ue,{className:"w-4 h-4 text-white animate-spin"})}):h?a.jsxs("div",{role:"alert",className:"min-h-screen flex flex-col gap-4 items-center justify-center bg-[#f7f3ee] text-[#171513]",children:[a.jsxs("p",{children:["Unable to load ",rr[o].label," admin content."]}),a.jsx("button",{className:"underline",onClick:()=>{m()},children:"Retry loading"})]}):a.jsxs("div",{className:`min-h-screen font-sans flex flex-col md:flex-row ${o==="alreadyalive"?"bg-[#f7f3ee] text-[#171513]":"bg-black text-white"}`,children:[a.jsxs("div",{className:`w-full md:w-64 border-b md:border-b-0 md:border-r flex flex-col shrink-0 ${o==="alreadyalive"?"border-[#d7d0c7] bg-[#f0e6dc]":"border-[#333]"}`,children:[a.jsxs("div",{className:`p-6 border-b ${o==="alreadyalive"?"border-[#d7d0c7]":"border-[#333]"}`,children:[a.jsxs(Xn,{href:o==="alreadyalive"?"/?site=alreadyalive&intro=skip":"/?site=michael",className:`${o==="alreadyalive"?"text-[#171513]":"text-white"} hover:opacity-70 transition-colors flex items-center gap-2`,children:[a.jsx(oD,{className:"w-4 h-4"}),a.jsx("span",{className:"text-[15px]",children:"View Live Site"})]}),a.jsxs("label",{className:"block mt-5 text-[11px] uppercase tracking-wider text-[#8a8a8a]",children:["Editing site",a.jsxs("select",{"aria-label":"Editing site",value:o,disabled:C||j,onChange:async I=>{const V=I.target.value;if(V===o||C||j)return;S(!0);const H=o;try{if(await Za(),R.current!==H)throw new Error("The editing website changed while saving.");if(u){window.location.assign(Vl(V,"/admin"));return}c(V),s(sr(V,"/admin")),E(!1)}catch(k){v({title:"Site switch blocked",description:k instanceof Error?k.message:"The pending draft could not be saved.",variant:"destructive"})}finally{S(!1)}},className:`mt-2 w-full border px-2 py-2 text-[14px] disabled:opacity-70 ${o==="alreadyalive"?"bg-[#fffdf9] border-[#bca994] text-[#171513]":"bg-black border-[#333] text-white"}`,children:[a.jsx("option",{value:"michael",children:"Michael Marantz"}),a.jsx("option",{value:"alreadyalive",children:"Already Alive"})]})]}),u&&a.jsx("p",{className:"mt-2 text-xs opacity-70",children:"Choosing another site opens its own admin and saves pending edits first."}),a.jsxs("button",{type:"button",className:"md:hidden mt-4 flex gap-2 items-center","aria-expanded":N,"aria-controls":"admin-navigation",onClick:()=>E(I=>!I),children:[a.jsx(xD,{className:"w-4 h-4"})," ",N?"Close menu":"Admin menu"]})]}),a.jsx("nav",{id:"admin-navigation","aria-label":`${rr[o].label} administration`,className:`${N?"block":"hidden"} md:block flex-1 py-6 px-4 space-y-1`,children:_.map(I=>{const V=I.path===F,H=O[I.icon];return a.jsxs(Xn,{href:I.path,"aria-current":V?"page":void 0,onClick:()=>E(!1),className:`flex items-center gap-3 px-3 py-2 text-[15px] transition-colors ${V?o==="alreadyalive"?"bg-[#e7b98c] text-[#171513]":"bg-[#111] text-white":o==="alreadyalive"?"text-[#756e66] hover:bg-[#e7b98c]/40 hover:text-[#171513]":"text-[#8a8a8a] hover:bg-[#111] hover:text-white"}`,children:[a.jsx(H,{className:"w-4 h-4"}),I.label]},I.path)})}),a.jsxs("div",{className:`${N?"block":"hidden"} md:block p-4 border-t ${o==="alreadyalive"?"border-[#d7d0c7]":"border-[#333]"}`,children:[a.jsxs("button",{onClick:D,disabled:j||C,className:"w-full mb-2 bg-white text-black py-2 px-4 flex items-center justify-center gap-2 hover:bg-[#e5e5e5] transition-colors text-[15px] disabled:opacity-50",children:[j?a.jsx(Ue,{className:"w-4 h-4 animate-spin"}):a.jsx(JO,{className:"w-4 h-4"}),"Publish Changes"]}),a.jsxs("button",{onClick:A,className:"w-full flex items-center gap-3 px-3 py-2 text-[15px] text-[#8a8a8a] hover:bg-[#111] hover:text-white transition-colors",children:[a.jsx(mD,{className:"w-4 h-4"}),"Log out"]})]})]}),a.jsx("div",{className:`flex-1 min-h-screen min-w-0 overflow-y-auto ${o==="alreadyalive"?"bg-[#f7f3ee]":"bg-black"}`,children:a.jsx("fieldset",{disabled:j||C,"aria-busy":j||C,className:"contents",children:e})})]})}function Uj(){const e=mt(),{data:t}=Os({site:e}),{data:s}=r8({query:{enabled:e==="michael",queryKey:["admin-newsletter-dashboard",e]},request:{portfolioSite:e}});if(!t)return null;if(e==="alreadyalive"){const o=t.alreadyAlive,c=[{label:"Homepage hero entries",count:o?.homepage.hero.length??0,path:"/admin/alreadyalive/homepage",icon:Tp},{label:"Selected case studies",count:o?.homepage.selectedProjectIds.length??0,path:"/admin/alreadyalive/homepage",icon:Cl},{label:"Case studies",count:o?.projects.length??0,path:"/admin/alreadyalive/work",icon:Cl},{label:"Film presentations",count:o?.films.length??0,path:"/admin/alreadyalive/films",icon:MN}];return a.jsxs("div",{className:"p-6 md:p-12 max-w-6xl mx-auto text-[#171513]",children:[a.jsx("h1",{className:"text-2xl mb-2",children:"Already Alive dashboard"}),a.jsx("p",{className:"text-[#756e66] mb-8 max-w-3xl",children:"Manage this studio’s homepage, case studies, film presentations and contact information. Edits save as Already Alive drafts. Publish Changes makes this website’s draft live; shared canonical projects stay on their originating website."}),a.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4 mb-10",children:c.map(u=>a.jsxs(Xn,{href:u.path,className:"block bg-white border border-[#d7d0c7] p-4 md:p-6 hover:border-[#8b5e3c]",children:[a.jsx(u.icon,{className:"w-5 h-5 text-[#8b5e3c] mb-3"}),a.jsx("p",{className:"text-3xl mb-1",children:u.count}),a.jsx("p",{className:"text-sm text-[#756e66]",children:u.label})]},u.label))}),a.jsxs("div",{className:"space-y-4 bg-white border border-[#d7d0c7] p-5 md:p-8",children:[a.jsx("h2",{className:"text-xl",children:"Studio shortcuts"}),a.jsx(Xn,{href:"/admin/alreadyalive/homepage",className:"block underline underline-offset-4",children:"Choose homepage videos, posters and selected case studies"}),a.jsx(Xn,{href:"/admin/alreadyalive/work",className:"block underline underline-offset-4",children:"Create or edit an Already Alive case study"}),a.jsx(Xn,{href:"/admin/alreadyalive/films",className:"block underline underline-offset-4",children:"Manage Already Alive film presentation overrides"}),a.jsx(Xn,{href:"/admin/alreadyalive/studio",className:"block underline underline-offset-4",children:"Edit studio, clients, contact details and page SEO"}),a.jsx(Xn,{href:"/admin/newsletter",className:"block underline underline-offset-4",children:"Open newsletter settings and audience information"})]})]})}const r=[{label:"Films & Work",count:t.films.length+t.work.length,path:"/admin/work",icon:Cl},{label:"Cycle Items",count:t.cycle.length,path:"/admin/cycle",icon:Tp},{label:"Press Quotes",count:t.press.length,path:"/admin/press",icon:kN},...s?[{label:"Subscribers",count:s.activeCount,path:"/admin/newsletter",icon:DN}]:[]];return a.jsxs("div",{className:"p-8 md:p-12 max-w-5xl mx-auto",children:[a.jsx("h1",{className:"text-2xl text-white mb-2",children:"Dashboard"}),a.jsx("p",{className:"text-[#8a8a8a] mb-12",children:'Manage your portfolio content. Changes are saved automatically as drafts. Click "Publish Changes" to push them live.'}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-12",children:r.map(o=>a.jsxs(Xn,{href:o.path,className:"block p-6 border border-[#333] hover:border-[#8a8a8a] bg-[#050505] transition-colors group",children:[a.jsx(o.icon,{className:"w-6 h-6 text-[#8a8a8a] group-hover:text-white mb-4 transition-colors"}),a.jsx("div",{className:"text-3xl text-white mb-1",children:o.count}),a.jsx("div",{className:"text-[#8a8a8a] text-[15px]",children:o.label})]},o.label))}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:a.jsxs("div",{className:"border border-[#333] p-6 bg-[#050505]",children:[a.jsxs("h2",{className:"text-[17px] text-white mb-4 flex items-center gap-2",children:[a.jsx(_N,{className:"w-4 h-4 text-[#8a8a8a]"}),"Site Settings"]}),a.jsxs("div",{className:"space-y-4 text-[15px]",children:[a.jsxs("div",{className:"flex justify-between border-b border-[#111] pb-2",children:[a.jsx("span",{className:"text-[#8a8a8a]",children:"Site Title"}),a.jsx("span",{className:"text-white",children:t.settings.siteTitle||"Not set"})]}),a.jsxs("div",{className:"flex justify-between border-b border-[#111] pb-2",children:[a.jsx("span",{className:"text-[#8a8a8a]",children:"Theme"}),a.jsx("span",{className:"text-white capitalize",children:t.settings.theme})]}),a.jsx("div",{className:"pt-2",children:a.jsx(Xn,{href:"/admin/settings",className:"text-white hover:text-[#8a8a8a] transition-colors underline underline-offset-4",children:"Edit Settings"})})]})]})})]})}function HV(){const[,e]=zn();return y.useEffect(()=>{e("/admin/work")},[e]),null}function Cs(e){if(Array.isArray(e))return e.map(t=>Cs(t));if(e!==null&&typeof e=="object"){const t={};for(const[s,r]of Object.entries(e))t[s]=Cs(r);return t}return e}function Yl(e,t){if(Object.is(e,t))return!0;
63if(e===null||t===null||typeof e!="object"||typeof t!="object")return!1;if(Array.isArray(e)||Array.isArray(t))return!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length?!1:e.every((o,c)=>Yl(o,t[c]));const s=Object.keys(e),r=Object.keys(t);return s.length!==r.length?!1:s.every(o=>Object.prototype.hasOwnProperty.call(t,o)&&Yl(e[o],t[o]))}function KV(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)+/g,"")}function Ij(e){if(typeof e.title!="string"||!e.title.trim())throw new Error("Entry title is required before saving.")}function zj(e,t,s,r){const o=Cs(t);return r&&!o.slug?.trim()&&(o.slug=KV(o.title)),o.previewMedia||(o.previewMedia=Cs(Zr(e,o))),o.featuredOnHomepage===void 0&&(o.featuredOnHomepage=s==="films"||o.showInBrandRow===!0),s==="work"&&(o.showInBrandRow=o.featuredOnHomepage),o}function Fj(e,t){const s=[];for(const r of["films","work"])e[r].forEach((o,c)=>{o.id===t&&s.push({item:o,collection:r,index:c})});return s}function GV(e,t){return Object.keys(e).filter(s=>s!=="id"&&!Yl(e[s],t[s]))}function YV(e,t){return new Error(`Entry "${e}" was moved to the ${t} collection in another session. Your edits are still here; reopen the entry before saving again.`)}function QV({latest:e,itemId:t,edited:s,collection:r,baselineInput:o,baselineServer:c,baselineCollection:u}){if(c===null){if(Fj(e,t).length>0)throw new Error(`Cannot create entry "${t}" because that ID is already in use. Refresh the editor and choose a new entry.`);const w={...Cs(o),...Cs(s),id:t};Ij(w),typeof w.type!="string"&&(w.type=r==="films"?"Feature":"Commercial"),typeof w.published!="boolean"&&(w.published=!1),(typeof w.order!="number"||!Number.isFinite(w.order))&&(w.order=999);const C=zj(e,w,r,!0),S=Cs(e);S[r]=[...S[r],C];const N=li(e,{includeUnpublished:!0}).map(({item:E})=>E.id);return N.push(t),$C(S,N)}if(Object.prototype.hasOwnProperty.call(s,"id")&&s.id!==t)throw new Error(`Entry IDs cannot be changed while editing "${t}".`);const f=Fj(e,t);if(f.length===0)throw new Error(`Entry "${t}" is missing from the latest draft. It may have been deleted; reopen the entry before saving again.`);if(f.length>1)throw new Error(`Entry "${t}" appears more than once in the latest draft. Refresh the editor before saving to avoid overwriting another entry.`);const h=f[0];if(h.item.deletedAt)throw new Error(`Entry "${t}" was deleted in another session. Your edits are still here; reopen the entry to review the latest draft.`);if(h.collection!==u)throw YV(t,h.collection);const m=GV(s,o);for(const j of m){const w=!Yl(c[j],h.item[j]),C=!Yl(s[j],h.item[j]);if(w&&C)throw new Error(`The "${String(j)}" field of "${t}" was changed in another session. Your edits are still here; copy them before reopening the entry to review the newer version.`)}const p=Cs(h.item);for(const j of m)p[j]=Cs(s[j]);Ij(p);const x=zj(e,p,r,m.includes("slug")&&!p.slug?.trim()),v=Cs(e);return h.collection===r?v[r]=v[r].map((j,w)=>w===h.index?x:j):(v[h.collection]=v[h.collection].filter((j,w)=>w!==h.index),v[r]=[...v[r],x]),v}function hg(e){return e instanceof TypeError||e instanceof Error&&/^(load failed|failed to fetch|networkerror.*|network request failed)$/i.test(e.message)}async function WV(e,t,s){try{return await t(e)}catch(r){if(!hg(r))throw r;if((await s()).revision!==e.revision)throw new Error("The connection was interrupted and the draft version changed. The save may have completed. Your edits are still here; copy them before reopening the entry to check the saved version.");return await t(e)}}function Vj(e,t){return Object.keys({...e,...t}).every(s=>JSON.stringify(e[s])===JSON.stringify(t[s]))}const mg="portfolio-entry-recovery:";function p2(e){try{const t=sessionStorage.getItem(mg+e);if(!t)return null;const s=JSON.parse(t);return!s.current?.data?.id||!s.baseline?.input?.data||!["films","work"].includes(s.current.collection)||s.current.data.id!==s.baseline.input.data.id?null:s}catch{return null}}function yl(e,t){try{return t?sessionStorage.setItem(mg+e,JSON.stringify(t)):sessionStorage.removeItem(mg+e),!0}catch{return!1}}const XV=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function ZV(e){const t=y.useRef(e);t.current=e;const s=y.useRef(null),r=y.useRef(null),o=y.useRef(void 0),c=y.useRef(!0),[u,f]=y.useState(!1),[h,m]=y.useState(null),[p,x]=y.useState(0),[v,j]=y.useState(!1),w=mr(),[,C]=zn(),S=mt(),N=y.useCallback(()=>{const A=t.current;return!!s.current&&!XV(s.current.input,{data:A.data,collection:A.collection})},[]);y.useEffect(()=>{if(c.current=!0,e.ready&&!s.current){const A=p2(e.recoveryKey);s.current=A?.current.data.id===e.itemId?A.baseline:{input:{data:e.data,collection:e.collection},server:e.isNew?null:[...e.content?.films??[],...e.content?.work??[]].find(_=>_.id===e.itemId)??null},A?.current.data.id===e.itemId&&(o.current=A.attempt,e.restore(A.current),t.current={...e,data:A.current.data,collection:A.current.collection}),x(_=>_+1)}return()=>{c.current=!1}},[e.ready]);const E=y.useCallback(()=>
63{if(r.current)return r.current;if(!N()&&!t.current.busy)return Promise.resolve();const A=async()=>{c.current&&(f(!0),m(null));try{for(;N()||t.current.busy;){const O=t.current;if(O.busy)throw new Error("Finish the media edit, fix any invalid timecodes, or wait for the upload/crop to complete before saving or publishing.");if(!O.data.title?.trim())throw new Error("Enter a title so this entry can be saved automatically.");const I={data:O.data,collection:O.collection},V=await zi({site:S},{cache:"no-store"});if(!s.current.server&&o.current){const U=o.current,L=V[U.input.collection].find(z=>z.id===O.itemId);L&&Vj(U.entry,L)&&(s.current={input:U.input,server:L},o.current=void 0)}const H=s.current,k=QV({latest:V,itemId:O.itemId,edited:I.data,collection:I.collection,baselineInput:H.input.data,baselineServer:H.server,baselineCollection:H.input.collection});o.current={input:I,entry:k[I.collection].find(U=>U.id===O.itemId)},yl(O.recoveryKey,{current:{data:t.current.data,collection:t.current.collection},baseline:H,attempt:o.current});let q;try{q=await WV(k,U=>nx(U,{site:S}),()=>zi({site:S},{cache:"no-store"}))}catch(U){if(!(hg(U)||U instanceof Error&&/connection was interrupted/i.test(U.message)))throw U;const z=await zi({site:S},{cache:"no-store"}),W=k[I.collection].find(K=>K.id===O.itemId),M=z[I.collection].find(K=>K.id===O.itemId);if(!W||!M||!Vj(W,M))throw U;q=z}if(!Array.isArray(q?.films)||!Array.isArray(q?.work))throw new Error("The server returned an invalid draft response. Your edits are still here; retry autosave.");const J=[...q.films,...q.work].find(U=>U.id===O.itemId);if(!J)throw new Error("The server did not confirm this entry. Keep the page open and retry.");s.current={input:I,server:J},o.current=void 0;const re=t.current;yl(O.recoveryKey,N()?{current:{data:re.data,collection:re.collection},baseline:s.current}:null),w.setQueryData(cr({site:S}),q),c.current&&x(U=>U+1)}const F=t.current;F.isNew&&s.current?.server&&c.current&&C(`/admin/${F.collection}/${F.itemId}`,{replace:!0})}catch(F){const O=hg(F)?"Connection interrupted. Your edits are still here. Autosave will retry when you reconnect, or you can retry below.":F instanceof Error?F.message:"The draft could not be saved. Your edits are still here.";c.current&&m(O);const I=t.current;if(I.isNew&&s.current?.server&&c.current){const V=`${I.collection}:${I.itemId}`;yl(V,{current:{data:I.data,collection:I.collection},baseline:s.current,attempt:o.current})&&(yl(I.recoveryKey,null),C(`/admin/${I.collection}/${I.itemId}`,{replace:!0}))}throw new Error(O)}finally{r.current=null,c.current&&f(!1)}},_=Promise.resolve().then(A);return r.current=_,_},[N,C,w]),R=N(),D=JSON.stringify({data:e.data,collection:e.collection});return y.useEffect(()=>{if(!s.current)return;const A=t.current,_=yl(A.recoveryKey,N()?{current:{data:A.data,collection:A.collection},baseline:s.current,attempt:o.current}:null);j(!_)},[D,p,e.ready,N]),y.useEffect(()=>{if(!e.ready||!R||e.busy||u)return;const A=window.setTimeout(()=>{E().catch(()=>{})},750);return()=>window.clearTimeout(A)},[D,e.ready,e.busy,p]),y.useEffect(()=>h2(E),[E]),y.useEffect(()=>()=>{N()&&!t.current.busy&&E().catch(()=>{})},[N,E]),y.useEffect(()=>{const A=window.location.href,_=window.history.state,F=H=>{!N()&&!t.current.busy&&!r.current||(H.preventDefault(),H.returnValue="")},O=()=>{N()&&E().catch(()=>{})},I=H=>{if(H.defaultPrevented||H.button!==0||H.metaKey||H.ctrlKey||H.shiftKey||H.altKey)return;const k=H.target instanceof Element?H.target.closest("a[href]"):null;if(!(k instanceof HTMLAnchorElement)||k.target==="_blank"||k.hasAttribute("download")||!N()&&!t.current.busy&&!r.current)return;const q=new URL(k.href,window.location.href);q.href!==window.location.href&&(H.preventDefault(),H.stopImmediatePropagation(),E().then(()=>{q.origin===window.location.origin?C(q.pathname+q.search+q.hash):window.location.assign(q.href)}).catch(()=>{}))},V=H=>{if(!N()&&!t.current.busy&&!r.current)return;const k=window.location.href,q=H.state;H.stopImmediatePropagation(),window.history.replaceState(_,"",A),E().then(()=>{window.history.replaceState(q,"",k)}).catch(()=>{})};return window.addEventListener("beforeunload",F),window.addEventListener("online",O),document.addEventListener("click",I,!0),window.addEventListener("popstate",V,!0),()=>{window.removeEventListener("beforeunload",F),window.removeEventListener("online",O),document.removeEventListener("click",I,!0),window.removeEventListener("popstate",V,!0)}},[N,E,C]),{saving:u,error:h,dirty:R,recoveryUnavailable:v,retry:()=>{E().catch(()=>{})}}}function Rs({site:e,onSuccess:t,onError:s}){const[r,o]=y.useState(!1),c=y.useRef(e);return c.current=e,{uploadFile:async(f,h,m,p)=>{const x=e;o(!0);try{const{uploadURL:v,objectPath:j}=await O5({name:f.name,size:f.size,contentType:f.type},{portfolioSite:e});if(!(await fetch(v,{method:"PUT",headers:{"Content-Type":f.type},body:f})).ok)throw new Error("Upload failed");const C=await P5({objectPath:j,kind:h,cropX:m,cropY:p},{portfolioSite:e});return c.current===x&&t?.(C.url),C.url}catch(v){throw s?.(v),v}finally{o(!1)}},isUploading:r}}var JV=Object.defineProperty,ri=(e,t)=>JV(e,"name",{value:t,configurable:!0}),Yx="Switch",[eB,Vq]=ss(Yx),[tB,Qx]=eB(Yx);function g2(e){const{__scopeSwitch:t,checked:s,children:r,defaultChecked:o,disabled:c,form:u,name:f,onCheckedChange:h,required:m,value:p="on",internal_do_not_use_render:x}=e,[v,j]=lo({prop:s,defaultProp:o??!1,onChange:h,caller:Yx}),[w,C]=y.useState(null),[S,N]=y.useState(null),E=y.useRef(!1),[R,D]=y.useReducer(F=>F+1,0),A=w?!!u||!!w.closest("form"):!0,_={checked:v,setChecked:j,disabled:c,
63control:w,setControl:C,name:f,form:u,value:p,hasConsumerStoppedPropagationRef:E,userInteractionCount:R,onUserInteraction:D,required:m,defaultChecked:o,isFormControl:A,bubbleInput:S,setBubbleInput:N};return a.jsx(tB,{scope:t,..._,children:y2(x)?x(_):r})}ri(g2,"SwitchProvider");var nB="SwitchTrigger",sB=y.forwardRef(ri(function({__scopeSwitch:t,onClick:s,...r},o){const{control:c,form:u,value:f,disabled:h,checked:m,required:p,setControl:x,setChecked:v,hasConsumerStoppedPropagationRef:j,onUserInteraction:w,isFormControl:C,bubbleInput:S}=Qx(nB,t),N=Ge(o,x),E=y.useRef(m);return y.useEffect(()=>{const R=u?c?.ownerDocument.getElementById(u):c?.form;if(R instanceof HTMLFormElement){const D=ri(()=>v(E.current),"reset");return R.addEventListener("reset",D),()=>R.removeEventListener("reset",D)}},[c,u,v]),a.jsx(Xe.button,{type:"button",role:"switch","aria-checked":m,"aria-required":p,"data-state":Wx(m),"data-disabled":h?"":void 0,disabled:h,value:f,...r,ref:N,onClick:ge(s,R=>{w(),v(D=>!D),S&&C&&(j.current=R.isPropagationStopped(),j.current||R.stopPropagation())})})},"SwitchTrigger")),x2=y.forwardRef(ri(function(t,s){const{__scopeSwitch:r,name:o,checked:c,defaultChecked:u,required:f,disabled:h,value:m,onCheckedChange:p,form:x,...v}=t;return a.jsx(g2,{__scopeSwitch:r,checked:c,defaultChecked:u,disabled:h,required:f,onCheckedChange:p,name:o,form:x,value:m,internal_do_not_use_render:({isFormControl:j})=>a.jsxs(a.Fragment,{children:[a.jsx(sB,{...v,ref:s,__scopeSwitch:r}),j&&a.jsx(oB,{__scopeSwitch:r})]})})},"Switch")),rB="SwitchThumb",iB=y.forwardRef(ri(function(t,s){const{__scopeSwitch:r,...o}=t,c=Qx(rB,r);return a.jsx(Xe.span,{"data-state":Wx(c.checked),"data-disabled":c.disabled?"":void 0,...o,ref:s})},"SwitchThumb")),aB="SwitchBubbleInput",oB=y.forwardRef(ri(function({__scopeSwitch:t,onClick:s,...r},o){const{control:c,hasConsumerStoppedPropagationRef:u,userInteractionCount:f,checked:h,defaultChecked:m,required:p,disabled:x,name:v,value:j,form:w,bubbleInput:C,setBubbleInput:S}=Qx(aB,t),N=Ge(o,S),E=Gg(c),R=y.useRef(!1),D=y.useRef(h),A=y.useRef(f);y.useEffect(()=>{const F=C;if(!F)return;const O=window.HTMLInputElement.prototype,V=Object.getOwnPropertyDescriptor(O,"checked").set,H=f!==A.current;A.current=f;const k=D.current!==h;D.current=h;const q=!(H&&u.current);if(k&&V){R.current=!H;const J=new Event("click",{bubbles:q});V.call(F,h),F.dispatchEvent(J),R.current=!1}},[C,h,u,f]);const _=y.useRef(h);return a.jsx(Xe.input,{type:"checkbox","aria-hidden":!0,defaultChecked:m??_.current,required:p,disabled:x,name:v,value:j,form:w,...r,tabIndex:-1,ref:N,onClick:ge(s,F=>{R.current&&F.stopPropagation()}),style:{...r.style,...E,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function y2(e){return typeof e=="function"}ri(y2,"isFunction");function Wx(e){return e?"checked":"unchecked"}ri(Wx,"getState");const Zn=y.forwardRef(({className:e,...t},s)=>a.jsx(x2,{className:Ee("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:s,children:a.jsx(iB,{className:Ee("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));Zn.displayName=x2.displayName;var lB=Object.defineProperty,cB=(e,t)=>lB(e,"name",{value:t,configurable:!0}),uB=y.forwardRef(cB(function(t,s){return a.jsx(Xe.label,{...t,ref:s,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(t.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}})},"Label")),v2=uB;const dB=Ig("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Kr=y.forwardRef(({className:e,...t},s)=>a.jsx(v2,{ref:s,className:Ee(dB(),e),...t}));Kr.displayName=v2.displayName;function Du(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):.5}function Bj(e){return e instanceof Error?e.message:"Unable to complete the image operation."}function Od({imagePath:e,site:t,kind:s="workGrid",disabled:r=!1,onApply:o,onBusyChange:c}
63){const u=s==="headshot"?.75:2.39,f=s==="headshot"?"3:4":"2.39:1",h=s==="headshot"?"profile image":"landscape still",[m,p]=y.useState(!1),[x,v]=y.useState(!1),[j,w]=y.useState(!1),[C,S]=y.useState(""),[N,E]=y.useState(null),[R,D]=y.useState({x:.5,y:.5}),[A,_]=y.useState(!1),[F,O]=y.useState(!1),I=y.useRef(null),V=y.useRef(null),H=y.useRef(null),k=y.useRef(t);k.current=t;const q=x||j;y.useEffect(()=>{c?.(q)},[q,c]),y.useEffect(()=>()=>{V.current?.abort(),V.current=null},[]);const J=(z,W)=>{const M=I.current;if(!M)return;const K=M.getBoundingClientRect();!K.width||!K.height||D({x:Du((z-K.left)/K.width),y:Du((W-K.top)/K.height)})},re=(z=!1)=>{j&&!z||(V.current?.abort(),V.current=null,H.current=null,p(!1),v(!1),S(""),E(null),D({x:.5,y:.5}),_(!1),O(!1))},U=async()=>{if(!e||r||q)return;V.current?.abort();const z=new AbortController;V.current=z;const W={imagePath:e,site:t};H.current=W,p(!0),v(!0),S(""),E(null),D({x:.5,y:.5}),O(!1);try{const M=await L5({imagePath:W.imagePath},{signal:z.signal,portfolioSite:W.site});if(z.signal.aborted)return;E(M)}catch(M){z.signal.aborted||S(Bj(M))}finally{z.signal.aborted||v(!1)}},L=async()=>{if(!e||!N||F||j||x||r)return;const z=H.current??{imagePath:e,site:t};V.current?.abort();const W=new AbortController;V.current=W,w(!0),S("");try{const M=await I5({imagePath:z.imagePath,kind:s,cropX:R.x,cropY:R.y},{signal:W.signal,portfolioSite:z.site});if(W.signal.aborted)return;if(k.current!==z.site){S("The selected site changed while this crop was running. The crop was not applied to the new site."),w(!1);return}o(M.url),w(!1),re(!0)}catch(M){W.signal.aborted||(S(Bj(M)),w(!1))}finally{V.current===W&&(V.current=null)}};return a.jsxs(a.Fragment,{children:[e&&a.jsx("button",{type:"button",onClick:U,disabled:r||q,className:"border border-[#555] text-white px-4 py-2 text-sm hover:border-white disabled:opacity-50",children:x?"Loading original…":j?"Applying…":"Re-crop"}),a.jsx(o2,{open:m,onOpenChange:z=>{z?p(!0):re()},children:a.jsxs(Hx,{className:"bg-[#111] border-[#333] text-white max-w-3xl max-h-[90dvh] overflow-y-auto",children:[a.jsxs(c2,{children:[a.jsxs(Kx,{children:["Re-crop ",h]}),a.jsxs(Gx,{className:"text-[#aaa]",children:["Choose the focal point from the retained original. The preview uses the same ",f," crop as ",s==="headshot"?"your About page":"the Work grid","."]})]}),x&&a.jsxs("div",{className:"min-h-48 flex items-center justify-center text-[#aaa] gap-2",role:"status",children:[a.jsx(Ue,{className:"w-4 h-4 animate-spin"})," Loading retained original…"]}),C&&a.jsx("div",{className:"border border-red-800 bg-red-950/30 text-red-200 p-3 text-sm",role:"alert",children:C}),N&&a.jsxs("div",{className:"space-y-5",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("div",{className:"text-xs uppercase tracking-wide text-[#888]",children:"Original image"}),a.jsxs("div",{ref:I,className:"relative w-full max-h-[45vh] overflow-hidden border border-[#444] bg-black touch-none cursor-crosshair",style:{aspectRatio:`${N.width}/${N.height}`},onPointerDown:z=>{j||(z.currentTarget.setPointerCapture(z.pointerId),_(!0),J(z.clientX,z.clientY))},onPointerMove:z=>{A&&!j&&J(z.clientX,z.clientY)},onPointerUp:z=>{z.currentTarget.hasPointerCapture(z.pointerId)&&z.currentTarget.releasePointerCapture(z.pointerId),_(!1)},onPointerCancel:()=>_(!1),children:[a.jsx("img",{src:zt(N.url,H.current?.site??t),alt:"Retained original for re-cropping",className:"absolute inset-0 w-full h-full object-contain select-none pointer-events-none",draggable:!1,onError:()=>{O(!0),S("The retained original could not be loaded. Re-upload this image before re-cropping.")}}),a.jsx("button",{type:"button",className:"absolute w-7 h-7 -ml-3.5 -mt-3.5 rounded-full border-2 border-white bg-black/40 shadow-[0_0_0_1px_#000] focus:outline-none focus:ring-2 focus:ring-white",style:{left:`${R.x*100}%`,top:`${R.y*100}%`},"aria-label":`Focal point: ${Math.round(R.x*100)} percent horizontal, ${Math.round(R.y*100)} percent vertical`,onPointerDown:z=>{z.stopPropagation(),!j&&(z.currentTarget.setPointerCapture(z.pointerId),_(!0))},onPointerMove:z=>{A&&!j&&J(z.clientX,z.clientY)},onPointerUp:()=>_(!1),onKeyDown:z=>{const W=z.shiftKey?.1:.02,M={...R};if(z.key==="ArrowLeft")M.x-=W;else if(z.key==="ArrowRight")M.x+=W;else if(z.key==="ArrowUp")M.y-=W;else if(z.key==="ArrowDown")M.y+=W;else return;z.preventDefault(),D({x:Du(M.x),y:Du(M.y)})}})]}),a.jsx("p",{className:"text-xs text-[#888]",children:"Tap or drag the focal point. Focus it and use the arrow keys; hold Shift for larger steps."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"text-xs uppercase tracking-wide text-[#888]",children:[f," live preview"]}),a.jsx("div",{className:"w-full bg-black overflow-hidden border border-[#444]",style:{aspectRatio:`${u}/1`},children:a.jsx("img",{src:zt(N.url,H.current?.site??t),alt:`Live ${f} ${h} crop preview`,className:"w-full h-full object-cover",style:{objectPosition:`${R.x*100}% ${R.y*100}%`},onError:()=>{O(!0),S("The retained original could not be loaded. Re-upload this image before re-cropping.")}})})]})]}),a.jsxs(u2,{className:"gap-3",children:[a.jsx("button",{type:"button",onClick:()=>re(),disabled:j,className:"border border-[#555] text-white px-4 py-2 text-sm disabled:opacity-50",children:"Cancel"}),a.jsxs("button",{type:"button",onClick:L,disabled:!N||F||x||j||r,className:"bg-white text-black px-4 py-2 text-sm flex items-center gap-2 disabled:opacity-50",children:[j&&a.jsx(Ue,{className:"w-4 h-4 animate-spin"}),j?"Applying…":"Apply crop"]})]})]})})]})}function Pn(e){if(typeof e!="string")return null;const t=e.trim();if(!t)return null;const s=t.split(":");if(s.length!==2&&s.length!==3)return null;const r=s[s.length-1];if(!/^\d+(?:\.\d{1,3})?$/.test(r))return null;const o=Number(r);
63if(!Number.isFinite(o)||o<0||o>=60)return null;const c=s.slice(0,-1);if(c.some(p=>!/^\d+$/.test(p)))return null;const u=c.map(Number);if(u.some(p=>!Number.isFinite(p)||p<0))return null;if(s.length===2){const[p]=u,x=p*60+o;return Number.isFinite(x)?x:null}const[f,h]=u;if(h>59)return null;const m=f*3600+h*60+o;return Number.isFinite(m)?m:null}function _t(e){if(!Number.isFinite(e)||e<0)return"";const t=Math.round(e*1e3);if(!Number.isSafeInteger(t))return"";const s=Math.floor(t/1e3),r=t%1e3,o=Math.floor(s/3600),c=Math.floor(s%3600/60),u=s%60,f=o>0?`${o}:${String(c).padStart(2,"0")}:${String(u).padStart(2,"0")}`:`${c}:${String(u).padStart(2,"0")}`;return r===0?f:`${f}.${String(r).padStart(3,"0").replace(/0+$/,"")}`}function sd(e,t,s){if(e===void 0||!Number.isFinite(e)||e<0)return"Set an In point using M:SS or H:MM:SS.";const r=s!==void 0&&Number.isFinite(s)&&s>=0;if(r&&e>s)return"The In point cannot be after the video duration.";const o=t??(r?s:void 0);return o===void 0?null:!Number.isFinite(o)||o<0?"Set an Out point using M:SS or H:MM:SS.":o<=e?"The Out point must be after the In point.":r&&o>s?"The Out point cannot be after the video duration.":null}function fB(e,t,s,r){const o=e==="start"?t:Pn(s.startText)??void 0,c=e==="end"?t:s.endImplicit?void 0:Pn(s.endText)??void 0,u=e==="start"&&!s.endImplicit&&c===void 0?"Set an Out point using M:SS or H:MM:SS.":sd(o,c,r);return{startSeconds:o,endSeconds:c,error:u}}const pg="https://player.vimeo.com",hB=1e4,$j=2500;function Dd(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function cf(e){return e&&typeof e=="object"?e:{}}function mB(e){if(typeof e=="string")try{const t=JSON.parse(e);return t&&typeof t=="object"?t:null}catch{return null}return e&&typeof e=="object"?e:null}function qj(e){return Dd(e)??Dd(cf(e).seconds)}function Hj(e){return Dd(e)??Dd(cf(e).duration)}function pB(e){const t=cf(e).message;return typeof t=="string"&&t.trim()?t:"Vimeo reported a playback error."}function gB(e,t,s){if(e.origin!==pg||!t||e.source!==t.contentWindow)return!1;try{const r=new URL(t.src),o=new URL(s);return r.origin===o.origin&&r.pathname===o.pathname&&r.search===o.search}catch{return!1}}function xB({url:e,startSeconds:t,endSeconds:s,disabled:r=!1,onChange:o,onBusyChange:c}){const u=y.useMemo(()=>KC(e,{autoplay:!1,playsInline:!0}),[e]),f=y.useRef(null),h=y.useRef(!1),m=y.useRef(!1),p=y.useRef(0),x=y.useRef(null),v=y.useRef(null),j=y.useRef(0),w=y.useRef(0),C=y.useRef(u),S=y.useRef(void 0),N=y.useRef(o),E=y.useRef(!1),R=y.useRef(!1),D=y.useRef({startText:"",endText:"",endImplicit:s===void 0}),[A,_]=y.useState(u?"loading":"error"),[F,O]=y.useState(u?"":"Enter a valid Vimeo URL to load the range editor."),[I,V]=y.useState(),[H,k]=y.useState(),[q,J]=y.useState(!1),[re,U]=y.useState(""),[L,z]=y.useState(Number.isFinite(t)?_t(t):"0:00"),[W,M]=y.useState(Number.isFinite(s)?_t(s):""),[K,ie]=y.useState(s===void 0),[ee,ae]=y.useState(""),[oe,le]=y.useState(!1),[Ne,ce]=y.useState("");S.current=I,N.current=o,D.current={startText:L,endText:W,endImplicit:K};const xe=A==="ready"&&h.current,ut=Pn(L),nt=K?I:Pn(W),tn=nt===null?void 0:nt,
63nn=!K&&nt===null?"Set an Out point using M:SS or H:MM:SS.":sd(ut===null?void 0:ut,tn,I),Rt=ee||nn||"",jt=ut===null?void 0:ut,ui=tn,Ft=xe&&!Rt&&jt!==void 0&&ui!==void 0&&ui>jt,di=q||!!Rt;y.useEffect(()=>{c?.(di)},[di,c]),y.useEffect(()=>{C.current!==u&&(C.current=u,h.current=!1,m.current=!1,Vn(),le(!1),ce(""),V(void 0),k(void 0),J(!1),U(""),ae(""),_(u?"loading":"error"),O(u?"":"Enter a valid Vimeo URL to load the range editor."),z(Number.isFinite(t)?_t(t):"0:00"),ie(s===void 0),M(Number.isFinite(s)?_t(s):I===void 0?"":_t(I)))},[u,s,t]),y.useEffect(()=>{C.current===u&&(E.current||(z(Number.isFinite(t)?_t(t):"0:00"),ae("")))},[t]),y.useEffect(()=>{C.current===u&&(R.current||(ie(s===void 0),M(Number.isFinite(s)?_t(s):I===void 0?"":_t(I)),ae("")))},[s]),y.useEffect(()=>{!K||I===void 0||M(_t(I))},[I,K]);function Gt($e,ft){const dt=f.current;!dt||!u||!h.current||dt.contentWindow?.postMessage(JSON.stringify({method:$e,value:ft}),pg)}function Ji(){h.current||(h.current=!0,_("ready"),O(""),Gt("addEventListener","timeupdate"),Gt("addEventListener","playing"),Gt("addEventListener","pause"),Gt("addEventListener","error"),Gt("addEventListener","ended"),Gt("getDuration"))}function Vn(){const $e=v.current;$e&&window.clearTimeout($e.timer),v.current=null}function _s($e){if(!m.current||!Number.isFinite($e))return;Vn();const ft=++w.current,dt=j.current,pt=window.setTimeout(()=>{v.current?.token!==ft||v.current?.generation!==dt||(v.current=null,ce("The selection seek timed out. Use Vimeo’s controls to play the armed preview."))},$j);v.current={generation:dt,token:ft,timer:pt},Gt("setCurrentTime",$e)}y.useEffect(()=>{if(h.current=!1,!u){_("error"),O("Enter a valid Vimeo URL to load the range editor.");return}_("loading"),O("");const $e=u,ft=window.setTimeout(()=>{h.current||(_("error"),O("Vimeo did not become ready. Check the link, privacy settings, or try again."))},hB);function dt(pt){if(!gB(pt,f.current,$e))return;const Oe=mB(pt.data);if(Oe){if(Oe.event==="ready"||Oe.method==="ping"&&!h.current){Ji();return}if(Oe.event==="error"){O(pB(Oe.data??Oe.value)),h.current||_("error");return}if(Oe.method==="getDuration"){const st=Hj(Oe.value);st!==void 0&&st>=0&&V(st);return}if(Oe.method==="getCurrentTime"){const st=x.current,Mt=qj(Oe.value);if(!st||Mt===void 0)return;if(window.clearTimeout(st.timer),x.current=null,J(!1),U(""),k(Mt),st.token===p.current){const Yt=st.kind;if(Yt==="start"||Yt==="end"){const rn=D.current,En=fB(Yt,Mt,rn,S.current);Yt==="start"?z(_t(Mt)):(ie(!1),M(_t(Mt))),En.error?ae(En.error):(ae(""),N.current({startSeconds:En.startSeconds,endSeconds:En.endSeconds}))}}return}if(Oe.method==="setCurrentTime"){const st=v.current;if(!st)return;window.clearTimeout(st.timer),v.current=null,m.current&&st.generation===j.current&&Gt("play");return}if(Oe.event==="timeupdate"){const st=cf(Oe.data??Oe.value),Mt=qj(Oe.data??Oe.value),sn=Hj(Oe.data??Oe.value);if(Mt!==void 0){k(Mt),sn!==void 0&&sn>=0&&S.current===void 0&&V(sn);const Yt=D.current,rn=Pn(Yt.startText),En=Yt.endImplicit?void 0:Pn(Yt.endText),xn=rn===null?0:rn,fi=Yt.endImplicit?sn??S.current:En===null?void 0:En;m.current&&!v.current&&(Mt<xn&&xn>0||fi!==void 0&&fi>xn&&Mt>=fi-.08)&&_s(xn)}st.duration!==void 0&&sn!==void 0&&V(sn);return}if(Oe.event==="ended"&&m.current&&D.current.endImplicit){const st=Pn(D.current.startText);_s(st===null?0:st);return}if(Oe.event==="playing"){ce(""),O("");return}Oe.event==="pause"&&m.current&&ce("Preview armed. If Vimeo did not start automatically, press Play in the Vimeo controls.")}}return window.addEventListener("message",dt),()=>{window.clearTimeout(ft),window.removeEventListener("message",dt);const pt=x.current;pt&&window.clearTimeout(pt.timer),x.current=null,Vn(),j.current+=1,p.current+=1}},[u]);function Nn($e){if(!xe||q)return;const ft=++p.current;J(!0),U("");const dt=window.setTimeout(()=>{x.current?.token===ft&&(x.current=null,J(!1),U("Vimeo did not return its current time. Try again after the player is ready."))},$j);x.current={kind:$e,token:ft,timer:dt},Gt("getCurrentTime")}function Le($e){p.current+=1,z($e),U("");const ft=Pn($e),dt=K?I:Pn(W),pt=dt===null?void 0:dt,Oe=!K&&dt===null?"Set an Out point using M:SS or H:MM:SS.":sd(ft===null?void 0:ft,pt,I);ae(Oe||""),!(Oe||ft===null)&&o({startSeconds:ft,endSeconds:K?void 0:pt})}function Ls($e){p.current+=1,M($e),ie(!1),U("");
63const ft=Pn($e);if(ft===null){ae("Set an Out point using M:SS or H:MM:SS.");return}const dt=ft===null?void 0:ft,pt=Pn(L),Oe=sd(pt===null?void 0:pt,dt===null?void 0:dt,I);ae(Oe||""),!(Oe||pt===null)&&o({startSeconds:pt,endSeconds:dt})}function Us(){p.current+=1,z("0:00"),M(I===void 0?"":_t(I)),ie(!0),ae(""),U(""),o({startSeconds:void 0,endSeconds:void 0})}function kt(){p.current+=1,z(Number.isFinite(t)?_t(t):"0:00"),ie(s===void 0),M(Number.isFinite(s)?_t(s):I===void 0?"":_t(I)),ae(""),U("")}function Cn(){!Ft||jt===void 0||(m.current=!0,j.current+=1,le(!0),ce("Preview armed. If playback does not start automatically, press Play in the Vimeo controls."),_s(jt))}function Vt(){m.current=!1,j.current+=1,Vn(),le(!1),ce(""),Gt("pause")}function br(){Gt("play")}return a.jsxs("div",{className:"space-y-4 border border-[#333] bg-[#050505] p-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("div",{className:"text-[13px] uppercase tracking-wide text-[#8a8a8a]",children:"Vimeo range"}),a.jsx("div",{className:"relative aspect-video w-full max-w-[640px] overflow-hidden border border-[#333] bg-black",children:u?a.jsx("iframe",{ref:f,src:u,title:"Vimeo preview range editor",className:"absolute inset-0 h-full w-full border-0",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,onLoad:()=>{f.current?.contentWindow&&f.current.contentWindow.postMessage(JSON.stringify({method:"ping"}),pg)}},u):a.jsx("div",{className:"flex h-full items-center justify-center p-5 text-center text-sm text-[#888]",children:"Enter a valid Vimeo URL to load its native controls."})}),A==="loading"&&a.jsxs("div",{className:"flex items-center gap-2 text-xs text-[#aaa]",role:"status",children:[a.jsx(Ue,{className:"h-3.5 w-3.5 animate-spin"}),"Waiting for the Vimeo player…"]}),A==="ready"&&!F&&a.jsx("p",{className:"text-xs text-[#888]",children:"Scrub with Vimeo’s controls, then set the In and Out points below."}),(F||re)&&a.jsx("p",{className:"text-sm text-red-300",role:"alert",children:F||re})]}),a.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[a.jsxs("label",{className:"space-y-1 text-sm text-[#aaa]",children:[a.jsx("span",{children:"In"}),a.jsx("input",{"aria-label":"Vimeo In timecode",value:L,onFocus:()=>{E.current=!0},onBlur:()=>{E.current=!1;const $e=Pn(L);$e!==null&&z(_t($e))},onChange:$e=>Le($e.target.value),disabled:r,placeholder:"0:00",className:"w-full border border-[#444] bg-black p-2.5 text-white outline-none transition-colors focus:border-white disabled:opacity-50"})]}),a.jsxs("label",{className:"space-y-1 text-sm text-[#aaa]",children:[a.jsxs("span",{children:["Out ",K?"(end)":""]}),a.jsx("input",{"aria-label":"Vimeo Out timecode",value:W,onFocus:()=>{R.current=!0},onBlur:()=>{R.current=!1;const $e=Pn(W);$e!==null&&M(_t($e))},onChange:$e=>Ls($e.target.value),disabled:r,placeholder:I===void 0?"end":_t(I),className:"w-full border border-[#444] bg-black p-2.5 text-white outline-none transition-colors focus:border-white disabled:opacity-50"})]})]}),Rt&&a.jsxs("div",{className:"space-y-2",role:"alert",children:[a.jsx("p",{className:"text-sm text-red-300",children:Rt}),a.jsxs("button",{type:"button",onClick:kt,disabled:r,className:"inline-flex items-center gap-2 border border-[#555] px-3 py-1.5 text-xs text-white hover:border-white disabled:opacity-50",children:[a.jsx(PN,{className:"h-3.5 w-3.5"}),"Revert fields"]})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("button",{type:"button",onClick:()=>Nn("start"),disabled:r||!xe||q,className:"border border-[#555] px-3 py-2 text-sm text-white hover:border-white disabled:opacity-50",children:q?"Reading…":"Set In"}),a.jsx("button",{type:"button",onClick:()=>Nn("end"),disabled:r||!xe||q,className:"border border-[#555] px-3 py-2 text-sm text-white hover:border-white disabled:opacity-50",children:q?"Reading…":"Set Out"}),a.jsx("button",{type:"button",onClick:Us,disabled:r,className:"px-3 py-2 text-sm text-[#aaa] hover:text-white disabled:opacity-50",children:"Clear trim"}),H!==void 0&&a.jsxs("span",{className:"text-xs text-[#777]",children:["Current position ",_t(H)]})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-t border-[#333] pt-3",children:[a.jsx("button",{type:"button",onClick:Cn,disabled:r||!Ft,className:"bg-white px-3 py-2 text-sm text-black hover:bg-[#e5e5e5] disabled:opacity-50",children:"Preview Selection"}),a.jsx("button",{type:"button",onClick:Vt,disabled:r||!oe,className:"border border-[#555] px-3 py-2 text-sm text-white hover:border-white disabled:opacity-50",children:"Stop Preview"}),oe&&a.jsx("span",{className:"text-xs text-[#aaa]",role:"status",children:"Selection loop armed"})]}),Ne&&a.jsxs("p",{className:"text-xs text-[#d0d0d0]",role:"status",children:[Ne," ",a.jsx("button",{type:"button",onClick:br,disabled:r||!xe,className:"underline underline-offset-2 hover:text-white disabled:opacity-50",children:"Play in Vimeo"})]})]})}function yB({site:e,value:t,onChange:s,disabled:r,onBusyChange:o}){const{toast:c}=Sn(),u=y.useRef(t),[f,h]=y.useState(!1),[m,p]=y.useState(!1);y.useEffect(()=>{u.current=t},[t]);const x=E=>{u.current=E,s(E)},{uploadFile:v,isUploading:j}=Rs({site:e,onSuccess:E=>{const R={...u.current,source:"upload",clip:E};u.current=R,s(R)},onError:E=>c({title:"Upload failed",description:E instanceof Error?E.message:String(E),variant:"destructive"})}),{uploadFile:w,isUploading:C}=Rs({site:e,onSuccess:E=>{const R={...u.current,still:E};u.current=R,s(R)},onError:E=>c({title:"Upload failed",description:E instanceof Error?E.message:String(E),variant:"destructive"})});y.useEffect(()=>{o&&o(j||C||m||t.source==="vimeo"&&f)},[j,C,m,f,t.source,o]);const N=r||(j||C||m);return a.jsxs("div",{className:"space-y-4 border border-[#333] bg-[#050505] p-6",children:[a.jsx("h3",{className:"text-[15px] text-white",children:"Preview Media"}),a.jsx("p",{className:"text-[14px] text-[#8a8a8a]",children:"This media is used in the homepage cycle (if featured) and other preview cards."}),a.jsxs("div",{className:"grid grid-cols-3 gap-4 border-b border-[#333] pb-6",children:[a.jsxs("label",{className:`flex items-center gap-2 cursor-pointer ${N?"o
63pacity-50 pointer-events-none":""}`,children:[a.jsx("input",{type:"radio",name:"previewSource",value:"upload",checked:t.source==="upload",onChange:()=>x({...u.current,source:"upload"}),disabled:N,className:"accent-white"}),a.jsx(Cl,{className:"w-4 h-4 text-[#8a8a8a]"}),a.jsx("span",{className:"text-[14px] text-white",children:"MP4 Upload"})]}),a.jsxs("label",{className:`flex items-center gap-2 cursor-pointer ${N?"opacity-50 pointer-events-none":""}`,children:[a.jsx("input",{type:"radio",name:"previewSource",value:"vimeo",checked:t.source==="vimeo",onChange:()=>x({...u.current,source:"vimeo"}),disabled:N,className:"accent-white"}),a.jsx(ON,{className:"w-4 h-4 text-[#8a8a8a]"}),a.jsx("span",{className:"text-[14px] text-white",children:"Vimeo Link"})]}),a.jsxs("label",{className:`flex items-center gap-2 cursor-pointer ${N?"opacity-50 pointer-events-none":""}`,children:[a.jsx("input",{type:"radio",name:"previewSource",value:"still",checked:t.source==="still",onChange:()=>x({...u.current,source:"still"}),disabled:N,className:"accent-white"}),a.jsx(_l,{className:"w-4 h-4 text-[#8a8a8a]"}),a.jsx("span",{className:"text-[14px] text-white",children:"Still Image"})]})]}),a.jsxs("div",{className:"pt-2",children:[t.source==="upload"&&a.jsxs("div",{className:"space-y-4",children:[t.clip?a.jsx("div",{className:"relative w-full max-w-[400px] aspect-video bg-black border border-[#333]",children:a.jsx("video",{src:zt(t.clip,e),className:"w-full h-full object-cover",controls:!0,muted:!0})}):a.jsx("div",{className:"text-[14px] text-[#8a8a8a]",children:"No video uploaded yet."}),a.jsxs("div",{className:"flex gap-4",children:[a.jsxs("label",{className:`cursor-pointer bg-white text-black px-4 py-2 text-[14px] inline-block ${N?"opacity-50 pointer-events-none":"hover:bg-[#e5e5e5] transition-colors"}`,children:[j?a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx(Ue,{className:"w-4 h-4 animate-spin"})," Uploading..."]}):t.clip?"Replace Video":"Upload Video (MP4)",a.jsx("input",{type:"file",accept:"video/mp4",className:"hidden",disabled:N,onChange:async E=>{const R=E.target.files?.[0];if(E.target.value="",R)try{await v(R,"clip")}catch{}}})]}),t.clip&&a.jsx("button",{type:"button",onClick:()=>x({...u.current,source:"still",clip:void 0}),disabled:N,className:"text-[14px] text-[#8a8a8a] hover:text-white",children:"Remove"})]}),a.jsx("p",{className:"text-[13px] text-[#8a8a8a] mt-2",children:"MP4 only, max 5MB, up to 12s."})]}),t.source==="vimeo"&&a.jsxs("div",{className:"space-y-4",children:[a.jsx(Kr,{className:"text-[14px] text-[#8a8a8a]",children:"Vimeo URL"}),!t.vimeoUrl&&a.jsx("p",{className:"text-sm text-amber-200",children:"Your draft can save without a preview URL. Add the Vimeo URL or choose Still Image before publishing."}),a.jsx("input",{type:"text",value:t.vimeoUrl||"",onChange:E=>x({...u.current,vimeoUrl:E.target.value,startSeconds:void 0,endSeconds:void 0}),disabled:N,placeholder:"https://vimeo.com/...",className:"w-full bg-black border border-[#333] p-3 text-white focus:border-white outline-none transition-colors"}),a.jsx(xB,{url:t.vimeoUrl||"",startSeconds:t.startSeconds,endSeconds:t.endSeconds,disabled:N,onChange:E=>x({...u.current,...E}),onBusyChange:h})]}),a.jsxs("div",{className:"space-y-4 mt-6",children:[a.jsx("h4",{className:"text-sm text-white",children:"Preview still (2.39:1)"}),a.jsx("p",{className:"text-[13px] text-[#8a8a8a]",children:"Upload or recrop the image shown before the motion preview. This does not change the video or its In and Out points."}),t.still?a.jsx("div",{className:"relative w-full max-w-[400px] aspect-[2.39/1] bg-black border border-[#333]",children:a.jsx("img",{src:zt(t.still,e),alt:"Preview still",className:"w-full h-full object-cover"})}):null,a.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[a.jsxs("label",{className:`cursor-pointer bg-white text-black px-4 py-2 text-[14px] inline-block ${N?"opacity-50 pointer-events-none":"hover:bg-[#e5e5e5] transition-colors"}`,children:[C?a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx(Ue,{className:"w-4 h-4 animate-spin"})," Uploading..."]}):t.still?"Replace Still":"Upload Still",a.jsx("input",{type:"file",accept:"image/*",className:"hidden",disabled:N,onChange:async E=>{const R=E.target.files?.[0];if(E.target.value="",R)try{await w(R,"still")}catch{}}})]}),a.jsx(Od,{imagePath:t.still,site:e,disabled:r||j||C,onBusyChange:p,onApply:E=>x({...u.current,still:E})}),t.still&&a.jsx("button",{type:"button",onClick:()=>x({...u.current,still:void 0}),disabled:N,className:"text-[14px] text-[#8a8a8a] hover:text-white",children:"Remove"})]})]})]})]})}const vB="w-full bg-[#050505] border border-[#333] p-3 text-white focus:border-white outline-none transition-colors",Pu="border border-[#333] px-3 py-2 text-sm text-white hover:border-white focus-visible:outline focus-visible:outline-white disabled:opacity-30 disabled:cursor-not-allowed";function bB({data:e,onChange:t}){function s(o,c){t(u=>({...u,[o]:c(u[o]||[])}))}function r(o,c,u){s(o,f=>{const h=[...f],m=c+u;return m<0||m>=f.length?f:([h[c],h[m]]=[h[m],h[c]],h)})}return a.jsxs("section",{"aria-labelledby":"film-credits-heading",className:"space-y-6",children:[a.jsx("h2",{id:"film-credits-heading",className:"text-[17px] text-[#8a8a8a] border-b border-[#333] pb-2",children:"Film Credits"}),["keyCredits","fullCredits"].map(o=>{const c=o==="keyCredits"?"Key credits":"Full credits",u=e[o]||[];return a.jsxs("fieldset",{className:"min-w-0 space-y-4 border border-[#333] p-4 md:p-6",children:[a.jsx("legend",{className:"px-2 text-white",children:c}),a.jsx("p",{className:"text-sm text-[#8a8a8a]",children:o==="keyCredits"?"Shown with the film details, below the logline.":"Additional credits shown when a visitor selects Full credits. You don't need to repeat key credits here."}),u.length===0&&a.jsxs("p",{className:"text-sm text-[#8a8a8a]",children:["No ",c.toLowerCase()," added."]}),u.map((f,h)=>a.jsxs("div",{className:"space-y-3 border-b border-[#222] pb-4",children:[a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:["role","name"].map(m=>a.jsxs("label",{className:"block space-y-2 text-sm text-[#8a8a8a]",children:[a.jsx("span",{children:m==="role"?"Role":"Name / company"}),a.jsx("input",{"aria-label":`${c} ${h+1} ${m}`,value:f[m],placeholder:m==="role"?"e.g. Cinematography":"Person or company",className:vB,onChange:p=>{const x=p.target.value;s(o,v=>v.map((j,w)=>w===h?{...j,[m]:x}:j))}})]},m))}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsx("button",{type:"button",className:Pu,disabled:h===0,"aria-label":`Move ${c.toLowerCase()} ${h+1} up`,onClick:()=>r(o,h,-1),children:"Move up"}),a.jsx("button",{type:"button",className:Pu,disabled:h===u.length-1,"aria-label":`Move ${c.toLowerCase()} ${h+1} down`,onClick:()=>r(o,h,1),children:"Move down"}),a.jsx("button",{type:"button",className:Pu,"aria-label":`Remove ${c.toLowerCase()} ${h+1}`,onClick:()=>s(o,m=>m.filter((p,x)=>x!==h)),children:"Remove"})]})]},h)),a.jsxs("button",{type:"button",className:Pu,onClick:()=>s(o,f=>[...f,{role:"",name:""}]),children:["Add ",o==="keyCredits"?"key credit":"full credit"]})]},o)})]})}function b2({id:e,initialCollection:t}){const s=mt(),{data:r}=Os({site:s}),{toast:o}=Sn(),c=!e||e==="new",u=`${t}:${c?"new":e}`,[f]=y.useState(()=>c?p2(u)?.current.data.id||crypto.randomUUID():e),[h,m]=y.useState(t),[p,x]=y.useState({id:f,title:"",slug:"",type:h==="films"?"Feature":"Commercial",year:"",status:"",homepageCaption:"",logline:"",poster:"",workGridImage:"",shareImage:"",vimeoUrl:"",watchFilmUrl:"",showTrailer:!1,showScreenerLine:!1,showDistributor:!1,distributor:"",ke
63yCredits:[],fullCredits:[],published:!1,showOnMichael:!0,showOnAlreadyAlive:h==="films",order:999,client:"",context:"",agency:"",productionCompany:"",still:"",showInBrandRow:!1,brandLabel:"",featuredOnHomepage:c?!1:void 0}),v=y.useRef(null);y.useEffect(()=>{if(r&&!c&&v.current!==f){let k=r.films.find(q=>q.id===f);if(k){m("films"),x(k),v.current=f;return}k=r.work.find(q=>q.id===f),k&&(m("work"),x(k),v.current=f)}},[r,f,c]);const{uploadFile:j,isUploading:w}=Rs({site:s,onSuccess:k=>x(q=>({...q,poster:k})),onError:()=>o({title:"Upload failed",variant:"destructive"})}),C=y.useRef(null),{uploadFile:S,isUploading:N}=Rs({site:s,onSuccess:k=>x(q=>({...q,workGridImage:k})),onError:()=>o({title:"Grid image upload failed",variant:"destructive"})}),E=k=>x(q=>({...q,still:k,previewMedia:{...Zr(r||{cycle:[]},q),still:k}})),R=Zr(r||{cycle:[]},p).still,{uploadFile:D,isUploading:A}=Rs({site:s,onSuccess:E,onError:()=>o({title:"Upload failed",variant:"destructive"})}),[_,F]=y.useState(!1),[O,I]=y.useState(!1),V=w||N||A||_||O,H=ZV({itemId:f,isNew:c,content:r,data:p,collection:h,busy:V,ready:!!r&&(c||v.current===f),recoveryKey:u,restore:k=>{x(k.data),m(k.collection)}});return r?a.jsxs("fieldset",{"aria-busy":H.saving||V,className:"p-8 md:p-12 max-w-4xl mx-auto pb-32 min-w-0 w-full",children:[a.jsxs(xt,{href:"/admin/work",className:"text-[#8a8a8a] hover:text-white inline-flex items-center gap-2 mb-8 transition-colors",children:[a.jsx(TN,{className:"w-4 h-4"})," Back to Master List"]}),a.jsxs("div",{className:"flex justify-between items-center mb-12",children:[a.jsx("h1",{className:"text-2xl text-white",children:c?"New Entry":"Edit Entry"}),a.jsxs("div",{className:"text-right text-sm text-[#aaa]",role:"status","aria-live":"polite",children:[a.jsxs("div",{className:"flex items-center justify-end gap-2",children:[H.saving||V?a.jsx(Ue,{className:"w-4 h-4 animate-spin"}):!H.dirty&&!H.error?a.jsx(zg,{className:"w-4 h-4"}):null,V?_?"Finish the preview edit to save…":"Uploading / processing…":H.saving?"Saving draft…":H.error?"Not saved":H.dirty?"Changes waiting to save…":c?"Autosave is on":"All changes saved"]}),a.jsx("p",{className:"mt-1 text-xs",children:"Draft only · Publish Changes makes it live"})]})]}),H.error&&a.jsxs("div",{role:"alert",className:"mb-8 border border-red-900 bg-red-950/20 p-4 text-sm text-red-200",children:[a.jsx("p",{children:H.error}),a.jsx("button",{type:"button",onClick:H.retry,disabled:H.saving||V,className:"mt-2 underline disabled:opacity-50",children:"Retry autosave"})]}),H.recoveryUnavailable&&H.dirty&&a.jsx("p",{role:"alert",className:"mb-6 text-sm text-amber-200",children:"Your browser cannot keep a recovery copy. Keep this tab open until all changes are saved."}),c&&a.jsxs("div",{className:"mb-12 border border-[#333] bg-[#050505] p-6 flex items-center gap-6",children:[a.jsx("span",{className:"text-white text-[15px]",children:"Collection Type:"}),a.jsxs("div",{className:"flex gap-4",children:[a.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[a.jsx("input",{type:"radio",name:"collectionType",checked:h==="films",onChange:()=>{m("films"),x(k=>({...k,type:"Feature",showOnAlreadyAlive:!0}))},className:"accent-white"}),a.jsx("span",{className:"text-white text-[15px]",children:"Film"})]}),a.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[a.jsx("input",{type:"radio",name:"collectionType",checked:h==="work",onChange:()=>{m("work"),x(k=>({...k,type:r.settings.types[0]||"Commercial",showOnAlreadyAlive:!1}))},className:"accent-white"}),a.jsx("span",{className:"text-white text-[15px]",children:"Work"})]})]})]}),a.jsxs("div",{className:"space-y-12",children:[a.jsxs("div",{className:"space-y-6",children:[a.jsx("h2",{className:"text-[17px] text-[#8a8a8a] border-b border-[#333] pb-2",children:"Core Info"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[15px] text-[#8a8a8a]",children:"Title"}),a.jsx("input",{value:p.title||"",onChange:k=>x({...p,title:k.target.value}),className:"w-full bg-[#050505] border border-[#333] p-3 text-white focus:border-white outline-none transition-colors",placeholder:h==="films"?"After the Silence":"A lil Sensitive"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[15px] text-[#8a8a8a]",children:"Slug"}),a.jsx("input",{value:p.slug||"",onChange:k=>x({...p,slug:k.target.value}),className:"w-full bg-[#050505] border border-[#333] p-3 text-white focus:border-white outline-none transition-colors",placeholder:h==="films"?"after-the-silence":"a-lil-sensitive"})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[15px] text-[#8a8a8a]",children:"Type"}),h==="films"?a.jsxs("select",{value:p.type||"Feature",onChange:k=>x({...p,type:k.target.value}),className:"w-full bg-[#050505] border border-[#333] p-3 text-white focus:border-white outline-none transition-colors appearance-none",children:[a.jsx("option",{value:"Feature",children:"Feature"}),a.jsx("option",{value:"Short",children:"Short"}),a.jsx("option",{value:"Episodic",children:"Episodic"})]}):a.jsx("select",{value:p.type||"",onChange:k=>x({...p,type:k.target.value}),className:"w-full bg-[#050505] border border-[#333] p-3 text-white focus:border-white outline-none transition-colors appearance-none",children:r.settings.types.map(k=>a.jsx("option",{value:k,children:k},k))})]}),h==="work"&&a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[15px] text-[#8a8a8a]",children:"Client/Brand"}),a.jsx("input",{value:p.client||"",onChange:k=>x({...p,client:k.target.value}),className:"w-full bg-[#050505] border border-[#333] p-3 text-white focus:border-white outline-none transition-colors",placeholder:"Cetaphil"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[15px] text-[#8a8a8a]",children:"Year"}),a.jsx("input",{value:p.year||"",onChange:k=>x({...p,year:k.target.value}),className:"w-full bg-[#050505] border border-[#333] p-3 text-white focus:border-white outline-none transition-colors",placeholder:"2024"})]})]}),h==="work"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[15px] text-[#8a8a8a]",children:"Context Line (optional)"}),a.jsx("input",{value:p.context||"",onChange:k=>x({...p,context:k.target.value}),className:"w-full bg-[#050505] border border-[#333] p-3 text-white focus:border-white outline-none transition-colors",placeholder:"Super Bowl LIX"})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[15px] text-[#8a8a8a]",children:"Agency (optional)"}),a.jsx("input",{value:p.agency||"",onChange:k=>x({...p,agency:k.target.value}),className:"w-full bg-[#050505] border border-[#333] p-3 text-white focus:border-white outline-none transition-colors"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[15px] text-[#8a8a8a]",children:"Production Co (optional)"}),a.jsx("input",{value:p.productionCompany||"",onChange:k=>x({...p,productionCompany:k.target.value}),className:"w-full bg-[#050505] border border-[#333] p-3 text-white focus:border-white outline-none transition-colors",placeholder:"m ss ng p eces"})]})]})]}),h==="films"&&a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[15px] text-[#8a8a8a]",children:"Logline (max 300 chars)"}),a.jsx("textarea",{value:p.logline||"",onChange:k=>x({...p,logline:k.target.value}),className:"w-full bg-[#050505] border border-[#333] p-3 text-white focus:border-white outline-none transition-colors min-h-[100px]",maxLength:300})]})]}),h==="films"&&a.jsx(bB,{data:p,onChange:x}),a.jsxs("div",{className:"space-y-6",children:[a.jsx("h2",{className:"text-[17px] text-[#8a8a8a] border-b border-[#333] pb-2",children:"Status & Display"}),a.jsxs("div",{className:"border border-[#333] bg-[#050505] p-6 space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Kr,{htmlFor:"featuredOnHomepage",className:"text-white cursor-pointer text-[15px]",children:"Featured on Homepage"}),a.jsx(Zn,{id:"featuredOnHomepage",checked:Bl(p,h),onCheckedChange:k=>x({...p,featuredOnHomepage:k})})]}),a.jsxs("div",{className:"pt-4 border-t border-[#222] space-y-4",children:[a.jsx("p",{className:"text-sm text-[#8a8a8a]",children:"This project exists once and can appear on both sites. Changes to the public site take effect when you publish."}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Kr,{htmlFor:"showOnMichael",className:"text-white cursor-pointer text-[15px]",children:"Show on Michael"}),a.jsx(Zn,{id:"showOnMichael",checked:p.showOnMichael!==!1,onCheckedChange:k=>x({...p,showOnMichael:k})})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Kr,{htmlFor:"showOnAlreadyAlive",className:"text-white cursor-pointer text-[15px]",children:"Show on Already Alive"}),a.jsx(Zn,{id:"showOnAlreadyAlive",checked:p.showOnAlreadyAlive??h==="films",onCheckedChange:k=>x({...p,showOnAlreadyAlive:k})})]})]})]}),h==="work"&&a.jsx("div",{className:"space-y-6 border border-[#333] bg-[#050505] p-6",children:a.jsxs("div",{className:"space-y-2 pt-4 border-t border-[#111]",children:[a.jsx("label",{className:"text-[15px] text-[#8a8a8a]",children:"Brand Label (for the row)"}),a.jsx("input",{value:p.brandLabel||"",onChange:k=>x({...p,brandLabel:k.target.value}),className:"w-full bg-black border border-[#333] p-3 text-white focus:border-white outline-none transition-colors",placeholder:"e.g. Cetaphil"})]})}),h==="films"&&a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[15px] text-[#8a8a8a]",children:"Status Line (Film page)"}),a.jsx("input",{value:p.status||"",onChange:k=>x({...p,status:k.target.value}),className:"w-full bg-[#050505] border border-[#333] p-3 text-white focus:border-white outline-none transition-colors",placeholder:"World Premiere, Tribeca 2024"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[15px] text-[#8a8a8a]",children:"Homepage Caption"}),a.jsx("input",{value:p.homepageCaption||"",onChange:k=>x({...p,homepageCaption:k.target.value}),className:"w-full bg-[#050505] border border-[#333] p-3 text-white focus:border-white outline-none transition-colors",placeholder:"Tribeca 2024"})]})]})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsx("h2",{className:"text-[17px] text-[#8a8a8a] border-b border-[#333] pb-2",children:"SEO (Optional)"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[15px] text-[#8a8a8a]",children:"SEO Title"}),a.jsx("input",{value:p.seoTitle||"",onChange:k=>x({...p,seoTitle:k.target.value}),className:"w-full bg-[#050505] border border-[#333] p-3 text-white focus:border-white outline-none transition-colors",placeholder:"Custom title tag..."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[15px] text-[#8a8a8a]",children:"SEO Description"}),a.jsx("textarea",{value:p.seoDescription||"",onChange:k=>x({...p,seoDescription:k.target.value}),className:"w-full bg-[#050505] border border-[#333] p-3 text-white focus:border-white outline-none transition-colors min-h-[100px]",placeholder:"Custom meta description..."})]})]})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsx("h2",{className:"text-[17px] text-[#8a8a8a] border-b border-[#333] pb-2",children:"Media"}),a.jsx(yB,{site:s,value:p.previewMedia||Zr(r,p),onChange:k=>x(q=>({...q,previewMedia:k})),disabled:O,onBusyChange:F}),h==="films"?a.jsxs("div",{className:"flex flex-col md:flex-row gap-8",children:[a.jsxs("div",{className:"w-[200px] space-y-4",children:[a.jsx("label",{className:"text-[15px] text-[#8a8a8a]",children:"Poster 
63(2:3)"}),a.jsxs("div",{className:"w-full aspect-[2/3] bg-[#050505] border border-[#333] relative group",children:[p.poster?a.jsx("img",{src:zt(p.poster,s),alt:"",className:"w-full h-full object-cover"}):a.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-[#8a8a8a] gap-2",children:[a.jsx(_l,{className:"w-6 h-6"}),a.jsx("span",{className:"text-[11px]",children:"No Image"})]}),a.jsx("div",{className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:a.jsxs("label",{className:"cursor-pointer bg-white text-black px-3 py-1 text-sm",children:[w?"Uploading...":"Upload",a.jsx("input",{type:"file",className:"hidden",accept:"image/*",onChange:k=>k.target.files?.[0]&&j(k.target.files[0],"poster")})]})})]})]}),a.jsxs("div",{className:"flex-1 space-y-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[15px] text-[#8a8a8a]",children:"Trailer Vimeo URL"}),a.jsx("input",{value:p.vimeoUrl||"",onChange:k=>x({...p,vimeoUrl:k.target.value}),className:"w-full bg-[#050505] border border-[#333] p-3 text-white focus:border-white outline-none transition-colors",placeholder:"https://vimeo.com/..."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[15px] text-[#8a8a8a]",children:"Watch Film URL"}),a.jsx("input",{value:p.watchFilmUrl||"",onChange:k=>x({...p,watchFilmUrl:k.target.value}),className:"w-full bg-[#050505] border border-[#333] p-3 text-white focus:border-white outline-none transition-colors",placeholder:"https://youtube.com/... or https://vimeo.com/..."}),a.jsx("p",{className:"text-[11px] text-[#666]",children:"Adds a Watch Film link that opens the full film in the video player."})]}),a.jsxs("div",{className:"space-y-4 p-4 border border-[#333] bg-[#050505]",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Kr,{htmlFor:"showTrailer",className:"text-white cursor-pointer",children:"Show Trailer Link"}),a.jsx(Zn,{id:"showTrailer",checked:p.showTrailer,onCheckedChange:k=>x({...p,showTrailer:k})})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Kr,{htmlFor:"showScreener",className:"text-white cursor-pointer",children:'Show "Screener available on request"'}),a.jsx(Zn,{id:"showScreener",checked:p.showScreenerLine,onCheckedChange:k=>x({...p,showScreenerLine:k})})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Kr,{htmlFor:"showDist",className:"text-white cursor-pointer",children:"Show Distributor in Status"}),a.jsx(Zn,{id:"showDist",checked:p.showDistributor,onCheckedChange:k=>x({...p,showDistributor:k})})]}),p.showDistributor&&a.jsx("input",{value:p.distributor||"",onChange:k=>x({...p,distributor:k.target.value}),className:"w-full bg-black border border-[#333] p-2 text-white focus:border-white outline-none transition-colors text-sm mt-2",placeholder:"Distributor Name (e.g. Well Go USA)"})]})]})]}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[15px] text-[#8a8a8a]",children:"Vimeo URL"}),a.jsx("input",{value:p.vimeoUrl||"",onChange:k=>x({...p,vimeoUrl:k.target.value}),className:"w-full bg-[#050505] border border-[#333] p-3 text-white focus:border-white outline-none transition-colors",placeholder:"https://vimeo.com/..."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[15px] text-[#8a8a8a]",children:"Still (displayed at 2.39:1)"}),a.jsxs("div",{className:"w-full max-w-[400px] aspect-[2.39/1] bg-[#050505] border border-[#333] relative group",children:[R?a.jsx("img",{src:zt(R,s),alt:"",className:"w-full h-full object-cover"}):a.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-[#8a8a8a] gap-2",children:[a.jsx(_l,{className:"w-6 h-6"}),a.jsx("span",{className:"text-[11px]",children:"No Image"})]}),a.jsx("div",{className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:a.jsxs("label",{className:"cursor-pointer bg-white text-black px-3 py-1 text-sm",children:[A?"Uploading...":"Upload",a.jsx("input",{type:"file",className:"hidden",accept:"image/*",disabled:A||O,onChange:k=>k.target.files?.[0]&&D(k.target.files[0],"still")})]})})]}),a.jsx(Od,{imagePath:R,site:s,disabled:A||_,onBusyChange:I,onApply:E})]})]}),h==="films"&&a.jsxs("div",{className:"space-y-4 max-w-lg",children:[a.jsx("h3",{className:"text-[15px] text-[#8a8a8a]",children:"Work / Grid Image (2.39:1)"}),a.jsx("p",{className:"text-sm text-[#8a8a8a]",children:"Used on the homepage, Work grid, and list hover preview. Your portrait poster stays on the film page. Images are center-cropped to 2.39:1 cinemascope. Optional; leave empty to use the existing image."}),a.jsx("div",{className:"w-full aspect-[2.39/1] bg-[#050505] border border-[#333] overflow-hidden flex items-center justify-center",children:p.workGridImage?a.jsx("img",{src:zt(p.workGridImage,s),alt:"Film Work grid preview",className:"w-full h-full object-cover"}):a.jsx("span",{className:"text-sm text-[#8a8a8a]",children:"No landscape image"})}),a.jsx("input",{ref:C,type:"file",className:"hidden",accept:"image/*","aria-label":"Upload film Work grid image",disabled:N||O,onChange:async k=>{const q=k.target.files?.[0];if(k.target.value="",!!q)try{await S(q,"workGrid")}catch{}}}),a.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[a.jsx("button",{type:"button",onClick:()=>C.current?.click(),disabled:N||O,className:"bg-white text-black px-4 py-2 text-sm disabled:opacity-50",children:N?"Uploading…":p.workGridImage?"Replace image":"Upload image"}),a.jsx(Od,{imagePath:p.workGridImage,site:s,disabled:N,onBusyChange:I,onApply:k=>x(q=>({...q,workGridImage:k}))}),p.workGridImage&&a.jsx("button",{type:"button",disabled:N||O,onClick:()=>x(k=>({...k,workGridImage:""})),className:"text-sm text-[#8a8a8a] hover:text-white disabled:opacity-50",children:"Remove image"})]})]})]})]})]}):null}function Kj(){const[,e]=Qi("/admin/films/:id"),t=e?.id||"new";return a.jsx(b2,{id:t,initialCollection:"films"},t)}var wB=Object.defineProperty,jB=(e,t)=>wB(e,"name",{value:t,configurable:!0}),SB=y.createContext(void 0);function Xx(e){const t=y.useContext(SB);return e||t||"ltr"}jB(Xx,"useDirection");var NB=Object.defineProperty,Zx=(e,t)=>NB(e,"name",{value:t,configurable:!0}),op=!1;function w2(){const[e,t]=y.useState(op);return y.useEffect(()=>{op||(op=!0,t(!0))},[]),e}Zx(w2,"useIsHydrated");var j2=Gi[" useSyncExternalStore ".trim().toString()];function S2(){return()=>{}}Zx(S2,"subscribe");function N2(){return j2(S2,()=>!0,()=>!1)}Zx(N2,"useIsHydratedModern");var CB=typeof j2=="function"?N2:w2,EB=Object.defineProperty,Wi=(e,t)=>EB(e,"name",{value:t,configurable:!0}),lp="rovingFocusGroup.onEntryFocus",TB={bubbles:!1,cancelable:!0},uf="RovingFocusGroup",[gg,C2,AB]=Ud(uf),[RB,E2]=ss(uf,[AB]),[kB,MB]=RB(uf),OB=y.forwardRef(Wi(function(t,s){return a.jsx(gg.Provider,{scope:t.__scopeRovingFocusGroup,children:a.jsx(gg.Slot,{scope:t.__scopeRovingFocusGroup,children:a.jsx(DB,{...t,ref:s})})})},"RovingFocusGroup")),DB=y.forwardRef(Wi(function(t,s){const{__scopeRovingFocusGroup:r,orientation:o,loop:c=!1,dir:u,currentTabStopId:f,defaultCurrentTabStopId:h,onCurrentTabStopIdChange:m,onEntryFocus:p,preventScrollOnEntryFocus:x=!1,...v}=t,j=y.useRef(null),w=Ge(s,j),C=Xx(u),[S,N]=lo({prop:f,defaultProp:h??null,onChange:m,caller:uf}),[E,R]=y.useState(!1),D=In(p),A=C2(r),_=y.useRef(!1),[F,O]=y.useState(0);return y.useEffect(()=>{const I=j.current;if(I)return I.addEventListener(lp,D),()=>I.removeEventListener(lp,D)},[D]),a.jsx(kB,{scope:r,orientation:o,dir:C,loop:c,currentTabStopId:S,onItemFocus:y.useCallback(I=>N(I),[N]),onItemShiftTab:y.useCallback(()=>R(!0),[]),onFocusableItemAdd:y.useCallback(()=>O(I=>I+1),[]),onFocusableItemRemove:y.useCallback(()=>O(I=>I-1),[]),children:a.jsx(Xe.div,{tabIndex:E||F===0?-1:0,"data-orientation":o,...v,ref:w,style:{outline:"none",...t.style},onMouseDown:ge(t.onMouseDown,()=>{_.current=!0}),onFocus:ge(t.onFocus,I=>{const V=!_.current;if(I.target===I.currentTarget&&V&&!E){const H=new CustomEvent(lp,TB);if(I.currentTarget.dispatchEvent(H),!H.defaultPrevented){const k=A().filter(L=>L.focusable),q=k.find(L=>L.active),J=k.find(L=>
63L.id===S),U=[q,J,...k].filter(Boolean).map(L=>L.ref.current);Jx(U,x)}}_.current=!1}),onBlur:ge(t.onBlur,()=>R(!1))})})},"RovingFocusGroupImpl")),PB="RovingFocusGroupItem",_B=y.forwardRef(Wi(function(t,s){const{__scopeRovingFocusGroup:r,focusable:o=!0,active:c=!1,tabStopId:u,children:f,...h}=t,m=Ii(),p=u||m,x=MB(PB,r),v=x.currentTabStopId===p,j=C2(r),{onFocusableItemAdd:w,onFocusableItemRemove:C,currentTabStopId:S}=x,N=CB();return pn(()=>{if(!(!N||!o))return w(),()=>C()},[N,o,w,C]),y.useEffect(()=>{if(!(N||!o))return w(),()=>C()},[N,o,w,C]),a.jsx(gg.ItemSlot,{scope:r,id:p,focusable:o,active:c,children:a.jsx(Xe.span,{tabIndex:v?0:-1,"data-orientation":x.orientation,...h,ref:s,onMouseDown:ge(t.onMouseDown,E=>{o?x.onItemFocus(p):E.preventDefault()}),onFocus:ge(t.onFocus,()=>x.onItemFocus(p)),onKeyDown:ge(t.onKeyDown,E=>{if(E.key==="Tab"&&E.shiftKey){x.onItemShiftTab();return}if(E.target!==E.currentTarget)return;const R=A2(E,x.orientation,x.dir);if(R!==void 0){if(E.metaKey||E.ctrlKey||E.altKey||E.shiftKey)return;E.preventDefault();let A=j().filter(_=>_.focusable).map(_=>_.ref.current);if(R==="last")A.reverse();else if(R==="prev"||R==="next"){R==="prev"&&A.reverse();const _=A.indexOf(E.currentTarget);A=x.loop?R2(A,_+1):A.slice(_+1)}setTimeout(()=>Jx(A))}}),children:typeof f=="function"?f({isCurrentTabStop:v,hasTabStop:S!=null}):f})})},"RovingFocusGroupItem")),LB={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function T2(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}Wi(T2,"getDirectionAwareKey");function A2(e,t,s){const r=T2(e.key,s);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return LB[r]}Wi(A2,"getFocusIntent");function Jx(e,t=!1){const s=document.activeElement;for(const r of e)if(r===s||(r.focus({preventScroll:t}),document.activeElement!==s))return}Wi(Jx,"focusFirst");function R2(e,t){return e.map((s,r)=>e[(t+r)%e.length])}Wi(R2,"wrapArray");var UB=OB,IB=_B,zB=Object.defineProperty,Be=(e,t)=>zB(e,"name",{value:t,configurable:!0}),xg=["Enter"," "],FB=["ArrowDown","PageUp","Home"],k2=["ArrowUp","PageDown","End"],VB=[...FB,...k2],BB={ltr:[...xg,"ArrowRight"],rtl:[...xg,"ArrowLeft"]},$B={ltr:["ArrowLeft"],rtl:["ArrowRight"]},df="Menu",[Ql,qB,HB]=Ud(df),[Xi,M2]=ss(df,[HB,Yd,E2]),ey=Yd(),O2=E2(),[KB,Zi]=Xi(df),[GB,ic]=Xi(df),YB=Be(e=>{const{__scopeMenu:t,open:s=!1,children:r,dir:o,onOpenChange:c,modal:u=!0}=e,f=ey(t),[h,m]=y.useState(null),p=y.useRef(!1),x=In(c),v=Xx(o);return y.useEffect(()=>{const j=Be(()=>{p.current=!0,document.addEventListener("pointerdown",w,{capture:!0,once:!0}),document.addEventListener("pointermove",w,{capture:!0,once:!0})},"handleKeyDown"),w=Be(()=>p.current=!1,"handlePointer");return document.addEventListener("keydown",j,{capture:!0}),()=>{document.removeEventListener("keydown",j,{capture:!0}),document.removeEventListener("pointerdown",w,{capture:!0}),document.removeEventListener("pointermove",w,{capture:!0})}},[]),y.useEffect(()=>{if(!s)return;const j=Be(()=>x(!1),"handleBlur");return window.addEventListener("blur",j),()=>window.removeEventListener("blur",j)},[s,x]),a.jsx(fP,{...f,children:a.jsx(KB,{scope:t,open:s,onOpenChange:x,content:h,onContentChange:m,children:a.jsx(GB,{scope:t,onClose:y.useCallback(()=>x(!1),[x]),isUsingKeyboardRef:p,dir:v,modal:u,children:r})})})},"Menu"),D2=y.forwardRef(Be(function(t,s){const{__scopeMenu:r,...o}=t,c=ey(r);return a.jsx(hP,{...c,...o,ref:s})},"MenuAnchor")),P2="MenuPortal",[QB,_2]=Xi(P2,{forceMount:void 0}),WB=Be(e=>{const{__scopeMenu:t,forceMount:s,children:r,container:o}=e,c=Zi(P2,t);return a.jsx(QB,{scope:t,forceMount:s,children:a.jsx(Ps,{present:s||c.open,children:a.jsx(Fd,{asChild:!0,container:o,children:r})})})},"MenuPortal"),hs="MenuContent",[XB,ty]=Xi(hs),ZB=y.forwardRef(Be(function(t,s){const r=_2(hs,t.__scopeMenu),{forceMount:o=r.forceMount,...c}=t,u=Zi(hs,t.__scopeMenu),f=ic(hs,t.__scopeMenu);return a.jsx(Ql.Provider,{scope:t.__scopeMenu,children:a.jsx(Ps,{present:o||u.open,children:a.jsx(Ql.Slot,{scope:t.__scopeMenu,children:f.modal?a.jsx(JB,{...c,ref:s}):a.jsx(e7,{...c,ref:s})})})})},"MenuContent")),JB=y.forwardRef(Be(function(t,s){const r=Zi(hs,t.__scopeMenu),o=y.useRef(null),c=Ge(s,o);return y.useEffect(()=>{const u=o.current;if(u)return ZT(u)},[]),a.jsx(ny,{...t,ref:c,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:ge(t.onFocusOutside,u=>u.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentModal")),e7=y.forwardRef(Be(function(t,s){const r=Zi(hs,t.__scopeMenu);return a.jsx(ny,{...t,ref:s,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentNonModal")),t7=dr("MenuContent.ScrollLock"),ny=y.forwardRef(Be(function(t,s){const{__scopeMenu:r,loop:o=!1,trapFocus:c,onOpenAutoFocus:u,onCloseAutoFocus:f,disableOutsidePointerEvents:h,onEntryFocus:m,onEscapeKeyDown:p,onPointerDownOutside:x,onFocusOutside:v,onInteractOutside:j,onDismiss:w,disableOutsideScroll:C,...S}=t,N=Zi(hs,r),E=ic(hs,r),R=ey(r),D=O2(r),A=qB(r),[_,F]=y.useState(null),O=y.useRef(null),I=Ge(s,O,N.onContentChange),V=y.useRef(0),H=y.useRef(""),k=y.useRef(0),q=y.useRef(null),J=y.useRef("right"),re=y.useRef(0),U=C?Ix:y.Fragment,L=C?{as:t7,allowPinchZoom:!0}:void 0,z=Be(M=>{const K=H.current+M,ie=A().filter(ce=>
63!ce.disabled),ee=document.activeElement,ae=ie.find(ce=>ce.ref.current===ee)?.textValue,oe=ie.map(ce=>ce.textValue),le=B2(oe,K,ae),Ne=ie.find(ce=>ce.textValue===le)?.ref.current;Be((function ce(xe){H.current=xe,window.clearTimeout(V.current),xe!==""&&(V.current=window.setTimeout(()=>ce(""),1e3))}),"updateSearch")(K),Ne&&setTimeout(()=>Ne.focus())},"handleTypeaheadSearch");y.useEffect(()=>()=>window.clearTimeout(V.current),[]),af();const W=y.useCallback(M=>J.current===q.current?.side&&q2(M,q.current?.area),[]);return a.jsx(XB,{scope:r,searchRef:H,onItemEnter:y.useCallback(M=>{W(M)&&M.preventDefault()},[W]),onItemLeave:y.useCallback(M=>{W(M)||(O.current?.focus(),F(null))},[W]),onTriggerLeave:y.useCallback(M=>{W(M)&&M.preventDefault()},[W]),pointerGraceTimerRef:k,onPointerGraceIntentChange:y.useCallback(M=>{q.current=M},[]),children:a.jsx(U,{...L,children:a.jsx(UT,{asChild:!0,trapped:c,onMountAutoFocus:ge(u,M=>{M.preventDefault(),O.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:f,children:a.jsx(zd,{asChild:!0,disableOutsidePointerEvents:h,onEscapeKeyDown:p,onPointerDownOutside:x,onFocusOutside:v,onInteractOutside:j,onDismiss:w,children:a.jsx(UB,{asChild:!0,...D,dir:E.dir,orientation:"vertical",loop:o,currentTabStopId:_,onCurrentTabStopIdChange:F,onEntryFocus:ge(m,M=>{E.isUsingKeyboardRef.current||M.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx(rC,{role:"menu","aria-orientation":"vertical","data-state":ry(N.open),"data-radix-menu-content":"",dir:E.dir,...R,...S,ref:I,style:{outline:"none",...S.style},onKeyDown:ge(S.onKeyDown,M=>{const ie=M.target.closest("[data-radix-menu-content]")===M.currentTarget,ee=M.ctrlKey||M.altKey||M.metaKey,ae=M.key.length===1;ie&&(M.key==="Tab"&&M.preventDefault(),!ee&&ae&&z(M.key));const oe=O.current;if(M.target!==oe||!VB.includes(M.key))return;M.preventDefault();const Ne=A().filter(ce=>!ce.disabled).map(ce=>ce.ref.current);k2.includes(M.key)&&Ne.reverse(),F2(Ne)}),onBlur:ge(t.onBlur,M=>{M.currentTarget.contains(M.target)||(window.clearTimeout(V.current),H.current="")}),onPointerMove:ge(t.onPointerMove,ro(M=>{const K=M.target,ie=re.current!==M.clientX;if(M.currentTarget.contains(K)&&ie){const ee=M.clientX>re.current?"right":"left";J.current=ee,re.current=M.clientX}}))})})})})})})},"MenuContentImpl")),n7=y.forwardRef(Be(function(t,s){const{__scopeMenu:r,...o}=t;return a.jsx(Xe.div,{...o,ref:s})},"MenuLabel")),yg="MenuItem",Gj="menu.itemSelect",sy=y.forwardRef(Be(function(t,s){const{disabled:r=!1,onSelect:o,...c}=t,u=y.useRef(null),f=ic(yg,t.__scopeMenu),h=ty(yg,t.__scopeMenu),m=Ge(s,u),p=y.useRef(!1),x=Be(()=>{const v=u.current;if(!r&&v){const j=new CustomEvent(Gj,{bubbles:!0,cancelable:!0});v.addEventListener(Gj,w=>o?.(w),{once:!0}),Id(v,j),j.defaultPrevented?p.current=!1:f.onClose()}},"handleSelect");return a.jsx(L2,{...c,ref:m,disabled:r,onClick:ge(t.onClick,x),onPointerDown:v=>{t.onPointerDown?.(v),p.current=!0},onPointerUp:ge(t.onPointerUp,v=>{p.current||v.currentTarget?.click()}),onKeyDown:ge(t.onKeyDown,v=>{r||v.target!==v.currentTarget||h.searchRef.current!==""&&v.key===" "||xg.includes(v.key)&&(v.currentTarget.click(),v.preventDefault())})})},"MenuItem")),L2=y.forwardRef(Be(function(t,s){const{__scopeMenu:r,disabled:o=!1,textValue:c,...u}=t,f=ty(yg,r),h=O2(r),m=y.useRef(null),p=Ge(s,m),[x,v]=y.useState(!1),[j,w]=y.useState("");return y.useEffect(()=>{const C=m.current;C&&w((C.textContent??"").trim())},[u.children]),a.jsx(Ql.ItemSlot,{scope:r,disabled:o,textValue:c??j,children:a.jsx(IB,{asChild:!0,...h,focusable:!o,children:a.jsx(Xe.div,{role:"menuitem","data-highlighted":x?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...u,ref:p,onPointerMove:ge(t.onPointerMove,ro(C=>{o?f.onItemLeave(C):(f.onItemEnter(C),C.defaultPrevented||C.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ge(t.onPointerLeave,ro(C=>f.onItemLeave(C))),onFocus:ge(t.onFocus,()=>v(!0)),onBlur:ge(t.onBlur,()=>v(!1))})})})},"MenuItemImpl")),s7=y.forwardRef(Be(function(t,s){const{checked:r=!1,onCheckedChange:o,...c}=t;return a.jsx(I2,{scope:t.__scopeMenu,checked:r,children:a.jsx(sy,{role:"menuitemcheckbox","aria-checked":Wl(r)?"mixed":r,...c,ref:s,"data-state":ff(r),onSelect:ge(c.onSelect,()=>o?.(Wl(r)?!0:!r),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),r7="MenuRadioGroup",[Bq,i7]=Xi(r7,{value:void 0,onValueChange:Be(()=>{},"onValueChange")}),a7="MenuRadioItem",o7=y.forwardRef(Be(function(t,s){const{value:r,...o}=t,c=i7(a7,t.__scopeMenu),u=r===c.value;return a.jsx(I2,{scope:t.__scopeMenu,checked:u,children:a.jsx(sy,{role:"menuitemradio","aria-checked":u,...o,ref:s,"data-state":ff(u),onSelect:ge(o.onSelect,()=>c.onValueChange?.(r),{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),U2="MenuItemIndicator",[I2,l7]=Xi(U2,{checked:!1}
63),c7=y.forwardRef(Be(function(t,s){const{__scopeMenu:r,forceMount:o,...c}=t,u=l7(U2,r);return a.jsx(Ps,{present:o||Wl(u.checked)||u.checked===!0,children:a.jsx(Xe.span,{...c,ref:s,"data-state":ff(u.checked)})})},"MenuItemIndicator")),u7=y.forwardRef(Be(function(t,s){const{__scopeMenu:r,...o}=t;return a.jsx(Xe.div,{role:"separator","aria-orientation":"horizontal",...o,ref:s})},"MenuSeparator")),d7="MenuSub",[$q,z2]=Xi(d7),_u="MenuSubTrigger",f7=y.forwardRef(Be(function(t,s){const r=Zi(_u,t.__scopeMenu),o=ic(_u,t.__scopeMenu),c=z2(_u,t.__scopeMenu),u=ty(_u,t.__scopeMenu),f=y.useRef(null),{pointerGraceTimerRef:h,onPointerGraceIntentChange:m}=u,p={__scopeMenu:t.__scopeMenu},x=y.useCallback(()=>{f.current&&window.clearTimeout(f.current),f.current=null},[]);y.useEffect(()=>x,[x]),y.useEffect(()=>{const j=h.current;return()=>{window.clearTimeout(j),m(null)}},[h,m]);const v=Ge(s,c.onTriggerChange);return a.jsx(D2,{asChild:!0,...p,children:a.jsx(L2,{id:c.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":r.open?c.contentId:void 0,"data-state":ry(r.open),...t,ref:v,onClick:j=>{t.onClick?.(j),!(t.disabled||j.defaultPrevented)&&(j.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:ge(t.onPointerMove,ro(j=>{u.onItemEnter(j),!j.defaultPrevented&&!t.disabled&&!r.open&&!f.current&&(u.onPointerGraceIntentChange(null),f.current=window.setTimeout(()=>{r.onOpenChange(!0),x()},100))})),onPointerLeave:ge(t.onPointerLeave,ro(j=>{x();const w=r.content?.getBoundingClientRect();if(w){const C=r.content?.dataset.side,S=C==="right",N=S?-5:5,E=w[S?"left":"right"],R=w[S?"right":"left"];u.onPointerGraceIntentChange({area:[{x:j.clientX+N,y:j.clientY},{x:E,y:w.top},{x:R,y:w.top},{x:R,y:w.bottom},{x:E,y:w.bottom}],side:C}),window.clearTimeout(h.current),h.current=window.setTimeout(()=>u.onPointerGraceIntentChange(null),300)}else{if(u.onTriggerLeave(j),j.defaultPrevented)return;u.onPointerGraceIntentChange(null)}})),onKeyDown:ge(t.onKeyDown,j=>{t.disabled||j.target!==j.currentTarget||u.searchRef.current!==""&&j.key===" "||BB[o.dir].includes(j.key)&&(r.onOpenChange(!0),r.content?.focus(),j.preventDefault())})})})},"MenuSubTrigger")),h7="MenuSubContent",m7=y.forwardRef(Be(function(t,s){const r=_2(hs,t.__scopeMenu),{forceMount:o=r.forceMount,align:c="start",...u}=t,f=Zi(hs,t.__scopeMenu),h=ic(hs,t.__scopeMenu),m=z2(h7,t.__scopeMenu),p=y.useRef(null),x=Ge(s,p);return a.jsx(Ql.Provider,{scope:t.__scopeMenu,children:a.jsx(Ps,{present:o||f.open,children:a.jsx(Ql.Slot,{scope:t.__scopeMenu,children:a.jsx(ny,{id:m.contentId,"aria-labelledby":m.triggerId,...u,ref:x,align:c,side:h.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:v=>{h.isUsingKeyboardRef.current&&p.current?.focus(),v.preventDefault()},onCloseAutoFocus:v=>v.preventDefault(),onFocusOutside:ge(t.onFocusOutside,v=>{v.target!==m.trigger&&f.onOpenChange(!1)}),onEscapeKeyDown:ge(t.onEscapeKeyDown,v=>{h.onClose(),v.preventDefault()}),onKeyDown:ge(t.onKeyDown,v=>{const j=v.currentTarget.contains(v.target),w=$B[h.dir].includes(v.key);j&&w&&(f.onOpenChange(!1),m.trigger?.focus(),v.preventDefault())})})})})})},"MenuSubContent"));function ry(e){return e?"open":"closed"}Be(ry,"getOpenState");function Wl(e){return e==="indeterminate"}Be(Wl,"isIndeterminate");function ff(e){return Wl(e)?"indeterminate":e?"checked":"unchecked"}Be(ff,"getCheckedState");function F2(e){const t=document.activeElement;for(const s of e)if(s===t||(s.focus(),document.activeElement!==t))return}Be(F2,"focusFirst");function V2(e,t){return e.map((s,r)=>e[(t+r)%e.length])}Be(V2,"wrapArray");function B2(e,t,s){const o=t.length>1&&Array.from(t).every(m=>m===t[0])?t[0]:t,c=s?e.indexOf(s):-1;let u=V2(e,Math.max(c,0));o.length===1&&(u=u.filter(m=>m!==s));const h=u.find(m=>m.toLowerCase().startsWith(o.toLowerCase()));return h!==s?h:void 0}Be(B2,"getNextMatch");function $2(e,t){const{x:s,y:r}=e;let o=!1;for(let c=0,u=t.length-1;c<t.length;u=c++){const f=t[c],h=t[u],m=f.x,p=f.y,x=h.x,v=h.y;p>r!=v>r&&s<(x-m)*(r-p)/(v-p)+m&&(o=!o)}return o}Be($2,"isPointInPolygon");function q2(e,t){if(!t)return!1;const s={x:e.clientX,y:e.clientY};return $2(s,t)}Be(q2,"isPointerInGraceArea");function ro(e){return t=>t.pointerType==="mouse"?e(t):void 0}Be(ro,"whenMouse");
63var p7=YB,g7=D2,x7=WB,y7=ZB,v7=n7,b7=sy,w7=s7,j7=o7,S7=c7,N7=u7,C7=f7,E7=m7,T7=Object.defineProperty,rs=(e,t)=>T7(e,"name",{value:t,configurable:!0}),iy="DropdownMenu",[A7,qq]=ss(iy,[M2]),is=M2(),[R7,H2]=A7(iy),k7=rs(e=>{const{__scopeDropdownMenu:t,children:s,dir:r,open:o,defaultOpen:c,onOpenChange:u,modal:f=!0}=e,h=is(t),m=y.useRef(null),[p,x]=lo({prop:o,defaultProp:c??!1,onChange:u,caller:iy});return a.jsx(R7,{scope:t,triggerId:Ii(),triggerRef:m,contentId:Ii(),open:p,onOpenChange:x,onOpenToggle:y.useCallback(()=>x(v=>!v),[x]),modal:f,children:a.jsx(p7,{...h,open:p,onOpenChange:x,dir:r,modal:f,children:s})})},"DropdownMenu"),M7="DropdownMenuTrigger",O7=y.forwardRef(rs(function(t,s){const{__scopeDropdownMenu:r,disabled:o=!1,...c}=t,u=H2(M7,r),f=is(r),h=Ge(s,u.triggerRef);return a.jsx(g7,{asChild:!0,...f,children:a.jsx(Xe.button,{type:"button",id:u.triggerId,"aria-haspopup":"menu","aria-expanded":u.open,"aria-controls":u.open?u.contentId:void 0,"data-state":u.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...c,ref:h,onPointerDown:ge(t.onPointerDown,m=>{!o&&m.button===0&&m.ctrlKey===!1&&(u.onOpenToggle(),u.open||m.preventDefault())}),onKeyDown:ge(t.onKeyDown,m=>{o||(["Enter"," "].includes(m.key)&&u.onOpenToggle(),m.key==="ArrowDown"&&u.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(m.key)&&m.preventDefault())})})})},"DropdownMenuTrigger")),D7=rs(e=>{const{__scopeDropdownMenu:t,...s}=e,r=is(t);return a.jsx(x7,{...r,...s})},"DropdownMenuPortal"),P7="DropdownMenuContent",_7=y.forwardRef(rs(function(t,s){const{__scopeDropdownMenu:r,...o}=t,c=H2(P7,r),u=is(r),f=y.useRef(!1);return a.jsx(y7,{id:c.contentId,"aria-labelledby":c.triggerId,...u,...o,ref:s,onCloseAutoFocus:ge(t.onCloseAutoFocus,h=>{f.current||c.triggerRef.current?.focus(),f.current=!1,h.preventDefault()}),onInteractOutside:ge(t.onInteractOutside,h=>{const m=h.detail.originalEvent,p=m.button===0&&m.ctrlKey===!0,x=m.button===2||p;(!c.modal||x)&&(f.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),L7=y.forwardRef(rs(function(t,s){const{__scopeDropdownMenu:r,...o}=t,c=is(r);return a.jsx(v7,{...c,...o,ref:s})},"DropdownMenuLabel")),U7=y.forwardRef(rs(function(t,s){const{__scopeDropdownMenu:r,...o}=t,c=is(r);return a.jsx(b7,{...c,...o,ref:s})},"DropdownMenuItem")),I7=y.forwardRef(rs(function(t,s){const{__scopeDropdownMenu:r,...o}=t,c=is(r);return a.jsx(w7,{...c,...o,ref:s})},"DropdownMenuCheckboxItem")),z7=y.forwardRef(rs(function(t,s){const{__scopeDropdownMenu:r,...o}=t,c=is(r);return a.jsx(j7,{...c,...o,ref:s})},"DropdownMenuRadioItem")),F7=y.forwardRef(rs(function(t,s){const{__scopeDropdownMenu:r,...o}=t,c=is(r);return a.jsx(S7,{...c,...o,ref:s})},"DropdownMenuItemIndicator")),V7=y.forwardRef(rs(function(t,s){const{__scopeDropdownMenu:r,...o}=t,c=is(r);return a.jsx(N7,{...c,...o,ref:s})},"DropdownMenuSeparator")),B7=y.forwardRef(rs(function(t,s){const{__scopeDropdownMenu:r,...o}=t,c=is(r);return a.jsx(C7,{...c,...o,ref:s})},"DropdownMenuSubTrigger")),$7=y.forwardRef(rs(function(t,s){const{__scopeDropdownMenu:r,...o}=t,c=is(r);return a.jsx(E7,{...c,...o,ref:s,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuSubContent")),q7=k7,H7=O7,K7=D7,K2=_7,G2=L7,Y2=U7,Q2=I7,W2=z7,X2=F7,Z2=V7,J2=B7,eA=$7;const G7=q7,Y7=H7,Q7=y.forwardRef(({className:e,inset:t,children:s,...r},o)=>a.jsxs(J2,{ref:o,className:Ee("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...r,children:[s,a.jsx(qO,{className:"ml-auto"})]}));Q7.displayName=J2.displayName;const W7=y.forwardRef(({className:e,...t},s)=>a.jsx(eA,{ref:s,className:Ee("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
63de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",e),...t}));W7.displayName=eA.displayName;const tA=y.forwardRef(({className:e,sideOffset:t=4,...s},r)=>a.jsx(K7,{children:a.jsx(K2,{ref:r,sideOffset:t,className:Ee("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",e),...s})}));tA.displayName=K2.displayName;const rd=y.forwardRef(({className:e,inset:t,...s},r)=>a.jsx(Y2,{ref:r,className:Ee("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...s}));rd.displayName=Y2.displayName;const X7=y.forwardRef(({className:e,children:t,checked:s,...r},o)=>a.jsxs(Q2,{ref:o,className:Ee("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:s,...r,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(X2,{children:a.jsx(zg,{className:"h-4 w-4"})})}),t]}));X7.displayName=Q2.displayName;const Z7=y.forwardRef(({className:e,children:t,...s},r)=>a.jsxs(W2,{ref:r,className:Ee("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...s,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(X2,{children:a.jsx(RN,{className:"h-2 w-2 fill-current"})})}),t]}));Z7.displayName=W2.displayName;const J7=y.forwardRef(({className:e,inset:t,...s},r)=>a.jsx(G2,{ref:r,className:Ee("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...s}));J7.displayName=G2.displayName;const e$=y.forwardRef(({className:e,...t},s)=>a.jsx(Z2,{ref:s,className:Ee("-mx-1 my-1 h-px bg-muted",e),...t}));e$.displayName=Z2.displayName;function vl(e){return typeof e=="object"&&e!==null&&"status"in e&&e.status===409}function t$(){const e=mt(),{data:t,refetch:s}=Os({site:e}),r=Xd(),{toast:o}=Sn(),[c,u]=y.useState([]),[f,h]=y.useState(!1),[m,p]=y.useState(null),x=y.useRef(!1),v=y.useMemo(()=>t?li(t,{includeUnpublished:!0}):[],[t]);y.useEffect(()=>{f||u(v.map(({item:A})=>A.id))},[v,f]);const j=y.useMemo(()=>{const A=new Map(v.map(O=>[O.item.id,O])),_=new Set,F=[];for(const O of c){const I=A.get(O);I&&!_.has(O)&&(F.push(I),_.add(O))}for(const O of v)_.has(O.item.id)||F.push(O);return F},[c,v]);if(!t)return null;const w=[...t.films.filter(A=>A.deletedAt).map((A,_)=>({item:A,collection:"films",sourceIndex:_})),...t.work.filter(A=>A.deletedAt).map((A,_)=>({item:A,collection:"work",sourceIndex:_}))],C=async(A,_,F)=>{if(!(e!=="michael"||x.current||r.isPending)){x.current=!0,p(A.item.id);try{await Za();const O=await zi({site:e},{cache:"no-store"}),I=A.collection;if(!O[I].find(k=>k.id===A.item.id&&!k.deletedAt))throw new Error("This project changed. Reload the page before trying again.");const H={...O,[I]:O[I].map(k=>k.id===A.item.id?{...k,[_]:F}:k)};await r.mutateAsync({data:H,params:{site:e}}),await s(),o({title:`${A.item.title} placement saved to draft`,description:"Publish Michael Marantz to update the public sites."})}catch(O){await s(),o({title:"Placement was not saved",description:O instanceof Error?O.message:"Reload the page and try again.",variant:"destructive"})}finally{x.current=!1,p(null)}}},S=async A=>
63{if(!r.isPending)try{const _={...t};A.collection==="films"?_.films=t.films.map(F=>F.id===A.item.id?{...F,published:!F.published}:F):_.work=t.work.map(F=>F.id===A.item.id?{...F,published:!F.published}:F),await r.mutateAsync({data:_}),await s(),o({title:`Item ${A.item.published?"unpublished":"published"}`})}catch(_){o({title:vl(_)?"Content changed in another tab. Reload before saving.":"Error saving changes",variant:"destructive"})}},N=async A=>{if(r.isPending)return;const _=e==="alreadyalive"?"Already Alive":"Michael Marantz";if(window.confirm(`Move "${A.item.title}" to trash on ${_}? This will hide it from ${_} after publishing.`))try{const F={...t};A.collection==="films"?F.films=t.films.map(O=>O.id===A.item.id?{...O,deletedAt:new Date().toISOString()}:O):F.work=t.work.map(O=>O.id===A.item.id?{...O,deletedAt:new Date().toISOString()}:O),await r.mutateAsync({data:F}),await s(),o({title:"Item moved to trash"})}catch(F){o({title:vl(F)?"Content changed in another tab. Reload before saving.":"Error moving to trash",variant:"destructive"})}},E=async A=>{if(!r.isPending)try{const _={...t};A.collection==="films"?_.films=t.films.map(F=>F.id===A.item.id?{...F,deletedAt:null}:F):_.work=t.work.map(F=>F.id===A.item.id?{...F,deletedAt:null}:F),await r.mutateAsync({data:_}),await s(),o({title:"Item restored"})}catch(_){o({title:vl(_)?"Content changed in another tab. Reload before saving.":"Error restoring item",variant:"destructive"})}},R=(A,_)=>{if(r.isPending)return;const F=A+_;F<0||F>=j.length||(u(()=>{const O=j.map(({item:V})=>V.id),[I]=O.splice(A,1);return O.splice(F,0,I),O}),h(!0))},D=async()=>{if(!r.isPending)try{const A=$C(t,j.map(({item:_})=>_.id));await r.mutateAsync({data:A}),await s(),h(!1),o({title:"Master order saved to draft"})}catch(A){o({title:vl(A)?"Content changed in another tab. Reload before saving.":"Error saving Work page order",description:vl(A)?"Your unsaved order is still here; refresh to load the newer draft.":void 0,variant:"destructive"})}};return a.jsxs("div",{className:"p-8 md:p-12 max-w-5xl mx-auto",children:[a.jsxs("div",{className:"flex justify-between items-center mb-12",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl text-white mb-2",children:"Films & Work"}),a.jsx("p",{className:"text-[#8a8a8a]",children:"Manage your films, commercials, documentaries, etc."}),a.jsx("p",{className:"text-[#666] text-sm mt-2 max-w-2xl",children:"Use the site switches on each row to choose where a project appears. Changes save to the Michael Marantz draft; publish Michael Marantz to make them live. Already Alive-owned work is managed in its own editor."})]}),a.jsx("div",{className:"flex gap-4",children:a.jsxs(xt,{href:"/admin/work/new",className:"bg-white text-black px-4 py-2 flex items-center gap-2 hover:bg-[#e5e5e5] transition-colors text-[15px]",children:[a.jsx(Jt,{className:"w-4 h-4"}),"Add New"]})})]}),a.jsxs("section",{"aria-labelledby":"work-page-order-heading",className:"mb-16",children:[a.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-4 mb-5",children:[a.jsxs("div",{children:[a.jsx("h2",{id:"work-page-order-heading",className:"text-xl text-white mb-2",children:"Master order"}),a.jsx("p",{className:"text-[#8a8a8a] text-[15px]",children:"Arrange films and work together. This is the master order for the public Work page, each collection, and the homepage rows."})]}),a.jsxs("button",{type:"button",onClick:D,disabled:!f||r.isPending,className:"bg-white text-black px-4 py-2 flex items-center gap-2 hover:bg-[#e5e5e5] transition-colors text-[15px] disabled:opacity-40",children:[r.isPending?a.jsx(Ue,{className:"w-4 h-4 animate-spin"}):a.jsx(co,{className:"w-4 h-4"}),"Save draft order"]})]}),a.jsx("div",{className:"space-y-2",children:j.length===0?a.jsx("div",{className:"border border-[#333] border-dashed p-8 text-center text-[#8a8a8a]",children:"No nondeleted films or work items yet."}):j.map((A,_)=>{const F=to(t,A.item,A.collection).still;return a.jsxs("div",{className:"flex flex-wrap sm:flex-nowrap items-center gap-3 bg-[#050505] border border-[#333] p-3 group",children:[a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsx("button",{type:"button",onClick:()=>R(_,-1),disabled:_===0||r.isPending,"aria-label":`Move ${A.item.title} up`,className:"text-[#8a8a8a] hover:text-white disabled:opacity-30 p-1",children:a.jsx(Pl,{className:"w-4 h-4"})}),a.jsx("button",{type:"button",onClick:()=>R(_,1),disabled:_===j.length-1||r.isPending,"aria-label":`Move ${A.item.title} down`,className:"text-[#8a8a8a] hover:text-white disabled:opacity-30 p-1",children:a.jsx(Dl,{className:"w-4 h-4"})})]}),a.jsx("div",{className:"w-28 aspect-video bg-[#111] shrink-0 relative border border-[#222]",children:F?a.jsx("img",{src:zt(F,e),alt:"",className:"w-full h-full object-cover"}):a.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-[10px] text-[#8a8a8a] text-center p-1",children:"No image"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-1",children:[a.jsx("h3",{className:"text-white text-[16px] truncate",children:A.item.title}),a.jsx("span",{className:"text-[10px] uppercase tracking-wider px-2 py-0.5 border border-[#333] text-[#8a8a8a]",children:A.collection==="films"?"Film":"Work"}),a.jsx("span",{className:`text-[10px] uppercase tracking-wider px-2 py-0.5 ${A.item.published?"bg-[#111] text-[#8a8a8a] border border-[#333]":"bg-[#ffeedd] text-black"}`,children:A.item.published?"Published":"Draft"}),A.item.showInBrandRow&&a.jsx("span",{className:"text-[10px] uppercase tracking-wider px-2 py-0.5 border border-[#333] text-white",children:"Brand Row"})]}),a.jsxs("div",{className:"text-[#8a8a8a] text-[14px] truncate",children:[A.item.type," ",A.item.client?`• ${A.item.client}`:""]})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-2 mr-2",children:[a.jsxs("label",{htmlFor:`show-michael-${A.item.id}`,className:"flex items-center gap-2 text-xs text-white whitespace-nowrap cursor-pointer",children:[a.jsx("span",{children:"Michael"}),a.jsx(Zn,{id:`show-michael-${A.item.id}`,checked:A.item.showOnMichael!==!1,onCheckedChange:O=>C(A,"showOnMichael",O),disabled:e!=="michael"||r.isPending||m!==null,"aria-label":`Show ${A.item.title} on Michael Marantz`})]}),a.jsxs("label",{htmlFor:`show-alreadyalive-${A.item.id}`,className:"flex items-center gap-2 text-xs text-[#e7b98c] whitespace-nowrap cursor-pointer",children:[a.jsx("span",{children:"Already Alive"}),a.jsx(Zn,{id:`show-alreadyalive-${A.item.id}`,checked:A.item.showOnAlreadyAlive??A.collection==="films",onCheckedChange:O=>C(A,"showOnAlreadyAlive",O),disabled:e!=="michael"||r.isPending||m!==null,"aria-label":`Show ${A.item.title} on Already Alive`})]}),m===A.item.id&&a.jsx(Ue,{className:"w-4 h-4 animate-spin text-[#8a8a8a]","aria-label":"Saving placement"})]}),a.jsx("div",{className:"flex items-center gap-2 mr-2",children:a.jsxs(G7,{children:[a.jsx(Y7,{disabled:r.isPending,className:"p-2 text-[#8a8a8a] hover:text-white transition-colors outline-none disabled:opacity-30",children:a.jsx(sD,{className:"w-4 h-4"})}),a.jsxs(tA,{align:"end",className:"bg-[#050505] border-[#333] text-white rounded-none",children:[a.jsx(rd,{asChild:!0,className:"hover:bg-[#111] focu
63s:bg-[#111] rounded-none cursor-pointer",children:a.jsxs(xt,{href:`/admin/work/${A.item.id}`,className:"w-full flex items-center gap-2",children:[a.jsx(wD,{className:"w-4 h-4"})," Edit"]})}),a.jsxs(rd,{onClick:()=>S(A),className:"hover:bg-[#111] focus:bg-[#111] rounded-none cursor-pointer flex items-center gap-2",children:[A.item.published?a.jsx(RN,{className:"w-4 h-4"}):a.jsx(Fg,{className:"w-4 h-4"}),A.item.published?"Unpublish":"Publish"]}),a.jsxs(rd,{onClick:()=>N(A),className:"hover:bg-[#111] focus:bg-[#111] rounded-none cursor-pointer text-red-500 focus:text-red-500 flex items-center gap-2",children:[a.jsx(ms,{className:"w-4 h-4"})," Move to Trash"]})]})]})})]},A.item.id)})})]}),w.length>0&&a.jsxs("div",{children:[a.jsx("h2",{className:"text-[17px] text-[#8a8a8a] mb-4",children:"Trash (30 days)"}),a.jsx("div",{className:"space-y-2 opacity-60",children:w.map(A=>a.jsxs("div",{className:"flex justify-between items-center border border-[#333] p-3 text-[15px]",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-white",children:A.item.title}),a.jsx("span",{className:"text-[10px] uppercase tracking-wider px-2 py-0.5 border border-[#333] text-[#8a8a8a]",children:A.collection==="films"?"Film":"Work"})]}),a.jsx("button",{onClick:()=>E(A),disabled:r.isPending,className:"text-[#8a8a8a] hover:text-white underline underline-offset-4 disabled:opacity-30",children:"Restore"})]},A.item.id))})]})]})}function Yj(){const[,e]=Qi("/admin/work/:id"),t=e?.id||"new";return a.jsx(b2,{id:t,initialCollection:"work"},t)}const id=5;function n$(e){return typeof e=="number"&&Number.isFinite(e)?String(e):String(id)}function cp(e){if(e===void 0||e.trim()==="")return null;const t=Number(e);return Number.isFinite(t)&&t>=1&&t<=12?t:null}function Qj(e){return typeof e=="object"&&e!==null&&"status"in e&&e.status===409}function Wj(e){const t=li(e,{includeUnpublished:!0});return[...t.filter(({item:s,collection:r})=>r==="films"&&Bl(s,r)),...t.filter(({item:s,collection:r})=>r==="work"&&Bl(s,r))]}function Xj(e,t){const s=new Set(t),r=new Set;return[...e.cycle.map(c=>c.itemId).filter(c=>!s.has(c)||r.has(c)?!1:(r.add(c),!0)),...t.filter(c=>!r.has(c))]}function s$(e,t){return e.find(s=>s.itemId===t&&s.enabled)??e.find(s=>s.itemId===t)}function Zj(e,t){return t.reduce((s,r)=>(s[r]=n$(s$(e.cycle,r)?.duration),s),{})}function r$(e){return`/${e.collection==="films"?"admin/films":"admin/work"}/${e.item.id}`}function i$(){const e=mt(),{data:t,refetch:s}=Os({site:e}),r=Xd(),{toast:o}=Sn(),[c,u]=y.useState([]),[f,h]=y.useState({}),[m,p]=y.useState({}),[x,v]=y.useState(!1),[j,w]=y.useState(!1),C=y.useMemo(()=>t?Wj(t):[],[t]),S=y.useMemo(()=>C.map(({item:V})=>V.id),[C]),N=y.useMemo(()=>new Map(C.map(V=>[V.item.id,V])),[C]);y.useEffect(()=>{if(!t||j)return;const V=!!t.settings.homepageCycleOrderOverride;u(V?Xj(t,S):S),h(Zj(t,S)),p({}),v(V)},[t,S,j]);const E=y.useMemo(()=>{const V=new Set(S),H=x?c:S,k=new Set,q=H.filter(J=>!V.has(J)||k.has(J)?!1:(k.add(J),!0));return S.forEach(J=>{k.has(J)||(k.add(J),q.push(J))}),q},[S,c,x]),R=()=>w(!0),D=(V,H)=>{if(r.isPending||!x)return;const k=V+H;if(k<0||k>=E.length)return;const q=[...E],[J]=q.splice(V,1);q.splice(k,0,J),u(q),R()},A=(V,H)=>{r.isPending||(h(k=>({...k,[V]:H})),p(k=>{if(!(V in k))return k;const q={...k};return delete q[V],q}),R())},_=(V,H)=>{if(cp(H)!==null)return!0;const k="Enter a number from 1 to 12 seconds.";p(J=>({...J,[V]:k}));const q=N.get(V)?.item.title;return o({title:`Check the duration${q?` for ${q}`:""}`,description:k,variant:"destructive"}),!1},F=()=>{r.isPending||(u(S),R())},O=V=>{r.isPending||(v(V),R())},I=async()=>{if(!t||r.isPending)return;const V=E.filter(L=>cp(f[L]??String(id))===null);if(V.length>0){V.forEach(z=>{p(W=>({...W,[z]:"Enter a number from 1 to 12 seconds."}))});const L=N.get(V[0])?.item.title;o({title:"Check cycle durations before saving",description:L?`${L} needs a number from 1 to 12 seconds.`:"Each duration must be a number from 1 to 12 seconds.",variant:"destructive"});return}const H=new Set,k=new Map;E.forEach(L=>{const W=t.cycle.map((M,K)=>({cycleItem:M,index:K}
63)).filter(({cycleItem:M})=>M.itemId===L).find(({cycleItem:M})=>M.enabled);W&&(k.set(L,W.index),H.add(W.index))});const q=E.flatMap(L=>{const z=k.get(L),W=cp(f[L]??String(id));if(z!==void 0)return[{...t.cycle[z],duration:W,enabled:!0}];const M=N.get(L);if(!M)return[];const K=Zr(t,M.item);return[{id:crypto.randomUUID(),itemId:L,source:p_.still,duration:W,enabled:!0,...K?.still?{still:K.still}:{}}]}),J=t.cycle.filter((L,z)=>!H.has(z)),re=[...q,...J],U={...t,settings:{...t.settings,homepageCycleOrderOverride:x},cycle:re};try{const L=await r.mutateAsync({data:U}),W=(await s()).data??L,K=Wj(W).map(({item:ee})=>ee.id),ie=!!W.settings.homepageCycleOrderOverride;u(ie?Xj(W,K):K),h(Zj(W,K)),p({}),v(ie),w(!1),o({title:"Homepage cycle saved to draft"})}catch(L){o({title:Qj(L)?"Content changed in another tab. Reload before saving.":"Error saving homepage cycle",description:Qj(L)?"Your unsaved order and durations are still here; refresh to load the newer draft.":void 0,variant:"destructive"})}};return t?a.jsxs("div",{className:"p-5 sm:p-8 md:p-12 max-w-5xl mx-auto pb-32",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-start gap-6 mb-10",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl text-white mb-2",children:"Homepage Cycle"}),a.jsx("p",{className:"text-[#8a8a8a] max-w-2xl text-[15px] leading-relaxed",children:"Choose the featured films and work order used by the homepage, and set how long each item remains on screen. Featured membership and preview media are managed in each item's editor."})]}),a.jsxs("button",{type:"button",onClick:I,disabled:!j||r.isPending,className:"bg-white text-black px-4 py-2 flex items-center justify-center gap-2 hover:bg-[#e5e5e5] transition-colors text-[15px] disabled:opacity-40 shrink-0",children:[r.isPending?a.jsx(Ue,{className:"w-4 h-4 animate-spin"}):a.jsx(co,{className:"w-4 h-4"}),"Save cycle draft"]})]}),a.jsxs("section",{className:"border border-[#333] bg-[#050505] p-4 sm:p-5 mb-8","aria-labelledby":"cycle-order-heading",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[a.jsxs("div",{children:[a.jsx("h2",{id:"cycle-order-heading",className:"text-[17px] text-white mb-1",children:"Homepage order override"}),a.jsx("p",{className:"text-[#8a8a8a] text-[14px] leading-relaxed max-w-2xl",children:x?"Arrows change the cycle order. New featured items append to the end.":"Off uses the master-derived row order: films first, then work."})]}),a.jsxs("label",{className:"flex items-center gap-3 text-[14px] text-white cursor-pointer shrink-0",children:[a.jsx("input",{type:"checkbox",checked:x,onChange:V=>O(V.target.checked),disabled:r.isPending,className:"h-4 w-4 accent-white"}),"Override order"]})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-3 mt-5 pt-4 border-t border-[#222]",children:[a.jsxs("button",{type:"button",onClick:F,disabled:r.isPending,className:"text-[#8a8a8a] hover:text-white flex items-center gap-2 text-[13px] disabled:opacity-30",children:[a.jsx(PN,{className:"w-4 h-4"}),"Reset to row order"]}),j&&a.jsx("span",{className:"text-[12px] text-[#8a8a8a]",role:"status",children:"Unsaved changes"})]})]}),a.jsxs("section",{"aria-labelledby":"cycle-items-heading",children:[a.jsxs("div",{className:"flex items-end justify-between gap-4 mb-4",children:[a.jsxs("div",{children:[a.jsx("h2",{id:"cycle-items-heading",className:"text-[17px] text-[#8a8a8a]",children:"Featured homepage items"}),a.jsx("p",{className:"text-[#666] text-[13px] mt-1",children:"Draft items are shown for planning and stay off the public site until published."})]}),a.jsxs("span",{className:"text-[#666] text-[13px] tabular-nums",children:[E.length," ",E.length===1?"item":"items"]})]}),E.length===0?a.jsx("div",{className:"border border-[#333] border-dashed p-10 text-center text-[#8a8a8a] text-[15px]",children:"No featured films or work items yet. Mark items as featured in their editors."}):a.jsx("div",{className:"space-y-2",children:E.map((V,H)=>{const k=N.get(V);if(!k)return null;const q=k.item,re=Zr(t,q)?.still||q.still||q.workGridImage||q.shareImage||q.poster,U=r$(k),L=f[V]??Str
63ing(id),z=m[V];return a.jsxs("div",{className:"bg-[#050505] border border-[#333] p-3 sm:p-4 flex flex-col sm:flex-row sm:items-center gap-3 sm:gap-4",children:[a.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[a.jsxs("div",{className:"flex flex-col gap-0.5 shrink-0",children:[a.jsx("button",{type:"button",onClick:()=>D(H,-1),disabled:!x||H===0||r.isPending,"aria-label":`Move ${q.title} up`,className:"text-[#8a8a8a] hover:text-white disabled:opacity-25 p-1",children:a.jsx(Pl,{className:"w-4 h-4"})}),a.jsx("button",{type:"button",onClick:()=>D(H,1),disabled:!x||H===E.length-1||r.isPending,"aria-label":`Move ${q.title} down`,className:"text-[#8a8a8a] hover:text-white disabled:opacity-25 p-1",children:a.jsx(Dl,{className:"w-4 h-4"})})]}),a.jsx(xt,{href:U,className:"w-24 sm:w-28 aspect-video bg-[#111] shrink-0 relative border border-[#222] block","aria-label":`Edit ${q.title}`,children:re?a.jsx("img",{src:zt(re,e),alt:"",className:"w-full h-full object-cover"}):a.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-[10px] text-[#8a8a8a] text-center p-1",children:"No image"})})]}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-1",children:[a.jsx(xt,{href:U,className:"text-white text-[16px] truncate hover:underline underline-offset-4",children:q.title}),a.jsx("span",{className:"text-[10px] uppercase tracking-wider px-2 py-0.5 border border-[#333] text-[#8a8a8a]",children:k.collection==="films"?"Film":"Work"}),!q.published&&a.jsx("span",{className:"text-[10px] uppercase tracking-wider px-2 py-0.5 bg-[#ffeedd] text-black",children:"Draft"})]}),a.jsxs("div",{className:"text-[#8a8a8a] text-[13px] truncate",children:[q.type,q.client?` • ${q.client}`:""]}),a.jsx(xt,{href:U,className:"inline-block mt-1 text-[#666] hover:text-white text-[12px] underline underline-offset-4",children:"Edit item media"})]}),a.jsxs("label",{className:"flex items-center gap-2 sm:w-28 shrink-0 text-[13px] text-[#8a8a8a]",children:[a.jsx("span",{children:"Seconds"}),a.jsx("input",{type:"number",min:1,max:12,step:"any",value:L,onChange:W=>A(V,W.target.value),onBlur:W=>_(V,W.target.value),disabled:r.isPending,"aria-label":`Duration for ${q.title} in seconds`,"aria-invalid":!!z,"aria-describedby":z?`duration-error-${V}`:void 0,className:`w-14 bg-black border px-2 py-1.5 text-white text-center tabular-nums outline-none focus:border-white disabled:opacity-40 ${z?"border-red-500":"border-[#333]"}`}),z&&a.jsx("span",{id:`duration-error-${V}`,className:"text-red-400 text-[11px] sm:absolute sm:mt-12",children:z})]})]},V)})})]})]}):a.jsx("div",{className:"min-h-[320px] flex items-center justify-center text-[#8a8a8a]",children:a.jsx(Ue,{className:"w-4 h-4 animate-spin"})})}function a$(){const e=mt(),{data:t,refetch:s}=Os({site:e}),r=Xd(),{toast:o}=Sn(),[c,u]=y.useState(null);t&&c===null&&u([...t.press]);const f=async()=>{if(!(!t||!c))try{await r.mutateAsync({data:{...t,press:c}}),await s(),o({title:"Press quotes saved"})}catch{o({title:"Error saving quotes",variant:"destructive"})}},h=x=>{c&&u(c.filter(v=>v.id!==x))},m=(x,v)=>{if(!c)return;let j=c.map(w=>w.id===x?{...w,...v}:w);if(v.featured===!0){const w=j.find(C=>C.id===x);w&&(j=j.map(C=>C.id!==x&&C.filmId===w.filmId&&C.featured?{...C,featured:!1}:C))}u(j)},p=()=>{if(!c||!t)return;const x={id:crypto.randomUUID(),outlet:"",quote:"",filmId:t.films[0]?.id||"",featured:!1,published:!1};u([x,...c])};return!t||!c?null:a.jsxs("div",{className:"p-8 md:p-12 max-w-5xl mx-auto pb-32",children:[a.jsxs("div",{className:"flex justify-between items-center mb-12",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl text-white mb-2",children:"Press Quotes"}),a.jsx("p",{className:"text-[#8a8a8a]",children:"Manage pull quotes for film pages."})]}),a.jsxs("div",{className:"flex gap-4",children:[a.jsxs("button",{onClick:p,className:"bg-[#111] text-white px-4 py-2 flex items-center gap-2 hover:bg-[#222] transition-colors text-[15px]",children:[a.jsx(Jt,{className:"w-4 h-4"}),"Add Quote"]}),a.jsxs("button",{onClick:f,disabled:r.isPending,className:"bg-white text-black px-4 py-2 flex items-center gap-2 hover:bg-[#e5e5e5] transition-colors text-[15px] disabled:opacity-50",children:[r.isPending?a.jsx(Ue,{className:"w-4 h-4 animate-spin"}):a.jsx(co,{className:"w-4 h-4"}),"Save Quotes"]})]})]}),a.jsx("div",{className:"space-y-4",children:c.length===0?a.jsx("div",{className:"border border-[#333] border-dashed p-12 text-center text-[#8a8a8a]",children:"No press quotes."}):c.map(x=>a.jsxs("div",{className:"bg-[#050505] border border-[#333] p-6 group space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[13px] text-[#8a8a8a] uppercase tracking-wider",children:"Outlet"}),a.jsx("input",{value:x.outlet,onChange:v=>m(x.id,{outlet:v.target.value}),className:"w-full bg-black border border-[#333] p-3 text-white outline-none",placeholder:"IndieWire"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[13px] text-[#8a8a8a] uppercase tracking-wider",children:"Related Film"}),a.jsxs("select",{value:x.filmId,onChange:v=>m(x.id,{filmId:v.target.value}),className:"w-full bg-black border border-[#333] p-3 text-white outline-none appearance-none",children:[a.jsx("option",{value:"",disabled:!0,children:"Select film..."}),t.films.map(v=>a.jsx("option",{value:v.id,children:v.title},v.id))]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between items-baseline",children:[a.jsx("label",{className:"text-[13px] text-[#8a8a8a] uppercase tracking-wider",children:"Quote (max 140 chars)"}),a.jsxs("span",{className:`text-[11px] ${x.quote.length>140?"text-red-500":"text-[#555]"}`,children:[x.quote.length,"/140"]})]}),a.jsx("textarea",{value:x.quote,onChange:v=>m(x.id,{quote:v.target.value}),className:"w-full bg-black border border-[#333] p-3 text-white outline-none min-h-[80px]",maxLength:140,placeholder:"A stunning achievement."})]}),a.jsxs("div",{className:"flex gap-4 items-center pt-2 border-t border-[#111]",children:[a.jsx("div",{className:"flex-1",children:a.jsxs("div",{className:"flex items-center gap-2 bg-black border border-[#333] px-3 py-2",children:[a.jsx(ON,{className:"w-4 h-4 text-[#8a8a8a]"}),a.jsx("input",{value:x.link||"",onChange:v=>m(x.id,{link:v.target.value}),className:"flex-1 bg-transparent text-white outline-none text-[15px]",placeholder:"https://..."})]})}),a.jsxs("div",{className:"flex items-center gap-6",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"text-[13px] text-[#8a8a8a] uppercase tracking-wider",children:"Featured on page"}),a.jsx(Zn,{checked:x.featured,onCheckedChange:v=>m(x.id,{featured:v})})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"text-[13px] text-[#8a8a8a] uppercase tracking-wider",children:"Published"}),a.jsx(Zn,{checked:x.published,onCheckedChange:v=>m(x.id,{published:v})})]}),a.jsx("button",{onClick:()=>h(x.id),className:"text-red-500 hover:text-red-400 p-2 transition-colors ml-4 border border-[#333] bg-black",children:a.jsx(ms,{className:"w-4 h-4"})})]})]})]},x.id))})]})}
63function o$(e,t,s){const r={...s},o=(c,u)=>JSON.stringify(c)===JSON.stringify(u);for(const c of new Set([...Object.keys(e),...Object.keys(t)]))if(!o(e[c],t[c])){if(!o(e[c],s[c])&&!o(t[c],s[c]))throw new Error(`"${c}" was changed in another session. Your edits are still here; copy them before reopening Settings to review the newer version.`);Object.assign(r,{[c]:t[c]})}return r}function l$(){const e=mt(),{data:t}=Os({site:e}),{data:s}=OC(),r=mr(),o=y.useRef(null),c=y.useRef(!1),u=y.useRef(!1),[f,h]=y.useState(!1),[m,p]=y.useState(!1),[x,v]=y.useState(null),j=Xd(),w=k5(),{toast:C}=Sn(),[S,N]=y.useState(null),[E,R]=y.useState(""),[D,A]=y.useState(!1);t&&S===null&&(o.current=t.settings,N(t.settings),R(t.settings.types.join(", ")));const{uploadFile:_,isUploading:F}=Rs({site:e,onSuccess:L=>N(z=>z?{...z,headshot:L}:null),onError:()=>C({title:"Upload failed",variant:"destructive"})}),{isUploading:O}=Rs({site:e,onSuccess:L=>N(z=>z?{...z,favicon:L}:null),onError:()=>C({title:"Upload failed",variant:"destructive"})}),{uploadFile:I,isUploading:V}=Rs({site:e,onSuccess:L=>N(z=>z?{...z,socialShareImage:L}:null),onError:()=>C({title:"Social image upload failed",description:"Your previous image has been kept. Please try again.",variant:"destructive"})}),H=async()=>{if(!(!t||!S||u.current||F||O||V||D||j.isPending||c.current)){c.current=!0,h(!0);try{const L=Array.from(new Set(E.split(",").map(K=>K.trim()).filter(Boolean))),z=await zi({site:e}),W=o$(o.current??t.settings,{...S,types:L},z.settings),M=await j.mutateAsync({data:{...z,settings:W}});o.current=M.settings,N(M.settings),R(M.settings.types.join(", ")),r.setQueryData(cr({site:e}),M),C({title:"Settings saved"})}catch(L){const z=typeof L=="object"&&L!==null&&"status"in L&&L.status===409;C({title:"Settings were not saved",description:z?"The draft changed while saving. Your edits are still here. Click Save Settings again to retry with the latest version.":L instanceof Error?L.message:"Please try again. Your edits are still here.",variant:"destructive"})}finally{c.current=!1,h(!1)}}},k=async()=>{if(!(u.current||c.current||f||w.isPending||F||O||V||D)&&window.confirm("Replace the development draft with the public live site? This will discard development drafts and unsaved Settings edits. Only publicly published content is copied; unpublished live drafts and deleted items are not included.")){u.current=!0,p(!0),v(null);try{await Za();const L=await w.mutateAsync({params:{site:e}});o.current=L.settings,N(L.settings),R(L.settings.types.join(", ")),r.setQueryData(cr({site:e}),L),await r.invalidateQueries({queryKey:cr({site:e})}),v({type:"success",text:"Development draft replaced with the public live content. Review it, then use Publish Changes when ready."}),C({title:"Live content copied to development draft"})}catch(L){const W=typeof L=="object"&&L!==null&&"status"in L&&L.status===409?"The development draft changed while pulling. Nothing was replaced; reload and try again.":L instanceof Error?L.message:"The live content could not be copied. Your development draft was not changed.";v({type:"error",text:W}),C({title:"Live content was not copied",description:W,variant:"destructive"})}finally{u.current=!1,p(!1)}}},q=(L,z)=>{S&&N({...S,contacts:S.contacts.map(W=>W.id===L?{...W,...z}:W)})},J=()=>{if(!S)return;const L={id:crypto.randomUUID(),group:"General",name:"",email:"",visible:!0};N({...S,contacts:[...S.contacts,L]})},re=L=>{S&&N({...S,contacts:S.contacts.filter(z=>z.id!==L)})},U=(L,z)=>{S&&N({...S,labels:{...S.labels||{},[L]:z}})};return!t||!S?null:a.jsxs("div",{className:"p-8 md:p-12 max-w-4xl mx-auto pb-32",children:[a.jsxs("div",{className:"flex justify-between items-center mb-12",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl text-white mb-2",children:"Settings & Contacts"}),a.jsx("p",{className:"text-[#8a8a8a]",children:"Manage global site data."})]}),a.jsxs("button",{onClick:H,disabled:f||m||j.isPending||F||O||V||D,className:"bg-white text-black px-4 py-2 flex items-center gap-2 hover:bg-[#e5e5e5] transition-colors text-[15px] disabled:opacity-50",children:[f||j.isPending?a.jsx(Ue,{className:"w-4 h-4 animate-spin"}):a.jsx(co,{className:"w-4 h-4"}),"Save Settings"]})]}),s?.canPullLiveContent&&a.jsxs("section",{className:"mb-12 border border-[#333] bg-[#080808] p-5 space-y-4","aria-labelledby":"pull-live-heading",children:[a.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[a.jsxs("div",{className:"max-w-2xl space-y-2",children:[a.jsx("h2",{id:"pull-live-heading",className:"text-[17px] text-white",children:"Development-only live content pull"}),a.jsx("p",{className:"text-[14px] text-[#b0b0b0]",children:"Replace this development draft with a snapshot from the public live site. This is a full replacement, not a merge, so development-only drafts and unsaved Settings edits will be lost."}),a.jsx("p",{className:"text-[13px] text-[#8a8a8a]",children:"Only publicly published live content is copied. Unpublished live drafts and deleted items are not included. The result stays in your development draft until you choose Publish Changes."})]}),a.jsxs("button",{type:"button",onClick:k,disabled:m||u.current||f||j.isPending||F||O||V||D,className:"border border-white text-white px-4 py-2 flex items-center gap-2 hover:bg-white hover:text-black transition-colors text-[14px] disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-white",children:[m?a.jsx(Ue,{className:"w-4 h-4 animate-spin"}):a.jsx(XO,{className:"w-4 h-4"}),m?"Pulling live content…":"Pull live content"]})]}),x&&a.jsx("p",{role:x.type==="error"?"alert":"status",className:x.type==="error"?"text-[13px] text-red-400":"text-[13px] text-emerald-400",children:x.text})]}),a.jsxs("fieldset",{disabled:f||j.isPending||m,className:"space-y-12 min-w-0",children:[a.jsxs("section",{className:"space-y-6",children:[a.jsx("h2",{className:"text-[17px] text-[#8a8a8a] border-b border-[#333] pb-2",children:"Profile & Bio"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[13px] text-[#8a8a8a] uppercase tracking-wider",children:"Name"}),a.jsx("input",{value:S.name,onChange:L=>N({...S,name:L.target.value}),className:"w-full bg-[#050505] border border-[#333] p-3 text-white outline-none"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[13px] text-[#8a8a8a] uppercase tracking-wider",children:"Role"}),a.jsx("input",{value:S.role,onChange:L=>N({...S,role:L.target.value}),className:"w-full bg-[#050505] border border-[#333] p-3 text-white outline-none"})]})]}),a.jsxs("div",{className:"flex gap-8",children:[a.jsxs("div",{className:"flex-1 space-y-2",children:[a.jsx("label",{className:"text-[13px] text-[#8a8a8a] uppercase tracking-wider",children:"Bio (HTML allowed)"}),a.jsx("textarea",{value:S.bio,onChange:L=>N({...S,bio:L.target.value}),className:"w-full bg-[#050505] border border-[#333] p-3 text-white outline-none min-h-[200px] font-mono text-sm leading-relaxed",placeholder:"<p>Bio text here...</p>"})]}),a.jsxs("div",{className:"w-[200px] space-y-2",children:[a.jsx("label",{className:"text-[13px] text-[#8a8a8a] uppercase tracking-wider",children:"Headsh
63ot (3:4)"}),a.jsx("div",{className:"w-full aspect-[3/4] bg-[#050505] border border-[#333] relative group",children:S.headshot?a.jsx("img",{src:zt(S.headshot,e),alt:"",className:"w-full h-full object-cover"}):a.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-[#8a8a8a] gap-2",children:[a.jsx(_l,{className:"w-6 h-6"}),a.jsx("span",{className:"text-[11px]",children:"No Image"})]})}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsxs("label",{className:`cursor-pointer bg-white text-black px-3 py-2 text-sm ${F||D||j.isPending?"opacity-50 pointer-events-none":""}`,children:[F?"Uploading...":S.headshot?"Replace image":"Upload image",a.jsx("input",{type:"file",className:"sr-only",accept:"image/*","aria-label":"Upload profile image",disabled:F||D||j.isPending,onChange:async L=>{const z=L.target.files?.[0];if(L.target.value="",!!z)try{await _(z,"headshot")}catch{}}})]}),a.jsx(Od,{imagePath:S.headshot,site:e,kind:"headshot",disabled:F||j.isPending,onBusyChange:A,onApply:L=>N(z=>z?{...z,headshot:L}:null)})]}),a.jsx("p",{className:"text-[12px] text-[#8a8a8a]",children:"Apply your crop, then Save Settings. It stays in your draft until you publish."})]})]})]}),a.jsxs("section",{className:"space-y-4","aria-labelledby":"social-image-heading",children:[a.jsx("h2",{id:"social-image-heading",className:"text-[17px] text-[#8a8a8a] border-b border-[#333] pb-2",children:"Site-wide Social Image"}),a.jsx("p",{className:"text-[14px] text-[#8a8a8a]",children:"Upload your own image for links to the homepage, About, and Work index. Individual project pages still use their own stills."}),a.jsxs("div",{className:"relative aspect-[1200/630] w-full max-w-lg border border-[#333] bg-black",children:[a.jsx("img",{src:zt(S.socialShareImage,e)||"/social-share.png",alt:S.socialShareImage?"Custom site-wide social image preview":"Default Michael Marantz Director social image",className:"w-full h-full object-contain"}),V&&a.jsxs("div",{role:"status",className:"absolute inset-0 flex items-center justify-center gap-2 bg-black/75 text-white text-sm",children:[a.jsx(Ue,{"aria-hidden":"true",className:"w-4 h-4 animate-spin"})," Uploading…"]})]}),a.jsx("p",{className:"text-[13px] text-[#8a8a8a]",children:"Recommended: 1200 × 630 pixels. Other sizes are center-cropped. PNG, JPG, or WebP."}),a.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[a.jsxs("label",{className:`relative inline-flex items-center gap-2 border border-[#333] px-4 py-2 text-sm text-white focus-within:ring-2 focus-within:ring-white ${V?"opacity-50":"cursor-pointer hover:bg-[#111]"}`,children:[a.jsx(_l,{"aria-hidden":"true",className:"w-4 h-4"}),S.socialShareImage?"Replace image":"Upload image",a.jsx("input",{type:"file",accept:"image/png,image/jpeg,image/webp","aria-label":S.socialShareImage?"Replace site-wide social image":"Upload site-wide social image",className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer disabled:cursor-not-allowed",disabled:V,onChange:async L=>{const z=L.target.files?.[0];L.target.value="",z&&await I(z,"share").catch(()=>{})}})]}),S.socialShareImage&&a.jsx("button",{type:"button",disabled:V,onClick:()=>N(L=>L?{...L,socialShareImage:""}:null),className:"text-sm text-[#8a8a8a] hover:text-white underline underline-offset-4 disabled:opacity-50",children:"Reset to default"})]}),a.jsx("p",{className:"text-[13px] text-[#8a8a8a]",children:"Choose Save Settings to save your draft, then Publish Changes when you’re ready to make it public."})]}),a.jsxs("section",{className:"space-y-6",children:[a.jsx("h2",{className:"text-[17px] text-[#8a8a8a] border-b border-[#333] pb-2",children:"Links"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[13px] text-[#8a8a8a] uppercase tracking-wider",children:"TED Talk URL"}),a.jsx("input",{value:S.tedUrl||"",onChange:L=>N({...S,tedUrl:L.target.value}),className:"w-full bg-[#050505] border border-[#333] p-3 text-white outline-none"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[13px] text-[#8a8a8a] uppercase tracking-wider",children:"Instagram URL"}),a.jsx("input",{value:S.instagramUrl||"",onChange:L=>N({...S,instagramUrl:L.target.value}),className:"w-full bg-[#050505] border border-[#333] p-3 text-white outline-none"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[13px] text-[#8a8a8a] uppercase tracking-wider",children:"Vimeo URL"}),a.jsx("input",{value:S.vimeoUrl||"",onChange:L=>N({...S,vimeoUrl:L.target.value}),className:"w-full bg-[#050505] border border-[#333] p-3 text-white outline-none"})]})]})]}),a.jsxs("section",{className:"space-y-6",children:[a.jsxs("div",{className:"flex justify-between items-end border-b border-[#333] pb-2",children:[a.jsx("h2",{className:"text-[17px] text-[#8a8a8a]",children:"Contacts"}),a.jsxs("button",{onClick:J,className:"text-white hover:text-[#8a8a8a] transition-colors flex items-center gap-1 text-[13px] uppercase tracking-wider",children:[a.jsx(Jt,{className:"w-4 h-4"})," Add"]})]}),a.jsx("div",{className:"space-y-4",children:S.contacts.map(L=>a.jsxs("div",{className:"bg-[#050505] border border-[#333] p-4 flex flex-col md:flex-row gap-4 items-start md:items-center",children:[a.jsx("div",{className:"w-32",children:a.jsxs("select",{value:L.group,onChange:z=>q(L.id,{group:z.target.value}),className:"w-full bg-black border border-[#333] p-2 text-white outline-none appearance-none text-sm",children:[a.jsx("option",{value:"Narrative",children:"Narrative"}),a.jsx("option",{value:"Commercial",children:"Commercial"}),a.jsx("option",{value:"General",children:"General"}),a.jsx("option",{value:"Press",children:"Press"})]})}),a.jsxs("div",{className:"flex-1 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 w-full",children:[a.jsx("input",{value:L.label||"",onChange:z=>q(L.id,{label:z.target.value}),placeholder:"Custom Label (optional)",className:"w-full bg-black border border-[#333] p-2 text-white outline-none text-sm"}),a.jsx("input",{value:L.company||"",onChange:z=>q(L.id,{company:z.target.value}),placeholder:"Company",className:"w-full bg-black border border-[#333] p-2 text-white outline-none text-sm"}),a.jsx("input",{value:L.name,onChange:z=>q(L.id,{name:z.target.value}),placeholder:"Person Name",className:"w-full bg-black border border-[#333] p-2 text-white outline-none text-sm"}),a.jsx("input",{value:L.email,onChange:z=>q(L.id,{email:z.target.value}),placeholder:"Email",className:"w-full bg-black border border-[#333] p-2 text-white outline-none text-sm lg:col-span-3"})]}),a.jsxs("div",{className:"flex items-center gap-4 shrink-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-[13px] text-[#8a8a8a]",children:"Visible"}),a.jsx(Zn,{checked:L.visible,onCheckedChange:z=>q(L.id,{visible:z})})]}),a.jsx("button",{onClick:()=>re(L.id),className:"text-red-500 hover:text-red-400 p-2 border border-[#333] bg-black transition-colors",children:a.jsx(ms,{className:"w-4 h-4"})})]})]},L.id))})]}),a.jsxs("section",{className:"space-y-6",children:[a.jsx("h2",{className:"text-[17px] text-[#8a8a8a] border-b border-[#333] pb-2",children:"Site Configuration"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[13px] text-[#8a8a8a] uppercase tracking-wider",children:"Site Title (SEO)"}),a.jsx("input",{value:S.siteTitle,onChange:L=>N({...S,siteTitle:L.target.value}),className:"w-full bg-[#050505] border border-[#333] p-3 text-white outline-none"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[13px] text-[#8a8a8a] uppercase tracking-wider",children:"Theme"}),a.jsxs("select",{value:S.theme,onChange:L=>N({...S,theme:L.target.value}),className:"w-full bg-[#050505] border border-[#333] p-3 text-white outline-none appearance-none",children:[a.jsx("option",{value:"dark",children:"Dark (Default)"}),a.jsx("option",{value:"light",children:"Light"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[13px] text-[#8a8a8a] uppercase tracking-wider",children:"Meta Description (SEO)"}),a.jsx("textarea",{value:S.metaDescription,onChange:L=>N({...S,metaDescription:L.target.value}),className:"w-full bg-[#050505] border border-[#333] p-3 text-white outline-none min-h-[80px]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{htmlFor:"work-types",className:"text-[13px] text-[#8a8a8a] uppercase tracking-wider",children:"Work Types (comma separated, controls order)"}),a.jsx("input",{id:"work-types",value:E,onChange:L=>R(L.target.value),disabled:j.isPending,className:"w-full bg-[#050505] border border-[#333] p-3 text-white outline-none",placeholder:"Narrative, Commercial, Non-Profit, Music Video, Documentary"}),a.jsx("p",{className:"text-[13px] text-[#8a8a8a]",children:"Separate types with commas, then save settings. New types become available in the work editor."})]})]}),a.jsxs("section",{className:"space-y-6",children:[a.jsx("h2",{className:"text-[17px] text-[#8a8a8a] border-b border-[#333] pb-2",children:"UI Labels (Optional Overrides)"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[13px] text-[#8a8a8a] uppercase tracking-wider",children:"Contact Nav Link"}),a.jsx("input",{value:S.labels?.contact||"",onChange:L=>U("contact",L.target.value),className:"w-full bg-[#050505] border border-[#333] p-3 text-white outline-none",placeholder:"Contact"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[13px] text-[#8a8a8a] uppercase tracking-wider",children:"Watch Trailer"}),a.jsx("input",{value:S.labels?.watchTrailer||"",onChange:L=>U("watchTrailer",L.target.value),className:"w-full bg-[#050505] border border-[#333] p-3 text-white outline-none",placeholder:"Watch trailer"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[13px] text-[#8a8a8a] uppercase tracking-wider",children:"Full Credits"}),a.jsx("input",{value:S.labels?.fullCredits||"",onChange:L=>U("fullCredits",L.target.value),className:"w-full bg-[#050505] border border-[#333] p-3 text-white outline-none",placeholder:"Full credits"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[13px] text-[#8a8a8a] uppercase tracking-wider",children:"Screener Line"}),a.jsx("input",{value:S.labels?.screenerLine||"",onChange:L=>U("screenerLine",L.target.value),className:"w-full bg-[#050505] border border-[#333] p-3 text-white outline-none",placeholder:"Full film available on request"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[13px] text-[#8a8a8a] uppercase tracking-wider",children:"Next Film"}),a.jsx("input",{value:S.labels?.nextFilm||"",onChange:L=>U("nextFilm",L.target.value),className:"w-full bg-[#050505] border border-[#333] p-3 text-white outline-none",placeholder:"Next film"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[13px] text-[#8a8a8a] uppercase tracking-wider",children:"Next Work Item"}),a.jsx("input",{value:S.labels?.nextItem||"",onChange:L=>U("nextItem",L.target.value),className:"w-full bg-[#050505] border border-[#333] p-3 text-white outline-none",placeholder:"Next"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[13px] text-[#8a8a8a] uppercase tracking-wider",children:"Back To Work"}),a.jsx("input",{value:S.labels?.backToWork||"",onChange:L=>U("backToWork",L.target.value),className:"w-full bg-[#050505] border border-[#333] p-3 text-white outline-none",placeholder:"Back to work"})]})]})]})]})]})}function c$(e){try{const t=sessionStorage.getItem(e);if(t!==null){if(/^[\da-f]{8}-[\da-f]{4}-4[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i.test(t))return t;
63throw new Error("A stored retry key is invalid. Do not replace it with a new key.")}const s=crypto.randomUUID();if(sessionStorage.setItem(e,s),sessionStorage.getItem(e)!==s)throw new Error("The retry key could not be persisted.");return s}catch(t){throw new Error(t instanceof Error&&t.message.startsWith("A stored retry key")?t.message:"The browser could not safely persist this retry key. No consent email was sent; enable session storage and try again.")}}function u$(e){try{return sessionStorage.removeItem(e),sessionStorage.getItem(e)===null}catch{return!1}}function Jj(){const[e,t]=y.useState("campaigns");return a.jsxs("div",{className:"p-8 md:p-12 max-w-5xl mx-auto font-sans text-white",children:[a.jsx("div",{className:"flex flex-col md:flex-row md:items-end justify-between gap-6 mb-12",children:a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl mb-2",children:"Newsletter"}),a.jsx("p",{className:"text-[#8a8a8a]",children:"Manage your website-owned audience and approved newsletter campaigns."})]})}),a.jsx("div",{className:"flex gap-8 border-b border-[#333] mb-8",children:["campaigns","subscribers","settings"].map(s=>a.jsx("button",{onClick:()=>t(s),className:`pb-4 text-[15px] transition-colors border-b-2 capitalize ${e===s?"border-white text-white":"border-transparent text-[#8a8a8a] hover:text-white"}`,children:s},s))}),e==="campaigns"&&a.jsx(d$,{}),e==="subscribers"&&a.jsx(h$,{}),e==="settings"&&a.jsx(m$,{})]})}function d$(){const e=mt(),{data:t,isLoading:s,isError:r,error:o}=z8({site:e},{query:{queryKey:[...Ka({site:e}),e],refetchInterval:1e4,refetchOnMount:"always"},request:{portfolioSite:e}});return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("h2",{className:"text-lg",children:"Campaigns"}),a.jsxs(xt,{href:"/admin/newsletter/new",className:"bg-white text-black px-4 py-2 text-[15px] flex items-center gap-2 hover:bg-[#e5e5e5] transition-colors",children:[a.jsx(Jt,{className:"w-4 h-4"})," New Campaign"]})]}),a.jsx(f$,{site:e}),s?a.jsx("div",{className:"flex justify-center p-8",children:a.jsx(Ue,{className:"w-4 h-4 animate-spin"})}):r?a.jsxs("div",{role:"alert",className:"p-6 border border-red-500/40 bg-red-950/20 text-red-300",children:["Could not load this site's campaigns: ",o instanceof Error?o.message:"Unknown error"]}):t&&t.length>0?a.jsx("div",{className:"border border-[#333] bg-[#050505] divide-y divide-[#333]",children:t.map(c=>{const u=c.deliveryMode==="legacy_broadcast"||c.deliveryMode==="legacy_unknown",f=c.progress;return a.jsxs("div",{className:"p-4 flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-[17px] mb-1",children:c.name}),a.jsx("div",{className:"text-[#8a8a8a] text-[15px]",children:c.subject}),u?a.jsx("p",{className:"text-amber-400/80 text-[12px] mt-2",children:"Historical Resend Broadcast — read only; cannot be resumed or resent."}):f&&a.jsxs("p",{className:"text-[#8a8a8a] text-[12px] mt-2",children:[f.acceptedCount," accepted · ",f.deliveredCount," delivered · ",f.queuedCount," queued · ",f.sendingCount," sending · ",f.retryableCount," retryable · ",f.skippedCount," skipped · ",f.failedCount," failed · ",f.manualReviewCount," needs review"]})]}),a.jsxs("div",{className:"flex items-center gap-6",children:[a.jsxs("div",{className:"text-right",children:[a.jsx("div",{className:"text-[#8a8a8a] text-[12px] uppercase tracking-wider mb-1",children:u?"Historical status":"Status"}),a.jsx("div",{className:`text-[14px] capitalize ${c.status==="sent"&&!u?"text-green-500":"text-white"}`,children:u?c.status.replace("_"," "):c.status==="sending"?"In progress":c.status==="sent"?"Processing complete":c.status.replace("_"," ")})]}),c.status==="draft"&&!u&&a.jsx(xt,{href:`/admin/newsletter/${c.id}`,className:"px-4 py-2 border border-[#333] hover:border-white transition-colors text-[14px]",children:"Edit"}),(c.status==="sending"||c.status==="failed"||c.status==="manual_review")&&!u&&a.jsx(xt,{href:`/admin/newsletter/${c.id}`,className:"px-4 py-2 border border-[#333] hover:border-white transition-colors text-[14px]",children:c.status==="sending"?"Review progress":c.status==="failed"?"Review":"Manual review"}),(c.status==="sent"||u)&&a.jsx(xt,{href:`/admin/newsletter/${c.id}`,className:"px-4 py-2 border border-[#333] hover:border-white transition-colors text-[14px]",children:u?"View history":"View"})]})]},c.id)})}):a.jsx("div",{className:"p-12 border border-[#333] bg-[#050505] text-center text-[#8a8a8a]",children:"No campaigns created yet."})]})}function f$({site:e}){const{data:t,isPending:s,isError:r,error:o}=DC({site:e},{query:{queryKey:[...zl({site:e}),e],refetchOnMount:"always",refetchInterval:3e4},request:{portfolioSite:e}});if(s)return a.jsx("div",{className:"border border-[#333] bg-[#050505] p-5 text-[#8a8a8a] text-[14px]",children:"Loading website audience…"});if(r||!t)return a.jsxs("div",{role:"alert",className:"border border-red-500/40 bg-red-950/20 p-5 text-red-300 text-[14px]",children:["Could not load the website-managed audience: ",o instanceof Error?o.message:"No audience summary was returned."]});const c=typeof t.eligibleCount=="number"&&Number.isFinite(t.eligibleCount),u=[["Eligible to send",c?t.eligibleCount:"Unavailable",c?"text-green-400":"text-amber-200"],["Active",t.activeCount,"text-white"],["Pending consent",t.pendingCount,"text-yellow-300"],["Unsubscribed",t.unsubscribedCount,"text-[#aaa]"],["Suppressed",t.suppressedCount,"text-red-300"]];return a.jsxs("section",{"aria-label":"Website-managed newsletter audience",className:"border border-[#333] bg-[#050505] p-5",children:[a.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-3 mb-4",children:[a.jsxs("div",{children:[a.jsxs("h3",{className:"text-[15px]",children:[rr[e].newsletter," website-managed list"]}),a.jsx("p",{className:"text-[#8a8a8a] text-[12px] mt-1",children:"Only eligible subscribers are reviewed for a campaign. Pending and negative-status records are excluded."})]}),a.jsxs("div",{className:"text-[12px] text-[#8a8a8a]",children:[t.subscriberCount," total subscribers · ",t.campaignCount," campaigns"]})]}),!c&&a.jsx("p",{role:"alert",className:"mb-4 text-amber-200 text-[13px]",children:"The API did not return an eligible-recipient count. Campaign sending is disabled until the audience can be verified."}
63),a.jsx("dl",{className:"grid grid-cols-2 sm:grid-cols-5 gap-3",children:u.map(([f,h,m])=>a.jsxs("div",{className:"border border-[#292929] px-3 py-3",children:[a.jsx("dt",{className:"text-[11px] text-[#8a8a8a]",children:f}),a.jsx("dd",{className:`text-[20px] mt-1 ${m}`,children:h})]},f))})]})}function h$(){const e=mt(),t=rr[e],[s,r]=y.useState(0),o=50,c={limit:o,offset:s*o,site:e},u=[..._C(c),e],{data:f,isLoading:h}=N8(c,{query:{queryKey:u,refetchOnMount:"always",staleTime:15e3},request:{portfolioSite:e}}),m=_8({request:{portfolioSite:e}}),p=m_({request:{portfolioSite:e}}),x=mr(),{toast:v}=Sn(),j=async k=>{if(confirm("Are you sure you want to suppress this subscriber? They will not receive any more emails."))try{await m.mutateAsync({id:k}),await x.invalidateQueries({queryKey:u}),await x.invalidateQueries({queryKey:[...zl({site:e}),e]}),v({title:"Subscriber suppressed"})}catch{v({title:"Failed to suppress",variant:"destructive"})}},[w,C]=y.useState(!1),S=R8({request:{portfolioSite:e}}),[N,E]=y.useState(null),[R,D]=y.useState(""),[A,_]=y.useState(""),F=y.useRef(null),O=async k=>{if(k){if(!k.name.toLowerCase().endsWith(".csv")){D(""),_(""),E(null),v({title:"Choose a CSV file",variant:"destructive"});return}if(k.size>5*1024*1024){D(""),_(""),E(null),v({title:"CSV file is too large",description:"Choose a file smaller than 5 MB.",variant:"destructive"});return}try{const q=await k.text();if(!q.trim())throw new Error("The selected CSV file is empty.");D(q),_(k.name),E(null)}catch(q){D(""),_(""),E(null),v({title:"Could not read CSV file",description:q instanceof Error?q.message:String(q),variant:"destructive"})}}},I=async()=>{if(R){C(!0);try{const k=await S.mutateAsync({data:{csv:R,dryRun:!0},params:{site:e}});E(k)}catch(k){v({title:"Import failed",description:k instanceof Error?k.message:String(k),variant:"destructive"})}finally{C(!1)}}},V=async()=>{if(!(!R||!N||N.dryRun!==!0)&&confirm(`Import ${N.validRows} valid rows into the ${t.newsletter} website-managed list? Missing or unknown statuses remain pending; unsubscribed and suppressed records are never reactivated.`)){C(!0);try{const k=await S.mutateAsync({data:{csv:R,dryRun:!1},params:{site:e}});v({title:`Imported ${k.imported} subscribers`}),D(""),_(""),E(null),F.current&&(F.current.value=""),await x.invalidateQueries({queryKey:u}),await x.invalidateQueries({queryKey:[...zl({site:e}),e]})}catch(k){v({title:"Import failed",description:k instanceof Error?k.message:String(k),variant:"destructive"})}finally{C(!1)}}},H=async(k,q)=>{if(!confirm(`Send a consent-confirmation email to ${q}? They will remain pending until they confirm using the emailed link.`))return;const J=`newsletter-confirmation:${e}:${k}`;let re;try{re=c$(J)}catch(U){v({title:"No consent email was sent",description:U instanceof Error?U.message:"Could not safely persist an email retry key.",variant:"destructive"});return}try{if((await p.mutateAsync({id:k,data:{confirm:"SEND",requestId:re}})).status!=="accepted"){v({title:"Consent-email outcome is not confirmed as accepted",description:"The same retry key remains stored. Retry only for this subscriber; do not create a new request key.",variant:"destructive"});return}const L=u$(J);v({title:"Consent email accepted",description:L?"The subscriber stays pending until they confirm the link.":"Acceptance was confirmed but this browser could not clear the retry key. Verify delivery before trying another confirmation email."}),await x.invalidateQueries({queryKey:u})}catch(U){v({title:"Consent-email outcome is unconfirmed",description:`${U instanceof Error?U.message:String(U)} The retry key remains stored. Retry only for this subscriber; do not create a new key or confirmation token.`,variant:"destructive"})}};return a.jsxs("div",{className:"space-y-8",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[a.jsxs("div",{className:"border border-[#333] p-6 bg-[#050505]",children:[a.jsxs("h3",{className:"text-[17px] mb-4 flex items-center gap-2",children:[a.jsx(_0,{className:"w-4 h-4"})," Import CSV"]}),a.jsxs("p",{className:"text-[#8a8a8a] text-[12px] mb-3",children:["Destination: ",t.newsletter,"'s website-managed audience. Review the dry run before importing; no email is sent."]}),a.jsx("p",{className:"text-[#8a8a8a] text-[14px] mb-4",children:"Choose a CSV file with an email column. Missing or unknown statuses import as pending. Active rows require consent_source and an ISO consent_at timestamp."}),a.jsxs("label",{className:"relative w-full min-h-32 border border-dashed border-[#555] bg-black px-4 py-6 mb-4 flex flex-col items-center justify-center gap-2 text-center cursor-pointer hover:border-white focus-within:border-white transition-colors",children:[a.jsx("input",{ref:F,type:"file",accept:".csv,text/csv",onChange:k=>{O(k.target.files?.[0])},className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer","aria-label":"Choose subscriber CSV file"}),a.jsx(_0,{className:"w-5 h-5"}),a.jsx("span",{className:"text-[14px]",children:A||"Choose CSV file"}),a.jsx("span",{className:"text-[12px] text-[#8a8a8a]",children:A?"Choose a different file":"Maximum file size: 5 MB"})]}),a.jsx("button",{onClick:I,disabled:!R||w,className:"w-full bg-white text-black py-2 px-4 flex justify-center items-center gap-2 hover:bg-[#e5e5e5] transition-colors disabled:opacity-50",children:w?a.jsx(Ue,{className:"w-4 h-4 animate-spin"}):"Review Import"}),N&&a.jsxs("div",{className:"mt-4 border border-[#444] bg-black p-4 space-y-3",children:[a.jsx("h4",{className:"text-[14px]",children:"Review import preview"}),a.jsxs("dl",{className:"grid grid-cols-2 gap-y-2 text-[12px] text-[#aaa]",children:[a.jsx("dt",{children:"Rows checked"}),a.jsx("dd",{className:"text-white",children:N.totalRows}),a.jsx("dt",{children:"Valid rows"}),a.jsx("dd",{className:"text-white",children:N.validRows}),a.jsx("dt",{children:"Duplicates (skipped)"}),a.jsx("dd",{className:"text-white",children:N.duplicateRows}),a.jsx("dt",{children:"Invalid rows (skipped)"}),a.jsx("dd",{className:"text-white",children:N.invalidRows}),a.jsx("dt",{children:"Suppressed rows"}),a.jsx("dd",{className:"text-white",children:N.suppressedRows})]}),N.errors?.length?a.jsx("ul",{className:"list-disc pl-5 text-[12px] text-amber-300 space-y-1","aria-label":"Import preview errors",children:N.errors.slice(0,10).map((k,q)=>a.jsx("li",{children:k},`${q}-${k}`))}):a.jsx("p",{className:"text-[#8a8a8a] text-[12px]",children:"No row errors in this preview."}),N.errors&&N.errors.length>10&&a.jsxs("p",{className:"text-[#8a8a8a] text-[12px]",children:["Showing 10 of ",N.errors.length," row errors."]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{type:"button",onClick:V,disabled:w||!N.validRows,className:"flex-1 bg-white text-black py-2 px-3 disabled:opacity-50",children:w?"Importing…":`Import ${N.validRows} valid rows`}),a.jsx("button",{type:"button",onClick:()=>E(null),disabled:w,className:"border border-[#555] px-3 py-2",children:"Cancel"})]})]})]}),a.jsxs("div",{className:"border border-[#333] p-6 bg-[#050505] flex flex-col",children:[a.jsxs("h3",{className:"text-[17px] mb-4 flex items-center gap-2",children:[a.jsx(tD,{className:"w-4 h-4"})," Export Subscribers"]}
63),a.jsx("p",{className:"text-[#8a8a8a] text-[14px] mb-auto",children:"Download a CSV of all subscribers including their status and timestamps."}),a.jsx("a",{href:k8({site:e}),target:"_blank",rel:"noreferrer",className:"w-full border border-[#333] bg-black text-white py-2 px-4 flex justify-center items-center gap-2 hover:border-white transition-colors",children:"Download CSV"})]})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-[17px] mb-4",children:"Subscribers List"}),h?a.jsx("div",{className:"flex justify-center p-8",children:a.jsx(Ue,{className:"w-4 h-4 animate-spin"})}):a.jsxs("div",{className:"border border-[#333] bg-[#050505]",children:[a.jsxs("table",{className:"w-full text-left text-[15px]",children:[a.jsx("thead",{className:"border-b border-[#333] text-[#8a8a8a]",children:a.jsxs("tr",{children:[a.jsx("th",{className:"p-4 font-normal",children:"Email"}),a.jsx("th",{className:"p-4 font-normal",children:"Status"}),a.jsx("th",{className:"p-4 font-normal",children:"Signup Source"}),a.jsx("th",{className:"p-4 font-normal",children:"Consent Evidence"}),a.jsx("th",{className:"p-4 font-normal",children:"Created"}),a.jsx("th",{className:"p-4 font-normal text-right",children:"Actions"})]})}),a.jsxs("tbody",{className:"divide-y divide-[#333]",children:[f?.items.map(k=>a.jsxs("tr",{children:[a.jsx("td",{className:"p-4",children:k.email}),a.jsx("td",{className:"p-4",children:a.jsx("span",{className:`px-2 py-1 text-[12px] uppercase tracking-wider ${k.status==="active"?"bg-green-500/10 text-green-500":k.status==="pending"?"bg-yellow-500/10 text-yellow-500":"bg-red-500/10 text-red-500"}`,children:k.status})}),a.jsx("td",{className:"p-4 text-[#8a8a8a]",children:k.source}),a.jsxs("td",{className:"p-4 text-[#8a8a8a]",children:[k.consentSource||"No consent recorded",k.consentAt&&a.jsx("div",{className:"text-[12px] mt-1",children:new Date(k.consentAt).toLocaleDateString()})]}),a.jsx("td",{className:"p-4 text-[#8a8a8a]",children:new Date(k.createdAt).toLocaleDateString()}),a.jsxs("td",{className:"p-4 text-right",children:[k.status==="pending"&&a.jsx("button",{onClick:()=>{H(k.id,k.email)},disabled:p.isPending,className:"border border-[#555] px-3 py-1 text-[12px] text-white hover:border-white disabled:opacity-50",children:"Send consent email"}),k.status!=="suppressed"&&a.jsx("button",{onClick:()=>j(k.id),className:"text-[#8a8a8a] hover:text-white p-2 transition-colors",title:"Suppress",children:a.jsx(PD,{className:"w-4 h-4"})})]})]},k.id)),(!f?.items||f.items.length===0)&&a.jsx("tr",{children:a.jsx("td",{colSpan:6,className:"p-8 text-center text-[#8a8a8a]",children:"No subscribers found."})})]})]}),f&&f.total>o&&a.jsxs("div",{className:"p-4 border-t border-[#333] flex justify-between items-center text-[14px]",children:[a.jsxs("span",{className:"text-[#8a8a8a]",children:["Showing ",s*o+1," - ",Math.min((s+1)*o,f.total)," of ",f.total]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{disabled:s===0,onClick:()=>r(k=>k-1),className:"px-3 py-1 border border-[#333] disabled:opacity-30 hover:border-white transition-colors",children:"Prev"}),a.jsx("button",{disabled:(s+1)*o>=f.total,onClick:()=>r(k=>k+1),className:"px-3 py-1 border border-[#333] disabled:opacity-30 hover:border-white transition-colors",children:"Next"})]})]})]})]})]})}function m$(){const e=mt(),{data:t,isLoading:s}=PC({site:e},{query:{queryKey:[...pd({site:e}),e],refetchOnMount:"always"},request:{portfolioSite:e}}),r=b8({request:{portfolioSite:e}}),o=mr(),{toast:c}=Sn(),[u,f]=y.useState({senderName:"",senderEmail:"",replyTo:"",brandName:"",websiteUrl:"",domain:""});y.useEffect(()=>{if(!t){f({senderName:"",senderEmail:"",replyTo:"",brandName:"",websiteUrl:"",domain:""});return}f({senderName:t.senderName||"",senderEmail:t.senderEmail||"",replyTo:t.replyTo||"",brandName:t.brandName||"",websiteUrl:t.websiteUrl||"",domain:t.domain||""})},[t,e]);const h=async m=>{m.preventDefault();try{await r.mutateAsync({data:u,params:{site:e}}),c({title:"Settings updated"}),await o.invalidateQueries({queryKey:[...pd({site:e}),e]})}catch{c({title:"Failed to update settings",variant:"destructive"})}};return s?a.jsx("div",{className:"flex justify-center p-8",children:a.jsx(Ue,{className:"w-4 h-4 animate-spin"})}):a.jsx("div",{className:"space-y-8 max-w-3xl",children:a.jsxs("form",{onSubmit:h,className:"border border-[#333] p-6 bg-[#050505] space-y-6",children:[a.jsxs("div",{className:"border-b border-[#333] pb-4",children:[a.jsx("h3",{className:"text-[17px]",children:"Sender & website identity"}),a.jsx("p",{className:"text-[13px] text-[#8a8a8a] mt-1",children:"Resend delivers email. This website owns the subscriber list, consent and unsubscribe preferences; no segment is required."})]}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"block text-[14px] text-[#8a8a8a]",children:"Sender Name"}),a.jsx("input",{required:!0,type:"text",value:u.senderName,onChange:m=>f(p=>({...p,senderName:m.target.value})),className:"w-full bg-black border border-[#333] px-3 py-2 text-[15px] focus:outline-none focus:border-white transition-colors"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"block text-[14px] text-[#8a8a8a]",children:"Sender Email"}),a.jsx("input",{required:!0,type:"email",value:u.senderEmail,onChange:m=>f(p=>({...p,senderEmail:m.target.value})),className:"w-full bg-black border border-[#333] px-3 py-2 text-[15px] focus:outline-none focus:border-white transition-colors"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"block text-[14px] text-[#8a8a8a]",children:"Reply-To Email"}),a.jsx("input",{required:!0,type:"email",value:u.replyTo,onChange:m=>f(p=>({...p,replyTo:m.target.value})),className:"w-full bg-black border border-[#333] px-3 py-2 text-[15px] focus:outline-none focus:border-white transition-colors"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"block text-[14px] text-[#8a8a8a]",children:"Brand Name"}),a.jsx("input",{required:!0,type:"text",value:u.brandName,onChange:m=>f(p=>({...p,brandName:m.target.value})),className:"w-full bg-black border border-[#333] px-3 py-2 text-[15px] focus:outline-none focus:border-white transition-colors"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"block text-[14px] text-[#8a8a8a]",children:"Website URL"}),a.jsx("input",{required:!0,type:"url",value:u.websiteUrl,onChange:m=>f(p=>({...p,websiteUrl:m.target.value})),className:"w-full bg-black border border-[#333] px-3 py-2 text-[15px] focus:outline-none focus:border-white transition-colors"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"block text-[14px] text-[#8a8a8a]",children:"Sending domain (optional)"}),a.jsx("input",{type:"text",value:u.domain,onChange:m=>f(p=>({...p,domain:m.target.value})),className:"w-full bg-black border border-[#333] px-3 py-2 text-[15px] focus:outline-none focus:border-white transition-colors"})]})]}),a.jsx("div",{className:"pt-4 border-t border-[#333] flex justify-end",children:a.jsxs("button",{type:"submit",disabled:r.isPending,className:"bg-white text-black px-6 py-2 flex items-center gap-2 hover:bg-[#e5e5e5] transition-colors disabled:opacity-50",children:[r.isPending&&a.jsx(Ue,{className:"w-4 h-4 animate-spin"})," Save Settings"]})})]})})}function nA(e,t){return e.catch(()=>{}).then(t)}function bl(e,t,s){return e.contextKey!==s||e.name!==t.name||e.subject!==t.subject||e.preheader!==t.preheader||JSON.stringify(e.blocks)!==JSON.stringify(t.blocks)}function Lu(e){return typeof e=="object"&&e!==null&&"status"in e&&e.status===409}function eS(e){try{const t=sessionStorage.getItem(e);if(t!==null){if(/^[\da-f]{8}-[\da-f]{4}-4[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i.test(t))return t;
63throw new Error("A stored retry key is invalid. No email was sent; do not replace it with a new key.")}const s=crypto.randomUUID();if(sessionStorage.setItem(e,s),sessionStorage.getItem(e)!==s)throw new Error("The retry key could not be persisted. No email was sent.");return s}catch(t){throw new Error(t instanceof Error&&t.message.startsWith("A stored retry key")?t.message:"The browser could not safely persist this retry key. No email was sent; enable session storage and try again.")}}function tS(e){try{return sessionStorage.removeItem(e),sessionStorage.getItem(e)===null}catch{return!1}}function p$(e){const t=JSON.stringify({subject:e.subject,preheader:e.preheader,blocks:e.blocks});let s=2166136261,r=5381;for(let c=0;c<t.length;c+=1){const u=t.charCodeAt(c);s=Math.imul(s^u,16777619),r=Math.imul(r,33)^u}const o=`${(s>>>0).toString(36)}-${(r>>>0).toString(36)}`;return`newsletter-test:${e.site}:${e.campaignId}:${encodeURIComponent(e.email.trim().toLowerCase())}:${o}`}function Uu(){const e=mt(),[t,s]=Qi("/admin/newsletter/:id"),[,r]=zn(),o=!s?.id||s.id==="new",c=o?"":s.id,{data:u,isLoading:f,isError:h,error:m,refetch:p}=Y8(c,{query:{enabled:!o,queryKey:[...Hu(c),e],refetchOnMount:"always",refetchInterval:be=>be.state.data?.status==="sending"?5e3:!1},request:{portfolioSite:e}}),{data:x,error:v}=DC({site:e},{query:{queryKey:[...zl({site:e}),e],refetchOnMount:"always",staleTime:3e4},request:{portfolioSite:e}}),{data:j}=PC({site:e},{query:{queryKey:[...pd({site:e}),e],refetchOnMount:"always"},request:{portfolioSite:e}}),w=rr[e],C=y.useRef(e);C.current=e;const S=y.useRef(new WeakMap),N=y.useCallback(be=>{let je=S.current.get(be);return je||(je=crypto.randomUUID(),S.current.set(be,je)),je},[]),[E,R]=y.useState(""),[D,A]=y.useState(""),[_,F]=y.useState(""),[O,I]=y.useState([]),[V,H]=y.useState(!1),[k,q]=y.useState(!1),[J,re]=y.useState(!1),[U,L]=y.useState(!1),[z,W]=y.useState(!1),M=y.useRef(O);M.current=O;const[K,ie]=y.useState(null),[ee,ae]=y.useState(0),[oe,le]=y.useState(!1),Ne=y.useRef(null),ce=`${e}:${o?"new":c}`,xe=y.useRef({name:"",subject:"",preheader:"",blocks:[]}),ut=y.useRef(ce),nt=y.useRef(ce);nt.current=ce;const tn=JSON.stringify({contextKey:ce,name:E,subject:D,preheader:_,blocks:O}),nn=y.useRef(0),Rt=y.useRef(null),jt=y.useRef({contextKey:ce,revision:0,name:E,subject:D,preheader:_,blocks:O});Rt.current!==tn&&(Rt.current=tn,nn.current+=1,jt.current={contextKey:ce,revision:nn.current,name:E,subject:D,preheader:_,blocks:O});const ui=y.useRef(Promise.resolve(null)),Ft=y.useRef(0),di=q8({request:{portfolioSite:e}}),Gt=J8({request:{portfolioSite:e}}),Ji=r_({request:{portfolioSite:e}}),Vn=c_({request:{portfolioSite:e}}),_s=f8({request:{portfolioSite:e}}),Nn=mr(),{toast:Le}=Sn(),Ls=y.useCallback(async be=>{let je;try{je=await p()}catch{return!1}const me=je.isError?void 0:je.data;if(!me||nt.current!==be)return!1;const De=me.preheader||"";return R(me.name),A(me.subject),F(De),I(me.blocks),M.current=me.blocks,xe.current={name:me.name,subject:me.subject,preheader:De,blocks:me.blocks},ut.current=be,nn.current+=1,Rt.current=JSON.stringify({contextKey:be,name:me.name,subject:me.subject,preheader:De,blocks:me.blocks}),jt.current={contextKey:be,revision:nn.current,name:me.name,subject:me.subject,preheader:De,blocks:me.blocks},ie(null),re(!1),!0},[p]),Us=async()=>{if(!K||oe||C.current!==K.site)return;const be=K;le(!0);try{const je=await _s.mutateAsync({data:{url:be.uploadedUrl,confirm:"PUBLISH IMAGE"},params:{site:be.site}});let me;try{me=new URL(je.url)}catch{throw new Error("The approval API did not return an absolute public image URL.")}if(me.protocol!=="https:"||!me.hostname||me.username||me.password)throw new Error("The approval API did not return a canonical HTTPS image URL.");if(C.current!==be.site){ie(null),Le({title:"Image published but not added to the draft",description:"The selected site changed during approval. The original draft block was left unchanged.",variant:"destructive"});return}const De=M.current,qe=De.findIndex(ke=>S.current.get(ke)===be.blockId),Ie=qe>=0?De[qe]:void 0;if(qe<0||Ie?.type!=="image"||Ie.url!==be.originalBlockUrl){ie(null),Le({title:"Image published but not added to the draft",description:"The original image block changed or was removed. Its current URL was left unchanged.",variant:"destructive"});return}const Ye={...Ie,url:me.href};S.current.set(Ye,be.blockId);const rt=[...De];rt[qe]=Ye,M.current=rt,I(rt),ie(null),Le({title:"Image approved and added to the draft",description:"Only this processed image is public; its original upload remains private."})}catch(je){if(Lu(je)){ie(null);const me=await Ls(ce);Le({title:"Campaign or image approval changed",description:me?"The server's current campaign was reloaded. No approval was retried.":"The server rejected approval and its current campaign could not be reloaded. Refresh before continuing; no approval was retried.",variant:"destructive"})}else Le({title:"Could not publish this image",description:je instanceof Error?je.message:"The selected processed image was not approved.",variant:"destructive"})}finally{le(!1)}},kt=y.useRef(null);y.useEffect(()=>{!o&&u&&Ne.current!==ce?(Ne.current=ce,R(u.name),A(u.subject),F(u.preheader||""),I(u.blocks),xe.current={name:u.name,subject:u.subject,preheader:u.preheader||"",blocks:u.blocks},ut.current=ce):o&&Ne.current!==ce&&(Ne.current=ce,R("New Campaign"),A(""),F(""),I([]),xe.current={name:"New Campaign",subject:"",preheader:"",blocks:[]},ut.current=ce)},[u,ce,c,o]),y.useEffect(()=>{re(!1)},[ce]);const Cn=y.useCallback(async(be=!1)=>
63{const je=jt.current,me=ce,De=c,qe=o,Ie=e;Ft.current+=1,H(!0);const Ye=nA(ui.current,async()=>{const rt=jt.current,ke=rt.contextKey===me?rt:je;if(!bl(ke,xe.current,ut.current)&&!be)return De;const wr={name:ke.name,subject:ke.subject,preheader:ke.preheader,blocks:ke.blocks.length?ke.blocks:[{type:"paragraph",text:"Your content here."}]};if(qe){const Is=await di.mutateAsync({data:wr,params:{site:Ie}});return nt.current===me&&(xe.current={name:ke.name,subject:ke.subject,preheader:ke.preheader,blocks:ke.blocks},ut.current=me),await Nn.invalidateQueries({queryKey:[...Ka({site:Ie}),Ie]}),nt.current===me&&(r(`/admin/newsletter/${Is.id}`),Le({title:"Draft saved"})),Is.id}return await Gt.mutateAsync({id:De,data:wr}),nt.current===me&&(xe.current={name:ke.name,subject:ke.subject,preheader:ke.preheader,blocks:ke.blocks},ut.current=me),Nn.setQueryData([...Hu(De),Ie],Is=>Is&&{...Is,...wr}),await Nn.invalidateQueries({queryKey:[...Ka({site:Ie}),Ie]}),be&&nt.current===me&&Le({title:"Draft saved"}),De}).catch(async rt=>{if(Lu(rt)&&nt.current===me){re(!1),L(!1),W(!1);const ke=await Ls(me);Le({title:"Campaign changed or is no longer editable",description:ke?"The server's current campaign was reloaded. Review its status; nothing was sent or retried.":"The server rejected this save. Could not reload its current state; refresh the page before continuing. Nothing was sent or retried.",variant:"destructive"})}else Le({title:"Save failed",description:rt instanceof Error?rt.message:"Unknown error",variant:"destructive"});return null}).finally(()=>{Ft.current=Math.max(0,Ft.current-1),H(Ft.current>0)});return ui.current=Ye,Ye},[ce,c,o,e,di,Gt,Nn,Le,r,Ls]);kt.current=Cn;const Vt=y.useCallback(async()=>{for(let be=0;be<5;be+=1){const je=jt.current,me=kt.current;if(!me||!await me(!1))return!1;const qe=jt.current;if(qe.revision===je.revision&&!bl(qe,xe.current,ut.current))return!0}return!1},[]);y.useEffect(()=>{if(o||u?.status!=="draft"||J||k||U||z||!bl(jt.current,xe.current,ut.current))return;const be=setTimeout(()=>{kt.current?.(!1)},2e3);return()=>clearTimeout(be)},[E,D,_,O,o,u?.status,J,k,U,z]);const[br,$e]=y.useState(""),ft=y.useRef(new Map),dt=async()=>{if(!br.trim()||k||z||U||J)return;if(K||ee>0||oe){Le({title:"Test not sent",description:"Approve or cancel the pending image publication before sending a test."});return}const be=ce;q(!0);let je="";try{if(!await Vt()){Le({title:"Test not sent",description:"The latest draft changes could not be saved. Resolve the save error before sending a test.",variant:"destructive"});return}if(nt.current!==be){Le({title:"Test not sent",description:"The selected site or campaign changed while saving. Review the current draft before approving a test.",variant:"destructive"});return}const De=jt.current;if(bl(De,xe.current,ut.current)){Le({title:"Test not sent",description:"The latest draft revision was not confirmed saved. Save and review the draft before trying again.",variant:"destructive"});return}const qe=br.trim().toLowerCase();if(!confirm(`Send a test email to ${qe} now? This sends only to this address, not to the audience.`))return;if(nt.current!==be){Le({title:"Test not sent",description:"The selected site or campaign changed. Approve a test again from the current draft.",variant:"destructive"});return}je=p$({site:e,campaignId:c,email:qe,subject:De.subject,preheader:De.preheader,blocks:De.blocks});let Ie;try{Ie=eS(je)}catch(rt){Le({title:"No test email was sent",description:rt instanceof Error?rt.message:"Could not safely persist an email retry key.",variant:"destructive"});return}const Ye=await Ji.mutateAsync({id:c,data:{email:qe,confirm:"SEND",requestId:Ie}});if(Ye.status==="accepted"||Ye.status==="delivered"){const rt=tS(je);Le({title:"Test email accepted by the provider",description:rt?void 0:"Acceptance was confirmed, but this browser could not clear the retry key. Do not resend until you verify delivery."})}else Le({title:"Test email was not confirmed as accepted",description:"The same retry key remains stored. Retry only with this recipient and saved content; do not start a new request.",variant:"destructive"})}catch(me){if(Lu(me)){re(!1);const De=await Ls(ce);Le({title:"Campaign changed before the test",description:De?"The server's current campaign was reloaded. No retry was attempted; review its status before another owner action.":"The server rejected the test and the current campaign could not be reloaded. Refresh before another owner action; no retry was attempted.",variant:"destructive"})}else Le({title:"Test-email outcome is unconfirmed",description:`${me instanceof Error?me.message:"The request failed without a confirmed result."} Its retry key remains stored. Retry only with the same recipient and saved content; do not generate a new key.`,variant:"destructive"})}finally{q(!1)}},pt=typeof x?.eligibleCount=="number"&&Number.isFinite(x.eligibleCount),Oe=async()=>
63{if(z||U)return;if(K||ee>0||oe){re(!1),Le({title:"Campaign not sent",description:"Approve or cancel the pending image publication before sending."});return}if(!pt){re(!1),Le({title:"Could not verify the audience",description:v instanceof Error?v.message:"The audience endpoint did not return a verified eligible count. Refresh before approving a send.",variant:"destructive"});return}if(!J){re(!0);return}const be=ce;L(!0);try{const je=await Vt();if(nt.current!==be){re(!1),Le({title:"Campaign not sent",description:"The selected site or campaign changed. Review and approve the current campaign again."});return}if(!je||bl(jt.current,xe.current,ut.current)){Le({title:"Campaign not sent",description:"The latest draft revision could not be confirmed saved. Review the save error, then approve a new send action.",variant:"destructive"});return}const me=u?.status==="sending"||u?.status==="failed"?"Resume the approved campaign":"Send this campaign",De=u?.status==="sending"||u?.status==="failed"?u.recipientCount:x?.eligibleCount??0,qe=`${me} to up to ${De} eligible ${w.newsletter} subscribers? The website-managed audience and saved campaign content will be frozen for delivery. This cannot be automatically undone.`;if(!confirm(qe))return;if(nt.current!==be){re(!1),Le({title:"Campaign not sent",description:"The selected site or campaign changed. Approve a send again from the current campaign."});return}W(!0);const Ie=c,Ye=`${e}:${Ie}`;let rt=ft.current.get(Ye);if(!rt){try{rt=eS(`newsletter-send:${Ye}`)}catch(wr){Le({title:"Campaign not sent",description:wr instanceof Error?wr.message:"Could not safely persist the campaign retry key.",variant:"destructive"});return}ft.current.set(Ye,rt)}const ke=await Vn.mutateAsync({id:Ie,data:{confirm:"SEND",requestId:rt}});ft.current.delete(Ye);const ta=tS(`newsletter-send:${Ye}`);await Nn.invalidateQueries({queryKey:[...Hu(Ie),e]}),await Nn.invalidateQueries({queryKey:[...Ka({site:e}),e]}),ke.status==="sent"?(Le({title:"Campaign processing completed",description:`${ke.progress?.acceptedCount??ke.sentCount} messages accepted; ${ke.progress?.deliveredCount??0} delivery confirmations recorded.${ta?"":" The browser could not clear the retry key; review status before another action."}`}),r("/admin/newsletter")):ke.status==="sending"?Le({title:"Sending paused",description:`${ke.progress?.acceptedCount??ke.sentCount} accepted; ${ke.progress?.deliveredCount??0} delivered, ${ke.progress?.queuedCount??0} queued and ${ke.progress?.manualReviewCount??0} need review. Resume is a separate manual action.${ta?"":" Retry key cleanup failed."}`}):Le({title:"Campaign needs attention",description:`${ke.progress?.acceptedCount??ke.sentCount} accepted; ${ke.progress?.deliveredCount??0} delivered; ${ke.progress?.failedCount??ke.failedCount} failed.${ta?"":" Retry key cleanup failed."}`,variant:"destructive"})}catch(je){if(Lu(je)){re(!1);const me=await Ls(ce);await Nn.invalidateQueries({queryKey:[...Ka({site:e}),e]}),Le({title:"Campaign changed or was frozen by the server",description:me?"The server's current status was reloaded. No send or resume was retried; review the campaign before another explicit approval.":"The server rejected the action and its current status could not be reloaded. Refresh before another approval; no send or resume was retried.",variant:"destructive"})}else Le({title:"Campaign-send outcome is unconfirmed",description:`${je instanceof Error?je.message:"Unknown error"} The request ID remains stored. Review campaign status before manually retrying; no automatic resend occurred.`,variant:"destructive"})}finally{W(!1),L(!1),re(!1)}},[st,Mt]=y.useState("desktop");if(f&&!o)return a.jsx("div",{className:"p-8 flex justify-center",children:a.jsx(Ue,{className:"w-4 h-4 animate-spin text-white"})});if(h)return a.jsxs("div",{role:"alert",className:"p-8 text-red-300",children:["Could not load this campaign for the selected website: ",m instanceof Error?m.message:"Unknown error",a.jsx("div",{className:"mt-4",children:a.jsx(xt,{href:"/admin/newsletter",className:"underline",children:"Return to campaigns"})})]});const sn=u?.deliveryMode==="legacy_broadcast"||u?.deliveryMode==="legacy_unknown",Yt=!sn&&(o||!u||u.status==="draft"),rn=!Yt||V||k||J||U||z,En=!sn&&!!u&&["draft","sending","failed"].includes(u?.status??""),xn=u?.senderSnapshot?.brandName||j?.brandName||w.newsletter,fi=u?.senderSnapshot?.senderName||j?.senderName||w.label,yo=u?.senderSnapshot?.senderEmail||j?.senderEmail||"",ea=u?.
63senderSnapshot?.websiteUrl||j?.websiteUrl||"";return a.jsxs("div",{className:"flex flex-col h-screen text-white font-sans overflow-hidden",children:[K&&a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80 p-4",role:"presentation",children:a.jsxs("section",{role:"dialog","aria-modal":"true","aria-labelledby":"newsletter-image-approval-title","aria-describedby":"newsletter-image-approval-warning",className:"w-full max-w-lg border border-[#555] bg-[#080808] p-6 shadow-2xl",children:[a.jsx("h2",{id:"newsletter-image-approval-title",className:"text-lg mb-3",children:"Approve image for public access?"}),a.jsx("p",{id:"newsletter-image-approval-warning",className:"text-[14px] leading-relaxed text-[#ccc]",children:"This will make only the selected processed image publicly readable so it can appear in newsletter email. The original upload and other draft assets remain private. Nothing is published until you choose Approve."}),K.site!==e&&a.jsxs("p",{role:"alert",className:"text-[13px] text-amber-300 mt-4",children:["This upload belongs to ",rr[K.site].newsletter,". Switch back to that site before approving it."]}),a.jsxs("div",{className:"flex justify-end gap-3 mt-6",children:[a.jsx("button",{type:"button",onClick:()=>ie(null),disabled:oe,className:"border border-[#555] px-4 py-2 text-[14px] hover:border-white disabled:opacity-50",children:"Cancel"}),a.jsxs("button",{type:"button",onClick:()=>{Us()},disabled:oe||_s.isPending||K.site!==e,className:"bg-white text-black px-4 py-2 text-[14px] hover:bg-[#e5e5e5] disabled:opacity-50 flex items-center gap-2",children:[oe||_s.isPending?a.jsx(Ue,{className:"w-4 h-4 animate-spin"}):null,"Approve publishing selected image"]})]})]})}),a.jsxs("header",{className:"flex-none p-4 border-b border-[#333] flex items-center justify-between bg-black z-10",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx(xt,{href:"/admin/newsletter",className:"text-[#8a8a8a] hover:text-white transition-colors",children:a.jsx(TN,{className:"w-5 h-5"})}),a.jsx("input",{type:"text",value:E,onChange:be=>R(be.target.value),disabled:rn,className:"bg-transparent border-none text-[17px] focus:outline-none focus:ring-0 min-w-[200px]",placeholder:"Campaign Name"}),u?.status&&a.jsx("span",{className:`px-2 py-1 text-[12px] uppercase tracking-wider ${u.status==="sent"&&!sn?"bg-green-500/10 text-green-500":u.status==="failed"||u.status==="manual_review"||sn?"bg-red-500/10 text-red-500":"bg-yellow-500/10 text-yellow-500"}`,children:sn?"Historical · read only":u.status==="sending"?"In progress":u.status==="sent"?"Processing complete":u.status.replace("_"," ")})]}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("button",{onClick:()=>Cn(!0),disabled:rn,className:"flex items-center gap-2 text-[#8a8a8a] hover:text-white transition-colors text-[14px]",children:[V?a.jsx(Ue,{className:"w-4 h-4 animate-spin"}):a.jsx(co,{className:"w-4 h-4"}),"Save"]}),En&&a.jsxs("button",{onClick:Oe,disabled:z||U||k||V||Vn.isPending||!pt||Yt&&(!D.trim()||O.length===0),className:`flex items-center gap-2 px-4 py-2 text-[14px] transition-colors ${J?"bg-destructive text-destructive-foreground hover:bg-destructive/90":"bg-white text-black hover:bg-[#e5e5e5]"}`,children:[z||U?a.jsx(Ue,{className:"w-4 h-4 animate-spin"}):a.jsx(AD,{className:"w-4 h-4"}),J?u?.status==="draft"?"Confirm Website Send":"Confirm Resume":u?.status==="draft"?"Send to Website List…":"Resume Manually"]})]})]}),a.jsxs("div",{className:"flex-1 min-h-0 flex flex-col md:flex-row",children:[a.jsxs("div",{className:"w-full md:w-[400px] lg:w-[480px] border-r border-[#333] flex flex-col overflow-y-auto bg-[#050505] p-6 space-y-8",children:[u?.deliveryMode==="legacy_broadcast"||u?.deliveryMode==="legacy_unknown"?a.jsx("div",{className:"border border-amber-500/40 bg-amber-950/20 p-4 text-amber-200 text-[13px]",children:"This historical Broadcast is read-only. It cannot be converted, resumed or resent as a website-list campaign."}):a.jsxs("div",{className:"border border-[#333] bg-black p-4 space-y-2",children:[a.jsx("h3",{className:"text-[14px]",children:"Website-managed audience"}),x?a.jsxs("p",{className:"text-[13px] text-[#aaa]",children:[a.jsx("strong",{className:"text-white",children:u&&u.status!=="draft"?u.recipientCount:x.eligibleCount})," eligible recipients ",u&&u.status!=="draft"?"frozen for this campaign":"currently eligible for approval","."]}):a.jsx("p",{className:"text-[13px] text-red-300",children:v instanceof Error?v.message:"Audience count unavailable; campaign sending is disabled until it can be verified."}),a.jsx("p",{className:"text-[12px] text-[#777]",children:"Pending, unsubscribed and suppressed contacts are excluded. The audience is frozen only when you explicitly approve the first send."})]}),u?.progress&&a.jsxs("section",{"aria-label":"Campaign delivery progress",className:"border border-[#333] bg-black p-4",children:[a.jsx("h3",{className:"text-[14px] mb-3",children:"Delivery progress"}),a.jsxs("dl",{className:"grid grid-cols-2 gap-2 text-[12px]",children:[a.jsx("dt",{className:"text-[#888]",children:"Queued"}),a.jsx("dd",{children:u.progress.queuedCount}),a.jsx("dt",{className:"text-[#888]",children:"Currently sending"}),a.jsx("dd",{children:u.progress.sendingCount}),a.jsx("dt",{className:"text-[#888]",children:"Retryable"}),a.jsx("dd",{children:u.progress.retryableCount}),a.jsx("dt",{className:"text-[#888]",children:"Provider accepted"}),a.jsx("dd",{children:u.progress.acceptedCount}),a.jsx("dt",{className:"text-[#888]",children:"Confirmed delivered"}),a.jsx("dd",{children:u.progress.deliveredCount}),a.jsx("dt",{className:"text-[#888]",children:"Skipped"}),a.jsx("dd",{children:u.progress.skippedCount}),a.jsx("dt",{className:"text-[#888]",children:"Failed"}),a.jsx("dd",{children:u.progress.failedCount}),a.jsx("dt",{className:"text-[#888]",children:"Needs manual review"}),a.jsx("dd",{children:u.progress.manualReviewCount})]}),a.jsx("p",{className:"text-[11px] text-[#777] mt-3",children:"Provider acceptance is not a delivery confirmation. Refreshing this page never sends or resumes recipients."})]}),u&&u.status!=="draft"&&!sn&&!u.senderSnapshot&&a.jsx("div",{role:"alert",className:"border border-amber-500/40 bg-amber-950/20 p-4 text-amber-200 text-[12px]",children:"The API did not return this campaign's frozen sender identity. The preview below uses current site settings and may not match the sender used for this campaign."}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"text-[17px]",children:"Email Details"}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[13px] text-[#8a8a8a] uppercase tracking-wider",children:"Subject Line"}),a.jsx("input",{type:"text",value:D,onChange:be=>A(be.target.value),disabled:rn,placeholder:"What is this email about?",className:"w-full bg-black border border-[#333] p-2 text-[15px] focus:outline-none focus:border-white transition-colors"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[13px] text-[#8a8a8a] uppercase tracking-wider",children:"Preheader Text"}
63),a.jsx("input",{type:"text",value:_,onChange:be=>F(be.target.value),disabled:rn,placeholder:"Brief summary visible in inbox preview",className:"w-full bg-black border border-[#333] p-2 text-[15px] focus:outline-none focus:border-white transition-colors"})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"text-[17px] flex justify-between items-center",children:"Content Blocks"}),a.jsx("div",{className:"space-y-4",children:O.map((be,je)=>a.jsx(x$,{blockId:N(be),block:be,site:e,index:je,isFirst:je===0,isLast:je===O.length-1,isSent:rn,onChange:me=>{S.current.set(me,N(be));const De=[...O];De[je]=me,I(De)},onImageUploadReady:(me,De,qe)=>{ie({uploadedUrl:me,blockId:De,originalBlockUrl:qe,site:e})},imageApprovalPending:!!K||ee>0,onImageUploadStart:()=>ae(me=>me+1),onImageUploadFinish:()=>ae(me=>Math.max(0,me-1)),onMove:me=>{const De=[...O],qe=me==="up"?je-1:je+1;qe>=0&&qe<De.length&&([De[je],De[qe]]=[De[qe],De[je]],I(De))},onDelete:()=>{const me=[...O];me.splice(je,1),I(me)}},N(be)))}),Yt&&!rn&&a.jsxs("div",{className:"grid grid-cols-2 gap-2 pt-4 border-t border-[#333]",children:[a.jsxs("button",{onClick:()=>I([...O,{type:"heading",text:"New Heading",level:2}]),className:"p-2 border border-[#333] hover:border-white text-[13px] text-[#8a8a8a] hover:text-white transition-colors flex items-center justify-center gap-2",children:[a.jsx(Jt,{className:"w-3 h-3"})," Heading"]}),a.jsxs("button",{onClick:()=>I([...O,{type:"paragraph",text:"Paragraph text..."}]),className:"p-2 border border-[#333] hover:border-white text-[13px] text-[#8a8a8a] hover:text-white transition-colors flex items-center justify-center gap-2",children:[a.jsx(Jt,{className:"w-3 h-3"})," Paragraph"]}),a.jsxs("button",{onClick:()=>I([...O,{type:"image",url:"",alt:""}]),className:"p-2 border border-[#333] hover:border-white text-[13px] text-[#8a8a8a] hover:text-white transition-colors flex items-center justify-center gap-2",children:[a.jsx(Jt,{className:"w-3 h-3"})," Image"]}),a.jsxs("button",{onClick:()=>I([...O,{type:"cta",text:"Click Here",url:"https://"}]),className:"p-2 border border-[#333] hover:border-white text-[13px] text-[#8a8a8a] hover:text-white transition-colors flex items-center justify-center gap-2",children:[a.jsx(Jt,{className:"w-3 h-3"})," Button"]}),a.jsxs("button",{onClick:()=>I([...O,{type:"link",text:"Link text",url:"https://"}]),className:"p-2 border border-[#333] hover:border-white text-[13px] text-[#8a8a8a] hover:text-white transition-colors flex items-center justify-center gap-2",children:[a.jsx(Jt,{className:"w-3 h-3"})," Link"]})]})]}),Yt&&!o&&a.jsxs("div",{className:"space-y-4 pt-8 border-t border-[#333]",children:[a.jsx("h3",{className:"text-[17px]",children:"Send Test"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("input",{type:"email",value:br,onChange:be=>$e(be.target.value),disabled:rn,placeholder:"[email protected]",className:"w-full bg-black border border-[#333] p-2 text-[15px] focus:outline-none focus:border-white transition-colors"}),a.jsx("button",{onClick:dt,disabled:!br.trim()||rn||U||z,className:"bg-white text-black px-4 py-2 hover:bg-[#e5e5e5] transition-colors disabled:opacity-50 flex items-center gap-2",children:k?a.jsx(Ue,{className:"w-4 h-4 animate-spin"}):"Send"})]})]})]}),a.jsxs("div",{className:"flex-1 bg-black flex flex-col min-w-0",children:[a.jsxs("div",{className:"flex-none p-4 border-b border-[#333] flex justify-center gap-4",children:[a.jsx("button",{onClick:()=>Mt("desktop"),className:`p-2 transition-colors ${st==="desktop"?"text-white":"text-[#8a8a8a] hover:text-white"}`,children:a.jsx(vD,{className:"w-5 h-5"})}),a.jsx("button",{onClick:()=>Mt("mobile"),className:`p-2 transition-colors ${st==="mobile"?"text-white":"text-[#8a8a8a] hover:text-white"}`,children:a.jsx(LN,{className:"w-5 h-5"})})]}),a.jsx("div",{className:"flex-1 overflow-y-auto flex justify-center p-4 md:p-8 bg-[#0a0a0a]",children:a.jsx("div",{className:`newsletter-email-preview bg-[#f4f1e9] text-[#211f1a] font-sans shadow-2xl transition-all duration-300 ${st==="mobile"?"w-[375px]":"w-full max-w-[600px]"}`,children:a.jsxs("div",{className:st==="mobile"?"px-5 py-10":"px-10 py-[60px]",children:[a.jsxs("div",{className:"border-b border-[#d4d0c7] pb-6 text-left",children:[a.jsx("div",{className:"font-serif text-[28px] text-[#211f1a] tracking-tight leading-none",children:xn}),a.jsx("div",{className:"font-mono text-[10px] uppercase tracking-[0.13em] text-[#746f66] mt-2",children:fi}),yo&&a.jsx("div",{className:"text-[11px] text-[#746f66] mt-2",children:yo})]}),a.jsxs("div",{className:"space-y-0",children:[O.map((be,je)=>a.jsx(g$,{block:be,site:e},je)),O.length===0&&a.jsx("div",{className:"text-center text-[#746f66] py-12 border border-dashed border-[rgba(33,31,26,0.2)]",children:"Add content blocks to build your email"})]}),a.jsxs("div",{className:"border-t border-[#d4d0c7] pt-10 mt-10 text-left text-[#746f66] text-[12px] leading-relaxed",children:[a.jsx("div",{className:"font-serif text-[22px] text-[#211f1a] mb-3",children:xn}),a.jsxs("p",{className:"mb-2",children:["You are receiving this email because you subscribed to updates from ",xn,"."]}),ea&&a.jsx("p",{className:"mb-4",children:a.jsx("a",{href:ea,target:"_blank",rel:"noreferrer",className:"underline",children:ea})}),a.jsxs("p",{children:[a.jsx("span",{className:"underline decoration-dotted",title:"A unique website-managed link is added to each delivered email",children:"Unsubscribe"})," ",a.jsx("span",{className:"text-[10px]",children:"(personal unsubscribe link added on send)"})]})]})]})})})]})]})]})}function g$({block:e,site:t}){switch(e.type){case"heading":{const s=`h${e.level||2}`,r=e.level===1?"text-[40px] pt-10 pb-5":e.level===3?"text-[24px] pt-8 pb-4":"text-[31px] pt-8 pb-4";return a.jsx(s,{className:`font-serif leading-tight font-normal text-[#211f1a] tracking-tight ${r}`,children:e.text})}case"paragraph":return a.jsx("div",{className:"pb-6 text-[15px] leading-[1.6] text-[#4a463d] whitespace-pre-wrap font-sans",children:e.text});case"link":return a.jsx("div",{className:"pb-6 text-[15px] leading-[1.6] font-sans",children:a.jsx("a",{href:e.url,className:"text-[#211f1a] underline underline-offset-4",children:e.text})});case"image":return e.url?a.jsx("div",{className:"pt-4 pb-8",children:a.jsx("img",{src:zt(e.url,t),alt:e.alt,className:"w-full h-auto block bg-[#eae6dd]"})}):a.jsx("div",{className:"bg-[#eae6dd] w-full aspect-video flex items-center justify-center text-[#746f66] text-xs pt-4 pb-8 mb-8 border border-[rgba(33,31,26,0.1)]",children:"Image placeholder"});case"cta":return a.jsx("div",{className:"pt-6 pb-8 text-center",children:a.jsx("table",{cellPadding:"0",cellSpacing:"0",children:a.jsx("tbody",{children:a.jsx("tr",{children:a.jsx("td",{className:"bg-[#f4f1e9] border border-[#211f1a] px-7 py-3.5",children:a.jsx("a",{href:e.url,className:"inline-block text-[#211f1a] text-[10px] font-mono font-bold uppercase tracking-[0.13em] no-underline",children:e.text})})})})})});default:return null}}function x$({block:e,blockId:t,site:s,imageApprovalPending:r,onImageUploadReady:o,onImageUploadStart:c,onImageUploadFinish:u,index:f,isFirst:h,isLast:m,isSe
63nt:p,onChange:x,onMove:v,onDelete:j}){const{uploadFile:w,isUploading:C}=Rs({site:s,onSuccess:S=>{e.type==="image"&&o(S,t,e.url)},onError:S=>alert(S instanceof Error?S.message:"Upload failed")});return a.jsxs("div",{className:"border border-[#333] bg-black",children:[a.jsxs("div",{className:"flex items-center justify-between p-2 border-b border-[#333] bg-[#111]",children:[a.jsx("div",{className:"text-[11px] font-mono uppercase tracking-wider text-[#8a8a8a] pl-2",children:e.type}),!p&&a.jsxs("div",{className:"flex items-center",children:[a.jsx("button",{onClick:()=>v("up"),disabled:h,className:"p-2 text-[#8a8a8a] hover:text-white disabled:opacity-30",children:a.jsx(Pl,{className:"w-3 h-3"})}),a.jsx("button",{onClick:()=>v("down"),disabled:m,className:"p-2 text-[#8a8a8a] hover:text-white disabled:opacity-30",children:a.jsx(Dl,{className:"w-3 h-3"})}),a.jsx("button",{onClick:j,className:"p-2 text-destructive hover:text-destructive/80",children:a.jsx(ms,{className:"w-3 h-3"})})]})]}),a.jsxs("div",{className:"p-4 space-y-4",children:[e.type==="heading"&&a.jsxs(a.Fragment,{children:[a.jsx("input",{type:"text",value:e.text,onChange:S=>x({...e,text:S.target.value}),disabled:p,className:"w-full bg-transparent border-b border-[#333] p-2 text-[15px] focus:outline-none focus:border-white",placeholder:"Heading text"}),a.jsxs("select",{value:e.level||2,onChange:S=>x({...e,level:parseInt(S.target.value)}),disabled:p,className:"w-full bg-black border border-[#333] p-2 text-[13px] text-[#8a8a8a]",children:[a.jsx("option",{value:1,children:"Heading 1 (H1)"}),a.jsx("option",{value:2,children:"Heading 2 (H2)"}),a.jsx("option",{value:3,children:"Heading 3 (H3)"})]})]}),e.type==="paragraph"&&a.jsx("textarea",{value:e.text,onChange:S=>x({...e,text:S.target.value}),disabled:p,className:"w-full bg-transparent border border-[#333] p-2 text-[15px] focus:outline-none focus:border-white min-h-[100px]",placeholder:"Paragraph text..."}),e.type==="link"&&a.jsxs(a.Fragment,{children:[a.jsx("input",{type:"text",value:e.text,onChange:S=>x({...e,text:S.target.value}),disabled:p,className:"w-full bg-transparent border-b border-[#333] p-2 text-[15px] focus:outline-none focus:border-white",placeholder:"Link text"}),a.jsx("input",{type:"url",value:e.url,onChange:S=>x({...e,url:S.target.value}),disabled:p,className:"w-full bg-transparent border-b border-[#333] p-2 text-[15px] focus:outline-none focus:border-white",placeholder:"https://"})]}),e.type==="cta"&&a.jsxs(a.Fragment,{children:[a.jsx("input",{type:"text",value:e.text,onChange:S=>x({...e,text:S.target.value}),disabled:p,className:"w-full bg-transparent border-b border-[#333] p-2 text-[15px] focus:outline-none focus:border-white",placeholder:"Button text"}),a.jsx("input",{type:"url",value:e.url,onChange:S=>x({...e,url:S.target.value}),disabled:p,className:"w-full bg-transparent border-b border-[#333] p-2 text-[15px] focus:outline-none focus:border-white",placeholder:"https://"})]}),e.type==="image"&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"flex gap-2",children:a.jsx("input",{type:"url",value:e.url,onChange:S=>x({...e,url:S.target.value}),disabled:p,className:"flex-1 bg-transparent border-b border-[#333] p-2 text-[15px] focus:outline-none focus:border-white",placeholder:"Image URL (or select below)"})}),!p&&a.jsxs("div",{children:[a.jsx("input",{type:"file",accept:"image/*",id:`upload-block-${f}`,className:"hidden",disabled:C||r,onChange:S=>{const N=S.target.files?.[0];if(N){const E=S.currentTarget;c(),w(N,"share").catch(()=>{}).finally(()=>{u(),E.value=""})}}}),a.jsx("label",{htmlFor:`upload-block-${f}`,className:`inline-block bg-[#111] border border-[#333] hover:border-white text-[13px] px-4 py-2 transition-colors ${r?"opacity-50 pointer-events-none":"cursor-pointer"}`,"aria-disabled":r,children:C?"Processing image…":r?"Finish image approval first":"Upload Image"})]}),a.jsx("input",{type:"text",value:e.alt,onChange:S=>x({...e,alt:S.target.value}),disabled:p,className:"w-full bg-transparent border-b border-[#333] p-2 text-[15px] focus:outline-none focus:border-white",placeholder:"Alt text (for screen readers)"})]})]})]})}var y$=Object.defineProperty,yr=(e,t)=>
63y$(e,"name",{value:t,configurable:!0}),v$="AlertDialog",[b$,Hq]=ss(v$,[e2]),vr=e2(),w$=yr(e=>{const{__scopeAlertDialog:t,...s}=e,r=vr(t);return a.jsx(t2,{...r,...s,modal:!0})},"AlertDialog");y.forwardRef(yr(function(t,s){const{__scopeAlertDialog:r,...o}=t,c=vr(r);return a.jsx(n2,{...c,...o,ref:s})},"AlertDialogTrigger"));var j$=yr(e=>{const{__scopeAlertDialog:t,...s}=e,r=vr(t);return a.jsx(i2,{...r,...s})},"AlertDialogPortal"),S$=y.forwardRef(yr(function(t,s){const{__scopeAlertDialog:r,...o}=t,c=vr(r);return a.jsx(Fx,{...c,...o,ref:s})},"AlertDialogOverlay")),N$="AlertDialogContent",[C$,E$]=b$(N$),T$=y.forwardRef(yr(function(t,s){const{__scopeAlertDialog:r,children:o,...c}=t,u=vr(r),f=y.useRef(null),h=Ge(s,f),m=y.useRef(null);return a.jsx(C$,{scope:r,cancelRef:m,children:a.jsx(Vx,{role:"alertdialog",...u,...c,ref:h,onOpenAutoFocus:ge(c.onOpenAutoFocus,p=>{p.preventDefault(),m.current?.focus({preventScroll:!0})}),onPointerDownOutside:p=>p.preventDefault(),onInteractOutside:p=>p.preventDefault(),children:o})})},"AlertDialogContent")),A$=y.forwardRef(yr(function(t,s){const{__scopeAlertDialog:r,...o}=t,c=vr(r);return a.jsx(Bx,{...c,...o,ref:s})},"AlertDialogTitle")),R$=y.forwardRef(yr(function(t,s){const{__scopeAlertDialog:r,...o}=t,c=vr(r);return a.jsx($x,{...c,...o,ref:s})},"AlertDialogDescription")),k$=y.forwardRef(yr(function(t,s){const{__scopeAlertDialog:r,...o}=t,c=vr(r);return a.jsx(qx,{...c,...o,ref:s})},"AlertDialogAction")),M$="AlertDialogCancel",O$=y.forwardRef(yr(function(t,s){const{__scopeAlertDialog:r,...o}=t,{cancelRef:c}=E$(M$,r),u=vr(r),f=Ge(s,c);return a.jsx(qx,{...u,...o,ref:f})},"AlertDialogCancel")),D$=w$,P$=j$,sA=S$,rA=T$,iA=k$,aA=O$,oA=A$,lA=R$;const ay=Ig("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover-elevate active-elevate-2",{variants:{variant:{default:"bg-primary text-primary-foreground border border-primary-border",destructive:"bg-destructive text-destructive-foreground shadow-sm border-destructive-border",outline:" border [border-color:var(--button-outline)] shadow-xs active:shadow-none ",secondary:"border bg-secondary text-secondary-foreground border border-secondary-border ",ghost:"border border-transparent",link:"text-primary underline-offset-4 hover:underline"},size:{default:"min-h-9 px-4 py-2",sm:"min-h-8 rounded-md px-3 text-xs",lg:"min-h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),_$=y.forwardRef(({className:e,variant:t,size:s,asChild:r=!1,...o},c)=>{const u=r?B3:"button";return a.jsx(u,{className:Ee(ay({variant:t,size:s,className:e})),ref:c,...o})});_$.displayName="Button";const L$=D$,U$=P$,cA=y.forwardRef(({className:e,...t},s)=>a.jsx(sA,{className:Ee("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:s}));cA.displayName=sA.displayName;const uA=y.forwardRef(({className:e,...t},s)=>a.jsxs(U$,{children:[a.jsx(cA,{}),a.jsx(rA,{ref:s,className:Ee("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));uA.displayName=rA.displayName;const dA=({className:e,...t})=>a.jsx("div",{className:Ee("flex flex-col space-y-2 text-center sm:text-left",e),...t});dA.displayName="AlertDialogHeader";const fA=({className:e,...t})=>a.jsx("div",{className:Ee("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});fA.displayName="AlertDialogFooter";const hA=y.forwardRef(({className:e,...t},s)=>a.jsx(oA,{ref:s,className:Ee("text-lg font-semibold",e),...t}));hA.displayName=oA.displayName;const mA=y.forwardRef(({className:e,...t},s)=>a.jsx(lA,{ref:s,className:Ee("text-sm text-muted-foreground",e),...t}));mA.displayName=lA.displayName;const pA=y.forwardRef(({className:e,...t},s)=>a.jsx(iA,{ref:s,className:Ee(ay(),e),...t}));pA.displayName=iA.displayName;const gA=y.forwardRef(({className:e,...t},s)=>a.jsx(aA,{ref:s,className:Ee(ay({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));gA.displayName=aA.displayName;function ns(e){return e?.trim()||void 0}function Ki(e,t){return`${e}:${t}`}function ad(...e){for(const t of e){const s=ns(t);if(s)return s}}function oy(e){return!!(e&&e.published&&!e.deletedAt&&e.showOnAlreadyAlive!==!1)}function ly(e){const t=e.alreadyAlive;return t?t.projects.flatMap(r=>{const o=e.work.find(v=>v.id===r.id),c=t.projectPresentation?.[r.id];if(!r.published||r.showOnAlreadyAlive===!1||c?.visible===!1||o&&!oy(o))return[];const u=o?to(e,o,"work"):{source:"still",still:ad(r.heroStill,r.still)},f=ad(c?.still,u.still),h=u.source==="upload"?u.clip:void 0,m=o?h:ad(r.heroClip),p=m?{source:"upload",clip:m,still:f}:{...u,still:f||u.still},x=r.id;return[{key:Ki("project",x),source:"project",projectId:x,sourceIdentity:Ki("project",x),title:r.title,client:r.client,href:`/work/${encodeURIComponent(r.slug)}`,thumbnail:f,clip:m,still:f,media:p,available:!0,order:c?.order??r.order}]}).sort((r,o)=>r.order-o.order).map(({order:r,...o})=>o):[]}function I$(e){const t=e.alreadyAlive;return t?t.films.flatMap(r=>{const o=e.films.find(m=>m.id===r.canonicalFilmId);if(r.published===!1||!oy(o))return[];const c=to(e,o,"films"),u=c.still,f=c.source==="upload"?ns(c.clip):void 0,h=r.canonicalFilmId;return[{key:Ki("film",h),source:"film",projectId:h,sourceIdentity:Ki("film",h),title:ns(r.title)||o.title,client:o.client||o.brandLabel||"",href:`/films/${encodeURIComponent(ns(r.slug)||o.slug)}`,thumbnail:u,clip:f,still:u,media:{...c,still:u||c.still},available:!0,order:r.order??o.order}]}).sort((r,o)=>r.order-o.order).map(({order:r,...o})=>o):[]}function vg(e){return e.alreadyAlive?.homepage?.hero||[]}function z$(e){const t=e.alreadyAlive;return t?t.films.flatMap(r=>{const o=e.films.find(c=>c.id===r.canonicalFilmId);return r.published===!1||!oy(o)?[]:[{canonicalFilmId:r.canonicalFilmId,title:ns(r.title)||o.title,slug:ns(r.slug)||o.slug,status:ns(r.status)||o.status||"",order:r.order??o.order}]}).sort((r,o)=>r.order-o.order):[]}function xA(e){const t=e.alreadyAlive,s=[...ly(e),...I$(e)],r=new Set(s.map(c=>c.sourceIdentity)),o=[];for(const c of vg(e)){const u=c.source||"project",f=Ki(u,c.projectId);if(r.has(f)||o.some(w=>w.sourceIdentity===f))continue;const h=u==="project"?t?.projects.find(w=>w.id===c.projectId):void 0,m=u==="project"?e.work.find(w=>w.id===c.projectId):void 0,p=u==="film"?t?.films.find(w=>w.canonicalFilmId===c.projectId):void 0,x=u==="film"?e.films.find(w=>w.id===c.projectId):void 0,v=u==="film"?ns(p?.slug)||x?.slug:h?.slug||m?.slug,j=ns(c.still);o.push({key:f,source:u,projectId:c.projectId,sourceIdentity:f,title:u==="film"?ns(p?.title)||x?.title||`Unavailable film (${c.projectId})`:h?.title||m?.title||`Unavailable project (${c.projectId})`,client:h?.client||m?.client||m?.brandLabel||"",href:v?`/${u==="film"?"films":"work"}/${encodeURIComponent(v)}`:"#",clip:c.clip,still:c.still,thumbnail:j,media:c.clip?{source:"upload",clip:c.clip,still:j}:{source:"still",still:j},duration:c.duration,available:!1})}return[...s,...o]}function F$(e){const t=xA(e).filter(r=>r.available),s=new Map(t.map(r=>[r.sourceIdentity,r]));if(!vg(e).length){const r={...e,films:e.films.filter(o=>o.showOnMichael!==!1),work:e.work.filter(o=>o.showOnMichael!==!1)};return qC(r).cycle.flatMap(o=>
63{const c=e.films.some(h=>h.id===o.itemId)?"film":"project",u=s.get(Ki(c,o.itemId));if(!u)return[];const f=ad(c==="project"?e.alreadyAlive?.projectPresentation?.[o.itemId]?.still:void 0,o.still);return[{...u,media:{...o,still:f},clip:o.source==="upload"?o.clip:void 0,still:f,thumbnail:f,duration:o.duration}]})}return vg(e).flatMap((r,o)=>{const c=r.source||"project",u=s.get(Ki(c,r.projectId));if(!u)return[];const f=r.clip===void 0?u.clip:ns(r.clip),h=r.still===void 0?u.still:ns(r.still);return[{...u,key:`${u.sourceIdentity}:${o}`,clip:f,still:h,thumbnail:h,media:r.clip!==void 0?f?{source:"upload",clip:f,still:h}:{source:"still",still:h}:{...u.media,still:h},duration:Number.isFinite(r.duration)&&r.duration>0?r.duration:5}]})}function V$(e){const t=new Map(e.alreadyAlive?.projects.map(s=>[s.id,s]));return ly(e).map(s=>{const r=t.get(s.projectId);return{...s,id:r.id,slug:r.slug,type:r.type,year:r.year}})}function B$(e){const t=new Map(ly(e).map(s=>[s.projectId,s]));return(e.alreadyAlive?.homepage?.selectedProjectIds||[]).slice(0,6).flatMap(s=>{const r=t.get(s);return r?[r]:[]})}const nS=["title","slug","status","logline","poster","stills","trailerUrl","showTrailer","credits","order"];function cy(e,t){switch(t){case"trailerUrl":return e.watchFilmUrl||e.vimeoUrl||"";case"poster":return e.poster||"";case"stills":return e.still?[e.still]:[];case"credits":return e.keyCredits??e.fullCredits??[];case"showTrailer":return e.showTrailer??!1;default:return e[t]}}const yA=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function $$(e,t){const s={canonicalFilmId:e.canonicalFilmId,presentationVersion:1};if(e.published===!1&&(s.published=!1),!t){for(const r of nS)e[r]!==void 0&&(s[r]=e[r]);return s}for(const r of nS){const o=e[r];o!==void 0&&(yA(o,cy(t,r))||(s[r]=o))}return s}function q$(e,t,s,r){const o={...e};return s===void 0||r&&yA(s,cy(r,t))?delete o[t]:o[t]=s,o}function vA(e){return e?e.deletedAt?{available:!1,reason:"The source film was deleted on the main site."}:e.published===!1?{available:!1,reason:"The source film is unpublished on the main site."}:e.showOnAlreadyAlive===!1?{available:!1,reason:"The source film is not offered to Already Alive. Enable its placement in the canonical editor first."}:{available:!0}:{available:!1,reason:"The source film no longer exists or is not published on the main site."}}function H$(e){const t={};for(const[s,r]of Object.entries(e??{})){const o={};r.visible!==void 0&&(o.visible=r.visible),typeof r.order=="number"&&Number.isFinite(r.order)&&(o.order=r.order),r.still&&(o.still=r.still),Object.keys(o).length&&(t[s]=o)}return t}function up(e){const t=e.alreadyAlive,s=new Map(e.films.map(r=>[r.id,r]));return{...t,films:t.films.map(r=>$$(r,s.get(r.canonicalFilmId)))}}function K$(e,t){const s=new Set(e.work.map(r=>r.id));return{...e,alreadyAlive:{...t,films:t.films.map(r=>({...r,presentationVersion:1})),projects:t.projects.filter(r=>!s.has(r.id)&&!r.canonicalWorkId),projectPresentation:H$(t.projectPresentation)}}}const Jr=e=>`${e.source??"project"}:${e.projectId}`;function sS(e,t,s){const r=t.work.find(o=>o.id===(e?.id??""));return e?e.published?e.showOnAlreadyAlive===!1?"Project is hidden on Already Alive.":s.projectPresentation?.[e.id]?.visible===!1?"Project is hidden on this site in Work.":r&&(r.published===!1||r.deletedAt||r.showOnAlreadyAlive===!1)?"The shared source work is unpublished or not offered to Already Alive.":"Project is not available.":"Project is not published.":"This project no longer exists. It is kept so you can fix or remove it."}function rS(e,t){const s=vA(t);return s.available?e?.published===!1?"Film is hidden on Already Alive.":t?.showOnAlreadyAlive===!1?"The source film is not offered to Already Alive.":"Film is not available.":s.reason}function G$(e,t){const s={...e,alreadyAlive:t},r=new Map(e.films.map(c=>[c.id,c])),o=new Map;for(const c of xA(s)){const u=c.source==="project"?t.projects.find(p=>p.id===c.projectId):void 0,f=c.source==="film"?t.films.find(p=>p.canonicalFilmId===c.projectId):void 0,h=c.source==="project"?!!(u||e.work.some(p=>p.id===c.projectId)):!!(f||r.get(c.projectId)),m=c.available?c.title:h?c.title.replace(/ \(.*\)$/,""):`Unavailable ${c.source}`;o.set(c.key,{key:c.key,source:c.source,id:c.projectId,label:m,sub:c.source==="film"?"Film":c.client,thumb:c.thumbnail??"",clip:c.clip??"",still:c.still??"",eligible:c.available,reason:c.available?void 0:c.source==="project"?sS(u,e,t):rS(f,r.get(c.projectId))})}for(const c of t.projects){const u=`project:${c.id}`;o.has(u)||o.set(u,{key:u,source:"project",id:c.id,label:c.title||"Untitled project",sub:c.client,thumb:c.still,clip:c.heroClip??"",still:c.still,eligible:!1,reason:sS(c,e,t)})}for(const c of t.films){const u=`film:${c.canonicalFilmId}`;if(o.has(u))continue;const f=r.get(c.canonicalFilmId);o.set(u,{key:u,source:"film",id:c.canonicalFilmId,label:c.title??f?.title??"Unavailable film",sub:"Film",thumb:c.poster||f?.still||f?.poster||"",clip:"",still:f?.still??"",eligible:!1,reason:rS(c,f)}
63)}return o}function Iu(e,t,s){if(s<0||s>=e.length)return e;const r=[...e],[o]=r.splice(t,1);return r.splice(s,0,o),r}const Y$=e=>Math.min(12,Math.max(1,Number.isFinite(e)?Math.round(e):6)),bA=()=>({role:"",name:""});function iS(e,t,s,r){const o=s==="michael"?"showOnMichael":"showOnAlreadyAlive";return{...e,projects:e.projects.map(c=>c.id===t&&!c.canonicalWorkId?{...c,[o]:r}:c)}}function aS(e,t,s,r=[]){const o=Jr(t);if(!e.homepage.hero.some(u=>Jr(u)===o))return e;const c=e.homepage.hero.map(u=>{if(Jr(u)!==o)return u;const f={...u,...s};for(const h of r)delete f[h];return f});return{...e,homepage:{...e.homepage,hero:c}}}function wA(e,t){const s=Jr(t);return e.homepage.hero.some(r=>Jr(r)===s)?e:{...e,homepage:{...e.homepage,hero:[...e.homepage.hero,{...t,source:t.source??"project"}]}}}const Pd=new WeakMap;let Q$=0;const jA=()=>`gallery-${++Q$}`;function uy(e){let t=Pd.get(e);return t||(t=e.map(jA),Pd.set(e,t)),e.map((s,r)=>({id:t[r],url:s}))}function oS(e,t){for(const s of t.projects){const r=e?.projects.find(o=>o.id===s.id);r&&Array.isArray(r.stills)&&Array.isArray(s.stills)&&r.stills.length===s.stills.length&&r.stills.every((o,c)=>o===s.stills[c])&&Pd.set(s.stills,uy(r.stills).map(o=>o.id))}return t}function wl(e,t,s,r,o=""){const c=e.projects.find(m=>m.id===t&&!m.canonicalWorkId);if(!c)return e;const u=uy(c.stills),f=u.findIndex(m=>m.id===s);if(r!=="add"&&f<0)return e;if(r==="add")u.push({id:jA(),url:o});else if(r==="set")u[f]={...u[f],url:o};else if(r==="remove")u.splice(f,1);else{const m=f+(r==="up"?-1:1);if(m<0||m>=u.length)return e;const[p]=u.splice(f,1);u.splice(m,0,p)}const h=u.map(m=>m.url);return Pd.set(h,u.map(m=>m.id)),{...e,projects:e.projects.map(m=>m.id===t?{...m,stills:h}:m)}}const W$=1500;class X${snap={base:null,draft:null,status:"idle",error:null,uploading:0,uploadError:null,dirty:!1};listeners=new Set;gen=0;timer=null;chain=Promise.resolve();uploads=new Set;onSaved;site;saveFn;autosaveMs;constructor(t,s,r=h2,o=W$){this.site=t,this.saveFn=s,this.autosaveMs=o,r(()=>this.flush())}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.snap;set(t){this.snap={...this.snap,...t},this.listeners.forEach(s=>s())}adopt(t){if(!t.alreadyAlive||t.site!==this.site)return;const s=this.snap,r=s.dirty||s.status==="saving"||this.uploads.size>0;s.draft&&s.base&&(r||(t.revision??0)<=(s.base.revision??0))||(this.gen++,this.set({base:t,draft:oS(s.draft,up(t)),dirty:!1,status:"saved",error:null}))}reset(t){this.timer&&clearTimeout(this.timer),this.gen++,this.set({base:t,draft:up(t),dirty:!1,status:"saved",error:null})}update(t){const s=this.snap.draft;s&&(this.gen++,this.set({draft:t(s),dirty:!0,status:this.snap.status==="conflict"?"conflict":this.snap.status==="saving"?"saving":"dirty"}),this.schedule())}schedule(){this.timer&&clearTimeout(this.timer),this.snap.status!=="conflict"&&(this.timer=setTimeout(()=>{this.timer=null,this.saveNow().catch(()=>{})},this.autosaveMs))}track(t){this.uploads.add(t),this.set({uploading:this.uploads.size});const s=()=>{this.uploads.delete(t),this.set({uploading:this.uploads.size})},r=o=>{this.uploads.delete(t),this.set({uploading:this.uploads.size,uploadError:`An upload failed: ${o instanceof Error?o.message:"try again"}. Upload it again before publishing.`})};return t.then(s,r),t}clearUploadError(){return this.uploads.size>0?!1:(this.set({uploadError:null}),!0)}saveNow(){this.timer&&(clearTimeout(this.timer),this.timer=null);const t=nA(this.chain,()=>this.doSave());return this.chain=t,t}async doSave(){const{base:t,draft:s,dirty:r}=this.snap;if(!r||!t||!s)return;const o=this.gen;this.set({status:"saving",error:null});try{const c=K$({...t,site:this.site},s),u=await this.saveFn(c,this.site),f=this.gen===o;this.set({base:u,...f&&u.alreadyAlive&&this.uploads.size===0?{draft:oS(this.snap.draft,up(u))}:{},dirty:!f,status:f?"saved":"dirty"}),this.onSaved?.(u),f||this.schedule()}catch(c){const u=c?.status,f=c instanceof Error?c.message:"Draft was not saved.";throw u===409?this.set({status:"conflict",error:"Someone saved a newer version. Reload it to continue; your unsaved edits here would be lost."}):this.set({status:"error",error:f}),c}}async flush(){for(let t=0;t<20;t++){for(;this.uploads.size;)await Promise.allSettled([...this.uploads]);if(this.snap.uploadError)throw new Error(this.snap.uploadError);if(await this.chain.catch(()=>{}),!this.snap.dirty)return;if(this.snap.status==="conflict")throw new Error(this.snap.error??"Draft conflict");await this.saveNow()}throw new Error("Already Alive draft kept changing while saving.")}}const lS=new Map;function SA(e){let t=lS.get(e);return t||(t=new X$(e,(s,r)=>nx(s,{site:r})),lS.set(e,t)),t}function Z$(e){const t=SA(e),s=y.useSyncExternalStore(t.subscribe,t.getSnapshot),r=s.dirty||s.status==="saving"||s.uploading>0;return y.useEffect(()=>{if(!r)return;const o=c=>{c.preventDefault(),c.returnValue=""};return window.addEventListener("beforeunload",o),()=>window.removeEventListener("beforeunload",o)},[r]),{store:t,...s}}const dy="/assets/aa-wordmark-DybT0rQB.png",_d={lead:"Every story is",subtitle:"A full service production-studio."},Gr={lead:80,logo:480,subtitle:880,reveal:1e3,fade:350,exit:2950,complete:3300,handoff:700};function J$(e,t,s){const r=e.setTimeout(t,Gr.exit),o=e.setTimeout(s,Gr.complete);return()=>{e.clearTimeout(r),e.clearTimeout(o)}}const Ke="w-full bg-[#fffdf9] border border-[#d7d0c7] p-2.5 text-[#171513] outline-none focus:border-[#8b5e3c] disabled:opacity-60",Qr=`${Ke} min-h-[90px]`,ir="bg-white p-5 space-y-4",io="text-sm underline disabled:opacity-40 disabled:no-underline",ds="p-1 disabled:opacity-30";function Ve({label:e,hint:t,children:s}){return a.jsxs("label",{className:"block space-y-1.5",children:[a.jsx("span",{className:"text-xs uppercase tracking-wide text-[#756e66]",children:e}),s,t?a.jsx("span",{className:"block text-xs text-[#756e66]",children:t}):null]})}
63function fy({value:e,onChange:t,placeholder:s}){return a.jsxs("div",{className:"space-y-2",children:[e.map((r,o)=>a.jsxs("div",{className:"flex gap-2",children:[a.jsx("input",{className:Ke,value:r,placeholder:s,onChange:c=>t(e.map((u,f)=>f===o?c.target.value:u))}),a.jsx("button",{type:"button","aria-label":"Remove line",className:ds,onClick:()=>t(e.filter((c,u)=>u!==o)),children:a.jsx(ms,{className:"w-4 h-4 text-red-700"})})]},o)),a.jsxs("button",{type:"button",className:io,onClick:()=>t([...e,""]),children:[a.jsx(Jt,{className:"inline w-3 h-3"})," Add line"]})]})}function NA({value:e,onChange:t}){return a.jsxs("div",{className:"space-y-2",children:[e.map((s,r)=>a.jsxs("div",{className:"grid grid-cols-[1fr_1fr_auto] gap-2",children:[a.jsx("input",{className:Ke,placeholder:"Role",value:s.role,onChange:o=>t(e.map((c,u)=>u===r?{...c,role:o.target.value}:c))}),a.jsx("input",{className:Ke,placeholder:"Name",value:s.name,onChange:o=>t(e.map((c,u)=>u===r?{...c,name:o.target.value}:c))}),a.jsx("button",{type:"button","aria-label":"Remove credit",className:ds,onClick:()=>t(e.filter((o,c)=>c!==r)),children:a.jsx(ms,{className:"w-4 h-4 text-red-700"})})]},r)),a.jsxs("button",{type:"button",className:io,onClick:()=>t([...e,bA()]),children:[a.jsx(Jt,{className:"inline w-3 h-3"})," Add credit"]})]})}function ar({site:e,value:t,onChange:s,kind:r="still",label:o,disabled:c,placeholder:u}){const{toast:f}=Sn(),{uploadFile:h,isUploading:m}=Rs({site:e}),p=SA(e),x=r==="clip",v=y.useRef(!1),j=async w=>{if(w)try{const C=await p.track(h(w,r));s(C),v.current&&(v.current=!1,p.clearUploadError())}catch(C){v.current=!0,f({title:"Upload failed",description:C instanceof Error?C.message:String(C),variant:"destructive"})}};return a.jsxs("div",{className:"space-y-2",children:[a.jsx("span",{className:"text-xs uppercase tracking-wide text-[#756e66]",children:o}),t?x?a.jsx("video",{src:zt(t,e),className:"w-full max-w-[260px] aspect-video bg-black object-cover",muted:!0,controls:!0}):a.jsx("img",{src:zt(t,e),alt:"",className:"w-full max-w-[260px] aspect-video object-cover bg-[#eee]"}):null,a.jsx("input",{className:Ke,value:t,disabled:c,placeholder:u??(x?"MP4 URL":"Image URL"),onChange:w=>s(w.target.value)}),a.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[a.jsxs("label",{className:`underline cursor-pointer ${c||m?"opacity-40 pointer-events-none":""}`,children:[m?a.jsxs("span",{className:"inline-flex items-center gap-1",children:[a.jsx(Ue,{className:"w-3 h-3 animate-spin"})," Uploading"]}):t?"Replace file":"Upload file",a.jsx("input",{type:"file",className:"hidden",accept:x?"video/mp4":"image/*",disabled:c||m,onChange:w=>{const C=w.target.files?.[0];w.target.value="",j(C)}})]}),t?a.jsx("button",{type:"button",className:"underline",disabled:c,onClick:()=>s(""),children:"Clear"}):null]})]})}const cS={source:"project",label:"Unavailable item",sub:"",thumb:"",clip:"",still:"",eligible:!1,reason:"This item no longer exists in the content. It is kept so you can fix or remove it."};function uS({site:e,src:t}){return t?a.jsx("img",{src:zt(t,e),alt:"",className:"w-24 h-14 object-cover bg-[#eee] shrink-0"}):a.jsx("div",{className:"w-24 h-14 bg-[#eee] shrink-0 text-[10px] text-[#756e66] flex items-center justify-center",children:"No thumbnail"})}function eq({site:e,draft:t,base:s,update:r}){const[o,c]=y.useState(""),[u,f]=y.useState(""),h=y.useMemo(()=>G$(s,t),[s,t]),m=t.homepage,p=N=>r(E=>({...E,homepage:N(E.homepage)})),x=N=>p(E=>({...E,hero:N(E.hero)})),v=(N,E)=>r(R=>aS(R,N,E)),j=(N,E)=>r(R=>aS(R,N,{},[E])),w=new Set(m.hero.map(Jr)),C=[...h.values()].filter(N=>N.eligible&&!w.has(N.key)),S=[...h.values()].filter(N=>N.eligible&&N.source==="project"&&!m.selectedProjectIds.includes(N.id));return a.jsxs("div",{className:"space-y-10",children:[a.jsxs("section",{children:[a.jsx("h2",{className:"text-xl mb-4",children:"Intro sequence"}),a.jsxs("div",{className:"bg-white p-5 space-y-4 text-center",children:[a.jsx("p",{className:"text-xl",children:_d.lead}),a.jsx("img",{src:dy,alt:"Already Alive",className:"w-full max-w-xs h-auto mx-auto brightness-0"}),a.jsx("p",{className:"text-sm",children:_d.subtitle})]}),a.jsx("p",{className:"mt-3 text-sm text-[#756e66]",children:"This fixed brand intro runs for about 4 seconds. Visitors can skip it, and reduced-motion preferences bypass it."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-xl mb-4",children:"Homepage copy"}),a.jsxs("div",{className:`${ir} space-y-5`,children:[a.jsx(Ve,{label:"What we do paragraphs",children:a.jsx(fy,{value:m.whatWeDoParagraphs,onChange:N=>p(E=>({...E,whatWeDoParagraphs:N}))})}),a.jsx("div",{className:"grid md:grid-cols-3 gap-4",children:m.stages.map((N,E)=>a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ve,{label:`Stage ${E+1} name`,children:a.jsx("input",{className:Ke,value:N.name,onChange:R=>p(D=>({...D,stages:D.stages.map((A,_)=>_===E?{...A,name:R.target.value}:A)}))})}),a.jsx(Ve,{label:"Description",children:a.jsx("textarea",{className:Qr,value:N.description,onChange:R=>p(D=>({...D,stages:D.stages.map((A,_)=>_===E?{...A,description:R.target.value}:A)}))})})]},E))}),a.jsx(Ve,{label:"Original score line",children:a.jsx("input",{className:Ke,value:m.scoreLine,onChange:N=>p(E=>({...E,scoreLine:N.target.value}))})}),a.jsx(Ve,{label:"Films strip copy",children:a.jsx("textarea",{className:Qr,value:m.filmsStripCopy,onChange:N=>p(E=>({...E,filmsStripCopy:N.target.value}))})})]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-xl mb-1",children:"Hero cycle"}),a.jsx("p",{className:"text-sm text-[#756e66] mb-4",children:"Plays in order. Each item can use its own clip and poster, independent of the project or film it came from."}),a.jsxs("div",{className:"space-y-3",children:[m.hero.length===0?a.jsx("div",{className:"bg-white p-5 text-sm text-[#756e66]",children:"No hero items yet. Add a project or film below."}):null,m.hero.map((N,E)=>{const R=h.get(Jr(N))??cS,D={projectId:N.projectId,source:N.source},A=N.still===void 0?R.still:N.still,_=N.clip===void 0?R.clip:N.clip,F=A||R.thumb;return a.jsxs("div",{className:`bg-white p-4 space-y-3 ${R.eligible?"":"border-l-4 border-[#b4532a]"}`,children:[a.jsxs("div",{className:"flex flex-wrap gap-3 items-start",children:[a.jsx(uS,{site:e,src:F}),a.jsxs("div",{className:"flex-1 min-w-[140px]",children:[a.jsx("p",{className:"font-medium break-words",children:R.label}),a.jsxs("p",{className:"text-xs uppercase tracking-wide text-[#756e66]",children:[R.source==="film"?"Film":"Project",R.sub?` / ${R.sub}`:""]}),R.eligible?null:a.jsxs("p",{className:"text-sm text-[#b4532a]",children:["Not shown publicly: ",R.reason]})]}),a.jsxs("div",{className:"flex items-center ml-auto",children:[a.jsx("button",{type:"button","aria-label":"Move up",className:ds,disabled:E===0,onClick:()=>x(O=>Iu(O,E,E-1)),children:a.jsx(Pl,{className:"w-4 h-4"})}),a.jsx("button",{type:"button","aria-label":"Move down",className:ds,disabled:E===m.hero.length-1,onClick:()=>x(O=>Iu(O,E,E+1)),children:a.jsx(Dl,{className:"w-4 h-4"})}),a.jsx("button",{type:"button","aria-label":"Remove from hero",className:ds,onClick:()=>x(O=>O.filter((I,V)=>V!==E)),children:a.jsx(ms,{className:"w-4 h-4 text-red-700"})})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[110px_1fr_1fr] gap-4",children:[a.jsx(Ve,{label:"Seconds (1-12)",children:a.jsx("input",{className:Ke,type:"number",min:1,max:12,value:N.duration,onChange:O=>v(D,{duration:Y$(Number(O.target.value))})})}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(ar,{site:e,kind:"clip",label:"Clip override",value:N.clip??"",disabled:N.clip==="",onCh
63ange:O=>O?v(D,{clip:O}):j(D,"clip")}),N.clip===void 0&&_?a.jsx("video",{src:zt(_,e),className:"w-full max-w-[260px] aspect-video bg-black object-cover",muted:!0,controls:!0}):null,a.jsx("p",{className:"text-xs text-[#756e66]",children:N.clip===""?"Video is disabled; the poster shows.":N.clip?"Using this clip.":_?"Inheriting the source clip.":"Source has no clip; the poster shows."}),a.jsxs("div",{className:"flex gap-4 text-sm",children:[a.jsx("button",{type:"button",className:"underline",onClick:()=>v(D,{clip:""}),children:"Disable video"}),a.jsx("button",{type:"button",className:"underline",onClick:()=>j(D,"clip"),children:"Inherit"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(ar,{site:e,label:"Poster override",value:N.still??"",onChange:O=>O?v(D,{still:O}):j(D,"still")}),a.jsx("p",{className:"text-xs text-[#756e66]",children:N.still?"Using this poster.":N.still===""?"No poster.":A?"Inheriting the source poster.":"Source has no poster."})]})]})]},`${Jr(N)}-${E}`)}),a.jsxs("div",{className:"bg-white p-4 flex flex-wrap gap-3 items-end",children:[a.jsx("div",{className:"flex-1 min-w-[220px]",children:a.jsx(Ve,{label:"Add to hero",children:a.jsxs("select",{className:Ke,value:o,onChange:N=>c(N.target.value),"data-testid":"select-hero-option",children:[a.jsx("option",{value:"",children:"Choose a project or film"}),["project","film"].map(N=>a.jsx("optgroup",{label:N==="project"?"Projects":"Films",children:C.filter(E=>E.source===N).map(E=>a.jsxs("option",{value:E.key,children:[E.label,E.sub?` (${E.sub})`:""]},E.key))},N))]})})}),a.jsxs("button",{type:"button",className:"bg-[#171513] text-white px-4 py-2.5 disabled:opacity-40",disabled:!o,"data-testid":"button-add-hero",onClick:()=>{const N=h.get(o);N&&(r(E=>wA(E,{projectId:N.id,source:N.source,duration:6})),c(""))},children:[a.jsx(Jt,{className:"inline w-4 h-4"})," Add"]})]})]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-xl mb-1",children:"Selected case studies"}),a.jsxs("p",{className:"text-sm text-[#756e66] mb-4",children:["Up to six projects in the homepage grid, in this order (",m.selectedProjectIds.length,"/6)."]}),a.jsxs("div",{className:"space-y-3",children:[m.selectedProjectIds.length===0?a.jsx("div",{className:"bg-white p-5 text-sm text-[#756e66]",children:"Nothing selected yet."}):null,m.selectedProjectIds.map((N,E)=>{const R=h.get(`project:${N}`)??cS;return a.jsxs("div",{className:`bg-white p-4 flex flex-wrap gap-3 items-center ${R.eligible?"":"border-l-4 border-[#b4532a]"}`,children:[a.jsx(uS,{site:e,src:R.thumb}),a.jsxs("div",{className:"flex-1 min-w-[140px]",children:[a.jsx("p",{className:"font-medium break-words",children:R.label}),a.jsx("p",{className:"text-xs uppercase tracking-wide text-[#756e66]",children:R.sub}),R.eligible?null:a.jsxs("p",{className:"text-sm text-[#b4532a]",children:["Not shown publicly: ",R.reason]})]}),a.jsx("button",{type:"button","aria-label":"Move up",className:ds,disabled:E===0,onClick:()=>p(D=>({...D,selectedProjectIds:Iu(D.selectedProjectIds,E,E-1)})),children:a.jsx(Pl,{className:"w-4 h-4"})}),a.jsx("button",{type:"button","aria-label":"Move down",className:ds,disabled:E===m.selectedProjectIds.length-1,onClick:()=>p(D=>({...D,selectedProjectIds:Iu(D.selectedProjectIds,E,E+1)})),children:a.jsx(Dl,{className:"w-4 h-4"})}),a.jsx("button",{type:"button","aria-label":"Remove case study",className:ds,onClick:()=>p(D=>({...D,selectedProjectIds:D.selectedProjectIds.filter((A,_)=>_!==E)})),children:a.jsx(ms,{className:"w-4 h-4 text-red-700"})})]},`${N}-${E}`)}),a.jsxs("div",{className:"bg-white p-4 flex flex-wrap gap-3 items-end",children:[a.jsx("div",{className:"flex-1 min-w-[220px]",children:a.jsx(Ve,{label:"Add case study",children:a.jsxs("select",{className:Ke,value:u,onChange:N=>f(N.target.value),disabled:m.selectedProjectIds.length>=6,"data-testid":"select-case-option",children:[a.jsx("option",{value:"",children:m.selectedProjectIds.length>=6?"Six selected":"Choose a project"}),S.map(N=>a.jsxs("option",{value:N.id,children:[N.label,N.sub?` (${N.sub})`:""]},N.key))]})})}),a.jsxs("button",{type:"button",className:"bg-[#171513] text-white px-4 py-2.5 disabled:opacity-40",disabled:!u||m.selectedProjectIds.length>=6,"data-testid":"button-add-case",onClick:()=>{p(N=>N.selectedProjectIds.length>=6||N.selectedProjectIds.includes(u)?N:{...N,selectedProjectIds:[...N.selectedProjectIds,u]}),f("")},children:[a.jsx(Jt,{className:"inline w-4 h-4"})," Add"]})]})]})]})]})}const CA=e=>(e.source??"project")==="project",EA=(e,t)=>e.homepage.hero.some(s=>CA(s)&&s.projectId===t),bg=(e,t)=>e.homepage.selectedProjectIds.includes(t);
63function tq(e,t,s){const r=EA(e,t);if(s===r)return e;if(s)return wA(e,{projectId:t,source:"project",duration:6});const o=e.homepage.hero.filter(c=>!(CA(c)&&c.projectId===t));return{...e,homepage:{...e.homepage,hero:o}}}function nq(e,t,s){const r=bg(e,t);if(s===r||s&&e.homepage.selectedProjectIds.length>=6)return e;const o=s?[...e.homepage.selectedProjectIds,t]:e.homepage.selectedProjectIds.filter(c=>c!==t);return{...e,homepage:{...e.homepage,selectedProjectIds:o}}}const sq=()=>({id:crypto.randomUUID(),client:"",title:"",slug:"",year:"",type:"Brand",vimeoUrl:"",still:"",brief:"",whatWeDid:[{stage:"Development",description:""}],results:[],stills:[],deliverables:"",credits:[bA()],showOnHomepageGrid:!1,includeInHomepageHero:!1,published:!1,order:999});function rq({item:e,p:t,set:s,site:r}){const o=t.visible!==!1,c=e.published===!1||e.showOnAlreadyAlive===!1;return a.jsxs("div",{className:`${ir} ${c?"border-l-4 border-[#b4532a]":""}`,children:[a.jsxs("div",{className:"flex flex-wrap justify-between gap-2",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"font-medium",children:e.title||"Untitled"}),a.jsx("p",{className:"text-xs uppercase tracking-wide text-[#756e66]",children:[e.client,e.year,e.type].filter(Boolean).join(" / ")})]}),a.jsxs("span",{className:"text-xs uppercase tracking-wide text-[#756e66]",children:["Shared work / ",a.jsx(Xn,{targetSite:"michael",className:"underline",href:Vl("michael",`/admin/work/${e.id}`),children:"Edit canonical copy"})]})]}),c?a.jsx("p",{className:"text-sm text-[#b4532a]",children:e.published===!1?"Unpublished on the main site, so it cannot appear here.":"Not offered to Already Alive on the main site."}):null,a.jsx("p",{className:"text-sm text-[#756e66]",children:"Title, client and copy are read-only here. Only where it appears on this site is editable."}),a.jsxs("div",{className:"grid md:grid-cols-[auto_120px_1fr] gap-4 items-start",children:[a.jsxs("label",{className:"text-sm pt-6",children:[a.jsx("input",{type:"checkbox",checked:o,onChange:u=>s({visible:u.target.checked})})," Show on Already Alive"]}),a.jsx(Ve,{label:"Order",children:a.jsx("input",{className:Ke,type:"number",value:t.order??e.order,onChange:u=>s({order:Number(u.target.value)})})}),a.jsxs("div",{children:[a.jsx(ar,{site:r,label:"Still for this site",value:t.still??"",onChange:u=>s({still:u||void 0})}),a.jsx("p",{className:"text-xs text-[#756e66] mt-1",children:t.still?"Overrides the shared still on Already Alive only.":"Using the shared still."})]})]})]})}function iq({site:e,draft:t,base:s,update:r}){const[o,c]=y.useState(null),u=s.work.filter(v=>!v.deletedAt),f=new Set(s.work.map(v=>v.id)),h=t.projects.filter(v=>!f.has(v.id)&&!v.canonicalWorkId),m=t.projects.filter(v=>v.canonicalWorkId&&!f.has(v.id)),p=(v,j)=>r(w=>({...w,projects:w.projects.map(C=>C.id===v?{...C,...j}:C)})),x=(v,j)=>r(w=>({...w,projectPresentation:{...w.projectPresentation,[v]:{...w.projectPresentation?.[v],...j}}}));return a.jsxs("div",{className:"space-y-10",children:[a.jsxs("section",{children:[a.jsx("h2",{className:"text-xl mb-4",children:"Shared work"}),a.jsxs("div",{className:"space-y-4",children:[u.length===0?a.jsx("div",{className:"bg-white p-5 text-sm text-[#756e66]",children:"No shared work has been offered by the main site."}):null,m.map(v=>a.jsxs("div",{className:`${ir} border-l-4 border-[#b4532a]`,children:[a.jsx("h3",{className:"font-medium",children:v.title||"Shared work"}),a.jsx("p",{className:"text-sm text-[#b4532a]",children:"Unavailable: the shared source work was removed or unpublished on the main site. Its Already Alive placement is kept and returns if the source is restored."})]},v.id)),u.map(v=>a.jsx(rq,{item:v,site:e,p:t.projectPresentation?.[v.id]??{},set:j=>x(v.id,j)},v.id))]})]}),a.jsxs("section",{children:[a.jsxs("div",{className:"flex justify-between mb-4",children:[a.jsx("h2",{className:"text-xl",children:"Already Alive projects"}),a.jsxs("button",{type:"button",className:"underline","data-testid":"button-new-project",onClick:()=>r(v=>({...v,projects:[...v.projects,sq()]})),children:[a.jsx(Jt,{className:"inline w-4"})," New project"]})]}),a.jsxs("div",{className:"space-y-5",children:[h.length===0?a.jsx("div",{className:"bg-white p-5 text-sm text-[#756e66]",children:"No projects of your own yet. Start one with New project."}
63):null,h.map(v=>{const j=v.id;return a.jsxs("div",{className:ir,"data-testid":`card-project-${j}`,children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("h3",{className:"font-medium",children:v.title||"[Untitled project]"}),o===j?a.jsxs("span",{className:"text-sm flex gap-3",children:["Delete this project? ",a.jsx("button",{type:"button",className:"underline text-red-700",onClick:()=>{r(w=>({...w,projects:w.projects.filter(C=>C.id!==j)})),c(null)},children:"Delete"}),a.jsx("button",{type:"button",className:"underline",onClick:()=>c(null),children:"Keep"})]}):a.jsx("button",{type:"button","aria-label":"Delete project",className:ds,onClick:()=>c(j),children:a.jsx(ms,{className:"w-4 text-red-700"})})]}),a.jsxs("div",{className:"grid md:grid-cols-4 gap-3",children:[a.jsx(Ve,{label:"Client",children:a.jsx("input",{className:Ke,value:v.client,onChange:w=>p(j,{client:w.target.value})})}),a.jsx(Ve,{label:"Title",children:a.jsx("input",{className:Ke,value:v.title,onChange:w=>p(j,{title:w.target.value})})}),a.jsx(Ve,{label:"Slug",children:a.jsx("input",{className:Ke,value:v.slug,onChange:w=>p(j,{slug:w.target.value})})}),a.jsx(Ve,{label:"Year",children:a.jsx("input",{className:Ke,value:v.year,onChange:w=>p(j,{year:w.target.value})})})]}),a.jsxs("div",{className:"grid md:grid-cols-2 gap-3",children:[a.jsx(Ve,{label:"Type",children:a.jsx("select",{className:Ke,value:v.type,onChange:w=>p(j,{type:w.target.value}),children:["Brand","Non-Profit","Documentary","Other",...["Brand","Non-Profit","Documentary","Other"].includes(v.type)?[]:[v.type]].map(w=>a.jsx("option",{children:w},w))})}),a.jsx(Ve,{label:"Vimeo URL",children:a.jsx("input",{className:Ke,value:v.vimeoUrl,onChange:w=>p(j,{vimeoUrl:w.target.value})})})]}),a.jsxs("div",{className:"grid md:grid-cols-3 gap-4",children:[a.jsx(ar,{site:e,label:"16:9 still",value:v.still,onChange:w=>p(j,{still:w})}),a.jsx(ar,{site:e,kind:"clip",label:"Hero clip",value:v.heroClip??"",onChange:w=>p(j,{heroClip:w||void 0})}),a.jsx(ar,{site:e,label:"Hero poster",value:v.heroStill??"",onChange:w=>p(j,{heroStill:w||void 0})})]}),a.jsx(Ve,{label:"Brief",children:a.jsx("textarea",{className:Qr,value:v.brief,onChange:w=>p(j,{brief:w.target.value})})}),a.jsx(Ve,{label:"Deliverables",children:a.jsx("input",{className:Ke,value:v.deliverables,onChange:w=>p(j,{deliverables:w.target.value})})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs uppercase tracking-wide text-[#756e66] mb-2",children:"What we did"}),v.whatWeDid.map((w,C)=>a.jsxs("div",{className:"grid grid-cols-[150px_1fr_auto] gap-2 mb-2",children:[a.jsx("select",{className:Ke,value:w.stage,onChange:S=>p(j,{whatWeDid:v.whatWeDid.map((N,E)=>E===C?{...N,stage:S.target.value}:N)}),children:["Development","Production","Post","Score",...["Development","Production","Post","Score"].includes(w.stage)?[]:[w.stage]].map(S=>a.jsx("option",{children:S},S))}),a.jsx("input",{className:Ke,value:w.description,onChange:S=>p(j,{whatWeDid:v.whatWeDid.map((N,E)=>E===C?{...N,description:S.target.value}:N)})}),a.jsx("button",{type:"button","aria-label":"Remove stage row",className:ds,onClick:()=>p(j,{whatWeDid:v.whatWeDid.filter((S,N)=>N!==C)}),children:a.jsx(ms,{className:"w-4 text-red-700"})})]},C)),a.jsxs("button",{type:"button",className:io,onClick:()=>p(j,{whatWeDid:[...v.whatWeDid,{stage:"Post",description:""}]}),children:[a.jsx(Jt,{className:"inline w-3"})," Add stage row"]})]}),a.jsx(Ve,{label:"Results (hidden when empty)",children:a.jsx(fy,{value:v.results,onChange:w=>p(j,{results:w})})}),a.jsxs("div",{className:"space-y-3",children:[a.jsx("p",{className:"text-xs uppercase tracking-wide text-[#756e66]",children:"Stills gallery"}),a.jsx("div",{className:"grid md:grid-cols-3 gap-4",children:uy(v.stills).map((w,C)=>a.jsxs("div",{className:"space-y-1",children:[a.jsx(ar,{site:e,label:`Still ${C+1}`,value:w.url,onChange:S=>r(N=>wl(N,j,w.id,"set",S))}),a.jsxs("div",{className:"flex gap-3 text-sm",children:[a.jsx("button",{type:"button",className:"underline disabled:opacity-30","aria-label":"Move still up",disabled:C===0,onClick:()=>r(S=>wl(S,j,w.id,"up")),children:"Up"}),a.jsx("button",{type:"button",className:"underline disabled:opacity-30","aria-label":"Move still down",disabled:C===v.stills.length-1,onClick:()=>r(S=>wl(S,j,w.id,"down")),children:"Down"}),a.jsx("button",{type:"button",className:"underline text-red-700",onClick:()=>r(S=>wl(S,j,w.id,"remove")),children:"Remove still"})]})]},w.id))}),a.jsxs("button",{type:"button",className:io,onClick:()=>r(w=>wl(w,j,null,"add")),children:[a.jsx(Jt,{className:"inline w-3"})," Add still"]})]}),a.jsx(Ve,{label:"Credits",children:a.jsx(NA,{value:v.credits,onChange:w=>p(j,{credits:w})})}),a.jsxs("div",{className:"flex flex-wrap gap-5 text-sm items-end",children:[a.jsxs("label",{children:[a.jsx("input",{type:"checkbox",checked:EA(t,j),onChange:w=>r(C=>tq(C,j,w.target.checked))})," In homepage hero"]}),a.jsxs("label",{children:[a.jsx("input",{type:"checkbox",checked:bg(t,j),disabled:!bg(t,j)&&t.homepage.selectedProjectIds.length>=6,onChange:w=>r(C=>nq(C,j,w.target.checked))})," Selected case study"]}),a.jsxs("label",{children:[a.jsx("input",{type:"checkbox",checked:v.published,onChange:w=>p(j,{published:w.target.checked})})," Published"]}),a.jsxs("label",{children:[a.jsx("input",{type:"checkbox",checked:v.showOnAlreadyAlive!==!1,onChange:w=>r(C=>iS(C,j,"alreadyalive",w.target.checked))})," Show on Already Alive"]}),a.jsxs("label",{children:[a.jsx("input",{type:"checkbox",checked:v.showOnMichael===!0,onChange:w=>r(C=>iS(C,j,"michael",w.target.checked))})," Show on Michael"]}),a.jsx(Ve,{label:"Order",children:a.jsx("input",{className:`${Ke} w-24`,type:"number",value:v.order,onChange:w=>p(j,{order:Number(w.target.value)})})})]}),a.jsx("p",{className:"text-xs text-[#756e66]",children:"Hero timing, clip overrides and ordering live under Homepage. Show on Michael shares this canonical project after Already Alive content is published; it does not edit Michael’s draft."})]},j)})]})]})]})}
63function aq({site:e,draft:t,base:s,update:r}){const o=new Map(s.films.map(p=>[p.id,p])),c=new Map(t.films.map(p=>[p.canonicalFilmId,p])),u=s.films.filter(p=>!p.deletedAt),f=t.films.filter(p=>!u.some(x=>x.id===p.canonicalFilmId)),h=(p,x)=>r(v=>({...v,films:v.films.some(j=>j.canonicalFilmId===p)?v.films.map(j=>j.canonicalFilmId===p?x(j):j):[...v.films,x({canonicalFilmId:p})]})),m=(p,x,v)=>{const j=vA(x),w=!!v,C=v??{canonicalFilmId:p},S=(A,_)=>h(p,F=>q$(F,A,_,x)),N=A=>C[A]!==void 0,E=(A,_)=>N(A)?C[A]:x?cy(x,A):_,R=({k:A})=>N(A)?a.jsx("button",{type:"button",className:`${io} ml-2`,onClick:()=>S(A,void 0),children:"Reset to shared"}):null,D=C.published===!1;return a.jsxs("div",{className:`${ir} ${j.available&&!D?"":"border-l-4 border-[#b4532a]"}`,"data-testid":`card-film-${p}`,children:[a.jsxs("div",{className:"flex flex-wrap justify-between gap-2 items-start",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"font-medium",children:E("title","")||"Unavailable film"}),a.jsxs("p",{className:"text-xs uppercase tracking-wide text-[#756e66]",children:[w?D?"Hidden on Already Alive":"Included":"Not included",x?"":" / source missing"]})]}),a.jsxs("div",{className:"flex gap-4 text-sm items-center",children:[x?a.jsx(Xn,{targetSite:"michael",className:"underline",href:Vl("michael",`/admin/films/${p}`),children:"Edit canonical copy"}):null,w&&x?a.jsx("button",{type:"button",className:"underline",onClick:()=>r(A=>({...A,films:A.films.map(_=>_.canonicalFilmId===p?{canonicalFilmId:p,..._.published===!1?{published:!1}:{}}:_)})),children:"Reset all overrides"}):null,w&&!D?a.jsx("button",{type:"button",className:"underline text-red-700",onClick:()=>h(p,A=>({...A,published:!1})),children:"Remove"}):a.jsx("button",{type:"button",className:"underline disabled:opacity-40",disabled:!j.available,onClick:()=>h(p,A=>{const _={...A};return delete _.published,_}),children:"Include"})]})]}),j.available?null:a.jsxs("p",{className:"text-sm text-[#b4532a]",children:["Unavailable: ",j.reason," This record is kept and will return if the source film is restored."]}),w?a.jsxs(a.Fragment,{children:[a.jsxs("label",{className:"text-sm block",children:[a.jsx("input",{type:"checkbox",checked:!D,disabled:!j.available,onChange:A=>h(p,_=>{const F={..._};return A.target.checked?delete F.published:F.published=!1,F})})," Show on Already Alive"]}),a.jsxs("div",{className:"grid md:grid-cols-4 gap-3",children:[a.jsxs(Ve,{label:"Title",children:[a.jsx("input",{className:Ke,value:E("title",""),onChange:A=>S("title",A.target.value)}),a.jsx(R,{k:"title"})]}),a.jsxs(Ve,{label:"Slug",children:[a.jsx("input",{className:Ke,value:E("slug",""),onChange:A=>S("slug",A.target.value)}),a.jsx(R,{k:"slug"})]}),a.jsxs(Ve,{label:"Status line",children:[a.jsx("input",{className:Ke,value:E("status",""),onChange:A=>S("status",A.target.value)}),a.jsx(R,{k:"status"})]}),a.jsxs(Ve,{label:"Order",children:[a.jsx("input",{className:Ke,type:"number",value:E("order",0),onChange:A=>S("order",Number(A.target.value))}),a.jsx(R,{k:"order"})]})]}),a.jsxs(Ve,{label:"Logline",children:[a.jsx("textarea",{className:Qr,value:E("logline",""),onChange:A=>S("logline",A.target.value)}),a.jsx(R,{k:"logline"})]}),a.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(ar,{site:e,label:"Poster / key art",value:E("poster",""),onChange:A=>S("poster",A||void 0)}),a.jsx(R,{k:"poster"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs(Ve,{label:"Trailer URL",children:[a.jsx("input",{className:Ke,value:E("trailerUrl",""),onChange:A=>S("trailerUrl",A.target.value)}),a.jsx(R,{k:"trailerUrl"})]}),a.jsxs("label",{className:"text-sm block",children:[a.jsx("input",{type:"checkbox",checked:E("showTrailer",!1),onChange:A=>S("showTrailer",A.target.checked)})," Show trailer"]}),a.jsx(R,{k:"showTrailer"})]})]}),a.jsxs(Ve,{label:"Credits",children:[a.jsx(NA,{value:E("credits",[]),onChange:A=>S("credits",A)}),a.jsx(R,{k:"credits"})]}),a.jsxs(Ve,{label:"Film stills (one image URL per line)",children:[a.jsx(fy,{value:E("stills",[]),onChange:A=>S("stills",A)}),a.jsx(R,{k:"stills"})]})]}):null]},p)};return a.jsxs("div",{className:"space-y-4",children:[a.jsx("p",{className:"text-sm text-[#756e66]",children:"Films come from the main site. Fields you leave alone follow the shared copy; only changes you make are stored for Already Alive."}),u.length===0&&f.length===0?a.jsx("div",{className:"bg-white p-5 text-sm text-[#756e66]",children:"No films are available yet."}):null,u.map(p=>m(p.id,p,c.get(p.id))),f.length?a.jsx("h2",{className:"text-xl pt-4",children:"Unavailable films"}):null,f.map(p=>m(p.canonicalFilmId,o.get(p.canonicalFilmId),p))]})}function oq({site:e,draft:t,update:s}){const r=f=>s(h=>({...h,studio:f(h.studio)})),o=f=>s(h=>({...h,clients:f(h.clients)})),c=t.studio,u=(f,h)=>a.jsx(Ve,{label:h,children:a.jsx("textarea",{className:Qr,value:c[f],onChange:m=>r(p=>({...p,[f]:m.target.value}))})});return a.jsxs("div",{className:"space-y-10",children:[a.jsxs("section",{children:[a.jsx("h2",{className:"text-xl mb-4",children:"Clients"}),a.jsxs("div",{className:`${ir} space-y-3`,children:[t.clients.length===0?a.jsx("p",{className:"text-sm text-[#756e66]",children:"No clients listed yet."}):null,t.clients.map((f,h)=>a.jsxs("div",{className:"grid grid-cols-[1fr_auto_auto_80px_auto] gap-3 items-center",children:[a.jsx("input",{className:Ke,"aria-label":"Client name",value:f.name,onChange:m=>o(p=>p.map((x,v)=>v===h?{...x,name:m.target.value}:x))}),a.jsxs("label",{className:"text-sm",children:[a.jsx("input",{type:"checkbox",checked:f.showOnHomepage,onChange:m=>o(p=>p.map((x,v)=>v===h?{...x,showOnHomepage:m.target.checked}:x))})," Home"]}),a.jsxs("label",{className:"text-sm",children:[a.jsx("input",{type:"checkbox",checked:f.showOnStudio,onChange:m=>o(p=>p.map((x,v)=>v===h?{...x,showOnStudio:m.target.checked}:x))})," Studio"]}),a.jsx("input",{className:Ke,type:"number","aria-label":"Order",value:f.order,onChange:m=>o(p=>p.map((x,v)=>v===h?{...x,order:Number(m.target.value)}:x))}),a.jsx("button",{type:"button","aria-label":"Remove client",className:ds,onClick:()=>o(m=>m.filter((p,x)=>x!==h)),children:a.jsx(ms,{className:"w-4 h-4 text-red-700"})})]},h)),a.jsxs("button",{type:"button",className:io,onClick:()=>o(f=>[...f,{name:"",showOnHomepage:!1,showOnStudio:!1,order:f.length}]),children:[a.jsx(Jt,{className:"inline w-3"})," Add client"]})]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-xl mb-4",children:"Studio"}),a.jsxs("div",{className:`${ir} space-y-4`,children:[a.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[u("howWeWork","How we work"),u("who","Who"),u("where","Where"),u("clients","Clients"),u("closing","Closing"),a.jsx(ar,{site:e,label:"Headshot",value:c.headshot||"",onChange:f=>r(h=>({...h,headshot:f}))})]}),a.jsx("p",{className:"text-xs uppercase tracking-wide text-[#756e66]",children:"What we do stages"}),c.whatWeDo.map((f,h)=>a.jsxs("div",{className:"grid md:grid-cols-2 gap-3",children:[a.jsx("input",{className:Ke,"aria-label":"Stage name",value:f.name,onChange:m=>r(p=>({...p,whatWeDo:p.whatWeDo.map((x,v)=>v===h?{...x,name:m.target.value}:x)}))}),a.jsx("textarea",{className:Qr,"aria-label":"Stage description",value:f.description,onChange:m=>r(p=>({...p,whatWeDo:p.whatWeDo.map((x,v)=>v===h?{...x,description:m.target.value}:x)}))})]},h))]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-xl mb-4",children:"Contact panel"}),a.jsx("div",{className:`${ir} grid md:grid-cols-2 gap-4`,children:["email","intro","studio","representation","instagramUrl","vimeoUrl","michaelUrl"].map(f=>a.jsx(Ve,{label:f,children:a.jsx("textarea",{className:Qr,value:t.contact[f],onChange:h=>s(m=>({...m,contact:{...m.contact,[f]:h.target.value}}))})},f))})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-xl mb-4",children:"Per-page SEO"}),a.jsx("div",{className:"space-y-4",children:Object.entries(t.seo).map(([f,h])=>a.jsxs("div",{className:`${ir} grid md:grid-cols-2 gap-4`,children:[a.jsx(Ve,{label:`${f} title`,children:a.jsx("input",{className:Ke,value:h.title,onChange:m=>s(p=>({...p,seo:{...p.seo,[f]:{...p.seo[f],title:m.target.value}}}))})}),a.jsx(Ve,{label:`${f} description`,children:a.jsx("textarea",{className:Qr,value:h.description,onChange:m=>s(p=>({...p,seo:{...p.seo,[f]:{...p.seo[f],description:m.target.value}}}))})})]},f))})]})]})}const lq={homepage:"Homepage",work:"Work",films:"Films",studio:"Studio and contact"};function cq({section:e="homepage"}){const t=mt(),s=mr(),{toast:r}=Sn(),[o,c]=y.useState(!1),{data:u,error:f,refetch:h}=Os({site:t}),{store:m,base:p,draft:x,status:v,error:j,uploadError:w,uploading:C}=Z$(t),S=j??w;m.onSaved=A=>s.setQueryData(cr({site:t}),A),y.useEffect(()=>{u&&u.site===t&&m.adopt(u)},[u,t,m]),y.useEffect(()=>()=>{m.flush().catch(()=>{})},[m]);const N=async()=>{try{m.reset(await zi({site:t},{cache:"no-store"})),r({title:"Loaded the latest saved version"})}catch(A){r({title:"Could not reload",description:A instanceof Error?A.message:"Try again.",variant:"destructive"})}},E=()=>m.flush().then(()=>r({title:"Already Alive draft saved"})).catch(()=>{});if(!x||!p)return f?a.jsxs("div",{className:"min-h-[100dvh] flex flex-col gap-3 items-center justify-center bg-[#f7f3ee] text-[#171513]",children:[a.jsx("p",{children:"The Already Alive draft did not load."}),a.jsx("button",{className:"underline",onClick:()=>{h()},children:"Retry"})]}):a.jsx("div",{className:"min-h-[100dvh] flex items-center justify-center bg-[#f7f3ee]",children:a.jsx(Ue,{className:"animate-spin"})});const R=C>0?"Uploading media":v==="saving"?"Saving":v==="dirty"?"Unsaved changes":v==="error"?"Not saved":v==="conflict"?"Conflict":"All changes saved",D={site:t,draft:x,base:p,update:m.update.bind(m)};return a.jsxs("div",{className:"min-h-[100dvh] bg-[#f7f3ee] text-[#171513] p-6 md:p-10 max-w-6xl",children:[a.jsxs("div",{className:"sticky top-0 z-10 -mx-6 md:-mx-10 px-6 md:px-10 py-4 bg-[#e7b98c] flex flex-wrap justify-between items-center gap-x-4 gap-y-2",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-xs uppercase tracking-widest",children:"Already Alive"}),a.jsx("h1",{className:"text-2xl",children:lq[e]})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2",children:[a.jsx("span",{className:"text-sm",role:"status","data-testid":"status-draft",children:R}),v==="conflict"?a.jsx("button",{type:"button",className:"underline text-sm","data-testid":"button-reload-saved",onClick:()=>c(!0),children:"Reload saved version"}):null,a.jsxs("button",{type:"button",onClick:()=>{E()},disabled:v==="saving"||v==="conflict","data-testid":"button-save-draft",className:"bg-[#171513] text-[#f7f3ee] px-4 py-2 flex gap-2 items-center disabled:opacity-60",children:[v==="saving"?a.jsx(Ue,{className:"w-4 h-4 animate-spin"}):a.jsx(co,{className:"w-4 h-4"}),v==="error"?"Retry save":"Save draft"]})]})]}),a.jsx(L$,{open:o,onOpenChange:c,children:a.jsxs(uA,{"data-testid":"dialog-reload-saved",children:[a.jsxs(dA,{children:[a.jsx(hA,{children:"Reload the saved version?"}),a.jsx(mA,{children:m.getSnapshot().dirty?"Your unsaved edits on this page will be discarded and replaced with the latest saved draft.":"This replaces what you see with the latest saved draft."})]}),a.jsxs(fA,{children:[a.jsx(gA,{"data-testid":"button-reload-cancel",children:"Keep editing"}),a.jsx(pA,{"data-testid":"button-reload-confirm",onClick:()=>{N()},children:"Discard and reload"})]})]})}),S?a.jsxs("p",{className:"mt-4 p-3 bg-[#f3d9cf] text-sm",role:"alert",children:[S,w&&!j?a.jsx("button",{type:"button",className:"ml-3 underline",disabled:C>0,"data-testid":"button-discard-upload-error",onClick:()=>m.clearUploadError(),children:"Discard failed upload"}):null]}):null,a.jsx("p",{className:"my-6 text-[#756e66]",children:"Edit the Already Alive presentation only. Changes autosave as a draft and stay unpublished until the selected site is published."}),e==="homepage"?a.jsx(eq,{...D}):null,e==="work"?a.jsx(iq,{...D}):null,e==="films"?a.jsx(aq,{...D}):null,e==="studio"?a.jsx(oq,{...D}):null]})}function uq(){const e=mt(),{isAuthenticated:t,isLoading:s,authError:r,retryAuth:o,login:c}=Jg(),{data:u,isLoading:f,isError:h,refetch:m}=OC({query:{enabled:t,queryKey:["/api/admin/status"]}});return s||t&&f?a.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:a.jsx(Ue,{className:"w-4 h-4 text-white animate-spin"})}):r||t&&h?a.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center text-white p-6",children:a.jsxs("div",{className:"max-w-md w-full text-center space-y-6",role:"alert",children:[a.jsx("h1",{className:"text-xl",children:"Unable to check Admin access"}),a.jsx("p",{className:"text-[#8a8a8a]",children:r||"We couldn’t confirm your Admin access. Please try again."}),a.jsx("button",{className:"w-full bg-white text-black py-3 px-4",onClick:()=>{r?o():m()},children:"Try again"})]})}):t?u?.authorized?a.jsx(qV,{children:e==="alreadyalive"?a.jsxs(md,{children:[a.jsx(Se,{path:"/admin",component:Uj}),a.jsx(Se,{path:"/admin/alreadyalive",children:a.jsx(wu,{to:sr(e,"/admin/alreadyalive/homepage"),replace:!0})}),a.jsx(Se,{path:"/admin/alreadyalive/:section",children:p=>{const x=BV(p.section);return x?a.jsx(cq,{section:x}):a.jsx("div",{className:"p-8",children:"This section is unavailable. Choose a section from the Already Alive menu."})}}),a.jsx(Se,{path:"/admin/work",children:a.jsx(wu,{to:sr(e,"/admin/alreadyalive/work"),replace:!0})}),a.jsx(Se,{path:"/admin/films",children:a.jsx(wu,{to:sr(e,"/admin/alreadyalive/films"),replace:!0})}),a.jsx(Se,{path:"/admin/settings",children:a.jsx(wu,{to:sr(e,"/admin/alreadyalive/studio"),replace:!0})}),a.jsx(Se,{path:"/admin/newsletter",component:Jj}),a.jsx(Se,{path:"/admin/newsletter/new",component:Uu}),a.jsx(Se,{path:"/admin/newsletter/:id",component:Uu}),a.jsx(Se,{path:"/admin/work/:id",children:p=>a.jsxs("div",{className:"p-8 space-y-4",children:[a.jsx("h1",{className:"text-xl",children:"Canonical project editing"}),a.jsx("p",{children:"Manage Already Alive-owned case studies in Work / Case Studies. Shared projects are edited on their originating website."}),a.jsx("a",{className:"underline block",href:sr(e,"/admin/alreadyalive/work"),children:"Open Already Alive case studies"}),p.id!=="new"&&a.jsx("a",{className:"underline block",href:Vl("michael",`/admin/work/${encodeURIComponent(p.id)}`),children:"Open canonical Michael project editor"})]})}),a.jsx(Se,{children:a.jsxs("div",{className:"p-8 space-y-3",children:[a.jsx("h1",{className:"text-xl",children:"This tool belongs to Michael Marantz"}),a.jsx("p",{children:"Choose an Already Alive section from the menu to edit this website."})]})})]}):a.jsxs(md,{children:[a.jsx(Se,{path:"/admin",component:Uj}),a.jsx(Se,{path:"/admin/films",component:HV}),a.jsx(Se,{path:"/admin/films/new",component:Kj}),a.jsx(Se,{path:"/admin/films/:id",component:Kj}),a.jsx(Se,{path:"/admin/work",component:t$}),a.jsx(Se,{path:"/admin/work/new",component:Yj}),a.jsx(Se,{path:"/admin/work/:id",component:Yj}),a.jsx(Se,{path:"/admin/cycle",component:i$}),a.jsx(Se,{path:"/admin/press",component:a$}),a.jsx(Se,{path:"/admin/newsletter",component:Jj}),a.jsx(Se,{path:"/admin/newsletter/new",component:Uu}),a.jsx(Se,{path:"/admin/newsletter/:id",component:Uu}),a.jsx(Se,{path:"/admin/settings",component:l$}),a.jsx(Se,{path:"/admin/alreadyalive",children:a.jsxs("div",{className:"p-8 space-y-4",children:[a.jsx("h1",{className:"text-xl",children:"Already Alive admin"}),a.jsx("p",{children:"This domain edits Michael Marantz. Open the Already Alive admin to edit that website."}),a.jsx("a",{className:"underline",href:Vl("alreadyalive","/admin/alreadyalive/homepage"),children:"Open Already Alive admin"})]})}),a.jsx(Se,{children:a.jsx("div",{className:"p-8",children:"Choose a section from the admin menu."})})]})}):a.jsx("div",{className:"min-h-screen bg-black flex flex-col items-center justify-center text-white text-[17px] font-sans p-6",children:a.jsxs("div",{className:"max-w-md w-full text-center space-y-6",children:[a.jsx("h1",{className:"text-xl",children:"Unauthorized"}),a.jsx("p",{className:"text-[#8a8a8a]",children:"You do not have permission to access this CMS. Please log in with the owner account."}),a.jsx(xt,{href:"/",className:"text-white hover:text-[#8a8a8a] transition-colors block",children:"Return to 
63site"})]})}):a.jsx("div",{className:"min-h-screen bg-black flex flex-col items-center justify-center text-white text-[17px] font-sans p-6",children:a.jsxs("div",{className:"max-w-md w-full text-center space-y-6",children:[a.jsx("h1",{className:"text-xl",children:"Admin Access"}),a.jsx("p",{className:"text-[#8a8a8a]",children:"Please log in to access the CMS."}),window.self!==window.top&&a.jsx("p",{className:"text-sm text-[#8a8a8a]",children:"Sign-in opens in a new tab. Continue using Admin in that tab."}),a.jsx("button",{onClick:()=>c(),className:"w-full bg-white text-black py-3 px-4 hover:bg-[#e5e5e5] transition-colors",children:"Log in"})]})})}const TA=y.forwardRef(({className:e,...t},s)=>a.jsx("div",{ref:s,className:Ee("rounded-xl border bg-card text-card-foreground shadow",e),...t}));TA.displayName="Card";const dq=y.forwardRef(({className:e,...t},s)=>a.jsx("div",{ref:s,className:Ee("flex flex-col space-y-1.5 p-6",e),...t}));dq.displayName="CardHeader";const fq=y.forwardRef(({className:e,...t},s)=>a.jsx("div",{ref:s,className:Ee("font-semibold leading-none tracking-tight",e),...t}));fq.displayName="CardTitle";const hq=y.forwardRef(({className:e,...t},s)=>a.jsx("div",{ref:s,className:Ee("text-sm text-muted-foreground",e),...t}));hq.displayName="CardDescription";const AA=y.forwardRef(({className:e,...t},s)=>a.jsx("div",{ref:s,className:Ee("p-6 pt-0",e),...t}));AA.displayName="CardContent";const mq=y.forwardRef(({className:e,...t},s)=>a.jsx("div",{ref:s,className:Ee("flex items-center p-6 pt-0",e),...t}));mq.displayName="CardFooter";function RA(){return a.jsx("div",{className:"h-full min-h-0 w-full flex items-center justify-center bg-background",children:a.jsx(TA,{className:"w-full max-w-md mx-4",children:a.jsxs(AA,{className:"pt-6",children:[a.jsxs("div",{className:"flex mb-4 gap-2",children:[a.jsx(KO,{className:"h-8 w-8 text-red-500"}),a.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"404 Page Not Found"})]}),a.jsx("p",{className:"mt-4 text-sm text-muted-foreground",children:"Did you forget to add the page to the router?"})]})})})}const kA=y.createContext(null),pq=200,gq=250,xq="cubic-bezier(0.4, 0, 0.2, 1)";function dS(e,t="1"){return{keyframes:e==="out"?[{opacity:t},{opacity:0}]:[{opacity:0},{opacity:1}],duration:e==="out"?pq:gq,easing:xq,fill:e==="out"?"forwards":"both"}}function yq(e,t,s){e.then(()=>{t()&&s()},()=>{})}function vq({children:e}){const[t,s]=zn(),r=y.useRef(null),o=y.useRef(t),c=y.useRef(null),u=y.useRef(!1),f=()=>{c.current?.cancel(),c.current=null};return y.useEffect(()=>()=>f(),[]),y.useLayoutEffect(()=>{if(o.current===t)return;o.current=t,f();const h=r.current;if(h&&(u.current&&(h.focus({preventScroll:!0}),u.current=!1),!(window.matchMedia("(prefers-reduced-motion: reduce)").matches||!h.animate)))try{const m=dS("in");c.current=h.animate(m.keyframes,m)}catch{f()}},[t]),y.useEffect(()=>{const h=p=>{if(p.defaultPrevented||p.button!==0||p.metaKey||p.ctrlKey||p.shiftKey||p.altKey)return;const x=p.target instanceof Element?p.target.closest("a[href]"):null;if(!(x instanceof HTMLAnchorElement)||x.hasAttribute("download")||x.target&&x.target!=="_self"||x.closest("[inert]"))return;const v=new URL(x.href),j="/".replace(/\/$/,"");if(v.origin!==window.location.origin||!["http:","https:"].includes(v.protocol)||j&&!v.pathname.startsWith(`${j}/`))return;const w=v.pathname.slice(j.length)||"/";if(t.startsWith("/admin")||w.startsWith("/admin")||v.pathname===window.location.pathname||!r.current)return;p.preventDefault(),p.stopPropagation();const C=getComputedStyle(r.current).opacity;f(),u.current=p.detail===0;const S=`${w}${v.search}${v.hash}`,N=r.current;if(window.matchMedia("(prefers-reduced-motion: reduce)").matches||!N.animate){s(S);return}try{const E=dS("out",C),R=N.animate(E.keyframes,E);c.current=R,yq(R.finished,()=>c.current===R,()=>{s(S)})}catch{f(),s(S)}},m=window.matchMedia("(prefers-reduced-motion: reduce)");return document.addEventListener("click",h,!0),window.addEventListener("popstate",f),m.addEventListener("change",f),()=>{document.removeEventListener("click",h,!0),window.removeEventListener("popstate",f),m.removeEventListener("change",f)}},[t,s]),a.jsx(kA.Provider,{value:r,children:e})}function MA({children:e}){const t=y.useContext(kA);
63return a.jsx("div",{ref:t,tabIndex:-1,className:"flex-1 min-h-0 flex flex-col outline-none",children:e})}function dp(e){const t=e?.trim();if(t)try{const s=new URL(t);return s.protocol==="http:"||s.protocol==="https:"?s.href:void 0}catch{return}}function bq({open:e,onOpenChange:t,site:s}){const r=s.alreadyAlive?.contact,o=y.useRef(null),c=y.useRef(null);if(y.useEffect(()=>{if(!e)return;const h=document.activeElement instanceof HTMLElement?document.activeElement:null,m=document.body.style,p=m.getPropertyValue("overflow"),x=m.getPropertyPriority("overflow");m.setProperty("overflow","hidden","important"),c.current?.focus();const v=j=>{if(j.key==="Escape"){j.preventDefault(),t(!1);return}if(j.key!=="Tab")return;const w=o.current;if(!w)return;const C=Array.from(w.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')).filter(E=>!E.hasAttribute("hidden")&&E.getAttribute("aria-hidden")!=="true");if(C.length===0){j.preventDefault(),w.focus();return}const S=C[0],N=C[C.length-1];j.shiftKey&&(document.activeElement===S||!w.contains(document.activeElement))?(j.preventDefault(),N.focus()):!j.shiftKey&&(document.activeElement===N||!w.contains(document.activeElement))&&(j.preventDefault(),S.focus())};return document.addEventListener("keydown",v),()=>{document.removeEventListener("keydown",v),p?m.setProperty("overflow",p,x):m.removeProperty("overflow"),h?.isConnected&&h.focus()}},[e,t]),!e)return null;const u=r?.email?.trim(),f=r?[{href:dp(r.instagramUrl),label:"Instagram"},{href:dp(r.vimeoUrl),label:"Vimeo"},{href:dp(r.michaelUrl),label:"michaelmarantz.com"}].filter(h=>!!h.href):[];return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"fixed inset-0 z-50 bg-black/40 backdrop-blur-sm transition-opacity",onClick:()=>t(!1),"aria-hidden":"true"}),a.jsxs("div",{className:"fixed top-0 right-0 bottom-0 z-50 w-full md:w-[480px] bg-[#F7F6F4] text-[#141414] border-l border-black/10 flex flex-col p-8 md:p-12 overflow-y-auto animate-in slide-in-from-right duration-300",role:"dialog","aria-modal":"true","aria-label":"Contact panel",tabIndex:-1,ref:o,children:[a.jsx("button",{ref:c,onClick:()=>t(!1),className:"absolute top-8 right-8 text-[#6E6B66] hover:text-[#141414] transition-colors","aria-label":"Close contact panel",children:a.jsx(Jl,{className:"w-6 h-6"})}),a.jsx("div",{className:"mt-16 flex flex-col gap-12 text-[17px] leading-relaxed",children:r?a.jsxs(a.Fragment,{children:[a.jsxs("section",{children:[a.jsx("h2",{className:"text-[11px] font-mono uppercase tracking-widest text-[#6E6B66] mb-4",children:"Contact"}),u&&a.jsx("a",{href:`mailto:${u}`,className:"text-xl md:text-2xl hover:opacity-70 transition-opacity mb-4 block",children:u})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-[11px] font-mono uppercase tracking-widest text-[#6E6B66] mb-4",children:"Studio"}),a.jsx("p",{children:r.studio})]}),r.representation&&a.jsxs("section",{children:[a.jsx("h2",{className:"text-[11px] font-mono uppercase tracking-widest text-[#6E6B66] mb-4",children:"Commercial Representation"}),a.jsx("p",{children:r.representation})]}),f.length>0&&a.jsx("section",{className:"flex flex-col gap-3",children:f.map(h=>a.jsx("a",{href:h.href,target:"_blank",rel:"noopener noreferrer",className:"hover:opacity-70 w-fit",children:h.label},h.label))})]}):a.jsx("div",{className:"text-muted-foreground",children:"[Contact content placeholder]"})})]})]})}function Ln({href:e,...t}){const s=ho();let r=e;if(e.startsWith("/")&&!e.startsWith("//")){const o=new URLSearchParams(s),c=new URL(e,"https://preview.invalid"),u=window.location.hostname.toLowerCase();(["localhost","127.0.0.1","0.0.0.0"].includes(u)||u.endsWith(".replit.dev"))&&o.get("site")==="alreadyalive"&&c.searchParams.set("site","alreadyalive"),o.get("preview")==="1"&&c.searchParams.set("preview","1"),r=`${c.pathname}${c.search}${c.hash}`}return a.jsx(xt,{...t,href:r})}function wq({site:e,onContactClick:t,isHome:s}){const[r]=zn(),o=c=>c==="/work"&&r.startsWith("/work")||c==="/films"&&r.startsWith("/films")||r===c?"text-[#141414]":"text-[#6E6B66] hover:text-[#141414]";return a.jsxs("nav",{"aria-label":"Main navigation",className:"sticky top-0 z-40 flex flex-wrap items-center justify-between gap-x-4 gap-y-4 px-5 py-5 md:p-8 bg-[#F7F6F4]/95 backdrop-blur-sm text-[#141414] border-b border-black/10",children:[a.jsx(Ln,{href:"/",className:"flex items-center","aria-label":"Already Alive Home",children:a.jsx("img",{src:dy,alt:"Already Alive Wordmark",className:"h-7 md:h-8 w-auto shrink-0 object-contain brightness-0"})}),a.jsxs("div",{className:"flex flex-wrap items-center gap-4 md:gap-8 text-[11px] md:text-[13px] tracking-wide uppercase font-mono",children:[a.jsx(Ln,{href:"/work","aria-current":r.startsWith("/work")?"page":void 0,className:`transition-colors ${o("/work")}`,children:"Work"}),a.jsx(Ln,{href:"/films","aria-current":r.startsWith("/films")?"page":void 0,className:`transition-colors ${o("/films")}`,children:"Films"}),a.jsx(Ln,{href:"/studio","aria-current":r==="/studio"?"page":void 0,className:`transition-colors ${o("/studio")}`,children:"Studio"}),a.jsx("button",{onClick:t,className:"transition-colors hover:text-[#141414] text-[#6E6B66] cursor-pointer uppercase font-mono",children:"Contact"})]})]})}const fp=e=>({transitionDelay:`${e}ms`});function jq({onComplete:e}){const[t,s]=y.useState(!1),[r,o]=y.useState(!1);return y.useEffect(()=>{if(t)return J$(window,()=>o(!0),e)},[t,e]),y.useEffect(()=>{const c=u=>{u.key==="Escape"&&e()};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[e]),a.jsxs("div",{className:"aa-intro",role:"dialog","aria-modal":"true","aria-label":"Already Alive introduction","data-ready":t,"data-leaving":r,style:{"--aa-intro-fade":`${Gr.fade}ms`,"--aa-intro-reveal":`${Gr.reveal}ms`},children:[a.jsxs("div",{className:"aa-intro__copy",children:[a.jsx("p",{className:"aa-intro__element aa-intro__lead",style:fp(Gr.lead),children:_d.lead}),a.jsx("img",{className:"aa-intro__element aa-intro__logo",style:fp(Gr.logo),src:dy,alt:"Already Alive",width:6617,height:3186,fetchPriority:"high",decoding:"async",onLoad:()=>s(!0),onError:()=>{console.error("Already Alive intro logo failed to load."),e()}}),a.jsx("p",{className:"aa-intro__element aa-intro__subtitle",style:fp(Gr.subtitle),children:_d.subtitle})]}),a.jsx("button",{type:"button",className:"aa-intro__skip",onClick:e,autoFocus:!0,children:"Skip intro"})]})}function wg(e){return typeof e=="string"?e.replace(/\[PLACEHOLDER:[^\]]*\]/gi,"").trim():Array.isArray(e)?e.map(t=>wg(t)):e&&typeof e=="object"?Object.fromEntries(Object.entries(e).map(([t,s])=>[t,wg(s)])):e}function jg(e){return e.media?e.media:{source:e.clip?"upload":"still",clip:e.clip,still:e.still||e.thumbnail}}function Sq({site:e}){const t=e.alreadyAlive,s=y.useMemo(()=>z$(e),[t,e.films]),r=y.useMemo(()=>B$(e),[t,e.work]),o=y.useMemo(()=>F$(e),[t,e.work,e.films]),[c,u]=y.useState(0),[f,h]=y.useState(null),[m,p]=y.useState(null),x=o.length?Math.min(c,o.length-1):0,v=o[x];if(y.useEffect(()=>{if(!v||o.length<2)return;const w=window.setTimeout(()=>{h(x),u((x+1)%o.length)},v.duration*1e3);return()=>window.clearTimeout(w)},[v?.key,v?.duration,x,o.length]),y.useEffect(()=>{if(f===null)return;const w=window.setTimeout(()=>h(null),850);return()=>window.clearTimeout(w)},[f,c]),!t)return a.jsx("div",{className:"p-8",children:"Missing homepage content"});const j=(t.clients||[]).filter(w=>w.showOnHomepage).map(w=>w.name);return a.jsxs("div",{className:"flex flex-col w-full pb-20",children:[a.jsxs("section",{className:"relative w-full aspect-[2.39/1] min-h-[220px] bg-[#141414] overflow-hidden",children:[o.map((w,C)=>{const S=C===x,N=C===f;return a.jsx("div",{className:"absolute inset-0 transition-opacity duration-[800ms] motion-reduce:transition-none ease-in-out",style:{opacity:S||N?1:0,zIndex:S?2:N?1:0},children:a.jsx(Hi,{media:jg(w),active:S||N,preload:C===(x+1)%o.length,alt:w.title,allowTouchPlayback:!0})},w.key)}),v&&a.jsx(Ln,{href:v.href,className:"absolute inset-0 z-10","aria-label":`${v.client} ${v.title}`,children:a.jsxs("span",{className:"absolute bottom-5 left-6 md:bottom-8 md:left-8 text-white text-[15px] leading-tight drop-shadow",children:[a.jsx("span",{className:"block text-[17px]",children:v.client||v.title}),v.client&&a.jsx("span",{className:"block text-[13px] text-white/75 mt-1",children:v.title})]})})]}),a.jsxs("section",{className:"px-6 md:px-12 pt-12",children:[a.jsx("p",{className:`text-[15px] md:text-[17px] leading-relaxed text-[#6E6B66] ${r.length?"mb-8":""}`,children:"An independent production studio for films and brands."}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 gap-x-6 gap-y-10",children:r.map(w=>a.jsxs(Ln,{href:w.href,className:"group block",onMouseEnter:()=>p(w.key),onMouseLeave:()=>p(null),onFocus:()=>p(w.key),onBlur:()=>p(null),children:[a.jsx("div",{className:"relative aspect-[2.39/1] bg-[#EBEAE8] overflow-hidden",children:a.jsx(Hi,{media:jg(w),active:m===w.key,alt:w.title})}),a.jsx("div",{className:"mt-3 text-[15px] leading-tight",children:w.
63client||w.title}),w.client&&a.jsx("div",{className:"mt-1 text-[13px] text-[#6E6B66]",children:w.title})]},w.key))}),a.jsx("div",{className:"mt-10 text-[13px]",children:a.jsx(Ln,{href:"/work",className:"text-[#6E6B66] hover:text-[#141414]",children:"All work"})})]}),s.length>0&&a.jsxs("section",{className:"px-6 md:px-12 pt-14 flex flex-col md:flex-row gap-x-12 gap-y-3 text-[15px]",children:[a.jsx(Ln,{href:"/films",className:"text-[#6E6B66] hover:text-[#141414] w-24 shrink-0",children:"Films"}),a.jsx("div",{className:"flex flex-wrap gap-x-8 gap-y-2",children:s.map(w=>a.jsx(Ln,{href:`/films/${w.slug}`,children:w.title},w.canonicalFilmId))})]}),j.length>0&&a.jsx("section",{className:"px-6 md:px-12 pt-10 text-[13px] leading-relaxed text-[#6E6B66] max-w-4xl",children:j.join(", ")})]})}function Nq({site:e}){const t=y.useMemo(()=>V$(e),[e]),[s,r]=y.useState("All"),[o,c]=y.useState("grid"),[u,f]=y.useState(null),h=MT(),m=y.useMemo(()=>{const v=new Set;return t.forEach(j=>{j.type&&v.add(j.type)}),["All",...Array.from(v)]},[t]),p=y.useMemo(()=>s==="All"?t:t.filter(v=>v.type===s),[t,s]),x=v=>`transition-colors ${v?"text-[#141414]":"text-[#6E6B66] hover:text-[#141414]"}`;return a.jsxs("div",{className:"flex flex-col w-full px-6 md:px-12 pb-24 text-[15px]",children:[a.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between mt-8 mb-8 gap-4",children:[a.jsx("nav",{className:"flex flex-wrap gap-x-6 gap-y-2","aria-label":"Work filters",children:m.map(v=>a.jsx("button",{onClick:()=>{r(v),f(null)},"aria-pressed":s===v,className:x(s===v),children:v},v))}),a.jsxs("div",{className:"flex gap-6",role:"group","aria-label":"Work view",children:[a.jsx("button",{onClick:()=>{c("list"),f(null)},"aria-pressed":o==="list",className:x(o==="list"),children:"List"}),a.jsx("button",{onClick:()=>{c("grid"),f(null)},"aria-pressed":o==="grid",className:x(o==="grid"),children:"Grid"})]})]}),a.jsx(az,{mode:"wait",initial:!1,children:a.jsxs(Ol.div,{initial:{opacity:h?1:0},animate:{opacity:1},exit:{opacity:h?1:0},transition:{duration:h?0:.2},children:[o==="grid"?a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 gap-x-6 gap-y-10",children:p.map(v=>a.jsxs(Ln,{href:`/work/${v.slug}`,className:"group block",onMouseEnter:()=>f(v.id),onMouseLeave:()=>f(null),onFocus:()=>f(v.id),onBlur:()=>f(null),children:[a.jsx("div",{className:"relative aspect-[2.39/1] bg-[#EBEAE8] overflow-hidden",children:a.jsx(Hi,{media:jg(v),active:u===v.id,alt:v.title,className:"transition-all duration-500 group-hover:brightness-110"})}),a.jsx("div",{className:"mt-3 leading-tight",children:v.client||v.title}),v.client&&a.jsx("div",{className:"mt-1 text-[13px] text-[#6E6B66]",children:v.title})]},v.id))}):a.jsx("div",{className:"flex flex-col",children:p.map(v=>a.jsxs(Ln,{href:`/work/${v.slug}`,className:"flex flex-col sm:flex-row sm:items-center py-3",children:[a.jsx("span",{className:"sm:w-1/3",children:v.client||v.title}),a.jsx("span",{className:"sm:w-1/3 text-[#6E6B66]",children:v.title}),a.jsx("span",{className:"sm:w-1/6 text-[#6E6B66]",children:v.year}),a.jsx("span",{className:"sm:w-1/6 text-[#6E6B66]",children:v.type})]},v.id))}),p.length===0&&a.jsx("div",{className:"py-12 text-[#6E6B66]",children:"No projects found for this filter."})]},`${o}:${s}`)})]})}function Xl({src:e,fallback:t=null,onError:s,...r}){const[o,c]=y.useState(null);return!e||o===e?t?a.jsx(a.Fragment,{children:t}):null:a.jsx("img",{...r,src:BC(e),onError:u=>{s?.(u),c(e)}})}function Cq({site:e}){const[,t]=Qi("/work/:slug"),s=t?.slug,r=e.alreadyAlive?.projects?.filter(p=>p.published&&p.showOnAlreadyAlive!==!1)||[],o=r.find(p=>p.slug===s),c=r;if(!o)return a.jsx("div",{className:"p-8",children:"Project not found"});const u=o.vimeoUrl?xd(o.vimeoUrl)?.embedUrl:null,f=c.filter(p=>p.type===o.type),h=f.findIndex(p=>p.id===o.id),m=h!==-1&&h<f.length-1?f[h+1]:f[0];return a.jsxs("div",{className:"flex flex-col w-full pb-32",children:[a.jsx("section",{className:"w-full aspect-video bg-black",children:u?a.jsx("iframe",{src:u,title:`${o.client} — ${o.title} film`,className:"w-full h-full",frameBorder:"0",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0}):a.jsx("div",{className:"w-full h-full flex items-center justify-center text-[#6E6B66] bg-[#222]",children:"Video unavailable"})}),a.jsxs("div",{className:"px-6 md:px-12 max-w-5xl",children:[a.jsxs("section",{className:"mt-12 md:mt-16 mb-24",children:[a.jsx("h1",{className:"text-4xl md:text-5xl lg:text-6xl tracking-tight mb-4",children:o.client}),a.jsxs("p",{className:"text-xl md:text-2xl text-[#6E6B66]",children:[o.title," ",a.jsx("span",{className:"opacity-50 mx-2",children:"—"})," ",o.year]}
63)]}),o.brief&&a.jsxs("section",{className:"mb-24",children:[a.jsx("h2",{className:"text-[11px] font-mono uppercase tracking-widest text-[#6E6B66] mb-6 border-b border-[rgba(20,20,20,0.1)] pb-4",children:"The Brief"}),a.jsx("p",{className:"text-xl md:text-2xl leading-relaxed",children:o.brief})]}),o.whatWeDid&&o.whatWeDid.length>0&&a.jsxs("section",{className:"mb-24",children:[a.jsx("h2",{className:"text-[11px] font-mono uppercase tracking-widest text-[#6E6B66] mb-6 border-b border-[rgba(20,20,20,0.1)] pb-4",children:"What We Did"}),a.jsx("div",{className:"flex flex-col gap-6",children:o.whatWeDid.map((p,x)=>a.jsxs("div",{className:"flex flex-col md:flex-row gap-2 md:gap-8",children:[a.jsx("span",{className:"md:w-48 text-[#6E6B66]",children:p.stage}),a.jsx("span",{className:"flex-1 text-[17px]",children:p.description})]},x))})]}),o.results&&o.results.length>0&&a.jsxs("section",{className:"mb-24",children:[a.jsx("h2",{className:"text-[11px] font-mono uppercase tracking-widest text-[#6E6B66] mb-6 border-b border-[rgba(20,20,20,0.1)] pb-4",children:"Results"}),a.jsx("div",{className:"flex flex-col gap-4 text-[17px]",children:o.results.map((p,x)=>a.jsx("div",{children:p},x))})]}),o.testimonial?.quote&&a.jsxs("section",{className:"mb-24",children:[a.jsxs("blockquote",{className:"text-2xl md:text-3xl leading-relaxed mb-8",children:['"',o.testimonial.quote,'"']}),a.jsxs("p",{className:"text-[15px]",children:[o.testimonial.name,a.jsx("br",{}),a.jsx("span",{className:"text-[#6E6B66]",children:o.testimonial.title})]})]})]}),o.stills&&o.stills.length>0&&a.jsx("section",{className:"w-full mb-24 px-6 md:px-12",children:a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:o.stills.map((p,x)=>a.jsx(Xl,{src:p,alt:`Still ${x+1}`,className:"w-full h-auto bg-[#EBEAE8]"},`${x}-${p}`))})}),a.jsxs("div",{className:"px-6 md:px-12 max-w-5xl",children:[o.deliverables&&a.jsx("section",{className:"mb-16",children:a.jsx("p",{className:"text-[#6E6B66] text-[17px]",children:o.deliverables})}),o.credits&&o.credits.length>0&&a.jsxs("section",{className:"mb-32",children:[a.jsx("h2",{className:"text-[11px] font-mono uppercase tracking-widest text-[#6E6B66] mb-6 border-b border-[rgba(20,20,20,0.1)] pb-4",children:"Credits"}),a.jsx("div",{className:"flex flex-col gap-3 text-[15px]",children:o.credits.map((p,x)=>a.jsxs("div",{className:"flex gap-4",children:[a.jsx("span",{className:"w-32 text-[#6E6B66]",children:p.role}),a.jsx("span",{children:p.name})]},x))})]}),m&&m.id!==o.id&&a.jsxs("section",{className:"border-t border-[rgba(20,20,20,0.1)] pt-12",children:[a.jsx("p",{className:"text-[11px] font-mono uppercase tracking-widest text-[#6E6B66] mb-4",children:"Next Project"}),a.jsx(Ln,{href:`/work/${m.slug}`,children:a.jsxs("div",{className:"cursor-pointer group block",children:[a.jsx("h3",{className:"text-3xl group-hover:opacity-70 transition-opacity mb-2",children:m.client}),a.jsx("p",{className:"text-[#6E6B66]",children:m.title})]})})]})]})]})}function Eq({site:e}){const s=e.alreadyAlive?.films?.filter(r=>r.published)||[];return a.jsxs("div",{className:"flex flex-col w-full px-6 md:px-12 pb-32 max-w-5xl",children:[a.jsx("div",{className:"mt-12 md:mt-24 mb-24 md:mb-32",children:a.jsx("p",{className:"text-xl md:text-2xl leading-relaxed",children:"Already Alive is a narrative company as much as a commercial one. The shorts and features we make on our own are where the craft gets sharpened — and they're the reason brand work made here doesn't look like brand work."})}),a.jsx("div",{className:"flex flex-col gap-24 md:gap-32",children:s.map((r,o)=>a.jsx(Ln,{href:`/films/${r.slug}`,children:a.jsxs("div",{className:"group cursor-pointer flex flex-col md:flex-row gap-8 md:gap-16",children:[a.jsx("div",{className:"w-full md:w-[40%]",children:a.jsx("div",{className:"aspect-[2/3] w-full bg-[#EBEAE8] overflow-hidden",children:a.jsx(Xl,{src:r.poster,alt:r.title,className:"w-full h-full object-cover transition-transform duration-700 group-hover:scale-105",fallback:a.jsx("div",{className:"w-full h-full flex items-center justify-center px-6 text-center text-[#6E6B66]",children:a.jsx("span",{className:"text-xl md:text-2xl",children:r.title})})})})}),a.jsxs("div",{className:"w-full md:w-[60%] flex flex-col justify-center",children:[a.jsx("h2",{className:"text-3xl md:text-4xl lg:text-5xl tracking-tight mb-4 group-hover:opacity-70 transition-opacity",children:r.title}),a.jsx("div",{className:"text-[15px] font-mono uppercase tracking-widest text-[#6E6B66] mb-8",children:r.status}),a.jsx("p",{className:"text-[17px] leading-relaxed",children:r.logline})]})]})},r.slug))})]})}function Tq({site:e}){const[,t]=Qi("/films/:slug"),s=t?.slug,o=(e.alreadyAlive?.films?.filter(h=>h.published)||[]).find(h=>h.slug===s);if(!o)return a.jsx("div",{className:"p-8",children:"Film not found"});
63const c=e.films.find(h=>h.id===o.canonicalFilmId)?.slug||o.slug,u=o.showTrailer&&o.trailerUrl?xd(o.trailerUrl)?.embedUrl:null,f=o.poster||o.stills?.[0];return a.jsxs("div",{className:"flex flex-col w-full max-w-[1100px] mx-auto px-6 md:px-12 pt-8 md:pt-12 pb-24",children:[a.jsxs("section",{className:"grid grid-cols-1 md:grid-cols-[280px_minmax(0,1fr)] gap-8 md:gap-12 items-start mb-16",children:[f&&a.jsx("div",{className:"w-full max-w-[220px] md:max-w-[280px] mx-auto md:mx-0 flex justify-center",children:a.jsx(Xl,{src:f,alt:o.poster?`Poster for ${o.title}`:`Still from ${o.title}`,className:"block w-auto h-auto max-w-full max-h-[420px] object-contain",fallback:a.jsx("div",{className:"w-full aspect-[2/3] flex items-center justify-center px-6 text-center text-[#6E6B66] bg-[#EBEAE8]",children:"Poster unavailable"})})}),a.jsxs("div",{className:f?"":"md:col-span-2",children:[a.jsx("h1",{className:"text-3xl md:text-4xl tracking-tight mb-4",children:o.title}),a.jsx("p",{className:"text-[11px] font-mono uppercase tracking-widest text-[#6E6B66] mb-6",children:o.status}),a.jsx("p",{className:"text-[17px] leading-relaxed max-w-2xl",children:o.logline})]})]}),a.jsxs("div",{children:[u&&a.jsx("section",{className:"w-full aspect-video bg-[#141414] mb-16",children:a.jsx("iframe",{src:u,title:`${o.title} trailer`,className:"w-full h-full",frameBorder:"0",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0})}),o.stills&&o.stills.length>0&&a.jsx("section",{className:"w-full mb-16",children:a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 w-full",children:o.stills.map((h,m)=>a.jsx(Xl,{src:h,alt:`Still ${m+1}`,className:"w-full h-auto bg-[#EBEAE8]"},`${m}-${h}`))})}),o.credits&&o.credits.length>0&&a.jsxs("section",{className:"mb-24 border-t border-[rgba(20,20,20,0.1)] pt-12",children:[a.jsx("h2",{className:"text-[11px] font-mono uppercase tracking-widest text-[#6E6B66] mb-8",children:"Credits"}),a.jsxs("div",{className:"flex flex-col gap-3 text-[15px]",children:[o.credits.map((h,m)=>a.jsxs("div",{className:"flex gap-4",children:[a.jsx("span",{className:"w-32 text-[#6E6B66]",children:h.role}),a.jsx("span",{children:h.name})]},m)),a.jsxs("div",{className:"flex gap-4 mt-6",children:[a.jsx("span",{className:"w-32 text-[#6E6B66]",children:"Production"}),a.jsx("span",{children:"Produced by Already Alive"})]})]})]}),a.jsx("section",{className:"border-t border-[rgba(20,20,20,0.1)] pt-12",children:a.jsxs("p",{className:"text-[#6E6B66] text-[15px]",children:["Directed by ",a.jsx("a",{href:`https://michaelmarantz.com/films/${c}`,target:"_blank",rel:"noopener noreferrer",className:"text-[#141414] hover:opacity-70 transition-opacity border-b border-[#141414] pb-0.5",children:"Michael Marantz"})]})})]})]})}const Hr=e=>(e||"").replace(/\[PLACEHOLDER:[^\]]*\]/gi,"").trim();function Aq({site:e}){const t=e.alreadyAlive,s=t?.studio,r=t?.clients?.filter(x=>x.showOnStudio)||[];if(!s)return a.jsx("div",{className:"p-8",children:"Studio content not found"});const o=s.whatWeDo?.filter(x=>Hr(x.name))||[],c=Hr(s.howWeWork),u=c.startsWith("There's one person accountable from the first call")?"Development, direction, production and original music.":c,f=Hr(s.who),h=Hr(s.where),m=Hr(s.closing),p=t?.contact?.email?.trim();return a.jsx("div",{className:"flex flex-col w-full px-6 md:px-12 pb-32 max-w-4xl mx-auto",children:a.jsxs("div",{className:"mt-12 md:mt-24 mb-14",children:[o.length>0&&a.jsxs("section",{className:"mb-14",children:[a.jsx("h2",{className:"text-[13px] text-[#6E6B66] mb-6",children:"What We Do"}),a.jsx("div",{className:"flex flex-col gap-12",children:o.map((x,v)=>a.jsxs("div",{children:[a.jsx("h3",{className:"text-xl md:text-2xl mb-4",children:Hr(x.name)}),Hr(x.description)&&a.jsx("p",{className:"text-[17px] leading-relaxed text-[#6E6B66] max-w-2xl",children:Hr(x.description)})]},v))})]}),u&&a.jsxs("section",{className:"mb-14",children:[a.jsx("h2",{className:"text-[13px] text-[#6E6B66] mb-6",children:"How We Work"}),a.jsx("p",{className:"text-[17px] leading-relaxed max-w-3xl",children:u})]}),(f||s.headshot)&&a.jsxs("section",{className:"mb-14",children:[a.jsx("h2",{className:"text-[13px] text-[#6E6B66] mb-6",children:"Who"}),a.jsxs("div",{className:"flex flex-col md:flex-row gap-12 md:gap-16",children:[s.headsh
63ot&&a.jsx("div",{className:"w-full md:w-1/3",children:a.jsx("div",{className:"aspect-[3/4] w-full bg-[#EBEAE8] overflow-hidden",children:a.jsx(Xl,{src:s.headshot,alt:"Michael Marantz",className:"w-full h-full object-cover"})})}),f&&a.jsx("div",{className:`${s.headshot?"md:w-2/3":""} w-full flex flex-col justify-center`,children:a.jsx("p",{className:"text-[17px] leading-relaxed text-[#141414] whitespace-pre-wrap",children:f})})]})]}),h&&a.jsxs("section",{className:"mb-14",children:[a.jsx("h2",{className:"text-[13px] text-[#6E6B66] mb-6",children:"Where"}),a.jsx("p",{className:"text-[17px] leading-relaxed max-w-2xl",children:h})]}),r.length>0&&a.jsxs("section",{className:"mb-14",children:[a.jsx("h2",{className:"text-[13px] text-[#6E6B66] mb-6",children:"Selected Clients"}),a.jsx("div",{className:"text-[17px] leading-loose text-[#6E6B66]",children:r.map(x=>x.name).join(" • ")})]}),(m||p)&&a.jsxs("section",{className:"border-t border-[rgba(20,20,20,0.1)] pt-10",children:[m&&a.jsx("p",{className:"text-[17px] leading-relaxed mb-8",children:m}),p&&a.jsx("a",{href:`mailto:${p}`,className:"inline-block text-[11px] font-mono uppercase tracking-widest text-[#141414] hover:opacity-70 transition-opacity border-b border-[#141414] pb-1",children:"Contact"})]})]})})}function Rq({site:e,isLoading:t,error:s,isPreview:r}){const o=y.useMemo(()=>e&&{...e,alreadyAlive:wg(e.alreadyAlive)},[e]),[c]=zn(),u=ho(),f=new URLSearchParams(u),[h,m]=y.useState(!1),[p,x]=y.useState(()=>{if(c!=="/"||f.get("intro")==="skip"||typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return!1;if(f.get("intro")==="replay")return!0;try{return!sessionStorage.getItem("hasSeenAAIntro")}catch{return!0}}),v=f.get("intro")==="skip",j=y.useCallback(()=>x(!1),[]);return y.useLayoutEffect(()=>{window.scrollTo({top:0,left:0,behavior:"instant"}),m(!1)},[c]),y.useEffect(()=>{if(c!=="/"||v)x(!1);else if(p&&!t)try{sessionStorage.setItem("hasSeenAAIntro","true")}catch{}},[c,v,p,t]),t?a.jsx("div",{className:"min-h-screen bg-[#F7F6F4] flex items-center justify-center",children:a.jsx(Ue,{className:"w-4 h-4 text-[#141414] animate-spin"})}):s||!o?a.jsx("div",{className:"min-h-screen bg-[#F7F6F4] flex items-center justify-center text-[#141414] text-sm font-sans",children:"Error loading site data."}):a.jsxs("div",{"data-brand":"alreadyalive",className:"already-alive-shell relative min-h-[100dvh] bg-[#F7F6F4] text-[#141414] font-sans",children:[a.jsx("a",{href:"#alreadyalive-content",className:"sr-only focus:not-sr-only focus:fixed focus:top-2 focus:left-2 focus:z-[100] focus:bg-white focus:p-3",children:"Skip to content"}),p&&o.alreadyAlive&&a.jsx(jq,{onComplete:j}),a.jsxs("div",{className:"w-full min-h-[100dvh] flex flex-col transition-opacity",style:{transitionDuration:`${Gr.handoff}ms`,pointerEvents:p?"none":"auto",opacity:p?0:1},inert:p?!0:void 0,"aria-hidden":p?"true":void 0,children:[a.jsx(wq,{site:o,onContactClick:()=>m(!0),isHome:c==="/"}),a.jsx("main",{id:"alreadyalive-content",tabIndex:-1,className:"flex-1 flex flex-col outline-none",children:a.jsx(MA,{children:a.jsxs(md,{children:[a.jsx(Se,{path:"/",children:a.jsx(Sq,{site:o})}),a.jsx(Se,{path:"/work",children:a.jsx(Nq,{site:o})}),a.jsx(Se,{path:"/work/:slug",children:a.jsx(Cq,{site:o})}),a.jsx(Se,{path:"/films",children:a.jsx(Eq,{site:o})}),a.jsx(Se,{path:"/films/:slug",children:a.jsx(Tq,{site:o})}),a.jsx(Se,{path:"/studio",children:a.jsx(Aq,{site:o})}),a.jsx(Se,{path:"/newsletter/confirm/:token",component:d2}),a.jsx(Se,{path:"/newsletter/unsubscribe/:token",component:f2}),a.jsx(Se,{component:RA})]})})}),a.jsx(bq,{open:h,onOpenChange:m,site:o})]})]})}function kq(){const{isAuthenticated:e,isLoading:t}=Jg(),s=ho(),r=new URLSearchParams(s),o=r.get("preview")==="1"&&e,c=mt(),u=Zd();y.useEffect(()=>(document.title=u.title,document.body.dataset.brand=c,document.body.classList.toggle("already-alive-site",c==="alreadyalive"),()=>{delete document.body.dataset.brand,document.body.classList.remove("already-alive-site")}),[u.title,c]);const f=tx({site:c},{query:{enabled:!o,queryKey:ex({site:c})}}),h=Os({site:c},{query:{enabled:o,queryKey:cr({site:c})}}),m=Os({site:"alreadyalive"},{query:{enabled:o&&c==="michael",queryKey:cr({site:"alreadyalive"})}}),p=y.useMemo(()=>
63{if(!o)return f.data;const I=h.data;if(!I||c!=="michael"||!m.data)return I;const V=new Set(I.work.map(k=>k.id)),H=(m.data.alreadyAlive?.projects||[]).filter(k=>k.published&&k.showOnMichael===!0&&!V.has(k.id)).map(k=>({id:k.id,title:k.title,slug:k.slug,type:k.type,year:k.year,published:k.published,order:k.order,still:k.still,vimeoUrl:k.vimeoUrl,client:k.client,logline:k.brief,keyCredits:k.credits,showOnMichael:!0,showOnAlreadyAlive:!1}));return{...I,work:[...I.work,...H]}},[o,c,f.data,h.data,m.data]),x=(o?h.isLoading||c==="michael"&&m.isLoading:f.isLoading)||t,v=o?h.error||c==="michael"&&m.error:f.error,[j]=zn(),[w,C]=y.useState(!1),S=j.startsWith("/admin"),[N,E]=y.useState(()=>{try{const I=localStorage.getItem("portfolio-theme");return I==="light"||I==="dark"?I:null}catch{return null}}),R=N??(p?.settings.theme==="light"?"light":"dark"),D=I=>{E(I);try{localStorage.setItem("portfolio-theme",I)}catch{}};y.useEffect(()=>{const I=V=>{(V.key==="portfolio-theme"||V.key===null)&&E(V.newValue==="light"||V.newValue==="dark"?V.newValue:null)};return window.addEventListener("storage",I),()=>window.removeEventListener("storage",I)},[]);const[A,_]=y.useState(()=>{if(j!=="/"||r.get("intro")==="skip"||window.matchMedia("(prefers-reduced-motion: reduce)").matches)return!1;try{return!sessionStorage.getItem("hasSeenIntro")}catch{return!0}}),F=r.get("intro")==="skip";if(y.useEffect(()=>{if(S||j!=="/"||F)_(!1);else if(A&&!x)try{sessionStorage.setItem("hasSeenIntro","true")}catch{}},[j,S,F,A,x]),y.useLayoutEffect(()=>{if(!x||v||S){document.documentElement.classList.remove("app-booting");const I=window;window.clearTimeout(I.__portfolioBootTimeout),I.__portfolioBootReady?.()}},[x,v,S]),S)return a.jsx(uq,{});if(c==="alreadyalive")return a.jsx(Rq,{site:p,isLoading:x,error:v,isPreview:o});if(x)return a.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:a.jsx(Ue,{className:"w-4 h-4 text-foreground animate-spin"})});if(v||!p)return a.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center text-foreground text-sm",children:"Error loading site data."});const{settings:O}=p;return a.jsxs("div",{"data-brand":c,className:`public-shell fixed inset-0 h-[100dvh] overflow-hidden bg-background text-foreground font-sans ${R} brand-${c}`,style:{colorScheme:R},children:[A&&c==="michael"?a.jsx(I_,{onComplete:()=>_(!1),settings:O}):null,a.jsxs("div",{className:"w-full h-full min-h-0 flex flex-col overflow-hidden",style:{pointerEvents:A?"none":"auto"},inert:A,"aria-hidden":A?"true":void 0,children:[a.jsx(U_,{settings:O,onContactClick:()=>C(!0),isHome:j==="/",introActive:A&&c==="michael"}),a.jsx("main",{className:`flex-1 min-h-0 flex flex-col overflow-hidden ${j==="/"?"":"pt-[80px] pb-[calc(44px+env(safe-area-inset-bottom,0px))]"}`,children:a.jsx(MA,{children:a.jsxs(md,{children:[a.jsx(Se,{path:"/",children:a.jsx(o6,{site:p,introActive:A})}),a.jsx(Se,{path:"/films/:slug",component:bF}),a.jsx(Se,{path:"/work",children:a.jsx(EF,{site:p})}),a.jsx(Se,{path:"/work/:slug",component:TF}),a.jsx(Se,{path:"/about",children:a.jsx(FV,{site:p})}),a.jsx(Se,{path:"/newsletter/confirm/:token",component:d2}),a.jsx(Se,{path:"/newsletter/unsubscribe/:token",component:f2}),a.jsx(Se,{component:RA})]})})}),a.jsx(z_,{theme:R,onChange:D}),a.jsx(L_,{open:w,onOpenChange:C,settings:O})]})]})}const Mq=new S3({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});function Oq({children:e}){const[t]=zn();return a.jsx(NS,{resetKey:t,children:e})}function Dq(){return a.jsx(Xk,{client:Mq,children:a.jsxs(kP,{children:[a.jsx(jC,{base:"/".replace(/\/$/,""),children:a.jsx(D_,{children:a.jsx(vq,{children:a.jsx(Oq,{children:a.jsx(kq,{})})})})}),a.jsx(KD,{})]})})}Wk.createRoot(document.getElementById("root"),{onCaughtError:(e,t)=>{console.error(e,t.componentStack)}}).render(a.jsx(NS,{children:a.jsx(Dq,{})}));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.