easel-canvas 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,66 @@
1
+ var gb=Object.defineProperty;var pb=(l,c,u)=>c in l?gb(l,c,{enumerable:!0,configurable:!0,writable:!0,value:u}):l[c]=u;var Sp=(l,c,u)=>pb(l,typeof c!="symbol"?c+"":c,u);(function(){const c=document.createElement("link").relList;if(c&&c.supports&&c.supports("modulepreload"))return;for(const h of document.querySelectorAll('link[rel="modulepreload"]'))f(h);new MutationObserver(h=>{for(const p of h)if(p.type==="childList")for(const v of p.addedNodes)v.tagName==="LINK"&&v.rel==="modulepreload"&&f(v)}).observe(document,{childList:!0,subtree:!0});function u(h){const p={};return h.integrity&&(p.integrity=h.integrity),h.referrerPolicy&&(p.referrerPolicy=h.referrerPolicy),h.crossOrigin==="use-credentials"?p.credentials="include":h.crossOrigin==="anonymous"?p.credentials="omit":p.credentials="same-origin",p}function f(h){if(h.ep)return;h.ep=!0;const p=u(h);fetch(h.href,p)}})();var jf={exports:{}},tc={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Np;function yb(){if(Np)return tc;Np=1;var l=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function u(f,h,p){var v=null;if(p!==void 0&&(v=""+p),h.key!==void 0&&(v=""+h.key),"key"in h){p={};for(var C in h)C!=="key"&&(p[C]=h[C])}else p=h;return h=p.ref,{$$typeof:l,type:f,key:v,ref:h!==void 0?h:null,props:p}}return tc.Fragment=c,tc.jsx=u,tc.jsxs=u,tc}var Tp;function vb(){return Tp||(Tp=1,jf.exports=yb()),jf.exports}var s=vb(),Sf={exports:{}},Be={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Cp;function bb(){if(Cp)return Be;Cp=1;var l=Symbol.for("react.transitional.element"),c=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),p=Symbol.for("react.consumer"),v=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),T=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),k=Symbol.for("react.view_transition"),R=Symbol.iterator;function B(U){return U===null||typeof U!="object"?null:(U=R&&U[R]||U["@@iterator"],typeof U=="function"?U:null)}var X={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,_={};function W(U,E,Y){this.props=U,this.context=E,this.refs=_,this.updater=Y||X}W.prototype.isReactComponent={},W.prototype.setState=function(U,E){if(typeof U!="object"&&typeof U!="function"&&U!=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,U,E,"setState")},W.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function ne(){}ne.prototype=W.prototype;function J(U,E,Y){this.props=U,this.context=E,this.refs=_,this.updater=Y||X}var ce=J.prototype=new ne;ce.constructor=J,N(ce,W.prototype),ce.isPureReactComponent=!0;var le=Array.isArray;function oe(){}var F={H:null,A:null,T:null,S:null},re=Object.prototype.hasOwnProperty;function we(U,E,Y){var A=Y.ref;return{$$typeof:l,type:U,key:E,ref:A!==void 0?A:null,props:Y}}function Te(U,E){return we(U.type,E,U.props)}function st(U){return typeof U=="object"&&U!==null&&U.$$typeof===l}function Ot(U){var E={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(Y){return E[Y]})}var Dt=/\/+/g;function tt(U,E){return typeof U=="object"&&U!==null&&U.key!=null?Ot(""+U.key):E.toString(36)}function ue(U){switch(U.status){case"fulfilled":return U.value;case"rejected":throw U.reason;default:switch(typeof U.status=="string"?U.then(oe,oe):(U.status="pending",U.then(function(E){U.status==="pending"&&(U.status="fulfilled",U.value=E)},function(E){U.status==="pending"&&(U.status="rejected",U.reason=E)})),U.status){case"fulfilled":return U.value;case"rejected":throw U.reason}}throw U}function me(U,E,Y,A,ie){var se=typeof U;(se==="undefined"||se==="boolean")&&(U=null);var ge=!1;if(U===null)ge=!0;else switch(se){case"bigint":case"string":case"number":ge=!0;break;case"object":switch(U.$$typeof){case l:case c:ge=!0;break;case y:return ge=U._init,me(ge(U._payload),E,Y,A,ie)}}if(ge)return ie=ie(U),ge=A===""?"."+tt(U,0):A,le(ie)?(Y="",ge!=null&&(Y=ge.replace(Dt,"$&/")+"/"),me(ie,E,Y,"",function(Ae){return Ae})):ie!=null&&(st(ie)&&(ie=Te(ie,Y+(ie.key==null||U&&U.key===ie.key?"":(""+ie.key).replace(Dt,"$&/")+"/")+ge)),E.push(ie)),1;ge=0;var ae=A===""?".":A+":";if(le(U))for(var de=0;de<U.length;de++)A=U[de],se=ae+tt(A,de),ge+=me(A,E,Y,se,ie);else if(de=B(U),typeof de=="function")for(U=de.call(U),de=0;!(A=U.next()).done;)A=A.value,se=ae+tt(A,de++),ge+=me(A,E,Y,se,ie);else if(se==="object"){if(typeof U.then=="function")return me(ue(U),E,Y,A,ie);throw E=String(U),Error("Objects are not valid as a React child (found: "+(E==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":E)+"). If you meant to render a collection of children, use an array instead.")}return ge}function be(U,E,Y){if(U==null)return U;var A=[],ie=0;return me(U,A,"","",function(se){return E.call(Y,se,ie++)}),A}function je(U){if(U._status===-1){var E=U._result,Y=E();Y.then(function(A){(U._status===0||U._status===-1)&&(U._status=1,U._result=A,Y.status===void 0&&(Y.status="fulfilled",Y.value=A))},function(A){(U._status===0||U._status===-1)&&(U._status=2,U._result=A,Y.status===void 0&&(Y.status="rejected",Y.reason=A))}),U._status===-1&&(U._status=0,U._result=Y)}if(U._status===1)return U._result.default;throw U._result}var Ce=typeof reportError=="function"?reportError:function(U){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var E=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof U=="object"&&U!==null&&typeof U.message=="string"?String(U.message):String(U),error:U});if(!window.dispatchEvent(E))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",U);return}console.error(U)};function ot(U){var E=F.T,Y={};Y.types=E!==null?E.types:null,F.T=Y;try{var A=U(),ie=F.S;ie!==null&&ie(Y,A),typeof A=="object"&&A!==null&&typeof A.then=="function"&&A.then(oe,Ce)}catch(se){Ce(se)}finally{E!==null&&Y.types!==null&&(E.types=Y.types),F.T=E}}function Et(U){var E=F.T;if(E!==null){var Y=E.types;Y===null?E.types=[U]:Y.indexOf(U)===-1&&Y.push(U)}else ot(Et.bind(null,U))}var Me={map:be,forEach:function(U,E,Y){be(U,function(){E.apply(this,arguments)},Y)},count:function(U){var E=0;return be(U,function(){E++}),E},toArray:function(U){return be(U,function(E){return E})||[]},only:function(U){if(!st(U))throw Error("React.Children.only expected to receive a single React element child.");return U}};return Be.Activity=b,Be.Children=Me,Be.Component=W,Be.Fragment=u,Be.Profiler=h,Be.PureComponent=J,Be.StrictMode=f,Be.Suspense=S,Be.ViewTransition=k,Be.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=F,Be.__COMPILER_RUNTIME={__proto__:null,c:function(U){return F.H.useMemoCache(U)}},Be.addTransitionType=Et,Be.cache=function(U){return function(){return U.apply(null,arguments)}},Be.cacheSignal=function(){return null},Be.cloneElement=function(U,E,Y){if(U==null)throw Error("The argument must be a React element, but you passed "+U+".");var A=N({},U.props),ie=U.key;if(E!=null)for(se in E.key!==void 0&&(ie=""+E.key),E)!re.call(E,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&E.ref===void 0||(A[se]=E[se]);var se=arguments.length-2;if(se===1)A.children=Y;else if(1<se){for(var ge=Array(se),ae=0;ae<se;ae++)ge[ae]=arguments[ae+2];A.children=ge}return we(U.type,ie,A)},Be.createContext=function(U){return U={$$typeof:v,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null},U.Provider=U,U.Consumer={$$typeof:p,_context:U},U},Be.createElement=function(U,E,Y){var A,ie={},se=null;if(E!=null)for(A in E.key!==void 0&&(se=""+E.key),E)re.call(E,A)&&A!=="key"&&A!=="__self"&&A!=="__source"&&(ie[A]=E[A]);var ge=arguments.length-2;if(ge===1)ie.children=Y;else if(1<ge){for(var ae=Array(ge),de=0;de<ge;de++)ae[de]=arguments[de+2];ie.children=ae}if(U&&U.defaultProps)for(A in ge=U.defaultProps,ge)ie[A]===void 0&&(ie[A]=ge[A]);return we(U,se,ie)},Be.createRef=function(){return{current:null}},Be.forwardRef=function(U){return{$$typeof:C,render:U}},Be.isValidElement=st,Be.lazy=function(U){return{$$typeof:y,_payload:{_status:-1,_result:U},_init:je}},Be.memo=function(U,E){return{$$typeof:T,type:U,compare:E===void 0?null:E}},Be.startTransition=ot,Be.unstable_useCacheRefresh=function(){return F.H.useCacheRefresh()},Be.use=function(U){return F.H.use(U)},Be.useActionState=function(U,E,Y){return F.H.useActionState(U,E,Y)},Be.useCallback=function(U,E){return F.H.useCallback(U,E)},Be.useContext=function(U){return F.H.useContext(U)},Be.useDebugValue=function(){},Be.useDeferredValue=function(U,E){return F.H.useDeferredValue(U,E)},Be.useEffect=function(U,E){return F.H.useEffect(U,E)},Be.useEffectEvent=function(U){return F.H.useEffectEvent(U)},Be.useId=function(){return F.H.useId()},Be.useImperativeHandle=function(U,E,Y){return F.H.useImperativeHandle(U,E,Y)},Be.useInsertionEffect=function(U,E){return F.H.useInsertionEffect(U,E)},Be.useLayoutEffect=function(U,E){return F.H.useLayoutEffect(U,E)},Be.useMemo=function(U,E){return F.H.useMemo(U,E)},Be.useOptimistic=function(U,E){return F.H.useOptimistic(U,E)},Be.useReducer=function(U,E,Y){return F.H.useReducer(U,E,Y)},Be.useRef=function(U){return F.H.useRef(U)},Be.useState=function(U){return F.H.useState(U)},Be.useSyncExternalStore=function(U,E,Y){return F.H.useSyncExternalStore(U,E,Y)},Be.useTransition=function(){return F.H.useTransition()},Be.version="19.3.0",Be}var Ep;function If(){return Ep||(Ep=1,Sf.exports=bb()),Sf.exports}var j=If(),Nf={exports:{}},nc={},Tf={exports:{}},Cf={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var Mp;function xb(){return Mp||(Mp=1,(function(l){function c(ue,me){var be=ue.length;ue.push(me);e:for(;0<be;){var je=be-1>>>1,Ce=ue[je];if(0<h(Ce,me))ue[je]=me,ue[be]=Ce,be=je;else break e}}function u(ue){return ue.length===0?null:ue[0]}function f(ue){if(ue.length===0)return null;var me=ue[0],be=ue.pop();if(be!==me){ue[0]=be;e:for(var je=0,Ce=ue.length,ot=Ce>>>1;je<ot;){var Et=2*(je+1)-1,Me=ue[Et],U=Et+1,E=ue[U];if(0>h(Me,be))U<Ce&&0>h(E,Me)?(ue[je]=E,ue[U]=be,je=U):(ue[je]=Me,ue[Et]=be,je=Et);else if(U<Ce&&0>h(E,be))ue[je]=E,ue[U]=be,je=U;else break e}}return me}function h(ue,me){var be=ue.sortIndex-me.sortIndex;return be!==0?be:ue.id-me.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var p=performance;l.unstable_now=function(){return p.now()}}else{var v=Date,C=v.now();l.unstable_now=function(){return v.now()-C}}var S=[],T=[],y=1,b=null,k=3,R=!1,B=!1,X=!1,N=!1,_=typeof setTimeout=="function"?setTimeout:null,W=typeof clearTimeout=="function"?clearTimeout:null,ne=typeof setImmediate<"u"?setImmediate:null;function J(ue){for(var me=u(T);me!==null;){if(me.callback===null)f(T);else if(me.startTime<=ue)f(T),me.sortIndex=me.expirationTime,c(S,me);else break;me=u(T)}}function ce(ue){if(X=!1,J(ue),!B)if(u(S)!==null)B=!0,le||(le=!0,st());else{var me=u(T);me!==null&&tt(ce,me.startTime-ue)}}var le=!1,oe=-1,F=5,re=-1;function we(){return N?!0:!(l.unstable_now()-re<F)}function Te(){if(N=!1,le){var ue=l.unstable_now();re=ue;var me=!0;try{e:{B=!1,X&&(X=!1,W(oe),oe=-1),R=!0;var be=k;try{t:{for(J(ue),b=u(S);b!==null&&!(b.expirationTime>ue&&we());){var je=b.callback;if(typeof je=="function"){b.callback=null,k=b.priorityLevel;var Ce=je(b.expirationTime<=ue);if(ue=l.unstable_now(),typeof Ce=="function"){b.callback=Ce,J(ue),me=!0;break t}b===u(S)&&f(S),J(ue)}else f(S);b=u(S)}if(b!==null)me=!0;else{var ot=u(T);ot!==null&&tt(ce,ot.startTime-ue),me=!1}}break e}finally{b=null,k=be,R=!1}me=void 0}}finally{me?st():le=!1}}}var st;if(typeof ne=="function")st=function(){ne(Te)};else if(typeof MessageChannel<"u"){var Ot=new MessageChannel,Dt=Ot.port2;Ot.port1.onmessage=Te,st=function(){Dt.postMessage(null)}}else st=function(){_(Te,0)};function tt(ue,me){oe=_(function(){ue(l.unstable_now())},me)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(ue){ue.callback=null},l.unstable_forceFrameRate=function(ue){0>ue||125<ue?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<ue?Math.floor(1e3/ue):5},l.unstable_getCurrentPriorityLevel=function(){return k},l.unstable_next=function(ue){switch(k){case 1:case 2:case 3:var me=3;break;default:me=k}var be=k;k=me;try{return ue()}finally{k=be}},l.unstable_requestPaint=function(){N=!0},l.unstable_runWithPriority=function(ue,me){switch(ue){case 1:case 2:case 3:case 4:case 5:break;default:ue=3}var be=k;k=ue;try{return me()}finally{k=be}},l.unstable_scheduleCallback=function(ue,me,be){var je=l.unstable_now();switch(typeof be=="object"&&be!==null?(be=be.delay,be=typeof be=="number"&&0<be?je+be:je):be=je,ue){case 1:var Ce=-1;break;case 2:Ce=250;break;case 5:Ce=1073741823;break;case 4:Ce=1e4;break;default:Ce=5e3}return Ce=be+Ce,ue={id:y++,callback:me,priorityLevel:ue,startTime:be,expirationTime:Ce,sortIndex:-1},be>je?(ue.sortIndex=be,c(T,ue),u(S)===null&&ue===u(T)&&(X?(W(oe),oe=-1):X=!0,tt(ce,be-je))):(ue.sortIndex=Ce,c(S,ue),B||R||(B=!0,le||(le=!0,st()))),ue},l.unstable_shouldYield=we,l.unstable_wrapCallback=function(ue){var me=k;return function(){var be=k;k=me;try{return ue.apply(this,arguments)}finally{k=be}}}})(Cf)),Cf}var kp;function wb(){return kp||(kp=1,Tf.exports=xb()),Tf.exports}var Ef={exports:{}},bn={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var zp;function jb(){if(zp)return bn;zp=1;var l=If();function c(y){var b="https://react.dev/errors/"+y;if(1<arguments.length){b+="?args[]="+encodeURIComponent(arguments[1]);for(var k=2;k<arguments.length;k++)b+="&args[]="+encodeURIComponent(arguments[k])}return"Minified React error #"+y+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(){}var f={d:{f:u,r:function(){throw Error(c(522))},D:u,C:u,L:u,m:u,X:u,S:u,M:u},p:0,findDOMNode:null},h=Symbol.for("react.portal"),p=Symbol.for("react.recoverable"),v=Symbol.for("react.optimistic_key");function C(y,b,k){var R=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:h,key:R==null?null:R===v?v:""+R,children:y,containerInfo:b,implementation:k}}var S=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function T(y,b){if(y==="font")return"";if(typeof b=="string")return b==="use-credentials"?b:""}return bn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=f,bn.browser=function(y){return{$$typeof:p,_reason:y}},bn.createPortal=function(y,b){var k=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!b||b.nodeType!==1&&b.nodeType!==9&&b.nodeType!==11)throw Error(c(299));return C(y,b,null,k)},bn.flushSync=function(y){var b=S.T,k=f.p;try{if(S.T=null,f.p=2,y)return y()}finally{S.T=b,f.p=k,f.d.f()}},bn.preconnect=function(y,b){typeof y=="string"&&(b?(b=b.crossOrigin,b=typeof b=="string"?b==="use-credentials"?b:"":void 0):b=null,f.d.C(y,b))},bn.prefetchDNS=function(y){typeof y=="string"&&f.d.D(y)},bn.preinit=function(y,b){if(typeof y=="string"&&b&&typeof b.as=="string"){var k=b.as,R=T(k,b.crossOrigin),B=typeof b.integrity=="string"?b.integrity:void 0,X=typeof b.fetchPriority=="string"?b.fetchPriority:void 0;k==="style"?f.d.S(y,typeof b.precedence=="string"?b.precedence:void 0,{crossOrigin:R,integrity:B,fetchPriority:X}):k==="script"&&f.d.X(y,{crossOrigin:R,integrity:B,fetchPriority:X,nonce:typeof b.nonce=="string"?b.nonce:void 0})}},bn.preinitModule=function(y,b){if(typeof y=="string")if(typeof b=="object"&&b!==null){if(b.as==null||b.as==="script"){var k=T(b.as,b.crossOrigin);f.d.M(y,{crossOrigin:k,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0})}}else b==null&&f.d.M(y)},bn.preload=function(y,b){if(typeof y=="string"&&typeof b=="object"&&b!==null&&typeof b.as=="string"){var k=b.as,R=T(k,b.crossOrigin);f.d.L(y,k,{crossOrigin:R,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,type:typeof b.type=="string"?b.type:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0,referrerPolicy:typeof b.referrerPolicy=="string"?b.referrerPolicy:void 0,imageSrcSet:typeof b.imageSrcSet=="string"?b.imageSrcSet:void 0,imageSizes:typeof b.imageSizes=="string"?b.imageSizes:void 0,media:typeof b.media=="string"?b.media:void 0})}},bn.preloadModule=function(y,b){if(typeof y=="string")if(b){var k=T(b.as,b.crossOrigin);f.d.m(y,{as:typeof b.as=="string"&&b.as!=="script"?b.as:void 0,crossOrigin:k,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0})}else f.d.m(y)},bn.requestFormReset=function(y){f.d.r(y)},bn.unstable_batchedUpdates=function(y,b){return y(b)},bn.useFormState=function(y,b,k){return S.H.useFormState(y,b,k)},bn.useFormStatus=function(){return S.H.useHostTransitionStatus()},bn.version="19.3.0",bn}var Ap;function ry(){if(Ap)return Ef.exports;Ap=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(c){console.error(c)}}return l(),Ef.exports=jb(),Ef.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var Op;function Sb(){if(Op)return nc;Op=1;var l=wb(),c=If(),u=ry();function f(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function h(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function p(e){for(var t=e,n=t;n&&!n.alternate;)t=n,(t.flags&4098)!==0&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function v(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function C(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function S(e){if(p(e)!==e)throw Error(f(188))}function T(e){var t=e.alternate;if(!t){if(t=p(e),t===null)throw Error(f(188));return t!==e?null:e}for(var n=e,a=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(a=i.return,a!==null){n=a;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return S(i),e;if(o===a)return S(i),t;o=o.sibling}throw Error(f(188))}if(n.return!==a.return)n=i,a=o;else{for(var m=!1,w=i.child;w;){if(w===n){m=!0,n=i,a=o;break}if(w===a){m=!0,a=i,n=o;break}w=w.sibling}if(!m){for(w=o.child;w;){if(w===n){m=!0,n=o,a=i;break}if(w===a){m=!0,a=o,n=i;break}w=w.sibling}if(!m)throw Error(f(189))}}if(n.alternate!==a)throw Error(f(190))}if(n.tag!==3)throw Error(f(188));return n.stateNode.current===n?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}function b(e,t,n,a,i,o){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,a,i,o)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&b(e.child,t,n,a,i,o))return!0;e=e.sibling}return!1}function k(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function R(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),!(e.tag===3||e.tag===5||e.tag===27));)e=e.return;return t}function B(e){var t=[null,null],n=k(e);return n===null||X(t,e,n.child,{foundSelf:!1}),t}function X(e,t,n,a){for(;n!==null;){if(n===t)a.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(a.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&X(e,t,n.child,a))return!0;n=n.sibling}return!1}function N(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(f(559))}}var _=null,W=null;function ne(e,t,n){return e===n?!0:e===t?(_=e,!0):!1}function J(e,t,n){return e===n?(W=e,!1):e===t?(W!==null&&(_=e),!0):!1}function ce(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function le(e,t,n){for(var a=0,i=e;i;i=n(i))a++;i=0;for(var o=t;o;o=n(o))i++;for(;0<a-i;)e=n(e),a--;for(;0<i-a;)t=n(t),i--;for(;a--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var oe=Object.assign,F=Symbol.for("react.element"),re=Symbol.for("react.transitional.element"),we=Symbol.for("react.portal"),Te=Symbol.for("react.fragment"),st=Symbol.for("react.strict_mode"),Ot=Symbol.for("react.profiler"),Dt=Symbol.for("react.consumer"),tt=Symbol.for("react.context"),ue=Symbol.for("react.forward_ref"),me=Symbol.for("react.suspense"),be=Symbol.for("react.suspense_list"),je=Symbol.for("react.memo"),Ce=Symbol.for("react.lazy"),ot=Symbol.for("react.activity"),Et=Symbol.for("react.legacy_hidden"),Me=Symbol.for("react.memo_cache_sentinel"),U=Symbol.for("react.view_transition"),E=Symbol.for("react.recoverable"),Y=Symbol.iterator;function A(e){return e===null||typeof e!="object"?null:(e=Y&&e[Y]||e["@@iterator"],typeof e=="function"?e:null)}var ie=Symbol.for("react.client.reference");function se(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ie?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Te:return"Fragment";case Ot:return"Profiler";case st:return"StrictMode";case me:return"Suspense";case be:return"SuspenseList";case ot:return"Activity";case U:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case we:return"Portal";case tt:return e.displayName||"Context";case Dt:return(e._context.displayName||"Context")+".Consumer";case ue:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case je:return t=e.displayName||null,t!==null?t:se(e.type)||"Memo";case Ce:t=e._payload,e=e._init;try{return se(e(t))}catch{}}return null}var ge=Array.isArray,ae=c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,de=u.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ae={pending:!1,data:null,method:null,action:null},Ve=[],ft=-1;function Rt(e){return{current:e}}function Ee(e){0>ft||(e.current=Ve[ft],Ve[ft]=null,ft--)}function Re(e,t){ft++,Ve[ft]=e.current,e.current=t}var at=Rt(null),ct=Rt(null),ht=Rt(null),un=Rt(null);function Sl(e,t){switch(Re(ht,t),Re(ct,e),Re(at,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Og(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Og(t),e=Dg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Ee(at),Re(at,e)}function Nl(){Ee(at),Ee(ct),Ee(ht)}function sa(e){var t=e.memoizedState;t!==null&&(Xs._currentValue=t.memoizedState,Re(un,e)),t=at.current;var n=Dg(t,e.type);t!==n&&(Re(ct,e),Re(at,n))}function Un(e){ct.current===e&&(Ee(at),Ee(ct)),un.current===e&&(Ee(un),Xs._currentValue=Ae)}var sl,Hl;function wn(e){if(sl===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);sl=t&&t[1]||"",Hl=-1<n.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+sl+e+Hl}var vi=!1;function Ra(e,t){if(!e||vi)return"";vi=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var ee=function(){throw Error()};if(Object.defineProperty(ee.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ee,[])}catch(pe){var L=pe}Reflect.construct(e,[],ee)}else{try{ee.call()}catch(pe){L=pe}ee=!1;try{var K=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),ee=!0,new e}finally{ee&&(K!==void 0?Object.defineProperty(e.prototype,"props",K):delete e.prototype.props)}}}else{try{throw Error()}catch(pe){L=pe}(ee=e())&&typeof ee.catch=="function"&&ee.catch(function(){})}}catch(pe){if(pe&&L&&typeof pe.stack=="string")return[pe.stack,L.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=a.DetermineComponentFrameRoot(),m=o[0],w=o[1];if(m&&w){var O=m.split(`
44
+ `),q=w.split(`
45
+ `);for(i=a=0;a<O.length&&!O[a].includes("DetermineComponentFrameRoot");)a++;for(;i<q.length&&!q[i].includes("DetermineComponentFrameRoot");)i++;if(a===O.length||i===q.length)for(a=O.length-1,i=q.length-1;1<=a&&0<=i&&O[a]!==q[i];)i--;for(;1<=a&&0<=i;a--,i--)if(O[a]!==q[i]){if(a!==1||i!==1)do if(a--,i--,0>i||O[a]!==q[i]){var Z=`
46
+ `+O[a].replace(" at new "," at ");return e.displayName&&Z.includes("<anonymous>")&&(Z=Z.replace("<anonymous>",e.displayName)),Z}while(1<=a&&0<=i);break}}}finally{vi=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?wn(n):""}function _a(e,t){switch(e.tag){case 26:case 27:case 5:return wn(e.type);case 16:return wn("Lazy");case 13:return e.child!==t&&t!==null?wn("Suspense Fallback"):wn("Suspense");case 19:return wn("SuspenseList");case 0:case 15:return Ra(e.type,!1);case 11:return Ra(e.type.render,!1);case 1:return Ra(e.type,!0);case 31:return wn("Activity");case 30:return wn("ViewTransition");default:return""}}function dn(e){try{var t="",n=null;do t+=_a(e,n),n=e,e=e.return;while(e);return t}catch(a){return`
47
+ Error generating stack: `+a.message+`
48
+ `+a.stack}}var Hn=Object.prototype.hasOwnProperty,$l=l.unstable_scheduleCallback,Ll=l.unstable_cancelCallback,Tl=l.unstable_shouldYield,Wn=l.unstable_requestPaint,rt=l.unstable_now,Ze=l.unstable_getCurrentPriorityLevel,tn=l.unstable_ImmediatePriority,Cl=l.unstable_UserBlockingPriority,Yl=l.unstable_NormalPriority,ol=l.unstable_LowPriority,Mt=l.unstable_IdlePriority,Gl=l.log,oa=l.unstable_setDisableYieldValue,cl=null,Vt=null;function jn(e){if(typeof Gl=="function"&&oa(e),Vt&&typeof Vt.setStrictMode=="function")try{Vt.setStrictMode(cl,e)}catch{}}var Ut=Math.clz32?Math.clz32:ns,ca=Math.log,bi=Math.LN2;function ns(e){return e>>>=0,e===0?32:31-(ca(e)/bi|0)|0}var ql=256,ra=262144,kn=4194304;function zn(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function $n(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var i=0,o=e.suspendedLanes,m=e.pingedLanes;e=e.warmLanes;var w=a&134217727;return w!==0?(a=w&~o,a!==0?i=zn(a):(m&=w,m!==0?i=zn(m):n||(n=w&~e,n!==0&&(i=zn(n))))):(w=a&~o,w!==0?i=zn(w):m!==0?i=zn(m):n||(n=a&~e,n!==0&&(i=zn(n)))),i===0?0:t!==0&&t!==i&&(t&o)===0&&(o=i&-i,n=t&-t,o>=n||o===32&&(n&4194048)!==0)?t:i}function In(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ua(e,t){(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var a=31-Ut(n),i=1<<a;t|=e[a],n&=~i}return t}function ut(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ln(){var e=kn;return kn<<=1,(kn&62914560)===0&&(kn=4194304),e}function xi(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function z(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function $(e,t,n,a,i,o){var m=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var w=e.entanglements,O=e.expirationTimes,q=e.hiddenUpdates;for(n=m&~n;0<n;){var Z=31-Ut(n),ee=1<<Z;w[Z]=0,O[Z]=-1;var L=q[Z];if(L!==null)for(q[Z]=null,Z=0;Z<L.length;Z++){var K=L[Z];K!==null&&(K.lane&=-536870913)}n&=~ee}a!==0&&ve(e,a,0),o!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=o&~(m&~t))}function ve(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-Ut(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|n&261930}function fe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-Ut(n),i=1<<a;i&t|e[a]&t&&(e[a]|=t),n&=~i}}function ke(e,t){var n=t&-t;return n=(n&42)!==0?1:Ie(n),(n&(e.suspendedLanes|t))!==0?0:n}function Ie(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Ue(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ye(){var e=de.p;return e!==0?e:(e=window.event,e===void 0?32:pp(e.type))}function fn(e,t){var n=de.p;try{return de.p=e,t()}finally{de.p=n}}var He=Math.random().toString(36).slice(2),_t="__reactFiber$"+He,Ke="__reactProps$"+He,jt="__reactContainer$"+He,El="__reactEvents$"+He,Ml="__reactListeners$"+He,fc="__reactHandles$"+He,wi="__reactResources$"+He,Ba="__reactMarker$"+He,Xl="__reactLoad$"+He;function ls(e){delete e[_t],delete e[Ke],delete e[Ml],delete e[fc]}function hn(e){var t;if(t=e[_t])return t;for(var n=e.parentNode;n;){if(t=n[jt]||n[_t]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Fg(e);e!==null;){if(n=e[_t])return n;e=Fg(e)}return t}e=n,n=e.parentNode}return null}function An(e){if(e=e[_t]||e[jt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ji(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(f(33))}function da(e){var t=e[wi];return t||(t=e[wi]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Kt(e){e[Ba]=!0}function Is(e){e[Xl]=void 0}var Ps=new Set,eo={};function St(e,t){Sn(e,t),Sn(e+"Capture",t)}function Sn(e,t){for(eo[e]=t,e=0;e<t.length;e++)Ps.add(t[e])}var Yt=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]*$"),Ht={},to={};function Ua(e){return Hn.call(to,e)?!0:Hn.call(Ht,e)?!1:Yt.test(e)?to[e]=!0:(Ht[e]=!0,!1)}var nt=!1;function no(){var e=nt;return nt=!1,e}function Si(e,t,n){if(Ua(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,n)}}function Ni(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,n)}}function Yn(e,t,n,a){if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,a)}}function ye(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function lo(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function hc(e,t,n){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var i=a.get,o=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(m){n=""+m,o.call(this,m)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return n},setValue:function(m){n=""+m},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Nt(e){if(!e._valueTracker){var t=lo(e)?"checked":"value";e._valueTracker=hc(e,t,""+e[t])}}function Nn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=lo(e)?e.checked?"true":"false":e.value),e=a,e!==n?(t.setValue(e),!0):!1}var fa=/[\n"\\]/g;function mt(e){return e.replace(fa,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ti(e,t,n,a,i,o,m,w){e.name="",m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"?e.type=m:e.removeAttribute("type"),t!=null?m==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+ye(t)):e.value!==""+ye(t)&&(e.value=""+ye(t)):m!=="submit"&&m!=="reset"||e.removeAttribute("value"),t!=null?m==="number"&&e.value==t?Gn(e,ye(e.value)):Gn(e,ye(t)):n!=null?Gn(e,ye(n)):a!=null&&e.removeAttribute("value"),i==null&&o!=null&&(e.defaultChecked=!!o),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?e.name=""+ye(w):e.removeAttribute("name")}function Jt(e,t,n,a,i,o,m,w){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.type=o),t!=null||n!=null){if(!(o!=="submit"&&o!=="reset"||t!=null)){Nt(e);return}n=n!=null?""+ye(n):"",t=t!=null?""+ye(t):n,w||t===e.value||(e.value=t),e.defaultValue=t}a=a??i,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=w?e.checked:!!a,e.defaultChecked=!!a,m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(e.name=m),Nt(e)}function Gn(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function ha(e,t,n,a){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&a&&(e[n].defaultSelected=!0)}else{for(n=""+ye(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,a&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function mc(e,t,n){if(t!=null&&(t=""+ye(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+ye(n):""}function ma(e,t,n,a){if(t==null){if(a!=null){if(n!=null)throw Error(f(92));if(ge(a)){if(1<a.length)throw Error(f(93));a=a[0]}n=a}n==null&&(n=""),t=n}n=ye(t),e.defaultValue=n,a=e.textContent,a===n&&a!==""&&a!==null&&(e.value=a),Nt(e)}function qn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ha=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 $a(e,t,n){var a=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,n):typeof n!="number"||n===0||Ha.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function kl(e,t,n){if(t!=null&&typeof t!="object")throw Error(f(62));if(e=e.style,n!=null){for(var a in n)!n.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="",nt=!0);for(var i in t)a=t[i],t.hasOwnProperty(i)&&n[i]!==a&&($a(e,i,a),nt=!0)}else for(var o in t)t.hasOwnProperty(o)&&$a(e,o,t[o])}function ga(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var as=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["maskType","mask-type"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),is=/^[\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 La(e){return is.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function On(){}var ss=null;function ao(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ya=null,sn=null;function io(e){var t=An(e);if(t&&(e=t.stateNode)){var n=e[Ke]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ti(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+mt(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var i=a[Ke]||null;if(!i)throw Error(f(90));Ti(a,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)a=n[t],a.form===e.form&&Nn(a)}break e;case"textarea":mc(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&ha(e,!!n.multiple,t,!1)}}}var rl=!1;function gc(e,t,n){if(rl)return e(t,n);rl=!0;try{var a=e(t);return a}finally{if(rl=!1,(Ya!==null||sn!==null)&&(kr(),Ya&&(t=Ya,e=sn,sn=Ya=null,io(t),e)))for(t=0;t<e.length;t++)io(e[t])}}function Vl(e,t){var n=e.stateNode;if(n===null)return null;var a=n[Ke]||null;if(a===null)return null;n=a[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(f(231,t,typeof n));return n}var zl=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),os=!1;if(zl)try{var pa={};Object.defineProperty(pa,"passive",{get:function(){os=!0}}),window.addEventListener("test",pa,pa),window.removeEventListener("test",pa,pa)}catch{os=!1}var Xn=null,ul=null,Ci=null;function so(){if(Ci)return Ci;var e,t=ul,n=t.length,a,i="value"in Xn?Xn.value:Xn.textContent,o=i.length;for(e=0;e<n&&t[e]===i[e];e++);var m=n-e;for(a=1;a<=m&&t[n-a]===i[o-a];a++);return Ci=i.slice(e,1<a?1-a:void 0)}function Ei(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function ya(){return!0}function Mi(){return!1}function Ft(e){function t(n,a,i,o,m){this._reactName=n,this._targetInst=i,this.type=a,this.nativeEvent=o,this.target=m,this.currentTarget=null;for(var w in e)e.hasOwnProperty(w)&&(n=e[w],this[w]=n?n(o):o[w]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?ya:Mi,this.isPropagationStopped=Mi,this}return oe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=ya)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ya)},persist:function(){},isPersistent:ya}),t}var Kl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ki=Ft(Kl),dl=oe({},Kl,{view:0,detail:0}),au=Ft(dl),oo,co,va,cs=oe({},dl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:nn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==va&&(va&&e.type==="mousemove"?(oo=e.screenX-va.screenX,co=e.screenY-va.screenY):co=oo=0,va=e),oo)},movementY:function(e){return"movementY"in e?e.movementY:co}}),ro=Ft(cs),iu=oe({},cs,{dataTransfer:0}),zi=Ft(iu),pc=oe({},dl,{relatedTarget:0}),Ga=Ft(pc),qa=oe({},Kl,{animationName:0,elapsedTime:0,pseudoElement:0}),yc=Ft(qa),su=oe({},Kl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ou=Ft(su),cu=oe({},Kl,{data:0}),uo=Ft(cu),Zl={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},vc={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"},bc={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function xc(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=bc[e])?!!t[e]:!1}function nn(){return xc}var wc=oe({},dl,{key:function(e){if(e.key){var t=Zl[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ei(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?vc[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:nn,charCode:function(e){return e.type==="keypress"?Ei(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ei(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),fo=Ft(wc),ru=oe({},cs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),jc=Ft(ru),uu=oe({},Kl,{submitter:0}),Sc=Ft(uu),du=oe({},dl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:nn}),fu=Ft(du),Nc=oe({},Kl,{propertyName:0,elapsedTime:0,pseudoElement:0}),hu=Ft(Nc),mu=oe({},cs,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Tc=Ft(mu),Cc=oe({},Kl,{newState:0,oldState:0,source:0}),rs=Ft(Cc),gu=[9,13,27,32],Ai=zl&&"CompositionEvent"in window,Oi=null;zl&&"documentMode"in document&&(Oi=document.documentMode);var pu=zl&&"TextEvent"in window&&!Oi,ho=zl&&(!Ai||Oi&&8<Oi&&11>=Oi),mo=" ",go=!1;function Ec(e,t){switch(e){case"keyup":return gu.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ge(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var fl=!1;function yu(e,t){switch(e){case"compositionend":return Ge(t);case"keypress":return t.which!==32?null:(go=!0,mo);case"textInput":return e=t.data,e===mo&&go?null:e;default:return null}}function vu(e,t){if(fl)return e==="compositionend"||!Ai&&Ec(e,t)?(e=so(),Ci=ul=Xn=null,fl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return ho&&t.locale!=="ko"?null:t.data;default:return null}}var Di={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 Mc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Di[e.type]:t==="textarea"}function hl(e,t,n,a){Ya?sn?sn.push(a):sn=[a]:Ya=a,t=_r(t,"onChange"),0<t.length&&(n=new ki("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var ml=null,ba=null;function po(e){Cg(e,0)}function xa(e){var t=ji(e);if(Nn(t))return e}function Ri(e,t){if(e==="change")return t}var Xa=!1;if(zl){var us;if(zl){var ds="oninput"in document;if(!ds){var kc=document.createElement("div");kc.setAttribute("oninput","return;"),ds=typeof kc.oninput=="function"}us=ds}else us=!1;Xa=us&&(!document.documentMode||9<document.documentMode)}function yo(){ml&&(ml.detachEvent("onpropertychange",wa),ba=ml=null)}function wa(e){if(e.propertyName==="value"&&xa(ba)){var t=[];hl(t,ba,e,ao(e)),gc(po,t)}}function zc(e,t,n){e==="focusin"?(yo(),ml=t,ba=n,ml.attachEvent("onpropertychange",wa)):e==="focusout"&&yo()}function Ac(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return xa(ba)}function Oc(e,t){if(e==="click")return xa(t)}function Dc(e,t){if(e==="input"||e==="change")return xa(t)}function Rc(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Tn=typeof Object.is=="function"?Object.is:Rc;function Va(e,t){if(Tn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(a=0;a<n.length;a++){var i=n[a];if(!Hn.call(t,i)||!Tn(e[i],t[i]))return!1}return!0}function fs(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function vo(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function bo(e,t){var n=vo(e);e=0;for(var a;n;){if(n.nodeType===3){if(a=e+n.textContent.length,e<=t&&a>=t)return{node:n,offset:t-e};e=a}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=vo(n)}}function xo(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?xo(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function wo(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=fs(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=fs(e.document)}return t}function hs(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var _c=zl&&"documentMode"in document&&11>=document.documentMode,ja=null,ms=null,d=null,g=!1;function x(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;g||ja==null||ja!==fs(a)||(a=ja,"selectionStart"in a&&hs(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),d&&Va(d,a)||(d=a,a=_r(ms,"onSelect"),0<a.length&&(t=new ki("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=ja)))}function M(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var D={animationend:M("Animation","AnimationEnd"),animationiteration:M("Animation","AnimationIteration"),animationstart:M("Animation","AnimationStart"),transitionrun:M("Transition","TransitionRun"),transitionstart:M("Transition","TransitionStart"),transitioncancel:M("Transition","TransitionCancel"),transitionend:M("Transition","TransitionEnd")},Q={},te={};zl&&(te=document.createElement("div").style,"AnimationEvent"in window||(delete D.animationend.animation,delete D.animationiteration.animation,delete D.animationstart.animation),"TransitionEvent"in window||delete D.transitionend.transition);function he(e){if(Q[e])return Q[e];if(!D[e])return e;var t=D[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in te)return Q[e]=t[n];return e}var Oe=he("animationend"),lt=he("animationiteration"),Qe=he("animationstart"),Je=he("transitionrun"),Zt=he("transitionstart"),$t=he("transitioncancel"),ln=he("transitionend"),_e=new Map,kt="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");kt.push("scrollEnd");function gt(e,t){_e.set(e,t),St(t,[e])}var Vn=0;function qe(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=Rl.identifierPrefix;var n=Vn++;return e="_"+e+"t_"+n.toString(32)+"_",t.autoName=e}function _i(e){if(e==null||typeof e=="string")return e;var t=null,n=Rs;if(n!==null)for(var a=0;a<n.length;a++){var i=e[n[a]];if(i!=null){if(i==="none")return"none";t=t==null?i:t+(" "+i)}}return t??e.default}function Cn(e,t){return e=_i(e),t=_i(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var Bc=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},gl=[],gs=0,bu=0;function Uc(){for(var e=gs,t=bu=gs=0;t<e;){var n=gl[t];gl[t++]=null;var a=gl[t];gl[t++]=null;var i=gl[t];gl[t++]=null;var o=gl[t];if(gl[t++]=null,a!==null&&i!==null){var m=a.pending;m===null?i.next=i:(i.next=m.next,m.next=i),a.pending=i}o!==0&&lh(n,i,o)}}function Hc(e,t,n,a){gl[gs++]=e,gl[gs++]=t,gl[gs++]=n,gl[gs++]=a,bu|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function xu(e,t,n,a){return Hc(e,t,n,a),$c(e)}function Bi(e,t){return Hc(e,null,null,t),$c(e)}function lh(e,t,n){e.lanes|=n;var a=e.alternate;a!==null&&(a.lanes|=n);for(var i=!1,o=e.return;o!==null;)o.childLanes|=n,a=o.alternate,a!==null&&(a.childLanes|=n),o.tag===22&&(e=o.stateNode,e===null||e._visibility&1||(i=!0)),e=o,o=o.return;return e.tag===3?(o=e.stateNode,i&&t!==null&&(i=31-Ut(n),e=o.hiddenUpdates,a=e[i],a===null?e[i]=[t]:a.push(t),t.lane=n|536870912),o):null}function $c(e){if(50<qo)throw qo=0,Mr=null,Error(f(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ps={};function My(e,t,n,a){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kn(e,t,n,a){return new My(e,t,n,a)}function wu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Sa(e,t){var n=e.alternate;return n===null?(n=Kn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ah(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Lc(e,t,n,a,i,o){var m=0;if(a=e,typeof a=="function")wu(a)&&(m=1);else if(typeof a=="string")m=nb(e,n,at.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(a){case ot:return e=Kn(31,n,t,i),e.elementType=ot,e.lanes=o,e;case Te:return Ui(n.children,i,o,t);case st:m=8,i|=24;break;case Ot:return e=Kn(12,n,t,i|2),e.elementType=Ot,e.lanes=o,e;case me:return e=Kn(13,n,t,i),e.elementType=me,e.lanes=o,e;case be:return e=Kn(19,n,t,i),e.elementType=be,e.lanes=o,e;case Et:case U:return e=i|32,e=Kn(30,n,t,e),e.elementType=U,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case tt:m=10;break e;case Dt:m=9;break e;case ue:m=11;break e;case je:m=14;break e;case Ce:m=16,a=null;break e}m=29,n=Error(f(130,e===null?"null":typeof e,"")),a=null}return t=Kn(m,n,t,i),t.elementType=e,t.type=a,t.lanes=o,t}function Ui(e,t,n,a){return e=Kn(7,e,a,t),e.lanes=n,e}function ju(e,t,n){return e=Kn(6,e,null,t),e.lanes=n,e}function ih(e){var t=Kn(18,null,null,0);return t.stateNode=e,t}function Su(e,t,n){return t=Kn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var sh=new WeakMap;function pl(e,t){if(typeof e=="object"&&e!==null){var n=sh.get(e);return n!==void 0?n:(t={value:e,source:t,stack:dn(t)},sh.set(e,t),t)}return{value:e,source:t,stack:dn(t)}}var ys=[],vs=0,Yc=null,jo=0,yl=[],vl=0,Ka=null,Ql=1,Jl="";function Na(e,t){ys[vs++]=jo,ys[vs++]=Yc,Yc=e,jo=t}function oh(e,t,n){yl[vl++]=Ql,yl[vl++]=Jl,yl[vl++]=Ka,Ka=e;var a=Ql;e=Jl;var i=32-Ut(a)-1;a&=~(1<<i),n+=1;var o=32-Ut(t)+i;if(30<o){var m=i-i%5;o=(a&(1<<m)-1).toString(32),a>>=m,i-=m,Ql=1<<32-Ut(t)+i|n<<i|a,Jl=o+e}else Ql=1<<o|n<<i|a,Jl=e}function Gc(e){e.return!==null&&(Na(e,1),oh(e,1,0))}function Nu(e){for(;e===Yc;)Yc=ys[--vs],ys[vs]=null,jo=ys[--vs],ys[vs]=null;for(;e===Ka;)Ka=yl[--vl],yl[vl]=null,Jl=yl[--vl],yl[vl]=null,Ql=yl[--vl],yl[vl]=null}function ch(e,t){yl[vl++]=Ql,yl[vl++]=Jl,yl[vl++]=Ka,Ql=t.id,Jl=t.overflow,Ka=e}var on=null,zt=null,Xe=!1,Za=null,bl=!1,Tu=Error(f(519));function Qa(e){var t=Error(f(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw So(pl(t,e)),Tu}function rh(e){var t=e.stateNode,n=e.type,a=e.memoizedProps;switch(t[_t]=e,t[Ke]=a,n){case"dialog":We("cancel",t),We("close",t);break;case"iframe":case"object":case"embed":We("load",t);break;case"video":case"audio":for(n=0;n<Vo.length;n++)We(Vo[n],t);break;case"source":We("error",t);break;case"img":case"image":case"link":We("error",t),We("load",t);break;case"details":We("toggle",t);break;case"input":We("invalid",t),Jt(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":We("invalid",t);break;case"textarea":We("invalid",t),ma(t,a.value,a.defaultValue,a.children)}n=a.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||a.suppressHydrationWarning===!0||zg(t.textContent,n)?(a.popover!=null&&(We("beforetoggle",t),We("toggle",t)),a.onScroll!=null&&We("scroll",t),a.onScrollEnd!=null&&We("scrollend",t),a.onClick!=null&&(t.onclick=On),t=!0):t=!1,t||Qa(e,!0)}function qc(e){for(on=e.return;on;)switch(on.tag){case 5:case 31:case 13:bl=!1;return;case 27:case 3:bl=!0;return;default:on=on.return}}function bs(e){if(e!==on)return!1;if(!Xe)return qc(e),Xe=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||tf(e.type,e.memoizedProps)),n=!n),n&&zt&&Qa(e),qc(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(f(317));zt=Jg(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(f(317));zt=Jg(e)}else t===27?(t=zt,ui(e.type)?(e=df,df=null,zt=e):zt=t):zt=on?wl(e.stateNode.nextSibling):null;return!0}function Hi(){zt=on=null,Xe=!1}function Cu(){var e=Za;return e!==null&&(Jn===null?Jn=e:Jn.push.apply(Jn,e),Za=null),e}function So(e){Za===null?Za=[e]:Za.push(e)}var Eu=Rt(null),$i=null,Ta=null;function Ja(e,t,n){Re(Eu,t._currentValue),t._currentValue=n}function Ca(e){e._currentValue=Eu.current,Ee(Eu)}function Xc(e,t,n){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===n)break;e=e.return}}function Mu(e,t,n,a){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){var m=i.child;o=o.firstContext;e:for(;o!==null;){var w=o;o=i;for(var O=0;O<t.length;O++)if(w.context===t[O]){o.lanes|=n,w=o.alternate,w!==null&&(w.lanes|=n),Xc(o.return,n,e),a||(m=null);break e}o=w.next}}else if(i.tag===18){if(m=i.return,m===null)throw Error(f(341));m.lanes|=n,o=m.alternate,o!==null&&(o.lanes|=n),Xc(m,n,e),m=null}else i.tag===13&&i.memoizedState!==null&&i.memoizedState.dehydrated===null?(i.lanes|=n,m=i.alternate,m!==null&&(m.lanes|=n),Xc(i.return,n,e),m=i.child,m=m!==null?m.sibling:null):m=i.child;if(m!==null)m.return=i;else for(m=i;m!==null;){if(m===e){m=null;break}if(i=m.sibling,i!==null){i.return=m.return,m=i;break}m=m.return}i=m}}function Li(e,t,n,a){e=null;for(var i=t,o=!1;i!==null;){if(!o){if((i.flags&524288)!==0)o=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var m=i.alternate;if(m===null)throw Error(f(387));if(m=m.memoizedProps,m!==null){var w=i.type;Tn(i.pendingProps.value,m.value)||(e!==null?e.push(w):e=[w])}}else if(i===un.current){if(m=i.alternate,m===null)throw Error(f(387));m.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(Xs):e=[Xs])}i=i.return}return e!==null&&Mu(t,e,n,a),t.flags|=262144,e!==null}function Vc(e){for(e=e.firstContext;e!==null;){if(!Tn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Yi(e){$i=e,Ta=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function mn(e){return uh($i,e)}function Kc(e,t){return $i===null&&Yi(e),uh(e,t)}function uh(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ta===null){if(e===null)throw Error(f(308));Ta=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ta=Ta.next=t;return n}var ky=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},zy=l.unstable_scheduleCallback,Ay=l.unstable_NormalPriority,Wt={$$typeof:tt,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ku(){return{controller:new ky,data:new Map,refCount:0}}function No(e){e.refCount--,e.refCount===0&&zy(Ay,function(){e.controller.abort()})}function dh(e,t){if((e.pendingLanes&4194048)!==0){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var a=t[e];n.indexOf(a)===-1&&n.push(a)}}}var To=null;function Oy(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Co=null,zu=0,Gi=0,xs=null;function Dy(e,t){if(Co===null){var n=Co=[];zu=0,Gi=Kd(),xs={status:"pending",value:void 0,then:function(a){n.push(a)}}}return zu++,t.then(fh,fh),t}function fh(){if(--zu===0&&(To=null,Co!==null)){xs!==null&&(xs.status="fulfilled");var e=Co;Co=null,Gi=0,xs=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ry(e,t){var n=[],a={status:"pending",value:null,reason:null,then:function(i){n.push(i)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var i=0;i<n.length;i++)(0,n[i])(t)},function(i){for(a.status="rejected",a.reason=i,i=0;i<n.length;i++)(0,n[i])(void 0)}),a}var hh=ae.S;ae.S=function(e,t){if(ig=rt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Dy(e,t),To!==null)for(var n=Hs;n!==null;)dh(n,To),n=n.next;if(n=e.types,n!==null){for(var a=Hs;a!==null;)dh(a,n),a=a.next;if(Gi!==0){a=To,a===null&&(a=To=[]);for(var i=0;i<n.length;i++){var o=n[i];a.indexOf(o)===-1&&a.push(o)}}}hh!==null&&hh(e,t)};var qi=Rt(null);function Au(){var e=qi.current;return e!==null?e:Ct.pooledCache}function Zc(e,t){t===null?Re(qi,qi.current):Re(qi,t.pool)}function mh(){var e=Au();return e===null?null:{parent:Wt._currentValue,pool:e}}var ws=Error(f(460)),Ou=Error(f(474)),Qc=Error(f(542)),Jc={then:function(){}};function gh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function ph(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(On,On),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,vh(e),e===void 0&&!("reason"in t)?Error(f(600)):e;default:if(typeof t.status=="string")t.then(On,On);else{if(e=Ct,e!==null&&100<e.shellSuspendCounter)throw Error(f(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=a}},function(a){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,vh(e),e}throw Vi=t,ws}}function Xi(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Vi=n,ws):n}}var Vi=null;function yh(){if(Vi===null)throw Error(f(459));var e=Vi;return Vi=null,e}function vh(e){if(e===ws||e===Qc)throw Error(f(483))}var js=null,Eo=0;function Fc(e){var t=Eo;return Eo+=1,js===null&&(js=[]),ph(js,e,t)}function Fa(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Wc(e,t){throw t.$$typeof===F?Error(f(525)):(e=Object.prototype.toString.call(t),Error(f(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function bh(e){function t(G,H){if(e){var V=G.deletions;V===null?(G.deletions=[H],G.flags|=16):V.push(H)}}function n(G,H){if(!e)return null;for(;H!==null;)t(G,H),H=H.sibling;return null}function a(G){for(var H=new Map;G!==null;)G.key===null?H.set(G.index,G):H.set(G.key,G),G=G.sibling;return H}function i(G,H){return G=Sa(G,H),G.index=0,G.sibling=null,G}function o(G,H,V){return G.index=V,e?(V=G.alternate,V!==null?(V=V.index,V<H?(G.flags|=2,H):V):(G.flags|=134217730,H)):(G.flags|=1048576,H)}function m(G){return e&&G.alternate===null&&(G.flags|=134217730),G}function w(G,H,V,P){return H===null||H.tag!==6?(H=ju(V,G.mode,P),H.return=G,H):(H=i(H,V),H.return=G,H)}function O(G,H,V,P){var xe=V.type;return xe===Te?(G=Z(G,H,V.props.children,P,V.key),Fa(G,V),G):H!==null&&(H.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===Ce&&Xi(xe)===H.type)?(H=i(H,V.props),Fa(H,V),H.return=G,H):(H=Lc(V.type,V.key,V.props,null,G.mode,P),Fa(H,V),H.return=G,H)}function q(G,H,V,P){return H===null||H.tag!==4||H.stateNode.containerInfo!==V.containerInfo||H.stateNode.implementation!==V.implementation?(H=Su(V,G.mode,P),H.return=G,H):(H=i(H,V.children||[]),H.return=G,H)}function Z(G,H,V,P,xe){return H===null||H.tag!==7?(H=Ui(V,G.mode,P,xe),H.return=G,H):(H=i(H,V),H.return=G,H)}function ee(G,H,V){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=ju(""+H,G.mode,V),H.return=G,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case re:return V=Lc(H.type,H.key,H.props,null,G.mode,V),Fa(V,H),V.return=G,V;case we:return H=Su(H,G.mode,V),H.return=G,H;case Ce:return H=Xi(H),ee(G,H,V)}if(ge(H)||A(H))return H=Ui(H,G.mode,V,null),H.return=G,H;if(typeof H.then=="function")return ee(G,Fc(H),V);if(H.$$typeof===tt)return ee(G,Kc(G,H),V);Wc(G,H)}return null}function L(G,H,V,P){var xe=H!==null?H.key:null;if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return xe!==null?null:w(G,H,""+V,P);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case re:return V.key===xe?O(G,H,V,P):null;case we:return V.key===xe?q(G,H,V,P):null;case Ce:return V=Xi(V),L(G,H,V,P)}if(ge(V)||A(V))return xe!==null?null:Z(G,H,V,P,null);if(typeof V.then=="function")return L(G,H,Fc(V),P);if(V.$$typeof===tt)return L(G,H,Kc(G,V),P);Wc(G,V)}return null}function K(G,H,V,P,xe){if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return G=G.get(V)||null,w(H,G,""+P,xe);if(typeof P=="object"&&P!==null){switch(P.$$typeof){case re:return G=G.get(P.key===null?V:P.key)||null,O(H,G,P,xe);case we:return G=G.get(P.key===null?V:P.key)||null,q(H,G,P,xe);case Ce:return P=Xi(P),K(G,H,V,P,xe)}if(ge(P)||A(P))return G=G.get(V)||null,Z(H,G,P,xe,null);if(typeof P.then=="function")return K(G,H,V,Fc(P),xe);if(P.$$typeof===tt)return K(G,H,V,Kc(H,P),xe);Wc(H,P)}return null}function pe(G,H,V,P){for(var xe=null,et=null,ze=H,De=H=0,en=null;ze!==null&&De<V.length;De++){ze.index>De?(en=ze,ze=null):en=ze.sibling;var it=L(G,ze,V[De],P);if(it===null){ze===null&&(ze=en);break}e&&ze&&it.alternate===null&&t(G,ze),H=o(it,H,De),et===null?xe=it:et.sibling=it,et=it,ze=en}if(De===V.length)return n(G,ze),Xe&&Na(G,De),xe;if(ze===null){for(;De<V.length;De++)ze=ee(G,V[De],P),ze!==null&&(H=o(ze,H,De),et===null?xe=ze:et.sibling=ze,et=ze);return Xe&&Na(G,De),xe}for(ze=a(ze);De<V.length;De++)en=K(ze,G,De,V[De],P),en!==null&&(e&&(it=en.alternate,it!==null&&ze.delete(it.key===null?De:it.key)),H=o(en,H,De),et===null?xe=en:et.sibling=en,et=en);return e&&ze.forEach(function(gi){return t(G,gi)}),Xe&&Na(G,De),xe}function Se(G,H,V,P){if(V==null)throw Error(f(151));for(var xe=null,et=null,ze=H,De=H=0,en=null,it=V.next();ze!==null&&!it.done;De++,it=V.next()){ze.index>De?(en=ze,ze=null):en=ze.sibling;var gi=L(G,ze,it.value,P);if(gi===null){ze===null&&(ze=en);break}e&&ze&&gi.alternate===null&&t(G,ze),H=o(gi,H,De),et===null?xe=gi:et.sibling=gi,et=gi,ze=en}if(it.done)return n(G,ze),Xe&&Na(G,De),xe;if(ze===null){for(;!it.done;De++,it=V.next())it=ee(G,it.value,P),it!==null&&(H=o(it,H,De),et===null?xe=it:et.sibling=it,et=it);return Xe&&Na(G,De),xe}for(ze=a(ze);!it.done;De++,it=V.next())it=K(ze,G,De,it.value,P),it!==null&&(e&&(en=it.alternate,en!==null&&ze.delete(en.key===null?De:en.key)),H=o(it,H,De),et===null?xe=it:et.sibling=it,et=it);return e&&ze.forEach(function(mb){return t(G,mb)}),Xe&&Na(G,De),xe}function Le(G,H,V,P){if(typeof V=="object"&&V!==null&&V.type===Te&&V.key===null&&V.props.ref===void 0&&(V=V.props.children),typeof V=="object"&&V!==null){switch(V.$$typeof){case re:e:{for(var xe=V.key;H!==null;){if(H.key===xe){if(xe=V.type,xe===Te){if(H.tag===7){n(G,H.sibling),P=i(H,V.props.children),Fa(P,V),P.return=G,G=P;break e}}else if(H.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===Ce&&Xi(xe)===H.type){n(G,H.sibling),P=i(H,V.props),Fa(P,V),P.return=G,G=P;break e}n(G,H);break}else t(G,H);H=H.sibling}V.type===Te?(P=Ui(V.props.children,G.mode,P,V.key),Fa(P,V),P.return=G,G=P):(P=Lc(V.type,V.key,V.props,null,G.mode,P),Fa(P,V),P.return=G,G=P)}return m(G);case we:e:{for(xe=V.key;H!==null;){if(H.key===xe)if(H.tag===4&&H.stateNode.containerInfo===V.containerInfo&&H.stateNode.implementation===V.implementation){n(G,H.sibling),P=i(H,V.children||[]),P.return=G,G=P;break e}else{n(G,H);break}else t(G,H);H=H.sibling}P=Su(V,G.mode,P),P.return=G,G=P}return m(G);case Ce:return V=Xi(V),Le(G,H,V,P)}if(ge(V))return pe(G,H,V,P);if(A(V)){if(xe=A(V),typeof xe!="function")throw Error(f(150));return V=xe.call(V),Se(G,H,V,P)}if(typeof V.then=="function")return Le(G,H,Fc(V),P);if(V.$$typeof===tt)return Le(G,H,Kc(G,V),P);Wc(G,V)}return typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint"?(V=""+V,H!==null&&H.tag===6?(n(G,H.sibling),P=i(H,V),P.return=G,G=P):(n(G,H),P=ju(V,G.mode,P),P.return=G,G=P),m(G)):n(G,H)}return function(G,H,V,P){try{Eo=0;var xe=Le(G,H,V,P);return js=null,xe}catch(ze){if(ze===ws||ze===Qc)throw ze;var et=Kn(29,ze,null,G.mode);return et.lanes=P,et.return=G,et}finally{}}}var Ki=bh(!0),xh=bh(!1),Wa=!1;function Du(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ru(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ia(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Pa(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(pt&2)!==0){var i=a.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),a.pending=t,t=$c(e),lh(e,null,n),t}return Hc(e,a,t,n),$c(e)}function Mo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,fe(e,n)}}function _u(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var m={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};o===null?i=o=m:o=o.next=m,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:a.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:a.shared,callbacks:a.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Bu=!1;function ko(){if(Bu){var e=xs;if(e!==null)throw e}}function zo(e,t,n,a){Bu=!1;var i=e.updateQueue;Wa=!1;var o=i.firstBaseUpdate,m=i.lastBaseUpdate,w=i.shared.pending;if(w!==null){i.shared.pending=null;var O=w,q=O.next;O.next=null,m===null?o=q:m.next=q,m=O;var Z=e.alternate;Z!==null&&(Z=Z.updateQueue,w=Z.lastBaseUpdate,w!==m&&(w===null?Z.firstBaseUpdate=q:w.next=q,Z.lastBaseUpdate=O))}if(o!==null){var ee=i.baseState;m=0,Z=q=O=null,w=o;do{var L=w.lane&-536870913,K=L!==w.lane;if(K?(Pe&L)===L:(a&L)===L){L!==0&&L===Gi&&(Bu=!0),Z!==null&&(Z=Z.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var pe=e,Se=w;L=t;var Le=n;switch(Se.tag){case 1:if(pe=Se.payload,typeof pe=="function"){ee=pe.call(Le,ee,L);break e}ee=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=Se.payload,L=typeof pe=="function"?pe.call(Le,ee,L):pe,L==null)break e;ee=oe({},ee,L);break e;case 2:Wa=!0}}L=w.callback,L!==null&&(e.flags|=64,K&&(e.flags|=8192),K=i.callbacks,K===null?i.callbacks=[L]:K.push(L))}else K={lane:L,tag:w.tag,payload:w.payload,callback:w.callback,next:null},Z===null?(q=Z=K,O=ee):Z=Z.next=K,m|=L;if(w=w.next,w===null){if(w=i.shared.pending,w===null)break;K=w,w=K.next,K.next=null,i.lastBaseUpdate=K,i.shared.pending=null}}while(!0);Z===null&&(O=ee),i.baseState=O,i.firstBaseUpdate=q,i.lastBaseUpdate=Z,o===null&&(i.shared.lanes=0),si|=m,e.lanes=m,e.memoizedState=ee}}function wh(e,t){if(typeof e!="function")throw Error(f(191,e));e.call(t)}function jh(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)wh(n[e],t)}var ei=Rt(null),Ic=Rt(0);function Sh(e,t){e=Aa,Re(Ic,e),Re(ei,t),Aa=e|t.baseLanes}function Uu(){Re(Ic,Aa),Re(ei,ei.current)}function Hu(){Aa=Ic.current,Ee(ei),Ee(Ic)}var gn=Rt(null),En=null;function ti(e){var t=e.alternate;Re(pn,pn.current&1),Re(gn,e),En===null&&(t===null||ei.current!==null||t.memoizedState!==null)&&(En=e)}function $u(e){Re(pn,pn.current),Re(gn,e),En===null&&(En=e)}function Nh(e){e.tag===22?(Re(pn,pn.current),Re(gn,e),En===null&&(En=e)):ni()}function ni(){Re(pn,pn.current),Re(gn,gn.current)}function Pn(e){Ee(gn),En===e&&(En=null),Ee(pn)}var pn=Rt(0);function Ao(e,t){Re(gn,gn.current),Re(pn,t)}function Lu(e){Ee(pn),Ee(gn),En===e&&(En=null)}function Pc(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||rf(n)||uf(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!=="independent"){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ea=0,$e=null,Tt=null,It=null,er=!1,Ss=!1,Zi=!1,tr=0,Oo=0,Ns=null,_y=0;function Gt(){throw Error(f(321))}function Yu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Tn(e[n],t[n]))return!1;return!0}function Gu(e,t,n,a,i,o){return Ea=o,$e=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ae.H=e===null||e.memoizedState===null?om:cm,Zi=!1,o=n(a,i),Zi=!1,Ss&&(o=Ch(t,n,a,i)),Th(e),o}function Th(e){ae.H=cr;var t=Tt!==null&&Tt.next!==null;if(Ea=0,It=Tt=$e=null,er=!1,Oo=0,Ns=null,t)throw Error(f(300));e===null||Pt||(e=e.dependencies,e!==null&&Vc(e)&&(Pt=!0))}function Ch(e,t,n,a){$e=e;var i=0;do{if(Ss&&(Ns=null),Oo=0,Ss=!1,25<=i)throw Error(f(301));if(i+=1,It=Tt=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}ae.H=qy,o=t(n,a)}while(Ss);return o}function By(){var e=ae.H,t=e.useState()[0];return t=typeof t.then=="function"?Do(t):t,e=e.useState()[0],(Tt!==null?Tt.memoizedState:null)!==e&&($e.flags|=1024),t}function qu(){var e=tr!==0;return tr=0,e}function Xu(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Vu(e){if(er){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}er=!1}Ea=0,It=Tt=$e=null,Ss=!1,Oo=tr=0,Ns=null}function Dn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return It===null?$e.memoizedState=It=e:It=It.next=e,It}function Qt(){if(Tt===null){var e=$e.alternate;e=e!==null?e.memoizedState:null}else e=Tt.next;var t=It===null?$e.memoizedState:It.next;if(t!==null)It=t,Tt=e;else{if(e===null)throw $e.alternate===null?Error(f(467)):Error(f(310));Tt=e,e={memoizedState:Tt.memoizedState,baseState:Tt.baseState,baseQueue:Tt.baseQueue,queue:Tt.queue,next:null},It===null?$e.memoizedState=It=e:It=It.next=e}return It}function nr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Do(e){var t=Oo;return Oo+=1,Ns===null&&(Ns=[]),e=ph(Ns,e,t),t=$e,(It===null?t.memoizedState:It.next)===null&&(t=t.alternate,ae.H=t===null||t.memoizedState===null?om:cm),e}function lr(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Do(e);if(e.$$typeof===E)return;if(e.$$typeof===tt)return mn(e)}throw Error(f(438,String(e)))}function Ku(e){var t=null,n=$e.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var a=$e.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=nr(),$e.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),a=0;a<e;a++)n[a]=Me;return t.index++,n}function Ma(e,t){return typeof t=="function"?t(e):t}function ar(e){var t=Qt();return Zu(t,Tt,e)}function Zu(e,t,n){var a=e.queue;if(a===null)throw Error(f(311));a.lastRenderedReducer=n;var i=e.baseQueue,o=a.pending;if(o!==null){if(i!==null){var m=i.next;i.next=o.next,o.next=m}t.baseQueue=i=o,a.pending=null}if(o=e.baseState,i===null)e.memoizedState=o;else{t=i.next;var w=m=null,O=null,q=t,Z=!1;do{var ee=q.lane&-536870913;if(ee!==q.lane?(Pe&ee)===ee:(Ea&ee)===ee){var L=q.revertLane;if(L===0)O!==null&&(O=O.next={lane:0,revertLane:0,gesture:null,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null}),ee===Gi&&(Z=!0);else if((Ea&L)===L){q=q.next,L===Gi&&(Z=!0);continue}else ee={lane:0,revertLane:q.revertLane,gesture:null,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},O===null?(w=O=ee,m=o):O=O.next=ee,$e.lanes|=L,si|=L;ee=q.action,Zi&&n(o,ee),o=q.hasEagerState?q.eagerState:n(o,ee)}else L={lane:ee,revertLane:q.revertLane,gesture:q.gesture,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},O===null?(w=O=L,m=o):O=O.next=L,$e.lanes|=ee,si|=ee;q=q.next}while(q!==null&&q!==t);if(O===null?m=o:O.next=w,!Tn(o,e.memoizedState)&&(Pt=!0,Z&&(n=xs,n!==null)))throw n;e.memoizedState=o,e.baseState=m,e.baseQueue=O,a.lastRenderedState=o}return i===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function Qu(e){var t=Qt(),n=t.queue;if(n===null)throw Error(f(311));n.lastRenderedReducer=e;var a=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var m=i=i.next;do o=e(o,m.action),m=m.next;while(m!==i);Tn(o,t.memoizedState)||(Pt=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,a]}function Eh(e,t,n){var a=$e,i=Qt(),o=Xe;if(o){if(n===void 0)throw Error(f(407));n=n()}else n=t();var m=!Tn((Tt||i).memoizedState,n);if(m&&(i.memoizedState=n,Pt=!0),i=i.queue,Wu(zh.bind(null,a,i,e),[e]),e=i.getSnapshot!==t||m||It!==null&&(It.memoizedState.tag&1)!==0,Ts(e?9:8,{destroy:void 0},kh.bind(null,a,i,n,t),null),e){if(a.flags|=2048,Ct===null)throw Error(f(349));o||(Ea&127)!==0||Mh(a,t,n)}return n}function Mh(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=$e.updateQueue,t===null?(t=nr(),$e.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function kh(e,t,n,a){t.value=n,t.getSnapshot=a,Ah(t)&&Oh(e)}function zh(e,t,n){return n(function(){Ah(t)&&Oh(e)})}function Ah(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Tn(e,n)}catch{return!0}}function Oh(e){var t=Bi(e,2);t!==null&&Fn(t,e,2)}function Ju(e){var t=Dn();if(typeof e=="function"){var n=e;if(e=n(),Zi){jn(!0);try{n()}finally{jn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ma,lastRenderedState:e},t}function Dh(e,t,n,a){return e.baseState=n,Zu(e,Tt,typeof a=="function"?a:Ma)}function Uy(e,t,n,a,i){if(or(e))throw Error(f(485));if(e=t.action,e!==null){var o={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(m){o.listeners.push(m)}};ae.T!==null?n(!0):o.isTransition=!1,a(o),n=t.pending,n===null?(o.next=t.pending=o,Rh(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Rh(e,t){var n=t.action,a=t.payload,i=e.state;if(t.isTransition){var o=ae.T,m={};m.types=o!==null?o.types:null,ae.T=m;try{var w=n(i,a),O=ae.S;O!==null&&O(m,w),_h(e,t,w)}catch(q){Fu(e,t,q)}finally{o!==null&&m.types!==null&&(o.types=m.types),ae.T=o}}else try{o=n(i,a),_h(e,t,o)}catch(q){Fu(e,t,q)}}function _h(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){Bh(e,t,a)},function(a){return Fu(e,t,a)}):Bh(e,t,n)}function Bh(e,t,n){t.status="fulfilled",t.value=n,Uh(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Rh(e,n)))}function Fu(e,t,n){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=n,Uh(t),t=t.next;while(t!==a)}e.action=null}function Uh(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Hh(e,t){return t}function $h(e,t){if(Xe){var n=Ct.formState;if(n!==null){e:{var a=$e;if(Xe){if(zt){t:{for(var i=zt,o=bl;i.nodeType!==8;){if(!o){i=null;break t}if(i=wl(i.nextSibling),i===null){i=null;break t}}o=i.data,i=o==="F!"||o==="F"?i:null}if(i){zt=wl(i.nextSibling),a=i.data==="F!";break e}}Qa(a)}a=!1}a&&(t=n[0])}}return n=Dn(),n.memoizedState=n.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hh,lastRenderedState:t},n.queue=a,n=am.bind(null,$e,a),a.dispatch=n,a=Ju(!1),o=nd.bind(null,$e,!1,a.queue),a=Dn(),i={state:t,dispatch:null,action:e,pending:null},a.queue=i,n=Uy.bind(null,$e,i,o,n),i.dispatch=n,a.memoizedState=e,[t,n,!1]}function Lh(e){var t=Qt();return Yh(t,Tt,e)}function Yh(e,t,n){if(t=Zu(e,t,Hh)[0],e=ar(Ma)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=Do(t)}catch(m){throw m===ws?Qc:m}else a=t;t=Qt();var i=t.queue,o=i.dispatch;return n!==t.memoizedState&&($e.flags|=2048,Ts(9,{destroy:void 0},Hy.bind(null,i,n),null)),[a,o,e]}function Hy(e,t){e.action=t}function Gh(e){var t=Qt(),n=Tt;if(n!==null)return Yh(t,n,e);Qt(),t=t.memoizedState,n=Qt();var a=n.queue.dispatch;return n.memoizedState=e,[t,a,!1]}function Ts(e,t,n,a){return e={tag:e,create:n,deps:a,inst:t,next:null},t=$e.updateQueue,t===null&&(t=nr(),$e.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(a=n.next,n.next=e,e.next=a,t.lastEffect=e),e}function qh(){return Qt().memoizedState}function ir(e,t,n,a){var i=Dn();$e.flags|=e,i.memoizedState=Ts(1|t,{destroy:void 0},n,a===void 0?null:a)}function sr(e,t,n,a){var i=Qt();a=a===void 0?null:a;var o=i.memoizedState.inst;Tt!==null&&a!==null&&Yu(a,Tt.memoizedState.deps)?i.memoizedState=Ts(t,o,n,a):($e.flags|=e,i.memoizedState=Ts(1|t,o,n,a))}function Xh(e,t){ir(8390656,8,e,t)}function Wu(e,t){sr(2048,8,e,t)}function $y(e){$e.flags|=4;var t=$e.updateQueue;if(t===null)t=nr(),$e.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Vh(e){var t=Qt().memoizedState;return $y({ref:t,nextImpl:e}),function(){if((pt&2)!==0)throw Error(f(440));return t.impl.apply(void 0,arguments)}}function Kh(e,t){return sr(4,2,e,t)}function Zh(e,t){return sr(4,4,e,t)}function Qh(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Jh(e,t,n){n=n!=null?n.concat([e]):null,sr(4,4,Qh.bind(null,t,e),n)}function Iu(){}function Fh(e,t){var n=Qt();t=t===void 0?null:t;var a=n.memoizedState;return t!==null&&Yu(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function Wh(e,t){var n=Qt();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&Yu(t,a[1]))return a[0];if(a=e(),Zi){jn(!0);try{e()}finally{jn(!1)}}return n.memoizedState=[a,t],a}function Pu(e,t,n){return n===void 0||(Ea&1073741824)!==0&&(Pe&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=og(),$e.lanes|=e,si|=e,n)}function Ih(e,t,n,a){return Tn(n,t)?n:ei.current!==null?(e=Pu(e,n,a),Tn(e,t)||(Pt=!0),e):(Ea&106)===0||(Ea&1073741824)!==0&&(Pe&261930)===0?(Pt=!0,e.memoizedState=n):(e=og(),$e.lanes|=e,si|=e,t)}function Ph(e,t,n,a,i){var o=de.p;de.p=o!==0&&8>o?o:8;var m=ae.T,w={};w.types=m!==null?m.types:null,ae.T=w,nd(e,!1,t,n);try{var O=i(),q=ae.S;if(q!==null&&q(w,O),O!==null&&typeof O=="object"&&typeof O.then=="function"){var Z=Ry(O,a);Ro(e,t,Z,ll(e))}else Ro(e,t,a,ll(e))}catch(ee){Ro(e,t,{then:function(){},status:"rejected",reason:ee},ll())}finally{de.p=o,m!==null&&w.types!==null&&(m.types=w.types),ae.T=m}}function Ly(){}function ed(e,t,n,a){if(e.tag!==5)throw Error(f(476));var i=em(e).queue;Ph(e,i,t,Ae,n===null?Ly:function(){return tm(e),n(a)})}function em(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Ae,baseState:Ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ma,lastRenderedState:Ae},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ma,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function tm(e){var t=em(e);t.next===null&&(t=e.alternate.memoizedState),Ro(e,t.next.queue,{},ll())}function td(){return mn(Xs)}function nm(){return Qt().memoizedState}function lm(){return Qt().memoizedState}function Yy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=ll();e=Ia(n);var a=Pa(t,e,n);a!==null&&(Fn(a,t,n),Mo(a,t,n)),t={cache:ku()},e.payload=t;return}t=t.return}}function Gy(e,t,n){var a=ll();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},or(e)?im(t,n):(n=xu(e,t,n,a),n!==null&&(Fn(n,e,a),sm(n,t,a)))}function am(e,t,n){var a=ll();Ro(e,t,n,a)}function Ro(e,t,n,a){var i={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(or(e))im(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var m=t.lastRenderedState,w=o(m,n);if(i.hasEagerState=!0,i.eagerState=w,Tn(w,m))return Hc(e,t,i,0),Ct===null&&Uc(),!1}catch{}finally{}if(n=xu(e,t,i,a),n!==null)return Fn(n,e,a),sm(n,t,a),!0}return!1}function nd(e,t,n,a){if(a={lane:2,revertLane:Kd(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},or(e)){if(t)throw Error(f(479))}else t=xu(e,n,a,2),t!==null&&Fn(t,e,2)}function or(e){var t=e.alternate;return e===$e||t!==null&&t===$e}function im(e,t){Ss=er=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function sm(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,fe(e,n)}}var cr={readContext:mn,use:lr,useCallback:Gt,useContext:Gt,useEffect:Gt,useImperativeHandle:Gt,useLayoutEffect:Gt,useInsertionEffect:Gt,useMemo:Gt,useReducer:Gt,useRef:Gt,useState:Gt,useDebugValue:Gt,useDeferredValue:Gt,useTransition:Gt,useSyncExternalStore:Gt,useId:Gt,useHostTransitionStatus:Gt,useFormState:Gt,useActionState:Gt,useOptimistic:Gt,useMemoCache:Gt,useCacheRefresh:Gt,useEffectEvent:Gt},om={readContext:mn,use:lr,useCallback:function(e,t){return Dn().memoizedState=[e,t===void 0?null:t],e},useContext:mn,useEffect:Xh,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,ir(4194308,4,Qh.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ir(4194308,4,e,t)},useInsertionEffect:function(e,t){ir(4,2,e,t)},useMemo:function(e,t){var n=Dn();t=t===void 0?null:t;var a=e();if(Zi){jn(!0);try{e()}finally{jn(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=Dn();if(n!==void 0){var i=n(t);if(Zi){jn(!0);try{n(t)}finally{jn(!1)}}}else i=t;return a.memoizedState=a.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},a.queue=e,e=e.dispatch=Gy.bind(null,$e,e),[a.memoizedState,e]},useRef:function(e){var t=Dn();return e={current:e},t.memoizedState=e},useState:function(e){e=Ju(e);var t=e.queue,n=am.bind(null,$e,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Iu,useDeferredValue:function(e,t){var n=Dn();return Pu(n,e,t)},useTransition:function(){var e=Ju(!1);return e=Ph.bind(null,$e,e.queue,!0,!1),Dn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=$e,i=Dn();if(Xe){if(n===void 0)throw Error(f(407));n=n()}else{if(n=t(),Ct===null)throw Error(f(349));(Pe&127)!==0||Mh(a,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Xh(zh.bind(null,a,o,e),[e]),a.flags|=2048,Ts(9,{destroy:void 0},kh.bind(null,a,o,n,t),null),n},useId:function(){var e=Dn(),t=Ct.identifierPrefix;if(Xe){var n=Jl,a=Ql;n=(a&~(1<<32-Ut(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=tr++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=_y++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:td,useFormState:$h,useActionState:$h,useOptimistic:function(e){var t=Dn();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=nd.bind(null,$e,!0,n),n.dispatch=t,[e,t]},useMemoCache:Ku,useCacheRefresh:function(){return Dn().memoizedState=Yy.bind(null,$e)},useEffectEvent:function(e){var t=Dn(),n={impl:e};return t.memoizedState=n,function(){if((pt&2)!==0)throw Error(f(440));return n.impl.apply(void 0,arguments)}}},cm={readContext:mn,use:lr,useCallback:Fh,useContext:mn,useEffect:Wu,useImperativeHandle:Jh,useInsertionEffect:Kh,useLayoutEffect:Zh,useMemo:Wh,useReducer:ar,useRef:qh,useState:function(){return ar(Ma)},useDebugValue:Iu,useDeferredValue:function(e,t){var n=Qt();return Ih(n,Tt.memoizedState,e,t)},useTransition:function(){var e=ar(Ma)[0],t=Qt().memoizedState;return[typeof e=="boolean"?e:Do(e),t]},useSyncExternalStore:Eh,useId:nm,useHostTransitionStatus:td,useFormState:Lh,useActionState:Lh,useOptimistic:function(e,t){var n=Qt();return Dh(n,Tt,e,t)},useMemoCache:Ku,useCacheRefresh:lm,useEffectEvent:Vh},qy={readContext:mn,use:lr,useCallback:Fh,useContext:mn,useEffect:Wu,useImperativeHandle:Jh,useInsertionEffect:Kh,useLayoutEffect:Zh,useMemo:Wh,useReducer:Qu,useRef:qh,useState:function(){return Qu(Ma)},useDebugValue:Iu,useDeferredValue:function(e,t){var n=Qt();return Tt===null?Pu(n,e,t):Ih(n,Tt.memoizedState,e,t)},useTransition:function(){var e=Qu(Ma)[0],t=Qt().memoizedState;return[typeof e=="boolean"?e:Do(e),t]},useSyncExternalStore:Eh,useId:nm,useHostTransitionStatus:td,useFormState:Gh,useActionState:Gh,useOptimistic:function(e,t){var n=Qt();return Tt!==null?Dh(n,Tt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Ku,useCacheRefresh:lm,useEffectEvent:Vh};function ld(e,t,n,a){t=e.memoizedState,n=n(a,t),n=n==null?t:oe({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var ad={enqueueSetState:function(e,t,n){e=e._reactInternals;var a=ll(),i=Ia(a);i.payload=t,n!=null&&(i.callback=n),t=Pa(e,i,a),t!==null&&(Fn(t,e,a),Mo(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=ll(),i=Ia(a);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Pa(e,i,a),t!==null&&(Fn(t,e,a),Mo(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ll(),a=Ia(n);a.tag=2,t!=null&&(a.callback=t),t=Pa(e,a,n),t!==null&&(Fn(t,e,n),Mo(t,e,n))}};function rm(e,t,n,a,i,o,m){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,o,m):t.prototype&&t.prototype.isPureReactComponent?!Va(n,a)||!Va(i,o):!0}function um(e,t,n,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,a),t.state!==e&&ad.enqueueReplaceState(t,t.state,null)}function Qi(e,t){var n=t;if("ref"in t){n={};for(var a in t)a!=="ref"&&(n[a]=t[a])}if(e=e.defaultProps){n===t&&(n=oe({},n));for(var i in e)n[i]===void 0&&(n[i]=e[i])}return n}function dm(e){Bc(e)}function fm(e){console.error(e)}function hm(e){Bc(e)}function rr(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function mm(e,t,n){try{var a=e.onCaughtError;a(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function id(e,t,n){return n=Ia(n),n.tag=3,n.payload={element:null},n.callback=function(){rr(e,t)},n}function gm(e){return e=Ia(e),e.tag=3,e}function pm(e,t,n,a){var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var o=a.value;e.payload=function(){return i(o)},e.callback=function(){mm(t,n,a)}}var m=n.stateNode;m!==null&&typeof m.componentDidCatch=="function"&&(e.callback=function(){mm(t,n,a),typeof i!="function"&&(oi===null?oi=new Set([this]):oi.add(this));var w=a.stack;this.componentDidCatch(a.value,{componentStack:w!==null?w:""})})}function Xy(e,t,n,a,i){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=n.alternate,t!==null&&Li(t,n,i,!0),n=gn.current,n!==null){switch(n.tag){case 31:case 13:case 19:return En===null?zr():n.alternate===null&&qt===0&&(qt=3),n.flags&=-257,n.flags|=65536,n.lanes=i,a===Jc?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),qd(e,a,i)),!1;case 22:return n.flags|=65536,a===Jc?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([a]):n.add(a)),qd(e,a,i)),!1}throw Error(f(435,n.tag))}return qd(e,a,i),zr(),!1}if(Xe)return t=gn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=i,a!==Tu&&(e=Error(f(422),{cause:a}),So(pl(e,n)))):(a!==Tu&&(t=Error(f(423),{cause:a}),So(pl(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,a=pl(a,n),i=id(e.stateNode,a,i),_u(e,i),qt!==4&&(qt=2)),!1;var o=Error(f(520),{cause:a});if(o=pl(o,n),Go===null?Go=[o]:Go.push(o),qt!==4&&(qt=2),t===null)return!0;a=pl(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=id(n.stateNode,a,e),_u(n,e),!1;case 1:if(t=n.type,o=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||o!==null&&typeof o.componentDidCatch=="function"&&(oi===null||!oi.has(o))))return n.flags|=65536,i&=-i,n.lanes|=i,i=gm(i),pm(i,e,n,a),_u(n,i),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var sd=Error(f(461)),Pt=!1;function an(e,t,n,a){t.child=e===null?xh(t,null,n,a):Ki(t,e.child,n,a)}function ym(e,t,n,a,i){n=n.render;var o=t.ref;if("ref"in a){var m={};for(var w in a)w!=="ref"&&(m[w]=a[w])}else m=a;return Yi(t),a=Gu(e,t,n,m,o,i),w=qu(),e!==null&&!Pt?(Xu(e,t,i),ka(e,t,i)):(Xe&&w&&Gc(t),t.flags|=1,an(e,t,a,i),t.child)}function vm(e,t,n,a,i){if(e===null){var o=n.type;return typeof o=="function"&&!wu(o)&&o.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=o,bm(e,t,o,a,i)):(e=Lc(n.type,null,a,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!md(e,i)){var m=o.memoizedProps;if(n=n.compare,n=n!==null?n:Va,n(m,a)&&e.ref===t.ref)return ka(e,t,i)}return t.flags|=1,e=Sa(o,a),e.ref=t.ref,e.return=t,t.child=e}function bm(e,t,n,a,i){if(e!==null){var o=e.memoizedProps;if(Va(o,a)&&e.ref===t.ref)if(Pt=!1,t.pendingProps=a=o,md(e,i))(e.flags&131072)!==0&&(Pt=!0);else return t.lanes=e.lanes,ka(e,t,i)}return od(e,t,n,a,i)}function xm(e,t,n,a){var i=a.children,o=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(o=o!==null?o.baseLanes|n:n,e!==null){for(a=t.child=e.child,i=0;a!==null;)i=i|a.lanes|a.childLanes,a=a.sibling;a=i&~o}else a=0,t.child=null;return wm(e,t,o,n,a)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Zc(t,o!==null?o.cachePool:null),o!==null?Sh(t,o):Uu(),Nh(t);else return a=t.lanes=536870912,wm(e,t,o!==null?o.baseLanes|n:n,n,a)}else o!==null?(Zc(t,o.cachePool),Sh(t,o),ni(),t.memoizedState=null):(e!==null&&Zc(t,null),Uu(),ni());return an(e,t,i,n),t.child}function _o(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function wm(e,t,n,a,i){var o=Au();return o=o===null?null:{parent:Wt._currentValue,pool:o},t.memoizedState={baseLanes:n,cachePool:o},e!==null&&Zc(t,null),Uu(),Nh(t),e!==null&&Li(e,t,a,!0),t.childLanes=i,null}function ur(e,t){return t=dr({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function jm(e,t,n){return Ki(t,e.child,null,n),e=ur(t,t.pendingProps),e.flags|=2,Pn(t),t.memoizedState=null,e}function Vy(e,t,n){var a=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Xe){if(a.mode==="hidden")return e=ur(t,a),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},_o(null,e);if($u(t),(e=zt)?(e=Qg(e,bl),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ka!==null?{id:Ql,overflow:Jl}:null,retryLane:536870912,hydrationErrors:null},n=ih(e),n.return=t,t.child=n,on=t,zt=null)):e=null,e===null)throw Qa(t);return t.lanes=536870912,null}return ur(t,a)}var o=e.memoizedState;if(o!==null){var m=o.dehydrated;if($u(t),i)if(t.flags&256)t.flags&=-257,t=jm(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(f(558));else if(Pt||Li(e,t,n,!1),i=(n&e.childLanes)!==0,Pt||i){if(ei.current===null){if(a=Ct,a!==null&&(m=ke(a,n),m!==0&&m!==o.retryLane))throw o.retryLane=m,Bi(e,m),Fn(a,e,m),sd;zr()}t=jm(e,t,n)}else e=o.treeContext,zt=wl(m.nextSibling),on=t,Xe=!0,Za=null,bl=!1,e!==null&&ch(t,e),t=ur(t,a),t.flags|=134221824;return t}return e=Sa(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Cs(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(f(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function od(e,t,n,a,i){return Yi(t),n=Gu(e,t,n,a,void 0,i),a=qu(),e!==null&&!Pt?(Xu(e,t,i),ka(e,t,i)):(Xe&&a&&Gc(t),t.flags|=1,an(e,t,n,i),t.child)}function Sm(e,t,n,a,i,o){return Yi(t),t.updateQueue=null,n=Ch(t,a,n,i),Th(e),a=qu(),e!==null&&!Pt?(Xu(e,t,o),ka(e,t,o)):(Xe&&a&&Gc(t),t.flags|=1,an(e,t,n,o),t.child)}function Nm(e,t,n,a,i){if(Yi(t),t.stateNode===null){var o=ps,m=n.contextType;typeof m=="object"&&m!==null&&(o=mn(m)),o=new n(a,o),t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=ad,t.stateNode=o,o._reactInternals=t,o=t.stateNode,o.props=a,o.state=t.memoizedState,o.refs={},Du(t),m=n.contextType,o.context=typeof m=="object"&&m!==null?mn(m):ps,o.state=t.memoizedState,m=n.getDerivedStateFromProps,typeof m=="function"&&(ld(t,n,m,a),o.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(m=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),m!==o.state&&ad.enqueueReplaceState(o,o.state,null),zo(t,a,o,i),ko(),o.state=t.memoizedState),typeof o.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){o=t.stateNode;var w=t.memoizedProps,O=Qi(n,w);o.props=O;var q=o.context,Z=n.contextType;m=ps,typeof Z=="object"&&Z!==null&&(m=mn(Z));var ee=n.getDerivedStateFromProps;Z=typeof ee=="function"||typeof o.getSnapshotBeforeUpdate=="function",w=t.pendingProps!==w,Z||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(w||q!==m)&&um(t,o,a,m),Wa=!1;var L=t.memoizedState;o.state=L,zo(t,a,o,i),ko(),q=t.memoizedState,w||L!==q||Wa?(typeof ee=="function"&&(ld(t,n,ee,a),q=t.memoizedState),(O=Wa||rm(t,n,O,a,L,q,m))?(Z||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=q),o.props=a,o.state=q,o.context=m,a=O):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{o=t.stateNode,Ru(e,t),m=t.memoizedProps,Z=Qi(n,m),o.props=Z,ee=t.pendingProps,L=o.context,q=n.contextType,O=ps,typeof q=="object"&&q!==null&&(O=mn(q)),w=n.getDerivedStateFromProps,(q=typeof w=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(m!==ee||L!==O)&&um(t,o,a,O),Wa=!1,L=t.memoizedState,o.state=L,zo(t,a,o,i),ko();var K=t.memoizedState;m!==ee||L!==K||Wa||e!==null&&e.dependencies!==null&&Vc(e.dependencies)?(typeof w=="function"&&(ld(t,n,w,a),K=t.memoizedState),(Z=Wa||rm(t,n,Z,a,L,K,O)||e!==null&&e.dependencies!==null&&Vc(e.dependencies))?(q||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(a,K,O),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(a,K,O)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||m===e.memoizedProps&&L===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&L===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=K),o.props=a,o.state=K,o.context=O,a=Z):(typeof o.componentDidUpdate!="function"||m===e.memoizedProps&&L===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&L===e.memoizedState||(t.flags|=1024),a=!1)}return o=a,Cs(e,t),a=(t.flags&128)!==0,o||a?(o=t.stateNode,n=a&&typeof n.getDerivedStateFromError!="function"?null:o.render(),t.flags|=1,e!==null&&a?(t.child=Ki(t,e.child,null,i),t.child=Ki(t,null,n,i)):an(e,t,n,i),t.memoizedState=o.state,e=t.child):e=ka(e,t,i),e}function Tm(e,t,n,a){return Hi(),t.flags|=256,an(e,t,n,a),t.child}var cd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function rd(e){return{baseLanes:e,cachePool:mh()}}function ud(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=nl),e}function Cm(e,t,n){var a=t.pendingProps,i=!1,o=(t.flags&128)!==0,m;if((m=o)||(m=e!==null&&e.memoizedState===null?!1:(pn.current&2)!==0),m&&(i=!0,t.flags&=-129),m=(t.flags&32)!==0,t.flags&=-33,e===null){if(Xe){if(i?ti(t):ni(),(e=zt)?(e=Qg(e,bl),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ka!==null?{id:Ql,overflow:Jl}:null,retryLane:536870912,hydrationErrors:null},n=ih(e),n.return=t,t.child=n,on=t,zt=null)):e=null,e===null)throw Qa(t);return uf(e)?t.lanes=32:t.lanes=536870912,null}return o=a.children,a=a.fallback,i?(ni(),i=t.mode,o=dr({mode:"hidden",children:o},i),a=Ui(a,i,n,null),o.return=t,a.return=t,o.sibling=a,t.child=o,a=t.child,a.memoizedState=rd(n),a.childLanes=ud(e,m,n),t.memoizedState=cd,_o(null,a)):(ti(t),dd(t,o))}var w=e.memoizedState;if(w!==null){var O=w.dehydrated;if(O!==null)return Ky(e,t,o,m,a,O,w,n)}return i?(ni(),i=a.fallback,o=t.mode,w=e.child,O=w.sibling,a=Sa(w,{mode:"hidden",children:a.children}),a.subtreeFlags=w.subtreeFlags&1206910976,O!==null?i=Sa(O,i):(i=Ui(i,o,n,null),i.flags|=2),i.return=t,a.return=t,a.sibling=i,t.child=a,_o(null,a),a=t.child,i=e.child.memoizedState,i===null?i=rd(n):(o=i.cachePool,o!==null?(w=Wt._currentValue,o=o.parent!==w?{parent:w,pool:w}:o):o=mh(),i={baseLanes:i.baseLanes|n,cachePool:o}),a.memoizedState=i,a.childLanes=ud(e,m,n),t.memoizedState=cd,_o(e.child,a)):(ti(t),n=e.child,e=n.sibling,n=Sa(n,{mode:"visible",children:a.children}),n.return=t,n.sibling=null,e!==null&&(m=t.deletions,m===null?(t.deletions=[e],t.flags|=16):m.push(e)),t.child=n,t.memoizedState=null,n)}function dd(e,t){return t=dr({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function dr(e,t){return e=Kn(22,e,null,t),e.lanes=0,e}function fr(e,t,n){return Ki(t,e.child,null,n),e=dd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ky(e,t,n,a,i,o,m,w){if(n)return t.flags&256?(ti(t),t.flags&=-257,fr(e,t,w)):t.memoizedState!==null?(ni(),t.child=e.child,t.flags|=128,null):(ni(),o=i.fallback,m=t.mode,i=dr({mode:"visible",children:i.children},m),o=Ui(o,m,w,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,Ki(t,e.child,null,w),i=t.child,i.memoizedState=rd(w),i.childLanes=ud(e,a,w),t.memoizedState=cd,_o(null,i));if(ti(t),uf(o)){if(a=o.nextSibling&&o.nextSibling.dataset,a)var O=a.dgst;return a=O,a!==""&&(i=Error(f(419)),i.stack="",i.digest=a,So({value:i,source:null,stack:null})),fr(e,t,w)}if(Pt||Li(e,t,w,!1),a=(w&e.childLanes)!==0,Pt||a){if(ei.current!==null)return fr(e,t,w);if(a=Ct,a!==null&&(i=ke(a,w),i!==0&&i!==m.retryLane))throw m.retryLane=i,Bi(e,i),Fn(a,e,i),sd;return rf(o)||zr(),fr(e,t,w)}return rf(o)?(t.flags|=192,t.child=e.child,null):(e=m.treeContext,zt=wl(o.nextSibling),on=t,Xe=!0,Za=null,bl=!1,e!==null&&ch(t,e),t=dd(t,i.children),t.flags|=134221824,t)}function Em(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),Xc(e.return,t,n)}function Mm(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Pc(n)===null&&(t=e),e=e.sibling}return t}function hr(e,t,n,a,i,o){var m=e.memoizedState;m===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:i,treeForkCount:o}:(m.isBackwards=t,m.rendering=null,m.renderingStartTime=0,m.last=a,m.tail=n,m.tailMode=i,m.treeForkCount=o)}function fd(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function hd(e,t,n){var a=t.pendingProps,i=a.revealOrder,o=a.tail;a=a.children;var m=pn.current;if(t.flags&128)return Ao(t,m),null;var w=(m&2)!==0;if(w?(m=m&1|2,t.flags|=128):m&=1,Ao(t,m),i==="backwards"&&e!==null?(fd(e),an(e,t,a,n),fd(e)):an(e,t,a,n),a=Xe?jo:0,!w&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Em(e,n,t);else if(e.tag===19)Em(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case"backwards":n=Mm(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,fd(t)),hr(t,!0,i,null,o,a);break;case"unstable_legacy-backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Pc(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}hr(t,!0,n,null,o,a);break;case"together":hr(t,!1,null,null,void 0,a);break;case"independent":t.memoizedState=null;break;default:n=Mm(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),hr(t,!1,i,n,o,a)}return t.child}function km(e,t,n){var a=t.pendingProps;return Ja(t,t.type,a.value),an(e,t,a.children,n),t.child}function ka(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),si|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Li(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(f(153));if(t.child!==null){for(e=t.child,n=Sa(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Sa(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function md(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Vc(e)))}function Zy(e,t,n){switch(t.tag){case 3:Sl(t,t.stateNode.containerInfo),Ja(t,Wt,e.memoizedState.cache),Hi();break;case 27:case 5:sa(t);break;case 4:Sl(t,t.stateNode.containerInfo);break;case 10:Ja(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,$u(t),null;break;case 13:var a=t.memoizedState;if(a!==null){if(a.dehydrated!==null)return ti(t),t.flags|=128,null;a=Li(e,t,n,!1);var i=t.child.childLanes;return a||(n&i)!==0?Cm(e,t,n):(ti(t),e=ka(e,t,n),e!==null?e.sibling:null)}ti(t);break;case 19:if(t.flags&128)return hd(e,t,n);if(i=(e.flags&128)!==0,a=(n&t.childLanes)!==0,a||(Li(e,t,n,!1),a=(n&t.childLanes)!==0),i){if(a)return hd(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ao(t,pn.current),a)break;return null;case 22:return t.lanes=0,xm(e,t,n,t.pendingProps);case 24:Ja(t,Wt,e.memoizedState.cache)}return ka(e,t,n)}function zm(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Pt=!0;else{if(!md(e,n)&&(t.flags&128)===0)return Pt=!1,Zy(e,t,n);Pt=(e.flags&131072)!==0}else Pt=!1,Xe&&(t.flags&1048576)!==0&&oh(t,jo,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=Xi(t.elementType),t.type=e,typeof e=="function")wu(e)?(a=Qi(e,a),t.tag=1,t=Nm(null,t,e,a,n)):(t.tag=0,t=od(null,t,e,a,n));else{if(e!=null){var i=e.$$typeof;if(i===ue){t.tag=11,t=ym(null,t,e,a,n);break e}else if(i===je){t.tag=14,t=vm(null,t,e,a,n);break e}else if(i===tt){t.tag=10,t.type=e,t=km(null,t,n);break e}}throw t=se(e)||e,Error(f(306,t,""))}}return t;case 0:return od(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,i=Qi(a,t.pendingProps),Nm(e,t,a,i,n);case 3:e:{if(Sl(t,t.stateNode.containerInfo),e===null)throw Error(f(387));a=t.pendingProps;var o=t.memoizedState;i=o.element,Ru(e,t),zo(t,a,null,n);var m=t.memoizedState;if(a=m.cache,Ja(t,Wt,a),a!==o.cache&&Mu(t,[Wt],n,!0),ko(),a=m.element,o.isDehydrated)if(o={element:a,isDehydrated:!1,cache:m.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Tm(e,t,a,n);break e}else if(a!==i){i=pl(Error(f(424)),t),So(i),t=Tm(e,t,a,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(zt=wl(e.firstChild),on=t,Xe=!0,Za=null,bl=!0,n=xh(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(Hi(),a===i){t=ka(e,t,n);break e}an(e,t,a,n)}t=t.child}return t;case 26:return Cs(e,t),e===null?(n=tp(t.type,null,t.pendingProps,null))?t.memoizedState=n:Xe||(t.stateNode=Rg(t.type,t.pendingProps,ht.current,t)):t.memoizedState=tp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return sa(t),e===null&&Xe&&(a=t.stateNode=Wg(t.type,t.pendingProps,ht.current),on=t,bl=!0,i=zt,ui(t.type)?(df=i,zt=wl(a.firstChild)):zt=i),an(e,t,t.pendingProps.children,n),Cs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Xe&&((i=a=zt)&&(a=Yv(a,t.type,t.pendingProps,bl),a!==null?(t.stateNode=a,on=t,zt=wl(a.firstChild),bl=!1,i=!0):i=!1),i||Qa(t)),sa(t),i=t.type,o=t.pendingProps,m=e!==null?e.memoizedProps:null,a=o.children,tf(i,o)?a=null:m!==null&&tf(i,m)&&(t.flags|=32),t.memoizedState!==null&&(i=Gu(e,t,By,null,null,n),Xs._currentValue=i),Cs(e,t),an(e,t,a,n),t.child;case 6:return e===null&&Xe&&((e=n=zt)&&(n=Gv(n,t.pendingProps,bl),n!==null?(t.stateNode=n,on=t,zt=null,e=!0):e=!1),e||Qa(t)),null;case 13:return Cm(e,t,n);case 4:return Sl(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=Ki(t,null,a,n):an(e,t,a,n),t.child;case 11:return ym(e,t,t.type,t.pendingProps,n);case 7:return a=t.pendingProps,Cs(e,t),an(e,t,a,n),t.child;case 8:return an(e,t,t.pendingProps.children,n),t.child;case 12:return an(e,t,t.pendingProps.children,n),t.child;case 10:return km(e,t,n);case 9:return i=t.type._context,a=t.pendingProps.children,Yi(t),i=mn(i),a=a(i),t.flags|=1,an(e,t,a,n),t.child;case 14:return vm(e,t,t.type,t.pendingProps,n);case 15:return bm(e,t,t.type,t.pendingProps,n);case 19:return hd(e,t,n);case 31:return Vy(e,t,n);case 22:return xm(e,t,n,t.pendingProps);case 24:return Yi(t),a=mn(Wt),e===null?(i=Au(),i===null&&(i=Ct,o=ku(),i.pooledCache=o,o.refCount++,o!==null&&(i.pooledCacheLanes|=n),i=o),t.memoizedState={parent:a,cache:i},Du(t),Ja(t,Wt,i)):((e.lanes&n)!==0&&(Ru(e,t),zo(t,null,null,n),ko()),i=e.memoizedState,o=t.memoizedState,i.parent!==a?(i={parent:a,cache:a},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),Ja(t,Wt,a)):(a=o.cache,Ja(t,Wt,a),a!==i.cache&&Mu(t,[Wt],n,!0))),an(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),a=t.pendingProps,a.name!=null&&a.name!=="auto"?t.flags|=e===null?18882560:18874368:Xe&&Gc(t),e!==null&&e.memoizedProps.name!==a.name?t.flags|=4194816:Cs(e,t),an(e,t,a.children,n),t.child;case 29:throw t.pendingProps}throw Error(f(156,t.tag))}function za(e){e.flags|=4}function gd(e,t,n,a,i){var o;if((o=(e.mode&32)!==0)&&(o=n===null?ip(t,a):ip(t,a)&&(a.src!==n.src||a.srcSet!==n.srcSet)),o){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(dg())e.flags|=8192;else throw Vi=Jc,Ou}else e.flags&=-16777217}function Am(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!sp(t))if(dg())e.flags|=8192;else throw Vi=Jc,Ou}function mr(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ln():536870912,e.lanes|=t,As|=t)}function Bo(e,t){if(!Xe)switch(e.tailMode){case"visible":break;case"collapsed":for(var n=e.tail,a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function At(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,a=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,a|=i.subtreeFlags&1206910976,a|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,a|=i.subtreeFlags,a|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=a,e.childLanes=n,t}function Qy(e,t,n){var a=t.pendingProps;switch(Nu(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return At(t),null;case 1:return At(t),null;case 3:return n=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Ca(Wt),Nl(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(bs(t)?za(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Cu())),At(t),null;case 26:var i=t.type,o=t.memoizedState;return e===null?(za(t),o!==null?(At(t),Am(t,o)):(At(t),gd(t,i,null,a,n))):o?o!==e.memoizedState?(za(t),At(t),Am(t,o)):(At(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&za(t),At(t),gd(t,i,e,a,n)),null;case 27:if(Un(t),n=ht.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&za(t);else{if(!a){if(t.stateNode===null)throw Error(f(166));return At(t),t.subtreeFlags&=-33554433,null}e=at.current,bs(t)?rh(t):(e=Wg(i,a,n),t.stateNode=e,za(t))}return At(t),t.subtreeFlags&=-33554433,null;case 5:if(Un(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&za(t);else{if(!a){if(t.stateNode===null)throw Error(f(166));return At(t),t.subtreeFlags&=-33554433,null}if(o=at.current,bs(t))rh(t);else{var m=Zo(ht.current);switch(o){case 1:o=m.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:o=m.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":o=m.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":o=m.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":o=m.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof a.is=="string"?m.createElement("select",{is:a.is}):m.createElement("select"),a.multiple?o.multiple=!0:a.size&&(o.size=a.size);break;default:o=typeof a.is=="string"?m.createElement(i,{is:a.is}):m.createElement(i)}}o[_t]=t,o[Ke]=a;e:for(m=t.child;m!==null;){if(m.tag===5||m.tag===6)o.appendChild(m.stateNode);else if(m.tag!==4&&m.tag!==27&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===t)break e;for(;m.sibling===null;){if(m.return===null||m.return===t)break e;m=m.return}m.sibling.return=m.return,m=m.sibling}t.stateNode=o;e:switch(vn(o,i,a),i){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&za(t)}}return At(t),t.subtreeFlags&=-33554433,gd(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&za(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(f(166));if(e=ht.current,bs(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,i=on,i!==null)switch(i.tag){case 27:case 5:a=i.memoizedProps}e[_t]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||zg(e.nodeValue,n)),e||Qa(t,!0)}else e=Zo(e).createTextNode(a),e[_t]=t,t.stateNode=e}return At(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=bs(t),n!==null){if(e===null){if(!a)throw Error(f(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(f(557));e[_t]=t}else Hi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;At(t),e=!1}else n=Cu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Pn(t),t):(Pn(t),null);if((t.flags&128)!==0)throw Error(f(558))}return At(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=bs(t),a!==null&&a.dehydrated!==null){if(e===null){if(!i)throw Error(f(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(f(317));i[_t]=t}else Hi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;At(t),i=!1}else i=Cu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Pn(t),t):(Pn(t),null)}return Pn(t),(t.flags&128)!==0?(t.lanes=n,t):(n=a!==null,e=e!==null&&e.memoizedState!==null,n&&(a=t.child,i=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(i=a.alternate.memoizedState.cachePool.pool),o=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(o=a.memoizedState.cachePool.pool),o!==i&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),mr(t,t.updateQueue),At(t),null);case 4:return Nl(),e===null&&Fd(t.stateNode.containerInfo),t.flags|=67108864,At(t),null;case 10:return Ca(t.type),At(t),null;case 19:if(Lu(t),a=t.memoizedState,a===null)return At(t),null;if(i=(t.flags&128)!==0,o=a.rendering,o===null)if(i)Bo(a,!1);else{if(qt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=Pc(e),o!==null){for(t.flags|=128,Bo(a,!1),e=o.updateQueue,t.updateQueue=e,mr(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ah(n,e),n=n.sibling;return Ao(t,pn.current&1|2),Xe&&Na(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&rt()>Cr&&(t.flags|=128,i=!0,Bo(a,!1),t.lanes=4194304)}else{if(!i)if(e=Pc(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,mr(t,e),Bo(a,!0),a.tail===null&&a.tailMode!=="collapsed"&&a.tailMode!=="visible"&&!o.alternate&&!Xe)return At(t),null}else 2*rt()-a.renderingStartTime>Cr&&n!==536870912&&(t.flags|=128,i=!0,Bo(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(e=a.last,e!==null?e.sibling=o:t.child=o,a.last=o)}if(a.tail!==null){e=a.tail;e:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break e}n=n.sibling}n=!0}return a.rendering=e,a.tail=e.sibling,a.renderingStartTime=rt(),e.sibling=null,o=pn.current,o=i?o&1|2:o&1,a.tailMode==="visible"||a.tailMode==="collapsed"||!n||Xe?Ao(t,o):(n=o,Re(gn,t),Re(pn,n),En===null&&(En=t)),Xe&&Na(t,a.treeForkCount),e}return At(t),null;case 22:case 23:return Pn(t),Hu(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(n&536870912)!==0&&(t.flags&128)===0&&(At(t),t.subtreeFlags&6&&(t.flags|=8192)):At(t),n=t.updateQueue,n!==null&&mr(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==n&&(t.flags|=2048),e!==null&&Ee(qi),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ca(Wt),At(t),null;case 25:return null;case 30:return t.flags|=33554432,At(t),null}throw Error(f(156,t.tag))}function Jy(e,t){switch(Nu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ca(Wt),Nl(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Un(t),null;case 31:if(t.memoizedState!==null){if(Pn(t),t.alternate===null)throw Error(f(340));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Pn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(f(340));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Lu(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Nl(),null;case 10:return Ca(t.type),null;case 22:case 23:return Pn(t),Hu(),e!==null&&Ee(qi),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ca(Wt),null;case 25:return null;default:return null}}function Om(e,t){switch(Nu(t),t.tag){case 3:Ca(Wt),Nl();break;case 26:case 27:case 5:Un(t);break;case 4:Nl();break;case 31:t.memoizedState!==null&&Pn(t);break;case 13:Pn(t);break;case 19:Lu(t);break;case 10:Ca(t.type);break;case 22:case 23:Pn(t),Hu(),e!==null&&Ee(qi);break;case 24:Ca(Wt)}}function Uo(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var i=a.next;n=i;do{if((n.tag&e)===e){a=void 0;var o=n.create,m=n.inst;a=o(),m.destroy=a}n=n.next}while(n!==i)}}catch(w){bt(t,t.return,w)}}function li(e,t,n){try{var a=t.updateQueue,i=a!==null?a.lastEffect:null;if(i!==null){var o=i.next;a=o;do{if((a.tag&e)===e){var m=a.inst,w=m.destroy;if(w!==void 0){m.destroy=void 0,i=t;var O=n,q=w;try{q()}catch(Z){bt(i,O,Z)}}}a=a.next}while(a!==o)}}catch(Z){bt(t,t.return,Z)}}function Dm(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{jh(t,n)}catch(a){bt(e,e.return,a)}}}function Rm(e,t,n){n.props=Qi(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){bt(e,t,a)}}function Fl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:var i=e.stateNode,o=qe(e.memoizedProps,i);(i.ref===null||i.ref.name!==o)&&(i.ref=Yg(o)),a=i.ref;break;case 7:if(e.stateNode===null){var m=new al(e);b(e.child,!1,$v,m,void 0,void 0),e.stateNode=m}a=e.stateNode;break;default:a=e.stateNode}typeof n=="function"?e.refCleanup=n(a):n.current=a}}catch(w){bt(e,t,w)}}function yn(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(i){bt(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(i){bt(e,t,i)}else n.current=null}function gr(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)Zg(e.stateNode,t[n])}function _m(e){for(var t=e.return;t!==null&&(yd(t)&&Zg(e.stateNode,t.stateNode),!pd(t));)t=t.return}function Ho(e){for(var t=e.return;t!==null&&(yd(t)&&Lv(e.stateNode,t.stateNode),!pd(t));)t=t.return}function pd(e){return e.tag===5||e.tag===3||e.tag===27}function yd(e){return e&&e.tag===7&&e.stateNode!==null}function vd(e){var t=e.type,n=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break e;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(i){bt(e,e.return,i)}}function bd(e,t,n){try{var a=e.stateNode;wv(a,e.type,n,t),a[Ke]=t}catch(i){bt(e,e.return,i)}}function Bm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ui(e.type)||e.tag===4}function xd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Bm(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&ui(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function wd(e,t,n,a){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=On)),gr(e,a),nt=!0;else if(i!==4&&(i===27&&(gr(e,a),a=null,ui(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(wd(e,t,n,a),e=e.sibling;e!==null;)wd(e,t,n,a),e=e.sibling}function pr(e,t,n,a){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),gr(e,a),nt=!0;else if(i!==4&&(i===27&&(gr(e,a),a=null,ui(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(pr(e,t,n,a),e=e.sibling;e!==null;)pr(e,t,n,a),e=e.sibling}function Um(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);vn(t,a,n),t[_t]=e,t[Ke]=n}catch(o){bt(e,e.return,o)}}var yr=!1,el=null;function Hm(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(yr=!0)}var Wl=null;function $m(){var e=Wl;return Wl=null,e}var Zn=0;function Es(e,t,n,a,i){return Zn=0,Lm(e.child,t,n,a,i)}function Lm(e,t,n,a,i){for(var o=!1;e!==null;){if(e.tag===5){var m=e.stateNode;if(a!==null){var w=af(m);a.push(w),w.view&&(o=!0)}else o||af(m).view&&(o=!0);yr=!0,$g(m,Zn===0?t:t+"_"+Zn,n),Zn++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Lm(e.child,t,n,a,i)&&(o=!0));e=e.sibling}return o}function Il(e,t){for(;e!==null;)e.tag===5?Lg(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Il(e.child,t)),e=e.sibling}function vr(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(vr(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(f(544));var n=t.name;t=Cn(t.default,t.share),t!=="none"&&(Es(e,n,t,null,!1)||Il(e.child,!1))}e=e.sibling}}function jd(e,t){if(e.tag===30){var n=e.stateNode,a=e.memoizedProps,i=qe(a,n),o=Cn(a.default,n.paired?a.share:a.enter);o!=="none"?Es(e,i,o,null,!1)?(vr(e),n.paired||t||_s(e,a.onEnter)):Il(e.child,!1):vr(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)jd(e,t),e=e.sibling;else vr(e)}function Sd(e){if(el!==null&&el.size!==0){var t=el;if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var n=e.memoizedProps,a=n.name;if(a!=null&&a!=="auto"){var i=t.get(a);if(i!==void 0){var o=Cn(n.default,n.share);if(o!=="none"&&(Es(e,a,o,null,!1)?(o=e.stateNode,i.paired=o,o.paired=i,_s(e,n.onShare)):Il(e.child,!1)),t.delete(a),t.size===0)break}}}Sd(e)}e=e.sibling}}}function Nd(e){if(e.tag===30){var t=e.memoizedProps,n=qe(t,e.stateNode),a=el!==null?el.get(n):void 0,i=Cn(t.default,a!==void 0?t.share:t.exit);i!=="none"&&(Es(e,n,i,null,!1)?a!==void 0?(i=e.stateNode,a.paired=i,i.paired=a,el.delete(n),_s(e,t.onShare)):_s(e,t.onExit):Il(e.child,!1)),el!==null&&Sd(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Nd(e),e=e.sibling;else el!==null&&Sd(e)}function Ym(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=qe(t,e.stateNode);t=Cn(t.default,t.update),e.flags&=-5,t!=="none"&&Es(e,n,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&Ym(e);e=e.sibling}}function Td(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var t=e.stateNode;t.paired!==null&&(t.paired=null,Il(e.child,!1))}Td(e)}e=e.sibling}}function br(e){if(e.tag===30)e.stateNode.paired=null,Il(e.child,!1),Td(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)br(e),e=e.sibling;else Td(e)}function Gm(e){for(e=e.child;e!==null;)e.tag===30?Il(e.child,!1):(e.subtreeFlags&33554432)!==0&&Gm(e),e=e.sibling}function Cd(e,t,n,a,i,o,m){for(var w=!1;t!==null;){if(t.tag===5){var O=t.stateNode;if(o!==null&&Zn<o.length){var q=o[Zn],Z=af(O);(q.view||Z.view)&&(w=!0);var ee;if(ee=(e.flags&4)===0)if(Z.clip)ee=!0;else{ee=q.rect;var L=Z.rect;ee=ee.y!==L.y||ee.x!==L.x||ee.height!==L.height||ee.width!==L.width}ee&&(e.flags|=4),Z.abs?Z=!q.abs:(q=q.rect,Z=Z.rect,Z=q.height!==Z.height||q.width!==Z.width),Z&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&$g(O,Zn===0?n:n+"_"+Zn,i),w&&(e.flags&4)!==0||(Wl===null&&(Wl=[]),Wl.push(O,Zn===0?a:a+"_"+Zn,t.memoizedProps)),Zn++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&m?e.flags|=t.flags&32:Cd(e,t.child,n,a,i,o,m)&&(w=!0));t=t.sibling}return w}function qm(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,a=e.stateNode,i=qe(n,a),o=Cn(n.default,n.update),m;m=e.memoizedState,e.memoizedState=null,a=e;var w=e.child;Zn=0,i=Cd(a,w,i,i,o,m,!1),(e.flags&4)!==0&&i&&_s(e,n.onUpdate)}else(e.subtreeFlags&33554432)!==0&&qm(e);e=e.sibling}}var cn=!1,yt=!1,Pl=!1,Ed=!1,Xm=typeof WeakSet=="function"?WeakSet:Set,rn=null,ea=!1,$o=!1,xr=!1,Md=!1;function Fy(e,t,n){if(e=e.containerInfo,Pd=Vs,e=wo(e),hs(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var i=a.getSelection&&a.getSelection();if(i&&i.rangeCount!==0){a=i.anchorNode;var o=i.anchorOffset,m=i.focusNode;i=i.focusOffset;try{a.nodeType,m.nodeType}catch{a=null;break e}var w=0,O=-1,q=-1,Z=0,ee=0,L=e,K=null;t:for(;;){for(var pe;L!==a||o!==0&&L.nodeType!==3||(O=w+o),L!==m||i!==0&&L.nodeType!==3||(q=w+i),L.nodeType===3&&(w+=L.nodeValue.length),(pe=L.firstChild)!==null;)K=L,L=pe;for(;;){if(L===e)break t;if(K===a&&++Z===o&&(O=w),K===m&&++ee===i&&(q=w),(pe=L.nextSibling)!==null)break;L=K,K=L.parentNode}L=pe}a=O===-1||q===-1?null:{start:O,end:q}}else a=null}a=a||{start:0,end:0}}else a=null;for(ef={focusedElem:e,selectionRange:a},Vs=!1,n=(n&335544064)===n,rn=t,t=n?9270:1024;rn!==null;){if(e=rn,n&&(a=e.deletions,a!==null))for(o=0;o<a.length;o++)n&&Nd(a[o]);if(e.alternate===null&&(e.flags&2)!==0)n&&Hm(e),wr(n);else{if(e.tag===22){if(a=e.alternate,e.memoizedState!==null){a!==null&&a.memoizedState===null&&n&&Nd(a),wr(n);continue}else if(a!==null&&a.memoizedState!==null){n&&Hm(e),wr(n);continue}}a=e.child,(e.subtreeFlags&t)!==0&&a!==null?(a.return=e,rn=a):(n&&Ym(e),wr(n))}}el=null}function wr(e){for(;rn!==null;){var t=rn,n=e,a=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((i&1024)!==0&&a!==null){n=void 0,i=a.memoizedProps,a=a.memoizedState;var o=t.stateNode;try{var m=Qi(t.type,i);n=o.getSnapshotBeforeUpdate(m,a),o.__reactInternalSnapshotBeforeUpdate=n}catch(w){bt(t,t.return,w)}}break;case 3:if((i&1024)!==0){if(a=t.stateNode.containerInfo,n=a.nodeType,n===9)cf(a);else if(n===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":cf(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&a!==null&&(n=qe(a.memoizedProps,a.stateNode),i=t.memoizedProps,i=Cn(i.default,i.update),i!=="none"&&Es(a,n,i,a.memoizedState=[],!0));break;default:if((i&1024)!==0)throw Error(f(163))}if(a=t.sibling,a!==null){a.return=t.return,rn=a;break}rn=t.return}}function Vm(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:ta(e,n),a&4&&Uo(5,n);break;case 1:if(ta(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(m){bt(n,n.return,m)}else{var i=Qi(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(m){bt(n,n.return,m)}}a&64&&Dm(n),a&512&&Fl(n,n.return);break;case 3:if(ta(e,n),a&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{jh(e,t)}catch(m){bt(n,n.return,m)}}break;case 27:t===null&&a&4&&Um(n);case 26:case 5:ta(e,n),t===null&&a&4&&vd(n),a&512&&Fl(n,n.return);break;case 12:ta(e,n);break;case 31:ta(e,n),a&4&&Jm(e,n);break;case 13:ta(e,n),a&4&&Fm(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=cv.bind(null,n),qv(e,n))));break;case 22:if(a=n.memoizedState!==null||cn,!a){var o=t!==null&&t.memoizedState!==null||yt;t=cn,i=yt,cn=a,(yt=o)&&!i?(a=2,(n.subtreeFlags&8772)!==0&&(a|=1),Dl(e,n,a)):ta(e,n),cn=t,yt=i}break;case 30:ta(e,n),a&512&&Fl(n,n.return);break;case 7:a&512&&Fl(n,n.return);default:ta(e,n)}}function kd(e,t){for(e=e.child;e!==null;)Km(e,t),e=e.sibling}function Km(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var a=n.style;typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"}else{var i=e.stateNode,o=e.memoizedProps.style,m=o!=null&&o.hasOwnProperty("display")?o.display:null;i.style.display=m==null||typeof m=="boolean"?"":(""+m).trim()}}catch(O){bt(e,e.return,O)}zd(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,nt=!0}catch(O){bt(e,e.return,O)}break;case 18:try{var w=e.stateNode;t?Hg(w,!0):Hg(e.stateNode,!1)}catch(O){bt(e,e.return,O)}break;case 22:case 23:e.memoizedState===null&&kd(e,t);break;default:kd(e,t)}}function zd(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var n=e,a=t;switch(n.tag){case 4:Km(n,a);break e;case 22:n.memoizedState===null&&zd(n,a);break e;default:zd(n,a)}}e=e.sibling}}function Zm(e){var t=e.alternate;t!==null&&(e.alternate=null,Zm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ls(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Bt=null,Qn=!1;function Al(e,t,n){for(n=n.child;n!==null;)Qm(e,t,n),n=n.sibling}function Qm(e,t,n){if(Vt&&typeof Vt.onCommitFiberUnmount=="function")try{Vt.onCommitFiberUnmount(cl,n)}catch{}switch(n.tag){case 26:yt||yn(n,t),Al(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!yt&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:yt||yn(n,t),Ho(n);var a=Bt,i=Qn;ui(n.type)&&(Bt=n.stateNode,Qn=!1),Al(e,t,n),Ig(n.stateNode,n.type,n.memoizedProps),Bt=a,Qn=i;break;case 5:yt||yn(n,t),Ho(n);case 6:if(n.tag===6&&Ho(n),a=Bt,i=Qn,Bt=null,Al(e,t,n),Bt=a,Qn=i,Bt!==null)if(Qn)try{(Bt.nodeType===9?Bt.body:Bt.nodeName==="HTML"?Bt.ownerDocument.body:Bt).removeChild(n.stateNode),nt=!0}catch(o){bt(n,t,o)}else try{Bt.removeChild(n.stateNode),nt=!0}catch(o){bt(n,t,o)}break;case 18:Bt!==null&&(Qn?(e=Bt,Ug(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Ks(e)):Ug(Bt,n.stateNode));break;case 4:a=Bt,i=Qn,Bt=n.stateNode.containerInfo,Qn=!0,Al(e,t,n),Bt=a,Qn=i;break;case 0:case 11:case 14:case 15:li(2,n,t),yt||li(4,n,t),Al(e,t,n);break;case 1:yt||(yn(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&Rm(n,t,a)),Al(e,t,n);break;case 21:Al(e,t,n);break;case 22:yt=(a=yt)||n.memoizedState!==null,Al(e,t,n),yt=a;break;case 30:yn(n,t),Al(e,t,n);break;case 7:yt||yn(n,t),Al(e,t,n);break;default:Al(e,t,n)}}function Jm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ks(e)}catch(n){bt(t,t.return,n)}}}function Fm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ks(e)}catch(n){bt(t,t.return,n)}}function Wy(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Xm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Xm),t;default:throw Error(f(435,e.tag))}}function jr(e,t){var n=Wy(e);t.forEach(function(a){if(!n.has(a)){n.add(a);var i=rv.bind(null,e,a);a.then(i,i)}})}function Rn(e,t,n){var a=t.deletions;if(a!==null)for(var i=0;i<a.length;i++){var o=a[i],m=e,w=t,O=w;e:for(;O!==null;){switch(O.tag){case 27:if(ui(O.type)){Bt=O.stateNode,Qn=!1;break e}break;case 5:Bt=O.stateNode,Qn=!1;break e;case 3:case 4:Bt=O.stateNode.containerInfo,Qn=!0;break e}O=O.return}if(Bt===null)throw Error(f(160));Qm(m,w,o),Bt=null,Qn=!1,m=o.alternate,m!==null&&(m.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Wm(t,e,n),t=t.sibling}var Ol=null;function Wm(e,t,n){var a=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(i&4&&(a=e.updateQueue,a=a!==null?a.events:null,a!==null))for(var o=0;o<a.length;o++){var m=a[o];m.ref.impl=m.nextImpl}Rn(t,e,n),_n(e),i&4&&(li(3,e,e.return),Uo(3,e),li(5,e,e.return));break;case 1:Rn(t,e,n),_n(e),i&512&&(yt||a===null||yn(a,a.return)),i&64&&cn&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Ol,Rn(t,e,n),_n(e),i&512&&(yt||a===null||yn(a,a.return)),i&4)if(i=a!==null?a.memoizedState:null,n=e.memoizedState,a===null)if(n===null)if(e.stateNode===null)if(cn)e.stateNode=Rg(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,n=e.memoizedProps,i=o.ownerDocument||o;t:switch(t){case"title":a=i.getElementsByTagName("title")[0],(!a||a[Ba]||a[_t]||a.namespaceURI==="http://www.w3.org/2000/svg"||a.hasAttribute("itemprop"))&&(a=i.createElement(t),i.head.insertBefore(a,i.querySelector("head > title"))),vn(a,t,n),a[_t]=e,Kt(a),t=a;break e;case"link":if(o=ap("link","href",i).get(t+(n.href||""))){for(m=0;m<o.length;m++)if(a=o[m],a.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&a.getAttribute("rel")===(n.rel==null?null:n.rel)&&a.getAttribute("title")===(n.title==null?null:n.title)&&a.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(m,1);break t}}a=i.createElement(t),vn(a,t,n),i.head.appendChild(a);break;case"meta":if(o=ap("meta","content",i).get(t+(n.content||""))){for(m=0;m<o.length;m++)if(a=o[m],a.getAttribute("content")===(n.content==null?null:""+n.content)&&a.getAttribute("name")===(n.name==null?null:n.name)&&a.getAttribute("property")===(n.property==null?null:n.property)&&a.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&a.getAttribute("charset")===(n.charSet==null?null:n.charSet)){o.splice(m,1);break t}}a=i.createElement(t),vn(a,t,n),i.head.appendChild(a);break;default:throw Error(f(468,t))}a[_t]=e,Kt(a),t=a}e.stateNode=t}else cn||gf(o,e.type,e.stateNode);else e.stateNode=lp(o,n,e.memoizedProps);else i!==n?(i===null?(t=a.stateNode,t===null||yt||t.parentNode.removeChild(t)):i.count--,n===null?cn||gf(o,e.type,e.stateNode):lp(o,n,e.memoizedProps)):n===null&&e.stateNode!==null&&bd(e,e.memoizedProps,a.memoizedProps);break;case 27:Rn(t,e,n),_n(e),i&512&&(yt||a===null||yn(a,a.return)),a!==null&&i&4&&bd(e,e.memoizedProps,a.memoizedProps);break;case 5:if(o=Pl,Pl=!1,Rn(t,e,n),Pl=o,_n(e),i&512&&(yt||a===null||yn(a,a.return)),e.flags&32){t=e.stateNode;try{qn(t,""),nt=!0}catch(Z){bt(e,e.return,Z)}}i&4&&e.stateNode!=null&&(t=e.memoizedProps,bd(e,t,a!==null?a.memoizedProps:t)),i&1024&&(Ed=!0);break;case 6:if(Rn(t,e,n),_n(e),i&4){if(e.stateNode===null)throw Error(f(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,nt=!0}catch(Z){bt(e,e.return,Z)}}break;case 3:if(nt=!1,Ur=null,o=Ol,Ol=Qo(t.containerInfo),Rn(t,e,n),Ol=o,_n(e),i&4&&a!==null&&a.memoizedState.isDehydrated)try{Ks(t.containerInfo)}catch(Z){bt(e,e.return,Z)}Ed&&(Ed=!1,Im(e)),nt=!1;break;case 4:i=Pl,Pl=cn,a=no(),o=Ol,Ol=Qo(e.stateNode.containerInfo),Rn(t,e,n),_n(e),Ol=o,nt&&$o&&(xr=!0),nt=a,Pl=i;break;case 12:Rn(t,e,n),_n(e);break;case 31:Rn(t,e,n),_n(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,jr(e,t)));break;case 13:Rn(t,e,n),_n(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Tr=rt()),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,jr(e,t)));break;case 22:o=e.memoizedState!==null,m=a!==null&&a.memoizedState!==null;var w=cn,O=yt,q=Pl;cn=w||o,Pl=q||o,yt=O||m,Rn(t,e,n),yt=O,Pl=q,cn=w,_n(e),i&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||a===null||m||cn||yt||(t=m||yt,n=cn,a=yt,cn=o||cn,yt=t,ai(e,2),cn=n,yt=a),!o&&Pl||kd(e,o)),i&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,jr(e,n))));break;case 19:Rn(t,e,n),_n(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,jr(e,t)));break;case 30:i&512&&(yt||a===null||yn(a,a.return)),i=no(),o=$o,m=(n&335544064)===n,w=e.memoizedProps,$o=m&&Cn(w.default,w.update)!=="none",Rn(t,e,n),_n(e),m&&a!==null&&nt&&(e.flags|=4),$o=o,nt=i;break;case 21:break;case 7:i&512&&(yt||a===null||yn(a,a.return)),a&&a.stateNode!==null&&(a.stateNode._fragmentFiber=e);default:Rn(t,e,n),_n(e)}}function _n(e){var t=e.flags;if(t&2){try{for(var n,a=e.return;a!==null;){if(Bm(a)){n=a;break}a=a.return}a=null;for(var i=e.return;i!==null;){if(yd(i)){var o=i.stateNode;a===null?a=[o]:a.push(o)}if(pd(i))break;i=i.return}var m=a;if(n==null)throw Error(f(160));switch(n.tag){case 27:var w=n.stateNode,O=xd(e);pr(e,O,w,m);break;case 5:var q=n.stateNode;n.flags&32&&(qn(q,""),n.flags&=-33);var Z=xd(e);pr(e,Z,q,m);break;case 3:case 4:var ee=n.stateNode.containerInfo,L=xd(e);wd(e,L,ee,m);break;default:throw Error(f(161))}}catch(K){bt(e,e.return,K)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Im(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Im(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Vs=!0,t.reset(),Vs=!1),e=e.sibling}}function Ms(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Pm(t,e),t=t.sibling;else qm(t)}function Pm(e,t){var n=e.alternate;if(n===null)jd(e,!1);else switch(e.tag){case 3:if(Md=ea=!1,$m(),Ms(t,e),!ea&&!xr){if(e=Wl,e!==null)for(var a=0;a<e.length;a+=3){n=e[a];var i=e[a+1];Lg(n,e[a+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+i+")"})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===""&&(e.style.viewTransitionName="none",e.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),Md=!0}Wl=null;break;case 5:Ms(t,e);break;case 4:a=ea,ea=!1,Ms(t,e),ea&&(xr=!0),ea=a;break;case 22:e.memoizedState===null&&(n.memoizedState!==null?jd(e,!1):Ms(t,e));break;case 30:a=ea,i=$m(),ea=!1,Ms(t,e),ea&&(e.flags|=4);var o=e.memoizedProps,m=e.stateNode;t=qe(o,m),m=qe(n.memoizedProps,m);var w=Cn(o.default,o.update);w==="none"?t=!1:(o=n.memoizedState,n.memoizedState=null,n=e.child,Zn=0,t=Cd(e,n,t,m,w,o,!0),Zn!==(o===null?0:o.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(_s(e,e.memoizedProps.onUpdate),Wl=i):i!==null&&(i.push.apply(i,Wl),Wl=i),ea=(e.flags&32)!==0?!0:a;break;default:Ms(t,e)}}function ta(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Vm(e,t.alternate,t),t=t.sibling}function ai(e,t){for(e=e.child;e!==null;){var n=e,a=t;switch(n.tag){case 0:case 11:case 14:case 15:li(4,n,n.return),ai(n,a);break;case 1:yn(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount=="function"&&Rm(n,n.return,i),ai(n,a);break;case 27:(a&2)!==0&&Ig(n.stateNode,n.type,n.memoizedProps);case 5:yn(n,n.return),n.tag!==5&&n.tag!==27||Ho(n),ai(n,a);break;case 6:Ho(n);break;case 26:yn(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||yt||i.parentNode.removeChild(i),ai(n,a);break;case 22:n.memoizedState===null&&ai(n,a);break;case 30:yn(n,n.return),ai(n,a);break;case 7:yn(n,n.return);default:ai(n,a)}e=e.sibling}}function Dl(e,t,n){for(n=(t.subtreeFlags&8772)!==0?n:n&-2,t=t.child;t!==null;){var a=t.alternate,i=e,o=t,m=o.flags,w=(n&1)!==0;switch(o.tag){case 0:case 11:case 15:Dl(i,o,n),Uo(4,o);break;case 1:if(Dl(i,o,n),a=o,i=a.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(Z){bt(a,a.return,Z)}if(a=o,i=a.updateQueue,i!==null){var O=a.stateNode;try{var q=i.shared.hiddenCallbacks;if(q!==null)for(i.shared.hiddenCallbacks=null,i=0;i<q.length;i++)wh(q[i],O)}catch(Z){bt(a,a.return,Z)}}w&&m&64&&Dm(o),Fl(o,o.return);break;case 27:(n&2)!==0&&Um(o);case 5:o.tag!==5&&o.tag!==27||_m(o),Dl(i,o,n),w&&a===null&&m&4&&vd(o),Fl(o,o.return);break;case 6:_m(o);break;case 26:O=o.stateNode,o.memoizedState!==null||O===null||cn||gf(Qo(O.ownerDocument),o.type,O),Dl(i,o,n),w&&a===null&&m&4&&vd(o),Fl(o,o.return);break;case 12:Dl(i,o,n);break;case 31:Dl(i,o,n),w&&m&4&&Jm(i,o);break;case 13:Dl(i,o,n),w&&m&4&&Fm(i,o);break;case 22:o.memoizedState===null&&Dl(i,o,n),Fl(o,o.return);break;case 30:Dl(i,o,n),Fl(o,o.return);break;case 7:Fl(o,o.return);default:Dl(i,o,n)}t=t.sibling}}function Ad(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&No(n))}function Od(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&No(e))}function xl(e,t,n,a){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)eg(e,t,n,a),t=t.sibling;else i&&Gm(t)}function eg(e,t,n,a){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&br(t);var o=t.flags;switch(t.tag){case 0:case 11:case 15:xl(e,t,n,a),o&2048&&Uo(9,t);break;case 1:xl(e,t,n,a);break;case 3:xl(e,t,n,a),i&&Md&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,e.style.viewTransitionName==="root"&&(e.style.viewTransitionName=""),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName==="none"&&(e.style.viewTransitionName="")),o&2048&&(o=null,t.alternate!==null&&(o=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==o&&(t.refCount++,o!=null&&No(o)));break;case 12:if(o&2048){xl(e,t,n,a),o=t.stateNode;try{var m=t.memoizedProps,w=m.id,O=m.onPostCommit;typeof O=="function"&&O(w,t.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(q){bt(t,t.return,q)}}else xl(e,t,n,a);break;case 31:xl(e,t,n,a);break;case 13:xl(e,t,n,a);break;case 23:break;case 22:m=t.stateNode,w=t.alternate,t.memoizedState!==null?(i&&w!==null&&w.memoizedState===null&&br(w),m._visibility&2?xl(e,t,n,a):Lo(e,t)):(i&&w!==null&&w.memoizedState!==null&&br(t),m._visibility&2?xl(e,t,n,a):(m._visibility|=2,ks(e,t,n,a,(t.subtreeFlags&10256)!==0||!1))),o&2048&&Ad(w,t);break;case 24:xl(e,t,n,a),o&2048&&Od(t.alternate,t);break;case 30:i&&(o=t.alternate,o!==null&&(Il(o.child,!0),Il(t.child,!0))),xl(e,t,n,a);break;default:xl(e,t,n,a)}}function ks(e,t,n,a,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var o=e,m=t,w=n,O=a,q=m.flags;switch(m.tag){case 0:case 11:case 15:ks(o,m,w,O,i),Uo(8,m);break;case 23:break;case 22:var Z=m.stateNode;m.memoizedState!==null?Z._visibility&2?ks(o,m,w,O,i):Lo(o,m):(Z._visibility|=2,ks(o,m,w,O,i)),i&&q&2048&&Ad(m.alternate,m);break;case 24:ks(o,m,w,O,i),i&&q&2048&&Od(m.alternate,m);break;default:ks(o,m,w,O,i)}t=t.sibling}}function Lo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,a=t,i=a.flags;switch(a.tag){case 22:Lo(n,a),i&2048&&Ad(a.alternate,a);break;case 24:Lo(n,a),i&2048&&Od(a.alternate,a);break;default:Lo(n,a)}t=t.sibling}}var Ji=8192;function Fi(e,t,n){if(e.subtreeFlags&Ji)for(e=e.child;e!==null;)tg(e,t,n),e=e.sibling}function tg(e,t,n){switch(e.tag){case 26:Fi(e,t,n),e.flags&Ji&&(e.memoizedState!==null?lb(n,Ol,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&cp(n,e)));break;case 5:Fi(e,t,n),e.flags&Ji&&(e=e.stateNode,(t&335544128)===t&&cp(n,e));break;case 3:case 4:var a=Ol;Ol=Qo(e.stateNode.containerInfo),Fi(e,t,n),Ol=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=Ji,Ji=16777216,Fi(e,t,n),Ji=a):Fi(e,t,n));break;case 30:if((e.flags&Ji)!==0&&(a=e.memoizedProps.name,a!=null&&a!=="auto")){var i=e.stateNode;i.paired=null,el===null&&(el=new Map),el.set(a,i)}Fi(e,t,n);break;default:Fi(e,t,n)}}function ng(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Yo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];rn=a,ag(a,e)}ng(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)lg(e),e=e.sibling}function lg(e){switch(e.tag){case 0:case 11:case 15:Yo(e),e.flags&2048&&li(9,e,e.return);break;case 3:Yo(e);break;case 12:Yo(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Sr(e)):Yo(e);break;default:Yo(e)}}function Sr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];rn=a,ag(a,e)}ng(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:li(8,t,t.return),Sr(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Sr(t));break;default:Sr(t)}e=e.sibling}}function ag(e,t){for(;rn!==null;){var n=rn;switch(n.tag){case 0:case 11:case 15:li(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var a=n.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:No(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,rn=a;else e:for(n=e;rn!==null;){a=rn;var i=a.sibling,o=a.return;if(Zm(a),a===n){rn=null;break e}if(i!==null){i.return=o,rn=i;break e}rn=o}}}var Iy={getCacheForType:function(e){var t=mn(Wt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return mn(Wt).controller.signal}},Py=typeof WeakMap=="function"?WeakMap:Map,pt=0,Ct=null,Fe=null,Pe=0,vt=0,tl=null,ii=!1,zs=!1,Dd=!1,Aa=0,qt=0,si=0,Wi=0,Nr=0,nl=0,As=0,Go=null,Jn=null,Rd=!1,Tr=0,ig=0,Cr=1/0,Er=null,oi=null,Lt=0,Rl=null,Ii=null,na=0,_d=0,Bd=null,sg=null,Os=null,Ds=null,Rs=null,qo=0,Mr=null;function ll(){return(pt&2)!==0&&Pe!==0?Pe&-Pe:ae.T!==null?Kd():Ye()}function og(){if(nl===0)if((Pe&536870912)===0||Xe){var e=ra;ra<<=1,(ra&3932160)===0&&(ra=262144),nl=e}else nl=536870912;return e=gn.current,e!==null&&(e.flags|=32),nl}function _s(e,t){if(t!=null){var n=e.stateNode,a=n.ref;a===null&&(a=n.ref=Yg(qe(e.memoizedProps,n))),Ds===null&&(Ds=[]),Ds.push(t.bind(null,a))}}function Fn(e,t,n){(e===Ct&&(vt===2||vt===9)||e.cancelPendingCommit!==null)&&(Bs(e,0),ci(e,Pe,nl,!1)),z(e,n),((pt&2)===0||e!==Ct)&&(e===Ct&&((pt&2)===0&&(Wi|=n),qt===4&&ci(e,Pe,nl,!1)),la(e))}function cg(e,t,n){if((pt&6)!==0)throw Error(f(327));var a=!n&&(t&127)===0&&(t&e.expiredLanes)===0||In(e,t),i=a?nv(e,t):Hd(e,t,!0),o=a;do{if(i===0){zs&&!a&&ci(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!ev(n)){i=Hd(e,t,!1),o=!1;continue}if(i===2){if(o=t,e.errorRecoveryDisabledLanes&o)var m=0;else m=e.pendingLanes&-536870913,m=m!==0?m:m&536870912?536870912:0;if(m!==0){t=m;e:{var w=e;i=Go;var O=w.current.memoizedState.isDehydrated;if(O&&(Bs(w,m).flags|=256),m=Hd(w,m,!1),m!==2&&m!==6){if(Dd&&!O){w.errorRecoveryDisabledLanes|=o,Wi|=o,i=4;break e}o=Jn,Jn=i,o!==null&&(Jn===null?Jn=o:Jn.push.apply(Jn,o))}i=m}if(o=!1,i!==2)continue}}if(i===1){Bs(e,0),ci(e,t,0,!0);break}e:{switch(a=e,o=i,o){case 0:case 1:throw Error(f(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:ci(a,t,nl,!ii);break e;case 2:Jn=null;break;case 3:case 5:break;default:throw Error(f(329))}if((t&62914560)===t&&(i=Tr+300-rt(),10<i)){if(ci(a,t,nl,!ii),$n(a,0,!0)!==0)break e;na=t,a.timeoutHandle=lf(rg.bind(null,a,n,Jn,Er,Rd,t,nl,Wi,As,ii,o,"Throttled",-0,0),i);break e}rg(a,n,Jn,Er,Rd,t,nl,Wi,As,ii,o,null,-0,0)}}break}while(!0);la(e)}function rg(e,t,n,a,i,o,m,w,O,q,Z,ee,L,K){e.timeoutHandle=-1;var pe=t.subtreeFlags,Se=(o&335544064)===o;if(ee=null,(Se||pe&8192||(pe&16785408)===16785408)&&(ee={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:On},el=null,tg(t,o,ee),Se&&(pe=ee,Se=e.containerInfo,Se=(Se.nodeType===9?Se:Se.ownerDocument).__reactViewTransition,Se!=null&&(pe.count++,pe.waitingForViewTransition=!0,pe=Wo.bind(pe),Se.finished.then(pe,pe))),pe=(o&62914560)===o?Tr-rt():(o&4194048)===o?ig-rt():0,pe=ab(ee,pe),pe!==null)){na=o,e.cancelPendingCommit=pe(yg.bind(null,e,t,o,n,a,i,m,w,O,q,Z,ee,null,L,K)),ci(e,o,m,!q);return}yg(e,t,o,n,a,i,m,w,O,q,Z,ee)}function ev(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var a=0;a<n.length;a++){var i=n[a],o=i.getSnapshot;i=i.value;try{if(!Tn(o(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ci(e,t,n,a){t=ua(e,t),t&=~Nr,t&=~Wi,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var i=t;0<i;){var o=31-Ut(i),m=1<<o;a[o]=-1,i&=~m}n!==0&&ve(e,n,t)}function kr(){return(pt&6)===0?(Xo(0),!1):!0}function Ud(){if(Fe!==null){if(vt===0)var e=Fe.return;else e=Fe,Ta=$i=null,Vu(e),js=null,Eo=0,e=Fe;for(;e!==null;)Om(e.alternate,e),e=e.return;Fe=null}}function Bs(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Nv(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),na=0,Ud(),Ct=e,Fe=n=Sa(e.current,null),Pe=t,vt=0,tl=null,ii=!1,zs=In(e,t),Dd=!1,As=nl=Nr=Wi=si=qt=0,Jn=Go=null,Rd=!1,Aa=ua(e,t),Uc(),n}function ug(e,t){$e=null,ae.H=cr,t===ws||t===Qc?(t=yh(),vt=3):t===Ou?(t=yh(),vt=4):vt=t===sd?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,tl=t,Fe===null&&(qt=1,rr(e,pl(t,e.current)))}function dg(){var e=gn.current;return e===null?!0:(Pe&4194048)===Pe?En===null:(Pe&62914560)===Pe||(Pe&536870912)!==0?e===En:!1}function fg(){var e=ae.H;return ae.H=cr,e===null?cr:e}function hg(){var e=ae.A;return ae.A=Iy,e}function zr(){qt=4,ii||(Pe&4194048)!==Pe&&gn.current!==null||(zs=!0),(si&134217727)===0&&(Wi&134217727)===0||Ct===null||ci(Ct,Pe,nl,!1)}function Hd(e,t,n){var a=pt;pt|=2;var i=fg(),o=hg();(Ct!==e||Pe!==t)&&(Er=null,Bs(e,t)),t=!1;var m=qt;e:do try{if(vt!==0&&Fe!==null){var w=Fe,O=tl;switch(vt){case 8:Ud(),m=6;break e;case 3:case 2:case 9:case 6:gn.current===null&&(t=!0);var q=vt;if(vt=0,tl=null,Us(e,w,O,q),n&&zs){m=0;break e}break;default:q=vt,vt=0,tl=null,Us(e,w,O,q)}}tv(),m=qt;break}catch(Z){ug(e,Z)}while(!0);return t&&e.shellSuspendCounter++,Ta=$i=null,pt=a,ae.H=i,ae.A=o,Fe===null&&(Ct=null,Pe=0,Uc()),m}function tv(){for(;Fe!==null;)mg(Fe)}function nv(e,t){var n=pt;pt|=2;var a=fg(),i=hg();Ct!==e||Pe!==t?(Er=null,Cr=rt()+500,Bs(e,t)):zs=In(e,t);e:do try{if(vt!==0&&Fe!==null){t=Fe;var o=tl;t:switch(vt){case 1:vt=0,tl=null,Us(e,t,o,1);break;case 2:case 9:if(gh(o)){vt=0,tl=null,gg(t);break}t=function(){vt!==2&&vt!==9||Ct!==e||(vt=7),la(e)},o.then(t,t);break e;case 3:vt=7;break e;case 4:vt=5;break e;case 7:gh(o)?(vt=0,tl=null,gg(t)):(vt=0,tl=null,Us(e,t,o,7));break;case 5:var m=null;switch(Fe.tag){case 26:m=Fe.memoizedState;case 5:case 27:var w=Fe;if(m?sp(m):w.stateNode.complete){vt=0,tl=null;var O=w.sibling;if(O!==null)Fe=O;else{var q=w.return;q!==null?(Fe=q,Ar(q)):Fe=null}break t}}vt=0,tl=null,Us(e,t,o,5);break;case 6:vt=0,tl=null,Us(e,t,o,6);break;case 8:Ud(),qt=6;break e;default:throw Error(f(462))}}lv();break}catch(Z){ug(e,Z)}while(!0);return Ta=$i=null,ae.H=a,ae.A=i,pt=n,Fe!==null?0:(Ct=null,Pe=0,Uc(),qt)}function lv(){for(;Fe!==null&&!Tl();)mg(Fe)}function mg(e){var t=zm(e.alternate,e,Aa);e.memoizedProps=e.pendingProps,t===null?Ar(e):Fe=t}function gg(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Sm(n,t,t.pendingProps,t.type,void 0,Pe);break;case 11:t=Sm(n,t,t.pendingProps,t.type.render,t.ref,Pe);break;case 5:Vu(t);var a=t;a===on&&(Xe?(qc(a),a.tag===5&&a.stateNode!=null&&(zt=a.stateNode)):(qc(a),Xe=!0));default:Om(n,t),t=Fe=ah(t,Aa),t=zm(n,t,Aa)}e.memoizedProps=e.pendingProps,t===null?Ar(e):Fe=t}function Us(e,t,n,a){Ta=$i=null,Vu(t),js=null,Eo=0;var i=t.return;try{if(Xy(e,i,t,n,Pe)){qt=1,rr(e,pl(n,e.current)),Fe=null;return}}catch(o){if(i!==null)throw Fe=i,o;qt=1,rr(e,pl(n,e.current)),Fe=null;return}t.flags&32768?(Xe||a===1?e=!0:zs||(Pe&536870912)!==0?e=!1:(ii=e=!0,(a===2||a===9||a===3||a===6)&&(a=gn.current,a!==null&&a.tag===13&&(a.flags|=16384))),pg(t,e)):Ar(t)}function Ar(e){var t=e;do{if((t.flags&32768)!==0){pg(t,ii);return}e=t.return;var n=Qy(t.alternate,t,Aa);if(n!==null){Fe=n;return}if(t=t.sibling,t!==null){Fe=t;return}Fe=t=e}while(t!==null);qt===0&&(qt=5)}function pg(e,t){do{var n=Jy(e.alternate,e);if(n!==null){n.flags&=32767,Fe=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Fe=e;return}Fe=e=n}while(e!==null);qt=6,Fe=null}function yg(e,t,n,a,i,o,m,w,O,q,Z,ee){e.cancelPendingCommit=null;do Or();while(Lt!==0);if((pt&6)!==0)throw Error(f(327));if(t!==null){if(t===e.current)throw Error(f(177));e===Ct&&(Fe=Ct=null,Pe=0),Ii=t,Rl=e,na=n,Bd=i,sg=a,av(e,t,n,m,w,O,ee)}}function av(e,t,n,a,i,o,m){var w=t.lanes|t.childLanes;if(_d=w,w|=bu,$(e,n,w,a,i,o),Ds=null,(n&335544064)===n?(Rs=Oy(e),a=10262):(Rs=null,a=10256),(t.subtreeFlags&a)!==0||(t.flags&a)!==0?(e.callbackNode=null,e.callbackPriority=0,uv(Yl,function(){return Gd(),null})):(e.callbackNode=null,e.callbackPriority=0),yr=!1,a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=ae.T,ae.T=null,i=de.p,de.p=2,o=pt,pt|=4;try{Fy(e,t,n)}finally{pt=o,de.p=i,ae.T=a}}Lt=1,yr?Os=zv(m,e.containerInfo,Rs,$d,Ld,sv,Yd,Gd,iv):($d(),Ld(),Yd())}function iv(e){if(Lt!==0){var t=Rl.onRecoverableError;t(e,{componentStack:null})}}function sv(){Lt===3&&(Lt=0,Pm(Ii,Rl),Lt=4)}function $d(){if(Lt===1){Lt=0;var e=Rl,t=Ii,n=na,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=ae.T,ae.T=null;var i=de.p;de.p=2;var o=pt;pt|=4;try{$o=xr=!1,Wm(t,e,n),n=ef;var m=wo(e.containerInfo),w=n.focusedElem,O=n.selectionRange;if(m!==w&&w&&w.ownerDocument&&xo(w.ownerDocument.documentElement,w)){if(O!==null&&hs(w)){var q=O.start,Z=O.end;if(Z===void 0&&(Z=q),"selectionStart"in w)w.selectionStart=q,w.selectionEnd=Math.min(Z,w.value.length);else{var ee=w.ownerDocument||document,L=ee&&ee.defaultView||window;if(L.getSelection){var K=L.getSelection(),pe=w.textContent.length,Se=Math.min(O.start,pe),Le=O.end===void 0?Se:Math.min(O.end,pe);!K.extend&&Se>Le&&(m=Le,Le=Se,Se=m);var G=bo(w,Se),H=bo(w,Le);if(G&&H&&(K.rangeCount!==1||K.anchorNode!==G.node||K.anchorOffset!==G.offset||K.focusNode!==H.node||K.focusOffset!==H.offset)){var V=ee.createRange();V.setStart(G.node,G.offset),K.removeAllRanges(),Se>Le?(K.addRange(V),K.extend(H.node,H.offset)):(V.setEnd(H.node,H.offset),K.addRange(V))}}}}for(ee=[],K=w;K=K.parentNode;)K.nodeType===1&&ee.push({element:K,left:K.scrollLeft,top:K.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<ee.length;w++){var P=ee[w];P.element.scrollLeft=P.left,P.element.scrollTop=P.top}}Vs=!!Pd,ef=Pd=null}finally{pt=o,de.p=i,ae.T=a}}e.current=t,Lt=2}}function Ld(){if(Lt===2){Lt=0;var e=Rl,t=Ii,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=ae.T,ae.T=null;var a=de.p;de.p=2;var i=pt;pt|=4;try{Vm(e,t.alternate,t)}finally{pt=i,de.p=a,ae.T=n}}Lt=3}}function Yd(){if(Lt===4||Lt===3){Lt=0;var e=Os;Os=null,Wn();var t=Rl,n=Ii,a=na,i=sg,o=(a&335544064)===a?10262:10256;if((n.subtreeFlags&o)!==0||(n.flags&o)!==0?Lt=5:(Lt=0,Ii=Rl=null,vg(t,t.pendingLanes)),o=t.pendingLanes,o===0&&(oi=null),Ue(a),n=n.stateNode,Vt&&typeof Vt.onCommitFiberRoot=="function")try{Vt.onCommitFiberRoot(cl,n,void 0,(n.current.flags&128)===128)}catch{}if(i!==null){n=ae.T,o=de.p,de.p=2,ae.T=null;try{for(var m=t.onRecoverableError,w=0;w<i.length;w++){var O=i[w];m(O.value,{componentStack:O.stack})}}finally{ae.T=n,de.p=o}}if(i=Ds,m=Rs,Rs=null,i!==null&&(Ds=null,m===null&&(m=[]),e!==null))for(O=0;O<i.length;O++)n=(0,i[O])(m),n!==void 0&&e.finished.finally(n);(na&3)!==0&&Or(),la(t),o=t.pendingLanes,(a&261930)!==0&&(o&42)!==0?t===Mr?qo++:(qo=0,Mr=t):(qo=0,Mr=null),Xo(0)}}function vg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,No(t)))}function Or(){return Os!==null&&(Os.skipTransition(),Os=null),$d(),Ld(),Yd(),Gd()}function Gd(){if(Lt!==5)return!1;var e=Rl,t=_d;_d=0;var n=Ue(na),a=ae.T,i=de.p;try{de.p=32>n?32:n,ae.T=null,n=Bd,Bd=null;var o=Rl,m=na;if(Lt=0,Ii=Rl=null,na=0,(pt&6)!==0)throw Error(f(331));var w=pt;if(pt|=4,lg(o.current),eg(o,o.current,m,n),pt=w,Xo(0,!1),Vt&&typeof Vt.onPostCommitFiberRoot=="function")try{Vt.onPostCommitFiberRoot(cl,o)}catch{}return!0}finally{de.p=i,ae.T=a,vg(e,t)}}function bg(e,t,n){t=pl(n,t),t=id(e.stateNode,t,2),e=Pa(e,t,2),e!==null&&(z(e,2),la(e))}function bt(e,t,n){if(e.tag===3)bg(e,e,n);else for(;t!==null;){if(t.tag===3){bg(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(oi===null||!oi.has(a))){e=pl(n,e),n=gm(2),a=Pa(t,n,2),a!==null&&(pm(n,a,t,e),z(a,2),la(a));break}}t=t.return}}function qd(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new Py;var i=new Set;a.set(t,i)}else i=a.get(t),i===void 0&&(i=new Set,a.set(t,i));i.has(n)||(Dd=!0,i.add(n),e=ov.bind(null,e,t,n),t.then(e,e))}function ov(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ct===e&&(Pe&n)===n&&((qt===4||qt===3&&(Pe&62914560)===Pe&&300>rt()-Tr)&&(pt&2)===0?Bs(e,0):Nr|=n,As===Pe&&(As=0)),la(e)}function xg(e,t){t===0&&(t=Ln()),e=Bi(e,t),e!==null&&(z(e,t),la(e))}function cv(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),xg(e,n)}function rv(e,t){var n=0;switch(e.tag){case 31:case 13:var a=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(f(314))}a!==null&&a.delete(t),xg(e,n)}function uv(e,t){return $l(e,t)}var Hs=null,$s=null,Xd=!1,Dr=!1,Vd=!1,ri=0;function la(e){e!==$s&&e.next===null&&($s===null?Hs=$s=e:$s=$s.next=e),Dr=!0,Xd||(Xd=!0,fv())}function Xo(e,t){if(!Vd&&Dr){Vd=!0;do for(var n=!1,a=Hs;a!==null;){if(e!==0){var i=a.pendingLanes;if(i===0)var o=0;else{var m=a.suspendedLanes,w=a.pingedLanes;o=(1<<31-Ut(42|e)+1)-1,o&=i&~(m&~w),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(n=!0,Ng(a,o))}else o=Pe,o=$n(a,a===Ct?o:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(o&3)===0||In(a,o)||(n=!0,Ng(a,o));a=a.next}while(n);Vd=!1}}function dv(){wg()}function wg(){Dr=Xd=!1;var e=0;ri!==0&&Sv()&&(e=ri);for(var t=rt(),n=null,a=Hs;a!==null;){var i=a.next,o=jg(a,t);o===0?(a.next=null,n===null?Hs=i:n.next=i,i===null&&($s=n)):(n=a,(e!==0||(o&3)!==0)&&(Dr=!0)),a=i}Lt!==0&&Lt!==5||Xo(e),ri!==0&&(ri=0)}function jg(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes&-62914561;0<o;){var m=31-Ut(o),w=1<<m,O=i[m];O===-1?((w&n)===0||(w&a)!==0)&&(i[m]=ut(w,t)):O<=t&&(e.expiredLanes|=w),o&=~w}if(t=Ct,n=Pe,n=$n(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,n===0||e===t&&(vt===2||vt===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&Ll(a),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||In(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&Ll(a),Ue(n)){case 2:case 8:n=Cl;break;case 32:n=Yl;break;case 268435456:n=Mt;break;default:n=Yl}return a=Sg.bind(null,e),n=$l(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&Ll(a),e.callbackPriority=2,e.callbackNode=null,2}function Sg(e,t){if(Lt!==0&&Lt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Or()&&e.callbackNode!==n)return null;var a=Pe;return a=$n(e,e===Ct?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(cg(e,a,t),jg(e,rt()),e.callbackNode!=null&&e.callbackNode===n?Sg.bind(null,e):null)}function Ng(e,t){if(Or())return null;cg(e,t,!0)}function fv(){Tv(function(){(pt&6)!==0?$l(tn,dv):wg()})}function Kd(){if(ri===0){var e=Gi;e===0&&(e=ql,ql<<=1,(ql&261888)===0&&(ql=256)),ri=e}return ri}function Tg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:La(e)}function hv(e,t,n,a,i){if(t==="submit"&&n&&n.stateNode===i){var o=Tg((i[Ke]||null).action),m=a.submitter;m&&(t=(t=m[Ke]||null)?Tg(t.formAction):m.getAttribute("formAction"),t!==null&&(o=t,m=null));var w=new ki("action","action",null,a,i);e.push({event:w,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(ri!==0){var O=new FormData(i,m);ed(n,{pending:!0,data:O,method:i.method,action:o},null,O)}}else typeof o=="function"&&(w.preventDefault(),O=new FormData(i,m),ed(n,{pending:!0,data:O,method:i.method,action:o},o,O))},currentTarget:i}]})}}for(var Zd=0;Zd<kt.length;Zd++){var Qd=kt[Zd],mv=Qd.toLowerCase(),gv=Qd[0].toUpperCase()+Qd.slice(1);gt(mv,"on"+gv)}gt(Oe,"onAnimationEnd"),gt(lt,"onAnimationIteration"),gt(Qe,"onAnimationStart"),gt("dblclick","onDoubleClick"),gt("focusin","onFocus"),gt("focusout","onBlur"),gt(Je,"onTransitionRun"),gt(Zt,"onTransitionStart"),gt($t,"onTransitionCancel"),gt(ln,"onTransitionEnd"),Sn("onMouseEnter",["mouseout","mouseover"]),Sn("onMouseLeave",["mouseout","mouseover"]),Sn("onPointerEnter",["pointerout","pointerover"]),Sn("onPointerLeave",["pointerout","pointerover"]),St("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),St("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),St("onBeforeInput",["compositionend","keypress","textInput","paste"]),St("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),St("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),St("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Vo="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(" "),pv=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Vo));function Cg(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var a=e[n],i=a.event;a=a.listeners;e:{var o=void 0;if(t)for(var m=a.length-1;0<=m;m--){var w=a[m],O=w.instance,q=w.currentTarget;if(w=w.listener,O!==o&&i.isPropagationStopped())break e;o=w,i.currentTarget=q;try{o(i)}catch(Z){Bc(Z)}i.currentTarget=null,o=O}else for(m=0;m<a.length;m++){if(w=a[m],O=w.instance,q=w.currentTarget,w=w.listener,O!==o&&i.isPropagationStopped())break e;o=w,i.currentTarget=q;try{o(i)}catch(Z){Bc(Z)}i.currentTarget=null,o=O}}}}function We(e,t){var n=t[El];n===void 0&&(n=t[El]=new Set);var a=e+"__bubble";n.has(a)||(Eg(t,e,2,!1),n.add(a))}function Jd(e,t,n){var a=0;t&&(a|=4),Eg(n,e,a,t)}var Rr="_reactListening"+Math.random().toString(36).slice(2);function Fd(e){if(!e[Rr]){e[Rr]=!0,Ps.forEach(function(n){n!=="selectionchange"&&(pv.has(n)||Jd(n,!1,e),Jd(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Rr]||(t[Rr]=!0,Jd("selectionchange",!1,t))}}function Eg(e,t,n,a){switch(pp(t)){case 2:var i=cb;break;case 8:i=rb;break;default:i=yf}n=i.bind(null,t,n,e),i=void 0,!os||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),a?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Wd(e,t,n,a,i){var o=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var m=a.tag;if(m===3||m===4){var w=a.stateNode.containerInfo;if(w===i)break;if(m===4)for(m=a.return;m!==null;){var O=m.tag;if((O===3||O===4)&&m.stateNode.containerInfo===i)return;m=m.return}for(;w!==null;){if(m=hn(w),m===null)return;if(O=m.tag,O===5||O===6||O===26||O===27){a=o=m;continue e}w=w.parentNode}}a=a.return}gc(function(){var q=o,Z=ao(n),ee=[];e:{var L=_e.get(e);if(L!==void 0){var K=ki,pe=e;switch(e){case"keypress":if(Ei(n)===0)break e;case"keydown":case"keyup":K=fo;break;case"focusin":pe="focus",K=Ga;break;case"focusout":pe="blur",K=Ga;break;case"beforeblur":case"afterblur":K=Ga;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":K=ro;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":K=zi;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":K=fu;break;case Oe:case lt:case Qe:K=yc;break;case ln:K=hu;break;case"scroll":case"scrollend":K=au;break;case"wheel":K=Tc;break;case"copy":case"cut":case"paste":K=ou;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":K=jc;break;case"submit":K=Sc;break;case"toggle":case"beforetoggle":K=rs}var Se=(t&4)!==0,Le=!Se&&(e==="scroll"||e==="scrollend"),G=Se?L!==null?L+"Capture":null:L;Se=[];for(var H=q,V;H!==null;){var P=H;if(V=P.stateNode,P=P.tag,P!==5&&P!==26&&P!==27||V===null||G===null||(P=Vl(H,G),P!=null&&Se.push(Ko(H,P,V))),Le)break;H=H.return}0<Se.length&&(L=new K(L,pe,null,n,Z),ee.push({event:L,listeners:Se}))}}if((t&7)===0){e:{if(K=e==="mouseover"||e==="pointerover",L=e==="mouseout"||e==="pointerout",K&&n!==ss&&(pe=n.relatedTarget||n.fromElement)&&(hn(pe)||pe[jt]))break e;(L||K)&&(pe=Z.window===Z?Z:(K=Z.ownerDocument)?K.defaultView||K.parentWindow:window,L?(K=n.relatedTarget||n.toElement,L=q,K=K?hn(K):null,K!==null&&(Le=p(K),Se=K.tag,K!==Le||Se!==5&&Se!==27&&Se!==6)&&(K=null)):(L=null,K=q),L!==K&&(Se=ro,P="onMouseLeave",G="onMouseEnter",H="mouse",(e==="pointerout"||e==="pointerover")&&(Se=jc,P="onPointerLeave",G="onPointerEnter",H="pointer"),Le=L==null?pe:ji(L),V=K==null?pe:ji(K),pe=new Se(P,H+"leave",L,n,Z),pe.target=Le,pe.relatedTarget=V,P=null,hn(Z)===q&&(Se=new Se(G,H+"enter",K,n,Z),Se.target=V,Se.relatedTarget=Le,P=Se),Le=P,Se=L&&K?le(L,K,yv):null,L!==null&&Mg(ee,pe,L,Se,!1),K!==null&&Le!==null&&Mg(ee,Le,K,Se,!0)))}e:{if(L=q?ji(q):window,K=L.nodeName&&L.nodeName.toLowerCase(),K==="select"||K==="input"&&L.type==="file")var xe=Ri;else if(Mc(L))if(Xa)xe=Dc;else{xe=Ac;var et=zc}else K=L.nodeName,!K||K.toLowerCase()!=="input"||L.type!=="checkbox"&&L.type!=="radio"?q&&ga(q.elementType)&&(xe=Ri):xe=Oc;if(xe&&(xe=xe(e,q))){hl(ee,xe,n,Z);break e}et&&et(e,L,q)}switch(et=q?ji(q):window,e){case"focusin":(Mc(et)||et.contentEditable==="true")&&(ja=et,ms=q,d=null);break;case"focusout":d=ms=ja=null;break;case"mousedown":g=!0;break;case"contextmenu":case"mouseup":case"dragend":g=!1,x(ee,n,Z);break;case"selectionchange":if(_c)break;case"keydown":case"keyup":x(ee,n,Z)}var ze;if(Ai)e:{switch(e){case"compositionstart":var De="onCompositionStart";break e;case"compositionend":De="onCompositionEnd";break e;case"compositionupdate":De="onCompositionUpdate";break e}De=void 0}else fl?Ec(e,n)&&(De="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(De="onCompositionStart");De&&(ho&&n.locale!=="ko"&&(fl||De!=="onCompositionStart"?De==="onCompositionEnd"&&fl&&(ze=so()):(Xn=Z,ul="value"in Xn?Xn.value:Xn.textContent,fl=!0)),et=_r(q,De),0<et.length&&(De=new uo(De,e,null,n,Z),ee.push({event:De,listeners:et}),ze?De.data=ze:(ze=Ge(n),ze!==null&&(De.data=ze)))),(ze=pu?yu(e,n):vu(e,n))&&(De=_r(q,"onBeforeInput"),0<De.length&&(et=new uo("onBeforeInput","beforeinput",null,n,Z),ee.push({event:et,listeners:De}),et.data=ze)),hv(ee,e,q,n,Z)}Cg(ee,t)})}function Ko(e,t,n){return{instance:e,listener:t,currentTarget:n}}function _r(e,t){for(var n=t+"Capture",a=[];e!==null;){var i=e,o=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||o===null||(i=Vl(e,n),i!=null&&a.unshift(Ko(e,i,o)),i=Vl(e,t),i!=null&&a.push(Ko(e,i,o))),e.tag===3)return a;e=e.return}return[]}function yv(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Mg(e,t,n,a,i){for(var o=t._reactName,m=[];n!==null&&n!==a;){var w=n,O=w.alternate,q=w.stateNode;if(w=w.tag,O!==null&&O===a)break;w!==5&&w!==26&&w!==27||q===null||(O=q,i?(q=Vl(n,o),q!=null&&m.unshift(Ko(n,q,O))):i||(q=Vl(n,o),q!=null&&m.push(Ko(n,q,O)))),n=n.return}m.length!==0&&e.push({event:t,listeners:m})}var vv=/\r\n?/g,bv=/\u0000|\uFFFD/g;function kg(e){return(typeof e=="string"?e:""+e).replace(vv,`
49
+ `).replace(bv,"")}function zg(e,t){return t=kg(t),kg(e)===t}function xt(e,t,n,a,i,o){switch(n){case"children":if(typeof a=="string")t==="body"||t==="textarea"&&a===""||qn(e,a);else if(typeof a=="number"||typeof a=="bigint")t!=="body"&&qn(e,""+a);else return;break;case"className":Ni(e,"class",a);break;case"tabIndex":Ni(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Ni(e,n,a);break;case"style":kl(e,a,o);return;case"data":if(t!=="object"){Ni(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=La(a),e.setAttribute(n,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof o=="function"&&(n==="formAction"?(t!=="input"&&xt(e,t,"name",i.name,i,null),xt(e,t,"formEncType",i.formEncType,i,null),xt(e,t,"formMethod",i.formMethod,i,null),xt(e,t,"formTarget",i.formTarget,i,null)):(xt(e,t,"encType",i.encType,i,null),xt(e,t,"method",i.method,i,null),xt(e,t,"target",i.target,i,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=La(a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=On);return;case"onScroll":a!=null&&We("scroll",e);return;case"onScrollEnd":a!=null&&We("scrollend",e);return;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(f(61));if(n=a.__html,n!=null){if(i.children!=null)throw Error(f(60));(o!=null?o.__html:void 0)!==n&&(e.innerHTML=n)}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}n=La(a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,a):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":a===!0?e.setAttribute(n,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,a):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(n,a):e.removeAttribute(n);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(n):e.setAttribute(n,a);break;case"popover":We("beforetoggle",e),We("toggle",e),Si(e,"popover",a);break;case"xlinkActuate":Yn(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Yn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Yn(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Yn(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Yn(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Yn(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Yn(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Yn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Yn(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Si(e,"is",a);break;case"innerText":case"textContent":return;default:if(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")n=as.get(n)||n,Si(e,n,a);else return}nt=!0}function Id(e,t,n,a,i,o){switch(n){case"style":kl(e,a,o);return;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(f(61));if(n=a.__html,n!=null){if(i.children!=null)throw Error(f(60));(o!=null?o.__html:void 0)!==n&&(e.innerHTML=n)}}break;case"children":if(typeof a=="string")qn(e,a);else if(typeof a=="number"||typeof a=="bigint")qn(e,""+a);else return;break;case"onScroll":a!=null&&We("scroll",e);return;case"onScrollEnd":a!=null&&We("scrollend",e);return;case"onClick":a!=null&&(e.onclick=On);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!eo.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(i=n.endsWith("Capture"),o=n.slice(2,i?n.length-7:void 0),t=e[Ke]||null,t=t!=null?t[n]:null,typeof t=="function"&&e.removeEventListener(o,t,i),typeof a=="function")){typeof t!="function"&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,a,i);break e}nt=!0,n in e?e[n]=a:a===!0?e.setAttribute(n,""):Si(e,n,a)}return}nt=!0}function vn(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":We("error",e),We("load",e);var a=!1,i=!1,o;for(o in n)if(n.hasOwnProperty(o)){var m=n[o];if(m!=null)switch(o){case"src":a=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(f(137,t));default:xt(e,t,o,m,n,null)}}i&&xt(e,t,"srcSet",n.srcSet,n,null),a&&xt(e,t,"src",n.src,n,null);return;case"input":We("invalid",e);var w=o=m=i=null,O=null,q=null;for(a in n)if(n.hasOwnProperty(a)){var Z=n[a];if(Z!=null)switch(a){case"name":i=Z;break;case"type":m=Z;break;case"checked":O=Z;break;case"defaultChecked":q=Z;break;case"value":o=Z;break;case"defaultValue":w=Z;break;case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(f(137,t));break;default:xt(e,t,a,Z,n,null)}}Jt(e,o,w,O,q,m,i,!1);return;case"select":We("invalid",e),a=m=o=null;for(i in n)if(n.hasOwnProperty(i)&&(w=n[i],w!=null))switch(i){case"value":o=w;break;case"defaultValue":m=w;break;case"multiple":a=w;default:xt(e,t,i,w,n,null)}t=o,n=m,e.multiple=!!a,t!=null?ha(e,!!a,t,!1):n!=null&&ha(e,!!a,n,!0);return;case"textarea":We("invalid",e),o=i=a=null;for(m in n)if(n.hasOwnProperty(m)&&(w=n[m],w!=null))switch(m){case"value":a=w;break;case"defaultValue":i=w;break;case"children":o=w;break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(f(91));break;default:xt(e,t,m,w,n,null)}ma(e,a,i,o);return;case"option":for(O in n)if(n.hasOwnProperty(O)&&(a=n[O],a!=null))switch(O){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:xt(e,t,O,a,n,null)}return;case"dialog":We("beforetoggle",e),We("toggle",e),We("cancel",e),We("close",e);break;case"iframe":case"object":We("load",e);break;case"video":case"audio":for(a=0;a<Vo.length;a++)We(Vo[a],e);break;case"image":We("error",e),We("load",e);break;case"details":We("toggle",e);break;case"embed":case"source":case"link":We("error",e),We("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(q in n)if(n.hasOwnProperty(q)&&(a=n[q],a!=null))switch(q){case"children":case"dangerouslySetInnerHTML":throw Error(f(137,t));default:xt(e,t,q,a,n,null)}return;default:if(ga(t)){for(Z in n)n.hasOwnProperty(Z)&&(a=n[Z],a!==void 0&&Id(e,t,Z,a,n,void 0));return}}for(w in n)n.hasOwnProperty(w)&&(a=n[w],a!=null&&xt(e,t,w,a,n,null))}var xv={};function wv(e,t,n,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,o=null,m=null,w=null,O=null,q=null,Z=null;for(K in n){var ee=n[K];if(n.hasOwnProperty(K)&&ee!=null)switch(K){case"checked":break;case"value":break;case"defaultValue":O=ee;default:a.hasOwnProperty(K)||xt(e,t,K,null,a,ee)}}for(var L in a){var K=a[L];if(ee=n[L],a.hasOwnProperty(L)&&(K!=null||ee!=null))switch(L){case"type":K!==ee&&(nt=!0),o=K;break;case"name":K!==ee&&(nt=!0),i=K;break;case"checked":K!==ee&&(nt=!0),q=K;break;case"defaultChecked":K!==ee&&(nt=!0),Z=K;break;case"value":K!==ee&&(nt=!0),m=K;break;case"defaultValue":K!==ee&&(nt=!0),w=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(f(137,t));break;default:K!==ee&&xt(e,t,L,K,a,ee)}}Ti(e,m,w,O,q,Z,o,i);return;case"select":K=m=w=L=null;for(o in n)if(O=n[o],n.hasOwnProperty(o)&&O!=null)switch(o){case"value":break;case"multiple":K=O;default:a.hasOwnProperty(o)||xt(e,t,o,null,a,O)}for(i in a)if(o=a[i],O=n[i],a.hasOwnProperty(i)&&(o!=null||O!=null))switch(i){case"value":o!==O&&(nt=!0),L=o;break;case"defaultValue":o!==O&&(nt=!0),w=o;break;case"multiple":o!==O&&(nt=!0),m=o;default:o!==O&&xt(e,t,i,o,a,O)}t=w,n=m,a=K,L!=null?ha(e,!!n,L,!1):!!a!=!!n&&(t!=null?ha(e,!!n,t,!0):ha(e,!!n,n?[]:"",!1));return;case"textarea":K=L=null;for(w in n)if(i=n[w],n.hasOwnProperty(w)&&i!=null&&!a.hasOwnProperty(w))switch(w){case"value":break;case"children":break;default:xt(e,t,w,null,a,i)}for(m in a)if(i=a[m],o=n[m],a.hasOwnProperty(m)&&(i!=null||o!=null))switch(m){case"value":i!==o&&(nt=!0),L=i;break;case"defaultValue":i!==o&&(nt=!0),K=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(f(91));break;default:i!==o&&xt(e,t,m,i,a,o)}mc(e,L,K);return;case"option":for(var pe in n)if(L=n[pe],n.hasOwnProperty(pe)&&L!=null&&!a.hasOwnProperty(pe))switch(pe){case"selected":e.selected=!1;break;default:xt(e,t,pe,null,a,L)}for(O in a)if(L=a[O],K=n[O],a.hasOwnProperty(O)&&L!==K&&(L!=null||K!=null))switch(O){case"selected":L!==K&&(nt=!0),e.selected=L&&typeof L!="function"&&typeof L!="symbol";break;default:xt(e,t,O,L,a,K)}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 Se in n)L=n[Se],n.hasOwnProperty(Se)&&L!=null&&!a.hasOwnProperty(Se)&&xt(e,t,Se,null,a,L);for(q in a)if(L=a[q],K=n[q],a.hasOwnProperty(q)&&L!==K&&(L!=null||K!=null))switch(q){case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(f(137,t));break;default:xt(e,t,q,L,a,K)}return;default:if(ga(t)){for(var Le in n)L=n[Le],n.hasOwnProperty(Le)&&L!==void 0&&!a.hasOwnProperty(Le)&&Id(e,t,Le,void 0,a,L);for(Z in a)L=a[Z],K=n[Z],!a.hasOwnProperty(Z)||L===K||L===void 0&&K===void 0||Id(e,t,Z,L,a,K);return}}for(var G in n)L=n[G],n.hasOwnProperty(G)&&L!=null&&!a.hasOwnProperty(G)&&xt(e,t,G,null,a,L);for(ee in a)L=a[ee],K=n[ee],!a.hasOwnProperty(ee)||L===K||L==null&&K==null||xt(e,t,ee,L,a,K)}function Ag(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function jv(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),a=0;a<n.length;a++){var i=n[a],o=i.transferSize,m=i.initiatorType,w=i.duration;if(o&&w&&Ag(m)){for(m=0,w=i.responseEnd,a+=1;a<n.length;a++){var O=n[a],q=O.startTime;if(q>w)break;var Z=O.transferSize,ee=O.initiatorType;Z&&Ag(ee)&&(O=O.responseEnd,m+=Z*(O<w?1:(w-q)/(O-q)))}if(--a,t+=8*(o+m)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Pd=null,ef=null;function Zo(e){return e.nodeType===9?e:e.ownerDocument}function Og(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Dg(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Rg(e,t,n,a){return n=Zo(n).createElement(e),n[_t]=a,n[Ke]=t,vn(n,e,t),Kt(n),n}function tf(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var nf=null;function Sv(){var e=window.event;return e&&e.type==="popstate"?e===nf?!1:(nf=e,!0):(nf=null,!1)}var lf=typeof setTimeout=="function"?setTimeout:void 0,Nv=typeof clearTimeout=="function"?clearTimeout:void 0,_g=typeof Promise=="function"?Promise:void 0,Bg=typeof requestAnimationFrame=="function"?requestAnimationFrame:lf,Tv=typeof queueMicrotask=="function"?queueMicrotask:typeof _g<"u"?function(e){return _g.resolve(null).then(e).catch(Cv)}:lf;function Cv(e){setTimeout(function(){throw e})}function ui(e){return e==="head"}function Ug(e,t){var n=t,a=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"||n==="/&"){if(a===0){e.removeChild(i),Ks(t);return}a--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")a++;else if(n==="html")ff(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,ff(n);for(var o=n.firstChild;o;){var m=o.nextSibling,w=o.nodeName;o[Ba]||w==="SCRIPT"||w==="STYLE"||w==="LINK"&&o.rel.toLowerCase()==="stylesheet"||n.removeChild(o),o=m}}else n==="body"&&ff(e.ownerDocument.body);n=i}while(n);Ks(t)}function Hg(e,t){var n=e;e=0;do{var a=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=a}while(n)}function $g(e,t,n){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display==="inline"){if(t=e.getClientRects(),t.length===1)var a=1;else for(var i=a=0;i<t.length;i++){var o=t[i];0<o.width&&0<o.height&&a++}a===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+n.paddingTop,e.marginBottom="-"+n.paddingBottom)}}function Lg(e,t){e=e.style,t=t.style;var n=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=n==null||typeof n=="boolean"?"":(""+n).trim(),n=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=n==null||typeof n=="boolean"?"":(""+n).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(n=t.display,e.display=n==null||typeof n=="boolean"?"":n,n=t.margin,n!=null?e.margin=n:(n=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=n==null||typeof n=="boolean"?"":n,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t=="boolean"?"":t)))}function Ev(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position==="absolute"||t.position==="fixed",clip:t.clipPath!=="none"||t.overflow!=="visible"||t.filter!=="none"||t.mask!=="none"||t.mask!=="none"||t.borderRadius!=="0px",view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function af(e){var t=e.getBoundingClientRect(),n=getComputedStyle(e);return Ev(t,n,e)}function Mv(e){return e.documentElement.clientHeight}function kv(e){this.addEventListener("load",e),this.addEventListener("error",e)}function zv(e,t,n,a,i,o,m,w,O){var q=t.nodeType===9?t:t.ownerDocument;try{var Z=q.startViewTransition({update:function(){var L=q.defaultView,K=L.navigation&&L.navigation.transition,pe=q.fonts.status;a();var Se=[];if(pe==="loaded"&&(Mv(q),q.fonts.status==="loading"&&Se.push(q.fonts.ready)),pe=Se.length,e!==null)for(var Le=e.suspenseyImages,G=0,H=0;H<Le.length;H++){var V=Le[H];if(!V.complete){var P=V.getBoundingClientRect();if(0<P.bottom&&0<P.right&&P.top<L.innerHeight&&P.left<L.innerWidth){if(G+=op(V),G>Hr){Se.length=pe;break}V=new Promise(kv.bind(V)),Se.push(V)}}}if(0<Se.length)return L=Promise.race([Promise.all(Se),new Promise(function(xe){return setTimeout(xe,500)})]).then(i,i),(K?Promise.allSettled([K.finished,L]):L).then(o,o);if(i(),K)return K.finished.then(o,o);o()},types:n});q.__reactViewTransition=Z;var ee=[];return Z.ready.then(function(){for(var L=q.documentElement.getAnimations({subtree:!0}),K=0;K<L.length;K++){var pe=L[K],Se=pe.effect,Le=Se.pseudoElement;if(Le!=null&&Le.startsWith("::view-transition")){ee.push(pe),pe=Se.getKeyframes();for(var G=Le=void 0,H=!0,V=0;V<pe.length;V++){var P=pe[V],xe=P.width;if(Le===void 0)Le=xe;else if(Le!==xe){H=!1;break}if(xe=P.height,G===void 0)G=xe;else if(G!==xe){H=!1;break}delete P.width,delete P.height,P.transform==="none"&&delete P.transform}H&&Le!==void 0&&G!==void 0&&(Se.setKeyframes(pe),H=getComputedStyle(Se.target,Se.pseudoElement),H.width!==Le||H.height!==G)&&(H=pe[0],H.width=Le,H.height=G,H=pe[pe.length-1],H.width=Le,H.height=G,Se.setKeyframes(pe))}}m()},function(L){q.__reactViewTransition===Z&&(q.__reactViewTransition=null);try{if(typeof L=="object"&&L!==null)switch(L.name){case"InvalidStateError":(L.message==="View transition was skipped because document visibility state is hidden."||L.message==="Skipping view transition because document visibility state has become hidden."||L.message==="Skipping view transition because viewport size changed."||L.message==="Transition was aborted because of invalid state")&&(L=null)}L!==null&&O(L)}finally{a(),i(),m()}}),Z.finished.finally(function(){for(var L=0;L<ee.length;L++)ee[L].cancel();q.__reactViewTransition===Z&&(q.__reactViewTransition=null),w()}),Z}catch{return a(),i(),m(),null}}function Pi(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}Pi.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:oe({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Pi.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),a=[],i=0;i<n.length;i++){var o=n[i].effect;o!==null&&o.target===e&&o.pseudoElement===t&&a.push(n[i])}return a},Pi.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Yg(e){return{name:e,group:new Pi("group",e),imagePair:new Pi("image-pair",e),old:new Pi("old",e),new:new Pi("new",e)}}function al(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}al.prototype.addEventListener=function(e,t,n){var a=null,i=null;if(!(n!=null&&typeof n!="boolean"&&(a=n.signal||null,a!==null&&a.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var o=this._eventListeners;if(qg(o,e,t,n)===-1){var m=this,w=t;n!=null&&typeof n!="boolean"&&n.once===!0&&(w=function(O){m.removeEventListener(e,t,n),typeof t=="function"?t.call(this,O):t.handleEvent(O)}),a!==null&&(i=m.removeEventListener.bind(m,e,t,n),a.addEventListener("abort",i,{once:!0}),i=a.removeEventListener.bind(a,"abort",i)),a=Ls(n),o.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:w,cleanup:i}),b(this._fragmentFiber.child,!1,Av,e,w,a)}this._eventListeners=o}};function Av(e,t,n,a){return N(e).addEventListener(t,n,a),!1}al.prototype.removeEventListener=function(e,t,n){var a=this._eventListeners;if(a!==null&&(t=qg(a,e,t,n),t!==-1)){var i=a[t];n=i.attachedListener;var o=i.cleanup;i=Ls(i.optionsOrUseCapture),b(this._fragmentFiber.child,!1,Ov,e,n,i),a.splice(t,1),o!==null&&o()}};function Ov(e,t,n,a){return N(e).removeEventListener(t,n,a),!1}function Ls(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Gg(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function qg(e,t,n,a){if(e.length===0)return-1;a=Gg(a);for(var i=0;i<e.length;i++){var o=e[i];if(o.type===t&&o.listener===n&&Gg(o.optionsOrUseCapture)===a)return i}return-1}al.prototype.dispatchEvent=function(e){var t=k(this._fragmentFiber);if(t===null)return!0;t=N(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var a=t.nodeType===9?t.createComment(""):document.createTextNode("");if(n)for(var i=0;i<n.length;i++){var o=n[i];a.addEventListener(o.type,o.attachedListener,Ls(o.optionsOrUseCapture))}if(t.appendChild(a),e=a.dispatchEvent(e),n)for(i=0;i<n.length;i++)o=n[i],a.removeEventListener(o.type,o.attachedListener,Ls(o.optionsOrUseCapture));return t.removeChild(a),e}return t.dispatchEvent(e)},al.prototype.focus=function(e){b(this._fragmentFiber.child,!0,Xg,e,void 0,void 0)};function Xg(e,t){return e.tag===6?!1:(e=N(e),Xv(e,t))}al.prototype.focusLast=function(e){var t=[];b(this._fragmentFiber.child,!0,sf,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Xg(t[n],e);n--);};function sf(e,t){return t.push(e),!1}al.prototype.blur=function(){var e=k(this._fragmentFiber);e!==null&&(e=N(e),e=Zo(e).activeElement,e!==null&&b(this._fragmentFiber.child,!1,Dv,e,void 0,void 0))};function Dv(e,t){return e.tag===6?!1:(e=N(e),e===t||e.contains(t)?(t.blur(),!0):!1)}al.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),b(this._fragmentFiber.child,!1,Rv,e,void 0,void 0)};function Rv(e,t){return e.tag===6||(e=N(e),t.observe(e)),!1}al.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),b(this._fragmentFiber.child,!1,_v,e,void 0,void 0);for(var n=t=0;n<_l.length;n++){var a=_l[n];a.fragmentInstance===this&&a.observer===e?e.unobserve(a.instance):_l[t++]=a}_l.length=t}};function _v(e,t){return e.tag===6||(e=N(e),t.unobserve(e)),!1}var _l=[],of=!1;function Bv(e,t,n){_l.push({fragmentInstance:e,observer:t,instance:n}),of||(of=!0,Vv(function(){of=!1;var a=_l;_l=[];for(var i=0;i<a.length;i++){var o=a[i];o.observer.unobserve(o.instance)}}))}al.prototype.getClientRects=function(){var e=[];return b(this._fragmentFiber.child,!1,Uv,e,void 0,void 0),e};function Uv(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=N(e),t.push.apply(t,e.getClientRects());return!1}al.prototype.getRootNode=function(e){var t=k(this._fragmentFiber);return t===null?this:N(t).getRootNode(e)},al.prototype.compareDocumentPosition=function(e){var t=k(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];b(this._fragmentFiber.child,!1,sf,n,void 0,void 0);var a=N(t);if(n.length===0){if(n=a,R(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break e}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=a=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:a&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=B(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=N(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=N(n[0]),i=N(n[n.length-1]);var o=R(this._fragmentFiber)?t.parentElement:a;if(o==null)return Node.DOCUMENT_POSITION_DISCONNECTED;a=o.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,o=o.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var m=t.compareDocumentPosition(e),w=i.compareDocumentPosition(e),O=m&Node.DOCUMENT_POSITION_CONTAINED_BY||w&Node.DOCUMENT_POSITION_CONTAINED_BY;return w=a&&o&&m&Node.DOCUMENT_POSITION_FOLLOWING&&w&Node.DOCUMENT_POSITION_PRECEDING,t=a&&t===e||o&&i===e||O||w?Node.DOCUMENT_POSITION_CONTAINED_BY:!a&&t===e||!o&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:m,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Hv(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Hv(e,t,n,a,i){var o=hn(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!o)e:{for(;o!==null;){if(o.tag===7&&(o===t||o.alternate===t)){n=!0;break e}o=o.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(o===null)return o=i.ownerDocument,i===o||i===o.documentElement||i===o.body;e:{for(o=t,t=k(t);o!==null;){if(!(o.tag!==5&&o.tag!==3&&o.tag!==27||o!==t&&o.alternate!==t)){o=!0;break e}o=o.return}o=!1}return o}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!o)&&!(t=o===n)&&(t=le(n,o,ce),t===null?t=!1:(b(t,!0,ne,o,n),o=_,_=null,t=o!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!o)&&!(t=o===a)&&(t=le(a,o,ce),t===null?t=!1:(b(t,!0,J,o,a),o=_,W=_=null,t=o!==null)),t):!1}function Vg(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}al.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(f(566));var t=[];b(this._fragmentFiber.child,!1,sf,t,void 0,void 0);var n=e!==!1;if(t.length===0){var a=B(this._fragmentFiber);if(a=n?a[1]||a[0]||k(this._fragmentFiber):a[0]||a[1],a===null)return;if(a.tag===6){e=N(a),Vg(e,n);return}if(a=N(a),a.nodeType!==9){if(a.nodeType===11){n="host"in a?a.host:null,n!==null&&n.scrollIntoView(e);return}a.scrollIntoView(e)}}for(a=n?t.length-1:0;a!==(n?-1:t.length);){var i=t[a];i.tag===6?(i=N(i),Vg(i,n)):N(i).scrollIntoView(e),a+=n?-1:1}};function $v(e,t){return e=N(e),Kg(e,t),!1}function Kg(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function Zg(e,t){var n=t._eventListeners;if(n!==null)for(var a=0;a<n.length;a++){var i=n[a];e.addEventListener(i.type,i.attachedListener,Ls(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(o){for(var m=0,w=0;w<_l.length;w++){var O=_l[w];(O.fragmentInstance!==t||O.observer!==o||O.instance!==e)&&(_l[m++]=O)}_l.length=m,o.observe(e)}),Kg(e,t))}function Lv(e,t){var n=t._eventListeners;if(n!==null)for(var a=0;a<n.length;a++){var i=n[a];e.removeEventListener(i.type,i.attachedListener,Ls(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(o){typeof o.rootMargin=="string"?Bv(t,o,e):o.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function cf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":cf(n),ls(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function Yv(e,t,n,a){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[Ba])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(o=e.getAttribute("rel"),o==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(o!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(o=e.getAttribute("src"),(o!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&o&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var o=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===o)return e}else return e;if(e=wl(e.nextSibling),e===null)break}return null}function Gv(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=wl(e.nextSibling),e===null))return null;return e}function Qg(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=wl(e.nextSibling),e===null))return null;return e}function rf(e){return e.data==="$?"||e.data==="$~"}function uf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function qv(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var a=function(){t(),n.removeEventListener("DOMContentLoaded",a)};n.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function wl(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var df=null;function Jg(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return wl(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Fg(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function Xv(e,t){function n(){a=!0}if(e.ownerDocument.activeElement===e)return!0;var a=!1;try{e.ownerDocument.addEventListener("focus",n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",n,!0)}return a}function Vv(e){Bg(function(){Bg(function(t){return e(t)})})}function Wg(e,t,n){switch(t=Zo(n),e){case"html":if(e=t.documentElement,!e)throw Error(f(452));return e;case"head":if(e=t.head,!e)throw Error(f(453));return e;case"body":if(e=t.body,!e)throw Error(f(454));return e;default:throw Error(f(451))}}function Ig(e,t,n){for(var a in n){var i=n[a];n.hasOwnProperty(a)&&i!=null&&xt(e,t,a,null,xv,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===On&&(e.onclick=null),ls(e)}function ff(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ls(e)}var jl=new Map,Pg=new Set;function Qo(e){if(typeof e.getRootNode=="function"){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Oa=de.d;de.d={f:Kv,r:Zv,D:Qv,C:Jv,L:Fv,m:Wv,X:Pv,S:Iv,M:eb};function Kv(){var e=Oa.f(),t=kr();return e||t}function Zv(e){var t=An(e);t!==null&&t.tag===5&&t.type==="form"?tm(t):Oa.r(e)}var Ys=typeof document>"u"?null:document;function ep(e,t,n){var a=Ys;if(a&&typeof t=="string"&&t){var i=mt(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),Pg.has(i)||(Pg.add(i),e={rel:e,crossOrigin:n,href:t},a.querySelector(i)===null&&(t=a.createElement("link"),vn(t,"link",e),Kt(t),a.head.appendChild(t)))}}function Qv(e){Oa.D(e),ep("dns-prefetch",e,null)}function Jv(e,t){Oa.C(e,t),ep("preconnect",e,t)}function Fv(e,t,n){Oa.L(e,t,n);var a=Ys;if(a&&e&&t){var i='link[rel="preload"][as="'+mt(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+mt(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+mt(n.imageSizes)+'"]')):i+='[href="'+mt(e)+'"]';var o=i;switch(t){case"style":o=Gs(e);break;case"script":o=qs(e)}if(!(jl.has(o)||(e=oe({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),jl.set(o,e),a.querySelector(i)!==null||t==="style"&&a.querySelector(Jo(o))||t==="script"&&a.querySelector(Fo(o))))){var m=a.createElement("link");vn(m,"link",e),t==="style"&&(m[Xl]=!0,m.onload=m.onerror=function(){Is(m)}),Kt(m),a.head.appendChild(m)}}}function Wv(e,t){Oa.m(e,t);var n=Ys;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+mt(a)+'"][href="'+mt(e)+'"]',o=i;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=qs(e)}if(!jl.has(o)&&(e=oe({rel:"modulepreload",href:e},t),jl.set(o,e),n.querySelector(i)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Fo(o)))return}a=n.createElement("link"),vn(a,"link",e),Kt(a),n.head.appendChild(a)}}}function Iv(e,t,n){Oa.S(e,t,n);var a=Ys;if(a&&e){var i=da(a).hoistableStyles,o=Gs(e);t=t||"default";var m=i.get(o);if(!m){var w={loading:0,preload:null};if(m=a.querySelector(Jo(o)))w.loading=5;else{e=oe({rel:"stylesheet",href:e,"data-precedence":t},n),(n=jl.get(o))&&hf(e,n);var O=m=a.createElement("link");Kt(O),vn(O,"link",e),O._p=new Promise(function(q,Z){O.onload=q,O.onerror=Z}),O.addEventListener("load",function(){w.loading|=1}),O.addEventListener("error",function(){w.loading|=2}),w.loading|=4,Br(m,t,a)}m={type:"stylesheet",instance:m,count:1,state:w},i.set(o,m)}}}function Pv(e,t){Oa.X(e,t);var n=Ys;if(n&&e){var a=da(n).hoistableScripts,i=qs(e),o=a.get(i);o||(o=n.querySelector(Fo(i)),o||(e=oe({src:e,async:!0},t),(t=jl.get(i))&&mf(e,t),o=n.createElement("script"),Kt(o),vn(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},a.set(i,o))}}function eb(e,t){Oa.M(e,t);var n=Ys;if(n&&e){var a=da(n).hoistableScripts,i=qs(e),o=a.get(i);o||(o=n.querySelector(Fo(i)),o||(e=oe({src:e,async:!0,type:"module"},t),(t=jl.get(i))&&mf(e,t),o=n.createElement("script"),Kt(o),vn(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},a.set(i,o))}}function tp(e,t,n,a){var i=(i=ht.current)?Qo(i):null;if(!i)throw Error(f(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(n=Gs(n.href),t=da(i).hoistableStyles,a=t.get(n),a||(a={type:"style",instance:null,count:0,state:null},t.set(n,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Gs(n.href);var o=da(i).hoistableStyles,m=o.get(e);if(m||(i=i.ownerDocument||i,m={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,m),(o=i.querySelector(Jo(e)))?o._p||(m.instance=o,m.state.loading=5):(o=jl.get(e),o||(o={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},jl.set(e,o)),tb(i,e,o,m.state))),t&&a===null)throw Error(f(528,""));return m}if(t&&a!==null)throw Error(f(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(n=qs(n),t=da(i).hoistableScripts,a=t.get(n),a||(a={type:"script",instance:null,count:0,state:null},t.set(n,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(f(444,e))}}function Gs(e){return'href="'+mt(e)+'"'}function Jo(e){return'link[rel="stylesheet"]['+e+"]"}function np(e){return oe({},e,{"data-precedence":e.precedence,precedence:null})}function tb(e,t,n,a){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[Xl]!==!0){a.loading=1;return}}else t=e.createElement("link"),t[Xl]=!0,t.onload=t.onerror=Is.bind(null,t),vn(t,"link",n),Kt(t),e.head.appendChild(t);a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2})}function qs(e){return'[src="'+mt(e)+'"]'}function Fo(e){return"script[async]"+e}function lp(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+mt(n.href)+'"]');if(a)return t.instance=a,Kt(a),a;var i=oe({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),Kt(a),vn(a,"style",i),Br(a,n.precedence,e),t.instance=a;case"stylesheet":i=Gs(n.href);var o=e.querySelector(Jo(i));if(o)return t.state.loading|=4,t.instance=o,Kt(o),o;a=np(n),(i=jl.get(i))&&hf(a,i),o=(e.ownerDocument||e).createElement("link"),Kt(o);var m=o;return m._p=new Promise(function(w,O){m.onload=w,m.onerror=O}),vn(o,"link",a),t.state.loading|=4,Br(o,n.precedence,e),t.instance=o;case"script":return o=qs(n.src),(i=e.querySelector(Fo(o)))?(t.instance=i,Kt(i),i):(a=n,(i=jl.get(o))&&(a=oe({},n),mf(a,i)),e=e.ownerDocument||e,i=e.createElement("script"),Kt(i),vn(i,"link",a),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(f(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,Br(a,n.precedence,e));return t.instance}function Br(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=a.length?a[a.length-1]:null,o=i,m=0;m<a.length;m++){var w=a[m];if(w.dataset.precedence===t)o=w;else if(o!==i)break}o?o.parentNode.insertBefore(e,o.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function hf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function mf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ur=null;function ap(e,t,n){if(Ur===null){var a=new Map,i=Ur=new Map;i.set(n,a)}else i=Ur,a=i.get(n),a||(a=new Map,i.set(n,a));if(a.has(e))return a;for(a.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var o=n[i];if(!(o[Ba]||o[_t]||e==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var m=o.getAttribute(t)||"";m=e+m;var w=a.get(m);w?w.push(o):a.set(m,[o])}}return a}function gf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function nb(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function ip(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function sp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function op(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function cp(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=op(t),e.suspenseyImages.push(t)),e=ib.bind(e),t.decode().then(e,e))}function lb(e,t,n,a){if(n.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var i=Gs(a.href),o=t.querySelector(Jo(i));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Wo.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=o,Kt(o);return}o=t.ownerDocument||t,a=np(a),(i=jl.get(i))&&hf(a,i),o=o.createElement("link"),Kt(o);var m=o;m._p=new Promise(function(w,O){m.onload=w,m.onerror=O}),vn(o,"link",a),n.instance=o}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Wo.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Hr=0;function ab(e,t){return e.stylesheets&&e.count===0&&Lr(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var a=setTimeout(function(){if(e.stylesheets&&Lr(e,e.stylesheets),e.unsuspend){var o=e.unsuspend;e.unsuspend=null,o()}},6e4+t);0<e.imgBytes&&Hr===0&&(Hr=62500*jv());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Lr(e,e.stylesheets),e.unsuspend)){var o=e.unsuspend;e.unsuspend=null,o()}},(e.imgBytes>Hr?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(i)}}:null}function rp(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)Lr(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function Wo(){this.count--,rp(this)}function ib(){this.imgCount--,rp(this)}var $r=null;function Lr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,$r=new Map,t.forEach(sb,e),$r=null,Wo.call(e))}function sb(e,t){if(!(t.state.loading&4)){var n=$r.get(e);if(n)var a=n.get(null);else{n=new Map,$r.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<i.length;o++){var m=i[o];(m.nodeName==="LINK"||m.getAttribute("media")!=="not all")&&(n.set(m.dataset.precedence,m),a=m)}a&&n.set(null,a)}i=t.instance,m=i.getAttribute("data-precedence"),o=n.get(m)||a,o===a&&n.set(null,i),n.set(m,i),this.count++,a=Wo.bind(this),i.addEventListener("load",a),i.addEventListener("error",a),o?o.parentNode.insertBefore(i,o.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Xs={$$typeof:tt,Provider:null,Consumer:null,_currentValue:Ae,_currentValue2:Ae,_threadCount:0};function ob(e,t,n,a,i,o,m,w,O){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=xi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xi(0),this.hiddenUpdates=xi(null),this.identifierPrefix=a,this.onUncaughtError=i,this.onCaughtError=o,this.onRecoverableError=m,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=O,this.transitionTypes=null,this.incompleteTransitions=new Map}function up(e,t,n,a,i,o,m,w,O,q,Z,ee){return e=new ob(e,t,n,m,O,q,Z,ee,w),t=1,o===!0&&(t|=24),o=Kn(3,null,null,t),e.current=o,o.stateNode=e,t=ku(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:a,isDehydrated:n,cache:t},Du(o),e}function dp(e){return e?(e=ps,e):ps}function fp(e,t,n,a,i,o){i=dp(i),a.context===null?a.context=i:a.pendingContext=i,a=Ia(t),a.payload={element:n},o=o===void 0?null:o,o!==null&&(a.callback=o),n=Pa(e,a,t),n!==null&&(Fn(n,e,t),Mo(n,e,t))}function hp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function pf(e,t){hp(e,t),(e=e.alternate)&&hp(e,t)}function mp(e){if(e.tag===13||e.tag===31){var t=Bi(e,67108864);t!==null&&Fn(t,e,67108864),pf(e,67108864)}}function gp(e){if(e.tag===13||e.tag===31){var t=ll();t=Ie(t);var n=Bi(e,t);n!==null&&Fn(n,e,t),pf(e,t)}}var Vs=!0;function cb(e,t,n,a){var i=ae.T;ae.T=null;var o=de.p;try{de.p=2,yf(e,t,n,a)}finally{de.p=o,ae.T=i}}function rb(e,t,n,a){var i=ae.T;ae.T=null;var o=de.p;try{de.p=8,yf(e,t,n,a)}finally{de.p=o,ae.T=i}}function yf(e,t,n,a){if(Vs){var i=vf(a);if(i===null)Wd(e,t,a,Yr,n),yp(e,a);else if(db(i,e,t,n,a))a.stopPropagation();else if(yp(e,a),t&4&&-1<ub.indexOf(e)){for(;i!==null;){var o=An(i);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var m=zn(o.pendingLanes);if(m!==0){var w=o;for(w.pendingLanes|=2,w.entangledLanes|=2;m;){var O=1<<31-Ut(m);w.entanglements[1]|=O,m&=~O}la(o),(pt&6)===0&&(Cr=rt()+500,Xo(0))}}break;case 31:case 13:w=Bi(o,2),w!==null&&Fn(w,o,2),kr(),pf(o,2)}if(o=vf(a),o===null&&Wd(e,t,a,Yr,n),o===i)break;i=o}i!==null&&a.stopPropagation()}else Wd(e,t,a,null,n)}}function vf(e){return e=ao(e),bf(e)}var Yr=null;function bf(e){if(Yr=null,e=hn(e),e!==null){var t=p(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=v(t),e!==null)return e;e=null}else if(n===31){if(e=C(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Yr=e,null}function pp(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"fullscreenerror":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ze()){case tn:return 2;case Cl:return 8;case Yl:case ol:return 32;case Mt:return 268435456;default:return 32}default:return 32}}var xf=!1,di=null,fi=null,hi=null,Io=new Map,Po=new Map,mi=[],ub="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 yp(e,t){switch(e){case"focusin":case"focusout":di=null;break;case"dragenter":case"dragleave":fi=null;break;case"mouseover":case"mouseout":hi=null;break;case"pointerover":case"pointerout":Io.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Po.delete(t.pointerId)}}function ec(e,t,n,a,i,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:a,nativeEvent:o,targetContainers:[i]},t!==null&&(t=An(t),t!==null&&mp(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function db(e,t,n,a,i){switch(t){case"focusin":return di=ec(di,e,t,n,a,i),!0;case"dragenter":return fi=ec(fi,e,t,n,a,i),!0;case"mouseover":return hi=ec(hi,e,t,n,a,i),!0;case"pointerover":var o=i.pointerId;return Io.set(o,ec(Io.get(o)||null,e,t,n,a,i)),!0;case"gotpointercapture":return o=i.pointerId,Po.set(o,ec(Po.get(o)||null,e,t,n,a,i)),!0}return!1}function vp(e){var t=hn(e.target);if(t!==null){var n=p(t);if(n!==null){if(t=n.tag,t===13){if(t=v(n),t!==null){e.blockedOn=t,fn(e.priority,function(){gp(n)});return}}else if(t===31){if(t=C(n),t!==null){e.blockedOn=t,fn(e.priority,function(){gp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Gr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=vf(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);ss=a,n.target.dispatchEvent(a),ss=null}else return t=An(n),t!==null&&mp(t),e.blockedOn=n,!1;t.shift()}return!0}function bp(e,t,n){Gr(e)&&n.delete(t)}function fb(){xf=!1,di!==null&&Gr(di)&&(di=null),fi!==null&&Gr(fi)&&(fi=null),hi!==null&&Gr(hi)&&(hi=null),Io.forEach(bp),Po.forEach(bp)}function qr(e,t){e.blockedOn===t&&(e.blockedOn=null,xf||(xf=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,fb)))}var Xr=null;function xp(e){Xr!==e&&(Xr=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){Xr===e&&(Xr=null);for(var t=0;t<e.length;t+=3){var n=e[t],a=e[t+1],i=e[t+2];if(typeof a!="function"){if(bf(a||n)===null)continue;break}var o=An(n);o!==null&&(e.splice(t,3),t-=3,ed(o,{pending:!0,data:i,method:n.method,action:a},a,i))}}))}function Ks(e){function t(O){return qr(O,e)}di!==null&&qr(di,e),fi!==null&&qr(fi,e),hi!==null&&qr(hi,e),Io.forEach(t),Po.forEach(t);for(var n=0;n<mi.length;n++){var a=mi[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<mi.length&&(n=mi[0],n.blockedOn===null);)vp(n),n.blockedOn===null&&mi.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(a=0;a<n.length;a+=3){var i=n[a],o=n[a+1],m=i[Ke]||null;if(typeof o=="function")m||xp(n);else if(m){var w=null;if(o&&o.hasAttribute("formAction")){if(i=o,m=o[Ke]||null)w=m.formAction;else if(bf(i)!==null)continue}else w=m.action;typeof w=="function"?n[a+1]=w:(n.splice(a,3),a-=3),xp(n)}}}function wp(){function e(o){o.canIntercept&&o.info==="react-transition"&&o.intercept({handler:function(){return new Promise(function(m){return i=m})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),a||setTimeout(n,20)}function n(){if(!a&&!navigation.transition){var o=navigation.currentEntry;o&&o.url!=null&&navigation.navigate(o.url,{state:o.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,i=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),i!==null&&(i(),i=null)}}}function wf(e){this._internalRoot=e}Vr.prototype.render=wf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(f(409));var n=t.current,a=ll();fp(n,a,e,t,null,null)},Vr.prototype.unmount=wf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;fp(e.current,2,null,e,null,null),kr(),t[jt]=null}};function Vr(e){this._internalRoot=e}Vr.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ye();e={blockedOn:null,target:e,priority:t};for(var n=0;n<mi.length&&t!==0&&t<mi[n].priority;n++);mi.splice(n,0,e),n===0&&vp(e)}};var jp=c.version;if(jp!=="19.3.0")throw Error(f(527,jp,"19.3.0"));de.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(f(188)):(e=Object.keys(e).join(","),Error(f(268,e)));return e=T(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var hb={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:ae,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Kr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Kr.isDisabled&&Kr.supportsFiber)try{cl=Kr.inject(hb),Vt=Kr}catch{}}return nc.createRoot=function(e,t){if(!h(e))throw Error(f(299));var n=!1,a="",i=dm,o=fm,m=hm;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(m=t.onRecoverableError)),t=up(e,1,!1,null,null,n,a,null,i,o,m,wp),e[jt]=t.current,Fd(e),new wf(t)},nc.hydrateRoot=function(e,t,n){if(!h(e))throw Error(f(299));var a=!1,i="",o=dm,m=fm,w=hm,O=null;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(o=n.onUncaughtError),n.onCaughtError!==void 0&&(m=n.onCaughtError),n.onRecoverableError!==void 0&&(w=n.onRecoverableError),n.formState!==void 0&&(O=n.formState)),t=up(e,1,!0,t,n??null,a,i,O,o,m,w,wp),t.context=dp(null),n=t.current,a=ll(),a=Ie(a),i=Ia(a),i.callback=null,Pa(n,i,a),n=a,t.current.lanes=n,z(t,n),la(t),e[jt]=t.current,Fd(e),new Vr(t)},nc.version="19.3.0",nc}var Dp;function Nb(){if(Dp)return Nf.exports;Dp=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(c){console.error(c)}}return l(),Nf.exports=Sb(),Nf.exports}var Tb=Nb();const Pf=Math.random().toString(36).slice(2),nu=(()=>{try{let l=localStorage.getItem("design-canvas:browser");return l||localStorage.setItem("design-canvas:browser",l=Math.random().toString(36).slice(2)),l}catch{return Pf}})();let eu="";const Cb=l=>void(eu=l),Mf=()=>({"X-Easel-Client":nu,...eu?{"X-Easel-Author":encodeURIComponent(eu)}:{}});async function Zs(l){const c=await l.json().catch(()=>({}));if(!l.ok)throw Object.assign(new Error(c.error??l.statusText),{status:l.status,body:c});return c}const Ne={board:()=>fetch("/api/board").then(l=>Zs(l)),update:()=>fetch("/api/update").then(l=>Zs(l)),saveBoard:(l,c)=>fetch("/api/board",{method:"PUT",headers:{"Content-Type":"application/json",...Mf()},body:JSON.stringify({...l,clientId:Pf,...c?{label:c}:{}})}).then(u=>Zs(u)),post:(l,c)=>fetch(l,{method:"POST",headers:{"Content-Type":"application/json",...Mf()},body:JSON.stringify(c)}).then(u=>Zs(u)),put:(l,c)=>fetch(l,{method:"PUT",headers:{"Content-Type":"application/json",...Mf()},body:JSON.stringify(c)}).then(u=>Zs(u)),get:l=>fetch(l).then(c=>Zs(c))};let sc=null,qf=null;function uy(l){qf=l,(sc==null?void 0:sc.readyState)===1&&sc.send(JSON.stringify({type:"editing",file:l,client:nu,person:eu||void 0}))}function Eb(l){let c=null,u=!1;const f=()=>{c=sc=new WebSocket(`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws`),c.onopen=()=>qf&&uy(qf),c.onmessage=h=>{try{l(JSON.parse(h.data))}catch{}},c.onclose=()=>{u||setTimeout(f,1e3)}};return f(),()=>{u=!0,c==null||c.close()}}function il(l){const c=l.ownerDocument,u=[];let f=l;for(;f&&f!==c.body;){const h=f.parentElement;if(!h)return null;u.unshift(Array.prototype.indexOf.call(h.children,f)),f=h}return f===c.body?u.join("/"):null}function Mn(l,c){let u=l.body;if(!c)return u;for(const f of c.split("/"))if(u=(u==null?void 0:u.children[Number(f)])??null,!u)return null;return u}function ia(l){const c=l.getBoundingClientRect();return{x:c.left,y:c.top,w:c.width,h:c.height}}const Mb=["width","height","padding","margin","gap","font-family","font-size","font-weight","color","background-color","border-radius","display","flex-direction","align-items","justify-content","line-height","text-align","border","box-shadow","opacity","flex-wrap","flex-grow","align-self","grid-template-columns","grid-template-rows","position","background-image"];function kb(l){const c=l.ownerDocument.defaultView.getComputedStyle(l),u={};for(const f of Mb)u[f]=c.getPropertyValue(f);return u}function Rp(l){const c={},u=l.style;if(!u)return c;for(let f=0;f<u.length;f++)c[u[f]]=u.getPropertyValue(u[f]);return c}function zb(l,c,u,f){const h=f.replace(/\s+/g," ").trim().slice(0,40);return`${l} ${c} ${h?`"${h}" `:""}(${u})`}const Ab={select:"M5 3l13 8-6 1.5L9.5 19z",hand:"M8 12V6.5a1.5 1.5 0 0 1 3 0V11m0-5.5V5a1.5 1.5 0 0 1 3 0v6m0-4.5a1.5 1.5 0 0 1 3 0V13a7 7 0 0 1-7 7h-.5a6 6 0 0 1-5-2.7L3.3 14a1.5 1.5 0 0 1 2.4-1.8L8 15",board:"M4 5h16v14H4zM4 9h16",title:"M5 6h14M12 6v13M9 19h6",sticky:"M5 4h14v10l-5 6H5zM14 20v-6h5",search:"M11 18a7 7 0 1 1 0-14 7 7 0 0 1 0 14zM20 20l-4-4",undo:"M9 14L4 9l5-5M4 9h10a6 6 0 0 1 0 12h-3",redo:"M15 14l5-5-5-5M20 9H10a6 6 0 0 0 0 12h3",play:"M8 5l11 7-11 7z",edit:"M4 20h4L19 9l-4-4L4 16zM13.5 6.5l4 4",trash:"M4 7h16M10 11v6M14 11v6M6 7l1 13h10l1-13M9 7V4h6v3",copy:"M8 8h11v11H8zM5 16V5h11",plus:"M12 5v14M5 12h14",close:"M6 6l12 12M18 6L6 18",chevronDown:"M6 9l6 6 6-6",chevronRight:"M9 6l6 6-6 6",list:"M8 6h12M8 12h12M8 18h12M4 6h.01M4 12h.01M4 18h.01",fit:"M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5",focus:"M9 4H4v5M15 4h5v5M9 20H4v-5M15 20h5v-5M9 9h6v6H9z",layers:"M12 3l9 5-9 5-9-5zM3 13l9 5 9-5",comment:"M4 5h16v11H9l-5 4z",front:"M8 8h12v12H8zM4 4h12v4M4 4v12h4",back:"M4 4h12v12H4zM8 16v4h12V8h-4",page:"M6 3h9l4 4v14H6zM15 3v4h4",more:"M5 12h.01M12 12h.01M19 12h.01",moon:"M20 14.5A8 8 0 1 1 9.5 4a6.5 6.5 0 0 0 10.5 10.5z",sun:"M12 17a5 5 0 1 0 0-10 5 5 0 0 0 0 10zM12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4",map:"M3 6l6-2 6 2 6-2v14l-6 2-6-2-6 2zM9 4v14M15 6v14",panel:"M4 5h16v14H4zM15 5v14",check:"M5 12l5 5 9-10",warn:"M12 4l9 16H3zM12 10v4M12 17h.01",info:"M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM12 11v5M12 8h.01",rect:"M4 6h16v12H4z",oval:"M12 19c4.4 0 8-3.1 8-7s-3.6-7-8-7-8 3.1-8 7 3.6 7 8 7z",line:"M5 19L19 5",arrow:"M5 19L19 5M10 5h9v9",pen:"M4 20l1-4L16.5 4.5l3 3L8 19zM14 7l3 3",image:"M4 5h16v14H4zM4 15l4-4 4 4 3-3 5 5M15 9h.01",grid:"M4 4h16v16H4zM4 12h16M12 4v16",system:"M4 5h16v11H4zM9 20h6M12 16v4",share:"M12 15V4M8 8l4-4 4 4M5 13v6h14v-6",folder:"M4 6h6l2 2h8v11H4z",file:"M6 3h8l4 4v14H6zM14 3v4h4",pdf:"M6 3h8l4 4v14H6zM14 3v4h4M9 13h6M9 17h4",eye:"M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",compare:"M4 5h7v14H4zM13 5h7v14h-7",restore:"M4 12a8 8 0 1 0 3-6.2M4 4v4h4",link:"M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1",radius:"M5 19V11a6 6 0 0 1 6-6h8",spacing:"M4 4v16M20 4v16M8 12h8M8 12l2-2M8 12l2 2M16 12l-2-2M16 12l-2 2",minus:"M5 12h14",parent:"M10 14L5 9l5-5M5 9h8a6 6 0 0 1 6 6v5",clock:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM12 7v5l3 2",person:"M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM5 20a7 7 0 0 1 14 0",alignLeft:"M5 4v16M9 8h10M9 16h6",alignHcenter:"M12 4v16M6 8h12M8 16h8",alignRight:"M19 4v16M5 8h10M9 16h6",alignTop:"M4 5h16M8 9v10M16 9v6",alignVcenter:"M4 12h16M8 6v12M16 8v8",alignBottom:"M4 19h16M8 5v10M16 9v6"};function I({name:l,size:c=18,...u}){return s.jsx("svg",{width:c,height:c,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...u,children:s.jsx("path",{d:Ab[l]})})}const Bn=(l,c,u)=>l===1?`1 ${c}`:`${l} ${u}`,kf=l=>Bn(l,"variant","variants"),Ob={button:"Button",a:"Link",img:"Image",input:"Field",textarea:"Field",select:"Menu",label:"Label",p:"Paragraph",span:"Text",li:"List item",ul:"List",ol:"List",nav:"Navigation",header:"Header",footer:"Footer",main:"Main",section:"Section",form:"Form",svg:"Icon",style:"Styles",script:"Script"},_p=(l,c)=>Ob[l??""]??(/^h[1-6]$/.test(l??"")?"Heading":c?`.${c}`:l?`<${l}>`:"Element"),r={app:{title:"Easel",docTitle:l=>`${l} — Easel`,loadFailed:"Couldn't load:",retry:"Try again",crashed:"The canvas hit an error and stopped:",reload:"Reload",loadingBoards:"Loading boards…",loading:"Loading…",emptyPage:"This page is empty",drawBoard:"Draw board",defaultAuthor:"Me",tokensAside:"Design tokens",assetsAside:"Assets",inspectorAside:"Inspector",navigation:"Navigation",announceBoard:(l,c,u)=>`${l} selected, ${c}/${u}. Enter to select inside`,firstRunEdit:"Click anything on a board to select it · double-click text to edit it",firstRunAi:l=>`Press ${l}J to ask the AI for a change`},templates:{blank:"Blank",mobile:"Mobile screen",desktop:"Desktop screen",doc:"Document"},tools:{select:"Select",hand:"Hand",board:"Draw board",title:"Title",sticky:"Note",rect:"Rectangle",oval:"Oval",line:"Line",arrow:"Arrow",pen:"Pen"},toolHints:{select:"Select and move boards",hand:"Drag to pan the canvas",board:"Drag to draw a board",title:"Click to add a title",sticky:"Click to add a sticky note",rect:"Drag to draw a rectangle",oval:"Drag to draw an oval",line:"Drag to draw a line",arrow:"Drag to draw an arrow",pen:"Drag to draw freehand"},toolbar:{aria:"Tools",leftPanel:"Left panel",leftPanelTitle:l=>`Left panel (${l}\\)`,canvasTools:"Canvas tools",shapes:"Shapes",tool:(l,c)=>`${l} (${c})`,shapeToolTitle:(l,c)=>`${l} (${c}) · Shift for square or circle`,insertImage:"Insert image",insertImageTitle:"Insert image (you can also paste onto the canvas)",undo:"Undo",redo:"Redo",undoTitle:(l,c)=>l?`Undo: ${l} (${c}Z)`:`Undo (${c}Z)`,redoTitle:(l,c)=>l?`Redo: ${l} (⇧${c}Z)`:`Redo (⇧${c}Z)`,newBoard:"New board",newBoardTitle:"New board (choose a template)",themeTitle:"Design system theme (used by swatches, token check and AI)",theme:"Theme",themeOption:l=>`Theme: ${l}`,snapshot:"Snapshot (git)",snapshotTitle:"Snapshot: save the design folder as a git commit",erroredBoards:"Boards with errors",erroredBoardsN:l=>`Boards with errors ${l}`,errors:l=>`Errors ${l}`,zoomOut:"Zoom out",zoomOutTitle:l=>`Zoom out (${l}-)`,zoomIn:"Zoom in",zoomInTitle:l=>`Zoom in (${l}+)`,zoom100:"Zoom to 100%",zoom100Title:l=>`Zoom to 100% (${l}0)`,fitAll:"Fit all",fitAllTitle:"Fit all (⇧1)",aiChat:"AI chat",askAi:"Ask AI",aiChatTitle:l=>`AI chat (${l}J)`,guides:"Show layout guides",guidesTitle:"Show layout guides (⌃G)",appearance:l=>`Appearance: ${l==="system"?"System":l==="light"?"Light":"Dark"}`,appearanceTitle:l=>`Appearance: ${l==="system"?"Follow system":l==="light"?"Light":"Dark"} (click to change)`,minimap:"Minimap",minimapTitle:"Minimap (M)",viewMenu:"View",viewMenuTitle:"View: guides, minimap, appearance, theme, snapshot",viewMenuTitleNarrow:"View: zoom, history, guides, minimap, appearance, snapshot",project:"Project",history:"History"},tabs:{left:"Left panel",boards:"Boards",assets:"Assets",tokens:"Tokens",right:"Right panel",closePanel:"Close panel",properties:"Properties",ai:"AI"},boardList:{aria:"Pages and boards",pages:"Pages",addPage:"Add page",singlePage:"Viewing everything as one page. Use + to split it into pages.",pageTabTitle:"Drag to reorder · right-click to rename or delete",boardsHead:"Boards",searchPlaceholder:"Find boards (⌘K)",search:"Find boards",noMatch:l=>`No boards match "${l}". Try part of the file name.`,emptyPage:"No boards on this page yet. Press B and drag on the canvas to draw one.",fileMissing:"File missing",otherGroup:"Other",mainPage:"Main",groupTitle:l=>`${Bn(l,"board","boards")} · click to collapse or expand · double-click to rename`,groupMenu:"Group menu"},minimap:{aria:"Minimap: click to move there"},sections:{board:"Board",comments:"Comments",guides:"Layout guides",tweaks:"Adjustable values",tokenCheck:"Token check",a11y:"Accessibility",checks:"Checks",properties:"Properties",layers:"Layers"},boardOptions:{aria:"Board options",positionAndSize:"Position and size",position:"Position",size:"Size",options:"Options",renameTitle:"Rename (F2)",renameFileTitle:"Rename file",width:"Width",height:"Height",radius:"Radius",interactive:"Show Play button",interactiveTitle:"Marks the board as playable: a dot and a ▶ on its label. Any board plays without it (P or right-click)",frameless:"No frame",fill:"Stretch to window",launch:"Open as launch screen",page:"Page",focus:"Focus view",focusTitle:"Focus view (F)",front:"Bring to front",frontTitle:"Bring to front (⌘])",back:"Send to back",backTitle:"Send to back (⌘[)",duplicate:"Duplicate",duplicateTitle:"Duplicate (⌘D)",delete:"Delete",deleteTitle:"Delete (Delete)",selectedN:l=>`${Bn(l,"board","boards")} selected`,frontTitleMod:l=>`Bring to front (${l}])`,backTitleMod:l=>`Send to back (${l}[)`,goToSelected:"Go to selected boards",goToSelectedTitle:"Go to selected boards (⇧2)",deleteTitleKey:"Delete (⌫)"},focus:{aria:l=>`${l} focus view`,prev:"Previous board",next:"Next board",pageStyle:" · page-style",close:"Close"},play:{back:"Back",forward:"Forward",viewOnCanvas:"View on canvas",closeTitle:"Close (Esc)",close:"Close"},share:{button:"Share",buttonTitle:"Share a view-only copy (web folder, single file, PDF or PNG)",title:"Share a view-only copy",scope:"What to export",whole:"Whole canvas",page:"This page",pageNone:"This canvas has one page",selected:l=>`Selected boards (${l})`,webTitle:"Web folder",webHint:"Static files. Host on Vercel, GitHub Pages or a PR preview.",singleTitle:"Single file",singleHint:l=>` · ${l} · opens in any browser, no hosting`,singleSwitch:"One .html file",measuring:"measuring…",pdfTitle:"PDF",pdfHint:"One board per page",pngTitle:"PNG",pngHint:"One image per board, 2×",export:"Export",save:"Save",working:"Exporting…",exported:"exported",saved:"saved",reveal:"Reveal",revealTitle:"Show the folder in your file manager",copyDeploy:"Copy deploy command",copyDeployTitle:l=>`Copies ${l} (run it in the project folder)`,copied:l=>`Copied: ${l}`,copyFailed:"Couldn't copy to the clipboard",attachHint:"Attach it to Slack, email or a PR.",skipped:l=>`${l} reference${l===1?"":"s"} could not be included`,largeFiles:"Large canvases make large files. No live updates.",sameAs:"Same as:",unavailable:"Unavailable here."},viewer:{docTitle:l=>`${l} — view only`,noData:"This page is an Easel export, but its data is missing (easel-viewer/data.js).",bar:"Viewer",pages:"Pages",play:"Play",playTitle:"Try the selected board full screen (or the first one)",stamp:l=>`View only · exported ${l}`,stampTitle:"A read-only copy. Changes happen in the design files, then export again.",madeWith:"Made with Easel",comments:"Comments",commentsN:l=>`Comments ${l}`,noComments:"No comments",replies:l=>l===1?"1 reply":`${l} replies`,pin:(l,c)=>`Comment ${l} by ${c}`,threadOf:(l,c)=>`${l} of ${c}`,closeThread:"Close comment",boardsPanel:"Boards",commentsPanel:"Comments panel",empty:"Nothing on this page"},canvas:{aria:"Design canvas",board:(l,c,u,f)=>`Board ${l}${c?" (selected)":""}${u?" editing":""}${f?" playing":""}`,interactive:"Marked as playable",hint:"Click selects · Double-click edits text · Esc deselects",notLoaded:"Scroll closer to load",fileMissing:l=>`File missing · ${l}`,playing:"▶ Playing · Esc",boardSize:"Board size",titleMaxWidth:"Max width",stickySize:"Sticky note size",deleteNote:"Delete note"},editMode:{fileChanged:"Someone changed this file first. Select the element again."},elementDrag:{moveAria:"Move element (Alt: into the hovered box)",moveTitle:"Drag to move · hold Alt to drop into the hovered box",width:"Width",height:"Height",size:"Size"},layers:{collapse:"Collapse",expand:"Expand",title:"Layers",hint:"Drop an item on another to move it in front of that item. Shift+click to select several (for wrapping). Click the list, then use ↑↓ to move and ←→ to collapse or expand."},select:{toolbar:"Element",text:"Text",textOff:"No text in this element",fill:"Fill",radius:"Radius",spacing:"Spacing",askAi:"Ask AI",askAiTitle:"Ask AI about this element",comment:"Comment",commentTitle:"Comment on this element",tokens:"Tokens",custom:"Custom…",hex:"Hex colour",picker:"Pick a colour",tokenNow:l=>`${l} · token`,decrease:l=>`Decrease ${l.toLowerCase()}`,increase:l=>`Increase ${l.toLowerCase()}`},design:{fill:"Fill",text:"Text",font:"Font",size:"Size",weight:"Weight",color:"Color",cornerRadius:"Corner radius",padding:"Padding",gap:"Gap",more:"More (CSS)",none:"None",inherited:l=>`(${l})`,weights:{100:"Thin",200:"Extra light",300:"Light",400:"Regular",500:"Medium",600:"Semibold",700:"Bold",800:"Extra bold",900:"Black"},white:"white",black:"black",grade:l=>l>=7?"AAA":l>=4.5?"AA":l>=3?"AA large text only":"too low",contrastWith:(l,c,u)=>`Contrast ${l}:1 with ${c} text · ${u}`,contrastOn:(l,c,u)=>`Contrast ${l}:1 on ${c} · ${u}`,openFill:l=>`${l}: change`},properties:{tokenColors:{text:"Text",secondaryText:"Secondary text",background:"Background",surface:"Surface",divider:"Divider",accent:"Accent",error:"Error"},fields:{width:"Width",height:"Height",fontSize:"Font size",fontWeight:"Weight",color:"Color",background:"Background",radius:"Radius",flexDirection:"Flex direction",alignItems:"Align items",justifyContent:"Justify content",flexWrap:"Wrap",flexGrow:"Grow",alignSelf:"Align self",lineHeight:"Line height",textAlign:"Text align",border:"Border",boxShadow:"Shadow",opacity:"Opacity"},alignButtons:{left:"Align left",hcenter:"Align center",right:"Align right",top:"Align top",vcenter:"Align middle",bottom:"Align bottom"},columns:"Columns",rows:"Rows",align:"Align",layout:"Layout",wrap:"Wrap",image:"Image",replaceImage:"Replace image…",wrapTitle:"Select consecutive siblings with the same parent first",wrapFlex:"Wrap in flex",wrapGrid:"Wrap in grid",duplicate:"Duplicate",delete:"Delete",offToken:l=>`Off tokens: ${l}`,none:"none",contrastTitle:"Contrast with background (4.5 or more for body text, 3 or more for large text)",contrast:"Contrast",largeTextOnly:"Large text only",tooLow:"Too low"},shapes:{selectedN:l=>`${l} shapes selected`,deleteAll:"Delete selected shapes",stickyColors:{yellow:"Yellow",orange:"Orange",pink:"Pink",purple:"Purple",blue:"Blue",green:"Green",gray:"Gray",white:"White"},shapeSize:"Shape size",drawShape:"Draw shape",kinds:{rect:"Rectangle",oval:"Oval",line:"Line",arrow:"Arrow",pen:"Pen",image:"Image"},none:"None",options:"Shape options",strokeColor:"Stroke color",fill:"Fill",weight:"Weight",strokeWeight:"Stroke weight",front:"Bring to front",back:"Send to back",deleteShape:"Delete shape",deleteTitle:"Delete (⌫)"},notes:{selectedN:l=>`${l} notes selected`,deleteAll:"Delete selected notes",options:"Note options",title:"Title",sticky:"Sticky note",fontSize:"Font size",defaultSuffix:" (default)",textStyle:"Text style",bold:"Bold",italic:"Italic",color:"Color",stickyColor:l=>`${l} sticky note`,maxWidth:"Max width",maxHeight:"Max height",width:"Width",height:"Height",titleHint:"Text shrinks once it passes the max width or height (0 means no limit).",stickyHint:"With a height set, overflowing text scrolls (0 fits the content).",deleteNote:"Delete note",deleteTitle:"Delete (⌫)"},guides:{aria:"Layout guides",heading:(l,c)=>`Layout guides ${l}/${c}`,types:{columns:"Columns",rows:"Rows",grid:"Grid"},add:{columns:"Add column guide",rows:"Add row guide",grid:"Add grid guide"},empty:"Add up to 6 column, row or grid guides. They show only on the canvas and never go into the screen HTML. Hide all: ⌃G",color:"Guide color",show:"Show",hide:"Hide",deleteGuide:"Delete guide",delete:"Delete",cell:"Cell",count:"Count",gutter:"Gutter",margin:"Margin",cellSize:"Cell size",align:"Align",alignAria:"Guide alignment",stretch:"Stretch",left:"Left",top:"Top",center:"Center",right:"Right",bottom:"Bottom"},dialog:{renameGroupTitle:"Rename group",menu:"Menu",cancel:"Cancel",ok:"OK",deleteBoardsTitle:(l,c)=>l>1?`Delete ${l} boards?`:`Delete board "${c}"?`,deleteBoardsBody:"The HTML files are deleted too. A copy stays in the trash (docs/design/.trash), and Undo (⌘Z) brings them back right away.",delete:"Delete",renameBoardTitle:"Rename board",name:"Name",rename:"Rename",renameFileTitle:"Rename file",fileName:"File name",renameFileRefs:l=>`Links or iframes pointing to this file: ${l}`,renameFileNoRefs:"No links or iframes point to this file.",renameFileExtra:l=>`Also update ${Bn(l,"reference","references")} to the new name`,newPageTitle:"New page",newPageName:l=>`Page ${l}`,create:"Create",renamePageTitle:"Rename page",deletePageTitle:l=>`Delete page "${l}"?`,deletePageBody:l=>`Its ${Bn(l,"board","boards")} and notes aren't deleted; they move to the first page. You can undo with ⌘Z.`,authorTitle:"Comment author",save:"Save",snapshotTitle:"Save snapshot",snapshotLabel:"Message",snapshotMessage:l=>`docs(design): design snapshot ${l}`,snapshotHint:"Commits only the design folder. The author comes from your git config, and nothing else you staged is included.",commit:"Commit"},toast:{saveFailed:l=>`Save failed: ${l}`,undoRedoDone:(l,c)=>`${l==="undo"?"Undo":"Redo"}: ${c}`,nothingToUndo:"Nothing to undo",nothingToRedo:"Nothing to redo",undoAction:"Undo",textOnly:"Only elements that contain just text (and line breaks) can be edited in place",moved:"Moved",movedFrozen:"Moved (kept the size of the original spot)",copiedElement:(l,c)=>`Copied <${l}> — paste it into another board while editing with ${c}V`,nothingCopied:"No element copied. Select an element while editing and press ⌘C",pasted:(l,c)=>`Pasted <${c}> from ${l}`,imageReplaced:l=>`Replaced the image with ${l}`,boardCreated:l=>`Created board ${l}`,boardCreateFailed:l=>`Couldn't create the board: ${l}`,boardsDeleted:l=>`Deleted ${Bn(l,"board","boards")}`,duplicated:l=>`Duplicated as ${l}`,renamed:"Renamed",fileRenamed:(l,c)=>`Renamed to ${l}${c?" (references updated)":""}`,notesMax:l=>`You can have up to ${l} notes`,noteDeleted:"Note deleted",shapeDeleted:"Shape deleted",shapesDeleted:l=>`Deleted ${Bn(l,"shape","shapes")}`,imageReadFailed:"Couldn't read the image",importOnly:l=>`${l}: only HTML or images can be imported`,imported:l=>`Imported ${Bn(l,"board","boards")}`,pagesMax:"You can have up to 40 pages",pageDeleted:"Page deleted",copied:"Copied",elementDeleted:"Element deleted",wrapped:l=>`Wrapped in ${l}`,theme:l=>`Theme: ${l}`,tokensSaved:"Tokens saved",nothingChanged:"Nothing changed",snapshot:l=>`Snapshot ${l}`,cleanedUp:l=>`Cleaned up ${Bn(l,"board","boards")}`,uploaded:l=>`Uploaded ${l}`,tweaksSaved:"Saved tweaks to source",blockFlow:"Vertical alignment doesn't apply in block flow. Try changing the parent to flex"},history:{renameGroup:"Rename group",pageFromGroup:"Page from group",boardOptions:"Board options",front:"Bring to front",back:"Send to back",moveBoard:"Move board",resizeBoard:"Resize board",addTitle:"Add title",addNote:"Add note",deleteNote:"Delete note",duplicateNote:"Duplicate note",moveNote:"Move note",editNote:"Edit note",noteStyle:"Note style",addShape:"Add shape",deleteShape:"Delete shape",moveShape:"Move shape",resizeShape:"Resize shape",shapeStyle:"Shape style",shapeFront:"Bring shape to front",shapeBack:"Send shape to back",addImage:"Add image",launchPage:"Launch page",moveToPage:"Move to page",launchScreen:"Set launch screen",changeTheme:"Change theme",cleanMissing:"Clean up boards with missing files",editGuide:"Edit layout guide",addGuide:"Add layout guide",deleteGuide:"Delete layout guide",saveTokens:"Save tokens",registerTokens:"Register tokens"},defaults:{newTitle:"New title",note:"Note",pastedImage:"pasted-image.png"},menu:{newBoard:"New board",renameGroup:"Rename group…",pageFromGroup:"Make a page from this group",drawWithB:"B to draw",rename:"Rename",moveUp:"Move up",moveDown:"Move down",unsetLaunchPage:"Unset launch page",setLaunchPage:"Set as launch page",moveSelectedToPage:l=>`Move ${Bn(l,"selected board","selected boards")} to this page`,delete:"Delete",selectInside:"Select inside",playInPlace:"Play in place",stopPlay:"Stop Play",playFullScreen:"Play full screen",askReview:"Ask AI for a review",focusView:"Focus view",askAI:"Ask AI",askFixErrors:"Ask AI to fix errors",goToBoard:"Go to board",renameFile:"Rename file…",duplicate:"Duplicate",front:"Bring to front",back:"Send to back",deleteBoards:l=>`Delete ${l} boards`,title:"Title",note:"Note",duplicateInFront:"Duplicate in front",newBoardHere:"New board here",mobileFrameHere:"Mobile screen frame here",titleHere:"Title here",noteHere:"Note here",selectAll:"Select all on this page",fitAll:"Fit all",zoom100:"Zoom to 100%",undo:"Undo",redo:"Redo",element:"Element",editText:"Edit text",selectParent:"Select parent",elementToAI:"Send this element to AI",copy:"Copy",pasteAfter:"Paste after",replaceImage:"Replace image…",copyForAI:"Copy description for AI",shape:"Shape",snapshot:"Snapshot",notGit:"The design folder isn't inside a git repository",snapshotStatus:(l,c)=>`Snapshot · ${l} · ${Bn(c,"changed file","changed files")}`,snapshotNow:"Save snapshot now (git commit)…",nothingChanged:"Nothing changed",fileMissing:"File is missing",askFixAll:"Ask AI to fix all",cleanMissing:l=>`Clean up ${Bn(l,"board","boards")} with missing files`},prompts:{fixErrors:l=>`Fix these errors:
50
+ ${l}`,error:"Error",review:"Review this screen: point out accessibility (48px touch targets, 4.5 contrast, labels), information hierarchy, and token violations (get_tokens, check_tokens), with fixes in priority order. Don't edit anything; only suggest.",fixComment:"Fix only that spot, as this comment says",fixTokens:l=>`Replace off-token values with tokens (verify with check_tokens):
51
+ ${l}`,fixA11y:l=>`Fix the accessibility issues (keep the visible size; enlarge touch targets with padding):
52
+ ${l}`,line:"Line "},checks:{tokenCheck:l=>`Token check · ${l}`,noOffToken:"No off-token values",off:"off",tokensOffTitle:"No tokens registered — checks are off",tokensOffBody:"Colours and sizes are not checked, and the AI is not given a default palette.",setUpTokens:"Set up tokens",a11y:"Accessibility",a11yOk:"No touch target, contrast or label issues",askFix:"Ask AI to fix",notVisible:"Checks run when the board is visible on screen.",pickInEdit:l=>`Select ${l} on the board`,line:l=>`Line ${l}`,more:l=>`+${l} more`,colorNotInTokens:"Color not in tokens",tokenFontSizes:l=>`Token font sizes: ${l}`,tokenRadii:l=>`Token radius: ${l}`,notMultipleOf4:"Not a multiple of 4",tokenWeights:l=>`Token weights: ${l}`,smallTarget:(l,c,u,f)=>`<${l}> touch target ${c}×${u} (under ${f})`,noName:l=>`<${l}> has no name (aria-label, text or label)`,noAlt:'<img> has no alt (use alt="" if decorative)',lowContrast:(l,c,u)=>`Contrast ${l}:1 (needs ${c}) "${u}"`},tokens:{import:"Import tokens (tokens.json or Figma variables JSON)",importFailed:l=>`Couldn't import: ${l}`,theme:"Theme",addTheme:"Add theme (copy current theme)",newTheme:"New theme",newThemeN:l=>`New theme ${l}`,activeTheme:"Active theme",themeName:"Theme name",importedTheme:"Imported",colors:l=>`Colors ${l}`,addColor:"Add color",colorN:l=>`Color ${l}`,colorOf:l=>`${l} color`,colorName:"Color name",remove:l=>`Remove ${l}`,fontSizes:"Font sizes",fontWeights:"Font weights",radii:"Radius",spacing:"Spacing",touchTarget:"Touch target",minTouchTarget:"Minimum touch target",saveTitle:"Save to docs/design/tokens.json",save:"Save",register:"Register tokens",registeredHint:"Properties panel swatches, token check and AI (get_tokens) use the selected theme's values.",defaultHint:"Starter values, not in use yet. Registering saves them to tokens.json and turns on the token check and the AI palette.",noColors:"Couldn't find any color values"},tweaks:{revert:"Revert",save:"Save to source",hint:"Applied right away as CSS variables. Saving changes only the values in the board-tweaks JSON."},inspector:{shotFailed:l=>`Failed: ${l}`,kindName:l=>({text:"Text",button:"Button",link:"Link",image:"Image",input:"Input",icon:"Icon",container:"Container"})[l]??l,crumbs:"Selection path",crumbBoard:"Select the board",crumbParent:l=>`Select ${l}`,crumbElement:(l,c)=>`<${l}> ${c}`,more:l=>`+${l} more`,copy:"Copy",copied:"Copied",capturing:"Capturing…",screenshot:"Screenshot",boardScreenshot:"Board screenshot",boardScreenshotTitle:"Save a PNG of this board next to the design folder",screenshotTitle:"Save a PNG of this element",actions:"Element actions",boardActions:"Board actions"},comments:{title:"Comments",placeholderElement:l=>`Comment on the selected element (${l})`,placeholderBoard:"Comment on the board",add:"Comment",authorTitle:"Change comment author name",author:l=>`Author: ${l}`,replyPlaceholder:l=>`Reply as ${l} (⌘Enter)`,reply:"Reply",replyResolve:"Reply and resolve",reopen:"Reopen",resolve:"Resolve",sendToAI:"Send to AI",sendToAITitle:"Send to AI to fix only where this comment points"},assets:{uploading:"Uploading…",upload:"Upload (images and fonts; drag and drop works too)",loading:"Loading…",empty:"No assets yet. Uploaded images are saved to docs/design/assets/ and used in screens as ../assets/name.",copyPath:" · click to copy path",file:"File",pickImage:"Choose image",pickLabel:", use this image",close:"Close"},chat:{aria:"AI chat",agent:"Agent",agentHint:"Which agent edits the files",agentButton:(l,c)=>c?`Agent: ${l} — ${c}`:`Agent: ${l}`,agentStatus:{ready:"ready",signin:"sign-in needed",missing:"not installed",unknown:"couldn't check"},checking:"Checking…",checkedOnOpen:"Checked when the AI tab opened",checkAgain:"Check again",model:"Model",modelDefault:"Default (from CLI config)",modelTitle:l=>`Model for ${l}: an alias or a full model id. Leave empty for the CLI's own default.`,continuing:"Continuing conversation",newConversation:"New conversation",newChat:"New chat",intro:l=>`Sends the selected boards and elements, plus the boards visible on screen, to ${l} as context. The agent edits the source HTML directly, and the canvas redraws right away.`,suggestions:[{label:"AI review: accessibility, contrast, hierarchy",text:"Review the selected screen: accessibility (48px touch targets, 4.5 contrast, labels), information hierarchy, and token violations (get_tokens, check_tokens). Only suggest changes in priority order; don't edit anything.",n:1},{label:"3 variants of this screen",text:"Make 3 variants of the selected screen in different directions (each with a different layout, hierarchy and emphasis).",n:3},{label:"Shorten the selected button text",text:"Shorten the selected button text",n:1},{label:"Make a new empty-state screen",text:"Make a new empty-state screen",n:1}],remedySignin:(l,c)=>`${l} is not signed in. Run \`${c}\` in a terminal.`,remedyMissing:l=>`\`${l}\` command not found. Install it, then Check again.`,copyCommand:"Copy command",copy:"Copy",copied:"Copied",sendNeedsSignin:l=>`Sign in to ${l} to send`,sendNeedsInstall:l=>`Install ${l} to send`,running:"Running",cancelled:"Cancelled",failed:"Failed",retry:"Retry",switchTo:l=>`Switch to ${l}`,details:"Details",noFilesChanged:"No files were changed.",restored:"Restored from the failed message",madeVariants:l=>`Made ${kf(l)} side by side · View`,thinking:"Thinking…",chipElement:l=>`Element <${l}>`,chipElementText:(l,c)=>`Element <${l}> ${c}`,chipBoards:l=>`${l} boards`,chipVisible:l=>`Visible boards ${l}`,chipComment:l=>`Comment "${l}"`,variants:kf,tooBig:l=>`${l}: larger than 15MB`,refLink:"Reference link",placeholderRunning:"Running… (Esc to cancel)",placeholder:"What should change? (Enter to send · Shift+Enter for a new line)",input:"Message to AI",attach:"Attach file or image",attachTitle:"Attach file or image (drag and drop or paste works too)",addLink:"Add reference link",variantsTitle:"Copies the selected board and makes different variants side by side",variantsDisabledTitle:"Select one board to use this",variantsAria:"Number of variants",cancel:"Cancel",cancelTitle:"Cancel (Esc)",send:"Send",chipRemoveTitle:"Click to remove",chipAddTitle:"Click to attach",remove:l=>`Remove ${l}`,howToInstall:"How to install",customCommand:"Custom command…",checkedAt:(l,c)=>c?`Checked when the AI tab opened · ${l}`:`Checked again at ${l}`,customTitle:"Custom command",customName:"Name",customCommandLabel:"Command",customNamePlaceholder:"Aider",customCommandPlaceholder:"aider --message {prompt} --yes",customHint:"`{prompt}` is replaced with your request and the canvas context. Output is shown as plain text.",customSave:"Save",customCommandTitle:l=>`Runs without a shell: ${l}`,waiting:"Waiting for you",waitingHint:"answer the request above",permAsk:(l,c,u)=>c==="command"?`${l} asks to run a command`:c==="edit"?`${l} asks to ${u==="Write"?"write":"edit"} a file`:c==="fetch"?`${l} asks to fetch a page`:`${l} asks to use ${u}`,permIn:"in",permOutside:"outside the design folder",allowOnce:"Allow once",alwaysAllow:l=>`Always allow ${l}`,alwaysAllowTitle:"Until Easel restarts, for this canvas only",deny:"Deny",permDone:{once:"Allowed",always:"Always allowed",deny:"Denied"},permDoneOutside:"(outside the design folder)",noPause:{codex:"Codex exec cannot pause to ask; it follows its sandbox setting.",cursor:"Cursor Agent cannot pause to ask here; it runs with --force.",gemini:"Gemini CLI cannot pause to ask here; it accepts edits on its own."},runChanged:(l,c)=>l&&c?`Changed ${l} board${l===1?"":"s"} · added ${c}`:c?`Added ${c} board${c===1?"":"s"}`:l?`Changed ${l} board${l===1?"":"s"}`:"Changed the canvas",chipNew:l=>`${l} (new)`,chipRemoved:l=>`${l} (removed)`,undoRun:"Undo this run",compare:"Compare",redo:"Redo",runUndone:l=>`Run undone · ${l} board${l===1?"":"s"} restored`,conflictUndo:l=>`Changed since this run: ${l}. Undo the rest and keep those, or undo all and overwrite them?`,conflictRedo:l=>`Changed since the undo: ${l}. Redo the rest and keep those, or redo all and overwrite them?`,undoRest:"Undo the rest",undoAll:"Undo all anyway",redoRest:"Redo the rest",redoAll:"Redo all anyway",restoreCopy:"Restore the copy from before this run",savedAt:l=>`Saved ${l}`,copyGone:"The copy from before this run is gone (only the newest 10 are kept).",restoredCopy:"Canvas restored to the copy from before this run",restoreTitle:"Restore the copy from before this run?",restoreBody:l=>`This puts the whole canvas back to ${l}, before this run: every screen and board.json, including anything changed since by you or by other runs. Undo takes the restore back.`,restoreOk:"Restore",restarted:l=>`Easel restarted · ${l}`},compare:{title:l=>`Compare · ${l}`,boards:"Boards",before:"Before",after:"After",notBefore:"This board did not exist before the run.",notAfter:"This run removed the board.",notBeforeChange:"This board did not exist before this change.",close:"Close"},activity:{outside:"Outside Easel",ago:l=>{const c=Math.floor(Math.max(0,l)/6e4);return c<1?"now":c<60?`${c}m`:c<1440?`${Math.floor(c/60)}h`:`${Math.floor(c/1440)}d`},agoLong:l=>{const c=Math.floor(Math.max(0,l)/6e4);return c<1?"just now":c<60?`${c} min ago`:c<1440?`${Math.floor(c/60)} h ago`:`${Math.floor(c/1440)} d ago`},tag:(l,c,u,f)=>`${l} · ${c} · ${f&&u===1?"new board":Bn(u,"change","changes")}`,tagTitle:l=>`${l} — click for the change, Before / After and Undo`,tagsAria:l=>`${Bn(l,"change","changes")} by others`,popAria:l=>`Change by ${l}`,element:_p,change:l=>{const c=_p(l.tag,l.cls);switch(l.kind){case"style":return`Style changed on ${c}`;case"attr":return`${c} attributes changed`;case"edited":return`${c} changed`;case"added":return l.count>1?`${l.count} elements added`:`${c} added`;case"removed":return l.count>1?`${l.count} elements removed`:`${c} removed`;case"replaced":return`${c} replaced`;case"many":return`${l.count}${l.more?"+":""} elements changed`;case"page":return"Page styles or title changed";case"source":return"Only spacing or comments in the source changed";case"new":return"New board";case"deleted":return"Board deleted";case"moved":return"Board moved";case"resized":return"Board resized";case"renamed":return"Board renamed";case"options":return"Board options changed";default:return"Changed"}},changes:l=>`${Bn(l,"change","changes")} on this board`,quote:l=>`“${l}”`,arrow:"→",beforeAfter:"Before / After",undo:"Undo",undoTitle:l=>l===1?"Undo this change":`Undo these ${l} changes`,conflict:l=>`Changed since: ${l}. Undo the rest and keep those, or undo all and overwrite them?`,undoRest:"Undo the rest",undoAll:"Undo all anyway",cancel:"Cancel",close:"Close",historyButton:"History",historyTitle:"History · newest first",historyEmpty:"Nothing yet. Changes made in this session show up here.",historyFoot:"History is kept for this session.",now:"Now",goBack:"Go back to here",goBackAria:(l,c,u)=>`${l} by ${c}, ${u} · Go back to here`,nowAria:(l,c,u)=>`${l} by ${c}, ${u} · current`,undoneAria:(l,c,u)=>`${l} by ${c}, ${u} · undone`,wentBack:l=>`Back to: ${l}`},occupancy:{editing:l=>`${l} is editing…`,you:"You · editing",personEditing:l=>`${l} · editing`,done:(l,c)=>`${l} · done ${c}`,someone:"Someone",clock:l=>new Date(l).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1}),tagsAria:"Who is on this board",listDot:l=>`${l} is editing`,youListDot:"You are editing",forked:(l,c,u)=>`Forked ${l} — ${c} started while ${u} was editing`,forkBlock:(l,c)=>l===1?`Fork of ${c}`:`${l} forks of ${c}`,forkBlockWhile:(l,c,u)=>`${l===1?`Fork of ${c}`:`${l} forks of ${c}`} · made while ${u} was editing`,forkBlockShort:l=>l===1?"Fork":`${l} forks`,useThis:"Use this",useThisOne:"Use this one",useThisTitle:"Make this variant the original board; the other variants go to trash",useThisOneTitle:l=>`Keep this version as the board; ${l===1?"the other version goes":`the other ${l} versions go`} to trash`,waitFor:l=>`Wait until ${l} is done editing`,confirmVariant:(l,c)=>`Apply "${l}" to ${c}?`,confirmVariantBody:(l,c)=>`${l} is replaced.${c?` The other ${c===1?"variant goes":`${c} variants go`} to trash.`:""}`,confirmFork:(l,c)=>`Use "${l}" for ${c}?`,confirmForkBody:(l,c)=>`${l} is replaced by this version. ${c?`This fork and the other ${c===1?"fork go":`${c} forks go`} to trash.`:"The fork goes to trash."}`,confirmKeep:l=>`Keep "${l}"?`,confirmKeepBody:(l,c)=>`${l} ${c===1?"goes":"go"} to trash.`,apply:"Apply",keepAll:"Keep all",keepBoth:"Keep both",applied:(l,c)=>`Applied ${l} to ${c}`,kept:(l,c)=>`Kept ${l}; ${c===1?"the other version is":`the other ${c} versions are`} in trash`,keptAll:(l,c)=>l==="variant"?`Kept all ${kf(c)} as boards`:c===1?"Kept both versions as boards":`Kept all ${c+1} versions as boards`,undo:"Undo"},update:{out:l=>`Easel ${l} is out`,copy:"Copy command",copied:"Copied. Run it, then restart Easel",hide:"Hide until the next version"}},Db=1440*60*1e3,zf=l=>`design-canvas:seen:${l}`,lu=l=>l.by?"comment":l.person||!l.outside?"person":"file",eh=(l,c)=>l.by??l.person??(l.outside?r.activity.outside:c);function Rb(l){const[c,u]=j.useState(null),[f,h]=j.useState(()=>Date.now()),[p,v]=j.useState({}),C=j.useRef(null),S=j.useCallback(()=>{C.current&&window.clearTimeout(C.current),C.current=window.setTimeout(()=>{Ne.get(`/api/activity?client=${encodeURIComponent(nu)}`).then(u).catch(()=>{})},120)},[]);j.useEffect(()=>{S();const k=window.setInterval(()=>h(Date.now()),3e4);return()=>window.clearInterval(k)},[S]),j.useEffect(()=>{if(!(!l||!c))try{const k=JSON.parse(localStorage.getItem(zf(l))??"{}"),R=Object.fromEntries(Object.entries(k).filter(([B])=>B.startsWith(`${c.boot}:`)));v(R),Object.keys(R).length!==Object.keys(k).length&&localStorage.setItem(zf(l),JSON.stringify(R))}catch{}},[l,c==null?void 0:c.boot]);const T=j.useCallback(k=>{!c||!k.length||v(R=>{const B=k.filter(N=>!R[`${c.boot}:${N}`]);if(!B.length)return R;const X={...R,...Object.fromEntries(B.map(N=>[`${c.boot}:${N}`,Date.now()]))};try{l&&localStorage.setItem(zf(l),JSON.stringify(X))}catch{}return X})},[c,l]),y=j.useCallback(k=>{if(!c)return"fresh";const R=k.steps.map(B=>p[`${c.boot}:${B}`]);return R.some(B=>!B)?"fresh":f-Math.max(...R)>Db?"gone":"seen"},[c,p,f]),b=j.useCallback(k=>((c==null?void 0:c.tags[k])??[]).filter(R=>y(R)!=="gone"),[c,y]);return{data:c,now:f,reload:S,markSeen:T,stateOf:y,tagsOf:b}}function _b({file:l,act:c,me:u,onOpen:f,lead:h}){const p=c.tagsOf(l);return!p.length&&!h?null:s.jsxs("span",{className:"act-tags",role:"group","aria-label":p.length?r.activity.tagsAria(p.reduce((v,C)=>v+C.count,0)):r.occupancy.tagsAria,children:[h,p.map(v=>{const C=r.activity.tag(eh(v,u),r.activity.ago(c.now-v.at),v.count,v.newBoard);return s.jsxs("button",{className:`act-tag ${c.stateOf(v)==="seen"?"seen":""}`,"data-tag":`${l}|${v.key}`,title:r.activity.tagTitle(C),"aria-haspopup":"dialog",onPointerDown:S=>S.stopPropagation(),onDoubleClick:S=>S.stopPropagation(),onClick:S=>{S.stopPropagation(),f(l,v.key)},children:[s.jsx(I,{name:lu(v),size:16}),s.jsx("span",{className:"act-tag-text",children:C})]},v.key)})]})}function Bb({tag:l}){const c=l.change;return l.count>1?s.jsx("div",{className:"callout-diff",children:r.activity.changes(l.count)}):(c==null?void 0:c.kind)==="text"?s.jsxs("div",{className:"callout-diff",children:[s.jsx("span",{className:"diff-old",children:r.activity.quote(c.from??"")})," ",r.activity.arrow," ",s.jsx("span",{className:"diff-new",children:r.activity.quote(c.to??"")})]}):s.jsx("div",{className:"callout-diff",children:c?r.activity.change(c):r.activity.change({kind:"",count:1})})}function Ub(l){const c=j.useRef(null),[u,f]=j.useState(null),h=()=>document.querySelector(`[data-tag="${CSS.escape(`${l.file}|${l.tag.key}`)}"]`);j.useLayoutEffect(()=>{var k,R;const v=h();if(!v)return void l.onClose();const C=v.getBoundingClientRect(),S=((k=c.current)==null?void 0:k.offsetWidth)??280,T=((R=c.current)==null?void 0:R.offsetHeight)??140,y=Math.max(8,Math.min(C.left,window.innerWidth-S-8)),b=C.bottom+8+T>window.innerHeight-8?Math.max(8,C.top-T-8):C.bottom+8;(!u||Math.abs(u.x-y)>.5||Math.abs(u.y-b)>.5)&&f({x:y,y:b})}),j.useEffect(()=>{var C,S;(S=(C=c.current)==null?void 0:C.querySelector("button"))==null||S.focus();const v=T=>{var b,k;const y=T.target;(b=c.current)!=null&&b.contains(y)||(k=h())!=null&&k.contains(y)||y instanceof Element&&y.closest(".dialog-backdrop")||l.onClose()};return window.addEventListener("pointerdown",v,!0),()=>window.removeEventListener("pointerdown",v,!0)},[l.file,l.tag.key]);const p=eh(l.tag,l.me);return s.jsxs("div",{ref:c,className:"callout",role:"dialog","aria-label":r.activity.popAria(p),style:{left:(u==null?void 0:u.x)??-9999,top:(u==null?void 0:u.y)??-9999},onKeyDown:v=>{var C;v.key==="Escape"&&(v.stopPropagation(),l.onClose(),(C=h())==null||C.focus())},children:[s.jsxs("div",{className:"callout-top",children:[s.jsx(I,{name:lu(l.tag),size:16}),p," ",s.jsxs("span",{className:"muted",children:["· ",r.activity.agoLong(l.now-l.tag.at)]}),s.jsx("button",{className:"icon-btn sm callout-x","aria-label":r.activity.close,title:r.activity.close,onClick:l.onClose,children:s.jsx(I,{name:"close",size:14})})]}),s.jsx(Bb,{tag:l.tag}),s.jsxs("div",{className:"callout-actions",children:[s.jsxs("button",{onClick:l.onCompare,children:[s.jsx(I,{name:"compare",size:14})," ",r.activity.beforeAfter]}),s.jsxs("button",{disabled:l.busy,title:r.activity.undoTitle(l.tag.steps.length),onClick:()=>l.onUndo(),children:[s.jsx(I,{name:"undo",size:14})," ",r.activity.undo]})]}),l.conflict&&s.jsxs("div",{className:"rr-conflict",role:"alert",children:[s.jsx("p",{children:r.activity.conflict(l.conflict.join(", "))}),s.jsxs("div",{className:"btn-row",children:[s.jsx("button",{onClick:()=>l.onUndo("rest"),children:r.activity.undoRest}),s.jsx("button",{className:"danger",onClick:()=>l.onUndo("all"),children:r.activity.undoAll}),s.jsx("button",{onClick:l.onCancelConflict,children:r.activity.cancel})]})]})]})}function Hb({frame:l,paths:c,zoom:u}){const[f,h]=j.useState([]),p=c.join(",");j.useEffect(()=>{if(!l)return h([]);const C=()=>{const T=l.isConnected?l.contentDocument:null;if(!(T!=null&&T.body))return h([]);h(c.map(y=>Mn(T,y)).filter(y=>!!y&&y!==T.body).map(ia))};C();const S=window.setTimeout(C,300);return l.addEventListener("load",C),l.addEventListener("dc-reloaded",C),()=>{window.clearTimeout(S),l.removeEventListener("load",C),l.removeEventListener("dc-reloaded",C)}},[l,p]);const v=1/Math.max(u,.05);return s.jsx(s.Fragment,{children:f.map((C,S)=>s.jsx("div",{className:"box change-outline",style:{left:C.x,top:C.y,width:C.w,height:C.h,"--px":`${v}px`}},S))})}function $b(l){var T;const c=j.useRef(null),u=Math.max(0,l.steps.findIndex(y=>y.now)),[f,h]=j.useState(u),p=j.useRef([]),v=(T=l.steps[u])==null?void 0:T.id;j.useEffect(()=>{var y;(y=p.current[u])==null||y.focus(),h(u)},[v]),j.useEffect(()=>{const y=b=>{var R;const k=b.target;(R=c.current)!=null&&R.contains(k)||k instanceof Element&&k.closest(".caret-btn")||l.onClose()};return window.addEventListener("pointerdown",y,!0),()=>window.removeEventListener("pointerdown",y,!0)},[l.onClose]);const C=y=>{var k;const b=Math.max(0,Math.min(l.steps.length-1,y));h(b),(k=p.current[b])==null||k.focus()},S=j.useMemo(()=>{var R;const y=((R=document.querySelector(".oc-dock"))==null?void 0:R.getBoundingClientRect())??l.anchor,b=Math.min(448,window.innerWidth-16);if(!y)return{left:8,bottom:76,width:b};const k=Math.round(window.innerHeight-y.top+8);return{left:Math.round(Math.max(8,Math.min(y.right-b,window.innerWidth-b-8))),bottom:k,width:b,maxHeight:Math.round(window.innerHeight-k-8)}},[l.anchor]);return s.jsxs("div",{ref:c,className:"menu oc-hist entering",role:"menu","aria-label":r.activity.historyTitle,style:S,onKeyDown:y=>{var b;["Escape","ArrowDown","ArrowUp","Home","End","Enter"," "].includes(y.key)&&y.stopPropagation(),y.key==="Escape"?(y.preventDefault(),l.onClose(),(b=document.querySelector(".caret-btn"))==null||b.focus()):y.key==="ArrowDown"||y.key==="ArrowUp"?(y.preventDefault(),C(f+(y.key==="ArrowDown"?1:-1))):(y.key==="Home"||y.key==="End")&&(y.preventDefault(),C(y.key==="Home"?0:l.steps.length-1))},children:[s.jsx("div",{className:"oc-menu-h",children:r.activity.historyTitle}),!l.steps.length&&s.jsx("p",{className:"hist-empty",children:r.activity.historyEmpty}),s.jsx("div",{className:"hist-rows",children:l.steps.map((y,b)=>{const k=eh(y,l.me),R=r.activity.ago(l.now-y.at);return s.jsxs("button",{ref:B=>void(p.current[b]=B),role:"menuitem",className:`menu-item oc-hrow ${y.now?"now":""} ${y.undone?"past":""} ${f===b?"active":""}`,"aria-label":(y.now?r.activity.nowAria:y.undone?r.activity.undoneAria:r.activity.goBackAria)(y.name,k,R),"aria-current":y.now?"step":void 0,title:y.label,"aria-disabled":l.busy||void 0,onMouseEnter:()=>h(b),onFocus:()=>h(b),onClick:()=>!y.now&&!l.busy&&l.onGo(y),children:[s.jsx("span",{className:"oc-now-dot","aria-hidden":"true"}),s.jsxs("span",{className:"oc-who",children:[s.jsx(I,{name:lu(y),size:16}),s.jsx("span",{children:k})]}),s.jsx("span",{className:"oc-what",children:y.name}),y.now?s.jsx("span",{className:"oc-mark",children:r.activity.now}):f===b?s.jsx("span",{className:"oc-mark go",children:r.activity.goBack}):s.jsx("span",{}),s.jsx("span",{className:"oc-when",children:R})]},y.id)})}),s.jsx("div",{className:"menu-foot",children:s.jsx("span",{children:r.activity.historyFoot})})]})}const Lb=3,Bp=(l,c,u=Lb)=>Math.abs(l)+Math.abs(c)>=u;function Yb(l,c,u=8){const f=(c.full??c.w)>l-u*2;return{x:Math.max(u,Math.round((l-c.w)/2)),icons:f}}function Gb(l,c=2){const u=l.split("/"),f=u.slice(1).map((h,p)=>u.slice(0,p+1).join("/"));return{paths:f.slice(-c),skipped:f.length>c}}function Bl(l){const c=(l??"").trim(),u=c.match(/^(-?\d+(?:\.\d+)?)px$/);return u?String(Number(u[1])):c}const Xf=l=>(l??"").trim().split(/\s+/).filter(Boolean).map(Bl).join(" · ");function qb(l){return l.replace(/·/g," ").trim().split(/\s+/).filter(Boolean).map(u=>/^-?\d+(?:\.\d+)?$/.test(u)?`${Number(u)}px`:u).join(" ")}function Vf(l,c){const u=Number(l);return!l||!Number.isFinite(u)?String(l??""):c[u]?`${c[u]} · ${u}`:String(u)}const Xb=/^(system-ui|-apple-system|blinkmacsystemfont|ui-sans-serif)$/i;function Up(l){var u;const c=((u=(l??"").split(",")[0])==null?void 0:u.trim().replace(/^["']|["']$/g,""))??"";return Xb.test(c)?"System UI":c}function Vb(l){const c=l.trim();return/^system ui$/i.test(c)?"system-ui":c.includes(",")||/^["'].*["']$/.test(c)||!/\s/.test(c)?c:`"${c}"`}function xn(l){const c=(l??"").trim().toLowerCase();let u=c.match(/^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/);if(u){let f=u[1];return f.length<=4&&(f=[...f].map(h=>h+h).join("")),f.length===8&&f.slice(6)!=="ff"?null:"#"+f.slice(0,6).toUpperCase()}return u=c.match(/^rgba?\(\s*([\d.]+)[ ,]+([\d.]+)[ ,]+([\d.]+)(?:[ ,/]+([\d.]+%?))?\s*\)$/),u?u[4]!=null&&parseFloat(u[4])<(u[4].endsWith("%")?100:1)?null:"#"+[u[1],u[2],u[3]].map(f=>Math.round(Number(f)).toString(16).padStart(2,"0")).join("").toUpperCase():null}const dy=l=>l.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"token";function dc(l,c){var p;const u=(l??"").trim(),f=u.match(/^var\(\s*--([a-z0-9-]+)/i);if(f){const v=c.find(S=>dy(S.name)===f[1].toLowerCase());if(v)return v;const C=(p=u.match(/,\s*([^)]+)\)\s*$/))==null?void 0:p[1];return C?dc(C,c):null}const h=xn(u);return h?c.find(v=>xn(v.value)===h)??null:null}function Kb(l,c){const u=dy(l.name);if(c[`--${u}`]!=null)return`var(--${u})`;const f=xn(l.value),h=Object.keys(c).find(p=>f&&xn(c[p])===f);return h?`var(${h})`:`var(--${u}, ${f??l.value})`}const Zb=(l,c)=>l==="text"&&xn(c)==null?"color":"background";function Ir(l,c,u=1,f=0){const h=parseFloat(l),p=Number.isFinite(h)?h:0;return Math.max(f,Math.round((p+c*u)*100)/100)}function Qb(l,c,u=4){return(l||"0px").trim().split(/\s+/).map(h=>`${Ir(h,c,u)}px`).join(" ")}const Kf=[{id:"yellow",label:r.shapes.stickyColors.yellow,bg:"#FFF1A8"},{id:"orange",label:r.shapes.stickyColors.orange,bg:"#FFD9BC"},{id:"pink",label:r.shapes.stickyColors.pink,bg:"#FFD6E2"},{id:"purple",label:r.shapes.stickyColors.purple,bg:"#E5DAFF"},{id:"blue",label:r.shapes.stickyColors.blue,bg:"#D2E4FF"},{id:"green",label:r.shapes.stickyColors.green,bg:"#D5F0D3"},{id:"gray",label:r.shapes.stickyColors.gray,bg:"#ECEBE7"},{id:"white",label:r.shapes.stickyColors.white,bg:"#FFFFFF"}],Jb=l=>{var c;return((c=Kf.find(u=>u.id===l))==null?void 0:c.bg)??Kf[0].bg},Hp=200,$p=6,Fb=["#111111","#6B6B6B","#C94F0C","#B42318","#1E7A4C","#2F6FDE","#FFFFFF","none"];function fy({s:l,id:c}){var T;const u=l.strokeWidth??4,f=l.stroke??"#111111",h=l.fill??"none",p=u,v=Math.max(1,l.w),C=Math.max(1,l.h),S=(l.points??[]).map(([y,b])=>`${y},${b}`).join(" ");return s.jsxs("svg",{width:v+p*2,height:C+p*2,viewBox:`${-p} ${-p} ${v+p*2} ${C+p*2}`,style:{position:"absolute",left:-p,top:-p,overflow:"visible"},children:[l.kind==="arrow"&&s.jsx("defs",{children:s.jsx("marker",{id:`ah-${c}`,viewBox:"0 0 10 10",refX:"8",refY:"5",markerWidth:"5",markerHeight:"5",orient:"auto-start-reverse",children:s.jsx("path",{d:"M0 0L10 5L0 10z",fill:f})})}),l.kind==="rect"&&s.jsx("rect",{x:0,y:0,width:v,height:C,rx:8,fill:h,stroke:f,strokeWidth:u}),l.kind==="oval"&&s.jsx("ellipse",{cx:v/2,cy:C/2,rx:v/2,ry:C/2,fill:h,stroke:f,strokeWidth:u}),(l.kind==="line"||l.kind==="arrow")&&s.jsx("polyline",{points:S,fill:"none",stroke:f,strokeWidth:u,strokeLinecap:"round",markerEnd:l.kind==="arrow"?`url(#ah-${c})`:void 0}),l.kind==="pen"&&s.jsx("polyline",{points:S,fill:"none",stroke:f,strokeWidth:u,strokeLinecap:"round",strokeLinejoin:"round"}),l.kind==="image"&&s.jsx("image",{href:(T=l.src)==null?void 0:T.replace(/^\.\.\//,"/"),x:0,y:0,width:v,height:C,preserveAspectRatio:"xMidYMid slice"})]})}function Wb(l){const c=j.useRef(null),u=(h,p)=>v=>{v.button!==0||!l.interactive||(v.stopPropagation(),l.onSelect(h,v.shiftKey),!v.shiftKey&&(c.current={id:h,mode:p,sx:v.clientX,sy:v.clientY,o:l.shapes[h],moved:!1},v.currentTarget.setPointerCapture(v.pointerId)))},f=(h,p=!1)=>{const v=c.current;if(!v)return;const C=(h.clientX-v.sx)/l.zoom,S=(h.clientY-v.sy)/l.zoom;if(!v.moved&&Math.abs(C)+Math.abs(S)<2/l.zoom){p&&(c.current=null);return}if(v.moved=!0,v.mode==="move")l.onChange(v.id,{x:Math.round(v.o.x+C),y:Math.round(v.o.y+S)},p);else{const T=Math.max(8,v.o.w+C),y=Math.max(8,v.o.h+S),b=T/Math.max(1,v.o.w),k=y/Math.max(1,v.o.h),R={w:Math.round(T),h:Math.round(y)};v.o.points&&(R.points=v.o.points.map(([B,X])=>[Math.round(B*b),Math.round(X*k)])),l.onChange(v.id,R,p)}p&&(c.current=null)};return s.jsx(s.Fragment,{children:l.ids.map(h=>{const p=l.shapes[h],v=l.selected.includes(h);return s.jsxs("div",{className:`shape ${v?"selected":""}`,"data-shape":h,style:{left:p.x,top:p.y,width:Math.max(1,p.w),height:Math.max(1,p.h),pointerEvents:l.interactive?"auto":"none"},onPointerDown:u(h,"move"),onPointerMove:C=>f(C),onPointerUp:C=>f(C,!0),onContextMenu:C=>{C.preventDefault(),C.stopPropagation(),l.selected.includes(h)||l.onSelect(h),l.onContext(h,C)},children:[s.jsx(fy,{s:p,id:h}),v&&s.jsx("div",{className:"shape-resize",role:"slider","aria-label":r.shapes.shapeSize,"aria-valuetext":`${p.w} × ${p.h}`,style:{width:12/l.zoom,height:12/l.zoom,right:-6/l.zoom,bottom:-6/l.zoom,borderWidth:1.5/l.zoom},onPointerDown:u(h,"resize"),onPointerMove:C=>f(C),onPointerUp:C=>f(C,!0)})]},h)})})}function Ib({tool:l,view:c,onDone:u}){const[f,h]=j.useState(null),p=j.useRef(null),v=S=>{const T=S.currentTarget.getBoundingClientRect();return{x:(S.clientX-T.left-c.x)/c.zoom,y:(S.clientY-T.top-c.y)/c.zoom}},C=(S,T,y,b,k,R)=>{if(R&&(l==="rect"||l==="oval")){const W=Math.max(Math.abs(y-S),Math.abs(b-T));y=S+Math.sign(y-S||1)*W,b=T+Math.sign(b-T||1)*W}if(l==="pen"){const W=k.map(le=>le[0]),ne=k.map(le=>le[1]),J=Math.min(...W),ce=Math.min(...ne);return{kind:"pen",x:J,y:ce,w:Math.max(...W)-J,h:Math.max(...ne)-ce,points:k.map(([le,oe])=>[Math.round(le-J),Math.round(oe-ce)])}}const B=Math.min(S,y),X=Math.min(T,b),N=Math.abs(y-S),_=Math.abs(b-T);return l==="line"||l==="arrow"?{kind:l,x:B,y:X,w:N,h:_,points:[[Math.round(S-B),Math.round(T-X)],[Math.round(y-B),Math.round(b-X)]]}:{kind:l,x:B,y:X,w:N,h:_}};return s.jsx("div",{className:"shape-drawer","aria-label":r.shapes.drawShape,onPointerDown:S=>{if(S.button!==0)return;S.currentTarget.setPointerCapture(S.pointerId);const T=v(S);p.current={x0:T.x,y0:T.y,pts:[[T.x,T.y]]}},onPointerMove:S=>{const T=p.current;if(!T)return;const y=v(S);l==="pen"&&T.pts.push([y.x,y.y]),h(C(T.x0,T.y0,y.x,y.y,T.pts,S.shiftKey))},onPointerUp:S=>{const T=p.current;if(p.current=null,h(null),!T)return;const y=v(S);let b=C(T.x0,T.y0,y.x,y.y,T.pts,S.shiftKey);if(b.w<4&&b.h<4){if(l==="pen")return;b=l==="line"||l==="arrow"?{kind:l,x:T.x0,y:T.y0,w:200,h:0,points:[[0,0],[200,0]]}:{kind:l,x:T.x0,y:T.y0,w:200,h:140}}u({...b,x:Math.round(b.x),y:Math.round(b.y),w:Math.round(b.w),h:Math.round(b.h)})},children:f&&s.jsx("div",{className:"world",style:{transform:`translate(${c.x}px, ${c.y}px) scale(${c.zoom})`,pointerEvents:"none"},children:s.jsx("div",{className:"shape",style:{left:f.x,top:f.y,width:Math.max(1,f.w),height:Math.max(1,f.h)},children:s.jsx(fy,{s:{...f,strokeWidth:4},id:"draft"})})})})}function Pb({shape:l,onPatch:c,onDelete:u,onFront:f,onBack:h}){const p=r.shapes.kinds,v=({value:C,onPick:S,allowNone:T})=>s.jsx("span",{className:"swatches",children:Fb.filter(y=>T||y!=="none").map(y=>s.jsx("button",{className:`swatch ${C===y?"on":""} ${y==="none"?"none":""}`,title:y==="none"?r.shapes.none:y,"aria-label":y==="none"?r.shapes.none:y,style:{background:y==="none"?void 0:y},onClick:()=>S(y)},y))});return s.jsxs("section",{className:"board-opts","aria-label":r.shapes.options,children:[s.jsx("div",{className:"sec-head",children:s.jsx("span",{children:p[l.kind]})}),l.kind!=="image"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"field-row",children:[s.jsx("span",{children:r.shapes.strokeColor}),s.jsx(v,{value:l.stroke??"#111111",onPick:C=>c({stroke:C})})]}),(l.kind==="rect"||l.kind==="oval")&&s.jsxs("div",{className:"field-row",children:[s.jsx("span",{children:r.shapes.fill}),s.jsx(v,{value:l.fill??"none",onPick:C=>c({fill:C}),allowNone:!0})]}),s.jsxs("label",{className:"field-row",children:[s.jsx("span",{children:r.shapes.weight}),s.jsx("input",{type:"range",min:1,max:24,value:l.strokeWidth??4,onChange:C=>c({strokeWidth:Number(C.target.value)}),"aria-label":r.shapes.strokeWeight})]})]}),s.jsxs("div",{className:"muted small",children:[l.w," × ",l.h," · (",l.x,", ",l.y,")"]}),s.jsxs("div",{className:"btn-row",children:[s.jsx("button",{className:"icon-btn","aria-label":r.shapes.front,title:r.shapes.front,onClick:f,children:s.jsx(I,{name:"front"})}),s.jsx("button",{className:"icon-btn","aria-label":r.shapes.back,title:r.shapes.back,onClick:h,children:s.jsx(I,{name:"back"})}),s.jsx("button",{className:"icon-btn danger","aria-label":r.shapes.deleteShape,title:r.shapes.deleteTitle,onClick:u,children:s.jsx(I,{name:"trash"})})]})]})}function e0({note:l,onPatch:c,onDelete:u}){const f=l.kind==="title",h=f?72:22;return s.jsxs("section",{className:"board-opts","aria-label":r.notes.options,children:[s.jsx("div",{className:"sec-head",children:s.jsx("span",{children:f?r.notes.title:r.notes.sticky})}),s.jsxs("label",{className:"field-row",children:[s.jsx("span",{children:r.notes.fontSize}),s.jsx("select",{value:l.size??h,onChange:p=>c({size:Number(p.target.value)===h?void 0:Number(p.target.value)}),"aria-label":r.notes.fontSize,children:(f?[32,48,56,72,96,128]:[14,18,22,28,36]).map(p=>s.jsxs("option",{value:p,children:[p,"px",p===h?r.notes.defaultSuffix:""]},p))})]}),s.jsxs("div",{className:"btn-row",role:"group","aria-label":r.notes.textStyle,children:[s.jsx("button",{className:`icon-btn ${l.bold??f?"on":""}`,"aria-pressed":!!(l.bold??f),"aria-label":r.notes.bold,title:r.notes.bold,onClick:()=>c({bold:!(l.bold??f)}),children:s.jsx("strong",{children:"B"})}),s.jsx("button",{className:`icon-btn ${l.italic?"on":""}`,"aria-pressed":!!l.italic,"aria-label":r.notes.italic,title:r.notes.italic,onClick:()=>c({italic:!l.italic||void 0}),children:s.jsx("em",{children:"I"})})]}),!f&&s.jsxs("div",{className:"field-row",children:[s.jsx("span",{children:r.notes.color}),s.jsx("span",{className:"swatches",children:Kf.map(p=>s.jsx("button",{className:`swatch ${(l.color??"yellow")===p.id?"on":""}`,title:p.label,"aria-label":r.notes.stickyColor(p.label),style:{background:p.bg},onClick:()=>c({color:p.id==="yellow"?void 0:p.id})},p.id))})]}),f?s.jsxs("div",{className:"grid2",children:[s.jsx(Da,{label:r.notes.maxWidth,value:l.maxW??2e3,onCommit:p=>c({maxW:p})}),s.jsx(Da,{label:r.notes.maxHeight,value:l.maxH??0,onCommit:p=>c({maxH:p||void 0})})]}):s.jsxs("div",{className:"grid2",children:[s.jsx(Da,{label:r.notes.width,value:l.w??400,onCommit:p=>c({w:p})}),s.jsx(Da,{label:r.notes.height,value:l.h??0,onCommit:p=>c({h:p||void 0})})]}),s.jsx("p",{className:"muted small",children:f?r.notes.titleHint:r.notes.stickyHint}),s.jsx("div",{className:"btn-row",children:s.jsx("button",{className:"icon-btn danger","aria-label":r.notes.deleteNote,title:r.notes.deleteTitle,onClick:u,children:s.jsx(I,{name:"trash"})})})]})}function Da({label:l,value:c,onCommit:u}){return s.jsxs("label",{className:"num",children:[s.jsx("span",{children:l}),s.jsx("input",{inputMode:"numeric",defaultValue:c,onBlur:f=>{const h=Math.max(0,Math.round(Number(f.target.value)));Number.isFinite(h)&&h!==c&&u(h)},onKeyDown:f=>!f.nativeEvent.isComposing&&f.key==="Enter"&&f.target.blur()},c)]})}const t0=l=>l==="grid"?{type:l,count:0,gutter:0,margin:0,align:"stretch",size:8,color:"#C94F0C"}:{type:l,count:l==="columns"?4:6,gutter:16,margin:20,align:"stretch",size:80,color:"#C94F0C"};function n0(l,c){const u=Math.max(1,Math.round(c.count));if(c.align==="stretch"){const v=(l-c.margin*2-c.gutter*(u-1))/u;return Array.from({length:u},(C,S)=>[c.margin+S*(v+c.gutter),v])}const f=u*c.size+(u-1)*c.gutter,h=c.align==="start"?c.margin:c.align==="end"?l-c.margin-f:(l-f)/2;return Array.from({length:u},(p,v)=>[h+v*(c.size+c.gutter),c.size])}function l0({guides:l,w:c,h:u}){return s.jsx("div",{className:"layout-guides","aria-hidden":"true",children:l.filter(f=>!f.hidden).map((f,h)=>f.type==="grid"?s.jsx("div",{className:"lg-grid",style:{backgroundImage:`linear-gradient(to right, ${f.color}55 1px, transparent 1px), linear-gradient(to bottom, ${f.color}55 1px, transparent 1px)`,backgroundSize:`${f.size}px ${f.size}px`}},h):n0(f.type==="columns"?c:u,f).map(([p,v],C)=>s.jsx("div",{className:"lg-track",style:f.type==="columns"?{left:p,top:0,width:v,height:u,background:`${f.color}1f`}:{top:p,left:0,height:v,width:c,background:`${f.color}1f`}},`${h}-${C}`)))})}function a0({guides:l,onChange:c}){const u=(h,p)=>c(l.map((v,C)=>C===h?{...v,...p}:v),r.history.editGuide),f=r.guides.types;return s.jsxs("section",{className:"board-opts guides-editor","aria-label":r.guides.aria,children:[s.jsxs("div",{className:"sec-head",children:[s.jsx("span",{children:r.guides.heading(l.length,$p)}),s.jsx("span",{className:"btn-row",children:["columns","rows","grid"].map(h=>s.jsx("button",{className:"icon-btn sm",disabled:l.length>=$p,title:r.guides.add[h],"aria-label":r.guides.add[h],onClick:()=>c([...l,t0(h)],r.history.addGuide),children:s.jsx("span",{className:"small",children:f[h]})},h))})]}),l.length===0&&s.jsx("p",{className:"muted small",children:r.guides.empty}),l.map((h,p)=>s.jsxs("div",{className:"guide-row",children:[s.jsxs("div",{className:"guide-head",children:[s.jsx("strong",{children:f[h.type]}),s.jsx("input",{type:"color",value:h.color,onChange:v=>u(p,{color:v.target.value}),"aria-label":r.guides.color}),s.jsx("div",{className:"spacer"}),s.jsx("button",{className:"icon-btn sm","aria-label":h.hidden?r.guides.show:r.guides.hide,title:h.hidden?r.guides.show:r.guides.hide,onClick:()=>u(p,{hidden:!h.hidden||void 0}),children:s.jsx(I,{name:h.hidden?"close":"check",size:14})}),s.jsx("button",{className:"icon-btn sm danger","aria-label":r.guides.deleteGuide,title:r.guides.delete,onClick:()=>c(l.filter((v,C)=>C!==p),r.history.deleteGuide),children:s.jsx(I,{name:"trash",size:14})})]}),h.type==="grid"?s.jsx("div",{className:"grid2",children:s.jsx(Da,{label:r.guides.cell,value:h.size,onCommit:v=>u(p,{size:Math.max(2,v)})})}):s.jsxs("div",{className:"grid2",children:[s.jsx(Da,{label:r.guides.count,value:h.count,onCommit:v=>u(p,{count:Math.max(1,Math.min(48,v))})}),s.jsx(Da,{label:r.guides.gutter,value:h.gutter,onCommit:v=>u(p,{gutter:v})}),s.jsx(Da,{label:r.guides.margin,value:h.margin,onCommit:v=>u(p,{margin:v})}),h.align!=="stretch"&&s.jsx(Da,{label:r.guides.cellSize,value:h.size,onCommit:v=>u(p,{size:Math.max(1,v)})}),s.jsxs("label",{className:"field-row span2",children:[s.jsx("span",{children:r.guides.align}),s.jsxs("select",{value:h.align,onChange:v=>u(p,{align:v.target.value}),"aria-label":r.guides.alignAria,children:[s.jsx("option",{value:"stretch",children:r.guides.stretch}),s.jsx("option",{value:"start",children:h.type==="columns"?r.guides.left:r.guides.top}),s.jsx("option",{value:"center",children:r.guides.center}),s.jsx("option",{value:"end",children:h.type==="columns"?r.guides.right:r.guides.bottom})]})]})]})]},p))]})}const Lp={paths:[],rects:[],selection:null,error:null};function i0(l,c){const[u,f]=j.useState(Lp),h=j.useRef([]);h.current=u.paths;const p=j.useCallback(()=>{var T;if(!l)return;const S=(T=c(l))==null?void 0:T.contentDocument;S&&f(y=>{const b=y.paths.map(k=>Mn(S,k));return b.some(k=>!k)?{...y,paths:[],rects:[],selection:null,error:r.editMode.fileChanged}:{...y,rects:b.map(k=>ia(k))}})},[l,c]),v=j.useCallback(async S=>{var k;if(!l)return;const T=(k=c(l))==null?void 0:k.contentDocument,y=T?S.map(R=>Mn(T,R)):[];if(!T||!S.length||y.some(R=>!R)){f(R=>({...R,paths:[],rects:[],selection:null})),await Ne.put("/api/selection",{file:null}).catch(()=>{});return}const b=S[S.length-1];f(R=>({...R,paths:S,rects:y.map(B=>ia(B)),error:null}));try{const{selection:R}=await Ne.put("/api/selection",{file:l,path:b,paths:S,styles:kb(Mn(T,b)),...hy(Mn(T,b))});f(B=>B.paths===S||B.paths.join()===S.join()?{...B,selection:R}:B)}catch(R){f(B=>({...B,selection:null,error:String(R.message)}))}},[l,c]),C=j.useRef(!0);return j.useEffect(()=>{f(Lp),C.current?C.current=!1:l||Ne.put("/api/selection",{file:null}).catch(()=>{})},[l]),j.useEffect(()=>{var k;if(!l)return;const S=c(l);if(!S)return;let T=()=>{};const y=()=>{T();const R=S.contentDocument,B=S.contentWindow;if(!R||!B)return;const X=_=>{var W;_.isComposing||(W=_.target)!=null&&W.isContentEditable||(window.dispatchEvent(new KeyboardEvent("keydown",{key:_.key,code:_.code,metaKey:_.metaKey,ctrlKey:_.ctrlKey,shiftKey:_.shiftKey,altKey:_.altKey})),(/^(Arrow|Delete|Backspace|Tab|Enter|Escape)/.test(_.key)||(_.metaKey||_.ctrlKey)&&/^[zydcvg]$/i.test(_.key))&&_.preventDefault())},N=()=>p();R.addEventListener("keydown",X,!0),B.addEventListener("scroll",N,!0),T=()=>{R.removeEventListener("keydown",X,!0),B.removeEventListener("scroll",N,!0)}},b=()=>{y(),h.current.length&&v(h.current)};return((k=S.contentDocument)==null?void 0:k.readyState)==="complete"&&y(),S.addEventListener("load",b),()=>{S.removeEventListener("load",b),T()}},[l,c,v,p]),{state:u,select:v,refresh:p,setError:S=>f(T=>({...T,error:S}))}}function Af(l,c,u){const f=l==null?void 0:l.contentDocument;if(!l||!(f!=null&&f.body))return null;const h=l.getBoundingClientRect(),p=h.width/(l.offsetWidth||h.width)||1,v=f.elementFromPoint((c-h.left)/p,(u-h.top)/p);if(!v||v===f.body||v===f.documentElement)return null;const C=il(v);return C==null?null:{el:v,path:C}}function s0(l,c,u,f,h){const p=l==null?void 0:l.contentDocument,v=l==null?void 0:l.contentWindow;if(!l||!(p!=null&&p.body)||!v)return!1;const C=l.getBoundingClientRect(),S=C.width/(l.offsetWidth||C.width)||1,T=p.scrollingElement??p.documentElement,y=R=>{const B=R===T?null:v.getComputedStyle(R),X=(!B||/auto|scroll/.test(B.overflowY))&&(h<0?R.scrollTop>0:h>0&&R.scrollTop+R.clientHeight<R.scrollHeight-1),N=(!B||/auto|scroll/.test(B.overflowX))&&(f<0?R.scrollLeft>0:f>0&&R.scrollLeft+R.clientWidth<R.scrollWidth-1);return X||N};let b=p.elementFromPoint((c-C.left)/S,(u-C.top)/S);for(;b&&b!==T&&b!==p.body&&!y(b);)b=b.parentElement;const k=b&&b!==p.body&&y(b)?b:y(T)?T:null;return k?(k.scrollBy(f/S,h/S),!0):!1}function o0(l,c){const u=p=>{const v=p.getBoundingClientRect();return v.width>0&&v.height>0&&v.left>=c.x&&v.top>=c.y&&v.right<=c.x+c.w&&v.bottom<=c.y+c.h},f=[],h=p=>{for(const v of Array.from(p.children))if(!/^(script|style|template)$/i.test(v.tagName))if(u(v)){const C=il(v);C!=null&&f.push(C)}else h(v)};return h(l.body),f}function hy(l){var p,v,C;const c=l.tagName.toLowerCase(),u=l.getAttribute("role"),f=c==="img"||c==="picture"||(v=(p=l.style)==null?void 0:p.backgroundImage)!=null&&v.includes("url(")?"image":c==="button"||u==="button"?"button":c==="a"?"link":/^(input|textarea|select)$/.test(c)?"input":c==="svg"?"icon":!l.children.length&&((C=l.textContent)!=null&&C.trim())?"text":"container",h=(l.getAttribute("aria-label")||l.getAttribute("alt")||l.getAttribute("title")||l.getAttribute("placeholder")||l.innerText||l.textContent||"").trim().replace(/\s+/g," ").slice(0,60);return{kind:f,label:h}}const th=.04,nh=4,c0=.25,r0=640,Of=.5,Df=[600,1200,2400],u0=l=>Df.find(c=>c>=l)??Df[Df.length-1],d0=6,my={url:l=>`/screens/${l}`,thumbs:!0};function f0(l){var U;const c=j.useRef(null),u=j.useRef(null),[f,h]=j.useState({w:1200,h:800}),[p,v]=j.useState(!1),[C,S]=j.useState([]),[T,y]=j.useState(null),b=j.useRef(null),k=j.useRef(null);j.useLayoutEffect(()=>{const E=c.current,Y=new ResizeObserver(()=>{var ie;const A={w:E.clientWidth,h:E.clientHeight};h(A),(ie=l.onSize)==null||ie.call(l,A)});return Y.observe(E),()=>Y.disconnect()},[]);const R=j.useRef(!1);j.useEffect(()=>{const E=u.current;if(!E)return;if(!R.current){R.current=!0;return}E.style.willChange="transform";const Y=setTimeout(()=>E.style.willChange="",200);return()=>clearTimeout(Y)},[l.view.x,l.view.y,l.view.zoom]),j.useEffect(()=>{const E=c.current,Y=A=>{var ae,de,Ae;A.preventDefault();const ie=E.getBoundingClientRect(),se=A.clientX-ie.left,ge=A.clientY-ie.top;if(A.ctrlKey||A.metaKey)l.setView(Ve=>{const ft=Ws(Ve.zoom*Math.exp(-A.deltaY*.01),th,nh),Rt=(se-Ve.x)/Ve.zoom,Ee=(ge-Ve.y)/Ve.zoom;return{zoom:ft,x:se-Rt*ft,y:ge-Ee*ft}});else{const Ve=((Ae=(de=(ae=A.target)==null?void 0:ae.closest)==null?void 0:de.call(ae,".board-frame[data-inside]"))==null?void 0:Ae.querySelector("iframe"))??null;if(s0(Ve,A.clientX,A.clientY,A.deltaX,A.deltaY))return;l.setView(ft=>({...ft,x:ft.x-A.deltaX,y:ft.y-A.deltaY}))}};return E.addEventListener("wheel",Y,{passive:!1}),()=>E.removeEventListener("wheel",Y)},[l.setView]),j.useEffect(()=>{const E=A=>{A.code==="Space"&&!py(A)&&!A.repeat&&(A.preventDefault(),v(!0))},Y=A=>A.code==="Space"&&v(!1);return window.addEventListener("keydown",E),window.addEventListener("keyup",Y),()=>{window.removeEventListener("keydown",E),window.removeEventListener("keyup",Y)}},[]);const{view:B}=l,X=(E,Y)=>{const A=c.current.getBoundingClientRect();return{x:(E-A.left-B.x)/B.zoom,y:(Y-A.top-B.y)/B.zoom}},N=E=>{b.current=E,y(E)},_=p||l.tool==="hand"||!!l.readOnly,W=l.screens??my,ne=E=>{if(E.target!==E.currentTarget&&E.button!==1)return;if(E.currentTarget.setPointerCapture(E.pointerId),E.button===1||_){k.current={kind:"pan",sx:E.clientX,sy:E.clientY,vx:B.x,vy:B.y};return}if(E.button!==0)return;const Y=X(E.clientX,E.clientY);if(l.tool==="title"||l.tool==="sticky"){l.onCreateNote(l.tool,{x:Math.round(Y.x),y:Math.round(Y.y)}),l.setTool("select");return}k.current={kind:l.tool==="board"?"draw":"marquee",sx:Y.x,sy:Y.y,additive:E.shiftKey,moved:!1}},J=E=>{const Y=k.current;if(!Y)return;if(Y.kind==="pan"){l.setView(se=>({...se,x:Y.vx+E.clientX-Y.sx,y:Y.vy+E.clientY-Y.sy}));return}const A=X(E.clientX,E.clientY),ie={x:Math.min(Y.sx,A.x),y:Math.min(Y.sy,A.y),w:Math.abs(A.x-Y.sx),h:Math.abs(A.y-Y.sy)};(ie.w+ie.h)*B.zoom>4&&(Y.moved=!0),Y.moved&&N(ie)},ce=E=>{const Y=k.current;if(k.current=null,(Y==null?void 0:Y.kind)==="pan"&&l.readOnly&&Math.abs(E.clientX-Y.sx)+Math.abs(E.clientY-Y.sy)<4&&l.onSelect([],"replace"),!Y||Y.kind==="pan")return;const A=b.current;if(N(null),Y.kind==="draw"){const ae=X(E.clientX,E.clientY);l.onCreateBoard(Y.moved&&A&&A.w>20&&A.h>20?y0(A):{x:Math.round(ae.x),y:Math.round(ae.y),w:390,h:844}),l.setTool("select");return}if(!Y.moved||!A){Y.additive||(l.onSelect([],"replace"),l.onSelectNote(null));return}const ie=l.visibleBoards.filter(ae=>Rf(l.board.boards[ae],A)),se=l.visibleNotes.filter(ae=>{var Rt;const de=(Rt=c.current)==null?void 0:Rt.querySelector(`[data-note="${ae}"]`);if(!de)return!1;const Ae=de.getBoundingClientRect(),Ve=X(Ae.left,Ae.top),ft=X(Ae.right,Ae.bottom);return Rf({x:Ve.x,y:Ve.y,w:ft.x-Ve.x,h:ft.y-Ve.y},A)}),ge=Object.entries(l.board.shapes??{}).filter(([,ae])=>Rf({x:ae.x,y:ae.y,w:Math.max(1,ae.w),h:Math.max(1,ae.h)},A)).map(([ae])=>ae);l.onMarquee({boards:ie,notes:se,shapes:ge},Y.additive)},le=j.useRef(null),oe=(E,Y)=>{const A=l.selected.includes(Y)?l.selected:[Y],ie={};for(const se of A)ie[se]={x:l.board.boards[se].x,y:l.board.boards[se].y};le.current={sx:E.clientX,sy:E.clientY,origins:ie,moved:!1},E.currentTarget.setPointerCapture(E.pointerId)},F=(E,Y=!1)=>{const A=le.current;if(!A)return;let ie=(E.clientX-A.sx)/B.zoom,se=(E.clientY-A.sy)/B.zoom;if(!A.moved&&!Bp(E.clientX-A.sx,E.clientY-A.sy))return;A.moved=!0;const ge=Object.keys(A.origins),ae=ge.map(Ee=>({...l.board.boards[Ee],x:A.origins[Ee].x+ie,y:A.origins[Ee].y+se})),de=gy(ae),Ae=l.visibleBoards.filter(Ee=>!ge.includes(Ee)).map(Ee=>l.board.boards[Ee]),Ve=d0/B.zoom,ft=[];if(!E.altKey){const Ee=Yp([de.x,de.x+de.w/2,de.x+de.w],Ae.flatMap(at=>[at.x,at.x+at.w/2,at.x+at.w]),Ve),Re=Yp([de.y,de.y+de.h/2,de.y+de.h],Ae.flatMap(at=>[at.y,at.y+at.h/2,at.y+at.h]),Ve);if(Ee){ie+=Ee.d;const at=Ae.filter(ct=>[ct.x,ct.x+ct.w/2,ct.x+ct.w].some(ht=>Math.abs(ht-Ee.at)<.5));ft.push({axis:"x",at:Ee.at,from:Math.min(de.y+((Re==null?void 0:Re.d)??0),...at.map(ct=>ct.y)),to:Math.max(de.y+de.h+((Re==null?void 0:Re.d)??0),...at.map(ct=>ct.y+ct.h))})}if(Re){se+=Re.d;const at=Ae.filter(ct=>[ct.y,ct.y+ct.h/2,ct.y+ct.h].some(ht=>Math.abs(ht-Re.at)<.5));ft.push({axis:"y",at:Re.at,from:Math.min(de.x+((Ee==null?void 0:Ee.d)??0),...at.map(ct=>ct.x)),to:Math.max(de.x+de.w+((Ee==null?void 0:Ee.d)??0),...at.map(ct=>ct.x+ct.w))})}}S(Y?[]:ft);const Rt={};for(const Ee of ge)Rt[Ee]={x:Math.round(A.origins[Ee].x+ie),y:Math.round(A.origins[Ee].y+se)};l.onMoveBoards(Rt,Y)},re=E=>{const Y=le.current;Y!=null&&Y.moved&&F(E,!0),le.current=null,S([])},we=f.w/B.zoom,Te=f.h/B.zoom,st=-B.x/B.zoom,Ot=-B.y/B.zoom,Dt=E=>E.x+E.w>st-200&&E.x<st+we+200&&E.y+E.h>Ot-200&&E.y<Ot+Te+200,tt=E=>{E.currentTarget.setPointerCapture(E.pointerId),k.current={kind:"pan",sx:E.clientX,sy:E.clientY,vx:B.x,vy:B.y}},ue=j.useRef(null),me=!!l.onPickElement&&!l.readOnly&&!_&&l.tool==="select",be=(E,Y,A,ie)=>{var ge;if(E.button!==0)return;if(E.stopPropagation(),l.readOnly||_)return l.readOnly&&l.onSelect([Y],"replace"),tt(E);const se=l.selected.includes(Y);if((ge=l.onHoverElement)==null||ge.call(l,null),A==="frame"&&me&&ie&&E.shiftKey&&l.editFile===Y){E.currentTarget.setPointerCapture(E.pointerId),ue.current={file:Y,kind:"elements",sx:E.clientX,sy:E.clientY,moved:!1};return}if(E.shiftKey)return l.onSelect([Y],"toggle");se||l.onSelect([Y],"replace"),oe(E,Y),ue.current={file:Y,kind:A==="frame"&&me&&ie?"board":"label",sx:E.clientX,sy:E.clientY,moved:!1}},je=(E,Y)=>({x:Math.min(E.sx,Y.clientX),y:Math.min(E.sy,Y.clientY),w:Math.abs(Y.clientX-E.sx),h:Math.abs(Y.clientY-E.sy)}),Ce=(E,Y,A)=>{var se,ge,ae;if(l.readOnly||((se=k.current)==null?void 0:se.kind)==="pan")return J(E);ue.current&&E.buttons===0&&(ue.current=null,le.current=null);const ie=ue.current;if(!ie){E.buttons===0&&me&&A&&((ge=l.onHoverElement)==null||ge.call(l,Y,E));return}if(ie.kind==="elements"){if(!ie.moved&&!Bp(E.clientX-ie.sx,E.clientY-ie.sy))return;ie.moved=!0,(ae=l.onElementMarquee)==null||ae.call(l,ie.file,je(ie,E),!1);return}F(E)},ot=(E,Y)=>{var se,ge,ae,de,Ae;if(l.readOnly||((se=k.current)==null?void 0:se.kind)==="pan")return void(k.current=null);const A=ue.current;if(ue.current=null,(A==null?void 0:A.kind)==="elements"){A.moved?(ge=l.onElementMarquee)==null||ge.call(l,A.file,je(A,E),!0):(ae=l.onPickElement)==null||ae.call(l,Y,E,{add:!0,double:!1});return}const ie=!!((de=le.current)!=null&&de.moved);re(E),!(!A||ie)&&(A.kind==="board"?(Ae=l.onPickElement)==null||Ae.call(l,Y,E,{add:!1,double:!1}):A.kind==="label"&&l.editFile===Y&&l.onSelect([Y],"replace"))},Et=new Set(l.visibleBoards),Me=new Set;for(const E of l.visibleBoards){const Y=(U=l.board.boards[E])==null?void 0:U.origin;(Y==null?void 0:Y.kind)==="fork"&&(Me.add(E),Et.has(Y.of)&&Me.add(Y.of))}return s.jsxs("div",{ref:c,className:`canvas tool-${_?"hand":l.tool}`,onPointerDown:ne,onPointerMove:J,onPointerUp:ce,onAuxClick:E=>E.preventDefault(),onContextMenu:E=>{if(E.target!==E.currentTarget)return;E.preventDefault();const Y=X(E.clientX,E.clientY);l.onContext({type:"canvas",x:Math.round(Y.x),y:Math.round(Y.y)},E)},role:"application","aria-label":r.canvas.aria,children:[s.jsxs("div",{ref:u,className:"world",style:{transform:`translate(${B.x}px, ${B.y}px) scale(${B.zoom})`},children:[l.underLayer,l.visibleNotes.map(E=>s.jsx(p0,{note:l.board.notes[E],zoom:B.zoom,id:E,selected:l.selectedNotes.includes(E),readOnly:l.readOnly,onSelect:Y=>l.onSelectNote(E,Y),onMove:(Y,A)=>l.onMoveNote(E,Y,A),onDelete:()=>l.onDeleteNote(E),onContext:Y=>l.onContext({type:"note",id:E},Y)},E)),l.visibleBoards.map(E=>{var se,ge,ae,de;const Y=l.board.boards[E],A=Dt(Y)&&(!W.thumbs||B.zoom>=c0||Math.max(Y.w,Y.h)*B.zoom>=r0||l.editFile===E),ie=l.selected.includes(E);return s.jsx(h0,{file:E,item:Y,exists:l.files.includes(E),zoom:B.zoom,live:A,selected:ie,single:ie&&l.selected.length===1&&!l.readOnly,readOnly:l.readOnly,screens:W,editing:l.editFile===E,typing:l.typing===E,playing:l.playing===E,near:Dt(Y),reloadKey:l.reloadKeys[E]??0,onPress:(Ae,Ve)=>be(Ae,E,Ve,A),onPressMove:Ae=>Ce(Ae,E,A),onRelease:Ae=>ot(Ae,E),onLeave:()=>{var Ae;return!ue.current&&((Ae=l.onHoverElement)==null?void 0:Ae.call(l,null))},onDoubleClickFrame:me&&A?Ae=>{var Ve;return(Ve=l.onPickElement)==null?void 0:Ve.call(l,E,Ae,{add:!1,double:!0})}:void 0,onContextFrame:Ae=>{var Ve;return me&&A&&!!((Ve=l.onElementContext)!=null&&Ve.call(l,E,Ae))},onResize:(Ae,Ve)=>l.onMoveBoards({[E]:Ae},Ve),onPlay:()=>l.onPlay(E),onRename:()=>l.onRename(E),onContext:Ae=>l.onContext({type:"board",file:E},Ae),overlay:(se=l.renderBoardOverlay)==null?void 0:se.call(l,E),compact:Y.w*B.zoom>=48&&B.zoom<Of&&Me.has(E),forkScene:Me.has(E),tags:Y.w*B.zoom>=48&&!(B.zoom<Of&&Me.has(E))&&l.playing!==E?(ge=l.renderBoardTags)==null?void 0:ge.call(l,E):null,buttons:l.readOnly?null:(ae=l.renderBoardButtons)==null?void 0:ae.call(l,E,B.zoom<Of&&Me.has(E)),ring:((de=l.boardRing)==null?void 0:de.call(l,E))??null,iframeRef:Ae=>{var Ve;return(Ve=l.iframeRef)==null?void 0:Ve.call(l,E,Ae)}},E)}),l.worldLayer,C.map((E,Y)=>E.axis==="x"?s.jsx("div",{className:"guide",style:{left:E.at,top:E.from,width:1/B.zoom,height:E.to-E.from}},Y):s.jsx("div",{className:"guide",style:{left:E.from,top:E.at,height:1/B.zoom,width:E.to-E.from}},Y)),T&&s.jsx("div",{className:l.tool==="board"?"draft-board":"marquee",style:{left:T.x,top:T.y,width:T.w,height:T.h,borderWidth:1/B.zoom},children:l.tool==="board"&&s.jsxs("span",{style:{transform:`scale(${1/B.zoom})`},children:[Math.round(T.w)," × ",Math.round(T.h)]})})]}),p&&s.jsx("div",{className:"pan-capture",onPointerDown:tt,onPointerMove:J,onPointerUp:()=>k.current=null})]})}function h0(l){var b,k,R;const{item:c,zoom:u}=l,f=Zf(u),h=c.title??l.file,p=c.w*u<48,v=!p&&!!l.compact,C=((b=c.origin)==null?void 0:b.kind)==="fork"&&c.origin.by?c.origin:null,S=C?r.occupancy.forked(r.occupancy.clock(Date.parse(C.at??"")||Date.now()),C.by,C.while??r.occupancy.someone):null,T=B=>{B.preventDefault(),B.stopPropagation(),l.onContext(B)},y=B=>B.stopPropagation();return s.jsxs("div",{className:`board ${l.selected?"selected":""} ${l.editing?"editing":""} ${l.playing?"playing":""} ${c.frameless?"frameless":""} ${c.is_interactive?"interactive":""} ${l.ring?"held":""}`,style:{left:c.x,top:c.y,width:c.w,height:c.h,...l.ring?{"--ring":l.ring}:{}},"data-file":l.file,role:"group","aria-label":r.canvas.board(h,!!l.selected,!!l.editing,!!l.playing),"aria-description":S??void 0,children:[s.jsxs("div",{className:`board-label ${p?"tiny":""} ${v?"compact":""} ${l.tags?"tagged":""} ${l.forkScene?"fork-scene":""}`,style:{transform:`scale(${1/u})`,width:c.w*u},onPointerDown:B=>l.onPress(B,"label"),onPointerMove:l.onPressMove,onPointerUp:l.onRelease,onContextMenu:T,title:`${h} · ${l.file}${S?`
53
+ ${S}`:""}`,children:[l.tags,s.jsxs("span",{className:"lab-row",children:[c.is_interactive&&s.jsx("span",{className:"dot","aria-label":r.canvas.interactive}),v&&C?s.jsxs("span",{className:`occ-tag fork-who ${l.ring?"":"done"}`,onDoubleClick:B=>B.stopPropagation(),children:[l.ring?s.jsx("span",{className:"spinner","aria-hidden":"true"}):s.jsx(I,{name:"comment",size:16}),s.jsx("span",{className:"act-tag-text",children:C.by})]}):s.jsx("span",{className:"board-title",onDoubleClick:B=>{B.stopPropagation(),l.readOnly||l.onRename()},children:h}),c.w*u>=160&&h!==l.file&&!(v&&C)&&s.jsx("span",{className:"board-file",children:l.file}),v&&l.selected&&l.buttons&&s.jsx("span",{className:"board-btns pinned",children:l.buttons}),!v&&c.w*u>=110&&s.jsxs("span",{className:`board-btns ${l.buttons?"pinned":""}`,children:[l.buttons,c.is_interactive&&s.jsx("button",{className:"icon-btn sm","aria-label":"Play",title:"Play",onPointerDown:y,onClick:B=>{B.stopPropagation(),l.onPlay()},children:s.jsx(I,{name:"play",size:14})})]})]})]}),s.jsxs("div",{className:"board-frame","data-inside":l.editing&&!l.readOnly?"":void 0,style:{borderRadius:c.radius??0},onDoubleClick:B=>{l.playing||l.typing||!l.onDoubleClickFrame||(B.stopPropagation(),l.onDoubleClickFrame(B))},onPointerDown:B=>!l.playing&&!l.typing&&l.onPress(B,"frame"),onPointerMove:B=>!l.playing&&!l.typing&&l.onPressMove(B),onPointerUp:B=>!l.playing&&!l.typing&&l.onRelease(B),onPointerLeave:l.onLeave,onContextMenu:B=>{l.playing||l.typing||(l.onContextFrame(B)?(B.preventDefault(),B.stopPropagation()):T(B))},children:[l.exists?l.live?s.jsx(g0,{reloadKey:l.reloadKey,iframeRef:l.iframeRef,src:l.screens.url(l.file),html:(R=(k=l.screens).html)==null?void 0:R.call(k,l.file),title:h,interactive:!!l.playing||!!l.typing}):s.jsxs("div",{className:`board-placeholder ${l.near?"loading":"far"}`,style:{fontSize:Math.min(64,14/u)},children:[l.near&&l.screens.thumbs&&s.jsx(m0,{file:l.file,v:l.reloadKey,px:u0(Math.max(c.w,c.h)*u*(window.devicePixelRatio||1))}),s.jsx("span",{className:"ph-title","data-hint":l.near?"":r.canvas.notLoaded,children:h}),l.near&&s.jsx("span",{className:"ph-bar",style:{height:3/Math.max(u,.05)},"aria-hidden":"true"})]}):s.jsx("div",{className:"board-missing",children:r.canvas.fileMissing(l.file)}),l.playing&&s.jsx("div",{className:"playing-badge",style:{transform:`scale(${1/Math.max(u,.25)})`},children:r.canvas.playing}),l.overlay]}),l.single&&s.jsx("div",{className:"board-resize",role:"slider","aria-label":r.canvas.boardSize,"aria-valuetext":`${c.w} × ${c.h}`,style:{width:12/u,height:12/u,right:-6/u,bottom:-6/u,borderWidth:1.5/u},onPointerDown:B=>{B.button===0&&(B.stopPropagation(),f.start(B,{x:c.w,y:c.h},(X,N)=>l.onResize({w:Ws(Math.round(X.x),40,8e3),h:Ws(Math.round(X.y),40,8e3)},N)))},onPointerMove:f.move,onPointerUp:f.end})]})}function m0({file:l,v:c,px:u}){const[f,h]=j.useState(!1),[p,v]=j.useState(u);j.useEffect(()=>v(b=>Math.max(b,u)),[u]);const C=`/api/thumb?f=${encodeURIComponent(l)}&v=${c}&px=${p}`,[S,T]=j.useState(null),y=j.useRef(null);return j.useEffect(()=>{if(C===y.current)return;const b=new Image;return b.onload=()=>T(y.current=C),b.onerror=()=>!y.current&&h(!0),b.src=C,()=>{b.onload=b.onerror=null}},[C]),f||!S?null:s.jsx("img",{className:"board-thumb",src:S,alt:"",decoding:"async",draggable:!1,onLoad:b=>{var k;b.currentTarget.classList.add("loaded"),(k=b.currentTarget.parentElement)==null||k.classList.remove("loading")}})}function g0(l){const c=j.useRef(null),u=j.useRef(!0);return j.useEffect(()=>{if(u.current){u.current=!1;return}const f=c.current,h=f==null?void 0:f.contentWindow;if(!f||!h)return;const p=h.document,v=[];p.querySelectorAll("*").forEach((y,b)=>{(y.scrollTop||y.scrollLeft)&&v.push([b,y.scrollTop,y.scrollLeft])});const C=h.scrollX,S=h.scrollY,T=()=>{f.removeEventListener("load",T);const y=f.contentWindow;y.scrollTo(C,S);const b=y.document.querySelectorAll("*");for(const[k,R,B]of v){const X=b[k];X&&(X.scrollTop=R,X.scrollLeft=B)}f.dispatchEvent(new CustomEvent("dc-reloaded"))};f.addEventListener("load",T),h.location.reload()},[l.reloadKey]),s.jsx("iframe",{ref:f=>{c.current=f,l.iframeRef(f)},src:l.html==null?l.src:void 0,srcDoc:l.html??void 0,title:l.title,style:{pointerEvents:l.interactive?"auto":"none"}})}function p0(l){const{note:c}=l,u=Zf(l.zoom),[f,h]=j.useState(!1),p=j.useRef(null);j.useEffect(()=>{if(f&&p.current){p.current.focus();const X=document.createRange();X.selectNodeContents(p.current);const N=getSelection();N==null||N.removeAllRanges(),N==null||N.addRange(X)}},[f]);const v=j.useRef(!1),C=j.useRef(!1),S=X=>{h(!1);const N=X.innerText;N!==c.text&&l.onMove({text:N},!0)},T=c.size??(c.kind==="title"?72:22),[y,b]=j.useState(T);j.useLayoutEffect(()=>{const X=p.current;if(!X||c.kind!=="title"||f)return b(T);let N=T;X.style.fontSize=`${N}px`;const _=c.maxW??4e3,W=c.maxH||1/0;for(let ne=0;ne<40&&N>12&&(X.scrollWidth>_+1||X.scrollHeight>W+1);ne++)N=Math.max(12,Math.floor(N*.92)),X.style.fontSize=`${N}px`;b(N)},[c.text,T,c.maxW,c.maxH,c.kind,f]);const k=Zf(l.zoom),R=c.kind==="title"?{left:c.x,top:c.y,maxWidth:c.maxW??4e3,maxHeight:c.maxH||void 0}:{left:c.x,top:c.y,width:c.w??320,height:c.h||void 0,background:Jb(c.color)},B={fontSize:y,fontWeight:c.bold??c.kind==="title"?700:400,fontStyle:c.italic?"italic":void 0};return c.kind==="title"&&y*l.zoom<12&&Object.assign(R,{transform:`scale(${12/(y*l.zoom)})`,transformOrigin:"0 0"}),s.jsxs("div",{className:`note note-${c.kind} ${l.selected?"selected":""} ${l.readOnly?"read-only":""}`,"data-note":l.id,style:R,onPointerDown:X=>{f||X.button!==0||l.readOnly||(X.stopPropagation(),X.shiftKey?l.onSelect(!0):l.selected||l.onSelect(!1),u.start(X,{x:c.x,y:c.y},(N,_)=>l.onMove({x:Math.round(N.x),y:Math.round(N.y)},_)))},onPointerMove:u.move,onPointerUp:u.end,onDoubleClick:X=>{X.stopPropagation(),l.readOnly||h(!0)},onContextMenu:X=>{X.preventDefault(),X.stopPropagation(),!l.readOnly&&(l.onSelect(!1),l.onContext(X))},children:[s.jsx("div",{ref:p,className:"note-text",style:B,contentEditable:f,suppressContentEditableWarning:!0,onCompositionStart:()=>v.current=!0,onCompositionEnd:X=>{v.current=!1,C.current&&(C.current=!1,S(X.currentTarget))},onBlur:X=>{v.current?C.current=!0:S(X.currentTarget)},onKeyDown:X=>{X.nativeEvent.isComposing||X.key==="Escape"&&X.currentTarget.blur()},children:c.text}),l.selected&&l.zoom>=.2&&!f&&s.jsx("div",{className:"note-resize",role:"slider","aria-label":c.kind==="title"?r.canvas.titleMaxWidth:r.canvas.stickySize,style:{width:12/l.zoom,height:12/l.zoom,right:-6/l.zoom,bottom:-6/l.zoom,borderWidth:1.5/l.zoom},onPointerDown:X=>{if(X.button!==0)return;X.stopPropagation();const N=X.currentTarget.parentElement.getBoundingClientRect(),_=N.width/l.zoom,W=N.height/l.zoom;k.start(X,{x:_,y:W},(ne,J)=>l.onMove(c.kind==="title"?{maxW:Math.max(80,Math.round(ne.x))}:{w:Math.max(80,Math.round(ne.x)),h:Math.max(60,Math.round(ne.y))},J))},onPointerMove:k.move,onPointerUp:k.end}),l.selected&&!f&&l.zoom>=.2&&s.jsx("button",{className:"note-del icon-btn","aria-label":r.canvas.deleteNote,style:{transform:`scale(${1/l.zoom})`},onPointerDown:X=>X.stopPropagation(),onClick:X=>{X.stopPropagation(),l.onDelete()},children:s.jsx(I,{name:"close",size:14})})]})}function Zf(l){const c=j.useRef(null);return{start(u,f,h){c.current={sx:u.clientX,sy:u.clientY,ox:f.x,oy:f.y,cb:h,moved:!1},u.currentTarget.setPointerCapture(u.pointerId)},move(u){const f=c.current;if(!f)return;const h=(u.clientX-f.sx)/l,p=(u.clientY-f.sy)/l;!f.moved&&Math.abs(h)+Math.abs(p)<2/l||(f.moved=!0,f.cb({x:f.ox+h,y:f.oy+p},!1))},end(u){const f=c.current;c.current=null,!(!f||!f.moved)&&f.cb({x:f.ox+(u.clientX-f.sx)/l,y:f.oy+(u.clientY-f.sy)/l},!0)}}}function Yp(l,c,u){let f=null;for(const h of l)for(const p of c){const v=p-h;Math.abs(v)<=u&&(!f||Math.abs(v)<Math.abs(f.d))&&(f={d:v,at:p})}return f}const gy=l=>{const c=Math.min(...l.map(f=>f.x)),u=Math.min(...l.map(f=>f.y));return{x:c,y:u,w:Math.max(...l.map(f=>f.x+f.w))-c,h:Math.max(...l.map(f=>f.y+f.h))-u}},Rf=(l,c)=>l.x<c.x+c.w&&l.x+l.w>c.x&&l.y<c.y+c.h&&l.y+l.h>c.y,y0=l=>({x:Math.round(l.x),y:Math.round(l.y),w:Math.round(l.w),h:Math.round(l.h)});function Ws(l,c,u){return Math.min(u,Math.max(c,l))}function py(l){const c=l.target;return c?c.tagName==="INPUT"?!/^(checkbox|radio|button|range|color)$/.test(c.type):c.isContentEditable||/^(TEXTAREA|SELECT)$/.test(c.tagName):!1}function es(l,c,u=60,f){if(!l.length)return{x:0,y:0,zoom:1};(c.w<100||c.h<100)&&(c={w:window.innerWidth,h:Math.max(200,window.innerHeight)});const h=f&&f.w>=100&&f.h>=100?f:{x:0,y:0,w:c.w,h:c.h};u=Math.min(u,h.w*.08,h.h*.08);const p=gy(l),v=Ws(Math.min((h.w-u*2)/p.w,(h.h-u*2)/p.h),th,nh);return{zoom:v,x:Math.round(h.x+u-p.x*v+(h.w-u*2-p.w*v)/2),y:Math.round(h.y+u-p.y*v+(h.h-u*2-p.h*v)/2)}}function v0(l){const[c,u]=j.useState(null),f=j.useCallback(()=>Ne.get("/api/assets").then(h=>u(h.assets)).catch(()=>u([])),[]);return j.useEffect(()=>{f()},[f,l]),{list:c,reload:f}}async function Qf(l){const c=[];for(const u of Array.from(l)){const f=await new Promise(h=>{const p=new FileReader;p.onload=()=>h(String(p.result).split(",")[1]??""),p.readAsDataURL(u)});c.push(await Ne.post("/api/assets",{name:u.name,data:f}))}return c}const b0=l=>l>1024*1024?`${(l/1024/1024).toFixed(1)}MB`:`${Math.max(1,Math.round(l/1024))}KB`;function yy(l){const{list:c,reload:u}=v0(l.version),[f,h]=j.useState(!1),[p,v]=j.useState(!1),C=async T=>{var y;h(!0);try{const b=await Qf(T);await u(),(y=l.onUploaded)==null||y.call(l,b)}catch(b){l.onError(b.message)}finally{h(!1)}},S=(c??[]).filter(T=>!l.only||T.kind===l.only);return s.jsxs("div",{className:`assets ${p?"over":""}`,onDragOver:T=>{T.preventDefault(),v(!0)},onDragLeave:()=>v(!1),onDrop:T=>{T.preventDefault(),v(!1),T.dataTransfer.files.length&&C(T.dataTransfer.files)},children:[s.jsxs("label",{className:"upload",children:[s.jsx(I,{name:"plus",size:14})," ",f?r.assets.uploading:r.assets.upload,s.jsx("input",{type:"file",hidden:!0,multiple:!0,accept:"image/*,.woff,.woff2,.ttf,.otf",onChange:T=>T.target.files&&void C(T.target.files)})]}),c==null?s.jsxs("p",{className:"empty",children:[s.jsx("span",{className:"spinner","aria-hidden":"true"})," ",r.assets.loading]}):S.length===0?s.jsx("p",{className:"empty",children:r.assets.empty}):s.jsx("ul",{className:"asset-grid",children:S.map(T=>s.jsx("li",{children:s.jsxs("button",{className:"asset",title:`${T.ref} · ${b0(T.size)}${l.onPick?"":r.assets.copyPath}`,"aria-label":`${T.name}${l.pickLabel??""}`,onClick:()=>l.onPick?l.onPick(T):void navigator.clipboard.writeText(T.ref).catch(()=>{}),children:[T.kind==="image"?s.jsx("img",{src:T.url,alt:"",loading:"lazy"}):s.jsx("span",{className:"asset-font",children:T.kind==="font"?"Aa":r.assets.file}),s.jsx("span",{className:"asset-name",children:T.name})]})},T.name))})]})}function x0({open:l,version:c,onClose:u,onPick:f,onError:h}){return j.useEffect(()=>{if(!l)return;const p=v=>v.key==="Escape"&&u();return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[l,u]),l?s.jsx("div",{className:"dialog-backdrop",onPointerDown:p=>p.target===p.currentTarget&&u(),children:s.jsxs("div",{className:"dialog wide",role:"dialog","aria-modal":"true","aria-label":r.assets.pickImage,children:[s.jsx("h2",{children:r.assets.pickImage}),s.jsx(yy,{version:c,only:"image",pickLabel:r.assets.pickLabel,onPick:f,onError:h,onUploaded:p=>p[0]&&p[0].kind==="image"&&f(p[0])}),s.jsx("div",{className:"dialog-actions",children:s.jsx("button",{onClick:u,children:r.assets.close})})]})}):null}var _f=ry();function Gp({label:l,src:c,empty:u,w:f,h}){const p=j.useRef(null),[v,C]=j.useState(0);return j.useEffect(()=>{const S=p.current;if(!S)return;const T=()=>C(Math.min(1,(S.clientWidth-16)/f,(S.clientHeight-16)/h));T();const y=new ResizeObserver(T);return y.observe(S),()=>y.disconnect()},[f,h]),s.jsxs("figure",{className:"cmp-pane",children:[s.jsx("figcaption",{children:l}),s.jsx("div",{className:"cmp-stage",ref:p,children:c?s.jsx("div",{className:"cmp-frame",style:{width:f*v,height:h*v},children:v>0&&s.jsx("iframe",{title:l,src:c,style:{width:f,height:h,transform:`scale(${v})`}})}):s.jsx("p",{className:"muted",children:u})})]})}const w0=l=>c=>`/api/chat/run-file?id=${encodeURIComponent(l)}&f=${encodeURIComponent(`screens/${c}`)}`,j0=l=>c=>`/api/history/step-file?id=${encodeURIComponent(l)}&f=${encodeURIComponent(c)}`;function vy({before:l,boards:c,onClose:u,notBefore:f=r.compare.notBefore}){const[h,p]=j.useState(()=>Math.max(0,c.findIndex(S=>S.kind==="changed"))),v=c[h];if(!v)return null;const C=S=>S.split("/").map(encodeURIComponent).join("/");return s.jsx("div",{className:"dialog-backdrop",onPointerDown:S=>S.target===S.currentTarget&&u(),children:s.jsxs("div",{className:"dialog cmp",role:"dialog","aria-modal":"true","aria-label":r.compare.title(v.title),onKeyDown:S=>S.key==="Escape"&&u(),children:[s.jsxs("div",{className:"cmp-head",children:[s.jsx("h2",{children:r.compare.title(v.title)}),s.jsx("button",{className:"icon-btn sm","aria-label":r.compare.close,title:r.compare.close,autoFocus:!0,onClick:u,children:s.jsx(I,{name:"close",size:14})})]}),c.length>1&&s.jsx("div",{className:"chips",role:"tablist","aria-label":r.compare.boards,children:c.map((S,T)=>s.jsx("button",{role:"tab","aria-selected":T===h,className:`chip cmp-tab ${T===h?"on":""}`,onClick:()=>p(T),children:S.kind==="added"?r.chat.chipNew(S.title):S.title},S.file))}),s.jsxs("div",{className:"cmp-panes",children:[s.jsx(Gp,{label:r.compare.before,src:v.kind==="added"?null:l(v.file),empty:f,w:v.w,h:v.h},`b-${v.file}`),s.jsx(Gp,{label:r.compare.after,src:v.kind==="removed"?null:`/screens/${C(v.file)}`,empty:r.compare.notAfter,w:v.w,h:v.h},`a-${v.file}`)]})]})})}const S0=/^ {0,3}(`{3,}|~{3,})\s*([\w#+.-]*)/,N0=/^ {0,3}(#{1,6})\s+(.*?)\s*#*\s*$/,oc=/^(\s*)([-*+]|\d{1,9}[.)])\s+(.*)$/,T0=/^ {0,3}([-*_])(\s*\1){2,}\s*$/,C0=l=>/^https?:\/\/[^\s<>"]+$/i.test(l)?l:null;function E0(l){const c=String(l??"").replace(/\r\n?/g,`
54
+ `).split(`
55
+ `),u=[];let f=[];const h=()=>{f.length&&u.push({t:"p",c:ts(f.join(`
56
+ `))}),f=[]};for(let p=0;p<c.length;p++){const v=c[p],C=S0.exec(v);if(C){h();const T=C[1],y=[];let b=!0;for(p++;p<c.length;p++){if(new RegExp(`^ {0,3}${T[0]==="`"?"`":"~"}{${T.length},}\\s*$`).test(c[p])){b=!1;break}y.push(c[p])}u.push({t:"code",lang:C[2]??"",v:y.join(`
57
+ `),open:b});continue}if(!v.trim()){h();continue}const S=N0.exec(v);if(S){h(),u.push({t:"h",level:S[1].length,c:ts(S[2])});continue}if(T0.test(v)&&!f.length){u.push({t:"hr"});continue}if(oc.test(v)&&(!f.length||!/^\s/.test(v))){h(),p=M0(c,p,u)-1;continue}f.push(v.trim())}return h(),u}const lc=l=>/\d/.test(l)?"ol":"ul";function M0(l,c,u){var S;const f=oc.exec(l[c]),h=f[1].length,p={t:lc(f[2]),start:lc(f[2])==="ol"?parseInt(f[2],10):1,items:[]},v=[],C=[];for(;c<l.length;c++){const T=l[c];if(!T.trim()){const k=l.slice(c+1).find(R=>R.trim());if(k&&oc.test(k)&&oc.exec(k)[1].length>=h)continue;break}const y=oc.exec(T);if(y&&y[1].length<=h+1){if(lc(y[2])!==p.t)break;p.items.push({c:[]}),v.push([y[3]]),C.push({list:{t:"ul",start:1,items:[]},texts:[]});continue}if(!p.items.length)break;const b=C[C.length-1];if(y){b.list.items.length||(b.list={t:lc(y[2]),start:lc(y[2])==="ol"?parseInt(y[2],10):1,items:[]}),b.list.items.push({c:[]}),b.texts.push([y[3]]);continue}if(!/^\s/.test(T)&&!((S=l[c-1])!=null&&S.trim()))break;(b.texts.length?b.texts[b.texts.length-1]:v[v.length-1]).push(T.trim())}return p.items.forEach((T,y)=>{T.c=ts(v[y].join(`
58
+ `));const b=C[y];b.list.items.length&&(b.list.items.forEach((k,R)=>k.c=ts(b.texts[R].join(`
59
+ `))),T.sub=b.list)}),u.push(p),c}function ts(l){const c=[];let u="";const f=p=>{u&&c.push({t:"text",v:u}),u="",c.push(p)};let h=0;for(;h<l.length;){const p=l[h];if(p==="\\"&&h+1<l.length&&/[\\`*_[\]()#+\-.!>~|]/.test(l[h+1])){u+=l[h+1],h+=2;continue}if(p===`
60
+ `){f({t:"br"}),h++;continue}if(p==="`"){let v=1;for(;l[h+v]==="`";)v++;const C="`".repeat(v),S=l.indexOf(C,h+v);if(S>h){const T=l.slice(h+v,S);f({t:"code",v:T.length>2&&T.startsWith(" ")&&T.endsWith(" ")?T.slice(1,-1):T}),h=S+v;continue}u+=C,h+=v;continue}if((p==="*"||p==="_")&&l[h+1]===p){const v=l.indexOf(p+p,h+2);if(v>h+2&&l[h+2]!==" "){f({t:"b",c:ts(l.slice(h+2,v))}),h=v+2;continue}}else if(p==="*"||p==="_"){const v=p==="*"||!/\w/.test(l[h-1]??"");let C=-1;for(let S=h+1;S<l.length;S++)if(l[S]===p&&l[S+1]!==p&&l[S-1]!==" "&&(p==="*"||!/\w/.test(l[S+1]??""))){C=S;break}if(v&&C>h+1&&l[h+1]!==" "&&!l.slice(h+1,C).includes(`
61
+ `)){f({t:"i",c:ts(l.slice(h+1,C))}),h=C+1;continue}}if(p==="["){const v=/^\[([^\]\n]*)\]\(([^)\s]*)\)/.exec(l.slice(h));if(v){const C=C0(v[2]),S=ts(v[1]);if(C)f({t:"a",href:C,c:S});else for(const T of S)T.t==="text"?u+=T.v:f(T);h+=v[0].length;continue}}if((p==="h"||p==="H")&&!/\w/.test(l[h-1]??"")){const v=/^https?:\/\/[^\s<>"`]+/i.exec(l.slice(h));if(v){const C=v[0].replace(/[.,;:!?)\]'"]+$/,"");f({t:"a",href:C,c:[{t:"text",v:C}]}),h+=C.length;continue}}u+=p,h++}return u&&c.push({t:"text",v:u}),c}function Fs({c:l}){return s.jsx(s.Fragment,{children:l.map((c,u)=>c.t==="text"?c.v:c.t==="code"?s.jsx("code",{className:c.v.length>24?"long":void 0,children:c.v},u):c.t==="b"?s.jsx("strong",{children:s.jsx(Fs,{c:c.c})},u):c.t==="i"?s.jsx("em",{children:s.jsx(Fs,{c:c.c})},u):c.t==="a"?s.jsx("a",{href:c.href,target:"_blank",rel:"noopener noreferrer",children:s.jsx(Fs,{c:c.c})},u):s.jsx("br",{},u))})}function by({list:l}){const c=l.items.map((u,f)=>s.jsxs("li",{children:[s.jsx(Fs,{c:u.c}),u.sub&&s.jsx(by,{list:u.sub})]},f));return l.t==="ol"?s.jsx("ol",{start:l.start,children:c}):s.jsx("ul",{children:c})}function k0({v:l}){const[c,u]=j.useState(!1);return s.jsxs("div",{className:"codeblock",children:[s.jsxs("button",{className:"copy",onClick:()=>{var f;return void((f=navigator.clipboard)==null?void 0:f.writeText(l).then(()=>{u(!0),window.setTimeout(()=>u(!1),1500)}))},children:[s.jsx(I,{name:"copy",size:12})," ",c?r.chat.copied:r.chat.copy]}),s.jsx("pre",{children:s.jsx("code",{children:l})})]})}const z0=({b:l})=>l.t==="p"?s.jsx("p",{children:s.jsx(Fs,{c:l.c})}):l.t==="h"?s.jsx("p",{className:`md-h h${Math.min(l.level,3)}`,role:"heading","aria-level":l.level,children:s.jsx(Fs,{c:l.c})}):l.t==="code"?s.jsx(k0,{v:l.v}):l.t==="hr"?s.jsx("hr",{}):s.jsx(by,{list:l});function A0({text:l,className:c=""}){const u=j.useMemo(()=>E0(l),[l]);return s.jsx("div",{className:`md ${c}`,children:u.map((f,h)=>s.jsx(z0,{b:f},h))})}const xy=j.createContext(()=>{}),wy=()=>j.useContext(xy);function O0({children:l}){const[c,u]=j.useState([]),f=j.useCallback(h=>{const p=Date.now()+Math.random();u(v=>[...v.slice(-3),{...h,id:p}]),setTimeout(()=>u(v=>v.filter(C=>C.id!==p)),h.ms??(h.tone==="error"?6e3:3200))},[]);return s.jsxs(xy.Provider,{value:f,children:[l,s.jsx("div",{className:"toasts",role:"status","aria-live":"polite",children:c.map(h=>s.jsxs("div",{className:`toast ${h.tone??"info"}`,children:[h.tone==="error"?s.jsx(I,{name:"warn"}):h.tone==="ok"?s.jsx(I,{name:"check"}):null,h.dot&&s.jsx("span",{className:"toast-dot","aria-hidden":"true"}),s.jsx("span",{children:h.text}),h.code&&s.jsx("code",{className:"toast-code",children:h.code}),h.action&&s.jsx("button",{className:"toast-action",onClick:()=>{h.action.run(),u(p=>p.filter(v=>v.id!==h.id))},children:h.action.label}),h.close&&s.jsx("button",{className:"icon-btn oc-ib toast-close","aria-label":h.close.label,title:h.close.label,onClick:()=>{var p,v;(v=(p=h.close).run)==null||v.call(p),u(C=>C.filter(S=>S.id!==h.id))},children:s.jsx(I,{name:"close",size:16})})]},h.id))})]})}function D0({menu:l,onClose:c,head:u}){const f=j.useRef(null),[h,p]=j.useState({x:0,y:0}),[v,C]=j.useState(-1);if(j.useLayoutEffect(()=>{if(!l||!f.current)return;const y=f.current.getBoundingClientRect(),b=l.right?l.x-y.width:l.x,k=l.up?l.y-y.height:l.y;p({x:Math.round(Math.max(8,Math.min(b,window.innerWidth-y.width-8))),y:Math.round(Math.max(8,Math.min(k,window.innerHeight-y.height-8)))}),C(-1),f.current.focus()},[l]),j.useEffect(()=>{if(!l)return;const y=b=>{f.current&&b.target instanceof Node&&f.current.contains(b.target)||c()};return window.addEventListener("pointerdown",y,!0),window.addEventListener("blur",c),()=>{window.removeEventListener("pointerdown",y,!0),window.removeEventListener("blur",c)}},[l,c]),!l)return null;const S=l.items,T=S.map((y,b)=>y!=="sep"&&!y.disabled?b:-1).filter(y=>y>=0);return s.jsxs("div",{ref:f,className:`menu entering ${l.className??""}`,role:"menu",tabIndex:-1,"aria-label":l.title??r.dialog.menu,style:{left:h.x,top:h.y},onKeyDown:y=>{if(y.key==="Escape")c();else if(y.key==="ArrowDown"||y.key==="ArrowUp"){y.preventDefault();const b=T.indexOf(v),k=y.key==="ArrowDown"?T[(b+1)%T.length]:T[(b-1+T.length)%T.length];C(k)}else if(y.key==="Enter"&&v>=0){const b=S[v];b!=="sep"&&(c(),b.run())}},children:[l.title&&s.jsx("div",{className:"menu-title",children:l.title}),u??l.head,S.map((y,b)=>y==="sep"?s.jsx("div",{className:"menu-sep",role:"separator"},b):s.jsxs("button",{role:y.check===void 0?"menuitem":"menuitemcheckbox","aria-checked":y.check===void 0?void 0:y.check,className:`menu-item ${v===b?"active":""} ${y.danger?"danger":""}`,disabled:y.disabled,onMouseEnter:()=>C(b),onClick:()=>{c(),y.run()},children:[s.jsx("span",{className:"menu-icon",children:y.icon&&s.jsx(I,{name:y.icon,size:16})}),s.jsx("span",{className:"menu-label",children:y.label}),y.check!==void 0&&s.jsx("span",{className:`menu-check ${y.check?"on":""}`,"aria-hidden":"true",children:s.jsx(I,{name:"check",size:14})}),y.shortcut&&s.jsx("kbd",{children:y.shortcut})]},b))]})}function R0({state:l,onClose:c}){const[u,f]=j.useState(""),[h,p]=j.useState(!1),v=j.useRef(null),C=j.useRef(null);if(j.useEffect(()=>{var y;l&&(l.kind==="prompt"?(f(l.value),p(((y=l.extra)==null?void 0:y.checked)??!1),setTimeout(()=>{var b;return(b=v.current)==null?void 0:b.select()},0)):setTimeout(()=>{var b;return(b=C.current)==null?void 0:b.focus()},0))},[l]),!l)return null;const S=()=>{l.kind==="prompt"?l.resolve(null):l.resolve(!1),c()},T=()=>{l.kind==="prompt"?l.resolve({value:u,extra:h}):l.resolve(!0),c()};return s.jsx("div",{className:"dialog-backdrop",onPointerDown:y=>y.target===y.currentTarget&&S(),children:s.jsxs("div",{className:"dialog",role:"dialog","aria-modal":"true","aria-label":l.title,onKeyDown:y=>{y.key==="Escape"&&S(),y.key==="Enter"&&!y.nativeEvent.isComposing&&T()},children:[s.jsx("h2",{children:l.title}),l.kind==="prompt"?s.jsxs(s.Fragment,{children:[s.jsxs("label",{className:"dialog-field",children:[l.label&&s.jsx("span",{children:l.label}),s.jsx("input",{ref:v,value:u,onChange:y=>f(y.target.value)})]}),l.hint&&s.jsx("p",{className:"muted",children:l.hint}),l.extra&&s.jsxs("label",{className:"check",children:[s.jsx("input",{type:"checkbox",checked:h,onChange:y=>p(y.target.checked)}),l.extra.label]})]}):s.jsx("p",{children:l.body}),s.jsxs("div",{className:"dialog-actions",children:[s.jsx("button",{onClick:S,children:r.dialog.cancel}),s.jsx("button",{ref:C,className:l.kind==="confirm"&&l.danger?"danger primary":"primary",onClick:T,children:l.ok})]})]})})}function _0(){const[l,c]=j.useState(null);return{state:l,close:()=>c(null),prompt:h=>new Promise(p=>c({kind:"prompt",value:h.value??"",ok:h.ok??r.dialog.ok,...h,resolve:p})),confirm:h=>new Promise(p=>c({kind:"confirm",ok:h.ok??r.dialog.ok,...h,resolve:p}))}}const qp=l=>`design-canvas:open:${l}`;function Qs({id:l,title:c,count:u,defaultOpen:f=!1,right:h,variant:p="head",children:v}){const[C,S]=j.useState(()=>{try{const k=localStorage.getItem(qp(l));return k==null?f:k==="1"}catch{return f}}),T=()=>{S(k=>{try{localStorage.setItem(qp(l),k?"0":"1")}catch{}return!k})},b=u!==void 0&&u!==""&&s.jsx("span",{className:`collapsible-count ${typeof u=="string"?"oc-off":""}`,children:u});return p==="row"?s.jsxs("div",{className:`pp-foldset ${C?"open":""}`,children:[s.jsxs("button",{className:"pp-fold","aria-expanded":C,"aria-controls":`sec-${l}`,onClick:T,children:[s.jsx("span",{className:"pp-l",children:c}),s.jsxs("span",{className:"pp-v",children:[b,s.jsx(I,{name:"chevronRight",size:14,className:"chev"})]})]}),C&&s.jsx("div",{className:"pp-fold-body",id:`sec-${l}`,children:v})]}):s.jsxs("section",{className:`pp-group collapsible ${C?"open":""}`,children:[s.jsxs("div",{className:"collapsible-head",children:[s.jsxs("button",{className:"pp-fold-h","aria-expanded":C,"aria-controls":`sec-${l}`,onClick:T,children:[s.jsx(I,{name:"chevronRight",size:14,className:"chev"}),s.jsx("span",{className:"collapsible-title",children:c}),b]}),h&&s.jsx("span",{className:"collapsible-right",children:h})]}),C&&s.jsx("div",{className:"pp-fold-body",id:`sec-${l}`,children:v})]})}function Ul(l,c="button"){if(l)for(const u of Array.from(l.querySelectorAll(c))){u.style.width="";const f=u.getBoundingClientRect().width;f%1>.01&&(u.style.width=`${Math.ceil(f)}px`)}}function jy(l,c){const[u,f]=j.useState(null);return j.useLayoutEffect(()=>{const h=l.current;if(!h)return;Ul(h);const p=Math.max(8,Math.round((c-h.offsetWidth)/2));p!==u&&f(p)}),u}const Js={claude:"Claude Code",codex:"Codex",cursor:"Cursor Agent",gemini:"Gemini CLI"},B0=Object.entries(Js).map(([l,c])=>({id:l,label:c,ok:!0})),U0={claude:"claude",codex:"codex",cursor:"cursor-agent",gemini:"gemini"},Xp={claude:"claude auth login",codex:"codex login",cursor:"cursor-agent login",gemini:"gemini"},H0={claude:"npm install -g @anthropic-ai/claude-code",codex:"npm install -g @openai/codex",cursor:"curl https://cursor.com/install -fsS | bash",gemini:"npm install -g @google/gemini-cli"},$0={claude:["opus","sonnet","haiku"],codex:[],cursor:[],gemini:["gemini-2.5-pro","gemini-2.5-flash"]},Zr={changed:0,added:1,removed:2},L0=l=>Js[l]?`var(--agent-${l})`:"var(--line-strong)",Vp=(l,c)=>{try{const u=localStorage.getItem(l);return u==null?c:JSON.parse(u)}catch{return c}},Kp=(l,c)=>{try{localStorage.setItem(l,JSON.stringify(c))}catch{}},Zp=l=>new Date(l).toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit"}),Qp=l=>new Date(l).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}),Y0=l=>(l.split(/[\\/]/).filter(Boolean).pop()??l)+"/";function Bf({text:l}){return s.jsx(s.Fragment,{children:l.split("`").map((c,u)=>u%2?s.jsx("code",{children:c},u):c)})}function Uf(l,c){const u=[...l.parts],f=u[u.length-1],h={...l};if(c.kind==="delta")(f==null?void 0:f.t)==="text"?u[u.length-1]={t:"text",text:f.text+c.text}:u.push({t:"text",text:c.text});else if(c.kind==="break")(f==null?void 0:f.t)==="text"&&f.text&&u.push({t:"text",text:""});else if(c.kind==="text")u.push({t:"text",text:c.text});else if(c.kind==="plain")(f==null?void 0:f.t)==="plain"?u[u.length-1]={t:"plain",text:`${f.text}
62
+ ${c.text}`}:u.push({t:"plain",text:c.text});else if(c.kind==="tool")u.push({t:"tool",name:c.name,detail:c.detail});else if(c.kind==="permission"){const{kind:p,...v}=c,C=u.findIndex(S=>S.t==="perm"&&S.id===c.id);C>=0?u[C]={...u[C],...v}:u.push({t:"perm",...v})}else if(c.kind==="permission-answered"){const p=u.findIndex(v=>v.t==="perm"&&v.id===c.id);p>=0&&(u[p]={...u[p],decision:c.decision})}else if(c.kind==="error"&&c.cause){for(let p=u.length-1;p>=0;p--)u[p].t==="error"&&u.splice(p,1);u.push({t:"error",text:c.text,cause:c.cause,raw:c.raw,changed:c.changed})}else c.kind==="error"?u.push({t:"error",text:c.text}):c.kind==="done"?h.cost=c.cost:c.kind==="start"?h.variants=c.variants:c.kind==="run-undo"?h.undone=c.undone:c.kind==="end"&&(h.status=c.status,h.step=c.step,h.boards=c.boards);return h.parts=u.filter(p=>p.t!=="text"&&p.t!=="plain"||p.text),h}function G0(l){const[c,u]=j.useState([]),[f,h]=j.useState(!1),[p,v]=j.useState(null),[C,S]=j.useState(!1),[T,y]=j.useState(null),[b,k]=j.useState(!1),[R,B]=j.useState(()=>Vp("design-canvas:models",{})),[X,N]=j.useState(!1),[_,W]=j.useState(null),[ne,J]=j.useState(()=>{try{return localStorage.getItem("design-canvas:agent")??"claude"}catch{return"claude"}}),[ce,le]=j.useState([]),[oe,F]=j.useState(null),[re,we]=j.useState({}),[Te,st]=j.useState(!0),[Ot,Dt]=j.useState(!0),[tt,ue]=j.useState(!0),[me,be]=j.useState(1),[je,Ce]=j.useState(null),[ot,Et]=j.useState(null),[Me,U]=j.useState(null),[E,Y]=j.useState(null),[A,ie]=j.useState(!1),[se,ge]=j.useState({}),[ae,de]=j.useState(null),[Ae,Ve]=j.useState(null),[ft,Rt]=j.useState(null),[Ee,Re]=j.useState(null),at=j.useRef(null),ct=j.useRef(null),ht=j.useRef(null),un=j.useRef(null),Sl=j.useRef(null),Nl=j.useRef(null);Nl.current=oe;const sa=j.useRef(new Map),Un=l.storeKey?`easel:chat:${l.storeKey}`:null,sl=j.useRef(0),Hl=j.useCallback((z=!1)=>{h(!0);const $=++sl.current;Ne.get("/api/agents").then(ve=>{$===sl.current&&(u(ve.agents),v({at:ve.checkedAt,onOpen:z}))}).catch(()=>{}).finally(()=>$===sl.current&&h(!1))},[]);j.useEffect(()=>{l.open&&Hl(!0)},[l.open,Hl]),j.useEffect(()=>{try{localStorage.setItem("design-canvas:agent",ne)}catch{}},[ne]),j.useEffect(()=>Kp("design-canvas:models",R),[R]),j.useEffect(()=>{if(!C)return;const z=ve=>{const fe=ke=>ke.current&&ve.target instanceof Node&&ke.current.contains(ve.target);fe(ht)||fe(un)||S(!1)},$=()=>S(!1);return window.addEventListener("pointerdown",z,!0),window.addEventListener("resize",$),()=>{window.removeEventListener("pointerdown",z,!0),window.removeEventListener("resize",$)}},[C]),j.useEffect(()=>{var z,$;C&&(($=(z=un.current)==null?void 0:z.querySelector('[aria-checked="true"], [role^="menuitem"]'))==null||$.focus())},[C]);const wn=()=>{var z,$;S(!1),($=(z=ht.current)==null?void 0:z.querySelector(".agent-btn"))==null||$.focus()},vi=z=>{if(z.key==="Escape")return wn();if(z.key!=="Tab"||!un.current)return;const $=Array.from(un.current.querySelectorAll("button:not(:disabled), a[href]"));z.target===$[z.shiftKey?0:$.length-1]&&(z.preventDefault(),wn())},Ra=z=>{const $=z.getBoundingClientRect();y({right:Math.round(window.innerWidth-$.right),top:Math.round($.bottom+4)}),S(ve=>!ve)},_a=(z,$)=>{var ve;(ve=navigator.clipboard)==null||ve.writeText($).then(()=>{W(z),window.setTimeout(()=>W(fe=>fe===z?null:fe),1500)})},dn=j.useRef(new Set),Hn=j.useRef(new Map),$l=j.useRef(()=>{});j.useEffect(()=>l.subscribe((z,$)=>{if($.kind==="boot")return U($.boot);if(!dn.current.has(z)){Hn.current.set(z,[...Hn.current.get(z)??[],$]);return}$l.current(z,$)}),[l.subscribe]),$l.current=(z,$)=>{if(le(fe=>fe.map(ke=>ke.role==="ai"&&ke.id===z?Uf(ke,$):ke)),$.kind==="end"&&F(fe=>fe===z?null:fe),$.kind==="session"){const fe=ce.find(ke=>ke.role==="ai"&&ke.id===z);fe&&we(ke=>({...ke,[fe.agent]:$.id}))}$.kind==="error"&&($.cause==="signin"||$.cause==="missing")&&Hl();const ve=sa.current.get(z);$.kind==="end"&&$.status==="error"&&ve&&!l.draft.trim()&&!l.attach.comments.length&&!l.attach.refs.length&&(l.setDraft(ve.text),l.setAttach(()=>ve.attach),N(!0))},j.useEffect(()=>{Ne.get("/api/chat/runs?ids=").then(z=>U($=>$??z.boot)).catch(()=>{})},[]),j.useEffect(()=>{var $;if(!Un||A)return;const z=Vp(Un,null);($=z==null?void 0:z.msgs)!=null&&$.length&&(le(z.msgs),we(z.sessions??{})),Y((z==null?void 0:z.boot)??null),ie(!0)},[Un,A]),j.useEffect(()=>{A&&Un&&Kp(Un,{msgs:ce.slice(-100),sessions:re,boot:Me??E})},[A,Un,ce,re,Me,E]),j.useEffect(()=>{if(!A||!Me)return;const z=!!E&&E!==Me;Y(Me),le(fe=>{if(!z||!fe.length)return fe;const ke=fe.map(Ie=>Ie.role==="ai"&&Ie.status==="running"?{...Ie,status:"cancelled"}:Ie);return ke[ke.length-1].role==="restart"?ke:[...ke,{role:"restart",at:Me}]});const $=ce.filter(fe=>fe.role==="ai");for(const fe of $)fe.status==="running"&&!z&&!dn.current.has(fe.id)&&Ne.get(`/api/chat?id=${encodeURIComponent(fe.id)}`).then(ke=>{dn.current.add(fe.id),le(Ie=>Ie.map(Ue=>Ue.role==="ai"&&Ue.id===fe.id?ke.events.reduce(Uf,{...Ue,parts:[]}):Ue)),ke.events.some(Ie=>Ie.kind==="end")||F(fe.id)});const ve=$.filter(fe=>fe.step).map(fe=>fe.id);ve.length&&Ne.get(`/api/chat/runs?ids=${ve.join(",")}`).then(fe=>ge(ke=>({...ke,...fe.runs}))).catch(()=>{})},[A,Me]),j.useEffect(()=>{const z=at.current;z&&z.scrollHeight-z.scrollTop-z.clientHeight<160&&(z.scrollTop=z.scrollHeight)},[ce]);const Ll=Te?l.selection:null,Tl=Ot?l.boards:[],Wn=Tl.length===1||!Tl.length&&!!Ll,rt=c.length?c:B0,Ze=rt.find(z=>z.id===ne),tn=(Ze==null?void 0:Ze.label)??Js[ne]??ne,Cl=ne.startsWith("custom:"),Yl=R[ne]??"",ol=(Ze==null?void 0:Ze.status)==="signin"?r.chat.sendNeedsSignin(tn):(Ze==null?void 0:Ze.status)==="missing"?r.chat.sendNeedsInstall(tn):null,Mt=ce.find(z=>z.role==="ai"&&z.id===oe),Gl=!!(Mt!=null&&Mt.parts.some(z=>z.t==="perm"&&!z.decision)),oa=async(z=l.draft.trim(),$=l.attach)=>{if(!z||oe||ol)return;Et(null);const ve=[...Ll?[r.chat.chipElement(Ll.tag)]:[],...Tl.map(fe=>l.titleOf(fe)),...tt&&l.visibleCount?[r.chat.chipVisible(l.visibleCount)]:[],...$.comments.map(fe=>r.chat.chipComment(fe.text.slice(0,16))),...$.refs.map(fe=>fe.name??fe.value),...me>1?[r.chat.variants(me)]:[]];try{const fe=await Ne.post("/api/chat",{agent:ne,text:z,model:Cl?void 0:Yl.trim()||void 0,resume:re[ne],variants:Wn?me:0,attach:{selection:!!Ll,boards:Tl,visible:tt,comments:$.comments.map(ke=>ke.id),refs:$.refs}});sa.current.set(fe.id,{text:z,attach:$}),N(!1),le(ke=>[...ke,{role:"user",text:z,chips:ve},{role:"ai",id:fe.id,agent:ne,label:tn,parts:[],status:"running",boot:Me??void 0}]),F(fe.id),dn.current.add(fe.id);for(const ke of Hn.current.get(fe.id)??[])$l.current(fe.id,ke);Hn.current.delete(fe.id),l.setDraft(""),l.setAttach(()=>({comments:[],refs:[]})),be(1),fe.variants.length&&l.onLocate(fe.variants)}catch(fe){Et(fe.message)}},cl=()=>oe&&Ne.post("/api/chat/cancel",{id:oe}).catch(()=>{}),Vt=z=>{const $=sa.current.get(z);l.draft.trim()||!$?oa():oa($.text,$.attach)},jn=(z,$)=>le(ve=>ve.map(fe=>fe.role==="ai"&&fe.id===z?$(fe):fe)),Ut=(z,$,ve)=>{jn(z,fe=>Uf(fe,{kind:"permission-answered",id:$,decision:ve})),Ne.post("/api/chat/permission/answer",{id:$,decision:ve}).catch(fe=>Et(fe.message))},ca=async(z,$,ve)=>{var fe;Ve(z);try{await Ne.post(`/api/chat/${$}-run`,{id:z,mode:ve}),de(null),jn(z,ke=>({...ke,undone:$==="undo"}))}catch(ke){const Ie=ke;Ie.status===409&&((fe=Ie.body)!=null&&fe.conflicts)?de({id:z,kind:$,names:[...new Set(Ie.body.conflicts.map(Ue=>Ue.file.endsWith(".html")?l.titleOf(Ue.file):Ue.file))]}):Et(Ie.message)}finally{Ve(null)}},bi=async(z,$)=>{if(await l.confirm({title:r.chat.restoreTitle,body:r.chat.restoreBody(Qp($)),ok:r.chat.restoreOk,danger:!0}))try{await Ne.post("/api/chat/revert",{id:z.id}),jn(z.id,ve=>({...ve,restored:!0}))}catch(ve){Et(ve.message)}},ns=z=>Rt({id:z.id,boards:[...z.boards??[]].sort(($,ve)=>Zr[$.kind]-Zr[ve.kind]).map($=>({...$,title:l.titleOf($.file),...l.sizeOf($.file)??{w:390,h:844}}))}),ql=async()=>{if(Ee)try{const z=await Ne.post("/api/agents/custom",{name:Ee.name,command:Ee.command});u($=>[...$.filter(ve=>ve.id!==z.agent.id),z.agent]),J(z.agent.id),Re(null)}catch(z){Re($=>$&&{...$,error:z.message})}},ra=async z=>{await Ne.post("/api/agents/custom",{action:"delete",id:z}).catch(()=>{}),u($=>$.filter(ve=>ve.id!==z)),ne===z&&J("claude")},kn=z=>z.status?r.chat.agentStatus[z.status]:f?r.chat.checking:"",zn=(Ze==null?void 0:Ze.status)==="signin"?{text:r.chat.remedySignin(tn,Xp[ne]??`${ne} login`),cmd:Xp[ne]??`${ne} login`}:(Ze==null?void 0:Ze.status)==="missing"?{text:r.chat.remedyMissing(Cl?(Ze.command??"").split(/\s+/)[0]:U0[ne]??ne),cmd:Cl?null:H0[ne]??ne}:null,$n=async z=>{for(const $ of Array.from(z)){if($.size>15*1024*1024){Et(r.chat.tooBig($.name));continue}const ve=await new Promise(fe=>{const ke=new FileReader;ke.onload=()=>fe(String(ke.result).split(",")[1]??""),ke.readAsDataURL($)});try{const fe=await Ne.post("/api/refs",{name:$.name||r.defaults.pastedImage,data:ve});l.setAttach(ke=>({...ke,refs:[...ke.refs,fe]}))}catch(fe){Et(fe.message)}}},In=z=>{const $=[...z.boards??[]].sort((He,_t)=>Zr[He.kind]-Zr[_t.kind]),ve=$.filter(He=>He.kind!=="added").length,fe=$.filter(He=>He.kind==="added").length,ke=r.chat.runChanged(ve,fe),Ie=!!Me&&!!z.boot&&z.boot!==Me,Ue=se[z.id],Ye=(ae==null?void 0:ae.id)===z.id?ae:null;if(z.restored)return s.jsx("div",{className:"run-result undone",children:s.jsx("div",{className:"oc-rr-top",children:s.jsxs("span",{className:"rr-line",children:[s.jsx(I,{name:"restore",size:14})," ",r.chat.restoredCopy]})})});if(Ie)return s.jsxs("div",{className:"run-result",children:[s.jsx("div",{className:"oc-rr-top",children:s.jsx("span",{className:"rr-line",children:ke})}),Ue===void 0?null:Ue.copy?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"btn-row",children:s.jsxs("button",{className:"btn",onClick:()=>void bi(z,Ue.copy.at),children:[s.jsx(I,{name:"restore",size:14})," ",r.chat.restoreCopy]})}),s.jsx("p",{className:"sub",children:r.chat.savedAt(Qp(Ue.copy.at))})]}):s.jsx("p",{className:"sub",children:r.chat.copyGone})]});const fn=Ye&&s.jsxs("div",{className:"rr-conflict",role:"alert",children:[s.jsx("p",{children:(Ye.kind==="undo"?r.chat.conflictUndo:r.chat.conflictRedo)(Ye.names.join(", "))}),s.jsxs("div",{className:"btn-row",children:[s.jsx("button",{className:"btn",onClick:()=>void ca(z.id,Ye.kind,"rest"),children:Ye.kind==="undo"?r.chat.undoRest:r.chat.redoRest}),s.jsx("button",{className:"btn danger",onClick:()=>void ca(z.id,Ye.kind,"all"),children:Ye.kind==="undo"?r.chat.undoAll:r.chat.redoAll}),s.jsx("button",{className:"btn",onClick:()=>de(null),children:r.chat.cancel})]})]});return z.undone?s.jsxs("div",{className:"run-result undone",children:[s.jsx("div",{className:"oc-rr-top",children:s.jsxs("span",{className:"rr-line",children:[s.jsx(I,{name:"undo",size:14})," ",r.chat.runUndone($.length)]})}),s.jsx("div",{className:"btn-row",children:s.jsxs("button",{className:"btn",disabled:Ae===z.id||!!oe,onClick:()=>void ca(z.id,"redo"),children:[s.jsx(I,{name:"redo",size:14})," ",r.chat.redo]})}),fn]}):s.jsxs("div",{className:"run-result",children:[s.jsxs("div",{className:"oc-rr-top",children:[s.jsx("span",{className:"rr-line",children:ke}),$.map(He=>He.kind==="removed"?s.jsxs("span",{className:"chip",children:[s.jsx(I,{name:"board",size:12})," ",r.chat.chipRemoved(l.titleOf(He.file))]},He.file):s.jsxs("button",{className:"chip",title:He.file,onClick:()=>l.onLocate([He.file]),children:[s.jsx(I,{name:"board",size:12})," ",He.kind==="added"?r.chat.chipNew(l.titleOf(He.file)):l.titleOf(He.file)]},He.file))]}),s.jsxs("div",{className:"btn-row",children:[s.jsxs("button",{className:"btn",disabled:Ae===z.id||!!oe,onClick:()=>void ca(z.id,"undo"),children:[s.jsx(I,{name:"undo",size:14})," ",r.chat.undoRun]}),$.length>0&&s.jsxs("button",{className:"btn",onClick:()=>ns(z),children:[s.jsx(I,{name:"compare",size:14})," ",r.chat.compare]})]}),fn]})},ua=(z,$)=>$.decision?s.jsxs("div",{className:"perm-done",title:$.subject,children:[s.jsx(I,{name:$.decision==="deny"?"close":"check",size:14,className:$.decision==="deny"?"no":"ok"}),s.jsxs("span",{children:[r.chat.permDone[$.decision]," · ",$.tool," ",$.what==="tool"?null:s.jsx("code",{children:$.subject}),$.outside?` ${r.chat.permDoneOutside}`:""]})]}):s.jsxs("div",{className:"perm",role:"group","aria-label":r.chat.permAsk(z.label??Js[z.agent]??z.agent,$.what,$.tool),children:[s.jsxs("div",{className:"perm-head",children:[s.jsx("span",{className:"idot","aria-hidden":"true"}),r.chat.permAsk(z.label??Js[z.agent]??z.agent,$.what,$.tool)]}),s.jsx("div",{className:"perm-cmd",children:$.subject}),s.jsxs("div",{className:"perm-where",title:$.where,children:[s.jsx(I,{name:"folder",size:14})," ",r.chat.permIn," ",s.jsx("code",{children:Y0($.where)}),$.outside&&s.jsxs("span",{className:"perm-outside",children:["· ",r.chat.permOutside]})]}),s.jsxs("div",{className:`btn-row ${$.rule?"":"oc-one"}`,children:[s.jsx("button",{className:"btn primary",onClick:()=>Ut(z.id,$.id,"once"),children:r.chat.allowOnce}),$.rule&&s.jsx("button",{className:"btn",title:r.chat.alwaysAllowTitle,onClick:()=>Ut(z.id,$.id,"always"),children:r.chat.alwaysAllow($.rule)}),s.jsx("button",{className:"btn",onClick:()=>Ut(z.id,$.id,"deny"),children:r.chat.deny})]})]}),ut=ce.map(z=>z.role==="ai"?`${z.status}${z.undone?"u":""}${z.restored?"r":""}${z.parts.length}`:z.role).join(),Ln=j.useCallback(()=>{Ul(Sl.current,".chat-head .new-chat, .rr-line, .chip, .bubble, .btn-row .btn, .oc-variants, .run-status > *"),Ul(un.current,".agent-status, .menu-foot .btn")},[]);j.useLayoutEffect(Ln,[Ln,ut,oe,ne,C,l.open,l.attach,l.selection,l.boards,l.visibleCount,_,se,ae,f,c,Te,Ot,tt]),j.useEffect(()=>{const z=Sl.current;if(!z)return;const $=new ResizeObserver(Ln);return $.observe(z),()=>$.disconnect()},[Ln]);const xi=(z,$)=>{const ve=[];let fe=[],ke=0;const Ie=()=>{fe.length&&ve.push(s.jsx("div",{className:"oc-tools",children:fe},`t${ke}`)),fe=[]};return z.parts.forEach((Ue,Ye)=>{if(Ue.t==="tool"||Ue.t==="perm"&&Ue.decision){fe.length||(ke=Ye);const fn=z.status==="running"&&Ye===z.parts.length-1;fe.push(Ue.t==="tool"?s.jsxs("div",{className:`ai-tool ${fn?"is-current":""}`,children:[s.jsx(I,{name:"edit",size:14}),s.jsx("span",{children:Ue.name}),Ue.detail&&s.jsx("code",{children:Ue.detail})]},Ye):s.jsx(j.Fragment,{children:ua(z,Ue)},Ye));return}Ie(),ve.push(Ue.t==="text"?s.jsx(A0,{className:"ai-text",text:Ue.text},Ye):Ue.t==="plain"?s.jsx("pre",{className:"ai-plain",children:Ue.text},Ye):Ue.t==="perm"?s.jsx(j.Fragment,{children:ua(z,Ue)},Ye):Ue.cause?s.jsxs("div",{className:"ai-fail",children:[s.jsx("div",{className:"ai-error",children:s.jsx("span",{children:s.jsx(Bf,{text:Ue.text})})}),$&&s.jsxs("div",{className:"btn-row",children:[s.jsx("button",{className:"btn",disabled:!!oe||!!ol,title:ol??void 0,onClick:()=>Vt(z.id),children:r.chat.retry}),(()=>{const fn=rt.find(He=>He.id!==z.agent&&He.status!=="missing"&&He.ok&&!He.custom);return fn&&fn.id!==ne?s.jsx("button",{className:"btn",onClick:()=>J(fn.id),children:r.chat.switchTo(fn.label)}):null})()]}),Ue.raw&&s.jsxs("details",{className:"ai-details",children:[s.jsxs("summary",{children:[s.jsx(I,{name:"chevronDown",size:14}),r.chat.details]}),s.jsx("div",{className:"ai-details-bar",children:s.jsxs("button",{className:"btn copy",onClick:()=>_a(`raw-${z.id}`,Ue.raw),children:[s.jsx(I,{name:"copy",size:12})," ",_===`raw-${z.id}`?r.chat.copied:r.chat.copy]})}),s.jsx("pre",{children:Ue.raw})]}),Ue.changed===!1&&s.jsx("p",{className:"muted small",children:r.chat.noFilesChanged})]},Ye):s.jsxs("div",{className:"ai-error",children:[s.jsx(I,{name:"warn",size:14})," ",Ue.text]},Ye))}),Ie(),ve};return s.jsxs("section",{className:"chat","aria-label":r.chat.aria,ref:Sl,children:[s.jsxs("div",{className:`chat-head ${b?"is-scrolled":""}`,children:[s.jsxs("div",{className:"chat-head-row oc-field",children:[s.jsx("span",{className:"pp-l",children:r.chat.agent}),s.jsx("div",{className:"agent-pick",ref:ht,children:s.jsxs("button",{className:`agent-btn ${C?"is-open":""}`,"aria-haspopup":"menu","aria-expanded":C,"aria-label":r.chat.agentButton(tn,Ze?kn(Ze):""),title:r.chat.agentHint,disabled:!!oe,onClick:z=>Ra(z.currentTarget),onKeyDown:z=>z.key==="Escape"&&S(!1),children:[s.jsx("span",{className:`dot ${(Ze==null?void 0:Ze.status)??""}`,"aria-hidden":"true"}),s.jsx("span",{className:"agent-name",children:tn}),s.jsx(I,{name:"chevronDown",size:14})]})})]}),s.jsxs("div",{className:"chat-head-row oc-field",children:[s.jsx("span",{className:"pp-l",children:Cl?r.chat.customCommandLabel:r.chat.model}),Cl?s.jsx("span",{className:"model-field mono custom-cmd",title:Ze==null?void 0:Ze.command,children:Ze==null?void 0:Ze.command}):s.jsxs(s.Fragment,{children:[s.jsx("input",{className:"model-field",list:`models-${ne}`,value:Yl,placeholder:r.chat.modelDefault,"aria-label":r.chat.model,title:r.chat.modelTitle(tn),disabled:!!oe,spellCheck:!1,onChange:z=>B($=>({...$,[ne]:z.target.value}))}),s.jsx("datalist",{id:`models-${ne}`,children:($0[ne]??[]).map(z=>s.jsx("option",{value:z},z))})]})]}),s.jsxs("div",{className:"chat-head-row sub",children:[s.jsx("span",{className:"muted small",children:oe?r.chat.running:re[ne]?r.chat.continuing:r.chat.newConversation}),s.jsx("div",{className:"spacer"}),s.jsxs("button",{className:"icon-btn sm new-chat","aria-label":r.chat.newChat,title:r.chat.newChat,disabled:!!oe||!ce.length&&!re[ne],onClick:()=>{le([]),we({}),N(!1),de(null),k(!1)},children:[s.jsx(I,{name:"plus",size:14})," ",s.jsx("span",{children:r.chat.newChat})]})]})]}),C&&T&&_f.createPortal(s.jsxs("div",{ref:un,className:"menu agent-menu oc-agent-menu entering",role:"menu","aria-label":r.chat.agent,style:{right:T.right,top:T.top},onKeyDown:vi,children:[rt.map(z=>s.jsxs("div",{className:`menu-item agent-item ${z.status==="missing"?"off":""}`,role:"none",children:[s.jsxs("button",{role:"menuitemradio","aria-checked":z.id===ne,className:"agent-choose",title:z.custom&&z.command?r.chat.customCommandTitle(z.command):void 0,onClick:()=>{J(z.id),S(!1)},children:[s.jsx("span",{className:`menu-check ${z.id===ne?"on":""}`,"aria-hidden":"true",children:s.jsx(I,{name:"check",size:14})}),s.jsx("span",{className:"idot",style:{background:L0(z.id)},"aria-hidden":"true"}),s.jsx("span",{className:"menu-label",children:z.label})]}),s.jsxs("span",{className:`agent-status ${z.status==="missing"?"off":z.status??""}`,children:[z.status&&z.status!=="missing"&&s.jsx("span",{className:`dot ${z.status}`,"aria-hidden":"true"}),kn(z),z.status==="missing"&&z.install&&s.jsxs(s.Fragment,{children:[" · ",s.jsx("a",{className:"link",href:z.install,target:"_blank",rel:"noopener noreferrer",children:r.chat.howToInstall})]})]}),z.custom&&s.jsx("button",{className:"icon-btn sm oc-remove","aria-label":r.chat.remove(z.label),title:r.chat.remove(z.label),onClick:()=>void ra(z.id),children:s.jsx(I,{name:"close",size:12})})]},z.id)),s.jsx("div",{className:"menu-sep",role:"separator"}),s.jsxs("button",{role:"menuitem",className:"menu-item oc-custom",onClick:()=>{S(!1),Re({name:"",command:""})},children:[s.jsx("span",{className:"menu-check on muted","aria-hidden":"true",children:s.jsx(I,{name:"plus",size:14})}),s.jsx("span",{className:"menu-label",children:r.chat.customCommand})]}),s.jsxs("div",{className:"menu-foot",children:[s.jsx("span",{children:f?r.chat.checking:p?r.chat.checkedAt(Zp(p.at),p.onOpen):r.chat.checkedOnOpen}),s.jsx("button",{className:"btn",disabled:f,onClick:()=>Hl(),children:r.chat.checkAgain})]})]}),document.body),Ee&&_f.createPortal(s.jsx("div",{className:"dialog-backdrop",onPointerDown:z=>z.target===z.currentTarget&&Re(null),children:s.jsxs("div",{className:"dialog cf",role:"dialog","aria-modal":"true","aria-label":r.chat.customTitle,onKeyDown:z=>z.key==="Escape"&&Re(null),children:[s.jsxs("h2",{className:"cf-title",children:[s.jsx("span",{className:"idot","aria-hidden":"true"}),r.chat.customTitle]}),s.jsxs("label",{className:"dialog-field",children:[r.chat.customName,s.jsx("input",{autoFocus:!0,value:Ee.name,placeholder:r.chat.customNamePlaceholder,onChange:z=>Re({...Ee,name:z.target.value,error:void 0})})]}),s.jsxs("label",{className:"dialog-field",children:[r.chat.customCommandLabel,s.jsx("input",{className:"mono",value:Ee.command,spellCheck:!1,placeholder:r.chat.customCommandPlaceholder,onChange:z=>Re({...Ee,command:z.target.value,error:void 0}),onKeyDown:z=>z.key==="Enter"&&!z.nativeEvent.isComposing&&void ql()})]}),s.jsx("p",{className:"cf-hint",children:s.jsx(Bf,{text:r.chat.customHint})}),Ee.error&&s.jsxs("p",{className:"cf-error",children:[s.jsx(I,{name:"warn",size:14})," ",Ee.error]}),s.jsxs("div",{className:"dialog-actions",children:[s.jsx("button",{onClick:()=>Re(null),children:r.chat.cancel}),s.jsx("button",{className:"primary",disabled:!Ee.name.trim()||!Ee.command.trim(),onClick:()=>void ql(),children:r.chat.customSave})]})]})}),document.body),s.jsx("div",{className:"chat-list",ref:at,"aria-live":"polite",onScroll:z=>k(z.currentTarget.scrollTop>0),children:ce.length===0?s.jsxs("div",{className:"chat-empty",children:[s.jsx("p",{children:r.chat.intro(tn)}),s.jsx("div",{className:"chat-suggest",children:r.chat.suggestions.map(z=>s.jsx("button",{className:"btn",onClick:()=>{l.setDraft(z.text),be(z.n)},children:z.label},z.label))})]}):ce.map((z,$)=>{var ve;return z.role==="restart"?s.jsx("div",{className:"restart",role:"separator",children:r.chat.restarted(Zp(z.at))},$):z.role==="user"?s.jsxs("div",{className:"msg user",children:[z.chips.length>0&&s.jsx("div",{className:"chips",children:z.chips.map((fe,ke)=>s.jsx("span",{className:"chip",children:fe},ke))}),s.jsx("div",{className:"bubble",children:z.text})]},$):s.jsxs("div",{className:`msg ai ${z.status}`,children:[s.jsxs("div",{className:"msg-head",children:[s.jsx("strong",{children:z.label??Js[z.agent]??z.agent}),z.status==="running"&&(z.parts.some(fe=>fe.t==="perm"&&!fe.decision)?s.jsxs("span",{className:"waiting",children:[s.jsx("span",{className:"pulse","aria-hidden":"true"}),r.chat.waiting]}):s.jsx("span",{className:"spinner",role:"img","aria-label":r.chat.running})),z.status==="cancelled"&&s.jsx("span",{className:"muted",children:r.chat.cancelled}),z.status==="error"&&s.jsxs("span",{className:"oc-failed",children:[s.jsx(I,{name:"warn",size:14}),r.chat.failed]}),z.status==="done"&&z.cost!=null&&s.jsxs("span",{className:"muted small",children:["$",z.cost.toFixed(3)]})]}),(ve=z.variants)!=null&&ve.length?s.jsxs("button",{className:"btn oc-variants",onClick:()=>l.onLocate(z.variants),children:[s.jsx(I,{name:"board",size:14})," ",r.chat.madeVariants(z.variants.length)]}):null,xi(z,$===ce.length-1),z.status==="running"&&!z.parts.length&&s.jsx("div",{className:"muted oc-thinking",children:r.chat.thinking}),r.chat.noPause[z.agent]&&z.parts.some(fe=>fe.t==="tool")&&s.jsx("p",{className:"ai-note",children:r.chat.noPause[z.agent]}),z.status!=="running"&&z.step&&In(z)]},$)})}),zn&&s.jsxs("div",{className:"remedy",role:"status",children:[s.jsx(I,{name:"warn",size:16}),s.jsxs("div",{children:[s.jsx("p",{children:s.jsx(Bf,{text:zn.text})}),s.jsxs("div",{className:"btn-row",children:[zn.cmd&&s.jsxs("button",{className:"btn",onClick:()=>_a("cmd",zn.cmd),title:zn.cmd,children:[s.jsx(I,{name:"copy",size:14})," ",_==="cmd"?r.chat.copied:r.chat.copyCommand]}),s.jsx("button",{className:"btn",disabled:f,onClick:()=>Hl(),children:f?r.chat.checking:r.chat.checkAgain})]})]})]}),s.jsxs("div",{className:"composer",onDragOver:z=>z.preventDefault(),onDrop:z=>{z.preventDefault(),z.dataTransfer.files.length&&$n(z.dataTransfer.files)},children:[Gl&&s.jsxs("div",{className:"run-status",role:"status",children:[s.jsxs("span",{className:"waiting",children:[s.jsx("span",{className:"pulse","aria-hidden":"true"}),r.chat.waiting]}),s.jsxs("span",{className:"muted",children:["· ",r.chat.waitingHint]})]}),s.jsxs("div",{className:"chips",children:[l.selection&&s.jsx(ac,{on:Te,onToggle:()=>st(z=>!z),icon:"select",label:r.chat.chipElementText(l.selection.tag,l.selection.text.slice(0,14))}),l.boards.length>0&&s.jsx(ac,{on:Ot,onToggle:()=>Dt(z=>!z),icon:"board",label:l.boards.length===1?l.titleOf(l.boards[0]):r.chat.chipBoards(l.boards.length)}),l.visibleCount>0&&s.jsx(ac,{on:tt,onToggle:()=>ue(z=>!z),icon:"fit",label:r.chat.chipVisible(l.visibleCount)}),l.attach.comments.map(z=>s.jsx(ac,{on:!0,icon:"comment",label:r.chat.chipComment(z.text.slice(0,14)),onRemove:()=>l.setAttach($=>({...$,comments:$.comments.filter(ve=>ve.id!==z.id)}))},z.id)),l.attach.refs.map((z,$)=>s.jsx(ac,{on:!0,icon:z.kind==="url"?"link":"page",label:z.name??z.value,onRemove:()=>l.setAttach(ve=>({...ve,refs:ve.refs.filter((fe,ke)=>ke!==$)}))},$))]}),je!=null&&s.jsx("div",{className:"url-row",children:s.jsx("input",{autoFocus:!0,value:je,placeholder:"https://","aria-label":r.chat.refLink,onChange:z=>Ce(z.target.value),onKeyDown:z=>{z.nativeEvent.isComposing||(z.key==="Enter"&&/^https?:\/\/\S+$/.test(je.trim())&&(l.setAttach($=>({...$,refs:[...$.refs,{kind:"url",value:je.trim()}]})),Ce(null)),z.key==="Escape"&&Ce(null))}})}),X&&l.draft.trim()&&s.jsx("span",{className:"restored muted small",children:r.chat.restored}),s.jsx("textarea",{ref:l.inputRef,value:l.draft,rows:3,placeholder:oe?r.chat.placeholderRunning:r.chat.placeholder,"aria-label":r.chat.input,onChange:z=>l.setDraft(z.target.value),onPaste:z=>{const $=Array.from(z.clipboardData.files);$.length&&(z.preventDefault(),$n($))},onKeyDown:z=>{z.nativeEvent.isComposing||z.keyCode===229||(z.key==="Enter"&&!z.shiftKey&&(z.preventDefault(),oa()),z.key==="Escape"&&(oe?cl():z.target.blur()))}}),ot&&s.jsxs("p",{className:"warn small oc-err",children:[s.jsx(I,{name:"warn",size:14})," ",ot]}),ol&&!oe&&s.jsxs("p",{className:"send-why",children:[s.jsx(I,{name:"warn",size:14})," ",ol]}),s.jsxs("div",{className:"composer-bar",children:[s.jsx("button",{className:"icon-btn sm","aria-label":r.chat.attach,title:r.chat.attachTitle,onClick:()=>{var z;return(z=ct.current)==null?void 0:z.click()},children:s.jsx(I,{name:"plus",size:14})}),s.jsx("button",{className:"icon-btn sm","aria-label":r.chat.addLink,title:r.chat.addLink,onClick:()=>Ce(""),children:s.jsx(I,{name:"link",size:14})}),s.jsx("input",{ref:ct,type:"file",multiple:!0,hidden:!0,accept:"image/*,.pdf,.md,.txt,.html,.csv,.json",onChange:z=>z.target.files&&void $n(z.target.files)}),s.jsx("label",{className:"variants",title:Wn?r.chat.variantsTitle:r.chat.variantsDisabledTitle,children:s.jsxs("select",{value:me,disabled:!Wn||!!oe,onChange:z=>be(Number(z.target.value)),"aria-label":r.chat.variantsAria,children:[s.jsx("option",{value:1,children:r.chat.variants(1)}),s.jsx("option",{value:2,children:r.chat.variants(2)}),s.jsx("option",{value:3,children:r.chat.variants(3)}),s.jsx("option",{value:4,children:r.chat.variants(4)})]})}),s.jsx("div",{className:"spacer"}),oe?s.jsxs("button",{className:"btn oc-cancel",title:r.chat.cancelTitle,onClick:cl,children:[s.jsx(I,{name:"close",size:14})," ",r.chat.cancel]}):s.jsx("button",{className:"primary",disabled:!l.draft.trim()||!!ol,title:ol??void 0,onClick:()=>void oa(),children:r.chat.send})]})]}),ft&&_f.createPortal(s.jsx(vy,{before:w0(ft.id),boards:ft.boards,onClose:()=>Rt(null)}),document.body)]})}function ac({on:l,onToggle:c,onRemove:u,icon:f,label:h}){return s.jsxs("span",{className:`chip ${l?"on":"off"}`,children:[s.jsxs("button",{className:"chip-main",onClick:c,disabled:!c,"aria-pressed":c?l:void 0,title:c?l?r.chat.chipRemoveTitle:r.chat.chipAddTitle:void 0,children:[s.jsx(I,{name:f,size:12}),s.jsx("span",{children:h})]}),u&&s.jsx("button",{className:"chip-x","aria-label":r.chat.remove(h),onClick:u,children:s.jsx(I,{name:"close",size:12})})]})}function q0(l){const[c,u]=j.useState(null);return j.useEffect(()=>{Ne.get("/api/tokens").then(u).catch(()=>{})},[l]),c}const Sy=l=>Object.entries((l==null?void 0:l.themes[l.active])??{}).map(([c,u])=>({name:c,value:u}));function tu(l){const c=l.trim().toLowerCase();let u=c.match(/^#([0-9a-f]{3,8})$/);if(u){let f=u[1];return f.length<=4&&(f=[...f].map(h=>h+h).join("")),[parseInt(f.slice(0,2),16),parseInt(f.slice(2,4),16),parseInt(f.slice(4,6),16),f.length===8?parseInt(f.slice(6),16)/255:1]}return u=c.match(/^rgba?\(\s*([\d.]+)[ ,]+([\d.]+)[ ,]+([\d.]+)(?:[ ,/]+([\d.]+))?\s*\)$/),u?[Number(u[1]),Number(u[2]),Number(u[3]),u[4]==null?1:Number(u[4])]:c==="transparent"?[0,0,0,0]:null}const Jp=([l,c,u])=>{const f=h=>{const p=h/255;return p<=.03928?p/12.92:((p+.055)/1.055)**2.4};return .2126*f(l)+.7152*f(c)+.0722*f(u)};function Pr(l,c){const u=tu(l),f=tu(c);if(!u||!f)return null;const[h,p]=[Jp(u),Jp(f)].sort((v,C)=>C-v);return(h+.05)/(p+.05)}const Jf=l=>{const c=tu(l);return c&&c[3]===1?"#"+c.slice(0,3).map(u=>Math.round(u).toString(16).padStart(2,"0")).join("").toUpperCase():null};function Fp(l,c,u){if(!(u!=null&&u.registered)||!c)return null;const f=new Set(Sy(u).map(p=>Jf(p.value)));if(/^(color|background|background-color|border-color)$/.test(l)){const p=Jf(c);if(p&&!f.has(p))return r.checks.colorNotInTokens}const h=[...c.matchAll(/(-?\d+(?:\.\d+)?)px/g)].map(p=>Number(p[1]));return l==="font-size"&&h.some(p=>!u.fontSizes.includes(p))?r.checks.tokenFontSizes(u.fontSizes.join("·")):l==="border-radius"&&h.some(p=>!u.radii.includes(p)&&p<999)?r.checks.tokenRadii(u.radii.join("·")):/^(gap|padding|margin)/.test(l)&&h.some(p=>p%4!==0)?r.checks.notMultipleOf4:l==="font-weight"&&/^\d+$/.test(c)&&!u.fontWeights.includes(Number(c))?r.checks.tokenWeights(u.fontWeights.join("·")):null}function X0(l,c=48){var T,y;const u=l.defaultView,f=[],h=b=>{for(let k=b;k&&k.nodeType===1;k=k.parentElement){const R=u.getComputedStyle(k),B=tu(R.backgroundColor);if(R.backgroundImage!=="none")return"";if(B&&B[3]>.5)return R.backgroundColor}return"rgb(255,255,255)"},p=b=>{const k=b.getBoundingClientRect(),R=u.getComputedStyle(b);return k.width>0&&k.height>0&&R.visibility!=="hidden"&&R.display!=="none"},v=l.body.querySelectorAll("a[href], button, input:not([type=hidden]), select, textarea, [role=button], [role=tab], [onclick]");for(const b of Array.from(v)){if(!p(b))continue;const k=il(b);if(k==null)continue;const R=b.getBoundingClientRect();R.width<c&&R.height<c&&f.push({path:k,kind:"target",message:r.checks.smallTarget(b.tagName.toLowerCase(),Math.round(R.width),Math.round(R.height),c)});const B=(b.getAttribute("aria-label")||b.getAttribute("title")||b.getAttribute("placeholder")||b.innerText||((T=b.querySelector("img[alt]"))==null?void 0:T.getAttribute("alt"))||"").trim(),X=b.getAttribute("aria-labelledby")||b.id&&l.querySelector(`label[for="${b.id}"]`)||b.closest("label");!B&&!X&&f.push({path:k,kind:"label",message:r.checks.noName(b.tagName.toLowerCase())})}for(const b of Array.from(l.body.querySelectorAll("img")))if(!b.hasAttribute("alt")&&p(b)){const k=il(b);k!=null&&f.push({path:k,kind:"label",message:r.checks.noAlt})}const C=l.createTreeWalker(l.body,NodeFilter.SHOW_TEXT),S=new Set;for(let b=C.nextNode();b;b=C.nextNode()){const k=b.parentElement;if(!k||S.has(k)||!((y=b.textContent)!=null&&y.trim())||/^(SCRIPT|STYLE)$/.test(k.tagName)||!p(k))continue;S.add(k);const R=u.getComputedStyle(k),B=h(k);if(!B)continue;const X=Pr(R.color,B);if(X==null)continue;const N=parseFloat(R.fontSize),W=N>=24||N>=18.66&&Number(R.fontWeight)>=700?3:4.5;if(X<W){const ne=il(k);ne!=null&&f.push({path:ne,kind:"contrast",message:r.checks.lowContrast(X.toFixed(2),W,b.textContent.trim().slice(0,16))})}}return f}function V0({tokens:l,onSave:c}){const[u,f]=j.useState(l);j.useEffect(()=>f(l),[l]);const h=u.themes[u.active]??{},p=JSON.stringify(u)!==JSON.stringify(l)||!l.registered,v=S=>f({...u,themes:{...u.themes,[u.active]:S}}),C=(S,T)=>s.jsxs("label",{className:"field-row tok-list",children:[s.jsx("span",{children:T}),s.jsx("input",{defaultValue:u[S].join(", "),"aria-label":T,onBlur:y=>f({...u,[S]:y.target.value.split(/[,\s]+/).map(Number).filter(b=>Number.isFinite(b))})},u[S].join())]});return s.jsxs("div",{className:"tokens",children:[s.jsxs("label",{className:"upload small",children:[s.jsx(I,{name:"plus",size:14})," ",r.tokens.import,s.jsx("input",{type:"file",hidden:!0,accept:".json,application/json",onChange:async S=>{var y;const T=(y=S.target.files)==null?void 0:y[0];if(T)try{f(K0(JSON.parse(await T.text()),u))}catch(b){alert(r.tokens.importFailed(b.message))}}})]}),s.jsxs("div",{className:"sec-head",children:[s.jsx("span",{children:r.tokens.theme}),s.jsx("button",{className:"icon-btn sm","aria-label":r.tokens.addTheme,title:r.tokens.addTheme,onClick:()=>{let S=r.tokens.newTheme;for(let T=2;u.themes[S];T++)S=r.tokens.newThemeN(T);f({...u,themes:{...u.themes,[S]:{...h}},active:S})},children:s.jsx(I,{name:"plus",size:14})})]}),s.jsxs("div",{className:"theme-row",children:[s.jsx("select",{value:u.active,onChange:S=>f({...u,active:S.target.value}),"aria-label":r.tokens.activeTheme,children:Object.keys(u.themes).map(S=>s.jsx("option",{children:S},S))}),s.jsx("input",{defaultValue:u.active,"aria-label":r.tokens.themeName,onBlur:S=>{const T=S.target.value.trim();if(!T||T===u.active||u.themes[T])return;const{[u.active]:y,...b}=u.themes;f({...u,themes:{...b,[T]:y},active:T})}},u.active)]}),s.jsxs("div",{className:"sec-head",children:[s.jsx("span",{children:r.tokens.colors(Object.keys(h).length)}),s.jsx("button",{className:"icon-btn sm","aria-label":r.tokens.addColor,title:r.tokens.addColor,onClick:()=>v({...h,[r.tokens.colorN(Object.keys(h).length+1)]:"#111111"}),children:s.jsx(I,{name:"plus",size:14})})]}),s.jsx("ul",{className:"tok-colors",children:Object.entries(h).map(([S,T])=>{var y;return s.jsxs("li",{children:[s.jsx("input",{type:"color",value:((y=Jf(T))==null?void 0:y.toLowerCase())??"#000000","aria-label":r.tokens.colorOf(S),onChange:b=>v({...h,[S]:b.target.value.toUpperCase()})}),s.jsx("input",{defaultValue:S,"aria-label":r.tokens.colorName,onBlur:b=>{const k=b.target.value.trim();!k||k===S||h[k]||v(Object.fromEntries(Object.entries(h).map(([R,B])=>R===S?[k,B]:[R,B])))}}),s.jsx("code",{children:T}),s.jsx("button",{className:"icon-btn sm danger","aria-label":r.tokens.remove(S),onClick:()=>v(Object.fromEntries(Object.entries(h).filter(([b])=>b!==S))),children:s.jsx(I,{name:"close",size:12})})]},S)})}),C("fontSizes",r.tokens.fontSizes),C("fontWeights",r.tokens.fontWeights),C("radii",r.tokens.radii),C("spacing",r.tokens.spacing),s.jsxs("label",{className:"field-row tok-list",children:[s.jsx("span",{children:r.tokens.touchTarget}),s.jsx("input",{type:"number",value:u.minTarget,onChange:S=>f({...u,minTarget:Number(S.target.value)||48}),"aria-label":r.tokens.minTouchTarget})]}),s.jsx("button",{disabled:!p,title:r.tokens.saveTitle,onClick:()=>c(u,l.registered?r.history.saveTokens:r.history.registerTokens),children:l.registered?r.tokens.save:r.tokens.register}),s.jsx("p",{className:"muted small",children:l.registered?r.tokens.registeredHint:r.tokens.defaultHint})]})}function K0(l,c){const u=l;if(u&&typeof u=="object"&&u.themes&&typeof u.themes=="object")return{...c,...u,active:u.active??Object.keys(u.themes)[0]};const f={},h=(p,v)=>{if(typeof p=="string"&&/^#|^rgb/i.test(p))f[v]=p.toUpperCase();else if(p&&typeof p=="object"){const C=p.value??p.$value;if(typeof C=="string")h(C,v);else for(const[S,T]of Object.entries(p))h(T,v?`${v} ${S}`:S)}};if(h(l,""),!Object.keys(f).length)throw new Error(r.tokens.noColors);return{...c,themes:{...c.themes,[r.tokens.importedTheme]:f},active:r.tokens.importedTheme}}function Wp({title:l,items:c,empty:u,onPick:f,onAskAI:h}){return s.jsxs("section",{className:"board-opts","aria-label":l,children:[s.jsxs("div",{className:"sec-head",children:[s.jsxs("span",{children:[l," ",c?c.length:""]}),h&&c&&c.length>0&&s.jsx("button",{className:"link",onClick:h,children:r.checks.askFix})]}),c==null?s.jsx("p",{className:"muted small",children:r.checks.notVisible}):c.length===0?s.jsxs("p",{className:"ok-line",children:[s.jsx(I,{name:"check",size:14})," ",u]}):s.jsxs("ul",{className:"check-list",children:[c.slice(0,30).map((p,v)=>s.jsx("li",{children:s.jsxs("button",{className:"check-item",disabled:!p.path,onClick:()=>p.path&&f(p.path),title:p.path?r.checks.pickInEdit(p.path):r.checks.line(p.line),children:[s.jsx(I,{name:"warn",size:12}),s.jsx("span",{children:p.message}),s.jsx("code",{children:p.path??r.checks.line(p.line)})]})},v)),c.length>30&&s.jsx("li",{className:"muted small",children:r.checks.more(c.length-30)})]})]})}function Z0({onSetUp:l}){const c=j.useRef(null);return j.useLayoutEffect(()=>Ul(c.current,".btn"),[]),s.jsxs("div",{ref:c,className:"oc-tc-off",role:"note","aria-label":r.checks.tokensOffTitle,children:[s.jsx(I,{name:"info",size:16}),s.jsxs("div",{children:[s.jsx("strong",{children:r.checks.tokensOffTitle}),s.jsx("p",{children:r.checks.tokensOffBody})]}),s.jsx("button",{className:"btn",onClick:l,children:r.checks.setUpTokens})]})}function rc(l){const c=l==null?void 0:l.getElementById("board-tweaks");if(!c)return null;try{return JSON.parse(c.textContent??"")}catch{return null}}function Ip(l,c,u){const f=u.type==="boolean"?u.value?"1":"0":String(u.value)+(u.type==="number"&&u.unit?u.unit:"");u.var&&l.documentElement.style.setProperty(u.var,f),l.documentElement.setAttribute(`data-tweak-${c}`,u.type==="boolean"?u.value?"on":"off":String(u.value))}function Q0({doc:l,onSave:c}){const[u,f]=j.useState(()=>rc(l)),[h,p]=j.useState(()=>JSON.stringify(rc(l)));if(j.useEffect(()=>{const S=rc(l);f(S),p(JSON.stringify(S))},[l]),!u)return null;const v=(S,T)=>{const y={...u,[S]:{...u[S],value:T}};f(y),l&&Ip(l,S,y[S])},C=JSON.stringify(u)!==h;return s.jsxs("section",{className:"board-opts","aria-label":"Tweaks",children:[s.jsx("div",{className:"sec-head",children:s.jsx("span",{children:"Tweaks"})}),Object.entries(u).map(([S,T])=>s.jsx("label",{className:T.type==="boolean"?"check":"field-row",children:T.type==="boolean"?s.jsxs(s.Fragment,{children:[s.jsx("input",{type:"checkbox",checked:!!T.value,onChange:y=>v(S,y.target.checked)}),T.label??S]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{children:T.label??S}),T.type==="color"?s.jsx("input",{type:"color",value:String(T.value),onChange:y=>v(S,y.target.value.toUpperCase()),"aria-label":T.label??S}):T.type==="enum"?s.jsx("select",{value:String(T.value),onChange:y=>v(S,y.target.value),"aria-label":T.label??S,children:(T.options??[]).map(y=>s.jsx("option",{children:y},y))}):s.jsxs("span",{className:"tw-num",children:[s.jsx("input",{type:"range",min:T.min??0,max:T.max??100,step:T.step??1,value:Number(T.value),onChange:y=>v(S,Number(y.target.value)),"aria-label":T.label??S}),s.jsxs("code",{children:[String(T.value),T.unit??""]})]})]})},S)),s.jsxs("div",{className:"btn-row",children:[s.jsx("button",{disabled:!C,onClick:()=>{const S=JSON.parse(h);if(f(S),l)for(const[T,y]of Object.entries(S))Ip(l,T,y)},children:r.tweaks.revert}),s.jsx("button",{className:"primary",disabled:!C,onClick:()=>void c(Object.fromEntries(Object.entries(u).map(([S,T])=>[S,T.value]))).then(()=>p(JSON.stringify(u))),children:r.tweaks.save})]}),s.jsx("p",{className:"muted small",children:r.tweaks.hint})]})}const Xt=r.select,aa=r.design,Ny=l=>l!=null&&l.registered?Sy(l):[];function J0(l){const c={};if(!(l!=null&&l.documentElement))return c;const u=f=>{for(let h=0;h<f.length;h++)f[h].startsWith("--")&&(c[f[h]]=f.getPropertyValue(f[h]).trim())};for(const f of Array.from(l.styleSheets)){let h=null;try{h=f.cssRules}catch{continue}for(const p of Array.from(h??[])){const v=p;v.selectorText&&v.style&&/(^|,)\s*(:root|html|body)\s*(,|$)/.test(v.selectorText)&&u(v.style)}}return u(l.documentElement.style),c}function Ty(l,c){const u=Zb(l.kind,l.styles["background-color"]);if(u==="color")return{prop:u,css:"color",value:c.color||l.styles.color||""};const f=c.background!=null?"background":"background-color";return{prop:u,css:f,value:c.background||c["background-color"]||l.styles["background-color"]||""}}function Ff(l){const c=dc(l.value,l.colors),u=xn(l.value)??(c?xn(c.value):null)??"",[f,h]=j.useState(u);j.useEffect(()=>h(u),[u]);const p=j.useRef(null);j.useEffect(()=>{var C,S;l.autoFocus&&((S=(C=p.current)==null?void 0:C.querySelector("button, input"))==null||S.focus())},[]);const v=()=>{const C=xn(f.startsWith("#")?f:`#${f}`);C&&C!==u?l.onPick(C):h(u)};return s.jsxs("div",{className:"fill-picker",ref:p,children:[s.jsxs("div",{className:"pop-top",children:[s.jsx("strong",{children:l.title}),s.jsx("span",{className:"muted",children:c?Xt.tokenNow(c.name):u||aa.none})]}),l.colors.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"pop-h",children:Xt.tokens}),s.jsx("div",{className:"tok-row",role:"group","aria-label":Xt.tokens,children:l.colors.map(C=>s.jsxs("button",{className:`tok ${(c==null?void 0:c.name)===C.name?"on":""}`,"aria-pressed":(c==null?void 0:c.name)===C.name,title:`${C.name} ${xn(C.value)??C.value}`,onClick:()=>l.onPick(Kb(C,l.vars)),children:[s.jsx("i",{style:{background:C.value}}),s.jsx("span",{children:C.name})]},C.name))}),s.jsx("div",{className:"pop-sep"})]}),s.jsx("div",{className:"custom-row",children:s.jsx("span",{children:Xt.custom})}),s.jsxs("div",{className:"hex",children:[s.jsx("input",{type:"color",className:"sw","aria-label":Xt.picker,value:(xn(f)??(u||"#000000")).toLowerCase(),onChange:C=>h(C.target.value.toUpperCase()),onBlur:v}),s.jsx("input",{className:"num","aria-label":Xt.hex,value:f,spellCheck:!1,onChange:C=>h(C.target.value),onBlur:v,onKeyDown:C=>{C.nativeEvent.isComposing||C.key==="Enter"&&v()}})]})]})}function Qr(l){const[c,u]=j.useState(l.value);j.useEffect(()=>u(l.value),[l.value]);const f=()=>c.trim()!==l.value.trim()&&l.onCommit(c.trim());return s.jsxs("div",{className:"pop-field",children:[s.jsx("span",{className:"pop-h",title:l.css,children:l.label}),l.chips&&l.chips.length>0&&s.jsx("span",{className:"chips-row",children:l.chips.map(h=>s.jsx("button",{className:`tchip ${Bl(l.value||l.placeholder)===String(h)?"on":""}`,onClick:()=>l.onCommit(String(h)),children:h},h))}),s.jsxs("span",{className:"stepper",children:[s.jsx("button",{className:"icon-btn sm","aria-label":Xt.decrease(l.label),onClick:()=>l.onStep(-1),children:s.jsx(I,{name:"minus",size:14})}),s.jsx("input",{"aria-label":l.label,title:l.css,value:c,placeholder:l.placeholder,onChange:h=>u(h.target.value),onBlur:f,onKeyDown:h=>{h.nativeEvent.isComposing||h.key==="Enter"&&f()}}),s.jsx("button",{className:"icon-btn sm","aria-label":Xt.increase(l.label),onClick:()=>l.onStep(1),children:s.jsx(I,{name:"plus",size:14})})]})]})}const Jr=l=>/^-?\d+(?:\.\d+)?$/.test(l)?`${Number(l)}px`:l;function F0(l){var ot,Et,Me,U,E,Y;const c=l.selection,u=j.useRef(null),f=j.useRef(null),[h,p]=j.useState({w:420,h:36}),v=j.useRef(0),[C,S]=j.useState(null),[T,y]=j.useState(null),[b,k]=j.useState(0),R=j.useRef([]),[B,X]=j.useState({});j.useEffect(()=>X({}),[c.hash,c.path,c.file]);const N=A=>B[A]??l.inline[A]??c.styles[A]??"",_=(A,ie)=>{X(se=>({...se,[A]:ie})),l.onStyle(A,ie)},W=Yb(l.win.w,{w:h.w,full:v.current||h.w});j.useLayoutEffect(()=>{const A=u.current;A&&(Ul(A),W.icons||(v.current=A.offsetWidth),(A.offsetWidth!==h.w||A.offsetHeight!==h.h)&&p({w:A.offsetWidth,h:A.offsetHeight}))});const ne=l.win.h-l.bottom-h.h;j.useLayoutEffect(()=>{if(!C)return y(null);const A=f.current,ie=R.current[re.findIndex(Ae=>Ae.pop===C)];if(!A||!ie||!u.current)return;const se=A.offsetWidth,ge=A.offsetHeight,ae=Math.round(Math.max(8,Math.min(W.x+ie.offsetLeft,l.win.w-se-8))),de=Math.round(Math.max(8,ne-ge-8));(!T||T.x!==ae||T.y!==de)&&y({x:ae,y:de})}),j.useEffect(()=>{if(!C)return;const A=ie=>{var ge,ae;const se=ie.target;(ge=f.current)!=null&&ge.contains(se)||(ae=u.current)!=null&&ae.contains(se)||S(null)};return window.addEventListener("pointerdown",A,!0),()=>window.removeEventListener("pointerdown",A,!0)},[C]);const J=Ny(l.tokens),ce=!!c.text.trim(),le=Ty(c,l.inline),oe=B[le.css]??le.value,F=xn(oe)??xn((ot=dc(oe,J))==null?void 0:ot.value)??null,re=[{id:"text",label:Xt.text,icon:"title",pop:"text",disabled:!ce,title:ce?Xt.text:Xt.textOff},{id:"fill",label:Xt.fill,pop:"fill",title:`${Xt.fill} (${le.css})`},{id:"radius",label:Xt.radius,icon:"radius",pop:"radius",title:`${aa.cornerRadius} (border-radius)`},{id:"spacing",label:Xt.spacing,icon:"spacing",pop:"spacing",title:`${aa.padding} · ${aa.gap}`},{id:"ask",label:Xt.askAi,icon:"comment",cls:"accent",title:Xt.askAiTitle,run:l.onAskAi},{id:"comment",label:Xt.comment,icon:"comment",title:Xt.commentTitle,run:l.onComment}],we=re.map((A,ie)=>A.disabled?-1:ie).filter(A=>A>=0),Te=we.includes(b)?b:we[0],st=A=>{var ie;return A.pop?S(se=>se===A.pop?null:A.pop):(ie=A.run)==null?void 0:ie.call(A)},Ot=()=>{var ie;const A=re.findIndex(se=>se.pop===C);S(null),(ie=R.current[A])==null||ie.focus()},Dt=A=>{if(!A.nativeEvent.isComposing){if(A.key==="Escape"){C&&(A.preventDefault(),A.stopPropagation(),Ot());return}A.metaKey||A.ctrlKey||/^(Arrow|Home$|End$|Enter$| $|Delete$|Backspace$)/.test(A.key)&&A.stopPropagation()}},tt=A=>{const ie=we.indexOf(Te),se=ge=>{var de;A.preventDefault();const ae=we[(ge+we.length)%we.length];k(ae),(de=R.current[ae])==null||de.focus()};A.key==="ArrowRight"?se(ie+1):A.key==="ArrowLeft"?se(ie-1):A.key==="Home"?se(0):A.key==="End"&&se(we.length-1)},ue=(Et=l.tokens)!=null&&Et.registered?l.tokens.fontSizes:[],me=[...new Set([...(Me=l.tokens)!=null&&Me.registered?l.tokens.fontWeights:[],400,500,600,700])].sort((A,ie)=>A-ie),be=(U=l.tokens)!=null&&U.registered?l.tokens.radii.filter(A=>A<999):[],je=(E=l.tokens)!=null&&E.registered?l.tokens.spacing.filter(A=>A<=64):[];let Ce=null;return C==="text"?Ce=s.jsxs(s.Fragment,{children:[s.jsx(Qr,{label:aa.size,css:"font-size",value:Bl(N("font-size")),chips:ue,onStep:A=>_("font-size",`${Ir(N("font-size"),A,1,1)}px`),onCommit:A=>_("font-size",Jr(A))}),s.jsxs("label",{className:"pop-field",children:[s.jsx("span",{className:"pop-h",title:"font-weight",children:aa.weight}),s.jsx("select",{value:String(Number(N("font-weight"))||""),onChange:A=>_("font-weight",A.target.value),children:me.map(A=>s.jsx("option",{value:String(A),children:Vf(A,aa.weights)},A))})]})]}):C==="fill"?Ce=s.jsx(Ff,{title:Xt.fill,value:oe,colors:J,vars:l.vars,autoFocus:!0,onPick:A=>_(le.css,A)}):C==="radius"?Ce=s.jsx(Qr,{label:aa.cornerRadius,css:"border-radius",value:Bl(N("border-radius")),chips:be,onStep:A=>_("border-radius",`${Ir(N("border-radius"),A)}px`),onCommit:A=>_("border-radius",Jr(A))}):C==="spacing"&&(Ce=s.jsxs(s.Fragment,{children:[s.jsx(Qr,{label:aa.padding,css:"padding",value:Xf(N("padding")),chips:je,onStep:A=>_("padding",Qb(N("padding"),A)),onCommit:A=>_("padding",A.replace(/·/g," ").trim().split(/\s+/).map(Jr).join(" "))}),s.jsx(Qr,{label:aa.gap,css:"gap",value:Bl(N("gap")==="normal"?"0px":N("gap")),chips:je,onStep:A=>_("gap",`${Ir(N("gap"),A,4)}px`),onCommit:A=>_("gap",Jr(A))})]})),s.jsxs(s.Fragment,{children:[s.jsx("div",{ref:u,className:`etb oc-context ${W.icons?"is-icons":""}`,role:"toolbar","aria-label":Xt.toolbar,"aria-orientation":"horizontal",style:{left:W.x},onKeyDown:A=>{Dt(A),tt(A)},onPointerDown:A=>A.stopPropagation(),children:re.map((A,ie)=>s.jsxs("span",{className:"etb-item",children:[A.id==="ask"&&s.jsx("span",{className:"sep","aria-hidden":"true"}),s.jsxs("button",{ref:se=>void(R.current[ie]=se),className:`${A.cls??""} ${C&&C===A.pop?"on":""}`,tabIndex:ie===Te?0:-1,disabled:A.disabled,title:A.title,"aria-label":A.id==="fill"?Xt.fill:W.icons?A.label:void 0,"aria-haspopup":A.pop?"dialog":void 0,"aria-expanded":A.pop?C===A.pop:void 0,onFocus:()=>k(ie),onClick:()=>st(A),children:[A.id==="fill"?s.jsx("span",{className:"sw",style:{background:F??"transparent"}}):s.jsx(I,{name:A.icon,size:14}),A.id!=="fill"&&!W.icons&&A.label,(A.id==="text"||A.id==="fill")&&s.jsx(I,{name:"chevronDown",size:14})]})]},A.id))}),C&&s.jsx("div",{ref:f,className:"menu pop",role:"dialog","aria-label":(Y=re.find(A=>A.pop===C))==null?void 0:Y.label,style:T?{left:T.x,top:T.y}:{visibility:"hidden",left:0,top:0},onKeyDown:Dt,onPointerDown:A=>A.stopPropagation(),children:Ce})]})}function W0(l){return s.jsxs("nav",{className:"crumb","aria-label":r.inspector.crumbs,children:[s.jsx("button",{className:"link",title:r.inspector.crumbBoard,onClick:l.onBoard,children:l.board}),l.skipped&&s.jsxs(s.Fragment,{children:[s.jsx("span",{"aria-hidden":"true",children:"›"}),s.jsx("span",{children:"…"})]}),l.parents.map(c=>s.jsxs("span",{className:"crumb-step",children:[s.jsx("span",{"aria-hidden":"true",children:"›"}),s.jsx("button",{className:"link",title:r.inspector.crumbParent(c.name),onClick:()=>l.onPath(c.path),children:c.name})]},c.path)),s.jsx("span",{"aria-hidden":"true",children:"›"}),s.jsx("b",{"aria-current":"true",title:l.title,children:l.current})]})}const I0=l=>l.includes("/")?l.slice(0,l.lastIndexOf("/")):"",cc=l=>`${Math.round(l)}px`;function P0(l,c,u,f,h){const p=c.style.pointerEvents;c.style.pointerEvents="none";const v=l.elementFromPoint(u,f);if(c.style.pointerEvents=p,!v||v===l.documentElement||c.contains(v))return null;const C=l.defaultView,S=ne=>{const J=C.getComputedStyle(ne);return/flex/.test(J.display)&&!J.flexDirection.startsWith("column")},T=/^(img|input|br|hr|textarea|select|svg|path|video|iframe)$/i,y=ne=>{const J=ne===l.body?"":il(ne);if(J==null)return null;const ce=S(ne),le=Array.from(ne.children).filter(we=>{var Te;return we!==c&&!((Te=we.hasAttribute)!=null&&Te.call(we,"data-dc-probe"))});let oe=le.length;for(let we=0;we<le.length;we++){const Te=ia(le[we]);if(ce?u<Te.x+Te.w/2:f<Te.y+Te.h/2){oe=we;break}}const F=ia(ne);let re;if(oe<le.length){const we=ia(le[oe]);re=ce?{x:we.x-1,y:we.y,w:2,h:we.h}:{x:we.x,y:we.y-1,w:we.w,h:2}}else if(le.length){const we=ia(le[le.length-1]);re=ce?{x:we.x+we.w,y:we.y,w:2,h:we.h}:{x:we.x,y:we.y+we.h,w:we.w,h:2}}else re={x:F.x,y:F.y+F.h-2,w:F.w,h:2};return{toParentPath:J,index:oe,freeze:[],line:re}};if(v.contains(c)||v===l.body)return y(v===l.body?l.body:v);if(h&&!T.test(v.tagName))return y(v);const b=v.parentElement,k=b===l.body?"":il(b);if(k==null)return null;const R=S(b),B=ia(v),X=R?u>B.x+B.w/2:f>B.y+B.h/2,_=Array.from(b.children).filter(ne=>ne!==c).indexOf(v)+(X?1:0),W=R?{x:X?B.x+B.w:B.x-1,y:B.y,w:2,h:B.h}:{x:B.x,y:X?B.y+B.h:B.y-1,w:B.w,h:2};return{toParentPath:k,index:_,freeze:[],line:W}}function ex(l,c,u){const f=c.parentElement;if(!f||f===l.body)return[];const h=il(f);if(h==null||h===u)return[];const p=l.defaultView.getComputedStyle(f);if(!/flex|grid/.test(p.display))return[];const v=[],C=(y,b)=>{const k=il(y),R=y.style,B=y.getBoundingClientRect(),X={};for(const N of b)R.getPropertyValue(N)||(X[N]=cc(N==="width"?B.width:B.height));k!=null&&Object.keys(X).length&&v.push({path:k,props:X})};C(f,["width","height"]);const S=p.display.includes("grid"),T=!p.flexDirection.startsWith("column");for(const y of Array.from(f.children))y!==c&&C(y,S?["width","height"]:T?["width"]:["height"]);return v}function tx(l){const[c,u]=j.useState(null),[f,h]=j.useState(null),p=j.useRef(null),v=1/Math.max(l.zoom,.25),C=k=>R=>{if(R.button!==0)return;R.stopPropagation(),R.preventDefault();const B=Mn(l.doc,l.path);if(!B)return;const X=l.doc.defaultView.getComputedStyle(B),N=X.position==="absolute"||X.position==="fixed",_=B.getBoundingClientRect();p.current={kind:k,sx:R.clientX,sy:R.clientY,el:B,abs:N,left:parseFloat(X.left)||0,top:parseFloat(X.top)||0,w:_.width,h:_.height,plan:null,moved:!1},R.currentTarget.setPointerCapture(R.pointerId)},S=k=>{var N,_;const R=p.current;if(!R)return;const B=(k.clientX-R.sx)/l.zoom,X=(k.clientY-R.sy)/l.zoom;if(!(!R.moved&&Math.abs(B)+Math.abs(X)<3)){if(R.moved=!0,R.kind==="move"){if(R.abs){R.el.style.left=cc(R.left+B),R.el.style.top=cc(R.top+X);return}h({...l.rect,x:l.rect.x+B,y:l.rect.y+X});const W=(_=(N=l.doc.defaultView)==null?void 0:N.frameElement)==null?void 0:_.getBoundingClientRect(),ne=W?W.width/(l.doc.defaultView.innerWidth||W.width):l.zoom,J=W?(k.clientX-W.left)/ne:l.rect.x+B,ce=W?(k.clientY-W.top)/ne:l.rect.y+X,le=P0(l.doc,R.el,J,ce,k.altKey);R.plan=le?{toParentPath:le.toParentPath,index:le.index,freeze:[]}:null,u((le==null?void 0:le.line)??null);return}R.kind!=="s"&&(R.el.style.width=cc(Math.max(8,R.w+B))),R.kind!=="e"&&(R.el.style.height=cc(Math.max(8,R.h+X)))}},T=k=>{const R=p.current;if(p.current=null,u(null),h(null),!R||!R.moved)return;const B=(k.clientX-R.sx)/l.zoom,X=(k.clientY-R.sy)/l.zoom;if(R.kind==="move"){if(R.abs)return l.onPosition(Math.round(R.left+B),Math.round(R.top+X));if(!R.plan||R.plan.toParentPath===I0(l.path)&&R.plan.index===Array.from(R.el.parentElement.children).indexOf(R.el))return;l.onMove({...R.plan,freeze:ex(l.doc,R.el,R.plan.toParentPath)});return}l.onResize(Math.round(R.kind==="s"?R.w:Math.max(8,R.w+B)),Math.round(R.kind==="e"?R.h:Math.max(8,R.h+X)))},y=l.rect,b=10*v;return s.jsxs(s.Fragment,{children:[f&&s.jsx("div",{className:"drag-ghost",style:{left:f.x,top:f.y,width:f.w,height:f.h}}),c&&s.jsx("div",{className:"drop-line",style:{left:c.x,top:c.y,width:Math.max(c.w,2*v),height:Math.max(c.h,2*v)}}),s.jsx("button",{className:"el-move","aria-label":r.elementDrag.moveAria,title:r.elementDrag.moveTitle,style:{left:Math.max(0,y.x),top:y.y>=22*v?y.y-22*v:Math.max(0,y.y),transform:`scale(${v})`,transformOrigin:y.y>=22*v?"0 100%":"0 0"},onPointerDown:C("move"),onPointerMove:S,onPointerUp:T,children:s.jsx(I,{name:"hand",size:12})}),["e","s","se"].map(k=>s.jsx("div",{className:`el-resize ${k}`,role:"slider","aria-label":k==="e"?r.elementDrag.width:k==="s"?r.elementDrag.height:r.elementDrag.size,"aria-valuetext":`${Math.round(y.w)} × ${Math.round(y.h)}`,style:{left:k==="s"?y.x+y.w/2-b/2:y.x+y.w-b/2,top:k==="e"?y.y+y.h/2-b/2:y.y+y.h-b/2,width:b,height:b,borderWidth:1.5*v},onPointerDown:C(k),onPointerMove:S,onPointerUp:T},k))]})}function nx(l,c,u,f){const h=Mn(l,c),p=h==null?void 0:h.parentElement;if(!h||!p)return null;const v=l.defaultView.getComputedStyle(p),C=/flex/.test(v.display),S=C&&v.flexDirection.startsWith("column"),T=f==="left"||f==="hcenter"||f==="right",y=f==="left"||f==="top"?"start":f==="right"||f==="bottom"?"end":"center",b={start:"flex-start",center:"center",end:"flex-end"}[y],k=(R,B)=>({op:"setStyle",path:c,hash:u,prop:R,value:B});return C&&(T?S:!S)?[k("align-self",b)]:T?y==="start"?[k("margin-left","0"),k("margin-right","auto")]:y==="end"?[k("margin-left","auto"),k("margin-right","0")]:[k("margin-left","auto"),k("margin-right","auto")]:C?y==="start"?[k("margin-top","0"),k("margin-bottom","auto")]:y==="end"?[k("margin-top","auto"),k("margin-bottom","0")]:[k("margin-top","auto"),k("margin-bottom","auto")]:null}function lx(l){const[c,u]=j.useState(""),[f,h]=j.useState(null),[p,v]=j.useState(!1),[C,S]=j.useState(!1),[T,y]=j.useState(null),[b,k]=j.useState(""),R=j.useRef(null),B=j.useRef(null);j.useLayoutEffect(()=>{Ul(R.current),Ul(B.current,".crumb button, .crumb span[aria-hidden], .oc-cmt button")});const X=async(F,re=!1)=>{b.trim()&&(await Ne.post("/api/comments",{action:"reply",id:F,text:b,author:l.author,resolve:re}),k(""),y(null))},N=F=>new Date(F).toLocaleString("ko-KR",{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}),_=l.selection,W=!!_&&!!l.file&&_.file===l.file,ne=l.comments.filter(F=>!l.file||F.file===l.file),J=ne.filter(F=>!F.resolved).length,ce=async()=>{_&&(await navigator.clipboard.writeText(zb(_.file,_.path,_.tag,_.text)).catch(()=>{}),S(!0),setTimeout(()=>S(!1),1200))},le=async()=>{if(l.file){v(!0);try{const F=await Ne.post("/api/screenshot",{file:l.file,path:_==null?void 0:_.path});h(F.path)}catch(F){h(r.inspector.shotFailed(F.message))}finally{v(!1)}}},oe=async()=>{!l.file||!c.trim()||(await Ne.post("/api/comments",{file:l.file,path:(_==null?void 0:_.file)===l.file?_.path:"",text:c,author:l.author}),u(""))};return s.jsxs("div",{className:"pp inspector",children:[s.jsxs("div",{className:"pp-scroll",ref:B,children:[W&&_&&s.jsxs("header",{className:"pp-head",children:[s.jsx("span",{className:"pp-file",children:_.file}),s.jsx("h2",{className:"pp-name",children:s.jsxs("span",{children:[r.inspector.kindName(_.kind??_.tag),_.label&&` · ${_.label.slice(0,40)}`,l.multi>1&&s.jsxs("span",{className:"muted",children:[" ",r.inspector.more(l.multi-1)]})]})}),s.jsxs("div",{className:"pp-crumb",children:[l.crumbs,_.path.includes("/")&&s.jsx("button",{className:"icon-btn pp-ib","aria-label":r.menu.selectParent,title:r.menu.selectParent,onClick:()=>l.onSelectPath(_.path.slice(0,_.path.lastIndexOf("/"))),children:s.jsx(I,{name:"parent",size:16})})]}),_.text&&!_.label&&s.jsxs("p",{className:"pp-note sel-text",children:["“",_.text.slice(0,120),"”"]})]}),l.error&&s.jsx("p",{className:"pp-note warn",children:l.error}),f&&s.jsx("p",{className:"pp-note muted shot",children:f}),l.children,l.file&&s.jsxs("section",{className:"pp-group oc-cmt","aria-label":r.comments.title,children:[s.jsxs("h3",{className:"pp-group-h",children:[r.comments.title,J>0&&s.jsx("span",{className:"oc-count",children:J})]}),s.jsx("textarea",{ref:l.commentRef,value:c,"aria-label":r.comments.title,placeholder:W&&_?r.comments.placeholderElement(_.path):r.comments.placeholderBoard,onChange:F=>u(F.target.value),onKeyDown:F=>{F.key==="Enter"&&(F.metaKey||F.ctrlKey)&&oe()}}),s.jsxs("div",{className:"oc-cmt-bar",children:[s.jsx("button",{className:"btn",onClick:oe,disabled:!c.trim(),children:r.comments.add}),s.jsx("button",{className:"btn oc-plain",onClick:l.onAuthor,title:r.comments.authorTitle,children:r.comments.author(l.author)}),!W&&s.jsx("button",{className:"btn oc-plain shot-link",onClick:le,disabled:p,title:r.inspector.boardScreenshotTitle,children:p?r.inspector.capturing:r.inspector.boardScreenshot})]}),s.jsx("ul",{className:"comments",children:ne.map(F=>s.jsxs("li",{className:`oc-cmt-item ${F.resolved?"resolved":""}`,children:[s.jsxs("div",{className:"c-head",children:[s.jsx("span",{className:"who",children:F.author}),F.path&&s.jsx("button",{className:"btn oc-plain c-path",onClick:()=>l.onSelectPath(F.path),children:F.path}),s.jsx("span",{className:"when",children:N(F.createdAt)})]}),s.jsx("div",{children:F.text}),(F.replies??[]).length>0&&s.jsx("ul",{className:"replies",children:F.replies.map(re=>s.jsxs("li",{children:[s.jsxs("div",{className:"c-head",children:[s.jsx("span",{className:"who",children:re.author}),s.jsx("span",{className:"when",children:N(re.createdAt)})]}),s.jsx("div",{children:re.text})]},re.id))}),T===F.id&&s.jsxs("div",{className:"reply-box",children:[s.jsx("textarea",{autoFocus:!0,value:b,placeholder:r.comments.replyPlaceholder(l.author),"aria-label":r.comments.reply,onChange:re=>k(re.target.value),onKeyDown:re=>{re.nativeEvent.isComposing||(re.key==="Enter"&&(re.metaKey||re.ctrlKey)&&X(F.id),re.key==="Escape"&&y(null))}}),s.jsxs("div",{className:"oc-cmt-bar",children:[s.jsx("button",{className:"btn",onClick:()=>void X(F.id),disabled:!b.trim(),children:r.comments.reply}),s.jsx("button",{className:"btn",onClick:()=>void X(F.id,!0),disabled:!b.trim(),children:r.comments.replyResolve})]})]}),s.jsxs("div",{className:"oc-cmt-bar",children:[T!==F.id&&s.jsx("button",{className:"btn oc-plain",onClick:()=>y(F.id),children:r.comments.reply}),s.jsx("button",{className:"btn oc-plain",onClick:()=>Ne.post("/api/comments",{action:"resolve",id:F.id,resolved:!F.resolved}),children:F.resolved?r.comments.reopen:r.comments.resolve}),!F.resolved&&l.onAskAI&&s.jsx("button",{className:"btn oc-plain",onClick:()=>l.onAskAI(F),title:r.comments.sendToAITitle,children:r.comments.sendToAI})]})]},F.id))})]})]}),W?s.jsxs("footer",{className:"pp-actions","aria-label":r.inspector.actions,ref:R,children:[l.onDuplicate&&s.jsx("button",{className:"btn",onClick:l.onDuplicate,children:r.properties.duplicate}),s.jsx("button",{className:"btn",onClick:ce,children:C?r.inspector.copied:r.inspector.copy}),s.jsx("button",{className:"btn",onClick:le,disabled:p,title:r.inspector.screenshotTitle,children:p?r.inspector.capturing:r.inspector.screenshot}),l.onDelete&&s.jsx("button",{className:"icon-btn pp-del","aria-label":r.properties.delete,title:r.boardOptions.deleteTitleKey,onClick:l.onDelete,children:s.jsx(I,{name:"trash"})})]}):l.footer]})}const ax=(l,c)=>l.x<c.x+c.w+(l.w+c.w)/2&&c.x<l.x+l.w+(l.w+c.w)/2&&l.y<c.y+c.h+(l.h+c.h)/2&&c.y<l.y+l.h+(l.h+c.h)/2;function ix(l){const c=new Set,u=[];for(const f of l){if(c.has(f))continue;const h=[f];c.add(f);for(let p=0;p<h.length;p++)for(const v of l)!c.has(v)&&ax(v,h[p])&&(c.add(v),h.push(v));u.push(l.filter(p=>h.includes(p)))}return u}function sx(l){const c=Math.min(...l.map(u=>u.y));return l.filter(u=>u.y-c<u.h/2).reduce((u,f)=>f.x<u.x?f:u)}function ox(l){const c=Math.min(...l.map(f=>f.x)),u=Math.min(...l.map(f=>f.y));return{x:c,y:u,w:Math.max(...l.map(f=>f.x+f.w))-c,h:Math.max(...l.map(f=>f.y+f.h))-u}}function cx(l,c,u,f){const h=new Set(u.map(p=>p??"")).size===1&&u[0]?u[0]:null;return{long:h?f.forkBlockWhile(l,c,h):null,medium:f.forkBlock(l,c),short:f.forkBlockShort(l)}}function rx(l,c,u,f){if(l.long&&u(l.long)<=c&&!f(u(l.long)))return l.long;for(const h of[l.medium,l.short])if(!f(u(h)))return h;return null}const Wf=l=>l.kind==="person"&&l.client===nu,uc=l=>l.by??l.person??r.occupancy.someone,Cy=(l,c)=>(l[c]??[]).filter(u=>u.kind==="agent"&&u.state==="editing");function ux({list:l}){return s.jsx(s.Fragment,{children:l.map(c=>{const u=Wf(c),f=u?r.occupancy.you:c.state==="done"?r.occupancy.done(uc(c),r.occupancy.clock(c.doneAt??Date.now())):c.kind==="person"?r.occupancy.personEditing(uc(c)):r.occupancy.editing(uc(c));return s.jsxs("span",{className:`occ-tag ${u?"you":""} ${c.state==="done"?"done":""}`,"data-occ":c.key,title:f,children:[u?s.jsx("span",{className:"idot","aria-hidden":"true"}):c.state==="editing"&&c.kind==="agent"?s.jsx("span",{className:"spinner","aria-hidden":"true"}):s.jsx(I,{name:lu(c.kind==="agent"?{by:c.by??""}:{person:c.person??""}),size:16}),s.jsx("span",{className:"act-tag-text",children:f})]},c.key)})})}function dx(l,c){const u=(l[c]??[]).find(f=>f.state==="editing");return u?{color:Wf(u)?"var(--select)":"var(--text)",label:Wf(u)?r.occupancy.youListDot:r.occupancy.listDot(uc(u))}:null}function Fr(l,c){var p;const u=l.boards[c];if(!u)return null;const f=(v,C)=>Object.keys(l.boards).filter(S=>{var T,y;return S!==v&&((T=l.boards[S].origin)==null?void 0:T.of)===v&&((y=l.boards[S].origin)==null?void 0:y.kind)===C});if((p=u.origin)!=null&&p.of&&l.boards[u.origin.of])return{original:u.origin.of,kind:u.origin.kind,chosen:c,alts:f(u.origin.of,u.origin.kind)};const h=f(c,"fork");return h.length?{original:c,kind:"fork",chosen:c,alts:h}:null}const fx=(l,c)=>[c.original,...c.alts].flatMap(u=>Cy(l,u))[0]??null,hx=l=>l.replace(/:.*$/,"");function mx({file:l,group:c,busy:u,open:f,onOpen:h,compact:p=!1}){const v=c.kind==="variant"?r.occupancy.useThis:r.occupancy.useThisOne;return s.jsxs("button",{className:`icon-btn sm use-btn ${u?"":"ready"} ${f?"pressed":""} ${p?"icon-only":""}`,"data-use":l,"aria-disabled":u?!0:void 0,"aria-haspopup":"dialog","aria-expanded":f,"aria-label":p?v:void 0,title:u?r.occupancy.waitFor(uc(u)):p?v:c.kind==="variant"?r.occupancy.useThisTitle:r.occupancy.useThisOneTitle(c.alts.length),onPointerDown:C=>C.stopPropagation(),onDoubleClick:C=>C.stopPropagation(),onClick:C=>{C.stopPropagation(),u||h()},children:[s.jsx(I,{name:"check",size:14}),!p&&s.jsx("span",{className:"use-label",children:v})]})}function gx(l){const c=j.useRef(null),[u,f]=j.useState(null),h=()=>document.querySelector(`[data-use="${CSS.escape(l.file)}"]`),p=b=>{var k;return((k=l.board.boards[b])==null?void 0:k.title)??b},v=l.group,C=p(v.original),S=r.occupancy,[T,y]=v.kind==="variant"?[S.confirmVariant(p(v.chosen),C),S.confirmVariantBody(C,v.alts.length-1)]:v.chosen===v.original?[S.confirmKeep(C),S.confirmKeepBody(v.alts.map(p).join(", "),v.alts.length)]:[S.confirmFork(p(v.chosen),C),S.confirmForkBody(C,v.alts.length-1)];return j.useLayoutEffect(()=>{var _,W;const b=h();if(!b)return void l.onClose();const k=b.getBoundingClientRect(),R=((_=c.current)==null?void 0:_.offsetWidth)??288,B=Math.round(Math.max(8,Math.min(k.right-R,window.innerWidth-R-8))),X=((W=c.current)==null?void 0:W.offsetHeight)??120,N=Math.round(Math.max(8,Math.min(k.bottom+8,window.innerHeight-X-8)));(!u||u.x!==B||u.y!==N)&&f({x:B,y:N})}),j.useEffect(()=>{var k,R;(R=(k=c.current)==null?void 0:k.querySelector("button"))==null||R.focus();const b=B=>{var N,_;const X=B.target;(N=c.current)!=null&&N.contains(X)||(_=h())!=null&&_.contains(X)||l.onClose()};return window.addEventListener("pointerdown",b,!0),()=>window.removeEventListener("pointerdown",b,!0)},[l.file]),s.jsxs("div",{ref:c,className:"menu confirm entering",role:"dialog","aria-label":T,style:{left:(u==null?void 0:u.x)??-9999,top:(u==null?void 0:u.y)??-9999},onKeyDown:b=>{var k;b.key==="Escape"&&(b.stopPropagation(),l.onClose(),(k=h())==null||k.focus())},children:[s.jsx("p",{className:"c-title",children:T}),s.jsx("p",{className:"c-body",children:y}),s.jsxs("div",{className:"btn-row",children:[s.jsx("button",{className:"btn oc-strong",disabled:l.busy,onClick:l.onApply,children:S.apply}),s.jsx("button",{className:"btn oc-plain",disabled:l.busy,onClick:l.onKeepAll,children:v.kind==="variant"||v.alts.length>1?S.keepAll:S.keepBoth})]})]})}function px({board:l,files:c,zoom:u}){const f=new Set(c),h=new Map;for(const p of c){const v=l.boards[p].origin;(v==null?void 0:v.kind)==="fork"&&f.has(v.of)&&l.boards[v.of]&&h.set(v.of,[...h.get(v.of)??[],{...l.boards[p],f:p}])}return h.size?s.jsx(s.Fragment,{children:[...h].flatMap(([p,v])=>ix(v).map(C=>s.jsx(yx,{of:p,from:l.boards[p],forks:C,zoom:Math.max(u,.05),board:l},C.map(S=>S.f).join(" "))))}):null}function yx({of:l,from:c,forks:u,zoom:f,board:h}){const p=j.useRef(null),v=j.useRef(null),C=sx(u),S=ox(u),T=u.length,y=c.title??l,b=cx(T,y,u.map(F=>{var re;return(re=F.origin)==null?void 0:re.while}),r.occupancy),[k,R]=j.useState(b.medium),B={left:S.x,top:S.y+S.h+10/f,transform:`scale(${1/f})`,transformOrigin:"0 0"};j.useLayoutEffect(()=>{var be;const F=v.current,re=(be=p.current)==null?void 0:be.getBoundingClientRect();if(!F||!re)return;const we=document.createElement("canvas").getContext("2d"),Te=getComputedStyle(F),st=parseFloat(Te.paddingLeft)+parseFloat(Te.paddingRight);we&&(we.font=`${Te.fontWeight} ${Te.fontSize} ${Te.fontFamily}`);const Ot=parseFloat(Te.lineHeight)||16,Dt=re.left+S.x*f,tt=re.top+(S.y+S.h)*f+10,ue=[...document.querySelectorAll(".canvas .note, .canvas .board-frame, .canvas .board-label")].map(je=>je.getBoundingClientRect()),me=rx(b,S.w*f,je=>(we?we.measureText(je).width:je.length*7)+st,je=>ue.some(Ce=>Ce.left<Dt+je&&Ce.right>Dt&&Ce.top<tt+Ot&&Ce.bottom>tt));me!==k&&R(me)},[f,S.x,S.y,S.w,S.h,b.long,b.medium,b.short,h]);const X=vx(c,C),N=X[X.length-1],_=X[0];if(Math.hypot(N.x-_.x,N.y-_.y)<4)return null;const W=1.5/f,ne=X[X.length-2],J=Math.atan2(N.y-ne.y,N.x-ne.x),ce=6/f,le=Math.min(...X.map(F=>F.x))-ce,oe=Math.min(...X.map(F=>F.y))-ce;return s.jsxs("div",{ref:p,className:"fork-link","data-fork":C.f,"data-forks":u.map(F=>F.f).join(" "),"aria-label":b.long??b.medium,role:"img",children:[s.jsx("svg",{className:"fork-svg",style:{left:le,top:oe,width:Math.max(...X.map(F=>F.x))+ce-le,height:Math.max(...X.map(F=>F.y))+ce-oe},"aria-hidden":"true",children:s.jsxs("g",{transform:`translate(${-le} ${-oe})`,children:[s.jsx("path",{d:X.map((F,re)=>`${re?"L":"M"}${F.x} ${F.y}`).join(""),strokeWidth:W,strokeDasharray:`${4*W} ${4*W}`}),s.jsx("path",{d:`M${N.x-ce*Math.cos(J-.6)} ${N.y-ce*Math.sin(J-.6)}L${N.x} ${N.y}L${N.x-ce*Math.cos(J+.6)} ${N.y-ce*Math.sin(J+.6)}`,strokeWidth:W})]})}),s.jsx("div",{className:"fork-caption",style:{...B,visibility:k?void 0:"hidden"},"aria-hidden":"true",children:s.jsx("span",{ref:v,children:k??b.short})})]})}function vx(l,c){const u=Math.max(l.y,c.y)+Math.min(48,Math.min(l.h,c.h)/4),f=u<Math.min(l.y+l.h,c.y+c.h);if(f&&c.x>=l.x+l.w)return[{x:l.x+l.w+8,y:u},{x:c.x-8,y:u}];if(f&&c.x+c.w<=l.x)return[{x:l.x-8,y:u},{x:c.x+c.w+8,y:u}];const h=C=>Math.min(48,C.h/4);if(c.x<l.x+l.w&&c.x+c.w>l.x){const C=Math.min(l.x,c.x)-40,S=c.y>=l.y,T=S?l.y+l.h-h(l):l.y+h(l),y=S?c.y+h(c):c.y+c.h-h(c);return[{x:l.x-8,y:T},{x:C,y:T},{x:C,y},{x:c.x-8,y}]}const p={x:l.x+l.w/2,y:l.y+l.h/2},v={x:c.x+c.w/2,y:c.y+c.h/2};return c.y>=l.y+l.h?[{x:p.x,y:l.y+l.h+8},{x:v.x,y:c.y-8}]:[{x:p.x,y:l.y-8},{x:v.x,y:c.y+c.h+8}]}const Hf=l=>l.includes("/")?l.slice(0,l.lastIndexOf("/")):"",Pp=l=>Number(l.split("/").pop());function bx(l){var ne;const[c,u]=j.useState([]),[f,h]=j.useState({0:!0}),[p,v]=j.useState(null),[C,S]=j.useState(null),[T,y]=j.useState(null);j.useEffect(()=>{Ne.get(`/api/outline?f=${encodeURIComponent(l.file)}`).then(J=>u(J.tree)).catch(()=>u([]))},[l.file,l.version]),j.useEffect(()=>{const J={};for(const ce of l.selected){const le=ce.split("/");for(let oe=1;oe<le.length;oe++)J[le.slice(0,oe).join("/")]=!0}Object.keys(J).length&&h(ce=>({...ce,...J}))},[l.selected.join("|")]);const b=J=>{if(!p||p===J||J.startsWith(p+"/"))return;const ce=Hf(J);let le=Pp(J);Hf(p)===ce&&Pp(p)<le&&(le-=1),l.onMove(p,ce,le)},k=[],R=new Map,B=J=>{for(const ce of J)k.push(ce),R.set(ce.path,ce),ce.children.length&&f[ce.path]&&B(ce.children)};B(c);const X=T??l.selected[l.selected.length-1]??((ne=k[0])==null?void 0:ne.path)??null,N=J=>{J==null||!R.has(J)||(y(J),l.onSelect(J,!1))},_=J=>{if(!X)return;const ce=k.findIndex(re=>re.path===X),le=R.get(X),F={ArrowDown:()=>{var re;return N((re=k[ce+1])==null?void 0:re.path)},ArrowUp:()=>{var re;return N((re=k[ce-1])==null?void 0:re.path)},ArrowRight:()=>le!=null&&le.children.length?f[X]?N(le.children[0].path):h(re=>({...re,[X]:!0})):void 0,ArrowLeft:()=>le!=null&&le.children.length&&f[X]?h(re=>({...re,[X]:!1})):N(X.includes("/")?Hf(X):null),Home:()=>{var re;return N((re=k[0])==null?void 0:re.path)},End:()=>{var re;return N((re=k[k.length-1])==null?void 0:re.path)},Enter:()=>N(X)," ":()=>N(X)}[J.key];F&&(J.preventDefault(),J.stopPropagation(),F())},W=(J,ce)=>{const le=J.children.length>0,oe=f[J.path];return s.jsxs("li",{children:[s.jsxs("div",{role:"treeitem","aria-selected":l.selected.includes(J.path),"aria-expanded":le?!!oe:void 0,"aria-level":ce+1,className:`layer ${l.selected.includes(J.path)?"on":""} ${C===J.path?"over":""} ${X===J.path?"kbd-focus":""}`,style:{paddingLeft:8+ce*16},draggable:!0,onDragStart:F=>{v(J.path),F.dataTransfer.effectAllowed="move"},onDragEnd:()=>{v(null),S(null)},onDragOver:F=>{p&&(F.preventDefault(),S(J.path))},onDragLeave:()=>S(F=>F===J.path?null:F),onDrop:F=>{F.preventDefault(),b(J.path),S(null)},onClick:F=>{y(J.path),l.onSelect(J.path,F.shiftKey)},children:[s.jsx("button",{className:"twisty",tabIndex:-1,"aria-label":oe?r.layers.collapse:r.layers.expand,style:{visibility:le?"visible":"hidden"},onClick:F=>{F.stopPropagation(),h(re=>({...re,[J.path]:!oe}))},children:s.jsx(I,{name:oe?"chevronDown":"chevronRight",size:14})}),s.jsx("span",{className:"tag",children:J.tag}),s.jsxs("span",{className:"lname",children:[J.cls&&`.${J.cls}`,J.cls&&J.text&&" · ",J.text]})]}),le&&oe&&s.jsx("ul",{children:J.children.map(F=>W(F,ce+1))})]},J.path)};return s.jsxs("section",{className:"pp-group layers",children:[s.jsx("h3",{className:"pp-group-h",title:r.layers.hint,children:r.layers.title}),s.jsx("ul",{className:"layer-tree",role:"tree","aria-label":r.layers.title,title:r.layers.hint,tabIndex:0,onKeyDown:_,children:c.map(J=>W(J,0))})]})}const xx=12,ey=l=>{var c;return((c=/^([a-z]+)[-_]/i.exec(l))==null?void 0:c[1].toUpperCase())??""},wx=j.forwardRef(function(c,u){var N;const[f,h]=j.useState(""),[p,v]=j.useState(null),[C,S]=j.useState(null),T=(N=c.pages[0])==null?void 0:N.id,y=j.useMemo(()=>{const _=f.trim().toLowerCase();return[...new Set(c.board.order)].filter(W=>{const ne=c.board.boards[W];return ne?_?W.toLowerCase().includes(_)||(ne.title??"").toLowerCase().includes(_):!c.pages.length||(ne.page??T)===c.currentPage:!1})},[f,c.board,c.pages,c.currentPage,T]),b=j.useMemo(()=>{if(f.trim()||y.length<xx)return null;const _=new Map;for(const J of y){const ce=ey(J);_.has(ce)||_.set(ce,[]),_.get(ce).push(J)}const W=[..._.keys()].filter(J=>J&&_.get(J).length>=2);if(W.length<2)return null;const ne=y.filter(J=>!W.includes(ey(J)));return[...W.map(J=>({key:J,label:J,files:_.get(J)})),...ne.length?[{key:"",label:r.boardList.otherGroup,files:ne}]:[]]},[y,f]),[k,R]=j.useState(()=>{try{return JSON.parse(localStorage.getItem("design-canvas:groups-closed")??"{}")}catch{return{}}}),B=_=>R(W=>{const ne={...W,[_]:!W[_]};try{localStorage.setItem("design-canvas:groups-closed",JSON.stringify(ne))}catch{}return ne}),X=_=>{var ce;const W=c.board.boards[_],ne=!!W.title&&W.title!==_.replace(/\.html$/,""),J=(ce=c.dotOf)==null?void 0:ce.call(c,_);return s.jsx("li",{children:s.jsxs("button",{className:`row oc-row ${c.selected.includes(_)?"on":""}`,"aria-current":c.selected.includes(_)||void 0,onClick:le=>c.onPick(_,le.shiftKey||le.metaKey),onContextMenu:le=>{c.onBoardMenu&&(le.preventDefault(),c.onBoardMenu(_,le))},title:_,children:[s.jsx("span",{className:"row-title",children:W.title??_}),c.missing.includes(_)&&s.jsx(I,{name:"warn",size:14,className:"warn-icon","aria-label":r.boardList.fileMissing}),J&&s.jsx("span",{className:"idot occ-dot",style:{background:J.color},role:"img","aria-label":J.label,title:J.label}),ne&&s.jsx("span",{className:"row-file",children:_})]})},_)};return s.jsxs("aside",{className:c.className??"left",style:c.style,"aria-label":r.boardList.aria,children:[c.header,c.showPages!==!1&&s.jsxs("section",{className:"left-pages",children:[s.jsxs("div",{className:"oc-sec",children:[s.jsx("span",{children:r.boardList.pages}),c.onAddPage&&s.jsx("button",{className:"icon-btn oc-ib","aria-label":r.boardList.addPage,title:r.boardList.addPage,onClick:c.onAddPage,children:s.jsx(I,{name:"plus",size:16})})]}),c.pages.length===0?s.jsx("p",{className:"oc-empty",children:r.boardList.singlePage}):s.jsx("ul",{className:"oc-list",role:"tablist","aria-label":r.boardList.pages,children:c.pages.map((_,W)=>s.jsx("li",{draggable:!!c.onMovePage,onDragStart:ne=>{v(_.id),ne.dataTransfer.effectAllowed="move"},onDragOver:ne=>{p&&(ne.preventDefault(),S(W))},onDragEnd:()=>{v(null),S(null)},onDrop:ne=>{var ce;ne.preventDefault();const J=c.pages.findIndex(le=>le.id===p);p&&J!==W&&((ce=c.onMovePage)==null||ce.call(c,p,W)),v(null),S(null)},children:s.jsxs("button",{role:"tab",title:r.boardList.pageTabTitle,"aria-selected":_.id===c.currentPage,className:`row oc-row ${_.id===c.currentPage?"on":""} ${C===W&&p!==_.id?"drop-before":""}`,onClick:()=>c.onPage(_.id),onContextMenu:ne=>{c.onPageMenu&&(ne.preventDefault(),c.onPageMenu(_.id,ne))},children:[s.jsx("span",{className:"row-title",children:_.name}),s.jsx("span",{className:"row-count",children:Object.values(c.board.boards).filter(ne=>(ne.page??T)===_.id).length})]})},_.id))})]}),s.jsxs("section",{className:"left-boards",children:[s.jsx("div",{className:"oc-sec",children:s.jsxs("span",{children:[r.boardList.boardsHead,s.jsx("span",{className:"oc-count",children:y.length})]})}),s.jsxs("label",{className:"oc-search",children:[s.jsx(I,{name:"search",size:16}),s.jsx("input",{ref:u,value:f,placeholder:r.boardList.searchPlaceholder,"aria-label":r.boardList.search,onChange:_=>h(_.target.value),onKeyDown:_=>{_.nativeEvent.isComposing||(_.key==="Enter"&&y[0]&&c.onPick(y[0],!1),_.key==="Escape"&&(h(""),_.target.blur()))}})]}),y.length===0?s.jsx("p",{className:"oc-empty",children:f?r.boardList.noMatch(f):r.boardList.emptyPage}):b?s.jsx("ul",{className:"oc-list board-list",children:b.map(_=>{var ne;const W=!k[_.key]||_.files.some(J=>c.selected.includes(J));return s.jsxs("li",{className:`group ${W?"open":""}`,children:[s.jsxs("div",{className:"row oc-row group-head",role:"button",tabIndex:0,"aria-expanded":W,title:r.boardList.groupTitle(_.files.length),onClick:()=>B(_.key),onKeyDown:J=>{(J.key==="Enter"||J.key===" ")&&(J.preventDefault(),B(_.key))},onDoubleClick:()=>{var J;return _.key&&((J=c.onGroupRename)==null?void 0:J.call(c,_.key))},onContextMenu:J=>{c.onGroupMenu&&(J.preventDefault(),c.onGroupMenu(_.key,_.files,J))},children:[s.jsx(I,{name:"chevronRight",size:14,className:"chev"}),s.jsx("span",{className:"row-title",children:_.key&&((ne=c.board.groupNames)==null?void 0:ne[_.key])||_.label}),s.jsx("span",{className:"row-count",children:_.files.length}),c.onGroupMenu&&s.jsx("button",{className:"icon-btn sm group-more","aria-label":r.boardList.groupMenu,title:r.boardList.groupMenu,onClick:J=>{J.stopPropagation();const ce=J.currentTarget.getBoundingClientRect();c.onGroupMenu(_.key,_.files,{clientX:ce.left,clientY:ce.bottom+4})},children:s.jsx(I,{name:"more",size:14})})]}),W&&s.jsx("ul",{className:"oc-list oc-sub",children:_.files.map(X)})]},_.key)})}):s.jsx("ul",{className:"oc-list board-list",children:y.map(X)})]}),c.footer]})});function ty({rects:l,selected:c,view:u,size:f,onJump:h,w:p=200,h:v=130,inset:C=0,className:S="minimap"}){const T=j.useMemo(()=>{if(!l.length)return{x:0,y:0,w:1,h:1};const N=Math.min(...l.map(W=>W.x)),_=Math.min(...l.map(W=>W.y));return{x:N,y:_,w:Math.max(...l.map(W=>W.x+W.w))-N,h:Math.max(...l.map(W=>W.y+W.h))-_}},[l]),y=Math.min((p-C*2)/T.w,(v-C*2)/T.h),b=(p-T.w*y)/2,k=(v-T.h*y)/2,R={x:(-u.x/u.zoom-T.x)*y+b,y:(-u.y/u.zoom-T.y)*y+k,w:Math.max(0,f.w/u.zoom*y),h:Math.max(0,f.h/u.zoom*y)},B=j.useRef(!1),X=N=>{const _=N.currentTarget.getBoundingClientRect(),W=_.width/p;h(((N.clientX-_.left)/W-b)/y+T.x,((N.clientY-_.top)/W-k)/y+T.y)};return s.jsx("div",{className:`${S} ${l.length>30?"many":""}`,role:"img","aria-label":r.minimap.aria,onPointerDown:N=>{B.current=!0,N.currentTarget.setPointerCapture(N.pointerId),X(N)},onPointerMove:N=>B.current&&X(N),onPointerUp:()=>B.current=!1,children:s.jsxs("svg",{width:p,height:v,children:[l.map(N=>s.jsx("rect",{x:(N.x-T.x)*y+b,y:(N.y-T.y)*y+k,width:Math.max(1,N.w*y),height:Math.max(1,N.h*y),rx:2,className:c.includes(N.file)?"mm-sel":"mm-board"},N.file)),s.jsx("rect",{x:Math.round(R.x)+.5,y:Math.round(R.y)+.5,width:Math.max(0,Math.round(R.w)-1),height:Math.max(0,Math.round(R.h)-1),rx:3,className:"mm-view"})]})})}function jx(l){const c=l.item,u=r.boardOptions,f=(h,p,v,C,S=!1)=>s.jsx(Nx,{label:p,bare:S,value:c[h]??0,min:v,max:C,onCommit:T=>l.onPatch({[h]:T})},h+l.file+(c[h]??""));return s.jsxs(s.Fragment,{children:[s.jsxs("header",{className:"pp-head","aria-label":u.aria,children:[s.jsx("button",{className:"pp-file",onClick:l.onRenameFile,title:u.renameFileTitle,children:l.file}),s.jsxs("h2",{className:"pp-name",children:[s.jsx("span",{children:c.title??l.file}),s.jsx("button",{className:"icon-btn pp-ib","aria-label":r.menu.rename,title:u.renameTitle,onClick:l.onRename,children:s.jsx(I,{name:"edit",size:16})})]})]}),s.jsxs("section",{className:"pp-group",children:[s.jsx("h3",{className:"pp-group-h",children:u.positionAndSize}),s.jsxs("div",{className:"pp-row",children:[s.jsx("span",{className:"pp-l",children:u.position}),s.jsxs("span",{className:"pp-two",children:[f("x","X"),f("y","Y")]})]}),s.jsxs("div",{className:"pp-row",children:[s.jsx("span",{className:"pp-l",children:r.boardOptions.size}),s.jsxs("span",{className:"pp-two",children:[f("w",u.width,40,8e3),f("h",u.height,40,8e3)]})]}),s.jsxs("div",{className:"pp-row",children:[s.jsx("span",{className:"pp-l",children:u.radius}),s.jsx("span",{className:"pp-two",children:f("radius",u.radius,0,200,!0)})]})]}),s.jsxs("section",{className:"pp-group",children:[s.jsx("h3",{className:"pp-group-h",children:u.options}),s.jsx(Wr,{on:!!c.is_interactive,label:u.interactive,title:u.interactiveTitle,onChange:h=>l.onPatch({is_interactive:h||void 0})}),s.jsx(Wr,{on:!!c.frameless,label:u.frameless,onChange:h=>l.onPatch({frameless:h||void 0})}),s.jsx(Wr,{on:c.expand==="fill",label:u.fill,onChange:h=>l.onPatch({expand:h?"fill":void 0})}),s.jsx(Wr,{on:l.isLaunch,label:u.launch,onChange:l.onLaunch}),l.pages.length>0&&s.jsxs("label",{className:"pp-row",children:[s.jsx("span",{className:"pp-l",children:u.page}),s.jsx("select",{value:c.page??l.pages[0].id,onChange:h=>l.onPatch({page:h.target.value}),children:l.pages.map(h=>s.jsx("option",{value:h.id,children:h.name},h.id))})]})]})]})}function Sx(l){const c=r.boardOptions;return s.jsxs("footer",{className:"pp-actions","aria-label":r.inspector.boardActions,children:[s.jsx("button",{className:"icon-btn","aria-label":c.focus,title:c.focusTitle,onClick:l.onFocus,children:s.jsx(I,{name:"focus"})}),s.jsx("button",{className:"icon-btn","aria-label":c.duplicate,title:c.duplicateTitle,onClick:l.onDuplicate,children:s.jsx(I,{name:"copy"})}),s.jsx("button",{className:"icon-btn","aria-label":c.front,title:c.frontTitle,onClick:l.onFront,children:s.jsx(I,{name:"front"})}),s.jsx("button",{className:"icon-btn","aria-label":c.back,title:c.backTitle,onClick:l.onBack,children:s.jsx(I,{name:"back"})}),s.jsx("button",{className:"icon-btn pp-del","aria-label":c.delete,title:c.deleteTitleKey,onClick:l.onDelete,children:s.jsx(I,{name:"trash"})})]})}function Wr(l){return s.jsxs("label",{className:"check",title:l.title,children:[s.jsx("input",{type:"checkbox",checked:l.on,onChange:c=>l.onChange(c.target.checked)}),s.jsx("i",{className:l.on?"on":"","aria-hidden":"true",children:l.on&&s.jsx(I,{name:"check",size:12})}),l.label]})}function Nx({label:l,value:c,min:u,max:f,bare:h,onCommit:p}){const[v,C]=j.useState(String(c));j.useEffect(()=>C(String(c)),[c]);const S=()=>{let T=Math.round(Number(v));if(!Number.isFinite(T))return C(String(c));u!=null&&(T=Math.max(u,T)),f!=null&&(T=Math.min(f,T)),T!==c&&p(T),C(String(T))};return s.jsxs("label",{className:"num",children:[!h&&s.jsx("span",{children:l}),s.jsx("input",{inputMode:"numeric","aria-label":h?l:void 0,value:v,onChange:T=>C(T.target.value),onBlur:S,onKeyDown:T=>{if(!T.nativeEvent.isComposing&&(T.key==="Enter"&&T.target.blur(),T.key==="ArrowUp"||T.key==="ArrowDown")){T.preventDefault();const y=Number(v)+(T.key==="ArrowUp"?1:-1)*(T.shiftKey?10:1);C(String(y))}}})]})}function Tx({board:l,file:c,onClose:u,onNav:f}){const h=l.boards[c],p=j.useRef(null),[v,C]=j.useState(1),S=[...new Set(l.order)].filter(b=>l.boards[b]),T=S.indexOf(c);if(j.useEffect(()=>{const b=k=>{k.key==="Escape"&&u(),k.key==="ArrowRight"&&S[T+1]&&f(S[T+1]),k.key==="ArrowLeft"&&S[T-1]&&f(S[T-1])};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[c,u,f,T,S]),j.useEffect(()=>{const b=()=>{const k=p.current;!k||!h||C(Math.min(1,(k.clientWidth-48)/h.w,(k.clientHeight-48)/h.h))};return b(),window.addEventListener("resize",b),()=>window.removeEventListener("resize",b)},[h]),!h)return null;const y=h.expand==="fill";return s.jsxs("div",{className:"focus",role:"dialog","aria-modal":"true","aria-label":r.focus.aria(h.title??c),children:[s.jsxs("div",{className:"focus-bar",children:[s.jsx("button",{className:"icon-btn","aria-label":r.focus.prev,disabled:!S[T-1],onClick:()=>f(S[T-1]),children:s.jsx(I,{name:"chevronRight",style:{transform:"rotate(180deg)"}})}),s.jsx("button",{className:"icon-btn","aria-label":r.focus.next,disabled:!S[T+1],onClick:()=>f(S[T+1]),children:s.jsx(I,{name:"chevronRight"})}),s.jsx("strong",{children:h.title??c}),s.jsxs("span",{className:"muted",children:[c,y?r.focus.pageStyle:` · ${h.w}×${h.h} · ${Math.round(v*100)}%`]}),s.jsx("div",{className:"spacer"}),s.jsxs("button",{onClick:u,children:[r.focus.close," ",s.jsx("kbd",{children:"Esc"})]})]}),s.jsx("div",{ref:p,className:`focus-stage ${y?"fill":""}`,children:y?s.jsx("iframe",{src:`/screens/${c}`,title:h.title??c,className:"focus-fill"}):s.jsx("div",{className:"focus-frame",style:{width:h.w*v,height:h.h*v,borderRadius:(h.radius??0)*v},children:s.jsx("iframe",{src:`/screens/${c}`,title:h.title??c,style:{width:h.w,height:h.h,transform:`scale(${v})`,transformOrigin:"0 0"}})})})]})}const ny="https://screens.invalid/",Cx=l=>l.split("/").map(encodeURIComponent).join("/");function Ex({board:l,file:c,onClose:u,onLocate:f,screens:h=my}){var N;const p=j.useRef(null),[v,C]=j.useState(c),[S,T]=j.useState({list:[c],i:0}),y=!!h.html,b=y?S.list[S.i]:v,k=l.boards[b]??l.boards[c],R=_=>T(W=>({list:[...W.list.slice(0,W.i+1),_],i:W.i+1})),B=_=>{var W,ne,J,ce;if(y)return T(le=>({...le,i:Math.max(0,Math.min(le.list.length-1,le.i+_))}));try{_<0?(ne=(W=p.current)==null?void 0:W.contentWindow)==null||ne.history.back():(ce=(J=p.current)==null?void 0:J.contentWindow)==null||ce.history.forward()}catch{}},X=()=>{var W,ne,J;let _=null;try{_=((W=p.current)==null?void 0:W.contentDocument)??null}catch{}if(_==null||_.addEventListener("click",ce=>{var F,re,we;const le=(re=(F=ce.target)==null?void 0:F.closest)==null?void 0:re.call(F,"a[href]");if(!le)return;if(y){const Te=new URL(le.getAttribute("href")??"",ny+Cx(b));if(Te.href.startsWith(ny)){const st=decodeURIComponent(Te.pathname.slice(1));if(st===b&&Te.hash)return;ce.preventDefault(),((we=h.html)==null?void 0:we.call(h,st))!=null&&R(st);return}ce.preventDefault(),window.open(Te.href,"_blank","noopener");return}const oe=new URL(le.href,_.baseURI);oe.origin!==location.origin&&(ce.preventDefault(),window.open(oe.href,"_blank","noopener"))}),!y)try{const ce=new URL(h.url(""),location.href).href,le=((J=(ne=p.current)==null?void 0:ne.contentWindow)==null?void 0:J.location.href)??"";le.startsWith(ce)&&C(decodeURIComponent(le.slice(ce.length).split(/[?#]/)[0]))}catch{}};return j.useEffect(()=>{const _=W=>W.key==="Escape"&&u();return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[u]),s.jsxs("div",{className:"play",onPointerDown:_=>_.target===_.currentTarget&&u(),children:[s.jsxs("div",{className:"play-bar",children:[s.jsx("button",{onClick:()=>B(-1),title:r.play.back,disabled:y&&S.i===0,children:"←"}),s.jsx("button",{onClick:()=>B(1),title:r.play.forward,disabled:y&&S.i>=S.list.length-1,children:"→"}),s.jsx("strong",{children:(k==null?void 0:k.title)??b}),s.jsx("span",{className:"muted",children:b}),s.jsx("div",{className:"spacer"}),s.jsx("button",{onClick:()=>{f(b),u()},children:r.play.viewOnCanvas}),s.jsx("button",{onClick:u,title:r.play.closeTitle,children:r.play.close})]}),s.jsx("iframe",{ref:p,className:"play-frame",src:y?void 0:h.url(c),srcDoc:y?(N=h.html)==null?void 0:N.call(h,b):void 0,title:"Play",onLoad:X,style:{width:Math.min((k==null?void 0:k.w)??390,window.innerWidth-32)}})]})}function Mx(l,c){return l.length===1&&Object.hasOwn(c,l[0])?"play":"pen"}const dt=r.design,kx=[{prop:"width",label:r.properties.fields.width},{prop:"height",label:r.properties.fields.height},{prop:"margin",label:"margin"},{prop:"color",label:r.properties.fields.color,color:!0},{prop:"background",label:r.properties.fields.background,color:!0},{prop:"display",label:"display",options:["","block","flex","grid","inline-flex","none"]},{prop:"flex-direction",label:r.properties.fields.flexDirection,options:["","row","column"]},{prop:"align-items",label:r.properties.fields.alignItems,options:["","flex-start","center","flex-end","stretch","baseline"]},{prop:"justify-content",label:r.properties.fields.justifyContent,options:["","flex-start","center","flex-end","space-between"]},{prop:"flex-wrap",label:r.properties.fields.flexWrap,options:["","nowrap","wrap"]},{prop:"flex-grow",label:r.properties.fields.flexGrow,options:["","0","1"]},{prop:"align-self",label:r.properties.fields.alignSelf,options:["","auto","flex-start","center","flex-end","stretch"]},{prop:"line-height",label:r.properties.fields.lineHeight},{prop:"text-align",label:r.properties.fields.textAlign,options:["","left","center","right"]},{prop:"border",label:r.properties.fields.border},{prop:"box-shadow",label:r.properties.fields.boxShadow},{prop:"opacity",label:r.properties.fields.opacity}];function ly(l){if(!l||l==="none")return null;const c=l.match(/^\s*repeat\(\s*(\d+)\s*,/);if(c)return Number(c[1]);let u=0,f=0,h=!1;for(const p of l)p==="("&&u++,p===")"&&u--,/\s/.test(p)&&u===0?h=!1:h||(h=!0,f++);return f||null}const zx=l=>`repeat(${l}, minmax(0, 1fr))`,Ax=[{dir:"left",label:r.properties.alignButtons.left,icon:"alignLeft"},{dir:"hcenter",label:r.properties.alignButtons.hcenter,icon:"alignHcenter"},{dir:"right",label:r.properties.alignButtons.right,icon:"alignRight"},{dir:"top",label:r.properties.alignButtons.top,icon:"alignTop"},{dir:"vcenter",label:r.properties.alignButtons.vcenter,icon:"alignVcenter"},{dir:"bottom",label:r.properties.alignButtons.bottom,icon:"alignBottom"}],Ox={a:["href"],img:["src","alt"],input:["placeholder"],button:["aria-label"]};function Dx(l){var X;const c=l.selection,u=Ox[c.tag]??[],f=Ny(l.tokens),h=Ty(c,l.inline),p=!!c.text.trim(),[v,C]=j.useState(null);j.useEffect(()=>C(null),[c.file,c.path]);const S=c.path+c.hash,T=N=>Fp(N,l.inline[N]??"",l.tokens),y=N=>{var W;const _=xn(N);return _==="#FFFFFF"?dt.white:_==="#000000"?dt.black:((W=dc(N,f))==null?void 0:W.name)??_??N},b=xn(c.styles["background-color"]),k=p?h.prop==="background"?Pr(c.styles.color??"",b??l.bg):Pr(c.styles.color??"",l.bg):null,R=k==null?null:h.prop==="background"?dt.contrastWith(k.toFixed(1),y(c.styles.color??""),dt.grade(k)):dt.contrastOn(k.toFixed(1),y(l.bg),dt.grade(k)),B=[...new Set([...(X=l.tokens)!=null&&X.registered?l.tokens.fontWeights:[],100,200,300,400,500,600,700,800,900])].sort((N,_)=>N-_);return s.jsxs(s.Fragment,{children:[s.jsxs("section",{className:"pp-group",children:[s.jsx("h3",{className:"pp-group-h",children:dt.fill}),s.jsx(pi,{word:dt.color,css:h.css,children:s.jsx(ay,{value:h.value,computed:h.prop==="color"?c.styles.color:c.styles["background-color"],colors:f,css:h.css,label:dt.fill,open:v==="fill",onToggle:()=>C(N=>N==="fill"?null:"fill")})}),R&&s.jsx("div",{className:"pp-row",children:s.jsx("span",{className:`pp-note contrast ${k>=4.5?"ok":k>=3?"mid":"bad"}`,title:r.properties.contrastTitle,children:R})}),v==="fill"&&s.jsx(Ff,{title:dt.fill,value:h.value,colors:f,vars:l.vars,onPick:N=>l.onStyle(h.css,N)})]}),p&&s.jsxs("section",{className:"pp-group",children:[s.jsx("h3",{className:"pp-group-h",children:dt.text}),s.jsx(pi,{word:dt.font,css:"font-family",children:s.jsx(ic,{label:dt.font,value:Up(l.inline["font-family"]),placeholder:Up(c.styles["font-family"]),onCommit:N=>l.onStyle("font-family",N?Vb(N):"")},"ff"+S)}),s.jsx(pi,{word:dt.size,css:"font-size",warn:T("font-size"),children:s.jsx(ic,{label:dt.size,value:Bl(l.inline["font-size"]),placeholder:Bl(c.styles["font-size"]),onCommit:N=>l.onStyle("font-size",$f(N))},"fs"+S)}),s.jsx(pi,{word:dt.weight,css:"font-weight",warn:T("font-weight"),children:s.jsxs("select",{"aria-label":dt.weight,defaultValue:l.inline["font-weight"]??"",onChange:N=>l.onStyle("font-weight",N.target.value),children:[s.jsx("option",{value:"",children:dt.inherited(Vf(c.styles["font-weight"],dt.weights))}),B.map(N=>s.jsx("option",{value:String(N),children:Vf(N,dt.weights)},N))]},"fw"+S)}),h.prop==="background"&&s.jsxs(s.Fragment,{children:[s.jsx(pi,{word:dt.color,css:"color",children:s.jsx(ay,{value:l.inline.color??"",computed:c.styles.color,colors:f,css:"color",label:dt.color,open:v==="color",onToggle:()=>C(N=>N==="color"?null:"color")})}),v==="color"&&s.jsx(Ff,{title:dt.color,value:l.inline.color||c.styles.color||"",colors:f,vars:l.vars,onPick:N=>l.onStyle("color",N)})]})]}),s.jsxs("section",{className:"pp-group",children:[s.jsx("h3",{className:"pp-group-h",children:r.properties.layout}),s.jsx(pi,{word:dt.cornerRadius,css:"border-radius",warn:T("border-radius"),children:s.jsx(ic,{label:dt.cornerRadius,value:Bl(l.inline["border-radius"]),placeholder:Bl(c.styles["border-radius"]),onCommit:N=>l.onStyle("border-radius",$f(N))},"br"+S)}),s.jsx(pi,{word:dt.padding,css:"padding",warn:T("padding"),children:s.jsx(ic,{label:dt.padding,value:Xf(l.inline.padding),placeholder:Xf(c.styles.padding),onCommit:N=>l.onStyle("padding",qb(N))},"pd"+S)}),s.jsx(pi,{word:dt.gap,css:"gap",warn:T("gap"),children:s.jsx(ic,{label:dt.gap,value:Bl(l.inline.gap),placeholder:Bl(c.styles.gap==="normal"?"":c.styles.gap),onCommit:N=>l.onStyle("gap",$f(N))},"gp"+S)}),s.jsxs("div",{className:"pp-row",children:[s.jsx("span",{className:"pp-l",children:r.properties.align}),s.jsx("span",{className:"align-set",role:"group","aria-label":r.properties.align,children:Ax.map(N=>s.jsx("button",{className:"icon-btn","aria-label":N.label,title:N.label,onClick:()=>l.onAlign(N.dir),children:s.jsx(I,{name:N.icon,size:16})},N.dir))})]}),s.jsxs("div",{className:"pp-row",children:[s.jsx("span",{className:"pp-l",children:r.properties.wrap}),s.jsxs("span",{className:"pp-btns",children:[s.jsx("button",{className:"btn",onClick:()=>l.onWrap("flex"),disabled:!l.canWrap,title:r.properties.wrapTitle,children:r.properties.wrapFlex}),s.jsx("button",{className:"btn",onClick:()=>l.onWrap("grid"),disabled:!l.canWrap,title:r.properties.wrapTitle,children:r.properties.wrapGrid})]})]}),l.onReplaceImage&&s.jsxs("div",{className:"pp-row",children:[s.jsx("span",{className:"pp-l",children:r.properties.image}),s.jsx("span",{className:"pp-btns",children:s.jsx("button",{className:"btn",onClick:l.onReplaceImage,children:r.properties.replaceImage})})]})]}),l.children,s.jsx(Qs,{id:"more-css",title:dt.more,children:s.jsxs("div",{className:"more-css",children:[kx.map(N=>s.jsx(Lf,{label:N.label,value:l.inline[N.prop]??(N.prop==="background"?l.inline["background-color"]??"":""),placeholder:c.styles[N.prop==="background"?"background-color":N.prop]??"",options:N.options,color:N.color,swatches:N.color?f:void 0,warn:Fp(N.prop,l.inline[N.prop]??(N.prop==="background"?l.inline["background-color"]??"":""),l.tokens),ratio:N.prop==="color"?Pr(l.inline.color||c.styles.color||"",l.bg):null,onCommit:_=>l.onStyle(N.prop,_)},N.prop+S)),(l.inline.display??c.styles.display??"").includes("grid")&&["grid-template-columns","grid-template-rows"].map(N=>s.jsx(Lf,{label:N.endsWith("columns")?r.properties.columns:r.properties.rows,value:String(ly(l.inline[N])??""),placeholder:String(ly(c.styles[N])??""),onCommit:_=>l.onStyle(N,/^\d+$/.test(_)&&Number(_)>0?zx(Math.min(24,Number(_))):_)},N+S)),u.map(N=>s.jsx(Lf,{label:N,value:l.attrs[N]??"",placeholder:"",onCommit:_=>l.onAttr(N,_===""?null:_)},N+S))]})})]})}const $f=l=>/^-?\d+(?:\.\d+)?$/.test(l.trim())?`${Number(l)}px`:l.trim();function pi(l){return s.jsxs("label",{className:"pp-row",title:l.css,children:[s.jsxs("span",{className:"pp-l",children:[l.word,l.warn&&s.jsxs("span",{className:"tok-warn",title:l.warn,"aria-label":r.properties.offToken(l.warn),children:[" ","⚠"]})]}),l.children]})}function ic(l){const[c,u]=j.useState(l.value);j.useEffect(()=>u(l.value),[l.value]);const f=()=>c.trim()!==l.value.trim()&&l.onCommit(c.trim());return s.jsx("input",{"aria-label":l.label,value:c,placeholder:l.placeholder,onChange:h=>u(h.target.value),onBlur:f,onKeyDown:h=>{h.nativeEvent.isComposing||(h.key==="Enter"&&h.currentTarget.blur(),h.key==="Escape"&&(u(l.value),h.stopPropagation()))}})}function ay(l){const c=l.value||l.computed||"",u=dc(c,l.colors),f=xn(c)??xn(l.computed)??(u?xn(u.value):null);return s.jsxs("button",{className:`fillv ${l.open?"on":""}`,"aria-expanded":l.open,"aria-label":dt.openFill(l.label),title:l.css,onClick:h=>{h.preventDefault(),l.onToggle()},children:[s.jsx("span",{className:"sw",style:{background:f??"transparent"}}),s.jsx("span",{className:"fillv-name",children:(u==null?void 0:u.name)??f??dt.none}),u&&f&&s.jsx("span",{className:"muted",children:f})]})}function Lf(l){const[c,u]=j.useState(l.value);j.useEffect(()=>u(l.value),[l.value]);const f=(h=c)=>{h.trim()!==l.value.trim()&&l.onCommit(h.trim())};return s.jsxs("label",{className:"field",children:[s.jsxs("span",{children:[l.label,l.warn&&s.jsxs("span",{className:"tok-warn",title:l.warn,"aria-label":r.properties.offToken(l.warn),children:[" ","⚠"]})]}),l.options?s.jsx("select",{value:c,onChange:h=>{u(h.target.value),f(h.target.value)},children:l.options.map(h=>s.jsx("option",{value:h,children:h||`(${l.placeholder||r.properties.none})`},h))}):s.jsx("input",{value:c,placeholder:l.placeholder,onChange:h=>u(h.target.value),onBlur:()=>f(),onKeyDown:h=>{h.nativeEvent.isComposing||(h.key==="Enter"&&h.currentTarget.blur(),h.key==="Escape"&&(u(l.value),h.currentTarget.blur()))}}),l.ratio!=null&&s.jsxs("span",{className:`ratio ${l.ratio>=4.5?"ok":l.ratio>=3?"mid":"bad"}`,title:r.properties.contrastTitle,children:[r.properties.contrast," ",l.ratio.toFixed(2),":1 · ",l.ratio>=7?"AAA":l.ratio>=4.5?"AA":l.ratio>=3?r.properties.largeTextOnly:r.properties.tooLow]}),l.chips&&s.jsx("span",{className:"chips-row",children:l.chips.map(h=>s.jsx("button",{className:`tchip ${c===h?"on":""}`,onClick:p=>{p.preventDefault(),u(h),f(h)},children:h.replace("px","")},h))}),l.color&&s.jsx("span",{className:"swatches",children:(l.swatches??[]).map(h=>s.jsx("button",{className:`swatch ${c.toUpperCase()===h.value?"on":""}`,title:`${h.name} ${h.value}`,style:{background:h.value},onClick:p=>{p.preventDefault(),u(h.value),f(h.value)}},h.value))})]})}const iy=384,sy=l=>/^[\w./@:,=+-]+$/.test(l)?l:`'${l.replace(/'/g,"'\\''")}'`,Rx=l=>l>=1048576?`${(l/1048576).toFixed(1)} MB`:`${Math.max(1,Math.round(l/1024))} KB`;function _x(l){const c=["npx easel-canvas export"];return l.dirFlag&&c.push(l.dirFlag),l.scope==="page"&&l.page&&c.push(`--page ${sy(l.pages.filter(u=>u.name===l.page.name).length>1?l.page.id:l.page.name)}`),l.scope==="boards"&&l.boards.length&&c.push(`--boards ${sy(l.boards.join(","))}`),l.single&&c.push("--single-file"),c.join(" ")}function Bx({pages:l,currentPage:c,selected:u}){const f=wy(),[h,p]=j.useState(!1),[v,C]=j.useState("all"),[S,T]=j.useState(!1),[y,b]=j.useState(null),[k,R]=j.useState(null),[B,X]=j.useState(null),[N,_]=j.useState({}),[W,ne]=j.useState({}),[J,ce]=j.useState({left:0,top:0,width:iy}),le=j.useRef(null),oe=j.useRef(null),F=l.find(E=>E.id===c)??l[0],re=v==="boards"&&!u.length||v==="page"&&!l.length?"all":v,we={scope:re,page:re==="page"?F==null?void 0:F.id:void 0,boards:re==="boards"?u:void 0},Te=(E=!0)=>{var Y;p(!1),E&&((Y=le.current)==null||Y.focus())},st=()=>{if(h)return Te();C(u.length?"boards":"all"),p(!0)};j.useLayoutEffect(()=>{if(!h)return;const E=()=>{var se;const Y=le.current.getBoundingClientRect(),A=((se=le.current.closest(".oc-card"))==null?void 0:se.getBoundingClientRect())??Y,ie=Math.min(iy,window.innerWidth-16);ce({width:ie,top:Math.round(Y.bottom+8),left:Math.round(Math.max(8,Math.min(A.right-ie,window.innerWidth-ie-8)))})};return E(),window.addEventListener("resize",E),()=>window.removeEventListener("resize",E)},[h]),j.useLayoutEffect(()=>{h&&Ul(oe.current,".oc-seg button, .btn")}),j.useEffect(()=>{var A,ie;if(!h)return;(ie=(A=oe.current)==null?void 0:A.querySelector(".oc-seg [aria-checked='true']"))==null||ie.focus();const E=se=>{var ae,de;const ge=se.target;!((ae=oe.current)!=null&&ae.contains(ge))&&!((de=le.current)!=null&&de.contains(ge))&&Te(!1)},Y=se=>{se.key==="Escape"&&(se.stopPropagation(),Te())};return document.addEventListener("pointerdown",E,!0),window.addEventListener("keydown",Y,!0),()=>{document.removeEventListener("pointerdown",E,!0),window.removeEventListener("keydown",Y,!0)}},[h]),j.useEffect(()=>{h&&!y&&Ne.get("/api/export").then(b,()=>{})},[h]);const Ot=JSON.stringify(we);j.useEffect(()=>{if(!h||!S)return;let E=!0;return R(null),Ne.post("/api/export/estimate",we).then(Y=>E&&R(Y.bytes),()=>{}),()=>{E=!1}},[h,S,Ot]);const Dt=async E=>{if(!B){X(E),ne(Y=>({...Y,[E]:void 0}));try{const Y=await Ne.post("/api/export",{...we,format:E==="pdf"||E==="png"?E:"web",singleFile:E==="single"});_(A=>({...A,[E]:Y})),E==="single"&&R(Y.bytes)}catch(Y){ne(A=>({...A,[E]:Y.message}))}finally{X(null)}}},tt=()=>Ne.post("/api/export/reveal",{}).catch(E=>f({tone:"error",text:E.message})),ue=async E=>{try{await navigator.clipboard.writeText(E),f({tone:"ok",text:r.share.copied(E)})}catch{f({tone:"error",text:r.share.copyFailed})}},me=S?"single":"web",be=N[me],je=y&&!y.browser.ok?y.browser.reason??"":null,Ce=(y==null?void 0:y.project)??"",ot=E=>`${Ce?Ce+"/":""}${E.mainRel.endsWith("/")||E.kind==="web"?E.outRel:E.mainRel}`,Et=(y==null?void 0:y.single)??`${Ce}-canvas.html`,Me=(E,Y)=>s.jsxs("span",{className:"oc-res",role:"status",children:[s.jsxs("span",{className:"oc-rline",children:[s.jsx(I,{name:"check",size:16}),s.jsx("code",{children:E.kind==="single"?E.mainRel.split("/").pop():ot(E)})," ",E.kind==="single"?r.share.saved:r.share.exported]}),s.jsxs("span",{className:"oc-racts",children:[s.jsx("button",{className:"btn",title:r.share.revealTitle,onClick:()=>void tt(),children:r.share.reveal}),Y.deploy&&E.deploy&&s.jsx("button",{className:"btn",title:r.share.copyDeployTitle(E.deploy),onClick:()=>void ue(E.deploy),children:r.share.copyDeploy})]}),Y.hint&&s.jsx("span",{className:"oc-rhint",children:r.share.attachHint}),E.skipped.length>0&&s.jsx("span",{className:"oc-rhint",title:E.skipped.map(A=>`${A.ref} (${A.from}): ${A.reason}`).join(`
63
+ `),children:r.share.skipped(E.skipped.length)})]}),U=(E,Y,A,ie)=>s.jsxs("div",{className:"oc-orow",children:[s.jsx("span",{className:"out-ic",children:s.jsx(I,{name:Y})}),s.jsxs("span",{className:"oc-otext",children:[s.jsx("strong",{children:A}),s.jsx("span",{children:je?`${r.share.unavailable} ${je}`:ie})]}),s.jsx("button",{className:"btn",disabled:!!je,"aria-busy":B===E,onClick:()=>void Dt(E),children:B===E?r.share.working:r.share.export}),W[E]&&s.jsx(oy,{text:W[E]}),N[E]&&!W[E]&&Me(N[E],{})]});return s.jsxs("div",{className:"share-wrap",children:[s.jsxs("button",{ref:le,className:`share-btn ${h?"on":""}`,"aria-haspopup":"dialog","aria-expanded":h,"aria-label":r.share.button,title:r.share.buttonTitle,onClick:st,children:[s.jsx(I,{name:"share",size:16})," ",s.jsx("span",{className:"share-label",children:r.share.button})]}),h&&s.jsxs("div",{ref:oe,className:"share-pop oc-share entering",role:"dialog","aria-label":r.share.title,style:{left:J.left,top:J.top,width:J.width},onKeyDown:E=>{E.stopPropagation()},children:[s.jsx("h4",{children:r.share.title}),s.jsxs("div",{className:"oc-seg",role:"radiogroup","aria-label":r.share.scope,children:[s.jsx("button",{role:"radio","aria-checked":re==="all",className:re==="all"?"on":"",onClick:()=>C("all"),children:r.share.whole}),s.jsx("button",{role:"radio","aria-checked":re==="page",className:re==="page"?"on":"",disabled:!l.length,title:l.length?F==null?void 0:F.name:r.share.pageNone,onClick:()=>C("page"),children:r.share.page}),u.length>0&&s.jsx("button",{role:"radio","aria-checked":re==="boards",className:re==="boards"?"on":"",onClick:()=>C("boards"),children:r.share.selected(u.length)})]}),s.jsxs("div",{className:"oc-out",children:[s.jsxs("div",{className:"oc-orow first",children:[s.jsx("span",{className:"out-ic",children:s.jsx(I,{name:S?"file":"folder"})}),s.jsxs("span",{className:"oc-otext",children:[s.jsx("strong",{children:S?r.share.singleTitle:r.share.webTitle}),s.jsx("span",{children:S?s.jsxs(s.Fragment,{children:[s.jsx("code",{children:Et}),r.share.singleHint(k==null?r.share.measuring:Rx(k))]}):r.share.webHint}),s.jsxs("label",{className:"oc-sw",children:[s.jsx("button",{type:"button",role:"switch","aria-checked":S,className:`switch ${S?"on":""}`,onClick:()=>T(E=>!E)}),s.jsx("span",{children:r.share.singleSwitch})]})]}),s.jsx("button",{className:"btn","aria-busy":B===me,onClick:()=>void Dt(me),children:B===me?r.share.working:S?r.share.save:r.share.export}),W[me]&&s.jsx(oy,{text:W[me]}),be&&!W[me]&&Me(be,{deploy:!S,hint:S})]}),U("pdf","pdf",r.share.pdfTitle,r.share.pdfHint),U("png","image",r.share.pngTitle,r.share.pngHint)]}),s.jsxs("div",{className:"oc-pfoot",children:[S&&s.jsx("span",{children:r.share.largeFiles}),s.jsxs("span",{children:[r.share.sameAs," ",s.jsx("code",{children:_x({dirFlag:y==null?void 0:y.dirFlag,scope:re,page:F,pages:l,boards:u,single:S})})]})]})]})]})}function oy({text:l}){return s.jsxs("span",{className:"oc-err",role:"alert",children:[s.jsx(I,{name:"warn",size:16}),s.jsx("span",{children:l})]})}const Ux=400,wt=navigator.platform.includes("Mac")?"⌘":"Ctrl+",Ey=l=>`design-canvas:${l}`;function Hx(l){try{return JSON.parse(localStorage.getItem(Ey(l))??"{}")}catch{return{}}}const $x=[{id:"blank",label:r.templates.blank,size:"390×844",w:390,h:844},{id:"mobile",label:r.templates.mobile,size:"390×844",w:390,h:844},{id:"desktop",label:r.templates.desktop,size:"1440×900",w:1440,h:900},{id:"doc",label:r.templates.doc,size:"800×1000",w:800,h:1e3}],yi=[{id:"select",icon:"select",label:r.tools.select,hint:r.toolHints.select,key:"V"},{id:"hand",icon:"hand",label:r.tools.hand,hint:r.toolHints.hand,key:"H"},{id:"board",icon:"board",label:r.tools.board,hint:r.toolHints.board,key:"B"},{id:"title",icon:"title",label:r.tools.title,hint:r.toolHints.title,key:"T"},{id:"sticky",icon:"sticky",label:r.tools.sticky,hint:r.toolHints.sticky,key:"N"},{id:"rect",icon:"rect",label:r.tools.rect,hint:r.toolHints.rect,key:"R"},{id:"oval",icon:"oval",label:r.tools.oval,hint:r.toolHints.oval,key:"O"},{id:"line",icon:"line",label:r.tools.line,hint:r.toolHints.line,key:"L"},{id:"arrow",icon:"arrow",label:r.tools.arrow,hint:r.toolHints.arrow,key:"A"},{id:"pen",icon:"pen",label:r.tools.pen,hint:r.toolHints.pen,key:"P"}],Lx=["rect","oval","line","arrow","pen"];function Yx(){var Ac,Oc,Dc,Rc,Tn,Va,fs,vo,bo,xo,wo,hs,_c,ja,ms;const[l,c]=j.useState(null),[u,f]=j.useState(null),[h,p]=j.useState({x:0,y:0,zoom:.1}),[v,C]=j.useState(null),[S,T]=j.useState("select"),[y,b]=j.useState([]),[k,R]=j.useState([]),B=k.length===1?k[0]:null,X=d=>R(d?[d]:[]),[N,_]=j.useState(null),[W,ne]=j.useState(null),[J,ce]=j.useState(null),[le,oe]=j.useState(null),F=j.useRef(null),[re,we]=j.useState(null),[Te,st]=j.useState(null),[Ot,Dt]=j.useState(!1),[tt,ue]=j.useState(""),[me,be]=j.useState(null),[je,Ce]=j.useState(!0),[ot,Et]=j.useState(()=>({w:window.innerWidth,h:window.innerHeight}));j.useEffect(()=>{const d=()=>Et({w:window.innerWidth,h:window.innerHeight});return window.addEventListener("resize",d),()=>window.removeEventListener("resize",d)},[]);const Me=ot.w<=1e3,U=ot.w<=480,[E,Y]=j.useState(!0),[A,ie]=j.useState(!1),[se,ge]=j.useState(null),[ae,de]=j.useState({canUndo:!1,canRedo:!1,undo:[],redo:[]}),[Ae,Ve]=j.useState({}),[ft,Rt]=j.useState(null),[Ee,Re]=j.useState(null),[at,ct]=j.useState([]),[ht,un]=j.useState("inspect"),[Sl,Nl]=j.useState(""),[sa,Un]=j.useState({comments:[],refs:[]}),[sl,Hl]=j.useState({}),wn=j.useRef(new Set),vi=j.useCallback(d=>(wn.current.add(d),()=>void wn.current.delete(d)),[]),Ra=j.useRef(null),_a=j.useRef(0),[dn,Hn]=j.useState("boards"),[$l,Ll]=j.useState(0),[Tl,Wn]=j.useState(null),[rt,Ze]=j.useState([]),tn=rt.length===1?rt[0]:null,Cl=d=>Ze(d?[d]:[]),[Yl,ol]=j.useState(0),Mt=q0(Yl),[Gl,oa]=j.useState(()=>{try{return localStorage.getItem("design-canvas:author")??""}catch{return""}});j.useEffect(()=>{Gl||Ne.get("/api/me").then(d=>d.name&&oa(d.name)).catch(()=>{})},[]),j.useEffect(()=>Cb(Gl),[Gl]);const cl=Gl||r.app.defaultAuthor,[Vt,jn]=j.useState(null),[Ut,ca]=j.useState(null),bi=j.useRef(null),ns=j.useRef(()=>{}),[ql,ra]=j.useState(!0),[kn,zn]=j.useState(()=>{try{return localStorage.getItem("design-canvas:theme")||"system"}catch{return"system"}});j.useEffect(()=>{kn==="system"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",kn);try{localStorage.setItem("design-canvas:theme",kn)}catch{}},[kn]);const[$n,In]=j.useState(null),ua=j.useRef(!1),ut=j.useRef(new Map),[Ln,xi]=j.useState(0),z=j.useRef(null),$=wy(),ve=_0();j.useEffect(()=>{let d=!1;const g="design-canvas:update-seen";return Ne.update().then(({update:x})=>{if(d||!x)return;try{if(localStorage.getItem(g)===x.latest)return}catch{}const M=()=>{try{localStorage.setItem(g,x.latest)}catch{}};$({dot:!0,text:r.update.out(x.latest),code:x.command,ms:12e3,action:{label:r.update.copy,run:()=>(M(),void navigator.clipboard.writeText(x.command).then(()=>$({tone:"ok",text:r.update.copied})))},close:{label:r.update.hide,run:M}})}).catch(()=>{}),()=>void(d=!0)},[$]);const fe=j.useCallback(d=>ut.current.get(d)??null,[Ln]),ke=j.useRef(null),Ie=j.useRef(null);Ie.current=u;const Ue=j.useRef(null),Ye=j.useCallback(async()=>{try{const d=await Ne.board();c(d),f(d.board),Rt(null)}catch(d){Rt(String(d.message))}},[]),fn=j.useCallback(()=>Ne.get("/api/comments").then(d=>ct(d.comments)).catch(()=>{}),[]),He=j.useCallback(()=>Ne.get("/api/history").then(de).catch(()=>{}),[]),_t=j.useCallback(()=>Ne.get("/api/errors").then(d=>Hl(d.errors)).catch(()=>{}),[]),Ke=Rb((l==null?void 0:l.dir)??null),[jt,El]=j.useState(null),[Ml,fc]=j.useState(null),[wi,Ba]=j.useState(!1),[Xl,ls]=j.useState({}),[hn,An]=j.useState(null),[ji,da]=j.useState(!1),Kt=j.useRef(null),Is=j.useRef(null),Ps=j.useRef(null),eo=j.useRef(null);j.useLayoutEffect(()=>{Ul(Is.current),Ul(Ps.current),Ul(eo.current)}),j.useEffect(()=>{Ye(),fn(),He(),_t()},[Ye,fn,He,_t]),j.useEffect(()=>{document.title=u!=null&&u.title?r.app.docTitle(u.title):r.app.title},[u==null?void 0:u.title]),j.useEffect(()=>{const d=new Map,g=M=>{const D=d.get(M);window.clearTimeout(D.t),D.t=window.setTimeout(()=>void Ne.put("/api/errors",{file:M,errors:D.list}).catch(()=>{}),200)},x=M=>{const D=M.data;if(!D||D.type!=="dc-error"||typeof D.file!="string")return;if(D.start)return void d.set(D.file,{list:[],loaded:!1});const Q=d.get(D.file)??{list:[],loaded:!0};if(d.set(D.file,Q),D.loaded)return Q.loaded=!0,g(D.file);Q.list.length<20&&!Q.list.some(te=>te.message===D.message)&&Q.list.push({kind:D.kind,message:D.message,line:D.line}),Q.loaded&&g(D.file)};return window.addEventListener("message",x),()=>window.removeEventListener("message",x)},[]);const St=j.useCallback((d,g)=>{const x=Ie.current;if(!x)return;const M=d(x);if(Ie.current=M,f(M),!g)return;Ue.current&&window.clearTimeout(Ue.current);const D=()=>(_a.current++,Ne.saveBoard(Ie.current,g==="draft"?void 0:g).catch(Q=>$({tone:"error",text:r.toast.saveFailed(Q.message)})).finally(()=>_a.current--));g==="draft"?Ue.current=window.setTimeout(()=>{Ue.current=null,D()},Ux):D()},[$]),Sn=j.useCallback(async d=>{try{const g=await Ne.post(`/api/history/${d}`,{});g.label?$({text:r.toast.undoRedoDone(d,g.label)}):$({text:d==="undo"?r.toast.nothingToUndo:r.toast.nothingToRedo}),await Ye()}catch(g){$({tone:"error",text:String(g.message)})}He()},[$,Ye,He]),Yt={label:r.toast.undoAction,run:()=>void Sn("undo")},Ht=j.useCallback(async(d,g=N)=>{var x;if(!g)return!1;try{return await Ne.post("/api/edit",{file:g,...d}),!0}catch(M){return(x=ke.current)==null||x.setError(String(M.message)),$({tone:"error",text:String(M.message)}),!1}},[N,$]),to=j.useCallback((d,g,x)=>{var kt,gt,Vn;if(Array.from(g.children).some(qe=>qe.tagName!=="BR")){(kt=ke.current)==null||kt.setError(r.toast.textOnly);return}const M=g.innerText??"";ne(d),g.contentEditable="true",g.focus();const D=g.ownerDocument,Q=D.createRange();Q.selectNodeContents(g),(gt=D.getSelection())==null||gt.removeAllRanges(),(Vn=D.getSelection())==null||Vn.addRange(Q);const te=qe=>{if(g.contains(qe.target))return void(qe.type==="click"&&qe.preventDefault());qe.preventDefault(),qe.stopPropagation(),qe.type==="mousedown"&&g.blur()};D.addEventListener("mousedown",te,!0),D.addEventListener("click",te,!0);let he=!1;const Oe=async()=>{var Cn;g.removeEventListener("keydown",lt),D.removeEventListener("mousedown",te,!0),D.removeEventListener("click",te,!0),g.contentEditable="false",ne(null),document.activeElement===((Cn=D.defaultView)==null?void 0:Cn.frameElement)&&cy();const qe=(g.innerText??"").replace(/\n$/,"");if(he||qe===M){he&&(g.innerText=M);return}const{hash:_i}=await Ne.get(`/api/element?f=${encodeURIComponent(d)}&path=${encodeURIComponent(x)}`);await Ht({op:"setText",path:x,hash:_i,text:qe},d)||(g.innerText=M)},lt=qe=>{qe.isComposing||qe.keyCode===229||(qe.key==="Enter"&&!qe.shiftKey?(qe.preventDefault(),g.blur()):qe.key==="Escape"&&(he=!0,g.blur()))};let Qe=!1,Je=!1;const Zt=()=>Qe=!0,$t=()=>{Qe=!1,Je&&ln()},ln=()=>{g.removeEventListener("compositionstart",Zt),g.removeEventListener("compositionend",$t),g.removeEventListener("blur",_e),Oe()},_e=()=>{Qe?Je=!0:ln()};g.addEventListener("compositionstart",Zt),g.addEventListener("compositionend",$t),g.addEventListener("keydown",lt),g.addEventListener("blur",_e)},[Ht]),Ua=(d,g)=>Ne.get(`/api/element?f=${encodeURIComponent(d)}&path=${encodeURIComponent(g)}`).then(x=>x.hash),nt=async(d,g)=>{var M;if(!N)return;const x=await Ua(N,d);await Ht({op:"move",path:d,hash:x,...g})&&((M=ke.current)==null||M.select([Gx(d,g.toParentPath,g.index)]),$({text:g.freeze.length?r.toast.movedFrozen:r.toast.moved,action:Yt}))},no=async()=>{var x;const d=ye.state.selection;if(!N||!d)return;const{source:g}=await Ne.get(`/api/element?f=${encodeURIComponent(N)}&path=${encodeURIComponent(d.path)}&full=1`);try{localStorage.setItem("design-canvas:clip",JSON.stringify({source:g,file:N,path:d.path,tag:d.tag}))}catch{}await((x=navigator.clipboard)==null?void 0:x.writeText(g).catch(()=>{})),$({tone:"ok",text:r.toast.copiedElement(d.tag,wt)})},Si=async()=>{if(!N)return;let d=null;try{d=JSON.parse(localStorage.getItem("design-canvas:clip")??"null")}catch{d=null}if(!d)return $({text:r.toast.nothingCopied});const g=ye.state.selection,x=(g==null?void 0:g.file)===N?g.path:"";if(await Ht({op:"insert",path:x,hash:x?g.hash:void 0,position:"after",html:d.source})&&($({tone:"ok",text:r.toast.pasted(d.file,d.tag),action:Yt}),x)){const M=x.split("/");M[M.length-1]=String(Number(M[M.length-1])+1),setTimeout(()=>{var D;return void((D=ke.current)==null?void 0:D.select([M.join("/")]))},600)}},Ni=(d,g)=>Wn(()=>async x=>{if(Wn(null),!N)return;const M=await Ua(N,d);(g?await Ht({op:"setAttr",path:d,hash:M,name:"src",value:x.ref}):await Ht({op:"setStyle",path:d,hash:M,prop:"background-image",value:`url("${x.ref}")`}))&&$({tone:"ok",text:r.toast.imageReplaced(x.name),action:Yt})}),Yn=j.useRef(null),ye=i0(N,fe);ke.current=ye;const lo=j.useRef(Promise.resolve()),hc=(d,g)=>{var D;const x=N,M=(D=ye.state.selection)==null?void 0:D.path;!x||!M||(lo.current=lo.current.then(async()=>{const Q=await Ua(x,M).catch(()=>null);Q&&await Ht({op:"setStyle",path:M,hash:Q,prop:d,value:g},x)}))};j.useEffect(()=>Eb(d=>{if(d.type==="file-changed")Ve(g=>({...g,[d.file]:(g[d.file]??0)+1})),d.kind!=="change"&&Ye();else if(d.type==="board-changed"&&d.source!==Pf)Ye(),Ke.reload();else if(d.type==="comments-changed")fn();else if(d.type==="history-changed")He(),Ke.reload();else if(d.type==="errors-changed")_t();else if(d.type==="assets-changed")Ll(g=>g+1);else if(d.type==="tokens-changed")ol(g=>g+1);else if(d.type==="app-changed")window.location.reload();else if(d.type==="chat")for(const g of wn.current)g(d.id,d.ev);else if(d.type==="hello")for(const g of wn.current)g("",{kind:"boot",boot:d.boot});else d.type==="occupancy"&&ls(d.boards)}),[Ye,fn,He,_t,Ke.reload]);const Nt=(u==null?void 0:u.pages)??[],Nn=((Ac=Nt.find(d=>d.id===v))==null?void 0:Ac.id)??((Oc=Nt[0])==null?void 0:Oc.id)??null,fa=j.useCallback(d=>!Nt.length||(d.page??Nt[0].id)===Nn,[Nt,Nn]),mt=j.useMemo(()=>u?[...new Set(u.order)].filter(d=>u.boards[d]&&fa(u.boards[d])):[],[u,fa]),Ti=j.useMemo(()=>u?Object.keys(u.notes).filter(d=>fa(u.notes[d])):[],[u,fa]),Jt=Ee??ot,Gn=()=>{const d=Me?8:12,g=!Me&&je?d+240+d:0,x=Me?Jt.w:Jt.w-d-288,M=Me?d+48:0,D=Jt.h-(Me?64:68)-36;return{x:g,y:M,w:x-g,h:D-M}},ha=(d,g)=>{const x=Gn();p(M=>({...M,x:Math.round(x.x+x.w/2-d*M.zoom),y:Math.round(x.y+x.h/2-g*M.zoom)}))};j.useEffect(()=>{if(ua.current||!u||!Ee)return;ua.current=!0;const d=Hx(u.title);window.innerWidth<1e3?Ce(!1):d.left!=null&&Ce(d.left),d.minimap!=null&&Y(d.minimap);const g=u.launch;if(g!=null&&g.page?C(g.page):d.page&&C(d.page),(g==null?void 0:g.view)==="focused"&&g.file&&u.boards[g.file]&&be(g.file),d.view&&!(g!=null&&g.page))p(d.view);else if(!d.view&&u.order.length>0){const x=u.order.find(D=>u.boards[D]&&fa(u.boards[D]))??u.order[0],M=u.boards[x];if(M){const D=es([M],Ee,80,Gn());p({...D,zoom:Math.min(D.zoom,1)}),b([x]),Dt(!0)}else p(es(Object.values(u.boards),Ee,60,Gn()))}else p(es(Object.values(u.boards),Ee,60,Gn()))},[u,Ee]),j.useEffect(()=>{if(!u||!ua.current)return;const d=window.setTimeout(()=>{try{localStorage.setItem(Ey(u.title),JSON.stringify({view:h,page:Nn,left:Me?void 0:je,minimap:E}))}catch{}},300);return()=>window.clearTimeout(d)},[h,Nn,je,E,u==null?void 0:u.title]),j.useEffect(()=>{if(!u)return;const d=window.setTimeout(()=>{var te;const g=-h.x/h.zoom,x=-h.y/h.zoom,M=Jt.w/h.zoom,D=Jt.h/h.zoom,Q=me?[me]:mt.filter(he=>{const Oe=u.boards[he];return Oe.x<g+M&&Oe.x+Oe.w>g&&Oe.y<x+D&&Oe.y+Oe.h>x});Ne.put("/api/context",{mode:re?"play":me?"focus":N?"edit":"canvas",page:Nn,pageName:((te=Nt.find(he=>he.id===Nn))==null?void 0:te.name)??null,visibleArtboards:Q,selectedArtboards:y,dirty:_a.current>0||!!Ue.current}).catch(()=>{})},300);return()=>window.clearTimeout(d)},[h,Nn,y,N,me,re,mt,Jt.w,Jt.h]),j.useEffect(()=>{!$n||!u||!$n.every(d=>u.boards[d])||(b($n),p(es($n.map(d=>u.boards[d]),Jt,80,Gn())),In(null))},[$n,u]);const mc=d=>({x:d.x,y:d.y,w:d.w??d.maxW??400,h:d.kind==="title"?90:200}),ma=()=>{u&&p(es([...mt.map(d=>u.boards[d]),...Ti.map(d=>mc(u.notes[d]))],Jt,60,Gn()))},qn=d=>{!u||!d.length||p(es(d.map(g=>u.boards[g]).filter(Boolean),Jt,80,Gn()))},Ha=d=>p(g=>{const x=Ws(g.zoom*d,th,nh),M=Gn(),D=M.x+M.w/2,Q=M.y+M.h/2;return{zoom:x,x:Math.round(D-(D-g.x)/g.zoom*x),y:Math.round(Q-(Q-g.y)/g.zoom*x)}}),$a=d=>Ha(d/h.zoom);j.useEffect(()=>{if(!Ot)return;let d=!1;const g=window.setTimeout(()=>d=!0,1500),x=()=>d&&Dt(!1),M=window.setTimeout(()=>Dt(!1),15e3);return window.addEventListener("pointerdown",x,!0),window.addEventListener("keydown",x,!0),()=>{window.clearTimeout(g),window.clearTimeout(M),window.removeEventListener("pointerdown",x,!0),window.removeEventListener("keydown",x,!0)}},[Ot]);const kl=(d,g="replace")=>{b(x=>g==="replace"?d:g==="add"?[...new Set([...x,...d])]:d.reduce((M,D)=>M.includes(D)?M.filter(Q=>Q!==D):[...M,D],x)),g==="replace"&&_(null),d.length&&g==="replace"&&(R([]),Ze([]))},ga=()=>Nt.length&&Nn?{page:Nn}:{},as=async(d,g="blank")=>{try{const{file:x}=await Ne.post("/api/boards/create",{...d,template:g,...ga()});await Ye(),b([x]),T("select"),$({tone:"ok",text:r.toast.boardCreated(x),action:Yt})}catch(x){$({tone:"error",text:r.toast.boardCreateFailed(x.message)})}},is=async d=>{if(!d.length||!u)return;const g=d.map(M=>{var D;return((D=u.boards[M])==null?void 0:D.title)??M});if(await ve.confirm({title:r.dialog.deleteBoardsTitle(d.length,g[0]),body:r.dialog.deleteBoardsBody,ok:r.dialog.delete,danger:!0}))try{await Ne.post("/api/boards/delete",{files:d}),N&&d.includes(N)&&_(null),b([]),await Ye(),$({text:r.toast.boardsDeleted(d.length),action:Yt})}catch(M){$({tone:"error",text:String(M.message)})}},La=async d=>{try{const g=await Ne.post("/api/boards/duplicate",{file:d});await Ye(),b([g.file]),$({tone:"ok",text:r.toast.duplicated(g.file),action:Yt})}catch(g){$({tone:"error",text:String(g.message)})}},On=async d=>{var M;const g=(M=Ie.current)==null?void 0:M.boards[d];if(!g)return;const x=await ve.prompt({title:r.dialog.renameBoardTitle,label:r.dialog.name,value:g.title??d.replace(/\.html$/,""),ok:r.dialog.rename});if(!(!x||x.value.trim()===(g.title??"")))try{await Ne.post("/api/boards/rename",{file:d,title:x.value.trim()}),await Ye(),$({tone:"ok",text:r.toast.renamed,action:Yt})}catch(D){$({tone:"error",text:String(D.message)})}},ss=async d=>{const{refs:g}=await Ne.get(`/api/boards/refs?file=${encodeURIComponent(d)}`).catch(()=>({refs:[]})),x=await ve.prompt({title:r.dialog.renameFileTitle,label:r.dialog.fileName,value:d,hint:g.length?r.dialog.renameFileRefs(g.map(D=>D.file).join(", ")):r.dialog.renameFileNoRefs,ok:r.dialog.rename,extra:g.length?{label:r.dialog.renameFileExtra(g.reduce((D,Q)=>D+(Q.count??1),0)),checked:!0}:void 0});if(!x)return;let M=x.value.trim();if(M.endsWith(".html")||(M+=".html"),M!==d)try{await Ne.post("/api/boards/rename",{file:d,newFile:M,updateRefs:x.extra}),N===d&&_(M),b([M]),await Ye(),$({tone:"ok",text:r.toast.fileRenamed(M,!!x.extra),action:Yt})}catch(D){$({tone:"error",text:String(D.message)})}},ao=d=>{const g=Gn(),x=(g.x+g.w/2-h.x)/h.zoom,M=(g.y+g.h/2-h.y)/h.zoom;as({x:Math.round(x-d.w/2),y:Math.round(M-d.h/2),w:d.w,h:d.h},d.id).then(()=>p(es([{x:x-d.w/2,y:M-d.h/2,w:d.w,h:d.h}],Jt,80,Gn())))},Ya=d=>ge({x:d.clientX,y:d.clientY,up:!0,title:r.menu.newBoard,items:$x.map(g=>({label:`${g.label} · ${g.size}`,icon:g.id==="doc"?"page":"board",shortcut:g.id==="blank"?r.menu.drawWithB:void 0,run:()=>ao(g)}))}),sn=(d,g)=>{un("chat"),qa(!0),g!=null&&g.length&&b(g),d!=null&&Nl(d),setTimeout(()=>{var x;return(x=Ra.current)==null?void 0:x.focus()},0)},io=d=>sn(r.prompts.fixErrors(d.map(g=>`- ${g}: ${(sl[g]??[{message:l!=null&&l.missing.includes(g)?r.menu.fileMissing:r.prompts.error}])[0].message}`).join(`
64
+ `)),d.filter(g=>u==null?void 0:u.boards[g])),rl=(d,g)=>St(x=>{const M=x.order.filter(Q=>!d.includes(Q)),D=x.order.filter(Q=>d.includes(Q));return{...x,order:g==="front"?[...M,...D]:[...D,...M]}},g==="front"?r.history.front:r.history.back),gc=(d,g,x=r.history.boardOptions)=>St(M=>{const D={...M.boards[d],...g};for(const Q of Object.keys(D))D[Q]===void 0&&delete D[Q];return{...M,boards:{...M.boards,[d]:D}}},x),Vl=(d,g,x,M=y,D=k,Q=rt)=>({...d,boards:{...d.boards,...Object.fromEntries(M.filter(te=>d.boards[te]).map(te=>[te,{...d.boards[te],x:d.boards[te].x+g,y:d.boards[te].y+x,autoPlaced:void 0}]))},notes:{...d.notes,...Object.fromEntries(D.filter(te=>d.notes[te]).map(te=>[te,{...d.notes[te],x:d.notes[te].x+g,y:d.notes[te].y+x}]))},shapes:{...d.shapes??{},...Object.fromEntries(Q.filter(te=>{var he;return(he=d.shapes)==null?void 0:he[te]}).map(te=>[te,{...d.shapes[te],x:d.shapes[te].x+g,y:d.shapes[te].y+x}]))}}),zl=(d,g)=>St(x=>Vl(x,d,g),y.length?r.history.moveBoard:k.length?r.history.moveNote:r.history.moveShape),os=()=>{var g;let d="";do d=`n${Date.now().toString(36)}${Math.random().toString(36).slice(2,6)}`;while((g=Ie.current)!=null&&g.notes[d]);return d},pa=(d,g)=>{var Q;if(Object.keys(((Q=Ie.current)==null?void 0:Q.notes)??{}).length>=Hp)return $({tone:"error",text:r.toast.notesMax(Hp)});const x=os(),M=Math.round(g.x),D=Math.round(g.y);St(te=>({...te,notes:{...te.notes,[x]:d==="title"?{kind:d,x:M,y:D,text:r.defaults.newTitle,maxW:2e3,...ga()}:{kind:d,x:M,y:D,text:r.defaults.note,w:400,...ga()}}}),d==="title"?r.history.addTitle:r.history.addNote),X(x),b([]),T("select")},Xn=d=>{St(g=>{const x={...g.notes};for(const M of d)delete x[M];return{...g,notes:x}},r.history.deleteNote),R([]),$({text:r.toast.noteDeleted,action:Yt})},ul=(u==null?void 0:u.shapes)??{},Ci=j.useMemo(()=>Object.keys(ul).filter(d=>fa(ul[d])).sort((d,g)=>(ul[d].z??0)-(ul[g].z??0)||(d<g?-1:1)),[ul,fa]),so=(d,g=r.history.addShape)=>{var D,Q,te;let x="";do x=`s${Date.now().toString(36)}${Math.random().toString(36).slice(2,6)}`;while((Q=(D=Ie.current)==null?void 0:D.shapes)!=null&&Q[x]);const M=Math.max(0,...Object.values(((te=Ie.current)==null?void 0:te.shapes)??{}).map(he=>he.z??0))+1;return St(he=>({...he,shapes:{...he.shapes??{},[x]:{...d,z:M,...ga()}}}),g),Cl(x),b([]),X(null),T("select"),x},Ei=(d,g,x)=>St(M=>({...M,shapes:{...M.shapes??{},[d]:{...M.shapes[d],...g}}}),x),ya=d=>{St(g=>{const x={...g.shapes??{}};for(const M of d)delete x[M];return{...g,shapes:x}},r.history.deleteShape),Ze([]),$({text:d.length===1?r.toast.shapeDeleted:r.toast.shapesDeleted(d.length),action:Yt})},Mi=(d,g)=>{var M;const x=Object.values(((M=Ie.current)==null?void 0:M.shapes)??{}).map(D=>D.z??0);Ei(d,{z:g==="front"?Math.max(0,...x)+1:Math.min(0,...x)-1},g==="front"?r.history.shapeFront:r.history.shapeBack)},Ft=(d,g)=>{const x=new Image;x.onload=()=>{const M=Math.min(1,600/Math.max(x.naturalWidth,x.naturalHeight)),D=Math.round(x.naturalWidth*M)||300,Q=Math.round(x.naturalHeight*M)||200,te=g??{x:(Jt.w/2-h.x)/h.zoom-D/2,y:(Jt.h/2-h.y)/h.zoom-Q/2};so({kind:"image",x:Math.round(te.x),y:Math.round(te.y),w:D,h:Q,src:d.ref},r.history.addImage)},x.onerror=()=>$({tone:"error",text:r.toast.imageReadFailed}),x.src=d.url};j.useEffect(()=>{const d=async g=>{var M,D,Q;if(N||(D=(M=g.target)==null?void 0:M.closest)!=null&&D.call(M,"input,textarea,[contenteditable=true]"))return;const x=Array.from(((Q=g.clipboardData)==null?void 0:Q.files)??[]).filter(te=>te.type.startsWith("image/"));if(x.length){g.preventDefault();try{const[te]=await Qf(x.map(he=>he.name?he:new File([he],r.defaults.pastedImage,{type:he.type})));Ft(te)}catch(te){$({tone:"error",text:String(te.message)})}}};return window.addEventListener("paste",d),()=>window.removeEventListener("paste",d)});const Kl=async(d,g)=>{var D,Q;let x=Math.round(g.x);const M=[];for(const te of d)try{if(/\.html?$/i.test(te.name)){const he=await te.text(),Oe=he.match(/<meta[^>]+name=["']board-size["'][^>]+content=["'](\d+)x(\d+)/i),lt=Oe?Number(Oe[1]):390,Qe=Oe?Number(Oe[2]):844,Je=((Q=(D=he.match(/<title>([^<]*)<\/title>/i))==null?void 0:D[1])==null?void 0:Q.trim())||te.name.replace(/\.html?$/i,""),Zt=te.name.toLowerCase().replace(/\.htm$/,".html").replace(/[^a-z0-9._-]+/g,"-"),$t=await Ne.post("/api/boards/create",{file:Zt,html:he,title:Je,x,y:Math.round(g.y),w:lt,h:Qe,...ga()});M.push($t.file),x+=lt+80}else if(te.type.startsWith("image/")){const[he]=await Qf([te]);Ft(he,{x,y:g.y}),x+=400}else $({tone:"error",text:r.toast.importOnly(te.name)})}catch(he){$({tone:"error",text:`${te.name}: ${he.message}`})}M.length&&(await Ye(),In(M),$({tone:"ok",text:r.toast.imported(M.length),action:Yt}))},ki=async d=>{var x;if(!u)return;const g=await ve.prompt({title:r.dialog.renameGroupTitle,label:r.dialog.name,value:((x=u.groupNames)==null?void 0:x[d])??d,ok:r.dialog.save});g!=null&&g.value.trim()&&St(M=>({...M,groupNames:{...M.groupNames??{},[d]:g.value.trim()}}),r.history.renameGroup)},dl=async(d,g)=>{try{const x=await Ne.post("/api/pages",d);return await Ye(),g&&$({tone:"ok",text:g,action:Yt}),x}catch(x){return $({tone:"error",text:String(x.message)}),null}},au=async()=>{if(Nt.length>=40)return $({tone:"error",text:r.toast.pagesMax});const d=await ve.prompt({title:r.dialog.newPageTitle,label:r.dialog.name,value:r.dialog.newPageName(Math.max(Nt.length,1)+1),ok:r.dialog.create});if(!(d!=null&&d.value.trim()))return;const g=await dl({action:"add",name:d.value.trim()});g!=null&&g.id&&C(g.id)},oo=async d=>{const g=Nt.find(M=>M.id===d),x=await ve.prompt({title:r.dialog.renamePageTitle,label:r.dialog.name,value:(g==null?void 0:g.name)??"",ok:r.dialog.rename});!(x!=null&&x.value.trim())||x.value.trim()===(g==null?void 0:g.name)||await dl({action:"rename",id:d,name:x.value.trim()})},co=async d=>{const g=Nt.find(M=>M.id===d),x=Object.values((u==null?void 0:u.boards)??{}).filter(M=>{var D;return(M.page??((D=Nt[0])==null?void 0:D.id))===d}).length;await ve.confirm({title:r.dialog.deletePageTitle((g==null?void 0:g.name)??""),body:r.dialog.deletePageBody(x),ok:r.dialog.delete,danger:!0})&&(Nn===d&&C(null),await dl({action:"delete",id:d},r.toast.pageDeleted))},va=(d,g)=>void dl({action:"move",id:d,index:g}),cs=(d,g)=>{var M,D;const x=Nt.findIndex(Q=>Q.id===d);ge({x:g.clientX,y:g.clientY,title:(M=Nt[x])==null?void 0:M.name,items:[{label:r.menu.rename,icon:"edit",run:()=>void oo(d)},{label:r.menu.moveUp,icon:"chevronDown",disabled:x<=0,run:()=>va(d,x-1)},{label:r.menu.moveDown,icon:"chevronDown",disabled:x>=Nt.length-1,run:()=>va(d,x+1)},{label:((D=u==null?void 0:u.launch)==null?void 0:D.page)===d?r.menu.unsetLaunchPage:r.menu.setLaunchPage,icon:"page",run:()=>St(Q=>{var te;return{...Q,launch:{...Q.launch??{view:"canvas"},page:((te=Q.launch)==null?void 0:te.page)===d?void 0:d}}},r.history.launchPage)},...y.length?[{label:r.menu.moveSelectedToPage(y.length),icon:"page",run:()=>St(Q=>({...Q,boards:{...Q.boards,...Object.fromEntries(y.map(te=>{var he;return[te,{...Q.boards[te],page:d===((he=Nt[0])==null?void 0:he.id)?void 0:d}]}))}}),r.history.moveToPage)}]:[],"sep",{label:r.menu.delete,icon:"trash",danger:!0,disabled:Nt.length<=1,run:()=>void co(d)}]})},ro=d=>{const g=y.includes(d)?y:[d],x=g.length>1;return[{label:r.menu.selectInside,icon:"select",shortcut:"Enter",disabled:x,run:()=>xc(d)},{label:Te===d?r.menu.stopPlay:r.menu.playInPlace,icon:"play",shortcut:"P",disabled:x,run:()=>Te===d?zi():st(d)},{label:r.menu.playFullScreen,icon:"play",disabled:x,run:()=>we(d)},{label:r.menu.askReview,icon:"comment",run:()=>sn(r.prompts.review,g)},{label:r.menu.focusView,icon:"focus",shortcut:"F",disabled:x,run:()=>be(d)},{label:r.menu.askAI,icon:"comment",shortcut:`${wt}J`,run:()=>sn(void 0,g)},...sl[d]||l!=null&&l.missing.includes(d)?[{label:r.menu.askFixErrors,icon:"warn",run:()=>io([d])}]:[],{label:r.menu.goToBoard,icon:"fit",shortcut:"⇧2",run:()=>qn(g)},"sep",{label:r.menu.rename,icon:"title",shortcut:"F2",disabled:x,run:()=>void On(d)},{label:r.menu.renameFile,icon:"link",disabled:x,run:()=>void ss(d)},{label:r.menu.duplicate,icon:"copy",shortcut:`${wt}D`,disabled:x,run:()=>void La(d)},"sep",{label:r.menu.front,icon:"front",shortcut:`${wt}]`,run:()=>rl(g,"front")},{label:r.menu.back,icon:"back",shortcut:`${wt}[`,run:()=>rl(g,"back")},"sep",{label:x?r.menu.deleteBoards(g.length):r.menu.delete,icon:"trash",shortcut:"⌫",danger:!0,run:()=>void is(g)}]},iu=(d,g)=>{var x,M;u&&(d.type==="board"?(y.includes(d.file)||kl([d.file]),ge({x:g.clientX,y:g.clientY,title:((x=u.boards[d.file])==null?void 0:x.title)??d.file,items:ro(d.file)})):d.type==="note"?(X(d.id),ge({x:g.clientX,y:g.clientY,title:((M=u.notes[d.id])==null?void 0:M.kind)==="title"?r.menu.title:r.menu.note,items:[{label:r.menu.duplicateInFront,icon:"copy",shortcut:`${wt}D`,run:()=>{const D=u.notes[d.id],Q=os();St(te=>({...te,notes:{...te.notes,[Q]:{...D,x:D.x+40,y:D.y+40}}}),r.history.duplicateNote),X(Q)}},"sep",{label:r.menu.delete,icon:"trash",shortcut:"⌫",danger:!0,run:()=>Xn([d.id])}]})):ge({x:g.clientX,y:g.clientY,items:[{label:r.menu.newBoardHere,icon:"board",shortcut:"B",run:()=>void as({x:Math.round(d.x),y:Math.round(d.y),w:390,h:844})},{label:r.menu.mobileFrameHere,icon:"board",run:()=>void as({x:Math.round(d.x),y:Math.round(d.y)},"mobile")},{label:r.menu.titleHere,icon:"title",shortcut:"T",run:()=>pa("title",d)},{label:r.menu.noteHere,icon:"sticky",shortcut:"N",run:()=>pa("sticky",d)},"sep",{label:r.menu.selectAll,icon:"select",shortcut:`${wt}A`,run:()=>kl(mt)},{label:r.menu.fitAll,icon:"fit",shortcut:"⇧1",run:ma},{label:r.menu.zoom100,icon:"search",shortcut:`${wt}0`,run:()=>$a(1)},"sep",{label:r.menu.undo,icon:"undo",shortcut:`${wt}Z`,disabled:!ae.canUndo,run:()=>void Sn("undo")},{label:r.menu.redo,icon:"redo",shortcut:`⇧${wt}Z`,disabled:!ae.canRedo,run:()=>void Sn("redo")}]}))};Yn.current=(d,g)=>{var Q;if(!N)return;const x=()=>Ne.get(`/api/element?f=${encodeURIComponent(N)}&path=${encodeURIComponent(d)}`).then(te=>te.hash),M=(Q=ut.current.get(N))!=null&&Q.contentDocument?Mn(ut.current.get(N).contentDocument,d):null,D=d.includes("/")?d.slice(0,d.lastIndexOf("/")):null;ge({x:g.clientX,y:g.clientY,title:M?`<${M.tagName.toLowerCase()}>`:r.menu.element,items:[{label:r.menu.editText,icon:"edit",disabled:!M||M.children.length>0,run:()=>M&&to(N,M,d)},{label:r.menu.selectParent,icon:"layers",shortcut:"↑",disabled:D==null,run:()=>D!=null&&void ye.select([D])},{label:r.menu.elementToAI,icon:"comment",run:()=>sn()},{label:r.menu.copy,icon:"copy",shortcut:`${wt}C`,run:()=>void no()},{label:r.menu.pasteAfter,icon:"copy",shortcut:`${wt}V`,run:()=>void Si()},...(M==null?void 0:M.tagName)==="IMG"?[{label:r.menu.replaceImage,icon:"page",run:()=>Ni(d,!0)}]:[],{label:r.menu.copyForAI,icon:"copy",run:()=>void navigator.clipboard.writeText(`${N} ${d} <${M==null?void 0:M.tagName.toLowerCase()}> "${((M==null?void 0:M.textContent)??"").trim().slice(0,60)}"`).then(()=>$({tone:"ok",text:r.toast.copied}))},"sep",{label:r.menu.duplicate,icon:"copy",shortcut:`${wt}D`,run:async()=>void Ht({op:"duplicate",path:d,hash:await x()})},{label:r.menu.delete,icon:"trash",shortcut:"⌫",danger:!0,run:async()=>{await Ht({op:"delete",path:d,hash:await x()})&&(ye.select([]),$({text:r.toast.elementDeleted,action:Yt}))}}]})};const zi=()=>{var g,x;const d=Te;st(null),(x=(g=document.activeElement)==null?void 0:g.blur)==null||x.call(g),cy(),d&&Ve(M=>({...M,[d]:(M[d]??0)+1}))};j.useEffect(()=>{if(!Te)return;const d=ut.current.get(Te);if(!d)return;const g=D=>D.key==="Escape"&&pc.current();let x=null;const M=()=>{x==null||x.removeEventListener("keydown",g,!0),x=d.contentDocument,x==null||x.addEventListener("keydown",g,!0)};return M(),d.addEventListener("load",M),()=>{d.removeEventListener("load",M),x==null||x.removeEventListener("keydown",g,!0)}},[Te,Ln]);const pc=j.useRef(()=>{});pc.current=zi;const[Ga,qa]=j.useState(()=>!window.matchMedia("(max-width: 1000px)").matches),yc=j.useRef(!1);j.useEffect(()=>{const d=setTimeout(()=>yc.current=!0,1500);return()=>clearTimeout(d)},[]),j.useEffect(()=>{Me&&yc.current&&qa(!0)},[Me,y,N,ht]),j.useEffect(()=>{Me&&je&&qa(!1)},[Me,je]),j.useEffect(()=>{Me&&Ga&&Ce(!1)},[Me,Ga]);const su=()=>{const d=je||Ga;Ce(!d),qa(!d)},ou=d=>{const g=[".oc-dock",".oc-left",".canvas",".oc-right"].map(Q=>document.querySelector(Q)).filter(Boolean),x=g.findIndex(Q=>Q.contains(document.activeElement)),M=g[(x+(d?-1:1)+g.length)%g.length],D=M.matches(".canvas")?M:M.querySelector("button:not([disabled]), input, select, textarea, [tabindex]");M.matches(".canvas")&&(M.tabIndex=-1),(D??M).focus()},cu=async d=>{if(!N)return;const g=[...ye.state.paths].sort((M,D)=>Number(M.split("/").pop())-Number(D.split("/").pop())),x=await Promise.all(g.map(M=>Ua(N,M)));await Ht({op:"wrap",paths:g,hashes:x,display:d})&&(ye.select([g[0]]),$({tone:"ok",text:r.toast.wrapped(d),action:Yt}))},uo=async(d,g)=>{try{await Ne.put("/api/tokens",{...d,label:g}),ol(x=>x+1),$({tone:"ok",text:g===r.history.changeTheme?r.toast.theme(d.active):r.toast.tokensSaved,action:Yt})}catch(x){$({tone:"error",text:String(x.message)})}},Zl=(d,g)=>{if(N===d){g.join()!==ye.state.paths.join()&&ye.select(g);return}bi.current={file:d,paths:g},_(d),b([d]),R([]),Ze([])},vc=(d,g)=>Zl(d,[g]),bc=(d,g,x)=>{const M=Af(ut.current.get(d),g.clientX,g.clientY);if(!M)return void(!x.add&&N===d&&_(null));if(x.add&&N===d){const D=ye.state.paths;return void ye.select(D.includes(M.path)?D.filter(Q=>Q!==M.path):[...D,M.path])}Zl(d,[M.path]),x.double&&to(d,M.el,M.path)};ns.current=bc,j.useEffect(()=>{var M,D;const d=bi.current,g=d&&N===d.file?ut.current.get(d.file):null;if(!d||!g)return;const x=()=>{bi.current=null,ye.select(d.paths)};return((M=g.contentDocument)==null?void 0:M.readyState)==="complete"&&((D=g.contentDocument.body)!=null&&D.childElementCount)?x():(g.addEventListener("load",x,{once:!0}),()=>g.removeEventListener("load",x))},[N,Ln]);const xc=d=>{var D,Q;const g=(D=ut.current.get(d))==null?void 0:D.contentDocument,x=g?Array.from(((Q=g.body)==null?void 0:Q.children)??[]).find(te=>!/^(SCRIPT|STYLE|TEMPLATE)$/.test(te.tagName)):null,M=x?il(x):"0";M!=null&&Zl(d,[M])};j.useEffect(()=>{N&&!(y.length===1&&y[0]===N)&&_(null)},[y]),j.useEffect(()=>{ce(null),oe(null)},[N,S]),j.useEffect(()=>{Te&&N===Te&&_(null)},[Te]);const nn=N??(y.length===1?y[0]:null),wc=j.useMemo(()=>{var d;return J0(N?(d=ut.current.get(N))==null?void 0:d.contentDocument:null)},[N,Ln,Ae[N??""],(Dc=ye.state.selection)==null?void 0:Dc.hash]);j.useEffect(()=>{if(!nn)return jn(null);Ne.get(`/api/lint?f=${encodeURIComponent(nn)}`).then(d=>jn(d.files[nn]??[])).catch(()=>jn(null))},[nn,Ae[nn??""],Yl]),j.useEffect(()=>{if(!nn)return ca(null);const d=()=>{var M;const x=(M=ut.current.get(nn))==null?void 0:M.contentDocument;ca((x==null?void 0:x.readyState)==="complete"?X0(x,(Mt==null?void 0:Mt.minTarget)??48):null)},g=window.setTimeout(d,600);return()=>window.clearTimeout(g)},[nn,Ln,Ae[nn??""],Mt==null?void 0:Mt.minTarget,h.zoom>=.25]);const fo=d=>{var M;const g=d.currentTarget.getBoundingClientRect(),x=((M=d.currentTarget.closest(".oc-dock"))==null?void 0:M.getBoundingClientRect())??g;return{clientX:g.left,clientY:x.top-8}},ru=d=>ge({x:d.clientX,y:d.clientY,up:!0,title:r.toolbar.canvasTools,items:yi.slice(0,5).map(g=>({label:g.label,icon:g.icon,shortcut:g.key,check:S===g.id,run:()=>T(g.id)}))}),jc=d=>ge({x:d.clientX,y:d.clientY,up:!0,title:r.toolbar.shapes,items:[...yi.slice(5).map(g=>({label:g.label,icon:g.icon,shortcut:g.key,check:S===g.id,run:()=>T(g.id)})),"sep",{label:r.toolbar.insertImage,icon:"image",run:()=>Wn(()=>g=>{Wn(null),Ft(g)})}]}),uu=d=>{const g=Mt?Object.keys(Mt.themes):[];ge({x:d.clientX,y:d.clientY,right:!0,className:"view oc-menu",title:r.toolbar.viewMenu,head:Me?s.jsx(Gf,{zoom:h.zoom,onZoom:Ha,onZoom100:()=>$a(1),onFit:ma,menu:!0}):void 0,items:[...Me?[{label:r.toolbar.history,icon:"clock",run:()=>mo()},"sep"]:[],{label:r.toolbar.guides,icon:"grid",shortcut:"⌃G",check:ql,run:()=>ra(x=>!x)},{label:r.toolbar.minimap,icon:"map",shortcut:"M",check:Me?A:E,run:Sc},{label:r.toolbar.leftPanel,icon:"panel",shortcut:`${wt}\\`,check:je,run:()=>Ce(x=>!x)},"sep",{label:r.toolbar.appearance(kn),icon:kn==="system"?"system":kn==="light"?"sun":"moon",run:()=>zn(x=>x==="system"?"light":x==="light"?"dark":"system")},...g.length>1?g.map(x=>({label:r.toolbar.themeOption(x),icon:"layers",check:Mt.active===x,run:()=>void uo({...Mt,active:x},r.history.changeTheme)})):[],"sep",{label:r.toolbar.snapshot,icon:"layers",run:()=>void Nc(d,!0)}]})},Sc=()=>Me?ie(d=>!d):Y(d=>!d),du=d=>ge({x:d.clientX,y:d.clientY,title:(l==null?void 0:l.dir)??(u==null?void 0:u.title),items:[{label:r.boardList.search,icon:"search",shortcut:"⌘K",run:()=>{Hn("boards"),Ce(!0),setTimeout(()=>{var g;return(g=z.current)==null?void 0:g.focus()},0)}},{label:r.toolbar.snapshot,icon:"layers",run:()=>void Nc(d)}]}),fu=(d,g)=>{!u||!l||ge({x:d.clientX,y:d.clientY,title:r.toolbar.erroredBoardsN(g.length),items:[...g.slice(0,12).map(x=>{var M,D,Q;return{label:`${((M=u.boards[x])==null?void 0:M.title)??x} — ${(((Q=(D=sl[x])==null?void 0:D[0])==null?void 0:Q.message)??r.menu.fileMissing).slice(0,40)}`,icon:"warn",run:()=>{kl([x]),qn([x])}}}),"sep",{label:r.menu.askFixAll,icon:"comment",run:()=>io(g)},...l.missing.length?[{label:r.menu.cleanMissing(l.missing.length),icon:"trash",danger:!0,run:()=>{St(x=>{const M={...x.boards};for(const D of l.missing)delete M[D];return{...x,boards:M,order:x.order.filter(D=>!l.missing.includes(D))}},r.history.cleanMissing),$({text:r.toast.cleanedUp(l.missing.length),action:Yt})}}]:[]]})},Nc=async(d,g=!1)=>{const x=await Ne.get("/api/snapshots").catch(()=>null);if(!(x!=null&&x.git))return ge({x:d.clientX,y:d.clientY,right:g,title:r.menu.snapshot,items:[{label:r.menu.notGit,disabled:!0,run:()=>{}}]});ge({x:d.clientX,y:d.clientY,right:g,title:r.menu.snapshotStatus(x.branch??"",x.changed),items:[{label:x.changed?r.menu.snapshotNow:r.menu.nothingChanged,icon:"check",disabled:!x.changed,run:async()=>{const M=await ve.prompt({title:r.dialog.snapshotTitle,label:r.dialog.snapshotLabel,value:r.dialog.snapshotMessage(new Date().toLocaleDateString("en-CA")),hint:r.dialog.snapshotHint,ok:r.dialog.commit});if(M)try{const D=await Ne.post("/api/snapshot",{message:M.value});$({tone:"ok",text:D.nothing?r.toast.nothingChanged:r.toast.snapshot(D.hash??"")})}catch(D){$({tone:"error",text:String(D.message)})}}},"sep",...x.snapshots.slice(0,10).map(M=>({label:`${M.hash} ${M.subject.slice(0,40)} · ${M.when}`,disabled:!0,run:()=>{}}))]})};j.useEffect(()=>uy(N),[N]);const hu=async d=>{const g=Ie.current,x=g&&Fr(g,d);if(!g||!x)return;const M=D=>{var Q;return((Q=g.boards[D])==null?void 0:Q.title)??D};An(D=>D&&{...D,busy:!0});try{const D=await Ne.post("/api/boards/use",{file:d});An(null),N&&x.alts.includes(N)&&_(null),await Ye(),In([x.original]);const Q=x.chosen===x.original?r.occupancy.kept(M(x.original),x.alts.length):r.occupancy.applied(hx(M(x.chosen)),M(x.original));$({tone:"ok",text:Q,action:D.step?{label:r.occupancy.undo,run:()=>void Tc(D.step,Q,[x.original,...x.alts])}:Yt})}catch(D){An(Q=>Q&&{...Q,busy:!1}),$({tone:"error",text:String(D.message)})}He(),Ke.reload()},mu=async d=>{const g=Ie.current,x=g&&Fr(g,d);if(!(!g||!x)){An(M=>M&&{...M,busy:!0});try{const M=await Ne.post("/api/boards/keep",{file:d});An(null),await Ye();const D=r.occupancy.keptAll(x.kind,x.alts.length);$({text:D,action:M.step?{label:r.occupancy.undo,run:()=>void Tc(M.step,D)}:Yt})}catch(M){An(D=>D&&{...D,busy:!1}),$({tone:"error",text:String(M.message)})}He(),Ke.reload()}},Tc=async(d,g,x=[])=>{try{await Ne.post("/api/history/undo-steps",{ids:[d],mode:"rest"}),await Ye(),x.length&&In(x),$({text:r.toast.undoRedoDone("undo",g),action:{label:r.toolbar.redo,run:()=>void Sn("redo")}})}catch(M){$({tone:"error",text:String(M.message)})}He(),Ke.reload()},Cc=j.useRef([]);j.useEffect(()=>{const d=[...y,...N?[N]:[]],g=d.filter(x=>!Cc.current.includes(x));Cc.current=d;for(const x of g)Ke.markSeen(Ke.tagsOf(x).flatMap(M=>M.steps))},[y,N]);const rs=(d,g)=>Ke.tagsOf(d).find(x=>x.key===g)??null,gu=(d,g)=>{rs(d,g)&&El(x=>(x==null?void 0:x.file)===d&&x.key===g?null:{file:d,key:g,conflict:null,busy:!1})},Ai=j.useRef(null);j.useEffect(()=>{var x;const d=Ai.current,g=jt&&rs(jt.file,jt.key);Ai.current=g?{id:`${jt.file}|${g.key}`,steps:g.steps}:null,d&&d.id!==((x=Ai.current)==null?void 0:x.id)&&Ke.markSeen(d.steps)},[jt==null?void 0:jt.file,jt==null?void 0:jt.key]);const Oi=async(d,g,x)=>{var D,Q,te;El(he=>he&&{...he,busy:!0});const M=((Q=(D=Ke.data)==null?void 0:D.steps.find(he=>he.id===g.steps[0]))==null?void 0:Q.name)??"";try{const he=()=>Ne.post("/api/history/undo-steps",{ids:g.steps,mode:x});g.run?await Ne.post("/api/chat/undo-run",{id:g.run,mode:x}).catch(Oe=>Oe.status===404?he():Promise.reject(Oe)):await he(),El(null),$({text:r.toast.undoRedoDone("undo",g.steps.length===1?M:r.activity.changes(g.steps.length)),action:{label:r.toolbar.redo,run:()=>void Sn("redo")}}),await Ye()}catch(he){const Oe=he,lt=Oe.status===409?(te=Oe.body)==null?void 0:te.conflicts:void 0;lt?El(Qe=>Qe&&{...Qe,busy:!1,conflict:[...new Set(lt.map(Je=>{var Zt,$t;return Je.file.endsWith(".html")?(($t=(Zt=Ie.current)==null?void 0:Zt.boards[Je.file])==null?void 0:$t.title)??Je.file:Je.file}))]}):(El(Qe=>Qe&&{...Qe,busy:!1}),$({tone:"error",text:Oe.message}))}He(),Ke.reload()},pu=async d=>{da(!0);try{await Ne.post("/api/history/goto",{id:d.id}),$({text:r.activity.wentBack(d.name)}),await Ye()}catch(g){$({tone:"error",text:String(g.message)})}finally{da(!1),He(),Ke.reload()}},ho=j.useCallback(()=>Ba(!1),[]),mo=()=>{Ke.reload(),Ba(!0)};j.useEffect(()=>{jt&&!rs(jt.file,jt.key)&&El(null)},[Ke.data,Ke.now]);const go=j.useRef(()=>{});go.current=d=>{var Oe,lt,Qe,Je,Zt,$t,ln;if(!u||ve.state||me||re||py(d)||d.isComposing)return;const g=d.metaKey||d.ctrlKey,x=d.key.toLowerCase(),M=y.length===1?y[0]:null,D=_e=>{d.preventDefault(),_e()};if(g&&x==="z")return D(()=>void Sn(d.shiftKey?"redo":"undo"));if(g&&x==="y")return D(()=>void Sn("redo"));if(g&&x==="j")return D(()=>ht==="chat"?un("inspect"):sn());if(g&&x==="k")return D(()=>{Ce(!0),setTimeout(()=>{var _e;return(_e=z.current)==null?void 0:_e.focus()},0)});if(g&&x==="a"&&!N)return D(()=>kl(mt));if(g&&x==="a"&&N){const _e=(Oe=ut.current.get(N))==null?void 0:Oe.contentDocument,kt=(lt=ye.state.selection)==null?void 0:lt.path,gt=_e&&(kt?(Qe=Mn(_e,kt))==null?void 0:Qe.parentElement:_e.body.firstElementChild),Vn=gt?Array.from(gt.children).filter(qe=>!/^(SCRIPT|STYLE)$/.test(qe.tagName)).map(qe=>il(qe)).filter(qe=>qe!=null):[];return D(()=>Vn.length&&void ye.select(Vn))}if(g&&x==="c"&&N&&ye.state.selection)return D(()=>void no());if(g&&x==="v"&&N)return D(()=>void Si());if(g&&x==="d"&&N&&ye.state.selection){const _e=ye.state.selection;return D(()=>void Ht({op:"duplicate",path:_e.path,hash:_e.hash}))}if(g&&x==="d"&&M&&!N)return D(()=>void La(M));if(g&&d.key==="]"&&y.length)return D(()=>rl(y,"front"));if(g&&d.key==="["&&y.length)return D(()=>rl(y,"back"));if(g&&d.key==="0")return D(()=>$a(1));if(g&&d.key==="1")return D(ma);if(g&&(d.key==="="||d.key==="+"))return D(()=>Ha(2));if(g&&d.key==="-")return D(()=>Ha(1/2));if(g&&d.key==="\\")return D(()=>su());if(d.ctrlKey&&!d.metaKey&&x==="g")return D(()=>ra(_e=>!_e));if(g&&x==="g"&&N&&ye.state.paths.length>=2)return D(()=>void cu("flex"));if(g)return;if(d.shiftKey&&d.code==="Digit1")return D(ma);if(d.shiftKey&&d.code==="Digit2")return D(()=>qn(y));if(d.key==="Escape"){if(Te)return D(()=>zi());if(N)return D(()=>_(null));if(S!=="select")return D(()=>T("select"));b([]),X(null),Cl(null);return}if(d.key==="F6")return D(()=>ou(d.shiftKey));const Q=document.activeElement,te=!Q||Q===document.body||!!((Je=Q.closest)!=null&&Je.call(Q,".canvas"))||Q.tagName==="IFRAME";if(d.key==="Tab"&&!d.shiftKey&&te&&N&&ye.state.selection){const _e=document.querySelector('.etb button[tabindex="0"]');if(_e)return D(()=>_e.focus())}if(d.key==="Tab"&&te&&!N&&mt.length){const _e=y.length?mt.indexOf(y[y.length-1]):-1,kt=mt[(_e+(d.shiftKey?-1:1)+mt.length)%mt.length];return D(()=>{var gt;kl([kt]),qn([kt]),ue(r.app.announceBoard(((gt=u.boards[kt])==null?void 0:gt.title)??kt,mt.indexOf(kt)+1,mt.length))})}if(d.key==="Enter"&&!N&&y.length===1&&te)return D(()=>xc(y[0]));if(d.key==="Enter"&&N&&ye.state.selection){const _e=(Zt=ut.current.get(N))==null?void 0:Zt.contentDocument,kt=_e&&Mn(_e,ye.state.selection.path),gt=d.shiftKey?kt==null?void 0:kt.parentElement:kt==null?void 0:kt.firstElementChild,Vn=gt&&gt!==(_e==null?void 0:_e.body)?il(gt):null;return Vn!=null?D(()=>void ye.select([Vn])):void 0}if(x==="p"&&!g&&Mx(y,u.boards)==="play")return D(()=>Te===y[0]?zi():st(y[0]));if((d.key==="Delete"||d.key==="Backspace")&&rt.length&&!N)return D(()=>ya(rt));if(d.key==="Delete"||d.key==="Backspace"){if(N&&ye.state.selection){const _e=ye.state.selection;return D(async()=>{await Ht({op:"delete",path:_e.path,hash:_e.hash})&&(ye.select([]),$({text:r.toast.elementDeleted,action:Yt}))})}return k.length||y.length&&!N?D(()=>{k.length&&Xn(k),y.length&&!N&&is(y)}):void 0}if((d.key.startsWith("Arrow")||d.key==="Enter")&&N&&ye.state.selection){const _e=ye.state.selection,kt=($t=ut.current.get(N))==null?void 0:$t.contentDocument,gt=kt&&Mn(kt,_e.path);if(!gt)return;if(d.altKey&&(d.key==="ArrowUp"||d.key==="ArrowDown")){const qe=_e.path.includes("/")?_e.path.slice(0,_e.path.lastIndexOf("/")):"",_i=Number(_e.path.split("/").pop()),Cn=d.key==="ArrowUp"?_i-1:_i+1;return Cn<0||Cn>=(((ln=gt.parentElement)==null?void 0:ln.children.length)??0)?D(()=>{}):D(()=>void nt(_e.path,{toParentPath:qe,index:Cn,freeze:[]}))}const Vn=d.key==="ArrowUp"||d.key==="Enter"&&d.shiftKey?gt.parentElement:d.key==="ArrowDown"||d.key==="Enter"?gt.firstElementChild:d.key==="ArrowRight"?gt.nextElementSibling:gt.previousElementSibling;if(Vn&&Vn!==kt.body){const qe=il(Vn);if(qe!=null)return D(()=>void ye.select([qe]))}return D(()=>{})}if(d.key.startsWith("Arrow")&&(y.length||k.length||rt.length)&&!N){const _e=d.altKey?100:d.shiftKey?10:1;return D(()=>zl(d.key==="ArrowLeft"?-_e:d.key==="ArrowRight"?_e:0,d.key==="ArrowUp"?-_e:d.key==="ArrowDown"?_e:0))}if(d.key==="F2"&&M)return D(()=>void On(M));if(x==="f"&&M)return D(()=>be(M));if(x==="m")return D(Sc);const he=yi.find(_e=>_e.key.toLowerCase()===x);if(he)return D(()=>T(he.id))},j.useEffect(()=>{const d=g=>go.current(g);return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[]);const Ec=d=>{var lt,Qe;const g=at.filter(Je=>Je.file===d&&!Je.resolved),x=(lt=ut.current.get(d))==null?void 0:lt.contentDocument,M=N===d,D=ql?(((Qe=u==null?void 0:u.guides)==null?void 0:Qe[d])??[]).filter(Je=>!Je.hidden):[],Q=Te===d?void 0:Ke.tagsOf(d).find(Je=>Je.paths.length&&Ke.stateOf(Je)==="fresh"),te=(J==null?void 0:J.file)===d&&Te!==d&&!(M&&ye.state.paths.includes(J.path))?J:null,he=(le==null?void 0:le.file)===d?le.rect:null;if(!M&&!g.length&&!D.length&&!Q&&!te&&!he)return null;const Oe=1/Math.max(h.zoom,.05);return s.jsxs("div",{className:"overlay",children:[Q&&s.jsx(Hb,{frame:ut.current.get(d)??null,paths:Q.paths,zoom:h.zoom}),D.length>0&&u&&s.jsx(l0,{guides:D,w:u.boards[d].w,h:u.boards[d].h}),te&&s.jsx(Yf,{r:te.rect,cls:"hover",px:Oe}),M&&ye.state.rects.map((Je,Zt)=>s.jsx(Yf,{r:Je,cls:"sel",px:Oe},Zt)),he&&s.jsx(Yf,{r:he,cls:"marquee-el",px:Oe}),M&&W!==d&&x&&ye.state.paths.length===1&&ye.state.rects[0]&&s.jsx(tx,{doc:x,path:ye.state.paths[0],rect:ye.state.rects[0],zoom:h.zoom,onMove:Je=>void nt(ye.state.paths[0],Je),onPosition:async(Je,Zt)=>{const $t=ye.state.paths[0],ln=await Ua(d,$t);await Ht({op:"batch",ops:[{op:"setStyle",path:$t,hash:ln,prop:"left",value:`${Je}px`},{op:"setStyle",path:$t,hash:ln,prop:"top",value:`${Zt}px`}]})},onResize:async(Je,Zt)=>{const $t=ye.state.paths[0],ln=await Ua(d,$t);await Ht({op:"batch",ops:[{op:"setStyle",path:$t,hash:ln,prop:"width",value:`${Je}px`},{op:"setStyle",path:$t,hash:ln,prop:"height",value:`${Zt}px`}]})}}),g.map((Je,Zt)=>{const $t=x&&Je.path?Mn(x,Je.path):null,ln=$t?ia($t):null;return s.jsx("div",{className:"pin",title:Je.text,style:ln?{left:ln.x+ln.w-12,top:ln.y-12,transform:`scale(${1/Math.max(h.zoom,.25)})`}:{right:8,top:8+Zt*30,transform:`scale(${1/Math.max(h.zoom,.25)})`},children:Zt+1},Je.id)})]})};if(!u||!l)return s.jsx("div",{className:"loading",role:"status",children:ft?s.jsxs(s.Fragment,{children:[s.jsx(I,{name:"warn"})," ",r.app.loadFailed," ",ft,s.jsx("button",{onClick:()=>void Ye(),children:r.app.retry})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spinner","aria-hidden":"true"})," ",r.app.loadingBoards]})});const Ge=y.length===1?y[0]:null,fl=[...new Set([...l.missing,...Object.keys(sl)])],yu=(()=>{const d=-h.x/h.zoom,g=-h.y/h.zoom,x=Jt.w/h.zoom,M=Jt.h/h.zoom;return mt.filter(D=>{const Q=u.boards[D];return Q.x<d+x&&Q.x+Q.w>d&&Q.y<g+M&&Q.y+Q.h>g}).length})(),vu=s.jsxs("div",{className:"oc-tabs",role:"tablist","aria-label":r.tabs.left,ref:Is,children:[s.jsx("button",{role:"tab","aria-selected":dn==="boards",className:dn==="boards"?"on":"",onClick:()=>Hn("boards"),children:r.tabs.boards}),s.jsx("button",{role:"tab","aria-selected":dn==="assets",className:dn==="assets"?"on":"",onClick:()=>Hn("assets"),children:r.tabs.assets}),s.jsx("button",{role:"tab","aria-selected":dn==="tokens",className:dn==="tokens"?"on":"",onClick:()=>Hn("tokens"),children:r.tabs.tokens})]}),Di=mt.map(d=>({file:d,...u.boards[d]})),Mc=!N&&!y.length&&!k.length&&!rt.length,hl=!Ga||ht==="inspect"&&Mc,ml=U&&!hl,ba=Me?8:12,po=ot.h-ba-(Me?64:184),xa=`oc-card oc-left ${je?"":"is-collapsed"} ${je&&dn!=="boards"?"is-tall":""}`,Ri=s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"oc-head",children:[s.jsxs("button",{className:"oc-project",title:l.dir??u.title,"aria-haspopup":"menu",onClick:d=>{const g=d.currentTarget.getBoundingClientRect();du({clientX:g.left,clientY:g.bottom+8})},children:[s.jsx("strong",{className:"app-title",children:u.title}),s.jsx(I,{name:"chevronDown",size:16})]}),s.jsx("button",{className:`icon-btn oc-ib ${je?"on":""}`,"aria-label":r.toolbar.leftPanel,"aria-pressed":je,title:r.toolbar.leftPanelTitle(wt),onClick:()=>Ce(d=>!d),children:s.jsx(I,{name:"panel"})})]}),(fl.length>0||ft)&&s.jsxs("div",{className:"oc-status",children:[fl.length>0&&s.jsxs("button",{className:"err-chip","aria-haspopup":"menu",title:r.toolbar.erroredBoards,onClick:d=>{const g=d.currentTarget.getBoundingClientRect();fu({clientX:g.left,clientY:g.bottom+8},fl)},children:[s.jsx(I,{name:"warn",size:16})," ",r.toolbar.errors(fl.length)]}),ft&&s.jsx("span",{className:"warn",children:ft})]}),je&&vu]}),Xa=ye.state.selection,us=!!N&&!!u.boards[N]&&!!Xa&&Xa.file===N&&ye.state.paths.length===1&&!W&&S==="select"&&Te!==N,ds=wi||!!(se!=null&&se.up),kc=!us&&S==="select"&&!W&&!ds&&!(Ge&&Te===Ge),yo=(()=>{if(!ml)return 0;const d=N?u.boards[N]:Ge?u.boards[Ge]:null,g=N?ye.state.rects[0]:null,x=d?h.y+(d.y+(g?g.y+g.h:d.h))*h.zoom+4:0;return Math.round(Ws(x+8,ba+48+ba,ot.h-(ht==="chat"?480:280)))})(),wa=N&&((Rc=ye.state.selection)==null?void 0:Rc.file)===N?ye.state.selection:null,zc=nn&&u.boards[nn]&&s.jsxs("section",{className:"pp-group",children:[s.jsx("h3",{className:"pp-group-h",children:r.sections.checks}),Mt&&!Mt.registered?s.jsx(Qs,{variant:"row",id:"token-check",title:r.sections.tokenCheck,count:r.checks.off,children:s.jsx(Z0,{onSetUp:()=>{Hn("tokens"),Ce(!0)}})}):s.jsx(Qs,{variant:"row",id:"token-check",title:r.sections.tokenCheck,count:(Vt==null?void 0:Vt.length)??0,children:s.jsx(Wp,{title:r.checks.tokenCheck((Mt==null?void 0:Mt.active)??""),items:Vt,empty:r.checks.noOffToken,onPick:d=>vc(nn,d),onAskAI:()=>sn(r.prompts.fixTokens((Vt??[]).slice(0,12).map(d=>`- ${d.path??r.prompts.line+d.line}: ${d.message}`).join(`
65
+ `)),[nn])})}),s.jsx(Qs,{variant:"row",id:"a11y",title:r.sections.a11y,count:(Ut==null?void 0:Ut.length)??0,children:s.jsx(Wp,{title:r.checks.a11y,items:Ut,empty:r.checks.a11yOk,onPick:d=>vc(nn,d),onAskAI:()=>sn(r.prompts.fixA11y((Ut??[]).slice(0,12).map(d=>`- ${d.path}: ${d.message}`).join(`
66
+ `)),[nn])})})]});return s.jsxs("div",{className:`app oc ${Me?"oc-n":""} ${ot.w<=760?"narrow":""} ${U?"oc-phone":""}`,children:[je&&dn==="tokens"?s.jsxs("aside",{className:xa,style:{maxHeight:po},"aria-label":r.app.tokensAside,children:[Ri,Mt?s.jsx(V0,{tokens:Mt,onSave:(d,g)=>void uo(d,g)}):s.jsx("p",{className:"oc-empty",children:r.app.loading})]}):je&&dn==="assets"?s.jsxs("aside",{className:xa,style:{maxHeight:po},"aria-label":r.app.assetsAside,children:[Ri,s.jsx(yy,{version:$l,onError:d=>$({tone:"error",text:d}),onUploaded:d=>$({tone:"ok",text:r.toast.uploaded(d.map(g=>g.name).join(", "))})})]}):je?s.jsx(wx,{className:xa,style:{maxHeight:po},header:Ri,ref:z,board:u,pages:Nt,currentPage:Nn,selected:y,missing:fl,onPage:C,onAddPage:()=>void au(),onPageMenu:cs,onMovePage:va,onPick:(d,g)=>{const x=u.boards[d];Nt.length&&x&&(x.page??Nt[0].id)!==Nn&&C(x.page??Nt[0].id),kl([d],g?"toggle":"replace"),g||qn([d]),Me&&!g&&Ce(!1)},onGroupRename:d=>void ki(d),onGroupMenu:(d,g,x)=>{var M;return ge({x:x.clientX,y:x.clientY,title:d&&((M=u.groupNames)==null?void 0:M[d])||d||r.boardList.otherGroup,items:[...d?[{label:r.menu.renameGroup,icon:"title",run:()=>void ki(d)}]:[],{label:r.menu.pageFromGroup,icon:"page",run:async()=>{var Q;if(!Nt.length&&!await dl({action:"add",name:r.boardList.mainPage}))return;const D=await dl({action:"add",name:d&&((Q=u.groupNames)==null?void 0:Q[d])||d||r.boardList.otherGroup});D!=null&&D.id&&(St(te=>({...te,boards:{...te.boards,...Object.fromEntries(g.filter(he=>te.boards[he]).map(he=>[he,{...te.boards[he],page:D.id}]))}}),r.history.pageFromGroup),C(D.id))}}]})},dotOf:d=>dx(Xl,d),onBoardMenu:(d,g)=>{var x;y.includes(d)||kl([d]),ge({x:g.clientX,y:g.clientY,title:((x=u.boards[d])==null?void 0:x.title)??d,items:ro(d)})}}):s.jsx("aside",{className:xa,"aria-label":r.boardList.aria,children:Ri}),s.jsxs("div",{className:"canvas-wrap",onDragOver:d=>{Array.from(d.dataTransfer.items).some(g=>g.kind==="file")&&d.preventDefault()},onDrop:d=>{const g=Array.from(d.dataTransfer.files);if(!g.length)return;d.preventDefault();const x=d.currentTarget.getBoundingClientRect(),M={x:(d.clientX-x.left-h.x)/h.zoom,y:(d.clientY-x.top-h.y)/h.zoom};Kl(g,M)},children:[s.jsx(f0,{board:u,files:l.files,view:h,setView:p,tool:S,setTool:T,visibleBoards:mt,visibleNotes:Ti,selected:y,selectedNotes:k,editFile:N,reloadKeys:Ae,onSelect:kl,onSelectNote:(d,g)=>{if(!d)return R([]);R(x=>g?x.includes(d)?x.filter(M=>M!==d):[...x,d]:[d]),g||(b([]),Ze([]))},onMarquee:(d,g)=>{b(x=>g?[...new Set([...x,...d.boards])]:d.boards),R(x=>g?[...new Set([...x,...d.notes])]:d.notes),Ze(x=>g?[...new Set([...x,...d.shapes])]:d.shapes)},onMoveBoards:(d,g)=>St(x=>{const M=Object.entries(d),D=M.length>0&&M.every(([,Qe])=>Qe.w==null&&Qe.h==null&&Qe.x!=null&&Qe.y!=null),[Q,te]=M[0]??[],he=D&&Q&&x.boards[Q]?te.x-x.boards[Q].x:0,Oe=D&&Q&&x.boards[Q]?te.y-x.boards[Q].y:0,lt=D&&k.length&&M.every(([Qe])=>y.includes(Qe))?Vl(x,he,Oe,[],k):x;return{...lt,boards:{...lt.boards,...Object.fromEntries(M.map(([Qe,Je])=>[Qe,{...lt.boards[Qe],...Je,autoPlaced:void 0}]))}}},g?Object.values(d).some(x=>x.w!=null)?r.history.resizeBoard:r.history.moveBoard:void 0),onMoveNote:(d,g,x)=>St(M=>{const D=M.notes[d],Q=g.x!=null?g.x-D.x:0,te=g.y!=null?g.y-D.y:0,Oe=(Q||te)&&!("text"in g)&&k.includes(d)?Vl(M,Q,te,y,k.filter(lt=>lt!==d)):M;return{...Oe,notes:{...Oe.notes,[d]:{...D,...g}}}},x?"text"in g?r.history.editNote:r.history.moveNote:void 0),onDeleteNote:d=>Xn([d]),onPlay:d=>Te===d?zi():st(d),playing:Te,typing:W,onPickElement:(d,g,x)=>{const M=ut.current.get(d),D=M==null?void 0:M.contentDocument;if(M&&(!(D!=null&&D.body)||D.readyState==="loading")){const Q={clientX:g.clientX,clientY:g.clientY};return M.addEventListener("load",()=>ns.current(d,Q,x),{once:!0})}bc(d,g,x)},onHoverElement:(d,g)=>{const x=d&&g?Af(ut.current.get(d),g.clientX,g.clientY):null;ce(M=>!x||!d?null:(M==null?void 0:M.file)===d&&M.path===x.path?M:{file:d,path:x.path,rect:ia(x.el)})},onElementMarquee:(d,g,x)=>{const M=ut.current.get(d),D=M==null?void 0:M.contentDocument;if(!M||!D||!g)return oe(null);const Q=M.getBoundingClientRect(),te=Q.width/(M.offsetWidth||Q.width)||1,he={x:(g.x-Q.left)/te,y:(g.y-Q.top)/te,w:g.w/te,h:g.h/te};if(!x)return oe({file:d,rect:he});oe(null);const Oe=N===d?ye.state.paths:[],lt=o0(D,he);Zl(d,[...Oe,...lt.filter(Qe=>!Oe.includes(Qe))])},onElementContext:(d,g)=>{const x=Af(ut.current.get(d),g.clientX,g.clientY);return x?(N===d&&ye.state.paths.includes(x.path)||Zl(d,[x.path]),window.setTimeout(()=>{var M;return(M=Yn.current)==null?void 0:M.call(Yn,x.path,g)},0),!0):!1},onRename:d=>void On(d),onCreateBoard:d=>void as(d),onCreateNote:pa,onContext:iu,onSize:Re,renderBoardOverlay:Ec,renderBoardTags:d=>{var x;const g=(x=Xl[d])!=null&&x.length?s.jsx(ux,{list:Xl[d]}):null;return Ke.tagsOf(d).length||g?s.jsx(_b,{file:d,act:Ke,me:cl,onOpen:gu,lead:g}):null},renderBoardButtons:(d,g)=>{const x=Fr(u,d);return x?s.jsx(mx,{file:d,group:x,busy:fx(Xl,x),compact:g,open:(hn==null?void 0:hn.file)===d,onOpen:()=>An(M=>(M==null?void 0:M.file)===d?null:{file:d,busy:!1})}):null},boardRing:d=>Cy(Xl,d).length?"var(--line-strong)":null,underLayer:s.jsx(px,{board:u,files:mt,zoom:h.zoom}),worldLayer:s.jsx(s.Fragment,{children:s.jsx(Wb,{shapes:ul,ids:Ci,zoom:h.zoom,selected:rt,interactive:S==="select",onSelect:(d,g)=>{Ze(x=>g?x.includes(d)?x.filter(M=>M!==d):[...x,d]:x.includes(d)?x:[d]),g||(b([]),R([]))},onChange:(d,g,x)=>St(M=>{var lt;const D=(lt=M.shapes)==null?void 0:lt[d];if(!D)return M;const Q=g.x!=null?g.x-D.x:0,te=g.y!=null?g.y-D.y:0,Oe=(Q||te)&&g.w==null&&rt.includes(d)?Vl(M,Q,te,y,k,rt.filter(Qe=>Qe!==d)):M;return{...Oe,shapes:{...Oe.shapes??{},[d]:{...D,...g}}}},x?g.w!=null?r.history.resizeShape:r.history.moveShape:void 0),onContext:(d,g)=>ge({x:g.clientX,y:g.clientY,title:r.menu.shape,items:[{label:r.menu.front,icon:"front",shortcut:`${wt}]`,run:()=>Mi(d,"front")},{label:r.menu.back,icon:"back",shortcut:`${wt}[`,run:()=>Mi(d,"back")},"sep",{label:r.menu.delete,icon:"trash",shortcut:"⌫",danger:!0,run:()=>ya([d])}]})})}),iframeRef:(d,g)=>{g&&ut.current.get(d)!==g&&(ut.current.set(d,g),xi(x=>x+1))}}),Lx.includes(S)&&s.jsx(Ib,{tool:S,view:h,onDone:d=>so(d)}),mt.length===0&&Ti.length===0&&Ci.length===0&&s.jsxs("div",{className:"canvas-empty",children:[s.jsx(I,{name:"board",size:32}),s.jsx("p",{children:r.app.emptyPage}),s.jsxs("button",{className:"primary",onClick:()=>T("board"),children:[r.app.drawBoard," ",s.jsx("kbd",{children:"B"})]})]})]}),!ml&&(us&&Xa&&!ds?s.jsx(F0,{win:ot,bottom:Me?64:68,selection:Xa,inline:(()=>{var x;const d=(x=ut.current.get(N))==null?void 0:x.contentDocument,g=d?Mn(d,Xa.path):null;return g?Rp(g):{}})(),tokens:Mt,vars:wc,onStyle:hc,onAskAi:()=>sn(),onComment:()=>{un("inspect"),qa(!0),setTimeout(()=>{var d;return(d=F.current)==null?void 0:d.focus()},0)}}):kc&&s.jsx(qx,{win:ot,first:Ot&&mt.length>0})),!Me&&s.jsxs("nav",{className:`oc-card oc-nav ${E&&Di.length?"":"is-collapsed"}`,"aria-label":r.app.navigation,children:[E&&Di.length>0&&s.jsx(ty,{className:"oc-map",w:240,h:112,inset:8,rects:Di,selected:y,view:h,size:Jt,onJump:ha}),s.jsx(Gf,{zoom:h.zoom,onZoom:Ha,onZoom100:()=>$a(1),onFit:ma})]}),Me&&A&&Di.length>0&&!ml&&s.jsx("nav",{className:"oc-card oc-nav oc-nav-n","aria-label":r.app.navigation,children:s.jsx(ty,{className:"oc-map",w:240,h:112,inset:8,rects:Di,selected:y,view:h,size:Jt,onJump:ha})}),s.jsxs("aside",{className:`oc-card oc-right ${hl?"is-rest":""} ${ml?"oc-sheet":""}`,"aria-label":r.app.inspectorAside,style:ml?{top:yo,height:ot.h-yo-8}:void 0,children:[s.jsxs("div",{className:"oc-rhead",ref:eo,children:[s.jsx(Bx,{pages:Nt,currentPage:Nn,selected:y}),s.jsxs("button",{className:`ask-ai ${ht==="chat"&&!hl?"on":""}`,"aria-label":r.toolbar.aiChat,"aria-pressed":ht==="chat"&&!hl,title:r.toolbar.aiChatTitle(wt),onClick:()=>ht==="chat"&&!hl?un("inspect"):sn(),children:[s.jsx(I,{name:"comment",size:16})," ",s.jsx("span",{className:"ask-ai-label",children:r.toolbar.askAi})]}),s.jsx("button",{className:`icon-btn ${(Tn=se==null?void 0:se.className)!=null&&Tn.startsWith("view")?"on":""}`,"aria-label":r.toolbar.viewMenu,"aria-haspopup":"menu","aria-expanded":!!((Va=se==null?void 0:se.className)!=null&&Va.startsWith("view")),title:Me?r.toolbar.viewMenuTitleNarrow:r.toolbar.viewMenuTitle,onClick:d=>{const g=d.currentTarget.getBoundingClientRect();uu({clientX:g.right,clientY:g.bottom+8})},children:s.jsx(I,{name:"more"})})]}),!hl&&s.jsxs("div",{className:"oc-tabs",role:"tablist","aria-label":r.tabs.right,ref:Ps,children:[s.jsx("button",{role:"tab","aria-selected":ht==="inspect",className:ht==="inspect"?"on":"",onClick:()=>un("inspect"),children:r.tabs.properties}),s.jsxs("button",{role:"tab","aria-selected":ht==="chat",className:ht==="chat"?"on":"",onClick:()=>sn(),children:[r.tabs.ai," ",s.jsxs("kbd",{children:[wt,"J"]})]}),Me&&s.jsx("button",{className:"icon-btn oc-close","aria-label":r.tabs.closePanel,title:`${r.tabs.closePanel} (${wt}\\)`,onClick:()=>qa(!1),children:s.jsx(I,{name:"close",size:16})})]}),s.jsx("div",{className:"chat-wrap",hidden:hl||ht!=="chat",children:s.jsx(G0,{selection:N&&((fs=ye.state.selection)==null?void 0:fs.file)===N?ye.state.selection:null,boards:N?[N]:y,visibleCount:yu,titleOf:d=>{var g;return((g=u.boards[d])==null?void 0:g.title)??d},sizeOf:d=>u.boards[d]?{w:u.boards[d].w,h:u.boards[d].h}:null,storeKey:(l==null?void 0:l.dir)??null,confirm:ve.confirm,attach:sa,setAttach:Un,draft:Sl,setDraft:Nl,subscribe:vi,onLocate:In,inputRef:Ra,open:ht==="chat"&&!hl})}),ht==="inspect"&&!hl&&s.jsxs(lx,{author:Gl||r.app.defaultAuthor,onAuthor:async()=>{const d=await ve.prompt({title:r.dialog.authorTitle,label:r.dialog.name,value:Gl,ok:r.dialog.save});if(d!=null&&d.value.trim()){oa(d.value.trim());try{localStorage.setItem("design-canvas:author",d.value.trim())}catch{}}},onAskAI:d=>{Un(g=>({...g,comments:g.comments.some(x=>x.id===d.id)?g.comments:[...g.comments,{id:d.id,text:d.text,file:d.file}]})),sn(Sl||r.prompts.fixComment,[d.file])},file:N??Ge,selection:ye.state.selection,crumbs:(()=>{var Q,te;const d=ye.state.selection,g=N?(Q=ut.current.get(N))==null?void 0:Q.contentDocument:null;if(!N||!d||d.file!==N||!g)return null;const x=he=>{if(!he)return"";const{kind:Oe,label:lt}=hy(he);if(Oe!=="container")return lt?`${r.inspector.kindName(Oe)} "${lt.slice(0,24)}"`:r.inspector.kindName(Oe);const Qe=he.classList[0];return`${r.inspector.kindName(Oe)}${he.id?` #${he.id}`:Qe?` .${Qe}`:""}`},{paths:M,skipped:D}=Gb(d.path);return s.jsx(W0,{board:((te=u.boards[N])==null?void 0:te.title)??N,parents:M.map(he=>({path:he,name:x(Mn(g,he))})),skipped:D,current:x(Mn(g,d.path)),title:r.inspector.crumbElement(d.tag,d.path),onBoard:()=>_(null),onPath:he=>void ye.select([he])})})(),commentRef:F,multi:ye.state.paths.length,error:ye.state.error,comments:at,onSelectPath:d=>{const g=N??Ge;g&&Zl(g,[d])},onDuplicate:wa?()=>void Ht({op:"duplicate",path:wa.path,hash:wa.hash}):void 0,onDelete:wa?async()=>{await Ht({op:"delete",path:wa.path,hash:wa.hash})&&ye.select([])}:void 0,footer:!N&&Ge&&u.boards[Ge]?s.jsx(Sx,{onFocus:()=>be(Ge),onDuplicate:()=>void La(Ge),onFront:()=>rl([Ge],"front"),onBack:()=>rl([Ge],"back"),onDelete:()=>void is([Ge])}):void 0,children:[!N&&tn&&ul[tn]&&s.jsx(Pb,{shape:ul[tn],onPatch:d=>Ei(tn,d,r.history.shapeStyle),onDelete:()=>ya([tn]),onFront:()=>Mi(tn,"front"),onBack:()=>Mi(tn,"back")}),!N&&B&&u.notes[B]&&s.jsx(e0,{note:u.notes[B],onPatch:d=>St(g=>{const x={...g.notes[B],...d};for(const M of Object.keys(x))x[M]===void 0&&delete x[M];return{...g,notes:{...g.notes,[B]:x}}},r.history.noteStyle),onDelete:()=>Xn([B])}),!N&&Ge&&u.boards[Ge]&&s.jsx(jx,{file:Ge,item:u.boards[Ge],pages:Nt,isLaunch:((vo=u.launch)==null?void 0:vo.view)==="focused"&&u.launch.file===Ge,onPatch:d=>gc(Ge,d),onRename:()=>void On(Ge),onRenameFile:()=>void ss(Ge),onLaunch:d=>St(g=>({...g,launch:d?{view:"focused",file:Ge}:{view:"canvas"}}),r.history.launchScreen)}),!N&&zc,!N&&Ge&&u.boards[Ge]&&s.jsx(Qs,{id:"guides",title:r.sections.guides,count:(((bo=u.guides)==null?void 0:bo[Ge])??[]).length,children:s.jsx(a0,{guides:((xo=u.guides)==null?void 0:xo[Ge])??[],onChange:(d,g)=>St(x=>({...x,guides:{...x.guides??{},[Ge]:d}}),g)})}),!N&&Ge&&u.boards[Ge]&&rc((wo=ut.current.get(Ge))==null?void 0:wo.contentDocument)&&s.jsx(Qs,{id:"tweaks",title:r.sections.tweaks,children:s.jsx(Q0,{doc:rc((hs=ut.current.get(Ge))==null?void 0:hs.contentDocument)?ut.current.get(Ge).contentDocument:null,onSave:async d=>{try{await Ne.post("/api/edit",{file:Ge,op:"setTweaks",values:d}),$({tone:"ok",text:r.toast.tweaksSaved,action:Yt})}catch(g){$({tone:"error",text:String(g.message)})}}},`${Ge}-${Ae[Ge]??0}-${Ln}`)}),!N&&rt.length>1&&s.jsxs("section",{className:"pp-group",children:[s.jsx("h3",{className:"pp-group-h",children:r.shapes.selectedN(rt.length)}),s.jsx("div",{className:"btn-row",children:s.jsx("button",{className:"icon-btn danger","aria-label":r.shapes.deleteAll,title:r.shapes.deleteAll,onClick:()=>ya(rt),children:s.jsx(I,{name:"trash"})})})]}),!N&&k.length>1&&s.jsxs("section",{className:"pp-group",children:[s.jsx("h3",{className:"pp-group-h",children:r.notes.selectedN(k.length)}),s.jsx("div",{className:"btn-row",children:s.jsx("button",{className:"icon-btn danger","aria-label":r.notes.deleteAll,title:r.notes.deleteAll,onClick:()=>Xn(k),children:s.jsx(I,{name:"trash"})})})]}),!N&&y.length>1&&s.jsxs("section",{className:"pp-group",children:[s.jsx("h3",{className:"pp-group-h",children:r.boardOptions.selectedN(y.length)}),s.jsxs("div",{className:"btn-row",children:[s.jsx("button",{className:"icon-btn","aria-label":r.boardOptions.front,title:r.boardOptions.frontTitleMod(wt),onClick:()=>rl(y,"front"),children:s.jsx(I,{name:"front"})}),s.jsx("button",{className:"icon-btn","aria-label":r.boardOptions.back,title:r.boardOptions.backTitleMod(wt),onClick:()=>rl(y,"back"),children:s.jsx(I,{name:"back"})}),s.jsx("button",{className:"icon-btn","aria-label":r.boardOptions.goToSelected,title:r.boardOptions.goToSelectedTitle,onClick:()=>qn(y),children:s.jsx(I,{name:"fit"})}),s.jsx("button",{className:"icon-btn danger","aria-label":r.boardOptions.delete,title:r.boardOptions.deleteTitleKey,onClick:()=>void is(y),children:s.jsx(I,{name:"trash"})})]})]}),N&&ye.state.selection&&ye.state.selection.file===N&&(()=>{var D;const d=ye.state.selection,g=(D=ut.current.get(N))!=null&&D.contentDocument?Mn(ut.current.get(N).contentDocument,d.path):null,x={};if(g)for(const Q of Array.from(g.attributes))x[Q.name]=Q.value;const M=ye.state.paths;return s.jsx(Dx,{tokens:Mt,bg:(()=>{let Q=g;const te=g==null?void 0:g.ownerDocument.defaultView;for(;Q&&te;Q=Q.parentElement){const he=te.getComputedStyle(Q).backgroundColor;if(he&&!/rgba\(0, 0, 0, 0\)|transparent/.test(he))return he}return"rgb(255, 255, 255)"})(),onAlign:async Q=>{var Oe;const te=(Oe=ut.current.get(N))==null?void 0:Oe.contentDocument,he=te&&nx(te,d.path,d.hash,Q);if(!he)return $({text:r.toast.blockFlow});await Ht({op:"batch",ops:he})},onReplaceImage:d.tag==="img"||/url\(/.test(d.styles["background-image"]??"")?()=>Ni(d.path,d.tag==="img"):null,selection:d,inline:g?Rp(g):{},attrs:x,canWrap:M.length>=2,vars:wc,onStyle:hc,onAttr:(Q,te)=>void Ht({op:"setAttr",path:d.path,hash:d.hash,name:Q,value:te}),onWrap:async Q=>{const te=[...M].sort((Oe,lt)=>Number(Oe.split("/").pop())-Number(lt.split("/").pop())),he=await Promise.all(te.map(Oe=>Ne.get(`/api/element?f=${encodeURIComponent(N)}&path=${encodeURIComponent(Oe)}`).then(lt=>lt.hash)));await Ht({op:"wrap",paths:te,hashes:he,display:Q})&&ye.select([te[0]])},children:zc})})(),(N??(rt.length||k.length?null:Ge))&&(()=>{const d=N??Ge;return s.jsx(bx,{file:d,version:Ae[d]??0,selected:N?ye.state.paths:[],onSelect:(g,x)=>{const M=N?ye.state.paths:[];Zl(d,x?M.includes(g)?M.filter(D=>D!==g):[...M,g]:[g])},onMove:async(g,x,M)=>{const{hash:D}=await Ne.get(`/api/element?f=${encodeURIComponent(d)}&path=${encodeURIComponent(g)}`);await Ht({op:"move",path:g,hash:D,toParentPath:x,index:M},d)&&Zl(d,[x?`${x}/${M}`:String(M)])}})})()]})]}),!ml&&s.jsx(Xx,{tool:S,setTool:T,phone:U,foldShapes:ot.w<=900,win:ot,hist:ae,histOpen:wi,caretRef:Kt,onNewBoard:d=>Ya(fo(d)),onToolsMenu:d=>ru(fo(d)),onShapesMenu:d=>jc(fo(d)),onInsertImage:()=>Wn(()=>d=>{Wn(null),Ft(d)}),onUndo:()=>void Sn("undo"),onRedo:()=>void Sn("redo"),onHistory:()=>wi?ho():mo()}),re&&s.jsx(Ex,{board:u,file:re,onClose:()=>we(null),onLocate:d=>{b([d]),qn([d])}}),me&&u.boards[me]&&s.jsx(Tx,{board:u,file:me,onClose:()=>{b([me]),be(null)},onNav:be}),s.jsx(x0,{open:!!Tl,version:$l,onClose:()=>Wn(null),onPick:d=>Tl==null?void 0:Tl(d),onError:d=>$({tone:"error",text:d})}),s.jsx("div",{className:"sr-only",role:"status","aria-live":"polite",children:tt}),s.jsx(D0,{menu:se,onClose:()=>ge(null),head:(_c=se==null?void 0:se.className)!=null&&_c.startsWith("view")&&Me?s.jsx(Gf,{zoom:h.zoom,onZoom:Ha,onZoom100:()=>$a(1),onFit:ma,menu:!0}):void 0}),jt&&!re&&(()=>{const d=rs(jt.file,jt.key);return d?s.jsx(Ub,{file:jt.file,tag:d,me:cl,now:Ke.now,conflict:jt.conflict,busy:jt.busy,onCompare:()=>fc({file:jt.file,step:d.steps[d.steps.length-1],added:d.newBoard}),onUndo:g=>void Oi(jt.file,d,g),onCancelConflict:()=>El(g=>g&&{...g,conflict:null}),onClose:()=>El(null)}):null})(),hn&&!re&&(()=>{const d=Fr(u,hn.file);return d?s.jsx(gx,{file:hn.file,group:d,board:u,busy:hn.busy,onApply:()=>void hu(hn.file),onKeepAll:()=>void mu(hn.file),onClose:()=>An(null)}):null})(),Ml&&u.boards[Ml.file]&&s.jsx(vy,{before:j0(Ml.step),notBefore:r.compare.notBeforeChange,boards:[{file:Ml.file,kind:Ml.added?"added":"changed",title:u.boards[Ml.file].title??Ml.file,w:u.boards[Ml.file].w,h:u.boards[Ml.file].h}],onClose:()=>fc(null)}),wi&&s.jsx($b,{steps:((ja=Ke.data)==null?void 0:ja.steps)??[],me:cl,now:Ke.now,anchor:((ms=Kt.current)==null?void 0:ms.getBoundingClientRect())??null,busy:ji,onGo:d=>void pu(d),onClose:ho}),s.jsx(R0,{state:ve.state,onClose:ve.close})]})}function Gx(l,c,u){const f=l.split("/").map(Number),h=c===""?[]:c.split("/").map(Number),p=f.length-1;return h.length>p&&h.slice(0,p).every((v,C)=>v===f[C])&&h[p]>f[p]&&h[p]--,[...h,u].join("/")}function Yf({r:l,cls:c,px:u=1}){return s.jsx("div",{className:`box ${c}`,style:{left:l.x,top:l.y,width:l.w,height:l.h,"--px":`${u}px`}})}function cy(){const l=document.querySelector(".canvas");l&&(l.tabIndex=-1,l.focus({preventScroll:!0}))}function Gf(l){return s.jsxs("div",{className:l.menu?"menu-zoom":"oc-zoom",children:[s.jsx("button",{className:"icon-btn oc-ib","aria-label":r.toolbar.zoomOut,title:r.toolbar.zoomOutTitle(wt),onClick:()=>l.onZoom(1/2),children:s.jsx(I,{name:"minus"})}),s.jsxs("button",{className:"zoom","aria-label":r.toolbar.zoom100,title:r.toolbar.zoom100Title(wt),onClick:l.onZoom100,children:[Math.round(l.zoom*100),"%"]}),s.jsx("button",{className:"icon-btn oc-ib","aria-label":r.toolbar.zoomIn,title:r.toolbar.zoomInTitle(wt),onClick:()=>l.onZoom(2),children:s.jsx(I,{name:"plus"})}),l.menu?s.jsxs("button",{className:"btn",title:r.toolbar.fitAllTitle,onClick:l.onFit,children:[s.jsx(I,{name:"fit",size:16})," ",r.toolbar.fitAll]}):s.jsx("button",{className:"icon-btn oc-ib oc-fit","aria-label":r.toolbar.fitAll,title:r.toolbar.fitAllTitle,onClick:l.onFit,children:s.jsx(I,{name:"fit"})})]})}function qx({win:l,first:c}){const u=j.useRef(null),[f,h]=j.useState(!1),[p,v]=j.useState(0);j.useLayoutEffect(()=>h(!1),[l.w,c]),j.useLayoutEffect(()=>{var B;const k=u.current;if(!c||!k)return;const R=((B=document.querySelector(".oc-dock"))==null?void 0:B.offsetWidth)??0;R!==p&&v(R),!f&&k.scrollWidth>l.w-16&&h(!0)});const C=jy(u,l.w),S={left:C??void 0,visibility:C==null?"hidden":void 0};if(!c)return s.jsx("div",{ref:u,className:"canvas-hint","aria-hidden":"true",style:S,children:r.canvas.hint});const T=`${wt}J`,[y,b]=r.app.firstRunAi(wt).split(T);return s.jsxs("div",{ref:u,className:`canvas-hint oc-first ${f?"is-stacked":""}`,role:"status",style:{...S,minWidth:f?void 0:p||void 0},children:[s.jsxs("span",{className:"oc-fr",children:[s.jsx(I,{name:"select",size:16}),s.jsx("span",{children:r.app.firstRunEdit})]}),s.jsx("span",{className:"oc-fr-sep","aria-hidden":"true"}),s.jsxs("span",{className:"oc-fr",children:[s.jsx(I,{name:"comment",size:16}),s.jsxs("span",{children:[y,s.jsx("kbd",{children:T}),b]})]})]})}function Xx(l){const c=j.useRef(null),u=jy(c,l.win.w),f=(v,C)=>s.jsx("button",{role:"radio","aria-checked":l.tool===v.id,"aria-label":r.toolbar.tool(v.label,v.key),title:C,className:`icon-btn tool ${l.tool===v.id?"on":""}`,onClick:()=>l.setTool(v.id),children:s.jsx(I,{name:v.icon})},v.id),h=yi.slice(0,5).find(v=>v.id===l.tool),p=yi.slice(5).find(v=>v.id===l.tool);return s.jsxs("div",{ref:c,className:"oc-dock",role:"toolbar","aria-label":r.toolbar.aria,style:{left:u??void 0,visibility:u==null?"hidden":void 0},children:[s.jsxs("button",{className:"new-board","aria-haspopup":"menu","aria-label":l.phone?r.toolbar.newBoard:void 0,title:r.toolbar.newBoardTitle,onClick:l.onNewBoard,children:[s.jsx(I,{name:"plus"}),!l.phone&&s.jsx("span",{children:r.toolbar.newBoard}),s.jsx(I,{name:"chevronDown",size:16,className:"s"})]}),s.jsx("span",{className:"oc-sep","aria-hidden":"true"}),l.phone?s.jsxs("button",{className:`icon-btn tool oc-fold ${h?"on":""}`,"aria-label":r.toolbar.canvasTools,"aria-haspopup":"menu",title:r.toolbar.canvasTools,onClick:l.onToolsMenu,children:[s.jsx(I,{name:(h==null?void 0:h.icon)??"select"}),s.jsx(I,{name:"chevronDown",size:16,className:"s"})]}):s.jsxs("div",{className:"oc-group",role:"radiogroup","aria-label":r.toolbar.canvasTools,children:[yi.slice(0,2).map(v=>f(v,r.toolbar.tool(v.hint,v.key))),s.jsx("span",{className:"oc-sep","aria-hidden":"true"}),yi.slice(2,5).map(v=>f(v,r.toolbar.tool(v.hint,v.key)))]}),s.jsx("span",{className:"oc-sep","aria-hidden":"true"}),l.foldShapes?s.jsxs("button",{className:`icon-btn tool oc-fold ${p?"on":""}`,"aria-label":r.toolbar.shapes,"aria-haspopup":"menu",title:r.toolbar.shapes,onClick:l.onShapesMenu,children:[s.jsx(I,{name:(p==null?void 0:p.icon)??"rect"}),s.jsx(I,{name:"chevronDown",size:16,className:"s"})]}):s.jsxs("div",{className:"oc-group",role:"radiogroup","aria-label":r.toolbar.shapes,children:[yi.slice(5).map(v=>f(v,r.toolbar.shapeToolTitle(v.hint,v.key))),s.jsx("button",{className:"icon-btn","aria-label":r.toolbar.insertImage,title:r.toolbar.insertImageTitle,onClick:l.onInsertImage,children:s.jsx(I,{name:"image"})})]}),s.jsx("span",{className:"oc-sep","aria-hidden":"true"}),s.jsxs("div",{className:"oc-group undo-split",children:[s.jsx("button",{className:"icon-btn","aria-label":r.toolbar.undo,title:r.toolbar.undoTitle(l.hist.undo.length?l.hist.undo[l.hist.undo.length-1]:void 0,wt),disabled:!l.hist.canUndo,onClick:l.onUndo,children:s.jsx(I,{name:"undo"})}),s.jsx("button",{ref:l.caretRef,className:`icon-btn caret-btn ${l.histOpen?"on":""}`,"aria-label":r.activity.historyButton,"aria-haspopup":"menu","aria-expanded":l.histOpen,title:r.activity.historyButton,onClick:l.onHistory,children:s.jsx(I,{name:"chevronDown",size:16})}),s.jsx("button",{className:"icon-btn","aria-label":r.toolbar.redo,title:r.toolbar.redoTitle(l.hist.redo.length?l.hist.redo[l.hist.redo.length-1]:void 0,wt),disabled:!l.hist.canRedo,onClick:l.onRedo,children:s.jsx(I,{name:"redo"})})]})]})}class Vx extends j.Component{constructor(){super(...arguments);Sp(this,"state",{error:null})}static getDerivedStateFromError(u){return{error:u}}render(){return this.state.error?s.jsxs("div",{className:"loading",role:"alert",children:[s.jsx(I,{name:"warn"})," ",r.app.crashed," ",this.state.error.message,s.jsx("button",{onClick:()=>location.reload(),children:r.app.reload})]}):this.props.children}}Tb.createRoot(document.getElementById("root")).render(s.jsx(Vx,{children:s.jsx(O0,{children:s.jsx(Yx,{})})}));