@bitovi/vybit 0.13.5 → 0.13.6

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,62 @@
1
+ var cm=Object.defineProperty;var dm=(e,t,n)=>t in e?cm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ke=(e,t,n)=>dm(e,typeof t!="symbol"?t+"":t,n);function fm(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const s=Object.getOwnPropertyDescriptor(r,o);s&&Object.defineProperty(e,o,s.get?s:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();function pm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var tf={exports:{}},_l={},nf={exports:{}},ce={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its 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 Jo=Symbol.for("react.element"),hm=Symbol.for("react.portal"),mm=Symbol.for("react.fragment"),gm=Symbol.for("react.strict_mode"),ym=Symbol.for("react.profiler"),xm=Symbol.for("react.provider"),vm=Symbol.for("react.context"),bm=Symbol.for("react.forward_ref"),wm=Symbol.for("react.suspense"),Sm=Symbol.for("react.memo"),Cm=Symbol.for("react.lazy"),oc=Symbol.iterator;function km(e){return e===null||typeof e!="object"?null:(e=oc&&e[oc]||e["@@iterator"],typeof e=="function"?e:null)}var rf={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},of=Object.assign,sf={};function no(e,t,n){this.props=e,this.context=t,this.refs=sf,this.updater=n||rf}no.prototype.isReactComponent={};no.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};no.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function lf(){}lf.prototype=no.prototype;function nu(e,t,n){this.props=e,this.context=t,this.refs=sf,this.updater=n||rf}var ru=nu.prototype=new lf;ru.constructor=nu;of(ru,no.prototype);ru.isPureReactComponent=!0;var sc=Array.isArray,af=Object.prototype.hasOwnProperty,ou={current:null},uf={key:!0,ref:!0,__self:!0,__source:!0};function cf(e,t,n){var r,o={},s=null,l=null;if(t!=null)for(r in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(s=""+t.key),t)af.call(t,r)&&!uf.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1<a){for(var u=Array(a),c=0;c<a;c++)u[c]=arguments[c+2];o.children=u}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)o[r]===void 0&&(o[r]=a[r]);return{$$typeof:Jo,type:e,key:s,ref:l,props:o,_owner:ou.current}}function Em(e,t){return{$$typeof:Jo,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function su(e){return typeof e=="object"&&e!==null&&e.$$typeof===Jo}function jm(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var lc=/\/+/g;function ti(e,t){return typeof e=="object"&&e!==null&&e.key!=null?jm(""+e.key):t.toString(36)}function Is(e,t,n,r,o){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(s){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case Jo:case hm:l=!0}}if(l)return l=e,o=o(l),e=r===""?"."+ti(l,0):r,sc(o)?(n="",e!=null&&(n=e.replace(lc,"$&/")+"/"),Is(o,t,n,"",function(c){return c})):o!=null&&(su(o)&&(o=Em(o,n+(!o.key||l&&l.key===o.key?"":(""+o.key).replace(lc,"$&/")+"/")+e)),t.push(o)),1;if(l=0,r=r===""?".":r+":",sc(e))for(var a=0;a<e.length;a++){s=e[a];var u=r+ti(s,a);l+=Is(s,t,n,u,o)}else if(u=km(e),typeof u=="function")for(e=u.call(e),a=0;!(s=e.next()).done;)s=s.value,u=r+ti(s,a++),l+=Is(s,t,n,u,o);else if(s==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function as(e,t,n){if(e==null)return e;var r=[],o=0;return Is(e,r,"","",function(s){return t.call(n,s,o++)}),r}function Tm(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var rt={current:null},_s={transition:null},Nm={ReactCurrentDispatcher:rt,ReactCurrentBatchConfig:_s,ReactCurrentOwner:ou};function df(){throw Error("act(...) is not supported in production builds of React.")}ce.Children={map:as,forEach:function(e,t,n){as(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return as(e,function(){t++}),t},toArray:function(e){return as(e,function(t){return t})||[]},only:function(e){if(!su(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ce.Component=no;ce.Fragment=mm;ce.Profiler=ym;ce.PureComponent=nu;ce.StrictMode=gm;ce.Suspense=wm;ce.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Nm;ce.act=df;ce.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=of({},e.props),o=e.key,s=e.ref,l=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,l=ou.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(u in t)af.call(t,u)&&!uf.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&a!==void 0?a[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){a=Array(u);for(var c=0;c<u;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:Jo,type:e.type,key:o,ref:s,props:r,_owner:l}};ce.createContext=function(e){return e={$$typeof:vm,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:xm,_context:e},e.Consumer=e};ce.createElement=cf;ce.createFactory=function(e){var t=cf.bind(null,e);return t.type=e,t};ce.createRef=function(){return{current:null}};ce.forwardRef=function(e){return{$$typeof:bm,render:e}};ce.isValidElement=su;ce.lazy=function(e){return{$$typeof:Cm,_payload:{_status:-1,_result:e},_init:Tm}};ce.memo=function(e,t){return{$$typeof:Sm,type:e,compare:t===void 0?null:t}};ce.startTransition=function(e){var t=_s.transition;_s.transition={};try{e()}finally{_s.transition=t}};ce.unstable_act=df;ce.useCallback=function(e,t){return rt.current.useCallback(e,t)};ce.useContext=function(e){return rt.current.useContext(e)};ce.useDebugValue=function(){};ce.useDeferredValue=function(e){return rt.current.useDeferredValue(e)};ce.useEffect=function(e,t){return rt.current.useEffect(e,t)};ce.useId=function(){return rt.current.useId()};ce.useImperativeHandle=function(e,t,n){return rt.current.useImperativeHandle(e,t,n)};ce.useInsertionEffect=function(e,t){return rt.current.useInsertionEffect(e,t)};ce.useLayoutEffect=function(e,t){return rt.current.useLayoutEffect(e,t)};ce.useMemo=function(e,t){return rt.current.useMemo(e,t)};ce.useReducer=function(e,t,n){return rt.current.useReducer(e,t,n)};ce.useRef=function(e){return rt.current.useRef(e)};ce.useState=function(e){return rt.current.useState(e)};ce.useSyncExternalStore=function(e,t,n){return rt.current.useSyncExternalStore(e,t,n)};ce.useTransition=function(){return rt.current.useTransition()};ce.version="18.3.1";nf.exports=ce;var b=nf.exports;const ff=pm(b),pf=fm({__proto__:null,default:ff},[b]);/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its 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 Rm=b,Pm=Symbol.for("react.element"),Im=Symbol.for("react.fragment"),_m=Object.prototype.hasOwnProperty,Am=Rm.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Lm={key:!0,ref:!0,__self:!0,__source:!0};function hf(e,t,n){var r,o={},s=null,l=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(l=t.ref);for(r in t)_m.call(t,r)&&!Lm.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:Pm,type:e,key:s,ref:l,props:o,_owner:Am.current}}_l.Fragment=Im;_l.jsx=hf;_l.jsxs=hf;tf.exports=_l;var i=tf.exports,Yi={},mf={exports:{}},xt={},gf={exports:{}},yf={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its 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
+ */(function(e){function t(j,R){var P=j.length;j.push(R);e:for(;0<P;){var G=P-1>>>1,Y=j[G];if(0<o(Y,R))j[G]=R,j[P]=Y,P=G;else break e}}function n(j){return j.length===0?null:j[0]}function r(j){if(j.length===0)return null;var R=j[0],P=j.pop();if(P!==R){j[0]=P;e:for(var G=0,Y=j.length,Ce=Y>>>1;G<Ce;){var _e=2*(G+1)-1,$=j[_e],ne=_e+1,ge=j[ne];if(0>o($,P))ne<Y&&0>o(ge,$)?(j[G]=ge,j[ne]=P,G=ne):(j[G]=$,j[_e]=P,G=_e);else if(ne<Y&&0>o(ge,P))j[G]=ge,j[ne]=P,G=ne;else break e}}return R}function o(j,R){var P=j.sortIndex-R.sortIndex;return P!==0?P:j.id-R.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var l=Date,a=l.now();e.unstable_now=function(){return l.now()-a}}var u=[],c=[],f=1,h=null,d=3,m=!1,v=!1,w=!1,S=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(j){for(var R=n(c);R!==null;){if(R.callback===null)r(c);else if(R.startTime<=j)r(c),R.sortIndex=R.expirationTime,t(u,R);else break;R=n(c)}}function x(j){if(w=!1,y(j),!v)if(n(u)!==null)v=!0,Q(k);else{var R=n(c);R!==null&&J(x,R.startTime-j)}}function k(j,R){v=!1,w&&(w=!1,p(E),E=-1),m=!0;var P=d;try{for(y(R),h=n(u);h!==null&&(!(h.expirationTime>R)||j&&!L());){var G=h.callback;if(typeof G=="function"){h.callback=null,d=h.priorityLevel;var Y=G(h.expirationTime<=R);R=e.unstable_now(),typeof Y=="function"?h.callback=Y:h===n(u)&&r(u),y(R)}else r(u);h=n(u)}if(h!==null)var Ce=!0;else{var _e=n(c);_e!==null&&J(x,_e.startTime-R),Ce=!1}return Ce}finally{h=null,d=P,m=!1}}var C=!1,T=null,E=-1,A=5,I=-1;function L(){return!(e.unstable_now()-I<A)}function B(){if(T!==null){var j=e.unstable_now();I=j;var R=!0;try{R=T(!0,j)}finally{R?K():(C=!1,T=null)}}else C=!1}var K;if(typeof g=="function")K=function(){g(B)};else if(typeof MessageChannel<"u"){var D=new MessageChannel,H=D.port2;D.port1.onmessage=B,K=function(){H.postMessage(null)}}else K=function(){S(B,0)};function Q(j){T=j,C||(C=!0,K())}function J(j,R){E=S(function(){j(e.unstable_now())},R)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(j){j.callback=null},e.unstable_continueExecution=function(){v||m||(v=!0,Q(k))},e.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<j?Math.floor(1e3/j):5},e.unstable_getCurrentPriorityLevel=function(){return d},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(j){switch(d){case 1:case 2:case 3:var R=3;break;default:R=d}var P=d;d=R;try{return j()}finally{d=P}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(j,R){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var P=d;d=j;try{return R()}finally{d=P}},e.unstable_scheduleCallback=function(j,R,P){var G=e.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?G+P:G):P=G,j){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=P+Y,j={id:f++,callback:R,priorityLevel:j,startTime:P,expirationTime:Y,sortIndex:-1},P>G?(j.sortIndex=P,t(c,j),n(u)===null&&j===n(c)&&(w?(p(E),E=-1):w=!0,J(x,P-G))):(j.sortIndex=Y,t(u,j),v||m||(v=!0,Q(k))),j},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(j){var R=d;return function(){var P=d;d=R;try{return j.apply(this,arguments)}finally{d=P}}}})(yf);gf.exports=yf;var Dm=gf.exports;/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its 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 Om=b,yt=Dm;function M(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;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."}var xf=new Set,Lo={};function yr(e,t){Gr(e,t),Gr(e+"Capture",t)}function Gr(e,t){for(Lo[e]=t,e=0;e<t.length;e++)xf.add(t[e])}var an=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Qi=Object.prototype.hasOwnProperty,Mm=/^[: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]*$/,ic={},ac={};function $m(e){return Qi.call(ac,e)?!0:Qi.call(ic,e)?!1:Mm.test(e)?ac[e]=!0:(ic[e]=!0,!1)}function zm(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Fm(e,t,n,r){if(t===null||typeof t>"u"||zm(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ot(e,t,n,r,o,s,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=l}var Ye={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ye[e]=new ot(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ye[t]=new ot(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ye[e]=new ot(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ye[e]=new ot(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ye[e]=new ot(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ye[e]=new ot(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ye[e]=new ot(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ye[e]=new ot(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ye[e]=new ot(e,5,!1,e.toLowerCase(),null,!1,!1)});var lu=/[\-:]([a-z])/g;function iu(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(lu,iu);Ye[t]=new ot(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(lu,iu);Ye[t]=new ot(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(lu,iu);Ye[t]=new ot(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ye[e]=new ot(e,1,!1,e.toLowerCase(),null,!1,!1)});Ye.xlinkHref=new ot("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ye[e]=new ot(e,1,!1,e.toLowerCase(),null,!0,!0)});function au(e,t,n,r){var o=Ye.hasOwnProperty(t)?Ye[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Fm(t,n,o,r)&&(n=null),r||o===null?$m(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var vn=Om.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,us=Symbol.for("react.element"),jr=Symbol.for("react.portal"),Tr=Symbol.for("react.fragment"),uu=Symbol.for("react.strict_mode"),Xi=Symbol.for("react.profiler"),vf=Symbol.for("react.provider"),bf=Symbol.for("react.context"),cu=Symbol.for("react.forward_ref"),Zi=Symbol.for("react.suspense"),qi=Symbol.for("react.suspense_list"),du=Symbol.for("react.memo"),Sn=Symbol.for("react.lazy"),wf=Symbol.for("react.offscreen"),uc=Symbol.iterator;function uo(e){return e===null||typeof e!="object"?null:(e=uc&&e[uc]||e["@@iterator"],typeof e=="function"?e:null)}var Pe=Object.assign,ni;function bo(e){if(ni===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);ni=t&&t[1]||""}return`
34
+ `+ni+e}var ri=!1;function oi(e,t){if(!e||ri)return"";ri=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var o=c.stack.split(`
35
+ `),s=r.stack.split(`
36
+ `),l=o.length-1,a=s.length-1;1<=l&&0<=a&&o[l]!==s[a];)a--;for(;1<=l&&0<=a;l--,a--)if(o[l]!==s[a]){if(l!==1||a!==1)do if(l--,a--,0>a||o[l]!==s[a]){var u=`
37
+ `+o[l].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=l&&0<=a);break}}}finally{ri=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?bo(e):""}function Km(e){switch(e.tag){case 5:return bo(e.type);case 16:return bo("Lazy");case 13:return bo("Suspense");case 19:return bo("SuspenseList");case 0:case 2:case 15:return e=oi(e.type,!1),e;case 11:return e=oi(e.type.render,!1),e;case 1:return e=oi(e.type,!0),e;default:return""}}function Ji(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Tr:return"Fragment";case jr:return"Portal";case Xi:return"Profiler";case uu:return"StrictMode";case Zi:return"Suspense";case qi:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case bf:return(e.displayName||"Context")+".Consumer";case vf:return(e._context.displayName||"Context")+".Provider";case cu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case du:return t=e.displayName||null,t!==null?t:Ji(e.type)||"Memo";case Sn:t=e._payload,e=e._init;try{return Ji(e(t))}catch{}}return null}function Hm(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ji(t);case 8:return t===uu?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Fn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Sf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Wm(e){var t=Sf(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(l){r=""+l,s.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function cs(e){e._valueTracker||(e._valueTracker=Wm(e))}function Cf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Sf(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Xs(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 ea(e,t){var n=t.checked;return Pe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function cc(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Fn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function kf(e,t){t=t.checked,t!=null&&au(e,"checked",t,!1)}function ta(e,t){kf(e,t);var n=Fn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?na(e,t.type,n):t.hasOwnProperty("defaultValue")&&na(e,t.type,Fn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function dc(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function na(e,t,n){(t!=="number"||Xs(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var wo=Array.isArray;function zr(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Fn(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function ra(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(M(91));return Pe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function fc(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(M(92));if(wo(n)){if(1<n.length)throw Error(M(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Fn(n)}}function Ef(e,t){var n=Fn(t.value),r=Fn(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function pc(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function jf(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function oa(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?jf(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ds,Tf=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ds=ds||document.createElement("div"),ds.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ds.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Do(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Eo={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Bm=["Webkit","ms","Moz","O"];Object.keys(Eo).forEach(function(e){Bm.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Eo[t]=Eo[e]})});function Nf(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Eo.hasOwnProperty(e)&&Eo[e]?(""+t).trim():t+"px"}function Rf(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Nf(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var Vm=Pe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function sa(e,t){if(t){if(Vm[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(M(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(M(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(M(61))}if(t.style!=null&&typeof t.style!="object")throw Error(M(62))}}function la(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 ia=null;function fu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var aa=null,Fr=null,Kr=null;function hc(e){if(e=ns(e)){if(typeof aa!="function")throw Error(M(280));var t=e.stateNode;t&&(t=Ml(t),aa(e.stateNode,e.type,t))}}function Pf(e){Fr?Kr?Kr.push(e):Kr=[e]:Fr=e}function If(){if(Fr){var e=Fr,t=Kr;if(Kr=Fr=null,hc(e),t)for(e=0;e<t.length;e++)hc(t[e])}}function _f(e,t){return e(t)}function Af(){}var si=!1;function Lf(e,t,n){if(si)return e(t,n);si=!0;try{return _f(e,t,n)}finally{si=!1,(Fr!==null||Kr!==null)&&(Af(),If())}}function Oo(e,t){var n=e.stateNode;if(n===null)return null;var r=Ml(n);if(r===null)return null;n=r[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":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(M(231,t,typeof n));return n}var ua=!1;if(an)try{var co={};Object.defineProperty(co,"passive",{get:function(){ua=!0}}),window.addEventListener("test",co,co),window.removeEventListener("test",co,co)}catch{ua=!1}function Um(e,t,n,r,o,s,l,a,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(f){this.onError(f)}}var jo=!1,Zs=null,qs=!1,ca=null,Gm={onError:function(e){jo=!0,Zs=e}};function Ym(e,t,n,r,o,s,l,a,u){jo=!1,Zs=null,Um.apply(Gm,arguments)}function Qm(e,t,n,r,o,s,l,a,u){if(Ym.apply(this,arguments),jo){if(jo){var c=Zs;jo=!1,Zs=null}else throw Error(M(198));qs||(qs=!0,ca=c)}}function xr(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Df(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 mc(e){if(xr(e)!==e)throw Error(M(188))}function Xm(e){var t=e.alternate;if(!t){if(t=xr(e),t===null)throw Error(M(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var s=o.alternate;if(s===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===s.child){for(s=o.child;s;){if(s===n)return mc(o),e;if(s===r)return mc(o),t;s=s.sibling}throw Error(M(188))}if(n.return!==r.return)n=o,r=s;else{for(var l=!1,a=o.child;a;){if(a===n){l=!0,n=o,r=s;break}if(a===r){l=!0,r=o,n=s;break}a=a.sibling}if(!l){for(a=s.child;a;){if(a===n){l=!0,n=s,r=o;break}if(a===r){l=!0,r=s,n=o;break}a=a.sibling}if(!l)throw Error(M(189))}}if(n.alternate!==r)throw Error(M(190))}if(n.tag!==3)throw Error(M(188));return n.stateNode.current===n?e:t}function Of(e){return e=Xm(e),e!==null?Mf(e):null}function Mf(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Mf(e);if(t!==null)return t;e=e.sibling}return null}var $f=yt.unstable_scheduleCallback,gc=yt.unstable_cancelCallback,Zm=yt.unstable_shouldYield,qm=yt.unstable_requestPaint,Le=yt.unstable_now,Jm=yt.unstable_getCurrentPriorityLevel,pu=yt.unstable_ImmediatePriority,zf=yt.unstable_UserBlockingPriority,Js=yt.unstable_NormalPriority,eg=yt.unstable_LowPriority,Ff=yt.unstable_IdlePriority,Al=null,zt=null;function tg(e){if(zt&&typeof zt.onCommitFiberRoot=="function")try{zt.onCommitFiberRoot(Al,e,void 0,(e.current.flags&128)===128)}catch{}}var At=Math.clz32?Math.clz32:og,ng=Math.log,rg=Math.LN2;function og(e){return e>>>=0,e===0?32:31-(ng(e)/rg|0)|0}var fs=64,ps=4194304;function So(e){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:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function el(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,s=e.pingedLanes,l=n&268435455;if(l!==0){var a=l&~o;a!==0?r=So(a):(s&=l,s!==0&&(r=So(s)))}else l=n&~o,l!==0?r=So(l):s!==0&&(r=So(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,s=t&-t,o>=s||o===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-At(t),o=1<<n,r|=e[n],t&=~o;return r}function sg(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function lg(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,s=e.pendingLanes;0<s;){var l=31-At(s),a=1<<l,u=o[l];u===-1?(!(a&n)||a&r)&&(o[l]=sg(a,t)):u<=t&&(e.expiredLanes|=a),s&=~a}}function da(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Kf(){var e=fs;return fs<<=1,!(fs&4194240)&&(fs=64),e}function li(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function es(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-At(t),e[t]=n}function ig(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-At(n),s=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~s}}function hu(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-At(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var he=0;function Hf(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Wf,mu,Bf,Vf,Uf,fa=!1,hs=[],In=null,_n=null,An=null,Mo=new Map,$o=new Map,jn=[],ag="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 submit".split(" ");function yc(e,t){switch(e){case"focusin":case"focusout":In=null;break;case"dragenter":case"dragleave":_n=null;break;case"mouseover":case"mouseout":An=null;break;case"pointerover":case"pointerout":Mo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":$o.delete(t.pointerId)}}function fo(e,t,n,r,o,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[o]},t!==null&&(t=ns(t),t!==null&&mu(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function ug(e,t,n,r,o){switch(t){case"focusin":return In=fo(In,e,t,n,r,o),!0;case"dragenter":return _n=fo(_n,e,t,n,r,o),!0;case"mouseover":return An=fo(An,e,t,n,r,o),!0;case"pointerover":var s=o.pointerId;return Mo.set(s,fo(Mo.get(s)||null,e,t,n,r,o)),!0;case"gotpointercapture":return s=o.pointerId,$o.set(s,fo($o.get(s)||null,e,t,n,r,o)),!0}return!1}function Gf(e){var t=er(e.target);if(t!==null){var n=xr(t);if(n!==null){if(t=n.tag,t===13){if(t=Df(n),t!==null){e.blockedOn=t,Uf(e.priority,function(){Bf(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 As(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=pa(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);ia=r,n.target.dispatchEvent(r),ia=null}else return t=ns(n),t!==null&&mu(t),e.blockedOn=n,!1;t.shift()}return!0}function xc(e,t,n){As(e)&&n.delete(t)}function cg(){fa=!1,In!==null&&As(In)&&(In=null),_n!==null&&As(_n)&&(_n=null),An!==null&&As(An)&&(An=null),Mo.forEach(xc),$o.forEach(xc)}function po(e,t){e.blockedOn===t&&(e.blockedOn=null,fa||(fa=!0,yt.unstable_scheduleCallback(yt.unstable_NormalPriority,cg)))}function zo(e){function t(o){return po(o,e)}if(0<hs.length){po(hs[0],e);for(var n=1;n<hs.length;n++){var r=hs[n];r.blockedOn===e&&(r.blockedOn=null)}}for(In!==null&&po(In,e),_n!==null&&po(_n,e),An!==null&&po(An,e),Mo.forEach(t),$o.forEach(t),n=0;n<jn.length;n++)r=jn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<jn.length&&(n=jn[0],n.blockedOn===null);)Gf(n),n.blockedOn===null&&jn.shift()}var Hr=vn.ReactCurrentBatchConfig,tl=!0;function dg(e,t,n,r){var o=he,s=Hr.transition;Hr.transition=null;try{he=1,gu(e,t,n,r)}finally{he=o,Hr.transition=s}}function fg(e,t,n,r){var o=he,s=Hr.transition;Hr.transition=null;try{he=4,gu(e,t,n,r)}finally{he=o,Hr.transition=s}}function gu(e,t,n,r){if(tl){var o=pa(e,t,n,r);if(o===null)gi(e,t,r,nl,n),yc(e,r);else if(ug(o,e,t,n,r))r.stopPropagation();else if(yc(e,r),t&4&&-1<ag.indexOf(e)){for(;o!==null;){var s=ns(o);if(s!==null&&Wf(s),s=pa(e,t,n,r),s===null&&gi(e,t,r,nl,n),s===o)break;o=s}o!==null&&r.stopPropagation()}else gi(e,t,r,null,n)}}var nl=null;function pa(e,t,n,r){if(nl=null,e=fu(r),e=er(e),e!==null)if(t=xr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Df(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 nl=e,null}function Yf(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Jm()){case pu:return 1;case zf:return 4;case Js:case eg:return 16;case Ff:return 536870912;default:return 16}default:return 16}}var Rn=null,yu=null,Ls=null;function Qf(){if(Ls)return Ls;var e,t=yu,n=t.length,r,o="value"in Rn?Rn.value:Rn.textContent,s=o.length;for(e=0;e<n&&t[e]===o[e];e++);var l=n-e;for(r=1;r<=l&&t[n-r]===o[s-r];r++);return Ls=o.slice(e,1<r?1-r:void 0)}function Ds(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 ms(){return!0}function vc(){return!1}function vt(e){function t(n,r,o,s,l){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=s,this.target=l,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?ms:vc,this.isPropagationStopped=vc,this}return Pe(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=ms)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ms)},persist:function(){},isPersistent:ms}),t}var ro={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},xu=vt(ro),ts=Pe({},ro,{view:0,detail:0}),pg=vt(ts),ii,ai,ho,Ll=Pe({},ts,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:vu,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!==ho&&(ho&&e.type==="mousemove"?(ii=e.screenX-ho.screenX,ai=e.screenY-ho.screenY):ai=ii=0,ho=e),ii)},movementY:function(e){return"movementY"in e?e.movementY:ai}}),bc=vt(Ll),hg=Pe({},Ll,{dataTransfer:0}),mg=vt(hg),gg=Pe({},ts,{relatedTarget:0}),ui=vt(gg),yg=Pe({},ro,{animationName:0,elapsedTime:0,pseudoElement:0}),xg=vt(yg),vg=Pe({},ro,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),bg=vt(vg),wg=Pe({},ro,{data:0}),wc=vt(wg),Sg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Cg={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"},kg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Eg(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=kg[e])?!!t[e]:!1}function vu(){return Eg}var jg=Pe({},ts,{key:function(e){if(e.key){var t=Sg[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ds(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Cg[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:vu,charCode:function(e){return e.type==="keypress"?Ds(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ds(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Tg=vt(jg),Ng=Pe({},Ll,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sc=vt(Ng),Rg=Pe({},ts,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:vu}),Pg=vt(Rg),Ig=Pe({},ro,{propertyName:0,elapsedTime:0,pseudoElement:0}),_g=vt(Ig),Ag=Pe({},Ll,{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}),Lg=vt(Ag),Dg=[9,13,27,32],bu=an&&"CompositionEvent"in window,To=null;an&&"documentMode"in document&&(To=document.documentMode);var Og=an&&"TextEvent"in window&&!To,Xf=an&&(!bu||To&&8<To&&11>=To),Cc=" ",kc=!1;function Zf(e,t){switch(e){case"keyup":return Dg.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Nr=!1;function Mg(e,t){switch(e){case"compositionend":return qf(t);case"keypress":return t.which!==32?null:(kc=!0,Cc);case"textInput":return e=t.data,e===Cc&&kc?null:e;default:return null}}function $g(e,t){if(Nr)return e==="compositionend"||!bu&&Zf(e,t)?(e=Qf(),Ls=yu=Rn=null,Nr=!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 Xf&&t.locale!=="ko"?null:t.data;default:return null}}var zg={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 Ec(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!zg[e.type]:t==="textarea"}function Jf(e,t,n,r){Pf(r),t=rl(t,"onChange"),0<t.length&&(n=new xu("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var No=null,Fo=null;function Fg(e){cp(e,0)}function Dl(e){var t=Ir(e);if(Cf(t))return e}function Kg(e,t){if(e==="change")return t}var ep=!1;if(an){var ci;if(an){var di="oninput"in document;if(!di){var jc=document.createElement("div");jc.setAttribute("oninput","return;"),di=typeof jc.oninput=="function"}ci=di}else ci=!1;ep=ci&&(!document.documentMode||9<document.documentMode)}function Tc(){No&&(No.detachEvent("onpropertychange",tp),Fo=No=null)}function tp(e){if(e.propertyName==="value"&&Dl(Fo)){var t=[];Jf(t,Fo,e,fu(e)),Lf(Fg,t)}}function Hg(e,t,n){e==="focusin"?(Tc(),No=t,Fo=n,No.attachEvent("onpropertychange",tp)):e==="focusout"&&Tc()}function Wg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Dl(Fo)}function Bg(e,t){if(e==="click")return Dl(t)}function Vg(e,t){if(e==="input"||e==="change")return Dl(t)}function Ug(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Dt=typeof Object.is=="function"?Object.is:Ug;function Ko(e,t){if(Dt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!Qi.call(t,o)||!Dt(e[o],t[o]))return!1}return!0}function Nc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Rc(e,t){var n=Nc(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Nc(n)}}function np(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?np(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function rp(){for(var e=window,t=Xs();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Xs(e.document)}return t}function wu(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")}function Gg(e){var t=rp(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&np(n.ownerDocument.documentElement,n)){if(r!==null&&wu(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,s=Math.min(r.start,o);r=r.end===void 0?s:Math.min(r.end,o),!e.extend&&s>r&&(o=r,r=s,s=o),o=Rc(n,s);var l=Rc(n,r);o&&l&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Yg=an&&"documentMode"in document&&11>=document.documentMode,Rr=null,ha=null,Ro=null,ma=!1;function Pc(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ma||Rr==null||Rr!==Xs(r)||(r=Rr,"selectionStart"in r&&wu(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ro&&Ko(Ro,r)||(Ro=r,r=rl(ha,"onSelect"),0<r.length&&(t=new xu("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Rr)))}function gs(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Pr={animationend:gs("Animation","AnimationEnd"),animationiteration:gs("Animation","AnimationIteration"),animationstart:gs("Animation","AnimationStart"),transitionend:gs("Transition","TransitionEnd")},fi={},op={};an&&(op=document.createElement("div").style,"AnimationEvent"in window||(delete Pr.animationend.animation,delete Pr.animationiteration.animation,delete Pr.animationstart.animation),"TransitionEvent"in window||delete Pr.transitionend.transition);function Ol(e){if(fi[e])return fi[e];if(!Pr[e])return e;var t=Pr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in op)return fi[e]=t[n];return e}var sp=Ol("animationend"),lp=Ol("animationiteration"),ip=Ol("animationstart"),ap=Ol("transitionend"),up=new Map,Ic="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Bn(e,t){up.set(e,t),yr(t,[e])}for(var pi=0;pi<Ic.length;pi++){var hi=Ic[pi],Qg=hi.toLowerCase(),Xg=hi[0].toUpperCase()+hi.slice(1);Bn(Qg,"on"+Xg)}Bn(sp,"onAnimationEnd");Bn(lp,"onAnimationIteration");Bn(ip,"onAnimationStart");Bn("dblclick","onDoubleClick");Bn("focusin","onFocus");Bn("focusout","onBlur");Bn(ap,"onTransitionEnd");Gr("onMouseEnter",["mouseout","mouseover"]);Gr("onMouseLeave",["mouseout","mouseover"]);Gr("onPointerEnter",["pointerout","pointerover"]);Gr("onPointerLeave",["pointerout","pointerover"]);yr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));yr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));yr("onBeforeInput",["compositionend","keypress","textInput","paste"]);yr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));yr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));yr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Co="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(" "),Zg=new Set("cancel close invalid load scroll toggle".split(" ").concat(Co));function _c(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Qm(r,t,void 0,e),e.currentTarget=null}function cp(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var l=r.length-1;0<=l;l--){var a=r[l],u=a.instance,c=a.currentTarget;if(a=a.listener,u!==s&&o.isPropagationStopped())break e;_c(o,a,c),s=u}else for(l=0;l<r.length;l++){if(a=r[l],u=a.instance,c=a.currentTarget,a=a.listener,u!==s&&o.isPropagationStopped())break e;_c(o,a,c),s=u}}}if(qs)throw e=ca,qs=!1,ca=null,e}function we(e,t){var n=t[ba];n===void 0&&(n=t[ba]=new Set);var r=e+"__bubble";n.has(r)||(dp(t,e,2,!1),n.add(r))}function mi(e,t,n){var r=0;t&&(r|=4),dp(n,e,r,t)}var ys="_reactListening"+Math.random().toString(36).slice(2);function Ho(e){if(!e[ys]){e[ys]=!0,xf.forEach(function(n){n!=="selectionchange"&&(Zg.has(n)||mi(n,!1,e),mi(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ys]||(t[ys]=!0,mi("selectionchange",!1,t))}}function dp(e,t,n,r){switch(Yf(t)){case 1:var o=dg;break;case 4:o=fg;break;default:o=gu}n=o.bind(null,t,n,e),o=void 0,!ua||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function gi(e,t,n,r,o){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var l=r.tag;if(l===3||l===4){var a=r.stateNode.containerInfo;if(a===o||a.nodeType===8&&a.parentNode===o)break;if(l===4)for(l=r.return;l!==null;){var u=l.tag;if((u===3||u===4)&&(u=l.stateNode.containerInfo,u===o||u.nodeType===8&&u.parentNode===o))return;l=l.return}for(;a!==null;){if(l=er(a),l===null)return;if(u=l.tag,u===5||u===6){r=s=l;continue e}a=a.parentNode}}r=r.return}Lf(function(){var c=s,f=fu(n),h=[];e:{var d=up.get(e);if(d!==void 0){var m=xu,v=e;switch(e){case"keypress":if(Ds(n)===0)break e;case"keydown":case"keyup":m=Tg;break;case"focusin":v="focus",m=ui;break;case"focusout":v="blur",m=ui;break;case"beforeblur":case"afterblur":m=ui;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":m=bc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=mg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=Pg;break;case sp:case lp:case ip:m=xg;break;case ap:m=_g;break;case"scroll":m=pg;break;case"wheel":m=Lg;break;case"copy":case"cut":case"paste":m=bg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=Sc}var w=(t&4)!==0,S=!w&&e==="scroll",p=w?d!==null?d+"Capture":null:d;w=[];for(var g=c,y;g!==null;){y=g;var x=y.stateNode;if(y.tag===5&&x!==null&&(y=x,p!==null&&(x=Oo(g,p),x!=null&&w.push(Wo(g,x,y)))),S)break;g=g.return}0<w.length&&(d=new m(d,v,null,n,f),h.push({event:d,listeners:w}))}}if(!(t&7)){e:{if(d=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",d&&n!==ia&&(v=n.relatedTarget||n.fromElement)&&(er(v)||v[un]))break e;if((m||d)&&(d=f.window===f?f:(d=f.ownerDocument)?d.defaultView||d.parentWindow:window,m?(v=n.relatedTarget||n.toElement,m=c,v=v?er(v):null,v!==null&&(S=xr(v),v!==S||v.tag!==5&&v.tag!==6)&&(v=null)):(m=null,v=c),m!==v)){if(w=bc,x="onMouseLeave",p="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(w=Sc,x="onPointerLeave",p="onPointerEnter",g="pointer"),S=m==null?d:Ir(m),y=v==null?d:Ir(v),d=new w(x,g+"leave",m,n,f),d.target=S,d.relatedTarget=y,x=null,er(f)===c&&(w=new w(p,g+"enter",v,n,f),w.target=y,w.relatedTarget=S,x=w),S=x,m&&v)t:{for(w=m,p=v,g=0,y=w;y;y=wr(y))g++;for(y=0,x=p;x;x=wr(x))y++;for(;0<g-y;)w=wr(w),g--;for(;0<y-g;)p=wr(p),y--;for(;g--;){if(w===p||p!==null&&w===p.alternate)break t;w=wr(w),p=wr(p)}w=null}else w=null;m!==null&&Ac(h,d,m,w,!1),v!==null&&S!==null&&Ac(h,S,v,w,!0)}}e:{if(d=c?Ir(c):window,m=d.nodeName&&d.nodeName.toLowerCase(),m==="select"||m==="input"&&d.type==="file")var k=Kg;else if(Ec(d))if(ep)k=Vg;else{k=Wg;var C=Hg}else(m=d.nodeName)&&m.toLowerCase()==="input"&&(d.type==="checkbox"||d.type==="radio")&&(k=Bg);if(k&&(k=k(e,c))){Jf(h,k,n,f);break e}C&&C(e,d,c),e==="focusout"&&(C=d._wrapperState)&&C.controlled&&d.type==="number"&&na(d,"number",d.value)}switch(C=c?Ir(c):window,e){case"focusin":(Ec(C)||C.contentEditable==="true")&&(Rr=C,ha=c,Ro=null);break;case"focusout":Ro=ha=Rr=null;break;case"mousedown":ma=!0;break;case"contextmenu":case"mouseup":case"dragend":ma=!1,Pc(h,n,f);break;case"selectionchange":if(Yg)break;case"keydown":case"keyup":Pc(h,n,f)}var T;if(bu)e:{switch(e){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else Nr?Zf(e,n)&&(E="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(E="onCompositionStart");E&&(Xf&&n.locale!=="ko"&&(Nr||E!=="onCompositionStart"?E==="onCompositionEnd"&&Nr&&(T=Qf()):(Rn=f,yu="value"in Rn?Rn.value:Rn.textContent,Nr=!0)),C=rl(c,E),0<C.length&&(E=new wc(E,e,null,n,f),h.push({event:E,listeners:C}),T?E.data=T:(T=qf(n),T!==null&&(E.data=T)))),(T=Og?Mg(e,n):$g(e,n))&&(c=rl(c,"onBeforeInput"),0<c.length&&(f=new wc("onBeforeInput","beforeinput",null,n,f),h.push({event:f,listeners:c}),f.data=T))}cp(h,t)})}function Wo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function rl(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,s=o.stateNode;o.tag===5&&s!==null&&(o=s,s=Oo(e,n),s!=null&&r.unshift(Wo(e,s,o)),s=Oo(e,t),s!=null&&r.push(Wo(e,s,o))),e=e.return}return r}function wr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Ac(e,t,n,r,o){for(var s=t._reactName,l=[];n!==null&&n!==r;){var a=n,u=a.alternate,c=a.stateNode;if(u!==null&&u===r)break;a.tag===5&&c!==null&&(a=c,o?(u=Oo(n,s),u!=null&&l.unshift(Wo(n,u,a))):o||(u=Oo(n,s),u!=null&&l.push(Wo(n,u,a)))),n=n.return}l.length!==0&&e.push({event:t,listeners:l})}var qg=/\r\n?/g,Jg=/\u0000|\uFFFD/g;function Lc(e){return(typeof e=="string"?e:""+e).replace(qg,`
38
+ `).replace(Jg,"")}function xs(e,t,n){if(t=Lc(t),Lc(e)!==t&&n)throw Error(M(425))}function ol(){}var ga=null,ya=null;function xa(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var va=typeof setTimeout=="function"?setTimeout:void 0,ey=typeof clearTimeout=="function"?clearTimeout:void 0,Dc=typeof Promise=="function"?Promise:void 0,ty=typeof queueMicrotask=="function"?queueMicrotask:typeof Dc<"u"?function(e){return Dc.resolve(null).then(e).catch(ny)}:va;function ny(e){setTimeout(function(){throw e})}function yi(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),zo(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);zo(t)}function Ln(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==="$?")break;if(t==="/$")return null}}return e}function Oc(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var oo=Math.random().toString(36).slice(2),$t="__reactFiber$"+oo,Bo="__reactProps$"+oo,un="__reactContainer$"+oo,ba="__reactEvents$"+oo,ry="__reactListeners$"+oo,oy="__reactHandles$"+oo;function er(e){var t=e[$t];if(t)return t;for(var n=e.parentNode;n;){if(t=n[un]||n[$t]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Oc(e);e!==null;){if(n=e[$t])return n;e=Oc(e)}return t}e=n,n=e.parentNode}return null}function ns(e){return e=e[$t]||e[un],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ir(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(M(33))}function Ml(e){return e[Bo]||null}var wa=[],_r=-1;function Vn(e){return{current:e}}function Se(e){0>_r||(e.current=wa[_r],wa[_r]=null,_r--)}function ve(e,t){_r++,wa[_r]=e.current,e.current=t}var Kn={},qe=Vn(Kn),ut=Vn(!1),ir=Kn;function Yr(e,t){var n=e.type.contextTypes;if(!n)return Kn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},s;for(s in n)o[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function ct(e){return e=e.childContextTypes,e!=null}function sl(){Se(ut),Se(qe)}function Mc(e,t,n){if(qe.current!==Kn)throw Error(M(168));ve(qe,t),ve(ut,n)}function fp(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(M(108,Hm(e)||"Unknown",o));return Pe({},n,r)}function ll(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Kn,ir=qe.current,ve(qe,e),ve(ut,ut.current),!0}function $c(e,t,n){var r=e.stateNode;if(!r)throw Error(M(169));n?(e=fp(e,t,ir),r.__reactInternalMemoizedMergedChildContext=e,Se(ut),Se(qe),ve(qe,e)):Se(ut),ve(ut,n)}var Jt=null,$l=!1,xi=!1;function pp(e){Jt===null?Jt=[e]:Jt.push(e)}function sy(e){$l=!0,pp(e)}function Un(){if(!xi&&Jt!==null){xi=!0;var e=0,t=he;try{var n=Jt;for(he=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Jt=null,$l=!1}catch(o){throw Jt!==null&&(Jt=Jt.slice(e+1)),$f(pu,Un),o}finally{he=t,xi=!1}}return null}var Ar=[],Lr=0,il=null,al=0,wt=[],St=0,ar=null,tn=1,nn="";function qn(e,t){Ar[Lr++]=al,Ar[Lr++]=il,il=e,al=t}function hp(e,t,n){wt[St++]=tn,wt[St++]=nn,wt[St++]=ar,ar=e;var r=tn;e=nn;var o=32-At(r)-1;r&=~(1<<o),n+=1;var s=32-At(t)+o;if(30<s){var l=o-o%5;s=(r&(1<<l)-1).toString(32),r>>=l,o-=l,tn=1<<32-At(t)+o|n<<o|r,nn=s+e}else tn=1<<s|n<<o|r,nn=e}function Su(e){e.return!==null&&(qn(e,1),hp(e,1,0))}function Cu(e){for(;e===il;)il=Ar[--Lr],Ar[Lr]=null,al=Ar[--Lr],Ar[Lr]=null;for(;e===ar;)ar=wt[--St],wt[St]=null,nn=wt[--St],wt[St]=null,tn=wt[--St],wt[St]=null}var mt=null,ht=null,Ee=!1,_t=null;function mp(e,t){var n=Ct(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function zc(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,mt=e,ht=Ln(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,mt=e,ht=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ar!==null?{id:tn,overflow:nn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Ct(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,mt=e,ht=null,!0):!1;default:return!1}}function Sa(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ca(e){if(Ee){var t=ht;if(t){var n=t;if(!zc(e,t)){if(Sa(e))throw Error(M(418));t=Ln(n.nextSibling);var r=mt;t&&zc(e,t)?mp(r,n):(e.flags=e.flags&-4097|2,Ee=!1,mt=e)}}else{if(Sa(e))throw Error(M(418));e.flags=e.flags&-4097|2,Ee=!1,mt=e}}}function Fc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;mt=e}function vs(e){if(e!==mt)return!1;if(!Ee)return Fc(e),Ee=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!xa(e.type,e.memoizedProps)),t&&(t=ht)){if(Sa(e))throw gp(),Error(M(418));for(;t;)mp(e,t),t=Ln(t.nextSibling)}if(Fc(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(M(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){ht=Ln(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ht=null}}else ht=mt?Ln(e.stateNode.nextSibling):null;return!0}function gp(){for(var e=ht;e;)e=Ln(e.nextSibling)}function Qr(){ht=mt=null,Ee=!1}function ku(e){_t===null?_t=[e]:_t.push(e)}var ly=vn.ReactCurrentBatchConfig;function mo(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(M(309));var r=n.stateNode}if(!r)throw Error(M(147,e));var o=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(l){var a=o.refs;l===null?delete a[s]:a[s]=l},t._stringRef=s,t)}if(typeof e!="string")throw Error(M(284));if(!n._owner)throw Error(M(290,e))}return e}function bs(e,t){throw e=Object.prototype.toString.call(t),Error(M(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Kc(e){var t=e._init;return t(e._payload)}function yp(e){function t(p,g){if(e){var y=p.deletions;y===null?(p.deletions=[g],p.flags|=16):y.push(g)}}function n(p,g){if(!e)return null;for(;g!==null;)t(p,g),g=g.sibling;return null}function r(p,g){for(p=new Map;g!==null;)g.key!==null?p.set(g.key,g):p.set(g.index,g),g=g.sibling;return p}function o(p,g){return p=$n(p,g),p.index=0,p.sibling=null,p}function s(p,g,y){return p.index=y,e?(y=p.alternate,y!==null?(y=y.index,y<g?(p.flags|=2,g):y):(p.flags|=2,g)):(p.flags|=1048576,g)}function l(p){return e&&p.alternate===null&&(p.flags|=2),p}function a(p,g,y,x){return g===null||g.tag!==6?(g=Ei(y,p.mode,x),g.return=p,g):(g=o(g,y),g.return=p,g)}function u(p,g,y,x){var k=y.type;return k===Tr?f(p,g,y.props.children,x,y.key):g!==null&&(g.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Sn&&Kc(k)===g.type)?(x=o(g,y.props),x.ref=mo(p,g,y),x.return=p,x):(x=Hs(y.type,y.key,y.props,null,p.mode,x),x.ref=mo(p,g,y),x.return=p,x)}function c(p,g,y,x){return g===null||g.tag!==4||g.stateNode.containerInfo!==y.containerInfo||g.stateNode.implementation!==y.implementation?(g=ji(y,p.mode,x),g.return=p,g):(g=o(g,y.children||[]),g.return=p,g)}function f(p,g,y,x,k){return g===null||g.tag!==7?(g=sr(y,p.mode,x,k),g.return=p,g):(g=o(g,y),g.return=p,g)}function h(p,g,y){if(typeof g=="string"&&g!==""||typeof g=="number")return g=Ei(""+g,p.mode,y),g.return=p,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case us:return y=Hs(g.type,g.key,g.props,null,p.mode,y),y.ref=mo(p,null,g),y.return=p,y;case jr:return g=ji(g,p.mode,y),g.return=p,g;case Sn:var x=g._init;return h(p,x(g._payload),y)}if(wo(g)||uo(g))return g=sr(g,p.mode,y,null),g.return=p,g;bs(p,g)}return null}function d(p,g,y,x){var k=g!==null?g.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return k!==null?null:a(p,g,""+y,x);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case us:return y.key===k?u(p,g,y,x):null;case jr:return y.key===k?c(p,g,y,x):null;case Sn:return k=y._init,d(p,g,k(y._payload),x)}if(wo(y)||uo(y))return k!==null?null:f(p,g,y,x,null);bs(p,y)}return null}function m(p,g,y,x,k){if(typeof x=="string"&&x!==""||typeof x=="number")return p=p.get(y)||null,a(g,p,""+x,k);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case us:return p=p.get(x.key===null?y:x.key)||null,u(g,p,x,k);case jr:return p=p.get(x.key===null?y:x.key)||null,c(g,p,x,k);case Sn:var C=x._init;return m(p,g,y,C(x._payload),k)}if(wo(x)||uo(x))return p=p.get(y)||null,f(g,p,x,k,null);bs(g,x)}return null}function v(p,g,y,x){for(var k=null,C=null,T=g,E=g=0,A=null;T!==null&&E<y.length;E++){T.index>E?(A=T,T=null):A=T.sibling;var I=d(p,T,y[E],x);if(I===null){T===null&&(T=A);break}e&&T&&I.alternate===null&&t(p,T),g=s(I,g,E),C===null?k=I:C.sibling=I,C=I,T=A}if(E===y.length)return n(p,T),Ee&&qn(p,E),k;if(T===null){for(;E<y.length;E++)T=h(p,y[E],x),T!==null&&(g=s(T,g,E),C===null?k=T:C.sibling=T,C=T);return Ee&&qn(p,E),k}for(T=r(p,T);E<y.length;E++)A=m(T,p,E,y[E],x),A!==null&&(e&&A.alternate!==null&&T.delete(A.key===null?E:A.key),g=s(A,g,E),C===null?k=A:C.sibling=A,C=A);return e&&T.forEach(function(L){return t(p,L)}),Ee&&qn(p,E),k}function w(p,g,y,x){var k=uo(y);if(typeof k!="function")throw Error(M(150));if(y=k.call(y),y==null)throw Error(M(151));for(var C=k=null,T=g,E=g=0,A=null,I=y.next();T!==null&&!I.done;E++,I=y.next()){T.index>E?(A=T,T=null):A=T.sibling;var L=d(p,T,I.value,x);if(L===null){T===null&&(T=A);break}e&&T&&L.alternate===null&&t(p,T),g=s(L,g,E),C===null?k=L:C.sibling=L,C=L,T=A}if(I.done)return n(p,T),Ee&&qn(p,E),k;if(T===null){for(;!I.done;E++,I=y.next())I=h(p,I.value,x),I!==null&&(g=s(I,g,E),C===null?k=I:C.sibling=I,C=I);return Ee&&qn(p,E),k}for(T=r(p,T);!I.done;E++,I=y.next())I=m(T,p,E,I.value,x),I!==null&&(e&&I.alternate!==null&&T.delete(I.key===null?E:I.key),g=s(I,g,E),C===null?k=I:C.sibling=I,C=I);return e&&T.forEach(function(B){return t(p,B)}),Ee&&qn(p,E),k}function S(p,g,y,x){if(typeof y=="object"&&y!==null&&y.type===Tr&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case us:e:{for(var k=y.key,C=g;C!==null;){if(C.key===k){if(k=y.type,k===Tr){if(C.tag===7){n(p,C.sibling),g=o(C,y.props.children),g.return=p,p=g;break e}}else if(C.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Sn&&Kc(k)===C.type){n(p,C.sibling),g=o(C,y.props),g.ref=mo(p,C,y),g.return=p,p=g;break e}n(p,C);break}else t(p,C);C=C.sibling}y.type===Tr?(g=sr(y.props.children,p.mode,x,y.key),g.return=p,p=g):(x=Hs(y.type,y.key,y.props,null,p.mode,x),x.ref=mo(p,g,y),x.return=p,p=x)}return l(p);case jr:e:{for(C=y.key;g!==null;){if(g.key===C)if(g.tag===4&&g.stateNode.containerInfo===y.containerInfo&&g.stateNode.implementation===y.implementation){n(p,g.sibling),g=o(g,y.children||[]),g.return=p,p=g;break e}else{n(p,g);break}else t(p,g);g=g.sibling}g=ji(y,p.mode,x),g.return=p,p=g}return l(p);case Sn:return C=y._init,S(p,g,C(y._payload),x)}if(wo(y))return v(p,g,y,x);if(uo(y))return w(p,g,y,x);bs(p,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,g!==null&&g.tag===6?(n(p,g.sibling),g=o(g,y),g.return=p,p=g):(n(p,g),g=Ei(y,p.mode,x),g.return=p,p=g),l(p)):n(p,g)}return S}var Xr=yp(!0),xp=yp(!1),ul=Vn(null),cl=null,Dr=null,Eu=null;function ju(){Eu=Dr=cl=null}function Tu(e){var t=ul.current;Se(ul),e._currentValue=t}function ka(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Wr(e,t){cl=e,Eu=Dr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(at=!0),e.firstContext=null)}function jt(e){var t=e._currentValue;if(Eu!==e)if(e={context:e,memoizedValue:t,next:null},Dr===null){if(cl===null)throw Error(M(308));Dr=e,cl.dependencies={lanes:0,firstContext:e}}else Dr=Dr.next=e;return t}var tr=null;function Nu(e){tr===null?tr=[e]:tr.push(e)}function vp(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Nu(t)):(n.next=o.next,o.next=n),t.interleaved=n,cn(e,r)}function cn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Cn=!1;function Ru(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function bp(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function on(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Dn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,de&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,cn(e,n)}return o=r.interleaved,o===null?(t.next=t,Nu(r)):(t.next=o.next,o.next=t),r.interleaved=t,cn(e,n)}function Os(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,hu(e,n)}}function Hc(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var l={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?o=s=l:s=s.next=l,n=n.next}while(n!==null);s===null?o=s=t:s=s.next=t}else o=s=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function dl(e,t,n,r){var o=e.updateQueue;Cn=!1;var s=o.firstBaseUpdate,l=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var u=a,c=u.next;u.next=null,l===null?s=c:l.next=c,l=u;var f=e.alternate;f!==null&&(f=f.updateQueue,a=f.lastBaseUpdate,a!==l&&(a===null?f.firstBaseUpdate=c:a.next=c,f.lastBaseUpdate=u))}if(s!==null){var h=o.baseState;l=0,f=c=u=null,a=s;do{var d=a.lane,m=a.eventTime;if((r&d)===d){f!==null&&(f=f.next={eventTime:m,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var v=e,w=a;switch(d=t,m=n,w.tag){case 1:if(v=w.payload,typeof v=="function"){h=v.call(m,h,d);break e}h=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=w.payload,d=typeof v=="function"?v.call(m,h,d):v,d==null)break e;h=Pe({},h,d);break e;case 2:Cn=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,d=o.effects,d===null?o.effects=[a]:d.push(a))}else m={eventTime:m,lane:d,tag:a.tag,payload:a.payload,callback:a.callback,next:null},f===null?(c=f=m,u=h):f=f.next=m,l|=d;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;d=a,a=d.next,d.next=null,o.lastBaseUpdate=d,o.shared.pending=null}}while(!0);if(f===null&&(u=h),o.baseState=u,o.firstBaseUpdate=c,o.lastBaseUpdate=f,t=o.shared.interleaved,t!==null){o=t;do l|=o.lane,o=o.next;while(o!==t)}else s===null&&(o.shared.lanes=0);cr|=l,e.lanes=l,e.memoizedState=h}}function Wc(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(M(191,o));o.call(r)}}}var rs={},Ft=Vn(rs),Vo=Vn(rs),Uo=Vn(rs);function nr(e){if(e===rs)throw Error(M(174));return e}function Pu(e,t){switch(ve(Uo,t),ve(Vo,e),ve(Ft,rs),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:oa(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=oa(t,e)}Se(Ft),ve(Ft,t)}function Zr(){Se(Ft),Se(Vo),Se(Uo)}function wp(e){nr(Uo.current);var t=nr(Ft.current),n=oa(t,e.type);t!==n&&(ve(Vo,e),ve(Ft,n))}function Iu(e){Vo.current===e&&(Se(Ft),Se(Vo))}var Ne=Vn(0);function fl(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var vi=[];function _u(){for(var e=0;e<vi.length;e++)vi[e]._workInProgressVersionPrimary=null;vi.length=0}var Ms=vn.ReactCurrentDispatcher,bi=vn.ReactCurrentBatchConfig,ur=0,Re=null,Fe=null,We=null,pl=!1,Po=!1,Go=0,iy=0;function Qe(){throw Error(M(321))}function Au(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Dt(e[n],t[n]))return!1;return!0}function Lu(e,t,n,r,o,s){if(ur=s,Re=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ms.current=e===null||e.memoizedState===null?dy:fy,e=n(r,o),Po){s=0;do{if(Po=!1,Go=0,25<=s)throw Error(M(301));s+=1,We=Fe=null,t.updateQueue=null,Ms.current=py,e=n(r,o)}while(Po)}if(Ms.current=hl,t=Fe!==null&&Fe.next!==null,ur=0,We=Fe=Re=null,pl=!1,t)throw Error(M(300));return e}function Du(){var e=Go!==0;return Go=0,e}function Mt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return We===null?Re.memoizedState=We=e:We=We.next=e,We}function Tt(){if(Fe===null){var e=Re.alternate;e=e!==null?e.memoizedState:null}else e=Fe.next;var t=We===null?Re.memoizedState:We.next;if(t!==null)We=t,Fe=e;else{if(e===null)throw Error(M(310));Fe=e,e={memoizedState:Fe.memoizedState,baseState:Fe.baseState,baseQueue:Fe.baseQueue,queue:Fe.queue,next:null},We===null?Re.memoizedState=We=e:We=We.next=e}return We}function Yo(e,t){return typeof t=="function"?t(e):t}function wi(e){var t=Tt(),n=t.queue;if(n===null)throw Error(M(311));n.lastRenderedReducer=e;var r=Fe,o=r.baseQueue,s=n.pending;if(s!==null){if(o!==null){var l=o.next;o.next=s.next,s.next=l}r.baseQueue=o=s,n.pending=null}if(o!==null){s=o.next,r=r.baseState;var a=l=null,u=null,c=s;do{var f=c.lane;if((ur&f)===f)u!==null&&(u=u.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var h={lane:f,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};u===null?(a=u=h,l=r):u=u.next=h,Re.lanes|=f,cr|=f}c=c.next}while(c!==null&&c!==s);u===null?l=r:u.next=a,Dt(r,t.memoizedState)||(at=!0),t.memoizedState=r,t.baseState=l,t.baseQueue=u,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do s=o.lane,Re.lanes|=s,cr|=s,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Si(e){var t=Tt(),n=t.queue;if(n===null)throw Error(M(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,s=t.memoizedState;if(o!==null){n.pending=null;var l=o=o.next;do s=e(s,l.action),l=l.next;while(l!==o);Dt(s,t.memoizedState)||(at=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function Sp(){}function Cp(e,t){var n=Re,r=Tt(),o=t(),s=!Dt(r.memoizedState,o);if(s&&(r.memoizedState=o,at=!0),r=r.queue,Ou(jp.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||We!==null&&We.memoizedState.tag&1){if(n.flags|=2048,Qo(9,Ep.bind(null,n,r,o,t),void 0,null),Be===null)throw Error(M(349));ur&30||kp(n,t,o)}return o}function kp(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Re.updateQueue,t===null?(t={lastEffect:null,stores:null},Re.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ep(e,t,n,r){t.value=n,t.getSnapshot=r,Tp(t)&&Np(e)}function jp(e,t,n){return n(function(){Tp(t)&&Np(e)})}function Tp(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Dt(e,n)}catch{return!0}}function Np(e){var t=cn(e,1);t!==null&&Lt(t,e,1,-1)}function Bc(e){var t=Mt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Yo,lastRenderedState:e},t.queue=e,e=e.dispatch=cy.bind(null,Re,e),[t.memoizedState,e]}function Qo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Re.updateQueue,t===null?(t={lastEffect:null,stores:null},Re.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Rp(){return Tt().memoizedState}function $s(e,t,n,r){var o=Mt();Re.flags|=e,o.memoizedState=Qo(1|t,n,void 0,r===void 0?null:r)}function zl(e,t,n,r){var o=Tt();r=r===void 0?null:r;var s=void 0;if(Fe!==null){var l=Fe.memoizedState;if(s=l.destroy,r!==null&&Au(r,l.deps)){o.memoizedState=Qo(t,n,s,r);return}}Re.flags|=e,o.memoizedState=Qo(1|t,n,s,r)}function Vc(e,t){return $s(8390656,8,e,t)}function Ou(e,t){return zl(2048,8,e,t)}function Pp(e,t){return zl(4,2,e,t)}function Ip(e,t){return zl(4,4,e,t)}function _p(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Ap(e,t,n){return n=n!=null?n.concat([e]):null,zl(4,4,_p.bind(null,t,e),n)}function Mu(){}function Lp(e,t){var n=Tt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Au(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Dp(e,t){var n=Tt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Au(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Op(e,t,n){return ur&21?(Dt(n,t)||(n=Kf(),Re.lanes|=n,cr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,at=!0),e.memoizedState=n)}function ay(e,t){var n=he;he=n!==0&&4>n?n:4,e(!0);var r=bi.transition;bi.transition={};try{e(!1),t()}finally{he=n,bi.transition=r}}function Mp(){return Tt().memoizedState}function uy(e,t,n){var r=Mn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},$p(e))zp(t,n);else if(n=vp(e,t,n,r),n!==null){var o=tt();Lt(n,e,r,o),Fp(n,t,r)}}function cy(e,t,n){var r=Mn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if($p(e))zp(t,o);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var l=t.lastRenderedState,a=s(l,n);if(o.hasEagerState=!0,o.eagerState=a,Dt(a,l)){var u=t.interleaved;u===null?(o.next=o,Nu(t)):(o.next=u.next,u.next=o),t.interleaved=o;return}}catch{}finally{}n=vp(e,t,o,r),n!==null&&(o=tt(),Lt(n,e,r,o),Fp(n,t,r))}}function $p(e){var t=e.alternate;return e===Re||t!==null&&t===Re}function zp(e,t){Po=pl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Fp(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,hu(e,n)}}var hl={readContext:jt,useCallback:Qe,useContext:Qe,useEffect:Qe,useImperativeHandle:Qe,useInsertionEffect:Qe,useLayoutEffect:Qe,useMemo:Qe,useReducer:Qe,useRef:Qe,useState:Qe,useDebugValue:Qe,useDeferredValue:Qe,useTransition:Qe,useMutableSource:Qe,useSyncExternalStore:Qe,useId:Qe,unstable_isNewReconciler:!1},dy={readContext:jt,useCallback:function(e,t){return Mt().memoizedState=[e,t===void 0?null:t],e},useContext:jt,useEffect:Vc,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,$s(4194308,4,_p.bind(null,t,e),n)},useLayoutEffect:function(e,t){return $s(4194308,4,e,t)},useInsertionEffect:function(e,t){return $s(4,2,e,t)},useMemo:function(e,t){var n=Mt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Mt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=uy.bind(null,Re,e),[r.memoizedState,e]},useRef:function(e){var t=Mt();return e={current:e},t.memoizedState=e},useState:Bc,useDebugValue:Mu,useDeferredValue:function(e){return Mt().memoizedState=e},useTransition:function(){var e=Bc(!1),t=e[0];return e=ay.bind(null,e[1]),Mt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Re,o=Mt();if(Ee){if(n===void 0)throw Error(M(407));n=n()}else{if(n=t(),Be===null)throw Error(M(349));ur&30||kp(r,t,n)}o.memoizedState=n;var s={value:n,getSnapshot:t};return o.queue=s,Vc(jp.bind(null,r,s,e),[e]),r.flags|=2048,Qo(9,Ep.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Mt(),t=Be.identifierPrefix;if(Ee){var n=nn,r=tn;n=(r&~(1<<32-At(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Go++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=iy++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},fy={readContext:jt,useCallback:Lp,useContext:jt,useEffect:Ou,useImperativeHandle:Ap,useInsertionEffect:Pp,useLayoutEffect:Ip,useMemo:Dp,useReducer:wi,useRef:Rp,useState:function(){return wi(Yo)},useDebugValue:Mu,useDeferredValue:function(e){var t=Tt();return Op(t,Fe.memoizedState,e)},useTransition:function(){var e=wi(Yo)[0],t=Tt().memoizedState;return[e,t]},useMutableSource:Sp,useSyncExternalStore:Cp,useId:Mp,unstable_isNewReconciler:!1},py={readContext:jt,useCallback:Lp,useContext:jt,useEffect:Ou,useImperativeHandle:Ap,useInsertionEffect:Pp,useLayoutEffect:Ip,useMemo:Dp,useReducer:Si,useRef:Rp,useState:function(){return Si(Yo)},useDebugValue:Mu,useDeferredValue:function(e){var t=Tt();return Fe===null?t.memoizedState=e:Op(t,Fe.memoizedState,e)},useTransition:function(){var e=Si(Yo)[0],t=Tt().memoizedState;return[e,t]},useMutableSource:Sp,useSyncExternalStore:Cp,useId:Mp,unstable_isNewReconciler:!1};function Pt(e,t){if(e&&e.defaultProps){t=Pe({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Ea(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Pe({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Fl={isMounted:function(e){return(e=e._reactInternals)?xr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=tt(),o=Mn(e),s=on(r,o);s.payload=t,n!=null&&(s.callback=n),t=Dn(e,s,o),t!==null&&(Lt(t,e,o,r),Os(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=tt(),o=Mn(e),s=on(r,o);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=Dn(e,s,o),t!==null&&(Lt(t,e,o,r),Os(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=tt(),r=Mn(e),o=on(n,r);o.tag=2,t!=null&&(o.callback=t),t=Dn(e,o,r),t!==null&&(Lt(t,e,r,n),Os(t,e,r))}};function Uc(e,t,n,r,o,s,l){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,l):t.prototype&&t.prototype.isPureReactComponent?!Ko(n,r)||!Ko(o,s):!0}function Kp(e,t,n){var r=!1,o=Kn,s=t.contextType;return typeof s=="object"&&s!==null?s=jt(s):(o=ct(t)?ir:qe.current,r=t.contextTypes,s=(r=r!=null)?Yr(e,o):Kn),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Fl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=s),t}function Gc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Fl.enqueueReplaceState(t,t.state,null)}function ja(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},Ru(e);var s=t.contextType;typeof s=="object"&&s!==null?o.context=jt(s):(s=ct(t)?ir:qe.current,o.context=Yr(e,s)),o.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(Ea(e,t,s,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&Fl.enqueueReplaceState(o,o.state,null),dl(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function qr(e,t){try{var n="",r=t;do n+=Km(r),r=r.return;while(r);var o=n}catch(s){o=`
39
+ Error generating stack: `+s.message+`
40
+ `+s.stack}return{value:e,source:t,stack:o,digest:null}}function Ci(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Ta(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var hy=typeof WeakMap=="function"?WeakMap:Map;function Hp(e,t,n){n=on(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){gl||(gl=!0,Ma=r),Ta(e,t)},n}function Wp(e,t,n){n=on(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Ta(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Ta(e,t),typeof r!="function"&&(On===null?On=new Set([this]):On.add(this));var l=t.stack;this.componentDidCatch(t.value,{componentStack:l!==null?l:""})}),n}function Yc(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new hy;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=Ny.bind(null,e,t,n),t.then(e,e))}function Qc(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Xc(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=on(-1,1),t.tag=2,Dn(n,t,1))),n.lanes|=1),e)}var my=vn.ReactCurrentOwner,at=!1;function et(e,t,n,r){t.child=e===null?xp(t,null,n,r):Xr(t,e.child,n,r)}function Zc(e,t,n,r,o){n=n.render;var s=t.ref;return Wr(t,o),r=Lu(e,t,n,r,s,o),n=Du(),e!==null&&!at?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,dn(e,t,o)):(Ee&&n&&Su(t),t.flags|=1,et(e,t,r,o),t.child)}function qc(e,t,n,r,o){if(e===null){var s=n.type;return typeof s=="function"&&!Vu(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,Bp(e,t,s,r,o)):(e=Hs(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&o)){var l=s.memoizedProps;if(n=n.compare,n=n!==null?n:Ko,n(l,r)&&e.ref===t.ref)return dn(e,t,o)}return t.flags|=1,e=$n(s,r),e.ref=t.ref,e.return=t,t.child=e}function Bp(e,t,n,r,o){if(e!==null){var s=e.memoizedProps;if(Ko(s,r)&&e.ref===t.ref)if(at=!1,t.pendingProps=r=s,(e.lanes&o)!==0)e.flags&131072&&(at=!0);else return t.lanes=e.lanes,dn(e,t,o)}return Na(e,t,n,r,o)}function Vp(e,t,n){var r=t.pendingProps,o=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ve(Mr,ft),ft|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ve(Mr,ft),ft|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,ve(Mr,ft),ft|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,ve(Mr,ft),ft|=r;return et(e,t,o,n),t.child}function Up(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Na(e,t,n,r,o){var s=ct(n)?ir:qe.current;return s=Yr(t,s),Wr(t,o),n=Lu(e,t,n,r,s,o),r=Du(),e!==null&&!at?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,dn(e,t,o)):(Ee&&r&&Su(t),t.flags|=1,et(e,t,n,o),t.child)}function Jc(e,t,n,r,o){if(ct(n)){var s=!0;ll(t)}else s=!1;if(Wr(t,o),t.stateNode===null)zs(e,t),Kp(t,n,r),ja(t,n,r,o),r=!0;else if(e===null){var l=t.stateNode,a=t.memoizedProps;l.props=a;var u=l.context,c=n.contextType;typeof c=="object"&&c!==null?c=jt(c):(c=ct(n)?ir:qe.current,c=Yr(t,c));var f=n.getDerivedStateFromProps,h=typeof f=="function"||typeof l.getSnapshotBeforeUpdate=="function";h||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(a!==r||u!==c)&&Gc(t,l,r,c),Cn=!1;var d=t.memoizedState;l.state=d,dl(t,r,l,o),u=t.memoizedState,a!==r||d!==u||ut.current||Cn?(typeof f=="function"&&(Ea(t,n,f,r),u=t.memoizedState),(a=Cn||Uc(t,n,a,r,d,u,c))?(h||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),l.props=r,l.state=u,l.context=c,r=a):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{l=t.stateNode,bp(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:Pt(t.type,a),l.props=c,h=t.pendingProps,d=l.context,u=n.contextType,typeof u=="object"&&u!==null?u=jt(u):(u=ct(n)?ir:qe.current,u=Yr(t,u));var m=n.getDerivedStateFromProps;(f=typeof m=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(a!==h||d!==u)&&Gc(t,l,r,u),Cn=!1,d=t.memoizedState,l.state=d,dl(t,r,l,o);var v=t.memoizedState;a!==h||d!==v||ut.current||Cn?(typeof m=="function"&&(Ea(t,n,m,r),v=t.memoizedState),(c=Cn||Uc(t,n,c,r,d,v,u)||!1)?(f||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(r,v,u),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(r,v,u)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=v),l.props=r,l.state=v,l.context=u,r=c):(typeof l.componentDidUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return Ra(e,t,n,r,s,o)}function Ra(e,t,n,r,o,s){Up(e,t);var l=(t.flags&128)!==0;if(!r&&!l)return o&&$c(t,n,!1),dn(e,t,s);r=t.stateNode,my.current=t;var a=l&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&l?(t.child=Xr(t,e.child,null,s),t.child=Xr(t,null,a,s)):et(e,t,a,s),t.memoizedState=r.state,o&&$c(t,n,!0),t.child}function Gp(e){var t=e.stateNode;t.pendingContext?Mc(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Mc(e,t.context,!1),Pu(e,t.containerInfo)}function ed(e,t,n,r,o){return Qr(),ku(o),t.flags|=256,et(e,t,n,r),t.child}var Pa={dehydrated:null,treeContext:null,retryLane:0};function Ia(e){return{baseLanes:e,cachePool:null,transitions:null}}function Yp(e,t,n){var r=t.pendingProps,o=Ne.current,s=!1,l=(t.flags&128)!==0,a;if((a=l)||(a=e!==null&&e.memoizedState===null?!1:(o&2)!==0),a?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),ve(Ne,o&1),e===null)return Ca(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(l=r.children,e=r.fallback,s?(r=t.mode,s=t.child,l={mode:"hidden",children:l},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=l):s=Wl(l,r,0,null),e=sr(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Ia(n),t.memoizedState=Pa,e):$u(t,l));if(o=e.memoizedState,o!==null&&(a=o.dehydrated,a!==null))return gy(e,t,l,r,a,o,n);if(s){s=r.fallback,l=t.mode,o=e.child,a=o.sibling;var u={mode:"hidden",children:r.children};return!(l&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=$n(o,u),r.subtreeFlags=o.subtreeFlags&14680064),a!==null?s=$n(a,s):(s=sr(s,l,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,l=e.child.memoizedState,l=l===null?Ia(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},s.memoizedState=l,s.childLanes=e.childLanes&~n,t.memoizedState=Pa,r}return s=e.child,e=s.sibling,r=$n(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function $u(e,t){return t=Wl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ws(e,t,n,r){return r!==null&&ku(r),Xr(t,e.child,null,n),e=$u(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function gy(e,t,n,r,o,s,l){if(n)return t.flags&256?(t.flags&=-257,r=Ci(Error(M(422))),ws(e,t,l,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,o=t.mode,r=Wl({mode:"visible",children:r.children},o,0,null),s=sr(s,o,l,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&Xr(t,e.child,null,l),t.child.memoizedState=Ia(l),t.memoizedState=Pa,s);if(!(t.mode&1))return ws(e,t,l,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(M(419)),r=Ci(s,r,void 0),ws(e,t,l,r)}if(a=(l&e.childLanes)!==0,at||a){if(r=Be,r!==null){switch(l&-l){case 4:o=2;break;case 16:o=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|l)?0:o,o!==0&&o!==s.retryLane&&(s.retryLane=o,cn(e,o),Lt(r,e,o,-1))}return Bu(),r=Ci(Error(M(421))),ws(e,t,l,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=Ry.bind(null,e),o._reactRetry=t,null):(e=s.treeContext,ht=Ln(o.nextSibling),mt=t,Ee=!0,_t=null,e!==null&&(wt[St++]=tn,wt[St++]=nn,wt[St++]=ar,tn=e.id,nn=e.overflow,ar=t),t=$u(t,r.children),t.flags|=4096,t)}function td(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ka(e.return,t,n)}function ki(e,t,n,r,o){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=o)}function Qp(e,t,n){var r=t.pendingProps,o=r.revealOrder,s=r.tail;if(et(e,t,r.children,n),r=Ne.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&td(e,n,t);else if(e.tag===19)td(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}r&=1}if(ve(Ne,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&fl(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),ki(t,!1,o,n,s);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&fl(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}ki(t,!0,n,null,s);break;case"together":ki(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function zs(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function dn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),cr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(M(153));if(t.child!==null){for(e=t.child,n=$n(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=$n(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function yy(e,t,n){switch(t.tag){case 3:Gp(t),Qr();break;case 5:wp(t);break;case 1:ct(t.type)&&ll(t);break;case 4:Pu(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;ve(ul,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ve(Ne,Ne.current&1),t.flags|=128,null):n&t.child.childLanes?Yp(e,t,n):(ve(Ne,Ne.current&1),e=dn(e,t,n),e!==null?e.sibling:null);ve(Ne,Ne.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Qp(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ve(Ne,Ne.current),r)break;return null;case 22:case 23:return t.lanes=0,Vp(e,t,n)}return dn(e,t,n)}var Xp,_a,Zp,qp;Xp=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};_a=function(){};Zp=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,nr(Ft.current);var s=null;switch(n){case"input":o=ea(e,o),r=ea(e,r),s=[];break;case"select":o=Pe({},o,{value:void 0}),r=Pe({},r,{value:void 0}),s=[];break;case"textarea":o=ra(e,o),r=ra(e,r),s=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=ol)}sa(n,r);var l;n=null;for(c in o)if(!r.hasOwnProperty(c)&&o.hasOwnProperty(c)&&o[c]!=null)if(c==="style"){var a=o[c];for(l in a)a.hasOwnProperty(l)&&(n||(n={}),n[l]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Lo.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in r){var u=r[c];if(a=o!=null?o[c]:void 0,r.hasOwnProperty(c)&&u!==a&&(u!=null||a!=null))if(c==="style")if(a){for(l in a)!a.hasOwnProperty(l)||u&&u.hasOwnProperty(l)||(n||(n={}),n[l]="");for(l in u)u.hasOwnProperty(l)&&a[l]!==u[l]&&(n||(n={}),n[l]=u[l])}else n||(s||(s=[]),s.push(c,n)),n=u;else c==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,a=a?a.__html:void 0,u!=null&&a!==u&&(s=s||[]).push(c,u)):c==="children"?typeof u!="string"&&typeof u!="number"||(s=s||[]).push(c,""+u):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Lo.hasOwnProperty(c)?(u!=null&&c==="onScroll"&&we("scroll",e),s||a===u||(s=[])):(s=s||[]).push(c,u))}n&&(s=s||[]).push("style",n);var c=s;(t.updateQueue=c)&&(t.flags|=4)}};qp=function(e,t,n,r){n!==r&&(t.flags|=4)};function go(e,t){if(!Ee)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Xe(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function xy(e,t,n){var r=t.pendingProps;switch(Cu(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xe(t),null;case 1:return ct(t.type)&&sl(),Xe(t),null;case 3:return r=t.stateNode,Zr(),Se(ut),Se(qe),_u(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(vs(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,_t!==null&&(Fa(_t),_t=null))),_a(e,t),Xe(t),null;case 5:Iu(t);var o=nr(Uo.current);if(n=t.type,e!==null&&t.stateNode!=null)Zp(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(M(166));return Xe(t),null}if(e=nr(Ft.current),vs(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[$t]=t,r[Bo]=s,e=(t.mode&1)!==0,n){case"dialog":we("cancel",r),we("close",r);break;case"iframe":case"object":case"embed":we("load",r);break;case"video":case"audio":for(o=0;o<Co.length;o++)we(Co[o],r);break;case"source":we("error",r);break;case"img":case"image":case"link":we("error",r),we("load",r);break;case"details":we("toggle",r);break;case"input":cc(r,s),we("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},we("invalid",r);break;case"textarea":fc(r,s),we("invalid",r)}sa(n,s),o=null;for(var l in s)if(s.hasOwnProperty(l)){var a=s[l];l==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&xs(r.textContent,a,e),o=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&xs(r.textContent,a,e),o=["children",""+a]):Lo.hasOwnProperty(l)&&a!=null&&l==="onScroll"&&we("scroll",r)}switch(n){case"input":cs(r),dc(r,s,!0);break;case"textarea":cs(r),pc(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=ol)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{l=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=jf(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=l.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),n==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[$t]=t,e[Bo]=r,Xp(e,t,!1,!1),t.stateNode=e;e:{switch(l=la(n,r),n){case"dialog":we("cancel",e),we("close",e),o=r;break;case"iframe":case"object":case"embed":we("load",e),o=r;break;case"video":case"audio":for(o=0;o<Co.length;o++)we(Co[o],e);o=r;break;case"source":we("error",e),o=r;break;case"img":case"image":case"link":we("error",e),we("load",e),o=r;break;case"details":we("toggle",e),o=r;break;case"input":cc(e,r),o=ea(e,r),we("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Pe({},r,{value:void 0}),we("invalid",e);break;case"textarea":fc(e,r),o=ra(e,r),we("invalid",e);break;default:o=r}sa(n,o),a=o;for(s in a)if(a.hasOwnProperty(s)){var u=a[s];s==="style"?Rf(e,u):s==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&Tf(e,u)):s==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&Do(e,u):typeof u=="number"&&Do(e,""+u):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Lo.hasOwnProperty(s)?u!=null&&s==="onScroll"&&we("scroll",e):u!=null&&au(e,s,u,l))}switch(n){case"input":cs(e),dc(e,r,!1);break;case"textarea":cs(e),pc(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Fn(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?zr(e,!!r.multiple,s,!1):r.defaultValue!=null&&zr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=ol)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Xe(t),null;case 6:if(e&&t.stateNode!=null)qp(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(M(166));if(n=nr(Uo.current),nr(Ft.current),vs(t)){if(r=t.stateNode,n=t.memoizedProps,r[$t]=t,(s=r.nodeValue!==n)&&(e=mt,e!==null))switch(e.tag){case 3:xs(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&xs(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[$t]=t,t.stateNode=r}return Xe(t),null;case 13:if(Se(Ne),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ee&&ht!==null&&t.mode&1&&!(t.flags&128))gp(),Qr(),t.flags|=98560,s=!1;else if(s=vs(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(M(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(M(317));s[$t]=t}else Qr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Xe(t),s=!1}else _t!==null&&(Fa(_t),_t=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Ne.current&1?Ke===0&&(Ke=3):Bu())),t.updateQueue!==null&&(t.flags|=4),Xe(t),null);case 4:return Zr(),_a(e,t),e===null&&Ho(t.stateNode.containerInfo),Xe(t),null;case 10:return Tu(t.type._context),Xe(t),null;case 17:return ct(t.type)&&sl(),Xe(t),null;case 19:if(Se(Ne),s=t.memoizedState,s===null)return Xe(t),null;if(r=(t.flags&128)!==0,l=s.rendering,l===null)if(r)go(s,!1);else{if(Ke!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(l=fl(e),l!==null){for(t.flags|=128,go(s,!1),r=l.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,l=s.alternate,l===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=l.childLanes,s.lanes=l.lanes,s.child=l.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=l.memoizedProps,s.memoizedState=l.memoizedState,s.updateQueue=l.updateQueue,s.type=l.type,e=l.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ve(Ne,Ne.current&1|2),t.child}e=e.sibling}s.tail!==null&&Le()>Jr&&(t.flags|=128,r=!0,go(s,!1),t.lanes=4194304)}else{if(!r)if(e=fl(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),go(s,!0),s.tail===null&&s.tailMode==="hidden"&&!l.alternate&&!Ee)return Xe(t),null}else 2*Le()-s.renderingStartTime>Jr&&n!==1073741824&&(t.flags|=128,r=!0,go(s,!1),t.lanes=4194304);s.isBackwards?(l.sibling=t.child,t.child=l):(n=s.last,n!==null?n.sibling=l:t.child=l,s.last=l)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Le(),t.sibling=null,n=Ne.current,ve(Ne,r?n&1|2:n&1),t):(Xe(t),null);case 22:case 23:return Wu(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ft&1073741824&&(Xe(t),t.subtreeFlags&6&&(t.flags|=8192)):Xe(t),null;case 24:return null;case 25:return null}throw Error(M(156,t.tag))}function vy(e,t){switch(Cu(t),t.tag){case 1:return ct(t.type)&&sl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Zr(),Se(ut),Se(qe),_u(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Iu(t),null;case 13:if(Se(Ne),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(M(340));Qr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Se(Ne),null;case 4:return Zr(),null;case 10:return Tu(t.type._context),null;case 22:case 23:return Wu(),null;case 24:return null;default:return null}}var Ss=!1,Ze=!1,by=typeof WeakSet=="function"?WeakSet:Set,W=null;function Or(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ie(e,t,r)}else n.current=null}function Aa(e,t,n){try{n()}catch(r){Ie(e,t,r)}}var nd=!1;function wy(e,t){if(ga=tl,e=rp(),wu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var l=0,a=-1,u=-1,c=0,f=0,h=e,d=null;t:for(;;){for(var m;h!==n||o!==0&&h.nodeType!==3||(a=l+o),h!==s||r!==0&&h.nodeType!==3||(u=l+r),h.nodeType===3&&(l+=h.nodeValue.length),(m=h.firstChild)!==null;)d=h,h=m;for(;;){if(h===e)break t;if(d===n&&++c===o&&(a=l),d===s&&++f===r&&(u=l),(m=h.nextSibling)!==null)break;h=d,d=h.parentNode}h=m}n=a===-1||u===-1?null:{start:a,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(ya={focusedElem:e,selectionRange:n},tl=!1,W=t;W!==null;)if(t=W,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,W=e;else for(;W!==null;){t=W;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var w=v.memoizedProps,S=v.memoizedState,p=t.stateNode,g=p.getSnapshotBeforeUpdate(t.elementType===t.type?w:Pt(t.type,w),S);p.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(M(163))}}catch(x){Ie(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,W=e;break}W=t.return}return v=nd,nd=!1,v}function Io(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var s=o.destroy;o.destroy=void 0,s!==void 0&&Aa(t,n,s)}o=o.next}while(o!==r)}}function Kl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function La(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Jp(e){var t=e.alternate;t!==null&&(e.alternate=null,Jp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[$t],delete t[Bo],delete t[ba],delete t[ry],delete t[oy])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function eh(e){return e.tag===5||e.tag===3||e.tag===4}function rd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||eh(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.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 Da(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ol));else if(r!==4&&(e=e.child,e!==null))for(Da(e,t,n),e=e.sibling;e!==null;)Da(e,t,n),e=e.sibling}function Oa(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Oa(e,t,n),e=e.sibling;e!==null;)Oa(e,t,n),e=e.sibling}var Ue=null,It=!1;function wn(e,t,n){for(n=n.child;n!==null;)th(e,t,n),n=n.sibling}function th(e,t,n){if(zt&&typeof zt.onCommitFiberUnmount=="function")try{zt.onCommitFiberUnmount(Al,n)}catch{}switch(n.tag){case 5:Ze||Or(n,t);case 6:var r=Ue,o=It;Ue=null,wn(e,t,n),Ue=r,It=o,Ue!==null&&(It?(e=Ue,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ue.removeChild(n.stateNode));break;case 18:Ue!==null&&(It?(e=Ue,n=n.stateNode,e.nodeType===8?yi(e.parentNode,n):e.nodeType===1&&yi(e,n),zo(e)):yi(Ue,n.stateNode));break;case 4:r=Ue,o=It,Ue=n.stateNode.containerInfo,It=!0,wn(e,t,n),Ue=r,It=o;break;case 0:case 11:case 14:case 15:if(!Ze&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var s=o,l=s.destroy;s=s.tag,l!==void 0&&(s&2||s&4)&&Aa(n,t,l),o=o.next}while(o!==r)}wn(e,t,n);break;case 1:if(!Ze&&(Or(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Ie(n,t,a)}wn(e,t,n);break;case 21:wn(e,t,n);break;case 22:n.mode&1?(Ze=(r=Ze)||n.memoizedState!==null,wn(e,t,n),Ze=r):wn(e,t,n);break;default:wn(e,t,n)}}function od(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new by),t.forEach(function(r){var o=Py.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Rt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var s=e,l=t,a=l;e:for(;a!==null;){switch(a.tag){case 5:Ue=a.stateNode,It=!1;break e;case 3:Ue=a.stateNode.containerInfo,It=!0;break e;case 4:Ue=a.stateNode.containerInfo,It=!0;break e}a=a.return}if(Ue===null)throw Error(M(160));th(s,l,o),Ue=null,It=!1;var u=o.alternate;u!==null&&(u.return=null),o.return=null}catch(c){Ie(o,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)nh(t,e),t=t.sibling}function nh(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Rt(t,e),Ot(e),r&4){try{Io(3,e,e.return),Kl(3,e)}catch(w){Ie(e,e.return,w)}try{Io(5,e,e.return)}catch(w){Ie(e,e.return,w)}}break;case 1:Rt(t,e),Ot(e),r&512&&n!==null&&Or(n,n.return);break;case 5:if(Rt(t,e),Ot(e),r&512&&n!==null&&Or(n,n.return),e.flags&32){var o=e.stateNode;try{Do(o,"")}catch(w){Ie(e,e.return,w)}}if(r&4&&(o=e.stateNode,o!=null)){var s=e.memoizedProps,l=n!==null?n.memoizedProps:s,a=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&kf(o,s),la(a,l);var c=la(a,s);for(l=0;l<u.length;l+=2){var f=u[l],h=u[l+1];f==="style"?Rf(o,h):f==="dangerouslySetInnerHTML"?Tf(o,h):f==="children"?Do(o,h):au(o,f,h,c)}switch(a){case"input":ta(o,s);break;case"textarea":Ef(o,s);break;case"select":var d=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!s.multiple;var m=s.value;m!=null?zr(o,!!s.multiple,m,!1):d!==!!s.multiple&&(s.defaultValue!=null?zr(o,!!s.multiple,s.defaultValue,!0):zr(o,!!s.multiple,s.multiple?[]:"",!1))}o[Bo]=s}catch(w){Ie(e,e.return,w)}}break;case 6:if(Rt(t,e),Ot(e),r&4){if(e.stateNode===null)throw Error(M(162));o=e.stateNode,s=e.memoizedProps;try{o.nodeValue=s}catch(w){Ie(e,e.return,w)}}break;case 3:if(Rt(t,e),Ot(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{zo(t.containerInfo)}catch(w){Ie(e,e.return,w)}break;case 4:Rt(t,e),Ot(e);break;case 13:Rt(t,e),Ot(e),o=e.child,o.flags&8192&&(s=o.memoizedState!==null,o.stateNode.isHidden=s,!s||o.alternate!==null&&o.alternate.memoizedState!==null||(Ku=Le())),r&4&&od(e);break;case 22:if(f=n!==null&&n.memoizedState!==null,e.mode&1?(Ze=(c=Ze)||f,Rt(t,e),Ze=c):Rt(t,e),Ot(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!f&&e.mode&1)for(W=e,f=e.child;f!==null;){for(h=W=f;W!==null;){switch(d=W,m=d.child,d.tag){case 0:case 11:case 14:case 15:Io(4,d,d.return);break;case 1:Or(d,d.return);var v=d.stateNode;if(typeof v.componentWillUnmount=="function"){r=d,n=d.return;try{t=r,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(w){Ie(r,n,w)}}break;case 5:Or(d,d.return);break;case 22:if(d.memoizedState!==null){ld(h);continue}}m!==null?(m.return=d,W=m):ld(h)}f=f.sibling}e:for(f=null,h=e;;){if(h.tag===5){if(f===null){f=h;try{o=h.stateNode,c?(s=o.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=h.stateNode,u=h.memoizedProps.style,l=u!=null&&u.hasOwnProperty("display")?u.display:null,a.style.display=Nf("display",l))}catch(w){Ie(e,e.return,w)}}}else if(h.tag===6){if(f===null)try{h.stateNode.nodeValue=c?"":h.memoizedProps}catch(w){Ie(e,e.return,w)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===e)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;h.sibling===null;){if(h.return===null||h.return===e)break e;f===h&&(f=null),h=h.return}f===h&&(f=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:Rt(t,e),Ot(e),r&4&&od(e);break;case 21:break;default:Rt(t,e),Ot(e)}}function Ot(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(eh(n)){var r=n;break e}n=n.return}throw Error(M(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Do(o,""),r.flags&=-33);var s=rd(e);Oa(e,s,o);break;case 3:case 4:var l=r.stateNode.containerInfo,a=rd(e);Da(e,a,l);break;default:throw Error(M(161))}}catch(u){Ie(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Sy(e,t,n){W=e,rh(e)}function rh(e,t,n){for(var r=(e.mode&1)!==0;W!==null;){var o=W,s=o.child;if(o.tag===22&&r){var l=o.memoizedState!==null||Ss;if(!l){var a=o.alternate,u=a!==null&&a.memoizedState!==null||Ze;a=Ss;var c=Ze;if(Ss=l,(Ze=u)&&!c)for(W=o;W!==null;)l=W,u=l.child,l.tag===22&&l.memoizedState!==null?id(o):u!==null?(u.return=l,W=u):id(o);for(;s!==null;)W=s,rh(s),s=s.sibling;W=o,Ss=a,Ze=c}sd(e)}else o.subtreeFlags&8772&&s!==null?(s.return=o,W=s):sd(e)}}function sd(e){for(;W!==null;){var t=W;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ze||Kl(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Ze)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:Pt(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&Wc(t,s,r);break;case 3:var l=t.updateQueue;if(l!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Wc(t,l,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var f=c.memoizedState;if(f!==null){var h=f.dehydrated;h!==null&&zo(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(M(163))}Ze||t.flags&512&&La(t)}catch(d){Ie(t,t.return,d)}}if(t===e){W=null;break}if(n=t.sibling,n!==null){n.return=t.return,W=n;break}W=t.return}}function ld(e){for(;W!==null;){var t=W;if(t===e){W=null;break}var n=t.sibling;if(n!==null){n.return=t.return,W=n;break}W=t.return}}function id(e){for(;W!==null;){var t=W;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Kl(4,t)}catch(u){Ie(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(u){Ie(t,o,u)}}var s=t.return;try{La(t)}catch(u){Ie(t,s,u)}break;case 5:var l=t.return;try{La(t)}catch(u){Ie(t,l,u)}}}catch(u){Ie(t,t.return,u)}if(t===e){W=null;break}var a=t.sibling;if(a!==null){a.return=t.return,W=a;break}W=t.return}}var Cy=Math.ceil,ml=vn.ReactCurrentDispatcher,zu=vn.ReactCurrentOwner,kt=vn.ReactCurrentBatchConfig,de=0,Be=null,$e=null,Ge=0,ft=0,Mr=Vn(0),Ke=0,Xo=null,cr=0,Hl=0,Fu=0,_o=null,it=null,Ku=0,Jr=1/0,Qt=null,gl=!1,Ma=null,On=null,Cs=!1,Pn=null,yl=0,Ao=0,$a=null,Fs=-1,Ks=0;function tt(){return de&6?Le():Fs!==-1?Fs:Fs=Le()}function Mn(e){return e.mode&1?de&2&&Ge!==0?Ge&-Ge:ly.transition!==null?(Ks===0&&(Ks=Kf()),Ks):(e=he,e!==0||(e=window.event,e=e===void 0?16:Yf(e.type)),e):1}function Lt(e,t,n,r){if(50<Ao)throw Ao=0,$a=null,Error(M(185));es(e,n,r),(!(de&2)||e!==Be)&&(e===Be&&(!(de&2)&&(Hl|=n),Ke===4&&Tn(e,Ge)),dt(e,r),n===1&&de===0&&!(t.mode&1)&&(Jr=Le()+500,$l&&Un()))}function dt(e,t){var n=e.callbackNode;lg(e,t);var r=el(e,e===Be?Ge:0);if(r===0)n!==null&&gc(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&gc(n),t===1)e.tag===0?sy(ad.bind(null,e)):pp(ad.bind(null,e)),ty(function(){!(de&6)&&Un()}),n=null;else{switch(Hf(r)){case 1:n=pu;break;case 4:n=zf;break;case 16:n=Js;break;case 536870912:n=Ff;break;default:n=Js}n=dh(n,oh.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function oh(e,t){if(Fs=-1,Ks=0,de&6)throw Error(M(327));var n=e.callbackNode;if(Br()&&e.callbackNode!==n)return null;var r=el(e,e===Be?Ge:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=xl(e,r);else{t=r;var o=de;de|=2;var s=lh();(Be!==e||Ge!==t)&&(Qt=null,Jr=Le()+500,or(e,t));do try{jy();break}catch(a){sh(e,a)}while(!0);ju(),ml.current=s,de=o,$e!==null?t=0:(Be=null,Ge=0,t=Ke)}if(t!==0){if(t===2&&(o=da(e),o!==0&&(r=o,t=za(e,o))),t===1)throw n=Xo,or(e,0),Tn(e,r),dt(e,Le()),n;if(t===6)Tn(e,r);else{if(o=e.current.alternate,!(r&30)&&!ky(o)&&(t=xl(e,r),t===2&&(s=da(e),s!==0&&(r=s,t=za(e,s))),t===1))throw n=Xo,or(e,0),Tn(e,r),dt(e,Le()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(M(345));case 2:Jn(e,it,Qt);break;case 3:if(Tn(e,r),(r&130023424)===r&&(t=Ku+500-Le(),10<t)){if(el(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){tt(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=va(Jn.bind(null,e,it,Qt),t);break}Jn(e,it,Qt);break;case 4:if(Tn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var l=31-At(r);s=1<<l,l=t[l],l>o&&(o=l),r&=~s}if(r=o,r=Le()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Cy(r/1960))-r,10<r){e.timeoutHandle=va(Jn.bind(null,e,it,Qt),r);break}Jn(e,it,Qt);break;case 5:Jn(e,it,Qt);break;default:throw Error(M(329))}}}return dt(e,Le()),e.callbackNode===n?oh.bind(null,e):null}function za(e,t){var n=_o;return e.current.memoizedState.isDehydrated&&(or(e,t).flags|=256),e=xl(e,t),e!==2&&(t=it,it=n,t!==null&&Fa(t)),e}function Fa(e){it===null?it=e:it.push.apply(it,e)}function ky(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],s=o.getSnapshot;o=o.value;try{if(!Dt(s(),o))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 Tn(e,t){for(t&=~Fu,t&=~Hl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-At(t),r=1<<n;e[n]=-1,t&=~r}}function ad(e){if(de&6)throw Error(M(327));Br();var t=el(e,0);if(!(t&1))return dt(e,Le()),null;var n=xl(e,t);if(e.tag!==0&&n===2){var r=da(e);r!==0&&(t=r,n=za(e,r))}if(n===1)throw n=Xo,or(e,0),Tn(e,t),dt(e,Le()),n;if(n===6)throw Error(M(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Jn(e,it,Qt),dt(e,Le()),null}function Hu(e,t){var n=de;de|=1;try{return e(t)}finally{de=n,de===0&&(Jr=Le()+500,$l&&Un())}}function dr(e){Pn!==null&&Pn.tag===0&&!(de&6)&&Br();var t=de;de|=1;var n=kt.transition,r=he;try{if(kt.transition=null,he=1,e)return e()}finally{he=r,kt.transition=n,de=t,!(de&6)&&Un()}}function Wu(){ft=Mr.current,Se(Mr)}function or(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,ey(n)),$e!==null)for(n=$e.return;n!==null;){var r=n;switch(Cu(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&sl();break;case 3:Zr(),Se(ut),Se(qe),_u();break;case 5:Iu(r);break;case 4:Zr();break;case 13:Se(Ne);break;case 19:Se(Ne);break;case 10:Tu(r.type._context);break;case 22:case 23:Wu()}n=n.return}if(Be=e,$e=e=$n(e.current,null),Ge=ft=t,Ke=0,Xo=null,Fu=Hl=cr=0,it=_o=null,tr!==null){for(t=0;t<tr.length;t++)if(n=tr[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,s=n.pending;if(s!==null){var l=s.next;s.next=o,r.next=l}n.pending=r}tr=null}return e}function sh(e,t){do{var n=$e;try{if(ju(),Ms.current=hl,pl){for(var r=Re.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}pl=!1}if(ur=0,We=Fe=Re=null,Po=!1,Go=0,zu.current=null,n===null||n.return===null){Ke=1,Xo=t,$e=null;break}e:{var s=e,l=n.return,a=n,u=t;if(t=Ge,a.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var c=u,f=a,h=f.tag;if(!(f.mode&1)&&(h===0||h===11||h===15)){var d=f.alternate;d?(f.updateQueue=d.updateQueue,f.memoizedState=d.memoizedState,f.lanes=d.lanes):(f.updateQueue=null,f.memoizedState=null)}var m=Qc(l);if(m!==null){m.flags&=-257,Xc(m,l,a,s,t),m.mode&1&&Yc(s,c,t),t=m,u=c;var v=t.updateQueue;if(v===null){var w=new Set;w.add(u),t.updateQueue=w}else v.add(u);break e}else{if(!(t&1)){Yc(s,c,t),Bu();break e}u=Error(M(426))}}else if(Ee&&a.mode&1){var S=Qc(l);if(S!==null){!(S.flags&65536)&&(S.flags|=256),Xc(S,l,a,s,t),ku(qr(u,a));break e}}s=u=qr(u,a),Ke!==4&&(Ke=2),_o===null?_o=[s]:_o.push(s),s=l;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var p=Hp(s,u,t);Hc(s,p);break e;case 1:a=u;var g=s.type,y=s.stateNode;if(!(s.flags&128)&&(typeof g.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(On===null||!On.has(y)))){s.flags|=65536,t&=-t,s.lanes|=t;var x=Wp(s,a,t);Hc(s,x);break e}}s=s.return}while(s!==null)}ah(n)}catch(k){t=k,$e===n&&n!==null&&($e=n=n.return);continue}break}while(!0)}function lh(){var e=ml.current;return ml.current=hl,e===null?hl:e}function Bu(){(Ke===0||Ke===3||Ke===2)&&(Ke=4),Be===null||!(cr&268435455)&&!(Hl&268435455)||Tn(Be,Ge)}function xl(e,t){var n=de;de|=2;var r=lh();(Be!==e||Ge!==t)&&(Qt=null,or(e,t));do try{Ey();break}catch(o){sh(e,o)}while(!0);if(ju(),de=n,ml.current=r,$e!==null)throw Error(M(261));return Be=null,Ge=0,Ke}function Ey(){for(;$e!==null;)ih($e)}function jy(){for(;$e!==null&&!Zm();)ih($e)}function ih(e){var t=ch(e.alternate,e,ft);e.memoizedProps=e.pendingProps,t===null?ah(e):$e=t,zu.current=null}function ah(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=vy(n,t),n!==null){n.flags&=32767,$e=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ke=6,$e=null;return}}else if(n=xy(n,t,ft),n!==null){$e=n;return}if(t=t.sibling,t!==null){$e=t;return}$e=t=e}while(t!==null);Ke===0&&(Ke=5)}function Jn(e,t,n){var r=he,o=kt.transition;try{kt.transition=null,he=1,Ty(e,t,n,r)}finally{kt.transition=o,he=r}return null}function Ty(e,t,n,r){do Br();while(Pn!==null);if(de&6)throw Error(M(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(M(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(ig(e,s),e===Be&&($e=Be=null,Ge=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Cs||(Cs=!0,dh(Js,function(){return Br(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=kt.transition,kt.transition=null;var l=he;he=1;var a=de;de|=4,zu.current=null,wy(e,n),nh(n,e),Gg(ya),tl=!!ga,ya=ga=null,e.current=n,Sy(n),qm(),de=a,he=l,kt.transition=s}else e.current=n;if(Cs&&(Cs=!1,Pn=e,yl=o),s=e.pendingLanes,s===0&&(On=null),tg(n.stateNode),dt(e,Le()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(gl)throw gl=!1,e=Ma,Ma=null,e;return yl&1&&e.tag!==0&&Br(),s=e.pendingLanes,s&1?e===$a?Ao++:(Ao=0,$a=e):Ao=0,Un(),null}function Br(){if(Pn!==null){var e=Hf(yl),t=kt.transition,n=he;try{if(kt.transition=null,he=16>e?16:e,Pn===null)var r=!1;else{if(e=Pn,Pn=null,yl=0,de&6)throw Error(M(331));var o=de;for(de|=4,W=e.current;W!==null;){var s=W,l=s.child;if(W.flags&16){var a=s.deletions;if(a!==null){for(var u=0;u<a.length;u++){var c=a[u];for(W=c;W!==null;){var f=W;switch(f.tag){case 0:case 11:case 15:Io(8,f,s)}var h=f.child;if(h!==null)h.return=f,W=h;else for(;W!==null;){f=W;var d=f.sibling,m=f.return;if(Jp(f),f===c){W=null;break}if(d!==null){d.return=m,W=d;break}W=m}}}var v=s.alternate;if(v!==null){var w=v.child;if(w!==null){v.child=null;do{var S=w.sibling;w.sibling=null,w=S}while(w!==null)}}W=s}}if(s.subtreeFlags&2064&&l!==null)l.return=s,W=l;else e:for(;W!==null;){if(s=W,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Io(9,s,s.return)}var p=s.sibling;if(p!==null){p.return=s.return,W=p;break e}W=s.return}}var g=e.current;for(W=g;W!==null;){l=W;var y=l.child;if(l.subtreeFlags&2064&&y!==null)y.return=l,W=y;else e:for(l=g;W!==null;){if(a=W,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Kl(9,a)}}catch(k){Ie(a,a.return,k)}if(a===l){W=null;break e}var x=a.sibling;if(x!==null){x.return=a.return,W=x;break e}W=a.return}}if(de=o,Un(),zt&&typeof zt.onPostCommitFiberRoot=="function")try{zt.onPostCommitFiberRoot(Al,e)}catch{}r=!0}return r}finally{he=n,kt.transition=t}}return!1}function ud(e,t,n){t=qr(n,t),t=Hp(e,t,1),e=Dn(e,t,1),t=tt(),e!==null&&(es(e,1,t),dt(e,t))}function Ie(e,t,n){if(e.tag===3)ud(e,e,n);else for(;t!==null;){if(t.tag===3){ud(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(On===null||!On.has(r))){e=qr(n,e),e=Wp(t,e,1),t=Dn(t,e,1),e=tt(),t!==null&&(es(t,1,e),dt(t,e));break}}t=t.return}}function Ny(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=tt(),e.pingedLanes|=e.suspendedLanes&n,Be===e&&(Ge&n)===n&&(Ke===4||Ke===3&&(Ge&130023424)===Ge&&500>Le()-Ku?or(e,0):Fu|=n),dt(e,t)}function uh(e,t){t===0&&(e.mode&1?(t=ps,ps<<=1,!(ps&130023424)&&(ps=4194304)):t=1);var n=tt();e=cn(e,t),e!==null&&(es(e,t,n),dt(e,n))}function Ry(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),uh(e,n)}function Py(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(M(314))}r!==null&&r.delete(t),uh(e,n)}var ch;ch=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ut.current)at=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return at=!1,yy(e,t,n);at=!!(e.flags&131072)}else at=!1,Ee&&t.flags&1048576&&hp(t,al,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;zs(e,t),e=t.pendingProps;var o=Yr(t,qe.current);Wr(t,n),o=Lu(null,t,r,e,o,n);var s=Du();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ct(r)?(s=!0,ll(t)):s=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Ru(t),o.updater=Fl,t.stateNode=o,o._reactInternals=t,ja(t,r,e,n),t=Ra(null,t,r,!0,s,n)):(t.tag=0,Ee&&s&&Su(t),et(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(zs(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=_y(r),e=Pt(r,e),o){case 0:t=Na(null,t,r,e,n);break e;case 1:t=Jc(null,t,r,e,n);break e;case 11:t=Zc(null,t,r,e,n);break e;case 14:t=qc(null,t,r,Pt(r.type,e),n);break e}throw Error(M(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Pt(r,o),Na(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Pt(r,o),Jc(e,t,r,o,n);case 3:e:{if(Gp(t),e===null)throw Error(M(387));r=t.pendingProps,s=t.memoizedState,o=s.element,bp(e,t),dl(t,r,null,n);var l=t.memoizedState;if(r=l.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){o=qr(Error(M(423)),t),t=ed(e,t,r,n,o);break e}else if(r!==o){o=qr(Error(M(424)),t),t=ed(e,t,r,n,o);break e}else for(ht=Ln(t.stateNode.containerInfo.firstChild),mt=t,Ee=!0,_t=null,n=xp(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Qr(),r===o){t=dn(e,t,n);break e}et(e,t,r,n)}t=t.child}return t;case 5:return wp(t),e===null&&Ca(t),r=t.type,o=t.pendingProps,s=e!==null?e.memoizedProps:null,l=o.children,xa(r,o)?l=null:s!==null&&xa(r,s)&&(t.flags|=32),Up(e,t),et(e,t,l,n),t.child;case 6:return e===null&&Ca(t),null;case 13:return Yp(e,t,n);case 4:return Pu(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Xr(t,null,r,n):et(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Pt(r,o),Zc(e,t,r,o,n);case 7:return et(e,t,t.pendingProps,n),t.child;case 8:return et(e,t,t.pendingProps.children,n),t.child;case 12:return et(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,s=t.memoizedProps,l=o.value,ve(ul,r._currentValue),r._currentValue=l,s!==null)if(Dt(s.value,l)){if(s.children===o.children&&!ut.current){t=dn(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){l=s.child;for(var u=a.firstContext;u!==null;){if(u.context===r){if(s.tag===1){u=on(-1,n&-n),u.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var f=c.pending;f===null?u.next=u:(u.next=f.next,f.next=u),c.pending=u}}s.lanes|=n,u=s.alternate,u!==null&&(u.lanes|=n),ka(s.return,n,t),a.lanes|=n;break}u=u.next}}else if(s.tag===10)l=s.type===t.type?null:s.child;else if(s.tag===18){if(l=s.return,l===null)throw Error(M(341));l.lanes|=n,a=l.alternate,a!==null&&(a.lanes|=n),ka(l,n,t),l=s.sibling}else l=s.child;if(l!==null)l.return=s;else for(l=s;l!==null;){if(l===t){l=null;break}if(s=l.sibling,s!==null){s.return=l.return,l=s;break}l=l.return}s=l}et(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Wr(t,n),o=jt(o),r=r(o),t.flags|=1,et(e,t,r,n),t.child;case 14:return r=t.type,o=Pt(r,t.pendingProps),o=Pt(r.type,o),qc(e,t,r,o,n);case 15:return Bp(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Pt(r,o),zs(e,t),t.tag=1,ct(r)?(e=!0,ll(t)):e=!1,Wr(t,n),Kp(t,r,o),ja(t,r,o,n),Ra(null,t,r,!0,e,n);case 19:return Qp(e,t,n);case 22:return Vp(e,t,n)}throw Error(M(156,t.tag))};function dh(e,t){return $f(e,t)}function Iy(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ct(e,t,n,r){return new Iy(e,t,n,r)}function Vu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function _y(e){if(typeof e=="function")return Vu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===cu)return 11;if(e===du)return 14}return 2}function $n(e,t){var n=e.alternate;return n===null?(n=Ct(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&14680064,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}function Hs(e,t,n,r,o,s){var l=2;if(r=e,typeof e=="function")Vu(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Tr:return sr(n.children,o,s,t);case uu:l=8,o|=8;break;case Xi:return e=Ct(12,n,t,o|2),e.elementType=Xi,e.lanes=s,e;case Zi:return e=Ct(13,n,t,o),e.elementType=Zi,e.lanes=s,e;case qi:return e=Ct(19,n,t,o),e.elementType=qi,e.lanes=s,e;case wf:return Wl(n,o,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case vf:l=10;break e;case bf:l=9;break e;case cu:l=11;break e;case du:l=14;break e;case Sn:l=16,r=null;break e}throw Error(M(130,e==null?e:typeof e,""))}return t=Ct(l,n,t,o),t.elementType=e,t.type=r,t.lanes=s,t}function sr(e,t,n,r){return e=Ct(7,e,r,t),e.lanes=n,e}function Wl(e,t,n,r){return e=Ct(22,e,r,t),e.elementType=wf,e.lanes=n,e.stateNode={isHidden:!1},e}function Ei(e,t,n){return e=Ct(6,e,null,t),e.lanes=n,e}function ji(e,t,n){return t=Ct(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ay(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=li(0),this.expirationTimes=li(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=li(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Uu(e,t,n,r,o,s,l,a,u){return e=new Ay(e,t,n,a,u),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Ct(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ru(s),e}function Ly(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:jr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function fh(e){if(!e)return Kn;e=e._reactInternals;e:{if(xr(e)!==e||e.tag!==1)throw Error(M(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(ct(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(M(171))}if(e.tag===1){var n=e.type;if(ct(n))return fp(e,n,t)}return t}function ph(e,t,n,r,o,s,l,a,u){return e=Uu(n,r,!0,e,o,s,l,a,u),e.context=fh(null),n=e.current,r=tt(),o=Mn(n),s=on(r,o),s.callback=t??null,Dn(n,s,o),e.current.lanes=o,es(e,o,r),dt(e,r),e}function Bl(e,t,n,r){var o=t.current,s=tt(),l=Mn(o);return n=fh(n),t.context===null?t.context=n:t.pendingContext=n,t=on(s,l),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Dn(o,t,l),e!==null&&(Lt(e,o,l,s),Os(e,o,l)),l}function vl(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function cd(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Gu(e,t){cd(e,t),(e=e.alternate)&&cd(e,t)}function Dy(){return null}var hh=typeof reportError=="function"?reportError:function(e){console.error(e)};function Yu(e){this._internalRoot=e}Vl.prototype.render=Yu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(M(409));Bl(e,t,null,null)};Vl.prototype.unmount=Yu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dr(function(){Bl(null,e,null,null)}),t[un]=null}};function Vl(e){this._internalRoot=e}Vl.prototype.unstable_scheduleHydration=function(e){if(e){var t=Vf();e={blockedOn:null,target:e,priority:t};for(var n=0;n<jn.length&&t!==0&&t<jn[n].priority;n++);jn.splice(n,0,e),n===0&&Gf(e)}};function Qu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ul(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function dd(){}function Oy(e,t,n,r,o){if(o){if(typeof r=="function"){var s=r;r=function(){var c=vl(l);s.call(c)}}var l=ph(t,r,e,0,null,!1,!1,"",dd);return e._reactRootContainer=l,e[un]=l.current,Ho(e.nodeType===8?e.parentNode:e),dr(),l}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var a=r;r=function(){var c=vl(u);a.call(c)}}var u=Uu(e,0,!1,null,null,!1,!1,"",dd);return e._reactRootContainer=u,e[un]=u.current,Ho(e.nodeType===8?e.parentNode:e),dr(function(){Bl(t,u,n,r)}),u}function Gl(e,t,n,r,o){var s=n._reactRootContainer;if(s){var l=s;if(typeof o=="function"){var a=o;o=function(){var u=vl(l);a.call(u)}}Bl(t,l,e,o)}else l=Oy(n,t,e,o,r);return vl(l)}Wf=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=So(t.pendingLanes);n!==0&&(hu(t,n|1),dt(t,Le()),!(de&6)&&(Jr=Le()+500,Un()))}break;case 13:dr(function(){var r=cn(e,1);if(r!==null){var o=tt();Lt(r,e,1,o)}}),Gu(e,1)}};mu=function(e){if(e.tag===13){var t=cn(e,134217728);if(t!==null){var n=tt();Lt(t,e,134217728,n)}Gu(e,134217728)}};Bf=function(e){if(e.tag===13){var t=Mn(e),n=cn(e,t);if(n!==null){var r=tt();Lt(n,e,t,r)}Gu(e,t)}};Vf=function(){return he};Uf=function(e,t){var n=he;try{return he=e,t()}finally{he=n}};aa=function(e,t,n){switch(t){case"input":if(ta(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=Ml(r);if(!o)throw Error(M(90));Cf(r),ta(r,o)}}}break;case"textarea":Ef(e,n);break;case"select":t=n.value,t!=null&&zr(e,!!n.multiple,t,!1)}};_f=Hu;Af=dr;var My={usingClientEntryPoint:!1,Events:[ns,Ir,Ml,Pf,If,Hu]},yo={findFiberByHostInstance:er,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},$y={bundleType:yo.bundleType,version:yo.version,rendererPackageName:yo.rendererPackageName,rendererConfig:yo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:vn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Of(e),e===null?null:e.stateNode},findFiberByHostInstance:yo.findFiberByHostInstance||Dy,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ks=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ks.isDisabled&&ks.supportsFiber)try{Al=ks.inject($y),zt=ks}catch{}}xt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=My;xt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Qu(t))throw Error(M(200));return Ly(e,t,null,n)};xt.createRoot=function(e,t){if(!Qu(e))throw Error(M(299));var n=!1,r="",o=hh;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Uu(e,1,!1,null,null,n,!1,r,o),e[un]=t.current,Ho(e.nodeType===8?e.parentNode:e),new Yu(t)};xt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(M(188)):(e=Object.keys(e).join(","),Error(M(268,e)));return e=Of(t),e=e===null?null:e.stateNode,e};xt.flushSync=function(e){return dr(e)};xt.hydrate=function(e,t,n){if(!Ul(t))throw Error(M(200));return Gl(null,e,t,!0,n)};xt.hydrateRoot=function(e,t,n){if(!Qu(e))throw Error(M(405));var r=n!=null&&n.hydratedSources||null,o=!1,s="",l=hh;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(l=n.onRecoverableError)),t=ph(t,null,e,1,n??null,o,!1,s,l),e[un]=t.current,Ho(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new Vl(t)};xt.render=function(e,t,n){if(!Ul(t))throw Error(M(200));return Gl(null,e,t,!1,n)};xt.unmountComponentAtNode=function(e){if(!Ul(e))throw Error(M(40));return e._reactRootContainer?(dr(function(){Gl(null,null,e,!1,function(){e._reactRootContainer=null,e[un]=null})}),!0):!1};xt.unstable_batchedUpdates=Hu;xt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Ul(n))throw Error(M(200));if(e==null||e._reactInternals===void 0)throw Error(M(38));return Gl(e,t,n,!1,r)};xt.version="18.3.1-next-f1338f8080-20240426";function mh(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(mh)}catch(e){console.error(e)}}mh(),mf.exports=xt;var Xu=mf.exports,fd=Xu;Yi.createRoot=fd.createRoot,Yi.hydrateRoot=fd.hydrateRoot;const zy="modulepreload",Fy=function(e){return"/panel/"+e},pd={},Ky=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),a=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));o=Promise.allSettled(n.map(u=>{if(u=Fy(u),u in pd)return;pd[u]=!0;const c=u.endsWith(".css"),f=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${f}`))return;const h=document.createElement("link");if(h.rel=c?"stylesheet":zy,c||(h.as="script"),h.crossOrigin="",h.href=u,a&&h.setAttribute("nonce",a),document.head.appendChild(h),c)return new Promise((d,m)=>{h.addEventListener("load",d),h.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(l){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=l,window.dispatchEvent(a),!a.defaultPrevented)throw l}return o.then(l=>{for(const a of l||[])a.status==="rejected"&&s(a.reason);return t().catch(s)})};let Xt=null,bl=!1;const Ws=[],Bs=[],Vs=[];function Hy(){return window.location.origin.replace(/^http/,"ws")}function gh(){if(Xt)return;const e=Hy();Xt=new WebSocket(e),Xt.addEventListener("open",()=>{bl=!0,Nn({type:"REGISTER",role:"panel"});for(const t of Bs)t()}),Xt.addEventListener("close",()=>{bl=!1,Xt=null;for(const t of Vs)t();setTimeout(()=>gh(),3e3)}),Xt.addEventListener("message",t=>{try{const n=JSON.parse(t.data);for(const r of Ws)r(n)}catch(n){console.error("[tw-panel] Failed to parse message:",n)}}),Xt.addEventListener("error",t=>{console.error("[tw-panel] WebSocket error:",t)})}function Nn(e){bl&&Xt&&Xt.send(JSON.stringify(e))}function pe(e,t){Nn({...t,to:e})}function wl(e){return Ws.push(e),()=>{const t=Ws.indexOf(e);t!==-1&&Ws.splice(t,1)}}function Wy(e){return Bs.push(e),()=>{const t=Bs.indexOf(e);t!==-1&&Bs.splice(t,1)}}function By(e){return Vs.push(e),()=>{const t=Vs.indexOf(e);t!==-1&&Vs.splice(t,1)}}function Vy(){return bl}const yh=[{name:"popover",label:"Popover",icon:i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[i.jsx("rect",{x:"1",y:"1",width:"14",height:"14",rx:"1.5",stroke:"currentColor",strokeWidth:"1.1",opacity:"0.3"}),i.jsx("rect",{x:"4",y:"4",width:"8",height:"6",rx:"1",fill:"currentColor"})]})},{name:"sidebar",label:"Sidebar",icon:i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[i.jsx("rect",{x:"1",y:"1",width:"14",height:"14",rx:"1.5",stroke:"currentColor",strokeWidth:"1.1",opacity:"0.3"}),i.jsx("rect",{x:"9",y:"1",width:"6",height:"14",rx:"1.5",fill:"currentColor",opacity:"0.85"})]})},{name:"modal",label:"Modal",icon:i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[i.jsx("rect",{x:"1",y:"1",width:"14",height:"14",rx:"1.5",fill:"currentColor",opacity:"0.12"}),i.jsx("rect",{x:"3",y:"4",width:"10",height:"8",rx:"1",fill:"currentColor",opacity:"0.9"})]})},{name:"popup",label:"Popup",icon:i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[i.jsx("rect",{x:"1",y:"1",width:"14",height:"14",rx:"1.5",stroke:"currentColor",strokeWidth:"1.1",opacity:"0.3"}),i.jsx("rect",{x:"8",y:"8",width:"7",height:"7",rx:"1",fill:"currentColor",opacity:"0.85"})]})}],xh="tw-panel-container";function Uy(){try{const e=localStorage.getItem(xh);if(e&&yh.some(t=>t.name===e))return e}catch{}return"popover"}function Es(){const[e,t]=b.useState(Uy),[n,r]=b.useState(!1),o=b.useRef(null);b.useEffect(()=>{function l(a){o.current&&!o.current.contains(a.target)&&r(!1)}return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[]);function s(l){if(l!==e){try{localStorage.setItem(xh,l)}catch{}t(l),pe("overlay",{type:"SWITCH_CONTAINER",container:l})}r(!1)}return i.jsxs("div",{ref:o,className:"relative",children:[i.jsx("button",{title:"Change container",onClick:()=>r(l=>!l),className:"w-7 h-7 flex items-center justify-center rounded border border-transparent text-bv-text-mid bg-transparent cursor-pointer transition-colors hover:bg-bv-surface hover:border-bv-border hover:text-bv-text",children:i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("rect",{x:".5",y:"1.5",width:"15",height:"13",rx:"1.5",ry:"1.5"}),i.jsx("line",{x1:"8.5",y1:"1.5",x2:"8.5",y2:"14.5"}),i.jsx("line",{x1:"11",y1:"5",x2:"13",y2:"5"}),i.jsx("line",{x1:"11",y1:"8",x2:"13",y2:"8"}),i.jsx("line",{x1:"11",y1:"11",x2:"13",y2:"11"})]})}),n&&i.jsxs("div",{className:"absolute top-[calc(100%+4px)] right-0 bg-bv-surface border border-[#4f4f4f] rounded-lg shadow-[0_4px_16px_rgba(0,0,0,0.25)] p-1.5 flex flex-col gap-px min-w-[148px] z-50",children:[i.jsx("div",{className:"text-[9px] font-semibold uppercase tracking-[0.8px] text-bv-muted px-2 pt-1 pb-1.5",children:"Container"}),yh.map(l=>i.jsxs("button",{onClick:()=>s(l.name),className:`flex items-center gap-2 px-2 py-1.5 rounded text-[12px] cursor-pointer border-none w-full text-left transition-colors ${l.name===e?"bg-bv-teal/9 text-bv-teal":"bg-transparent text-bv-text-mid hover:bg-bv-surface hover:text-bv-text"}`,children:[l.icon,l.label]},l.name)),i.jsx("div",{className:"h-px bg-[#4f4f4f] mx-1 my-1"}),i.jsxs("button",{onClick:()=>{r(!1),pe("overlay",{type:"CLOSE_PANEL"})},className:"flex items-center gap-2 px-2 py-1.5 rounded text-[12px] cursor-pointer border-none w-full text-left transition-colors bg-transparent text-red-400 hover:bg-red-500/10 hover:text-red-300",children:[i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[i.jsx("line",{x1:"4",y1:"4",x2:"12",y2:"12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),i.jsx("line",{x1:"12",y1:"4",x2:"4",y2:"12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),"Close panel"]})]})]})}function Gy(e){const t={};for(const[n,r]of Object.entries(e)){if(!r||typeof r!="object")continue;const o=r,s=typeof o.control=="string"?o.control:typeof o.control=="object"&&o.control!==null?o.control.type??"text":"text";t[n]={control:s,options:Array.isArray(o.options)?o.options:void 0,description:typeof o.description=="string"?o.description:void 0,defaultValue:o.defaultValue}}return t}function Yy(e,t=!0){const[n,r]=b.useState(null),[o,s]=b.useState(!0),[l,a]=b.useState({}),[u,c]=b.useState({}),f=b.useRef(0),h=b.useRef(null),d=b.useRef(!1);return b.useEffect(()=>{if(!t)return;if(e.length===0){s(!1);return}d.current=!1,f.current=0;const m=document.createElement("iframe");Object.assign(m.style,{position:"fixed",left:"-99999px",top:"0",width:"800px",height:"600px",visibility:"hidden",pointerEvents:"none"}),h.current=m,document.body.appendChild(m);function v(g){if(g>=e.length){d.current||(d.current=!0,r(e[0]),a({}),c({}),s(!1));return}f.current=g,m.src=`/storybook/iframe.html?id=${e[g].id}&viewMode=story&vybit-ghost=1`}let w=null;function S(g){var k,C,T,E;if(d.current)return;let y=g.data;if(typeof y=="string")try{y=JSON.parse(y)}catch{return}const x=e[f.current];if((y==null?void 0:y.key)==="storybook-channel"&&((k=y==null?void 0:y.event)==null?void 0:k.type)==="storyPrepared"&&((E=(T=(C=y==null?void 0:y.event)==null?void 0:C.args)==null?void 0:T[0])==null?void 0:E.id)===(x==null?void 0:x.id)){const A=y.event.args[0].argTypes??{},I=y.event.args[0].initialArgs??y.event.args[0].args??{};if(Object.keys(A).length>0)d.current=!0,r(x),a(Gy(A)),c(I),s(!1);else{w&&clearTimeout(w);const L=f.current+1;w=setTimeout(()=>v(L),50)}}}window.addEventListener("message",S);function p(){w&&clearTimeout(w),w=setTimeout(()=>{!d.current&&f.current<e.length&&(v(f.current+1),p())},5e3)}return m.addEventListener("load",()=>{p()}),v(0),()=>{d.current=!0,window.removeEventListener("message",S),w&&clearTimeout(w),m.remove(),h.current=null}},[e,t]),{bestStory:n,probing:o,argTypes:l,defaultArgs:u}}const Qy=1;let Sl=0;const vh=[];function bh(){return new Promise(e=>{const t=()=>{Sl<Qy?(Sl++,e(Xy)):vh.push(t)};t()})}function Xy(){Sl=Math.max(0,Sl-1);const e=vh.shift();e==null||e()}function Zy(e){const[t,n]=b.useState(!1),r=b.useRef(null),o=b.useRef(!1);b.useEffect(()=>{if(!e||o.current)return;o.current=!0;let l=!1;return bh().then(a=>{if(l){a();return}r.current=a,n(!0)}),()=>{l=!0,r.current&&(r.current(),r.current=null),n(!1),o.current=!1}},[e]);const s=b.useCallback(()=>{r.current&&(r.current(),r.current=null)},[]);return{canProbe:t,releaseProbeSlot:s}}function qy(e){const[t,n]=b.useState(!1),r=b.useRef(null),o=b.useRef(!1);b.useEffect(()=>{if(!e||o.current)return;o.current=!0;let l=!1;return bh().then(a=>{if(l){a();return}r.current=a,n(!0)}),()=>{l=!0,r.current&&(r.current(),r.current=null)}},[e]);const s=b.useCallback(()=>{r.current&&(r.current(),r.current=null)},[]);return{canLoad:t,releaseSlot:s}}function Ka(e,t={},n="/storybook"){const r=`${n}/iframe.html?id=${encodeURIComponent(e)}&viewMode=story&vybit-ghost=1`,o=Object.entries(t).filter(([,l])=>l!=null);if(o.length===0)return r;const s=o.map(([l,a])=>`${encodeURIComponent(l)}:${encodeURIComponent(String(a))}`).join(";");return`${r}&args=${s}`}function Jy({argTypes:e,args:t,onArgsChange:n}){const r=Object.entries(e);if(r.length===0)return null;function o(s,l){n({...t,[s]:l})}return i.jsx("div",{className:"flex flex-col gap-1.5 px-1",children:r.map(([s,l])=>i.jsx(ex,{name:s,argType:l,value:t[s],onChange:a=>o(s,a)},s))})}function ex({name:e,argType:t,value:n,onChange:r}){const o=typeof t.control=="string"?t.control:typeof t.control=="object"&&t.control!==null?t.control.type??"text":"text";return i.jsxs("label",{className:"flex items-center gap-2 text-[10px]",children:[i.jsx("span",{className:"text-bv-text-mid font-mono min-w-[60px] shrink-0",children:e}),o==="select"&&t.options?i.jsx("select",{className:"flex-1 bg-bv-surface border border-bv-border rounded px-1.5 py-0.5 text-[10px] text-bv-text",value:String(n??""),onChange:s=>r(s.target.value),children:t.options.map(s=>i.jsx("option",{value:s,children:s},s))}):o==="boolean"?i.jsx("input",{type:"checkbox",checked:!!n,onChange:s=>r(s.target.checked),className:"accent-bv-teal"}):o==="number"?i.jsx("input",{type:"number",className:"flex-1 bg-bv-surface border border-bv-border rounded px-1.5 py-0.5 text-[10px] text-bv-text",value:n!=null?String(n):"",onChange:s=>r(s.target.value===""?void 0:Number(s.target.value))}):i.jsx("input",{type:"text",className:"flex-1 bg-bv-surface border border-bv-border rounded px-1.5 py-0.5 text-[10px] text-bv-text",value:String(n??""),onChange:s=>r(s.target.value)})]})}function tx(e){return e.replace(/:root/g,":host").replace(/(^|[\s,{;])body(?=\s*[,{:])/gm,"$1:host")}function fb(e){return e.replace(/:host/g,":root")}const nx="color:CanvasText;font-family:system-ui,sans-serif;font-size:16px;line-height:1.5";function wh({ghostHtml:e,ghostCss:t,style:n,className:r}){const o=b.useRef(null);return b.useEffect(()=>{if(!o.current)return;const s=o.current.shadowRoot??o.current.attachShadow({mode:"open"}),l=`:host{${nx}}`;s.innerHTML=`<style>${l}${t}</style><div style="pointer-events:none">${e}</div>`},[e,t]),i.jsx("div",{ref:o,style:n,className:r})}const Ti=56,Ni=40,rx=.15;function ox({phase:e,ghostHtml:t,ghostCss:n,naturalWidth:r,naturalHeight:o,storyBackground:s,onClick:l}){const a=e!=="idle",u=a&&!!t,c=a&&!u&&e!=="error",f=b.useRef(null),[h,d]=b.useState(null);if(b.useEffect(()=>{if(!u||!f.current||r>0&&o>0)return;const p=f.current.firstElementChild,g=p==null?void 0:p.shadowRoot,y=g==null?void 0:g.querySelector("div");if(!y)return;const x=y.style.width;y.style.width="max-content";const k=y.scrollWidth,C=y.scrollHeight;y.style.width=x,k>0&&C>0&&d({w:k,h:C})},[u,t,r,o]),!a||e==="idle")return i.jsx("div",{className:"w-14 h-10 rounded bg-bv-surface border border-dashed border-bv-border flex items-center justify-center text-[9px] font-mono text-bv-muted cursor-pointer shrink-0 hover:border-bv-teal hover:text-bv-teal transition-colors",onClick:l,children:"preview"});if(c)return i.jsx("div",{className:"w-14 h-10 rounded bg-bv-surface flex items-center justify-center shrink-0",children:i.jsx("div",{className:"w-3.5 h-3.5 border-2 border-bv-border border-t-bv-teal rounded-full animate-spin"})});if(e==="error")return i.jsx("div",{className:"w-14 h-10 rounded bg-bv-surface flex items-center justify-center shrink-0",children:i.jsx("span",{className:"text-[9px] text-bv-orange",children:"err"})});const m=r>0?r:(h==null?void 0:h.w)??0,v=o>0?o:(h==null?void 0:h.h)??0,w=m>0&&v>0?Math.min(Ti/m,Ni/v,1):1,S=Math.max(w,rx);return i.jsx("div",{className:"w-14 h-10 rounded bg-bv-surface overflow-hidden relative cursor-pointer shrink-0",style:s?{backgroundColor:s}:void 0,onClick:l,children:i.jsx("div",{ref:f,style:{position:"absolute",top:0,left:0,transformOrigin:"top left",transform:`scale(${S})`,width:S<1?`${Ti/S}px`:`${Ti}px`,height:S<1?`${Ni/S}px`:`${Ni}px`,display:"flex",alignItems:S>=.8?"center":"flex-start",justifyContent:S>=.8?"center":"flex-start",padding:S<.8?"4px":"2px",pointerEvents:"none"},children:n?i.jsx(wh,{ghostHtml:t,ghostCss:n}):i.jsx("div",{className:"pointer-events-none",dangerouslySetInnerHTML:{__html:t}})})})}const sx={phase:"idle",bestStory:null,argTypes:{},defaultArgs:{},args:{},liveReady:!1,storyBackground:void 0,liveGhostHtml:null,liveGhostCss:null,naturalWidth:0,naturalHeight:0,error:null,pendingArgs:null,loadLiveRequested:!1};function lx(e,t){switch(t.type){case"BECOME_VISIBLE":return e.phase!=="idle"?e:{...e,phase:t.hasCachedGhost?"cached":"probing"};case"PROBE_COMPLETE":return e.phase!=="probing"&&e.phase!=="cached"?e:{...e,phase:"probe-done",bestStory:t.bestStory,argTypes:t.argTypes,defaultArgs:t.defaultArgs,args:t.defaultArgs};case"PROBE_FALLBACK":return e.phase!=="probing"&&e.phase!=="cached"?e:{...e,phase:"probe-done",bestStory:t.bestStory};case"SLOT_ACQUIRED":return e.phase!=="probe-done"?e:{...e,phase:"loading"};case"IFRAME_LOADED":return e.phase!=="loading"?e:{...e,phase:"ready",liveReady:!0};case"IFRAME_ERROR":return e.phase!=="loading"?e:{...e,phase:"error",error:t.message};case"GHOST_EXTRACTED":return e.phase!=="ready"&&e.phase!=="loading"&&e.phase!=="probe-done"?e:{...e,phase:"ready",liveGhostHtml:t.ghostHtml,liveGhostCss:t.ghostCss,storyBackground:t.storyBackground??e.storyBackground,naturalWidth:t.naturalWidth??e.naturalWidth,naturalHeight:t.naturalHeight??e.naturalHeight};case"ARGS_CHANGED":return e.liveReady?{...e,args:t.args}:{...e,args:t.args,pendingArgs:t.args};case"CLEAR_PENDING_ARGS":return{...e,pendingArgs:null};case"REQUEST_LIVE_REFRESH":return e.phase==="cached"?{...e,phase:"probing",loadLiveRequested:!0}:e.phase==="error"?{...e,phase:"probing",error:null,loadLiveRequested:!0}:{...e,loadLiveRequested:!0}}return e}const ix=new Set(["color","font-family","font-size","font-weight","font-style","line-height","letter-spacing","text-align","text-transform","text-decoration"]);function ax(e){const t=e.ownerDocument.defaultView??window,n=e.ownerDocument,r=t.getComputedStyle(e),o=n.createElement(e.tagName.toLowerCase());o.style.position="absolute",o.style.visibility="hidden",o.style.pointerEvents="none",(n.body??n.documentElement).appendChild(o);const s=t.getComputedStyle(o),l={};for(let a=0;a<r.length;a++){const u=r[a],c=r.getPropertyValue(u);(ix.has(u)||c!==s.getPropertyValue(u))&&(l[u]=c)}return o.remove(),l}function ux(e,t,n){for(const[r,o]of Object.entries(t))if(!((r==="height"||r==="block-size")&&!(t.display??"").startsWith("inline"))){if((r==="width"||r==="inline-size")&&n!=null){const s=parseFloat(o);if(!isNaN(s)&&Math.abs(s-n)<1)continue}r==="perspective-origin"||r==="transform-origin"||e.style.setProperty(r,o)}}const cx=new Set(["perspective-origin","transform-origin"]);function dx(e,t){if(!e||!t)return;const n=e.ownerDocument.defaultView??window,r=e.ownerDocument,o=r.body??r.documentElement,s=new Map;function l(u){let c=s.get(u);if(c)return c;const f=r.createElement(u);f.style.position="absolute",f.style.visibility="hidden",f.style.pointerEvents="none",o.appendChild(f);const h=n.getComputedStyle(f);c=new Map;for(let d=0;d<h.length;d++){const m=h[d];c.set(m,h.getPropertyValue(m))}return f.remove(),s.set(u,c),c}function a(u,c){const f=n.getComputedStyle(u),h=c;if(h.style){const w=l(u.tagName.toLowerCase());for(let S=0;S<f.length;S++){const p=f[S];if(cx.has(p))continue;const g=f.getPropertyValue(p);g!==(w.get(p)??"")&&h.style.setProperty(p,g)}}const d=u.children,m=c.children,v=Math.min(d.length,m.length);for(let w=0;w<v;w++)a(d[w],m[w])}a(e,t)}function hd(e){const t=[];for(const n of e.styleSheets)try{for(const r of n.cssRules){const o=r.cssText;o.includes(".sb-")||o.includes("#storybook-")||o.includes("Nunito Sans")||t.push(o)}}catch{}return tx(t.join(`
41
+ `))}const qt=class qt extends HTMLElement{constructor(){super();ke(this,"shadow");ke(this,"ghostEl");ke(this,"hiddenIframe");ke(this,"loadTimeoutId",null);ke(this,"pollId",null);ke(this,"hasLoaded",!1);ke(this,"_loadedDispatched",!1);ke(this,"observer",null);ke(this,"settleTimeoutId",null);ke(this,"_error",null);this.shadow=this.attachShadow({mode:"open"}),this.ghostEl=document.createElement("div"),this.ghostEl.setAttribute("part","ghost"),this.ghostEl.style.display="contents";const n=document.createElement("style");n.textContent=`
42
+ iframe {
43
+ position: absolute; inset: 0;
44
+ width: 100%; height: 100%;
45
+ border: none;
46
+ opacity: 0;
47
+ transition: opacity 0.2s ease-in;
48
+ pointer-events: none;
49
+ }
50
+ iframe.visible {
51
+ opacity: 1;
52
+ pointer-events: auto;
53
+ }
54
+ `,this.shadow.append(n,this.ghostEl),this.hiddenIframe=document.createElement("iframe"),Object.assign(this.hiddenIframe.style,{position:"fixed",left:"0",top:"0",width:"800px",height:"600px",opacity:"0",pointerEvents:"none",border:"none",zIndex:"-999999"}),this.hiddenIframe.addEventListener("load",()=>this.onIframeLoad()),this.hiddenIframe.addEventListener("error",()=>this.reportError("Failed to load iframe"))}connectedCallback(){document.body.appendChild(this.hiddenIframe),this.syncIframeWidth(),this.triggerLoad()}disconnectedCallback(){var n;(n=this.observer)==null||n.disconnect(),this.observer=null,this.pollId&&(clearInterval(this.pollId),this.pollId=null),this.hiddenIframe.remove()}attributeChangedCallback(){this.isConnected&&(this.syncIframeWidth(),this.triggerLoad())}syncIframeWidth(){const n=this.clientWidth;n>0&&(this.hiddenIframe.style.width=n+"px")}triggerLoad(){var o;(o=this.observer)==null||o.disconnect(),this.observer=null,this.loadTimeoutId&&clearTimeout(this.loadTimeoutId),this.settleTimeoutId&&(clearTimeout(this.settleTimeoutId),this.settleTimeoutId=null),this.pollId&&(clearInterval(this.pollId),this.pollId=null),this.hasLoaded=!1,this._loadedDispatched=!1;const n=this.getAttribute("src"),r=this.getAttribute("srcdoc");r!=null?this.hiddenIframe.srcdoc=r:n&&(this.hiddenIframe.src=n),this.loadTimeoutId=setTimeout(()=>{if(!this.hasLoaded){const s=this.getAttribute("src");this.reportError(`Story failed to load (${s||"unknown"}) — check that Storybook is running on port 6006+`)}},2e4)}onIframeLoad(){const n=this.getAttribute("src"),r=this.getAttribute("srcdoc");if(!n&&r==null)return;this.loadTimeoutId&&(clearTimeout(this.loadTimeoutId),this.loadTimeoutId=null),this.hasLoaded=!0;const o=this.hiddenIframe.contentDocument;if(!o){console.warn("[AdaptiveIframe] iframe loaded but contentDocument is null");return}const s=o.createElement("style");if(s.textContent="body,html{margin:0!important;padding:0!important}",o.head.appendChild(s),r!=null){this.extractAndApply(o);return}this.waitForStoryContent(o)}updateArgs(n,r){const o=this.hiddenIframe.contentWindow;o&&(o.postMessage(JSON.stringify({key:"storybook-channel",event:{type:"updateStoryArgs",args:[{storyId:n,updatedArgs:r}]}}),"*"),setTimeout(()=>{const s=this.hiddenIframe.contentDocument;s&&this.extractAndApply(s)},300))}navigateToStory(n){var u;const r=this.hiddenIframe.contentWindow,o=this.hiddenIframe.contentDocument;if(!r||!o){this.reportError("Cannot navigate: iframe not available");return}this._loadedDispatched=!1,(u=this.observer)==null||u.disconnect(),this.observer=null,this.pollId&&(clearInterval(this.pollId),this.pollId=null),this.loadTimeoutId&&(clearTimeout(this.loadTimeoutId),this.loadTimeoutId=null),this.settleTimeoutId&&(clearTimeout(this.settleTimeoutId),this.settleTimeoutId=null);const s=o.querySelector("#storybook-root");if(!s){this.reportError("Cannot navigate: #storybook-root not found");return}r.postMessage(JSON.stringify({key:"storybook-channel",event:{type:"setCurrentStory",args:[{storyId:n}]}}),"*");let l=!1;const a=new MutationObserver(()=>{l||(this.settleTimeoutId&&clearTimeout(this.settleTimeoutId),this.settleTimeoutId=setTimeout(()=>{l||(l=!0,a.disconnect(),this.observer=null,this.settleTimeoutId=null,this.extractAndApply(o))},200))});this.observer=a,a.observe(s,{childList:!0,subtree:!0,characterData:!0}),o.body&&s!==o.body&&a.observe(o.body,{childList:!0})}waitForStoryContent(n){var h;(h=this.observer)==null||h.disconnect(),this.observer=null,this.pollId&&(clearInterval(this.pollId),this.pollId=null);let r=!1,o=0;const s=20,l=()=>this.findStoryRoot(n)?(r=!0,this.extractAndApply(n),this.observer&&(this.observer.disconnect(),this.observer=null),!0):!1;if(l())return;const a=n.querySelector("#storybook-root"),u=a??n.body;if(!u)return;const c=new MutationObserver(d=>{if(!r){if(o++,l()){this.pollId&&(clearInterval(this.pollId),this.pollId=null);return}o>=s&&(c.disconnect(),this.observer=null,this.pollId&&(clearInterval(this.pollId),this.pollId=null),console.error(`[AdaptiveIframe] gave up after ${o} mutations — story never appeared. src=${this.getAttribute("src")}`),this.reportError("Story did not render — component may not exist or Storybook story file has an error"))}});this.observer=c,c.observe(u,{childList:!0,subtree:!0,characterData:!0}),a&&n.body&&a!==n.body&&c.observe(n.body,{childList:!0});let f=0;this.pollId=setInterval(()=>{if(r){clearInterval(this.pollId),this.pollId=null;return}f++;const d=this.hiddenIframe.contentDocument;if(d&&this.findStoryRoot(d)){r=!0,this.extractAndApply(d),this.observer&&(this.observer.disconnect(),this.observer=null),clearInterval(this.pollId),this.pollId=null;return}f>=40&&(clearInterval(this.pollId),this.pollId=null)},1e3),setTimeout(()=>{!r&&this.observer===c&&(this.observer.disconnect(),this.observer=null,this.pollId&&(clearInterval(this.pollId),this.pollId=null),console.error(`[AdaptiveIframe] 40s timeout — story never rendered. src=${this.getAttribute("src")}`),this.reportError("Story did not render — component may not exist or Storybook story file has an error"))},4e4)}findStoryRoot(n){var o;const r=n.querySelector("#storybook-root");if(r){for(const l of r.children)if(!l.classList.contains("sb-loader")&&!(l.id&&(l.id.startsWith("storybook-")||l.id.startsWith("sb-"))))return l.children.length===0&&!((o=l.textContent)!=null&&o.trim())&&!l.className?null:l;const s=this.findPortalContent(n);return s||null}return n.body.firstElementChild}findPortalContent(n){var o;const r=n.defaultView??window;for(const s of n.body.children)if(!qt.INFRA_TAGS.has(s.tagName)&&!(s.id&&qt.INFRA_IDS.has(s.id))&&!(s.id&&(s.id.startsWith("storybook-")||s.id.startsWith("sb-")))&&!(s.className&&typeof s.className=="string"&&s.className.split(/\s+/).some(a=>qt.INFRA_CLASS_PREFIXES.some(u=>a.startsWith(u))))){if(s instanceof HTMLElement){const l=r.getComputedStyle(s);if(l.display==="none"||l.visibility==="hidden")continue}if(!(!s.children.length&&!((o=s.textContent)!=null&&o.trim())))return s}return null}getComponentHtml(){const n=this.hiddenIframe.contentDocument;if(!n)return"";const r=this.findStoryRoot(n);return r?r.cloneNode(!0).outerHTML:this.ghostEl.innerHTML}getComponentCss(){const n=this.hiddenIframe.contentDocument;return n?hd(n):""}extractAndApply(n){const r=this.findStoryRoot(n);if(r&&r.ownerDocument.defaultView,!r)return;const o=ax(r);if(o.position==="fixed"||o.position==="absolute"){const S=["position","left","right","top","bottom","inset","inset-block","inset-block-start","inset-block-end","inset-inline","inset-inline-start","inset-inline-end","transform","translate","z-index","opacity","animation","animation-name","animation-duration","animation-delay","animation-fill-mode","animation-timing-function","transition","transition-property","transition-duration","transition-delay","transition-timing-function"];for(const p of S)delete o[p]}ux(this,o,parseInt(this.hiddenIframe.style.width)||800),this.ghostEl.innerHTML=r.innerHTML;const s=r.children,l=this.ghostEl.children,a=Math.min(s.length,l.length);for(let S=0;S<a;S++)dx(s[S],l[S]);this._loadedDispatched||(this._loadedDispatched=!0,this.dispatchEvent(new CustomEvent("iframe-loaded")));const u=this.getComponentHtml(),c=hd(n),f=getComputedStyle(n.body).backgroundColor,h=r,d=h.style.width,m=h.style.display;h.style.width="fit-content",m||(h.style.display="block");const v=h.scrollWidth,w=h.scrollHeight;h.style.width=d,h.style.display=m,this.dispatchEvent(new CustomEvent("ghost-extracted",{detail:{ghostHtml:u,ghostCss:c,hostStyles:o,storyBackground:f,naturalWidth:v,naturalHeight:w}}))}reportError(n){this._error=n,console.error(`[AdaptiveIframe] ${n}`),this.dispatchEvent(new CustomEvent("iframe-error",{detail:{message:n}}))}getError(){return this._error}clearError(){this._error=null}};ke(qt,"observedAttributes",["src","srcdoc"]),ke(qt,"INFRA_TAGS",new Set(["SCRIPT","STYLE","LINK","META","NOSCRIPT"])),ke(qt,"INFRA_IDS",new Set(["storybook-root","storybook-docs","sb-addons-root"])),ke(qt,"INFRA_CLASS_PREFIXES",["sb-"]);let Ha=qt;customElements.get("adaptive-iframe")||customElements.define("adaptive-iframe",Ha);let Ri=null;function fx(){return Ri||(Ri=new Wa),Ri}const En=class En{constructor(){ke(this,"iframe");ke(this,"el");ke(this,"queue",[]);ke(this,"processing",!1);ke(this,"hasLoadedFirstStory",!1);ke(this,"navFailCount",0);const t=document.createElement("adaptive-iframe");t.style.setProperty("position","fixed","important"),t.style.setProperty("width","800px","important"),t.style.setProperty("height","600px","important"),t.style.setProperty("left","0","important"),t.style.setProperty("top","0","important"),t.style.setProperty("opacity","0","important"),t.style.setProperty("pointer-events","none","important"),t.style.setProperty("overflow","hidden","important"),t.style.setProperty("z-index","-999999","important"),document.body.appendChild(t),this.el=t,this.iframe=t}extract(t){return new Promise((n,r)=>{this.queue.push({storyId:t,resolve:n,reject:r}),this.processNext()})}cancel(t){this.queue=this.queue.filter(n=>n.storyId!==t)}processNext(){if(this.processing||this.queue.length===0)return;this.processing=!0;const t=this.queue.shift();this.extractSingle(t.storyId).then(n=>t.resolve(n)).catch(n=>t.reject(n)).finally(()=>{this.processing=!1,this.processNext()})}extractSingle(t){return this.hasLoadedFirstStory&&this.navFailCount<En.MAX_NAV_FAILURES?this.extractViaNavigate(t):this.extractViaSrc(t)}extractViaNavigate(t){return new Promise((n,r)=>{let o=!1,s=null;const l=()=>{o||(o=!0,this.el.removeEventListener("ghost-extracted",a),this.el.removeEventListener("iframe-error",u),s&&clearTimeout(s))},a=c=>{l(),this.hasLoadedFirstStory=!0,this.navFailCount=0;const f=c.detail;n({ghostHtml:f.ghostHtml,ghostCss:f.ghostCss,hostStyles:f.hostStyles,storyBackground:f.storyBackground,naturalWidth:f.naturalWidth,naturalHeight:f.naturalHeight})},u=c=>{l();const f=c.detail.message;r(new Error(f))};this.el.addEventListener("ghost-extracted",a),this.el.addEventListener("iframe-error",u),this.iframe.navigateToStory(t),s=setTimeout(()=>{l(),this.navFailCount++,this.extractViaSrc(t).then(n,r)},En.NAV_TIMEOUT)})}extractViaSrc(t){return new Promise((n,r)=>{let o=!1,s=null;const l=()=>{o||(o=!0,this.el.removeEventListener("ghost-extracted",a),this.el.removeEventListener("iframe-error",u),s&&clearTimeout(s))},a=c=>{l(),this.hasLoadedFirstStory=!0;const f=c.detail;n({ghostHtml:f.ghostHtml,ghostCss:f.ghostCss,hostStyles:f.hostStyles,storyBackground:f.storyBackground,naturalWidth:f.naturalWidth,naturalHeight:f.naturalHeight})},u=c=>{l();const f=c.detail.message;r(new Error(f))};this.el.addEventListener("ghost-extracted",a),this.el.addEventListener("iframe-error",u),this.el.setAttribute("src",Ka(t,{})),s=setTimeout(()=>{l(),r(new Error(`Extraction timeout for story: ${t}`))},En.SRC_TIMEOUT)})}};ke(En,"MAX_NAV_FAILURES",2),ke(En,"NAV_TIMEOUT",3e3),ke(En,"SRC_TIMEOUT",25e3);let Wa=En;function px(e,t){const[n,r]=b.useState(null),[o,s]=b.useState(!1),[l,a]=b.useState(null);return b.useEffect(()=>{if(!t||!e)return;let u=!1;const c=fx();return s(!0),a(null),c.extract(e).then(f=>{u||(r(f),s(!1))}).catch(f=>{u||(a(f instanceof Error?f.message:String(f)),s(!1))}),()=>{u=!0,c.cancel(e)}},[t,e]),{ghostData:n,loading:o,error:l}}function hx({group:e,isArmed:t,onArm:n,onDisarm:r,cachedGhostHtml:o,cachedGhostCss:s,cachedHostStyles:l,cachedStoryBackground:a,cachedArgCount:u,onGhostExtracted:c,insertMode:f,hasPageSelection:h}){var bn;const[d,m]=b.useReducer(lx,{...sx,storyBackground:a}),v=b.useRef(null),w=b.useRef(null),S=b.useRef(!1),[p,g]=b.useState(!1);b.useEffect(()=>{const ae=v.current;if(!ae)return;const me=new IntersectionObserver(([st])=>{st.isIntersecting&&(m({type:"BECOME_VISIBLE",hasCachedGhost:!!o}),me.disconnect())},{rootMargin:"200px"});return me.observe(ae),()=>me.disconnect()},[o]);const y=d.phase!=="idle"&&(d.phase==="probing"||!o||p||d.loadLiveRequested)&&!(d.phase==="probe-done"||d.phase==="loading"||d.phase==="ready"||d.phase==="loaded"||d.phase==="error"),{canProbe:x,releaseProbeSlot:k}=Zy(y),C=y&&x,{bestStory:T,probing:E,argTypes:A,defaultArgs:I}=Yy(e.stories,C);b.useEffect(()=>{!E&&T&&(d.phase==="probing"||d.phase==="cached")&&(k(),Object.keys(A).length>0?m({type:"PROBE_COMPLETE",bestStory:T,argTypes:A,defaultArgs:I}):m({type:"PROBE_FALLBACK",bestStory:T}))},[E,T,A,I,d.phase]);const L=d.loadLiveRequested&&(d.phase==="probe-done"||d.phase==="loading")&&!!d.bestStory&&(!o||d.loadLiveRequested),{canLoad:B,releaseSlot:K}=qy(L);b.useEffect(()=>{B&&d.phase==="probe-done"&&m({type:"SLOT_ACQUIRED"})},[B,d.phase]);const D=d.phase==="probe-done"&&!!d.bestStory&&!d.loadLiveRequested&&!o,{ghostData:H}=px(((bn=d.bestStory)==null?void 0:bn.id)??null,D);b.useEffect(()=>{H&&(m({type:"GHOST_EXTRACTED",ghostHtml:H.ghostHtml,ghostCss:H.ghostCss,storyBackground:H.storyBackground,naturalWidth:H.naturalWidth,naturalHeight:H.naturalHeight}),d.bestStory&&(c==null||c({storyId:d.bestStory.id,args:{},ghostHtml:H.ghostHtml,ghostCss:H.ghostCss,hostStyles:H.hostStyles,storyBackground:H.storyBackground,componentName:e.name,componentPath:e.componentPath,argCount:Object.keys(d.argTypes).length||void 0})))},[H]),b.useEffect(()=>{d.phase!=="loading"||!d.bestStory||!w.current||S.current||(S.current=!0,Ka(d.bestStory.id,{}),w.current.setAttribute("src",Ka(d.bestStory.id,{})))},[d.phase,d.bestStory]),b.useEffect(()=>{const ae=w.current;if(!(ae!=null&&ae.addEventListener))return;const me=()=>{m({type:"IFRAME_LOADED"}),K(),d.pendingArgs&&d.bestStory&&(typeof ae.updateArgs=="function"&&ae.updateArgs(d.bestStory.id,d.pendingArgs),m({type:"CLEAR_PENDING_ARGS"}))},st=lt=>{const X=lt.detail.message;m({type:"IFRAME_ERROR",message:X}),K()},Je=lt=>{const{ghostHtml:X,ghostCss:oe,hostStyles:ie,storyBackground:N,naturalWidth:O,naturalHeight:z}=lt.detail;(N||X)&&m({type:"GHOST_EXTRACTED",ghostHtml:X,ghostCss:oe??"",storyBackground:N,naturalWidth:O,naturalHeight:z}),d.bestStory&&(c==null||c({storyId:d.bestStory.id,args:{},ghostHtml:X,ghostCss:oe??"",hostStyles:ie,storyBackground:N,componentName:e.name,componentPath:e.componentPath,argCount:Object.keys(d.argTypes).length||void 0}))};return ae.addEventListener("iframe-loaded",me),ae.addEventListener("iframe-error",st),ae.addEventListener("ghost-extracted",Je),()=>{ae.removeEventListener("iframe-loaded",me),ae.removeEventListener("iframe-error",st),ae.removeEventListener("ghost-extracted",Je)}},[d.bestStory,d.pendingArgs,K,e.name,e.componentPath,c]);const Q=b.useCallback(ae=>{if(m({type:"ARGS_CHANGED",args:ae}),!d.liveReady||!w.current||!d.bestStory){m({type:"REQUEST_LIVE_REFRESH"});return}const me=w.current;typeof me.updateArgs=="function"&&me.updateArgs(d.bestStory.id,ae)},[d.bestStory,d.liveReady]),J=b.useCallback(ae=>{var lt,X;if(ae.stopPropagation(),t){r();return}const me=w.current,st=((lt=me==null?void 0:me.getComponentHtml)==null?void 0:lt.call(me))??d.liveGhostHtml??o??"",Je=((X=me==null?void 0:me.getComponentCss)==null?void 0:X.call(me))??d.liveGhostCss??s??"";n(st,Je,d.args),m({type:"REQUEST_LIVE_REFRESH"}),c&&st&&d.bestStory&&c({storyId:d.bestStory.id,args:d.args,ghostHtml:st,ghostCss:Je,hostStyles:l??{},storyBackground:d.storyBackground,componentName:e.name,componentPath:e.componentPath,argCount:Object.keys(d.argTypes).length||void 0})},[t,n,r,d.args,d.bestStory,d.storyBackground,o,s,l,e.name,e.componentPath,c]),j=b.useCallback(ae=>{ae.stopPropagation(),g(me=>!me),!d.liveReady&&!d.loadLiveRequested&&m({type:"REQUEST_LIVE_REFRESH"})},[d.liveReady,d.loadLiveRequested]),R=Object.keys(d.argTypes).length>0?d.argTypes:e.argTypes??{},P=Object.keys(R).length>0||!!o,G=Object.keys(R).length||u||0,Y=d.liveGhostHtml??o,Ce=d.liveGhostCss??s,_e=f==="replace"?"Replace":"Place",$=f==="replace"?"Replacing":"Placing",ne=d.phase!=="idle",ge=d.bestStory??T,q=ne&&!d.error&&ge&&d.loadLiveRequested,Gn=t?"border-bv-orange text-white bg-bv-orange hover:bg-[#d94425]":h?"border-bv-teal text-bv-teal bg-bv-teal/10 hover:bg-bv-teal/20 hover:text-white":"border-bv-border text-bv-text-mid bg-bv-surface hover:border-[#555] hover:text-bv-text hover:bg-bv-surface-hi";return i.jsxs("li",{ref:v,className:"flex flex-col",children:[i.jsxs("div",{className:`flex items-center gap-2.5 px-2.5 py-2 rounded-md cursor-pointer transition-all ${t?"bg-bv-orange/10 border border-bv-orange":p?"bg-bv-surface border border-bv-border rounded-b-none":"border border-transparent hover:bg-bv-surface hover:border-bv-border"}`,onClick:j,children:[i.jsx(ox,{phase:d.phase,ghostHtml:Y,ghostCss:Ce,naturalWidth:d.naturalWidth,naturalHeight:d.naturalHeight,storyBackground:d.storyBackground,onClick:j}),i.jsxs("div",{className:"flex-1 min-w-0",children:[e.stories[0]?i.jsx("a",{href:`/storybook/?path=/story/${e.stories[0].id}`,target:"_blank",rel:"noopener noreferrer",className:"text-[12px] text-bv-text hover:text-bv-orange hover:underline transition-colors leading-tight truncate block",onClick:ae=>ae.stopPropagation(),children:i.jsx(md,{fullTitle:e.fullTitle})}):i.jsx("div",{className:"text-[12px] text-bv-text leading-tight truncate",children:i.jsx(md,{fullTitle:e.fullTitle})}),i.jsx("div",{className:"text-[10px] text-bv-muted mt-0.5",children:d.phase==="loading"&&!Y?i.jsx("span",{className:"text-bv-teal",children:"Loading preview…"}):G>0?`${G} props`:null})]}),i.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[i.jsx("button",{type:"button",className:`h-5.5 rounded px-2 text-[10px] font-medium border transition-all cursor-pointer ${p?"border-[#555] text-bv-text bg-bv-surface-hi":"border-bv-border text-bv-text-mid bg-bv-surface hover:border-[#555] hover:text-bv-text hover:bg-bv-surface-hi"}`,onClick:j,children:p?"▲ Collapse":"Customize"}),i.jsx("button",{type:"button",className:`h-5.5 rounded px-2 text-[10px] font-medium border transition-all cursor-pointer ${Gn}`,onClick:J,children:t?$:_e})]})]}),p&&i.jsxs("div",{className:"border border-t-0 border-bv-border rounded-b-md bg-bv-surface overflow-hidden",children:[i.jsx("div",{className:"flex items-center justify-center min-h-20 p-4 border-b border-bv-border overflow-hidden",style:{contain:"paint",...d.storyBackground?{backgroundColor:d.storyBackground}:{}},children:Y&&Ce?i.jsx(wh,{ghostHtml:Y,ghostCss:Ce}):Y?i.jsx("div",{className:"pointer-events-none",dangerouslySetInnerHTML:{__html:Y}}):i.jsx("span",{className:"text-[10px] text-bv-muted",children:"Loading preview…"})}),P&&i.jsxs("div",{className:"px-2.5 py-2",onClick:ae=>ae.stopPropagation(),children:[i.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[i.jsx("span",{className:"text-[9px] font-semibold uppercase tracking-wider text-bv-muted",children:"Props"}),i.jsx("span",{className:"text-[9px] text-bv-muted",children:"Changes re-render live"})]}),i.jsx(Jy,{argTypes:R,args:d.args,onArgsChange:Q})]})]}),q&&i.jsx("adaptive-iframe",{ref:ae=>{w.current=ae,ae&&(ae.style.setProperty("position","absolute","important"),ae.style.setProperty("width","0","important"),ae.style.setProperty("height","0","important"),ae.style.setProperty("opacity","0","important"),ae.style.setProperty("pointer-events","none","important"),ae.style.setProperty("overflow","hidden","important"))}})]})}function md({fullTitle:e}){const t=e.split("/");if(t.length===1)return i.jsx("span",{className:"font-semibold",children:t[0]});const n=t.slice(0,-1),r=t.at(-1);return i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-bv-muted font-normal",children:n.join(" / ")}),i.jsx("span",{className:"text-bv-muted font-normal",children:" / "}),i.jsx("span",{className:"font-semibold",children:r})]})}function Sh(e){return!e||Object.keys(e).length===0?"":JSON.stringify(e,Object.keys(e).sort())}function gd(e,t){const n=Sh(t);return n?`${e}::${n}`:e}function mx(){const[e,t]=b.useState(!1),n=b.useRef(new Map);b.useEffect(()=>{let s=!1;return fetch("/api/ghost-cache").then(l=>l.json()).then(l=>{if(s)return;const a=new Map;for(const u of l){const c=u.argsHash?`${u.storyId}::${u.argsHash}`:u.storyId;a.set(c,u)}n.current=a,t(!0)}).catch(()=>{s||t(!0)}),()=>{s=!0}},[]);const r=b.useCallback((s,l)=>{const a=gd(s,l),u=n.current.get(a);return u?{ghostHtml:u.ghostHtml,ghostCss:u.ghostCss,hostStyles:u.hostStyles,storyBackground:u.storyBackground,argCount:u.argCount}:null},[]),o=b.useCallback(s=>{const l=gd(s.storyId,s.args),a=n.current.get(l),u=!a||s.argCount!=null&&a.argCount==null;n.current.set(l,{storyId:s.storyId,argsHash:Sh(s.args),ghostHtml:s.ghostHtml,ghostCss:s.ghostCss,hostStyles:s.hostStyles,storyBackground:s.storyBackground,componentName:s.componentName,componentPath:s.componentPath,argCount:s.argCount,extractedAt:Date.now()}),u&&fetch("/api/ghost-cache",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({storyId:s.storyId,args:s.args,ghostHtml:s.ghostHtml,ghostCss:s.ghostCss,hostStyles:s.hostStyles,storyBackground:s.storyBackground,componentName:s.componentName,componentPath:s.componentPath,argCount:s.argCount})}).catch(()=>{})},[]);return{getCachedGhost:r,submitToCache:o,loaded:e}}function js({insertMode:e,hasPageSelection:t,onArmedChange:n}){const{groups:r,loading:o,error:s,refetch:l}=yx(),[a,u]=b.useState(null),[c,f]=b.useState(!1),{getCachedGhost:h,submitToCache:d}=mx(),m=b.useCallback((w,S,p,g)=>{var y;u(w.name),n==null||n(!0),pe("overlay",{type:"COMPONENT_ARM",componentName:w.name,storyId:((y=w.stories[0])==null?void 0:y.id)??"",ghostHtml:S,ghostCss:p,componentPath:w.componentPath,args:g,insertMode:e==="replace"?"replace":void 0})},[e,n]),v=b.useCallback(()=>{u(null),n==null||n(!1),pe("overlay",{type:"COMPONENT_DISARM"})},[n]);return b.useEffect(()=>wl(w=>{w.type==="COMPONENT_DISARMED"&&(u(null),f(!1),n==null||n(!1))}),[n]),b.useEffect(()=>{if(!a&&!c)return;const w=()=>{u(null),f(!1),n==null||n(!1),pe("overlay",{type:"COMPONENT_DISARM"})};return document.addEventListener("click",w),()=>document.removeEventListener("click",w)},[a,c,n]),i.jsxs("div",{className:"p-3 flex flex-col gap-3",children:[i.jsxs("button",{type:"button",onClick:w=>{if(w.stopPropagation(),c){f(!1),pe("overlay",{type:"COMPONENT_DISARM"});return}f(!0),pe("overlay",{type:"INSERT_DESIGN_CANVAS",insertMode:e==="replace"?"replace":"after"})},className:`flex items-center gap-2.5 px-3 py-2 rounded-md border transition-all cursor-pointer text-left ${c?"border-bv-teal bg-bv-teal/10 ring-1 ring-bv-teal":"border-bv-border bg-bv-surface hover:border-bv-teal hover:bg-bv-teal/5"}`,children:[i.jsx("div",{className:"w-8 h-8 rounded bg-bv-teal/10 text-bv-teal flex items-center justify-center shrink-0",children:i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:[i.jsx("path",{d:"M15 1H1v14h14V1ZM0 0h16v16H0V0Z"}),i.jsx("path",{d:"M4 8h8M8 4v8",stroke:"currentColor",strokeWidth:"1.5",fill:"none"})]})}),i.jsxs("div",{className:"flex flex-col min-w-0",children:[i.jsx("span",{className:"text-[11px] font-medium text-bv-text",children:"Draw / Screenshot Canvas"}),i.jsx("span",{className:"text-[10px] text-bv-muted",children:"Freehand drawing or annotate a screenshot"})]})]}),i.jsxs("div",{className:"flex flex-col gap-1.5",children:[o&&i.jsx("div",{className:"text-[11px] text-bv-muted",children:"Loading components…"}),!o&&s&&i.jsx(gx,{onConnected:l}),!o&&!s&&r.length===0&&i.jsx("div",{className:"text-[11px] text-bv-muted",children:"No stories found."}),!o&&!s&&r.length>0&&i.jsx("ul",{className:"flex flex-col gap-2",children:r.map(w=>{var g;const S=(g=w.stories[0])==null?void 0:g.id,p=S?h(S):null;return i.jsx(hx,{group:w,isArmed:a===w.name,onArm:(y,x,k)=>m(w,y,x,k),onDisarm:v,cachedGhostHtml:p==null?void 0:p.ghostHtml,cachedGhostCss:p==null?void 0:p.ghostCss,cachedHostStyles:p==null?void 0:p.hostStyles,cachedStoryBackground:p==null?void 0:p.storyBackground,cachedArgCount:p==null?void 0:p.argCount,onGhostExtracted:d,insertMode:e,hasPageSelection:t},w.name)})})]})]})}function gx({onConnected:e}){const[t,n]=b.useState(""),[r,o]=b.useState(!1),[s,l]=b.useState(!1),a=async u=>{o(!0),l(!1);try{const c=u!=null?{port:u}:{};(await(await fetch("/api/storybook-reconnect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)})).json()).ok?e():l(!0)}catch{l(!0)}finally{o(!1)}};return i.jsxs("div",{className:"text-[11px] text-bv-text-mid leading-relaxed flex flex-col gap-2",children:[i.jsx("span",{children:"Storybook not detected."}),i.jsx("button",{onClick:()=>a(),disabled:r,className:"self-start px-2.5 py-1 rounded bg-bv-surface-hi text-bv-text text-[11px] border border-bv-border hover:border-bv-teal disabled:opacity-50 transition-colors",children:r?"Scanning…":"Scan for Storybook"}),i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:"text-bv-muted",children:"or port:"}),i.jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",placeholder:"6006",value:t,onChange:u=>{n(u.target.value),l(!1)},onKeyDown:u=>{u.key==="Enter"&&t&&a(Number(t))},className:"w-16 px-1.5 py-0.5 rounded bg-bv-surface text-bv-text text-[11px] border border-bv-border focus:border-bv-teal outline-none"}),i.jsx("button",{onClick:()=>t&&a(Number(t)),disabled:!t||r,className:"px-2 py-0.5 rounded bg-bv-surface-hi text-bv-text text-[11px] border border-bv-border hover:border-bv-teal disabled:opacity-50 transition-colors",children:"Connect"})]}),s&&i.jsxs("span",{className:"text-bv-orange text-[10px]",children:["No Storybook found",t?` on port ${t}`:"",". Is it running?"]})]})}function yx(){const[e,t]=b.useState([]),[n,r]=b.useState(!0),[o,s]=b.useState(!1),[l,a]=b.useState(0),u=b.useCallback(()=>{r(!0),s(!1),t([]),a(c=>c+1)},[]);return b.useEffect(()=>{let c=!1;return(async()=>{var f,h;try{const d=await fetch("/api/storybook-data").then(v=>v.json());if(!d.available){c||(s(!0),r(!1));return}const m=Object.values(((f=d.index)==null?void 0:f.entries)??((h=d.index)==null?void 0:h.stories)??{});c||t(xx(m,d.argTypes??{}))}catch{c||s(!0)}finally{c||r(!1)}})(),()=>{c=!0}},[l]),{groups:e,loading:n,error:o,refetch:u}}function xx(e,t={}){const n=new Map;for(const o of e){if(o.type==="docs"||o.id.endsWith("--docs"))continue;const s=o.title.split("/").at(-1)??o.title;n.has(s)||n.set(s,[]),n.get(s).push(o)}const r=Array.from(n.entries()).map(([o,s])=>{var a,u;const l=new Set;for(const c of s)for(const f of c.tags??[])l.add(f);return{name:o,fullTitle:((a=s[0])==null?void 0:a.title)??o,tags:Array.from(l),stories:s,argTypes:t[o]??vx(s),componentPath:(u=s[0])==null?void 0:u.componentPath}});return r.sort((o,s)=>{const l=o.tags.includes("design-system")?0:1,a=s.tags.includes("design-system")?0:1;return l!==a?l-a:o.name.localeCompare(s.name)}),r}function vx(e){const t={};for(const n of e)for(const[r,o]of Object.entries(n.argTypes??{}))r in t||(t[r]=o);return t}const Pi="w-[30px] h-7 rounded-[4px] border-none flex items-center justify-center cursor-pointer transition-all duration-[120ms] ease-out",bx="bg-[#00464A] text-[#5fd4da] shadow-[0_1px_3px_rgba(0,0,0,0.3)]",wx="bg-[#F5532D]/15 text-[#F5532D] shadow-[0_1px_3px_rgba(0,0,0,0.3)]",yd="bg-transparent text-[#999] hover:text-[#b3b3b3]";function Ii(e,t,n){return e?t?wx:n?bx:yd:yd}function Ts({mode:e,onModeChange:t,isPicking:n=!1,isEngaged:r=!1}){return i.jsxs("div",{className:"inline-flex items-center rounded-[6px] bg-[#1a1a1a] p-[2px] gap-[1px]",children:[i.jsx("button",{type:"button",onClick:()=>t("select"),className:`${Pi} ${Ii(e==="select",e==="select"&&n,e==="select"&&r)}`,"aria-pressed":e==="select",title:"Select an element",children:i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"currentColor",children:[i.jsx("path",{d:"M14,0H2C.895,0,0,.895,0,2V14c0,1.105,.895,2,2,2H6c.552,0,1-.448,1-1h0c0-.552-.448-1-1-1H2V2H14V6c0,.552,.448,1,1,1h0c.552,0,1-.448,1-1V2c0-1.105-.895-2-2-2Z"}),i.jsx("path",{d:"M12.043,10.629l2.578-.644c.268-.068,.43-.339,.362-.607-.043-.172-.175-.308-.345-.358l-7-2c-.175-.051-.363-.002-.492,.126-.128,.129-.177,.317-.126,.492l2,7c.061,.214,.257,.362,.48,.362h.009c.226-.004,.421-.16,.476-.379l.644-2.578,3.664,3.664c.397,.384,1.03,.373,1.414-.025,.374-.388,.374-1.002,0-1.389l-3.664-3.664Z"})]})}),i.jsx("button",{type:"button",onClick:()=>t("insert"),className:`${Pi} ${Ii(e==="insert",e==="insert"&&n,e==="insert"&&r)}`,"aria-pressed":e==="insert",title:"Insert to add content",children:i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"square",strokeLinejoin:"miter",children:[i.jsx("rect",{x:"4",y:"2",width:"16",height:"8",rx:"2"}),i.jsx("path",{d:"m17,14h1c1.105,0,2,.895,2,2"}),i.jsx("path",{d:"m4,16c0-1.105.895-2,2-2h1"}),i.jsx("path",{d:"m7,22h-1c-1.105,0-2-.895-2-2"}),i.jsx("path",{d:"m20,20c0,1.105-.895,2-2,2h-1"}),i.jsx("line",{x1:"13",y1:"14",x2:"11",y2:"14"}),i.jsx("line",{x1:"13",y1:"22",x2:"11",y2:"22"})]})}),i.jsx("button",{type:"button",onClick:()=>t("bug-report"),className:`${Pi} ${Ii(e==="bug-report",!1)}`,"aria-pressed":e==="bug-report",title:"Report a bug",children:i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"currentColor",children:[i.jsx("path",{d:"M11.5,6C11.5,4.067,9.933,2.5,8,2.5S4.5,4.067,4.5,6v1h7V6Z"}),i.jsx("rect",{x:"3",y:"8",width:"10",height:"6",rx:"2"}),i.jsx("path",{d:"M1,5.5h2.2C3.07,5.01,3,4.51,3,4h0V3.5H1c-.552,0-1,.448-1,1S.448,5.5,1,5.5Z"}),i.jsx("path",{d:"M15,3.5h-2c0,.51-.07,1.01-.2,1.5H15c.552,0,1-.448,1-1s-.448-1-1-1Z"}),i.jsx("path",{d:"M1,11.5h2.05c.232,.89,.62,1.71,1.13,2.5H1c-.552,0-1-.448-1-1s.448-1,1-1h0Z"}),i.jsx("path",{d:"M15,10.5h-2.05c-.232,.89-.62,1.71-1.13,2.5h3.18c.552,0,1-.448,1-1s-.448-1-1-1Z"}),i.jsx("path",{d:"M1,7.5h2v2H1c-.552,0-1-.448-1-1s.448-1,1-1Z"}),i.jsx("path",{d:"M13,7.5h2c.552,0,1,.448,1,1s-.448,1-1,1h-2v-2Z"}),i.jsx("rect",{x:"7",y:"9",width:"2",height:"4",rx:".5"})]})})]})}function Sx(e){var c,f;const n=`<${((c=e.component)==null?void 0:c.name)??"component"}>`,r="insertMode"in e?e.insertMode:void 0,o="targetComponentName"in e&&e.targetComponentName||"parentComponent"in e&&((f=e.parentComponent)==null?void 0:f.name)||null,s=o||e.elementKey||null,l=o?`<${s}>`:s,a="targetPatchId"in e&&!!e.targetPatchId,u=l&&a?`new ${l}`:l;switch(r){case"after":return u?`Appended ${n} after ${u}`:`Appended ${n}`;case"before":return u?`Prepended ${n} before ${u}`:`Prepended ${n}`;case"last-child":return u?`Inserted ${n} bottom of ${u}`:`Inserted ${n}`;case"first-child":return u?`Inserted ${n} top of ${u}`:`Inserted ${n}`;default:return u?`Inserted ${n} in ${u}`:`Inserted ${n}`}}function xd(e,t){const n=e.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();return n.length>t?n.slice(0,t)+"…":n}function Ns({label:e,count:t,items:n,activeColor:r,dotColor:o,onCommit:s,onDiscard:l,onCommitAll:a,onDiscardAll:u}){const[c,f]=b.useState(!1),h=b.useRef(null),d=b.useRef(null),[m,v]=b.useState(void 0);b.useEffect(()=>{if(!c||!d.current)return;const g=d.current.getBoundingClientRect(),y=220,x=window.innerWidth,k=4;let C=g.left+g.width/2-y/2;C=Math.max(k,Math.min(C,x-y-k)),v(C-g.left)},[c]),b.useEffect(()=>{if(!c)return;function p(g){h.current&&!h.current.contains(g.target)&&f(!1)}return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[c]),b.useEffect(()=>{if(!c)return;function p(g){g.key==="Escape"&&f(!1)}return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[c]);const w=t>0,S=s||l||a||u;return i.jsxs("div",{ref:h,className:"relative",children:[i.jsxs("button",{ref:d,className:`flex items-center gap-1 text-[11px] tabular-nums border-none bg-transparent cursor-pointer px-0 py-0 ${w?`${r} font-medium`:"text-bv-muted"} ${w?"hover:underline":""}`,onClick:()=>w&&f(!c),disabled:!w,type:"button",children:[o&&i.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${o}`}),t," ",e]}),c&&i.jsxs("div",{className:"absolute bottom-full mb-1 min-w-[220px] max-w-[calc(100vw-24px)] w-max bg-bv-surface border border-bv-border rounded-lg shadow-lg overflow-hidden flex flex-col z-[9999]",style:m!==void 0?{left:`${m}px`}:void 0,children:[i.jsxs("div",{className:"px-3 py-1.5 border-b border-bv-border text-[11px] font-semibold text-bv-text-mid uppercase tracking-wide",children:[e," (",t,")"]}),i.jsx("div",{className:"flex-1 overflow-auto",children:n.length===0?i.jsx("div",{className:"px-3 py-2 text-[11px] text-bv-muted italic",children:"No patches"}):n.map(p=>{var T,E,A;const g="kind"in p&&p.kind==="message",y="kind"in p&&p.kind==="design",x="kind"in p&&p.kind==="component-drop",k="kind"in p&&p.kind==="text-change",C="kind"in p&&p.kind==="bug-report";return i.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 border-b border-bv-border last:border-b-0 group",children:[i.jsxs("div",{className:"flex-1 min-w-0",children:[!g&&!y&&!x&&!k&&!C&&((T=p.component)==null?void 0:T.name)&&i.jsx("div",{className:"text-[10px] text-bv-muted truncate",children:p.component.name}),C?i.jsxs("div",{className:"text-[11px] text-bv-text",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("span",{children:"🐛"}),i.jsx("span",{className:"font-semibold",children:"Bug Report"})]}),"bugDescription"in p&&p.bugDescription&&i.jsx("div",{className:"text-[10px] text-bv-muted mt-0.5 whitespace-pre-wrap break-words line-clamp-3",children:p.bugDescription.slice(0,200)})]}):x?i.jsx("div",{className:"text-[11px] text-bv-text truncate",children:Sx(p)}):y?i.jsxs("div",{className:"text-[11px] text-bv-text",children:[i.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[i.jsx("span",{children:"✏️"}),i.jsxs("span",{className:"truncate",children:["Drawing",(E=p.component)!=null&&E.name?` in ${p.component.name}`:""]})]}),"image"in p&&p.image&&i.jsx("img",{src:p.image,alt:"Design drawing",className:"max-w-full max-h-16 object-contain rounded border border-bv-border bg-white"})]}):g?i.jsxs("div",{className:"text-[11px] text-bv-text truncate",children:[i.jsx("span",{className:"mr-1",children:"💬"}),'"',"message"in p&&p.message||"",'"']}):k?i.jsxs("div",{className:"text-[11px] text-bv-text",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("span",{children:"✏️"}),i.jsxs("span",{className:"truncate",children:["Text edit",(A=p.component)!=null&&A.name?` in ${p.component.name}`:""]})]}),"originalHtml"in p&&p.originalHtml&&"newHtml"in p&&p.newHtml&&i.jsxs("div",{className:"mt-0.5 text-[10px] font-mono text-bv-muted break-words",children:[i.jsx("span",{className:"line-through",children:xd(p.originalHtml,30)})," → ",i.jsx("span",{className:"text-bv-teal",children:xd(p.newHtml,30)})]})]}):i.jsx("div",{className:"text-[11px] font-mono text-bv-text truncate",children:p.originalClass?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"line-through text-bv-muted",children:p.originalClass})," → ",i.jsx("span",{className:"text-bv-teal",children:p.newClass})]}):i.jsxs("span",{className:"text-bv-teal",children:["+",p.newClass]})})]}),(s||l)&&i.jsxs("div",{className:"flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:[s&&i.jsx("button",{className:"text-[10px] px-1.5 py-0.5 rounded border-none cursor-pointer bg-bv-teal text-white hover:bg-bv-teal-dark transition-colors",onClick:I=>{I.stopPropagation(),s(p.id)},title:"Commit to Agent",type:"button",children:"✓"}),l&&i.jsx("button",{className:"text-[10px] px-1.5 py-0.5 rounded border-none cursor-pointer bg-transparent text-bv-muted hover:text-bv-orange hover:bg-bv-surface-hi transition-colors",onClick:I=>{I.stopPropagation(),l(p.id)},title:"Discard",type:"button",children:"✕"})]})]},p.id)})}),S&&n.length>0&&(a||u)&&i.jsxs("div",{className:"flex gap-2 px-3 py-1.5 border-t border-bv-border",children:[a&&i.jsx("button",{className:"text-[10px] px-2 py-1 rounded border-none cursor-pointer font-semibold bg-bv-teal text-white hover:bg-bv-teal-dark transition-colors",onClick:()=>{a(),f(!1)},type:"button",children:"Commit All"}),u&&i.jsx("button",{className:"text-[10px] px-2 py-1 rounded cursor-pointer font-semibold bg-transparent border border-bv-border text-bv-text-mid hover:text-bv-orange hover:border-bv-orange transition-colors",onClick:()=>{u(),f(!1)},type:"button",children:"Discard All"})]})]})]})}function Cx(e){return e==="click"||e==="navigation"||e==="page-load"||e==="error"}function vd(e){const t=[];let n=null;for(const r of e)Cx(r.trigger)?(n={primary:r,secondaries:bd(r),checked:!1},t.push(n)):n?kx(n,r):(n={primary:{...r,trigger:r.trigger},secondaries:bd(r),checked:!1},t.push(n));return t}function bd(e){const t=[];return e.trigger==="mutation"&&t.push({type:"mutations",label:"1 mutation",checked:!0,count:1}),e.isKeyframe&&t.push({type:"screenshot",label:"screenshot",checked:!0}),e.networkErrorCount>0&&t.push({type:"network",label:`${e.networkErrorCount} network error${e.networkErrorCount>1?"s":""}`,checked:!0,count:e.networkErrorCount}),e.consoleErrorCount>0&&t.push({type:"logs",label:`${e.consoleErrorCount} log${e.consoleErrorCount>1?"s":""} (${e.consoleErrorCount} error${e.consoleErrorCount>1?"s":""})`,checked:!0,count:e.consoleErrorCount,errorCount:e.consoleErrorCount}),t}function kx(e,t){const n=e.secondaries.find(r=>r.type==="mutations");if(t.trigger==="mutation"&&(n?(n.count=(n.count??0)+1,n.label=`${n.count} mutation${n.count>1?"s":""}`):e.secondaries.push({type:"mutations",label:"1 mutation",checked:!0,count:1})),t.isKeyframe&&!e.secondaries.some(r=>r.type==="screenshot")&&e.secondaries.push({type:"screenshot",label:"screenshot",checked:!0}),t.networkErrorCount>0){const r=e.secondaries.find(o=>o.type==="network");r?(r.count=(r.count??0)+t.networkErrorCount,r.label=`${r.count} network error${r.count>1?"s":""}`):e.secondaries.push({type:"network",label:`${t.networkErrorCount} network error${t.networkErrorCount>1?"s":""}`,checked:!0,count:t.networkErrorCount})}if(t.consoleErrorCount>0){const r=e.secondaries.find(o=>o.type==="logs");r?(r.count=(r.count??0)+t.consoleErrorCount,r.errorCount=(r.errorCount??0)+t.consoleErrorCount,r.label=`${r.count} log${r.count>1?"s":""} (${r.errorCount} error${r.errorCount>1?"s":""})`):e.secondaries.push({type:"logs",label:`${t.consoleErrorCount} log${t.consoleErrorCount>1?"s":""} (${t.consoleErrorCount} error${t.consoleErrorCount>1?"s":""})`,checked:!0,count:t.consoleErrorCount,errorCount:t.consoleErrorCount})}}function Ex(e,t){const n=(new Date(t).getTime()-new Date(e).getTime())/1e3;if(Math.abs(n)<1)return"0s";const r=Math.round(Math.abs(n));return r>=120?`−${Math.round(r/60)}m`:`−${r}s`}function _i(e){return new Date(e).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}const wd={click:"bg-[rgba(0,132,139,0.15)] text-[#5fd4da]",navigation:"bg-[rgba(168,85,247,0.12)] text-[#c084fc]","page-load":"bg-[rgba(59,130,246,0.12)] text-[#60a5fa]",error:"bg-[rgba(239,68,68,0.12)] text-[#f87171]",mutation:"bg-[rgba(255,255,255,0.06)] text-[#999]"};function jx({trigger:e}){const t=wd[e]??wd.mutation;return i.jsx("span",{className:`text-[9px] px-1.5 rounded-[3px] font-semibold tracking-[0.2px] mr-1.5 shrink-0 leading-[1.4] ${t}`,children:e})}function Tx({checked:e,onChange:t}){return i.jsx("button",{type:"button",onClick:n=>{n.stopPropagation(),t()},className:`w-4 h-4 rounded-[3px] border-[1.5px] flex items-center justify-center shrink-0 cursor-pointer transition-all duration-[120ms] mr-2 ${e?"border-[#00848B] bg-[rgba(0,132,139,0.12)] text-[#00848B]":"border-[#666] bg-transparent text-transparent"}`,children:e&&i.jsx("span",{className:"text-[9px]",children:"✓"})})}function Nx({checked:e,visible:t,onChange:n}){return t?i.jsx("button",{type:"button",onClick:r=>{r.stopPropagation(),n()},className:`w-3.5 h-3.5 rounded-[3px] border-[1.5px] flex items-center justify-center shrink-0 cursor-pointer transition-all duration-[120ms] mr-1.5 ${e?"border-[#00848B] bg-[rgba(0,132,139,0.12)] text-[#00848B]":"border-[#666] bg-transparent text-transparent"}`,children:e&&i.jsx("span",{className:"text-[8px]",children:"✓"})}):i.jsx("div",{className:"w-3.5 h-3.5 mr-1.5 shrink-0"})}function Rx({onSubmit:e}){const[t,n]=b.useState([]),[r,o]=b.useState(""),[s,l]=b.useState(null),[a,u]=b.useState(!1),[c,f]=b.useState(!1),h=b.useRef(null),d=b.useRef(null);b.useEffect(()=>(pe("overlay",{type:"RECORDING_GET_HISTORY"}),wl(k=>{if(k.type==="RECORDING_HISTORY"){const C=vd(k.snapshots),T=Math.max(0,C.length-3);for(let E=T;E<C.length;E++)C[E].checked=!0;n(C)}else k.type==="RECORDING_SNAPSHOT_META"?n(C=>{const T=Px(C);return T.push(k.meta),vd(T)}):k.type==="BUG_REPORT_ELEMENT_PICKED"?(l(k.element),u(!1)):k.type==="BUG_REPORT_PICK_CANCELLED"&&u(!1)})),[]),b.useEffect(()=>{h.current&&(h.current.scrollTop=h.current.scrollHeight)},[t.length]);const m=b.useCallback((x,k)=>{n(C=>{const T=C.map(E=>({...E,secondaries:E.secondaries.map(A=>({...A}))}));if(k&&d.current!==null){const E=Math.min(d.current,x),A=Math.max(d.current,x);for(let I=E;I<=A;I++)T[I].checked=!0,T[I].secondaries.forEach(L=>{L.checked=!0})}else T[x].checked=!T[x].checked,T[x].checked&&T[x].secondaries.forEach(E=>{E.checked=!0});return d.current=x,T})},[]),v=b.useCallback((x,k)=>{n(C=>{const T=C.map(E=>({...E,secondaries:E.secondaries.map(A=>({...A}))}));return T[x].secondaries[k].checked=!T[x].secondaries[k].checked,T})},[]),w=()=>{a?(pe("overlay",{type:"BUG_REPORT_PICK_CANCELLED"}),u(!1)):(pe("overlay",{type:"BUG_REPORT_PICK_ELEMENT"}),u(!0))},S=t.filter(x=>x.checked).length,p=S>0&&r.trim().length>0&&!c,g=async()=>{var H,Q,J;if(!p)return;f(!0);const x=t.filter(j=>j.checked).map(j=>j.primary.id);pe("overlay",{type:"RECORDING_GET_RANGE",ids:x});const C=await new Promise(j=>{const R=wl(P=>{P.type==="RECORDING_RANGE"&&(R(),j(P.snapshots))});setTimeout(()=>{R(),j([])},1e4)}),T=t.filter(j=>j.checked),E=T.some(j=>j.secondaries.some(R=>R.type==="screenshot"&&R.checked)),A=T.some(j=>j.secondaries.some(R=>R.type==="logs"&&R.checked)),I=T.some(j=>j.secondaries.some(R=>R.type==="network"&&R.checked)),L=[],B=[];for(const j of C){const R={timestamp:j.timestamp,trigger:j.trigger,url:j.url};A&&((H=j.consoleLogs)!=null&&H.length)&&(R.consoleLogs=j.consoleLogs),I&&((Q=j.networkErrors)!=null&&Q.length)&&(R.networkErrors=j.networkErrors),j.domSnapshot&&(R.domSnapshot=j.domSnapshot.slice(0,5e4)),j.domDiff&&(R.domDiff=j.domDiff.slice(0,1e4)),(J=j.domChanges)!=null&&J.length&&(R.domChanges=j.domChanges),E&&j.screenshot&&(B.push(j.screenshot),R.hasScreenshot=!0),j.elementInfo&&(R.elementInfo=j.elementInfo),j.navigationInfo&&(R.navigationInfo=j.navigationInfo),L.push(R)}const K=T.map(j=>j.primary.timestamp),D={start:K[0]??new Date().toISOString(),end:K[K.length-1]??new Date().toISOString()};e({bugDescription:r.trim(),bugScreenshots:E?B.slice(0,5):[],bugTimeline:L,bugTimeRange:D,bugElement:s}),o(""),l(null),n(j=>j.map(R=>({...R,checked:!1,secondaries:R.secondaries.map(P=>({...P,checked:!0}))}))),f(!1)},y=t.length>0?t[t.length-1].primary.timestamp:new Date().toISOString();return i.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[i.jsx("div",{ref:h,className:"flex-1 overflow-y-auto border-b border-bv-border",children:t.length===0?i.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 p-8 text-center",children:[i.jsx("div",{className:"text-[11px] text-bv-muted",children:"No recording events yet"}),i.jsx("div",{className:"text-[10px] text-bv-muted/60",children:"Interact with the page to start recording events."})]}):t.map((x,k)=>i.jsxs("div",{className:`border-b border-white/[0.03] ${x.checked?"bg-[rgba(0,132,139,0.12)] border-l-2 border-l-[#00848B]":""}`,children:[i.jsxs("div",{className:"flex items-center px-2.5 py-1.5 cursor-pointer hover:bg-white/[0.025] transition-colors duration-[120ms]",onClick:C=>m(k,C.shiftKey),children:[i.jsx("span",{className:"w-9 shrink-0 text-right pr-1.5 font-mono text-[10px] text-bv-muted font-medium",title:_i(x.primary.timestamp),children:k===t.length-1?"0s":Ex(x.primary.timestamp,y)}),i.jsx(Tx,{checked:x.checked,onChange:()=>m(k,!1)}),i.jsx(jx,{trigger:x.primary.trigger}),i.jsxs("span",{className:"text-[11px] text-bv-text flex-1 min-w-0 truncate",children:[x.primary.trigger==="click"&&x.primary.elementInfo&&i.jsxs(i.Fragment,{children:["on ",i.jsxs("span",{className:"font-mono text-[10px] text-bv-text-mid",children:["<",x.primary.elementInfo.tag,">"]}),x.primary.elementInfo.componentName&&i.jsxs(i.Fragment,{children:[" ","in ",i.jsxs("span",{className:"font-mono text-[10px] text-bv-text-mid",children:["<",x.primary.elementInfo.componentName,">"]})]})]}),x.primary.trigger==="page-load"&&i.jsx("span",{className:"font-mono text-[10px] text-bv-text-mid",children:x.primary.url}),x.primary.trigger==="navigation"&&i.jsx("span",{className:"font-mono text-[10px] text-bv-text-mid",children:x.primary.url}),x.primary.trigger==="error"&&i.jsxs("span",{className:"text-[#f87171]",children:[x.primary.consoleErrorCount," error",x.primary.consoleErrorCount>1?"s":""]})]}),x.primary.isKeyframe&&i.jsx("span",{className:"text-[8px] text-[#00848B] font-bold ml-1 shrink-0",children:"◆"})]}),x.secondaries.map((C,T)=>i.jsxs("div",{className:`flex items-center px-2.5 py-0.5 transition-opacity duration-[120ms] ${x.checked&&!C.checked?"opacity-30":""} ${T===x.secondaries.length-1?"pb-[5px]":""}`,children:[i.jsx("span",{className:"w-9 shrink-0"}),i.jsx("span",{className:"w-3 shrink-0"}),i.jsx(Nx,{checked:C.checked,visible:x.checked,onChange:()=>v(k,T)}),i.jsxs("span",{className:`text-[10px] text-bv-text-mid flex-1 min-w-0 truncate ${x.checked&&!C.checked?"line-through decoration-white/25":""}`,children:[C.type==="network"&&C.networkStatus&&i.jsxs("span",{className:`font-bold ${C.networkStatus>=400?"text-[#ef4444]":"text-[#2E7229]"}`,children:[C.networkStatus," "]}),C.type==="logs"&&C.errorCount&&C.errorCount>0&&i.jsxs("span",{className:"text-[#f87171] font-semibold",children:[C.errorCount," error",C.errorCount>1?"s":""," "]}),C.label]})]},`${x.primary.id}-${C.type}-${T}`))]},x.primary.id))}),i.jsxs("div",{className:"px-3 py-2.5 flex flex-col gap-2",children:[i.jsxs("div",{className:"text-[10px] text-bv-text-mid",children:[i.jsx("span",{className:"font-bold text-[#00848B]",children:S})," event",S!==1?"s":""," selected",S>0&&(()=>{const x=t.filter(T=>T.checked),k=_i(x[0].primary.timestamp),C=_i(x[x.length-1].primary.timestamp);return i.jsxs("span",{className:"text-bv-muted font-mono text-[9px] ml-1.5",children:[k," – ",C]})})()]}),i.jsx("textarea",{value:r,onChange:x=>o(x.target.value),placeholder:"Describe the bug…",className:"w-full min-h-[48px] max-h-[140px] px-2.5 py-2 rounded-md border border-bv-border bg-bv-surface text-bv-text text-[11px] leading-[1.5] resize-none outline-none transition-colors duration-[120ms] focus:border-[#00848B] placeholder:text-[#666] overflow-y-auto",style:{fieldSizing:"content"}}),i.jsx("div",{className:"flex items-center gap-1.5",children:s?i.jsxs("div",{className:"flex items-center gap-1 flex-1 min-w-0 px-2 py-1 rounded bg-bv-surface border border-bv-border font-mono text-[10px] text-bv-text",children:[i.jsxs("span",{className:"text-[#00848B] font-semibold",children:["<",s.tag,">"]}),s.id&&i.jsxs("span",{className:"text-bv-muted",children:["#",s.id]}),s.componentName&&i.jsx("span",{className:"text-[9px] text-bv-text-mid bg-[rgba(0,132,139,0.1)] px-1 rounded-[2px] font-medium font-sans",children:s.componentName}),i.jsx("button",{type:"button",onClick:()=>l(null),className:"w-3.5 h-3.5 rounded-[3px] border-none bg-white/[0.08] text-bv-muted text-[9px] flex items-center justify-center cursor-pointer ml-auto hover:bg-white/15 hover:text-bv-text",children:"✕"})]}):i.jsxs("button",{type:"button",onClick:w,className:`flex items-center gap-[5px] px-2.5 py-[5px] rounded-md border border-dashed text-[10px] font-medium cursor-pointer transition-all duration-[120ms] whitespace-nowrap ${a?"border-[#00848B] text-[#00848B] bg-[rgba(0,132,139,0.12)]":"border-bv-border text-bv-text-mid bg-transparent hover:border-[#00848B] hover:text-[#00848B] hover:bg-[rgba(0,132,139,0.12)]"}`,children:[i.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"currentColor",className:"shrink-0",children:[i.jsx("path",{d:"M14,0H2C.895,0,0,.895,0,2V14c0,1.105,.895,2,2,2H6c.552,0,1-.448,1-1h0c0-.552-.448-1-1-1H2V2H14V6c0,.552,.448,1,1,1h0c.552,0,1-.448,1-1V2c0-1.105-.895-2-2-2Z"}),i.jsx("path",{d:"M12.043,10.629l2.578-.644c.268-.068,.43-.339,.362-.607-.043-.172-.175-.308-.345-.358l-7-2c-.175-.051-.363-.002-.492,.126-.128,.129-.177,.317-.126,.492l2,7c.061,.214,.257,.362,.48,.362h.009c.226-.004,.421-.16,.476-.379l.644-2.578,3.664,3.664c.397,.384,1.03,.373,1.414-.025,.374-.388,.374-1.002,0-1.389l-3.664-3.664Z"})]}),a?"Click an element…":"Pick Element"]})}),i.jsxs("button",{type:"button",onClick:g,disabled:!p,className:`flex items-center justify-center gap-1.5 w-full py-2 rounded-md border-none text-[11px] font-semibold cursor-pointer transition-all duration-[120ms] ${p?"bg-[#F5532D] text-white hover:bg-[#e04420]":"bg-bv-surface text-[#555] cursor-not-allowed"}`,children:[i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"currentColor",children:[i.jsx("path",{d:"M11.5,6C11.5,4.067,9.933,2.5,8,2.5S4.5,4.067,4.5,6v1h7V6Z"}),i.jsx("rect",{x:"3",y:"8",width:"10",height:"6",rx:"2"}),i.jsx("path",{d:"M1,7.5h2v2H1c-.552,0-1-.448-1-1s.448-1,1-1Z"}),i.jsx("path",{d:"M13,7.5h2c.552,0,1,.448,1,1s-.448,1-1,1h-2v-2Z"}),i.jsx("rect",{x:"7",y:"9",width:"2",height:"4",rx:".5"})]}),"Commit Bug Report"]})]})]})}function Px(e){return e.map(t=>t.primary)}function Sd({tabs:e,activeTab:t,onTabChange:n}){const[r,o]=b.useState(null);return i.jsx("div",{className:"relative flex border-b border-bv-border px-3",children:e.map(s=>{const l=s.id===t,a=s.disabled===!0;return i.jsxs("div",{className:"relative",onMouseEnter:()=>a&&s.tooltip&&o(s.id),onMouseLeave:()=>o(null),children:[i.jsxs("button",{type:"button",className:`relative px-3 py-2 text-[11px] font-medium font-[family-name:var(--font-ui)] border-none bg-transparent cursor-pointer transition-colors ${a?"text-bv-muted cursor-not-allowed":l?"text-bv-text":"text-bv-text-mid hover:text-bv-text"}`,disabled:a,onClick:()=>!a&&n(s.id),"aria-selected":l,role:"tab",children:[s.label,l&&i.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-[2px] bg-bv-teal"})]}),r===s.id&&s.tooltip&&i.jsx("div",{className:"absolute top-full left-1/2 -translate-x-1/2 mt-1 px-2 py-1 text-[10px] text-white bg-bv-text rounded whitespace-nowrap z-[9999]",children:s.tooltip})]},s.id)})})}function Ix(){const[e,t]=b.useState([]),[n,r]=b.useState({draft:0,committed:0,implementing:0,implemented:0,partial:0,error:0}),[o,s]=b.useState({draft:[],commits:[]}),[l,a]=b.useState(!1),u=b.useRef(e);u.current=e;const c=b.useRef(o);c.current=o;const f=b.useCallback((E,A)=>{pe("overlay",{type:"PATCH_PREVIEW",oldClass:E,newClass:A})},[]),h=b.useCallback(E=>{pe("overlay",{type:"PATCH_PREVIEW_BATCH",pairs:E})},[]),d=b.useCallback(()=>{pe("overlay",{type:"PATCH_REVERT"})},[]),m=b.useCallback((E,A,I,L)=>{if(L===I){t(K=>{const D=K.find(H=>H.kind==="class-change"&&H.elementKey===E&&H.property===A);return D&&D.kind==="class-change"&&D.newClass!==I?pe("overlay",{type:"PATCH_REVERT_STAGED",oldClass:D.newClass,newClass:I}):pe("overlay",{type:"PATCH_REVERT"}),K.filter(H=>!(H.kind==="class-change"&&H.elementKey===E&&H.property===A))});return}const B=crypto.randomUUID();t(K=>{const D=K.filter(Q=>!(Q.kind==="class-change"&&Q.elementKey===E&&Q.property===A)),H={id:B,kind:"class-change",elementKey:E,status:"staged",originalClass:I,newClass:L,property:A,timestamp:new Date().toISOString()};return[...D,H]}),pe("overlay",{type:"PATCH_STAGE",id:B,oldClass:I,newClass:L,property:A})},[]),v=b.useCallback((E,A,I)=>{const L=crypto.randomUUID(),B=I?{name:I}:void 0;t(K=>{const D={id:L,kind:"message",elementKey:A,status:"staged",originalClass:"",newClass:"",property:"",timestamp:new Date().toISOString(),message:E,component:B};return[...K,D]}),Nn(B?{type:"MESSAGE_STAGE",id:L,message:E,elementKey:A,component:B}:{type:"MESSAGE_STAGE",id:L,message:E,elementKey:A})},[]),w=b.useCallback(()=>{const E=c.current.draft.map(L=>L.id),A=u.current.filter(L=>L.status==="staged").map(L=>L.id),I=Array.from(new Set([...E,...A]));I.length!==0&&(Nn({type:"PATCH_COMMIT",ids:I}),t([]))},[]),S=b.useCallback(E=>{t(A=>A.filter(I=>I.id!==E)),Nn({type:"DISCARD_DRAFTS",ids:[E]}),pe("overlay",{type:"PATCH_REVERT"})},[]),p=b.useCallback(()=>{const E=c.current.draft.map(L=>L.id),A=u.current.filter(L=>L.status==="staged").map(L=>L.id),I=Array.from(new Set([...E,...A]));t([]),I.length>0&&Nn({type:"DISCARD_DRAFTS",ids:I}),pe("overlay",{type:"PATCH_REVERT"})},[]),g=b.useCallback(E=>{const A=c.current.commits.find(I=>I.status==="committed"&&I.patches.some(L=>L.id===E));A&&Nn({type:"DISCARD_COMMIT",commitId:A.id})},[]),y=b.useCallback(()=>{},[]),x=b.useCallback(E=>{r({draft:E.draftCount,committed:E.committedCount,implementing:E.implementingCount,implemented:E.implementedCount,partial:E.partialCount,error:E.errorCount}),s({draft:E.draft,commits:E.commits}),a(!!E.agentWaiting)},[]),k=b.useCallback(E=>{r({draft:E.staged,committed:E.committed,implementing:E.implementing,implemented:E.implemented,partial:0,error:0})},[]),C=e.filter(E=>E.status==="staged").length,T={draft:Math.max(C,n.draft),committed:n.committed,implementing:n.implementing,implemented:n.implemented,partial:n.partial,error:n.error};return{patches:e,counts:T,queueState:o,agentWaiting:l,preview:f,previewBatch:h,revertPreview:d,stage:m,stageMessage:v,commitAll:w,discard:S,discardAll:p,discardCommit:g,reset:y,handleQueueUpdate:x,handlePatchUpdate:k}}const Zu=["none","2xs","xs","sm","md","lg","xl","2xl"],Ch=["none","2xs","xs","sm"],Ba=["0","1","2","4","8"],qu=["none","2xs","xs","sm","md","lg"],Cl=new Set(Zu),kl=new Set(Ch),eo=new Set(Ba),El=new Set(qu),_x=["text-xs","text-sm","text-base","text-lg","text-xl","text-2xl","text-3xl","text-4xl","text-5xl","text-6xl","text-7xl","text-8xl","text-9xl"],Ax=["font-thin","font-extralight","font-light","font-normal","font-medium","font-semibold","font-bold","font-extrabold","font-black"],Lx=["leading-none","leading-tight","leading-snug","leading-normal","leading-relaxed","leading-loose","leading-3","leading-4","leading-5","leading-6","leading-7","leading-8","leading-9","leading-10"],Dx=["tracking-tighter","tracking-tight","tracking-normal","tracking-wide","tracking-wider","tracking-widest"],Ox=Array.from({length:21},(e,t)=>`opacity-${t*5}`),kh=["none","sm","","md","lg","xl","2xl","3xl","full"],Va=kh.map(e=>e?`rounded-${e}`:"rounded");function Mx(e){return kh.map(t=>t?`${e}-${t}`:e)}const Eh=["0","","2","3","4","5","6","8","10","12","16","20","24","32","40","48","56","64"],$x=["solid","dashed","dotted","double","hidden","none"],Ua=["0","px","0.5","1","1.5","2","2.5","3","3.5","4","5","6","7","8","9","10","11","12","14","16","20","24","28","32","36","40","44","48","52","56","60","64","72","80","96"],zx=["slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"],Fx=["50","100","200","300","400","500","600","700","800","900","950"];function te(){return e=>e===""?{props:{}}:null}function Me(e,t){const n=new Set(t);return r=>n.has(r)?{props:{[e]:r}}:null}function bt(e="color"){return t=>t!==""?{props:{[e]:t}}:null}function Z(e,t="scale"){return n=>n!==""?{props:{[t]:n,scaleName:e}}:null}const Kx=["t","r","b","l","x","y"],Ai=["t","r","b","l","x","y","s","e","bs","be"];function Ae(...e){return t=>{for(const n of e){const r=n(t);if(r)return r}return null}}function F(e,t){return{prefix:e,segment:t}}function Gt(e,t){return t.map(n=>({...n,section:e}))}function Li(e,t,n=Kx){return[...n.map(o=>({prefix:e+o,segment:t,canonical:e,extraProps:{side:o}})),{prefix:e,segment:t}]}function Hx(e,t){const n=["tl","tr","br","bl"],r=["t","r","b","l"],o=n.map(l=>({prefix:e+"-"+l,segment:t,canonical:e,extraProps:{corner:l}})),s=r.map(l=>({prefix:e+"-"+l,segment:t,canonical:e,extraProps:{side:l}}));return[...o,...s,{prefix:e,segment:Ae(te(),t)}]}function Cd(e,t){const n=new Set(t);return{prefix:e,segment:te(),matches:r=>n.has(r)?{props:{value:r}}:null}}function Wx(e,t){for(const n of t){const{prefix:r,matches:o,segment:s,canonical:l,section:a,extraProps:u}=n;if(o){const h=o(e);if(!h)continue;const d={property:l??r,fullClass:e};if(a&&(d.section=a),u)for(const[m,v]of Object.entries(u))d[m]=v;for(const[m,v]of Object.entries(h.props))d[m]=v;return d}let c;if(e===r)c="";else if(e.startsWith(r+"-"))c=e.slice(r.length+1);else continue;const f=s(c);if(f){const h={property:l??r,fullClass:e};if(a&&(h.section=a),u)for(const[d,m]of Object.entries(u))h[d]=m;for(const[d,m]of Object.entries(f.props))h[d]=m;return h}return{property:l??r,fullClass:e,unknown:!0}}return null}function Bx(e,t){const n=e.trim().split(/\s+/).filter(Boolean),r=[];for(const o of n){const s=Wx(o,t);s&&r.push(s)}return r}const Vx=["solid","dashed","dotted","double","none","hidden"],Ux=["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],Gx=["xs","sm","base","lg","xl","2xl","3xl","4xl","5xl","6xl","7xl","8xl","9xl"],Yx=["tighter","tight","normal","wide","wider","widest"],Qx=["left","center","right","justify","start","end"],Xx=["inline-block","inline-grid","inline-flex","inline","flow-root","block","flex","grid","contents","hidden","table-header-group","table-footer-group","table-row-group","table-column-group","table-caption","table-column","table-row","table-cell","table"],Zx=["static","relative","absolute","fixed","sticky"],qx=["t","tr","r","br","b","bl","l","tl"],Jx=["start","end","end-safe","center","center-safe","between","around","evenly","stretch","baseline","normal"],ev=["start","end","end-safe","center","center-safe","baseline","baseline-last","stretch"],tv=["normal","start","end","center","between","around","evenly","baseline","stretch"],nv=["start","end","center","stretch"],rv=["auto","start","end","center","stretch","baseline"],ov=[...Gt("spacing",[...Li("m",Z("spacing"),Ai),...Li("-m",Z("spacing"),Ai),...Li("p",Z("spacing"),Ai),F("gap-x",Z("spacing")),F("gap-y",Z("spacing")),F("gap",Z("spacing")),F("space-x-reverse",te()),F("space-y-reverse",te()),F("space-x",Z("spacing")),F("space-y",Z("spacing"))]),...Gt("sizing",[F("min-w",Z("spacing")),F("max-w",Z("spacing")),F("min-h",Z("spacing")),F("max-h",Z("spacing")),F("size",Z("spacing")),F("w",Z("spacing")),F("h",Z("spacing"))]),...Gt("typography",[F("font-sans",te()),F("font-serif",te()),F("font-mono",te()),F("font",Me("scale",Ux)),F("text-shadow",Ae(Me("size",qu),bt())),F("text",Ae(Me("align",Qx),e=>Gx.includes(e)?{props:{size:e,scaleName:"fontSize"}}:null,bt())),F("leading",Ae(Me("scale",["none"]),Z("spacing"))),F("tracking",Me("scale",Yx)),F("italic",te()),F("not-italic",te()),F("underline",te()),F("line-through",te()),F("overline",te()),F("no-underline",te()),F("uppercase",te()),F("lowercase",te()),F("capitalize",te()),F("normal-case",te()),F("truncate",te()),F("align-text-top",te()),F("align-text-bottom",te()),F("align-baseline",te()),F("align-top",te()),F("align-middle",te()),F("align-bottom",te()),F("align-sub",te()),F("align-super",te())]),...Gt("color",[F("bg-gradient-to",Me("direction",qx)),F("bg",bt()),F("from",bt()),F("via",bt()),F("to",bt()),F("ring",bt()),F("outline",Ae(Me("style",["solid","dashed","dotted","double","none"]),bt())),F("fill",bt()),F("stroke",bt()),F("decoration",bt())]),...Gt("borders",[{prefix:"border-bs",segment:Ae(te(),Z("borderWidth")),canonical:"border",extraProps:{side:"bs"}},{prefix:"border-be",segment:Ae(te(),Z("borderWidth")),canonical:"border",extraProps:{side:"be"}},{prefix:"border-x",segment:Ae(te(),Z("borderWidth")),canonical:"border",extraProps:{side:"x"}},{prefix:"border-y",segment:Ae(te(),Z("borderWidth")),canonical:"border",extraProps:{side:"y"}},{prefix:"border-s",segment:Ae(te(),Z("borderWidth")),canonical:"border",extraProps:{side:"s"}},{prefix:"border-e",segment:Ae(te(),Z("borderWidth")),canonical:"border",extraProps:{side:"e"}},{prefix:"border-t",segment:Ae(te(),Z("borderWidth")),canonical:"border",extraProps:{side:"t"}},{prefix:"border-r",segment:Ae(te(),Z("borderWidth")),canonical:"border",extraProps:{side:"r"}},{prefix:"border-b",segment:Ae(te(),Z("borderWidth")),canonical:"border",extraProps:{side:"b"}},{prefix:"border-l",segment:Ae(te(),Z("borderWidth")),canonical:"border",extraProps:{side:"l"}},F("border",Ae(te(),Me("style",Vx),e=>/^\d+$/.test(e)||e==="px"?{props:{scale:e,scaleName:"borderWidth"}}:null,bt())),...Hx("rounded",Z("borderRadius"))]),...Gt("effects",[F("opacity",Z("opacity")),F("shadow",Me("size",Zu))]),...Gt("layout",[Cd("display",Xx),Cd("position",Zx),{prefix:"inset-bs",segment:Z("spacing"),canonical:"inset",extraProps:{side:"bs"}},{prefix:"inset-be",segment:Z("spacing"),canonical:"inset",extraProps:{side:"be"}},{prefix:"inset-x",segment:Z("spacing"),canonical:"inset",extraProps:{side:"x"}},{prefix:"inset-y",segment:Z("spacing"),canonical:"inset",extraProps:{side:"y"}},{prefix:"inset-s",segment:Z("spacing"),canonical:"inset",extraProps:{side:"s"}},{prefix:"inset-e",segment:Z("spacing"),canonical:"inset",extraProps:{side:"e"}},{prefix:"top",segment:Z("spacing"),canonical:"inset",extraProps:{side:"top"}},{prefix:"right",segment:Z("spacing"),canonical:"inset",extraProps:{side:"right"}},{prefix:"bottom",segment:Z("spacing"),canonical:"inset",extraProps:{side:"bottom"}},{prefix:"left",segment:Z("spacing"),canonical:"inset",extraProps:{side:"left"}},{prefix:"start",segment:Z("spacing"),canonical:"inset",extraProps:{side:"start"}},{prefix:"end",segment:Z("spacing"),canonical:"inset",extraProps:{side:"end"}},F("inset",Z("spacing")),F("z",Z("zIndex"))]),...Gt("flexbox",[F("flex-row-reverse",te()),F("flex-col-reverse",te()),F("flex-wrap-reverse",te()),F("flex-row",te()),F("flex-col",te()),F("flex-wrap",te()),F("flex-nowrap",te()),F("flex",Ae(te(),Me("value",["auto","initial","none"]),Z("number"))),F("grow",Ae(te(),Z("number"))),F("shrink",Ae(te(),Z("number"))),F("justify-items",Me("value",nv)),F("justify",Me("value",Jx)),F("items",Me("value",ev)),F("content",Me("value",tv)),F("self",Me("value",rv)),F("basis",Z("spacing")),F("grid-cols",Ae(Me("value",["none","subgrid"]),Z("gridCols"))),F("grid-rows",Ae(Me("value",["none","subgrid"]),Z("gridRows"))),F("col-span",Z("colSpan")),F("row-span",Z("rowSpan")),F("order",Z("order"))]),...Gt("overflow",[F("overflow-x",Me("value",["auto","hidden","clip","visible","scroll"])),F("overflow-y",Me("value",["auto","hidden","clip","visible","scroll"])),F("overflow",Me("value",["auto","hidden","clip","visible","scroll"]))])],sv=[{id:"design",label:"Design"},{id:"replace",label:"Replace"}],lv=[{id:"place",label:"Place"}];function iv(e,t){return e==="insert"?"place":t==="component"?"replace":"design"}function av(e){return e==="insert"?lv:sv}function uv(e,t,n,r){return t||e==="insert"&&!n&&r}const cv={mode:null,tabPreference:"design",selectModeActive:!1,insertBrowseActive:!1,textEditing:!1,elementData:null,selectionId:0,insertPoint:null};function Ga(e,t){switch(t.type){case"MODE_CHANGE":{let n=t.mode;const r=!!t.fromOverlay,o=[];if(n===e.mode){if(e.elementData||e.insertPoint)return Rs(e,r);(e.mode==="insert"&&e.insertBrowseActive||e.mode==="select"&&e.selectModeActive)&&(n=null)}const s={...e,elementData:null,selectionId:e.selectionId+1,textEditing:!1,insertPoint:null,mode:n};return n===null?(s.selectModeActive=!1,s.insertBrowseActive=!1,r||o.push({kind:"sendToOverlay",message:{type:"CANCEL_MODE"}}),{state:s,effects:o}):(n==="insert"?(s.tabPreference=e.tabPreference==="design"?"component":e.tabPreference,s.insertBrowseActive=!0):s.insertBrowseActive=!1,n==="select"&&e.mode!=="select"&&(s.tabPreference="design"),r||o.push({kind:"sendToOverlay",message:{type:"MODE_CHANGED",mode:n}}),s.selectModeActive=n==="select",{state:s,effects:o})}case"TAB_CHANGE":{const n=[],r={...e};return t.tab==="replace"||t.tab==="place"?r.tabPreference="component":t.tab==="design"&&(r.tabPreference="design"),t.fromOverlay||n.push({kind:"sendToOverlay",message:{type:"TAB_CHANGED",tab:t.tab}}),{state:r,effects:n}}case"DESELECT_AND_REENTER":return Rs(e,!!t.fromOverlay);case"ESCAPE":return e.elementData||e.insertPoint?Rs(e,!1):e.mode!==null?{state:{...e,mode:null,selectModeActive:!1,insertBrowseActive:!1,insertPoint:null},effects:[{kind:"sendToOverlay",message:{type:"CANCEL_MODE"}}]}:{state:e,effects:[]};case"WS_RESET_SELECTION":return{state:{...e,elementData:null,selectionId:e.selectionId+1,textEditing:!1,insertPoint:null,selectModeActive:!1,insertBrowseActive:!1,mode:null},effects:[]};case"WS_DESELECT_ELEMENT":return Rs(e,!0);case"WS_ELEMENT_SELECTED":return{state:{...e,elementData:t.elementData,selectionId:e.selectionId+1,selectModeActive:!1,mode:e.mode??"select"},effects:[]};case"WS_SELECT_MODE_CHANGED":return{state:{...e,selectModeActive:t.active},effects:[]};case"WS_MODE_CHANGED":return Ga(e,{type:"MODE_CHANGE",mode:t.mode,fromOverlay:!0});case"WS_TAB_CHANGED":return Ga(e,{type:"TAB_CHANGE",tab:t.tab,fromOverlay:!0});case"WS_TEXT_EDIT_ACTIVE":return{state:{...e,textEditing:!0},effects:[]};case"WS_TEXT_EDIT_DONE":return{state:{...e,textEditing:!1},effects:[]};case"WS_INSERT_POINT_LOCKED":return{state:{...e,insertPoint:{position:t.position,targetName:t.targetName},insertBrowseActive:!1},effects:[]};case"WS_COMPONENT_DISARMED":return{state:{...e,elementData:null,selectionId:e.selectionId+1,selectModeActive:!1,insertBrowseActive:!1,insertPoint:null},effects:[]};default:return{state:e,effects:[]}}}function Rs(e,t){const n=[],r={...e,elementData:null,selectionId:e.selectionId+1,textEditing:!1,insertPoint:null};return t||(n.push({kind:"sendToOverlay",message:{type:"CLEAR_HIGHLIGHTS",deselect:!0}}),e.mode==="select"?(r.selectModeActive=!0,n.push({kind:"sendToOverlay",message:{type:"TOGGLE_SELECT_MODE",active:!0}})):e.mode==="insert"&&(r.insertBrowseActive=!0,n.push({kind:"sendToOverlay",message:{type:"MODE_CHANGED",mode:"insert"}}))),{state:r,effects:n}}function kd(e){for(const t of e.current)t.kind==="sendToOverlay"&&pe("overlay",t.message);e.current=[]}function dv(){const e=b.useRef([]),t=b.useCallback((s,l)=>{const{state:a,effects:u}=Ga(s,l);return e.current=u,a},[]),[n,r]=b.useReducer(t,cv);b.useEffect(()=>{kd(e)});const o=b.useCallback(s=>{r(s),kd(e)},[r]);return{state:n,dispatch:o}}function fv(){const{state:e,dispatch:t}=dv();b.useEffect(()=>{const u=c=>{c.key==="Escape"&&t({type:"ESCAPE"})};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[t]);const n=b.useCallback((u,c=!1)=>{t({type:"MODE_CHANGE",mode:u,fromOverlay:c})},[t]),r=b.useCallback((u,c=!1)=>{t({type:"TAB_CHANGE",tab:u,fromOverlay:c})},[t]),o=b.useCallback(u=>{switch(u.type){case"RESET_SELECTION":return t({type:"WS_RESET_SELECTION"}),!0;case"DESELECT_ELEMENT":return t({type:"WS_DESELECT_ELEMENT"}),!0;case"ELEMENT_SELECTED":return t({type:"WS_ELEMENT_SELECTED",elementData:{componentName:u.componentName,instanceCount:u.instanceCount,classes:u.classes,parsedClasses:Bx(u.classes,ov),tailwindConfig:u.tailwindConfig}}),!0;case"SELECT_MODE_CHANGED":return t({type:"WS_SELECT_MODE_CHANGED",active:!!u.active}),!0;case"MODE_CHANGED":return t({type:"WS_MODE_CHANGED",mode:u.mode}),!0;case"TAB_CHANGED":return t({type:"WS_TAB_CHANGED",tab:u.tab}),!0;case"TEXT_EDIT_ACTIVE":return t({type:"WS_TEXT_EDIT_ACTIVE"}),!0;case"TEXT_EDIT_DONE":return t({type:"WS_TEXT_EDIT_DONE"}),!0;case"INSERT_POINT_LOCKED":return t({type:"WS_INSERT_POINT_LOCKED",position:u.position,targetName:u.targetName}),!0;case"COMPONENT_DISARMED":return t({type:"WS_COMPONENT_DISARMED"}),!0;default:return!1}},[t]),s=b.useMemo(()=>av(e.mode),[e.mode]),l=b.useMemo(()=>iv(e.mode,e.tabPreference),[e.mode,e.tabPreference]),a=b.useMemo(()=>uv(e.mode,e.selectModeActive,e.insertPoint,e.insertBrowseActive),[e.mode,e.selectModeActive,e.insertPoint,e.insertBrowseActive]);return{mode:e.mode,elementData:e.elementData,selectionId:e.selectionId,insertPoint:e.insertPoint,selectModeActive:e.selectModeActive,textEditing:e.textEditing,tabPreference:e.tabPreference,currentTabs:s,activeTab:l,isPicking:a,handleModeChange:n,handleTabChange:r,handleWsMessage:o}}function Yl(){return typeof window<"u"}function so(e){return Ju(e)?(e.nodeName||"").toLowerCase():"#document"}function gt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Wt(e){var t;return(t=(Ju(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ju(e){return Yl()?e instanceof Node||e instanceof gt(e).Node:!1}function De(e){return Yl()?e instanceof Element||e instanceof gt(e).Element:!1}function Bt(e){return Yl()?e instanceof HTMLElement||e instanceof gt(e).HTMLElement:!1}function Ya(e){return!Yl()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof gt(e).ShadowRoot}function os(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Nt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function pv(e){return/^(table|td|th)$/.test(so(e))}function Ql(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const hv=/transform|translate|scale|rotate|perspective|filter/,mv=/paint|layout|strict|content/,Yn=e=>!!e&&e!=="none";let Di;function ec(e){const t=De(e)?Nt(e):e;return Yn(t.transform)||Yn(t.translate)||Yn(t.scale)||Yn(t.rotate)||Yn(t.perspective)||!Xl()&&(Yn(t.backdropFilter)||Yn(t.filter))||hv.test(t.willChange||"")||mv.test(t.contain||"")}function gv(e){let t=fn(e);for(;Bt(t)&&!sn(t);){if(ec(t))return t;if(Ql(t))return null;t=fn(t)}return null}function Xl(){return Di==null&&(Di=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Di}function sn(e){return/^(html|body|#document)$/.test(so(e))}function Nt(e){return gt(e).getComputedStyle(e)}function Zl(e){return De(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function fn(e){if(so(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ya(e)&&e.host||Wt(e);return Ya(t)?t.host:t}function jh(e){const t=fn(e);return sn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Bt(t)&&os(t)?t:jh(t)}function zn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=jh(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),l=gt(o);if(s){const a=Qa(l);return t.concat(l,l.visualViewport||[],os(o)?o:[],a&&n?zn(a):[])}else return t.concat(o,zn(o,[],n))}function Qa(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const to=Math.min,pt=Math.max,jl=Math.round,Ps=Math.floor,Kt=e=>({x:e,y:e}),yv={left:"right",right:"left",bottom:"top",top:"bottom"};function Ed(e,t,n){return pt(e,to(t,n))}function ss(e,t){return typeof e=="function"?e(t):e}function Hn(e){return e.split("-")[0]}function ls(e){return e.split("-")[1]}function Th(e){return e==="x"?"y":"x"}function Nh(e){return e==="y"?"height":"width"}function rn(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Rh(e){return Th(rn(e))}function xv(e,t,n){n===void 0&&(n=!1);const r=ls(e),o=Rh(e),s=Nh(o);let l=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(l=Tl(l)),[l,Tl(l)]}function vv(e){const t=Tl(e);return[Xa(e),t,Xa(t)]}function Xa(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const jd=["left","right"],Td=["right","left"],bv=["top","bottom"],wv=["bottom","top"];function Sv(e,t,n){switch(e){case"top":case"bottom":return n?t?Td:jd:t?jd:Td;case"left":case"right":return t?bv:wv;default:return[]}}function Cv(e,t,n,r){const o=ls(e);let s=Sv(Hn(e),n==="start",r);return o&&(s=s.map(l=>l+"-"+o),t&&(s=s.concat(s.map(Xa)))),s}function Tl(e){const t=Hn(e);return yv[t]+e.slice(t.length)}function kv(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ev(e){return typeof e!="number"?kv(e):{top:e,right:e,bottom:e,left:e}}function Nl(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}/*!
55
+ * tabbable 6.4.0
56
+ * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
57
+ */var jv=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],Za=jv.join(","),Ph=typeof Element>"u",Zo=Ph?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Rl=!Ph&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},Pl=function(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=o===""||o==="true",l=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Pl(t.parentNode));return l},Tv=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Nv=function(t,n,r){if(Pl(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Za));return n&&Zo.call(t,Za)&&o.unshift(t),o=o.filter(r),o},qa=function(t,n,r){for(var o=[],s=Array.from(t);s.length;){var l=s.shift();if(!Pl(l,!1))if(l.tagName==="SLOT"){var a=l.assignedElements(),u=a.length?a:l.children,c=qa(u,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:l,candidates:c})}else{var f=Zo.call(l,Za);f&&r.filter(l)&&(n||!t.includes(l))&&o.push(l);var h=l.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(l),d=!Pl(h,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(h&&d){var m=qa(h===!0?l.children:h.children,!0,r);r.flatten?o.push.apply(o,m):o.push({scopeParent:l,candidates:m})}else s.unshift.apply(s,l.children)}}return o},Ih=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},_h=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Tv(t))&&!Ih(t)?0:t.tabIndex},Rv=function(t,n){var r=_h(t);return r<0&&n&&!Ih(t)?0:r},Pv=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Ah=function(t){return t.tagName==="INPUT"},Iv=function(t){return Ah(t)&&t.type==="hidden"},_v=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},Av=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},Lv=function(t){if(!t.name)return!0;var n=t.form||Rl(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(l){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",l.message),!1}var s=Av(o,t.form);return!s||s===t},Dv=function(t){return Ah(t)&&t.type==="radio"},Ov=function(t){return Dv(t)&&!Lv(t)},Mv=function(t){var n,r=t&&Rl(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var l,a,u;for(s=!!((l=o)!==null&&l!==void 0&&(a=l.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(u=t.ownerDocument)!==null&&u!==void 0&&u.contains(t));!s&&o;){var c,f,h;r=Rl(o),o=(c=r)===null||c===void 0?void 0:c.host,s=!!((f=o)!==null&&f!==void 0&&(h=f.ownerDocument)!==null&&h!==void 0&&h.contains(o))}}return s},Nd=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},$v=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var l=Zo.call(t,"details>summary:first-of-type"),a=l?t.parentElement:t;if(Zo.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var u=t;t;){var c=t.parentElement,f=Rl(t);if(c&&!c.shadowRoot&&o(c)===!0)return Nd(t);t.assignedSlot?t=t.assignedSlot:!c&&f!==t.ownerDocument?t=f.host:t=c}t=u}if(Mv(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Nd(t);return!1},zv=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return Zo.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},Fv=function(t,n){return!(n.disabled||Iv(n)||$v(n,t)||_v(n)||zv(n))},Rd=function(t,n){return!(Ov(n)||_h(n)<0||!Fv(t,n))},Kv=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Lh=function(t){var n=[],r=[];return t.forEach(function(o,s){var l=!!o.scopeParent,a=l?o.scopeParent:o,u=Rv(a,l),c=l?Lh(o.candidates):a;u===0?l?n.push.apply(n,c):n.push(a):r.push({documentOrder:s,tabIndex:u,item:o,isScope:l,content:c})}),r.sort(Pv).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},Dh=function(t,n){n=n||{};var r;return n.getShadowRoot?r=qa([t],n.includeContainer,{filter:Rd.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Kv}):r=Nv(t,n.includeContainer,Rd.bind(null,n)),Lh(r)};function Hv(){return/apple/i.test(navigator.vendor)}function Wv(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Ja(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Ya(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function xo(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Oi(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Bv(e){return e.matches("html,body")}function qo(e){return(e==null?void 0:e.ownerDocument)||document}function Us(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var s;return o.parentId===t&&(!n||((s=o.context)==null?void 0:s.open))}).flatMap(o=>[o,...Us(e,o.id,n)])}function Vv(e){return"nativeEvent"in e}var Uv=typeof document<"u",Gv=function(){},lr=Uv?b.useLayoutEffect:Gv;const Yv={...pf},Qv=Yv.useInsertionEffect,Xv=Qv||(e=>e());function Er(e){const t=b.useRef(()=>{});return Xv(()=>{t.current=e}),b.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}const Oh=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Mh(e,t){const n=Dh(e,Oh()),r=n.length;if(r===0)return;const o=Wv(qo(e)),s=n.indexOf(o),l=s===-1?t===1?0:r-1:s+t;return n[l]}function Zv(e){return Mh(qo(e).body,1)||e}function qv(e){return Mh(qo(e).body,-1)||e}function Mi(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Ja(n,r)}function Jv(e){Dh(e,Oh()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Pd(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function Id(e,t,n){let{reference:r,floating:o}=e;const s=rn(t),l=Rh(t),a=Nh(l),u=Hn(t),c=s==="y",f=r.x+r.width/2-o.width/2,h=r.y+r.height/2-o.height/2,d=r[a]/2-o[a]/2;let m;switch(u){case"top":m={x:f,y:r.y-o.height};break;case"bottom":m={x:f,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:h};break;case"left":m={x:r.x-o.width,y:h};break;default:m={x:r.x,y:r.y}}switch(ls(t)){case"start":m[l]-=d*(n&&c?-1:1);break;case"end":m[l]+=d*(n&&c?-1:1);break}return m}async function e0(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:l,elements:a,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:d=!1,padding:m=0}=ss(t,e),v=Ev(m),S=a[d?h==="floating"?"reference":"floating":h],p=Nl(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(S)))==null||n?S:S.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:f,strategy:u})),g=h==="floating"?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,y=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),x=await(s.isElement==null?void 0:s.isElement(y))?await(s.getScale==null?void 0:s.getScale(y))||{x:1,y:1}:{x:1,y:1},k=Nl(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:g,offsetParent:y,strategy:u}):g);return{top:(p.top-k.top+v.top)/x.y,bottom:(k.bottom-p.bottom+v.bottom)/x.y,left:(p.left-k.left+v.left)/x.x,right:(k.right-p.right+v.right)/x.x}}const t0=50,n0=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:l}=n,a=l.detectOverflow?l:{...l,detectOverflow:e0},u=await(l.isRTL==null?void 0:l.isRTL(t));let c=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:h}=Id(c,r,u),d=r,m=0;const v={};for(let w=0;w<s.length;w++){const S=s[w];if(!S)continue;const{name:p,fn:g}=S,{x:y,y:x,data:k,reset:C}=await g({x:f,y:h,initialPlacement:r,placement:d,strategy:o,middlewareData:v,rects:c,platform:a,elements:{reference:e,floating:t}});f=y??f,h=x??h,v[p]={...v[p],...k},C&&m<t0&&(m++,typeof C=="object"&&(C.placement&&(d=C.placement),C.rects&&(c=C.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:f,y:h}=Id(c,d,u)),w=-1)}return{x:f,y:h,placement:d,strategy:o,middlewareData:v}},r0=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:l,initialPlacement:a,platform:u,elements:c}=t,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:d,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:w=!0,...S}=ss(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const p=Hn(o),g=rn(a),y=Hn(a)===a,x=await(u.isRTL==null?void 0:u.isRTL(c.floating)),k=d||(y||!w?[Tl(a)]:vv(a)),C=v!=="none";!d&&C&&k.push(...Cv(a,w,v,x));const T=[a,...k],E=await u.detectOverflow(t,S),A=[];let I=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&A.push(E[p]),h){const D=xv(o,l,x);A.push(E[D[0]],E[D[1]])}if(I=[...I,{placement:o,overflows:A}],!A.every(D=>D<=0)){var L,B;const D=(((L=s.flip)==null?void 0:L.index)||0)+1,H=T[D];if(H&&(!(h==="alignment"?g!==rn(H):!1)||I.every(j=>rn(j.placement)===g?j.overflows[0]>0:!0)))return{data:{index:D,overflows:I},reset:{placement:H}};let Q=(B=I.filter(J=>J.overflows[0]<=0).sort((J,j)=>J.overflows[1]-j.overflows[1])[0])==null?void 0:B.placement;if(!Q)switch(m){case"bestFit":{var K;const J=(K=I.filter(j=>{if(C){const R=rn(j.placement);return R===g||R==="y"}return!0}).map(j=>[j.placement,j.overflows.filter(R=>R>0).reduce((R,P)=>R+P,0)]).sort((j,R)=>j[1]-R[1])[0])==null?void 0:K[0];J&&(Q=J);break}case"initialPlacement":Q=a;break}if(o!==Q)return{reset:{placement:Q}}}return{}}}},o0=new Set(["left","top"]);async function s0(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),l=Hn(n),a=ls(n),u=rn(n)==="y",c=o0.has(l)?-1:1,f=s&&u?-1:1,h=ss(t,e);let{mainAxis:d,crossAxis:m,alignmentAxis:v}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof v=="number"&&(m=a==="end"?v*-1:v),u?{x:m*f,y:d*c}:{x:d*c,y:m*f}}const l0=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:l,middlewareData:a}=t,u=await s0(t,e);return l===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:s+u.y,data:{...u,placement:l}}}}},i0=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:l=!0,crossAxis:a=!1,limiter:u={fn:p=>{let{x:g,y}=p;return{x:g,y}}},...c}=ss(e,t),f={x:n,y:r},h=await s.detectOverflow(t,c),d=rn(Hn(o)),m=Th(d);let v=f[m],w=f[d];if(l){const p=m==="y"?"top":"left",g=m==="y"?"bottom":"right",y=v+h[p],x=v-h[g];v=Ed(y,v,x)}if(a){const p=d==="y"?"top":"left",g=d==="y"?"bottom":"right",y=w+h[p],x=w-h[g];w=Ed(y,w,x)}const S=u.fn({...t,[m]:v,[d]:w});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[m]:l,[d]:a}}}}}},a0=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:l,elements:a}=t,{apply:u=()=>{},...c}=ss(e,t),f=await l.detectOverflow(t,c),h=Hn(o),d=ls(o),m=rn(o)==="y",{width:v,height:w}=s.floating;let S,p;h==="top"||h==="bottom"?(S=h,p=d===(await(l.isRTL==null?void 0:l.isRTL(a.floating))?"start":"end")?"left":"right"):(p=h,S=d==="end"?"top":"bottom");const g=w-f.top-f.bottom,y=v-f.left-f.right,x=to(w-f[S],g),k=to(v-f[p],y),C=!t.middlewareData.shift;let T=x,E=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(E=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=g),C&&!d){const I=pt(f.left,0),L=pt(f.right,0),B=pt(f.top,0),K=pt(f.bottom,0);m?E=v-2*(I!==0||L!==0?I+L:pt(f.left,f.right)):T=w-2*(B!==0||K!==0?B+K:pt(f.top,f.bottom))}await u({...t,availableWidth:E,availableHeight:T});const A=await l.getDimensions(a.floating);return v!==A.width||w!==A.height?{reset:{rects:!0}}:{}}}};function $h(e){const t=Nt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Bt(e),s=o?e.offsetWidth:n,l=o?e.offsetHeight:r,a=jl(n)!==s||jl(r)!==l;return a&&(n=s,r=l),{width:n,height:r,$:a}}function tc(e){return De(e)?e:e.contextElement}function Vr(e){const t=tc(e);if(!Bt(t))return Kt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=$h(t);let l=(s?jl(n.width):n.width)/r,a=(s?jl(n.height):n.height)/o;return(!l||!Number.isFinite(l))&&(l=1),(!a||!Number.isFinite(a))&&(a=1),{x:l,y:a}}const u0=Kt(0);function zh(e){const t=gt(e);return!Xl()||!t.visualViewport?u0:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function c0(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==gt(e)?!1:t}function fr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=tc(e);let l=Kt(1);t&&(r?De(r)&&(l=Vr(r)):l=Vr(e));const a=c0(s,n,r)?zh(s):Kt(0);let u=(o.left+a.x)/l.x,c=(o.top+a.y)/l.y,f=o.width/l.x,h=o.height/l.y;if(s){const d=gt(s),m=r&&De(r)?gt(r):r;let v=d,w=Qa(v);for(;w&&r&&m!==v;){const S=Vr(w),p=w.getBoundingClientRect(),g=Nt(w),y=p.left+(w.clientLeft+parseFloat(g.paddingLeft))*S.x,x=p.top+(w.clientTop+parseFloat(g.paddingTop))*S.y;u*=S.x,c*=S.y,f*=S.x,h*=S.y,u+=y,c+=x,v=gt(w),w=Qa(v)}}return Nl({width:f,height:h,x:u,y:c})}function ql(e,t){const n=Zl(e).scrollLeft;return t?t.left+n:fr(Wt(e)).left+n}function Fh(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ql(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function d0(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",l=Wt(r),a=t?Ql(t.floating):!1;if(r===l||a&&s)return n;let u={scrollLeft:0,scrollTop:0},c=Kt(1);const f=Kt(0),h=Bt(r);if((h||!h&&!s)&&((so(r)!=="body"||os(l))&&(u=Zl(r)),h)){const m=fr(r);c=Vr(r),f.x=m.x+r.clientLeft,f.y=m.y+r.clientTop}const d=l&&!h&&!s?Fh(l,u):Kt(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-u.scrollLeft*c.x+f.x+d.x,y:n.y*c.y-u.scrollTop*c.y+f.y+d.y}}function f0(e){return Array.from(e.getClientRects())}function p0(e){const t=Wt(e),n=Zl(e),r=e.ownerDocument.body,o=pt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=pt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+ql(e);const a=-n.scrollTop;return Nt(r).direction==="rtl"&&(l+=pt(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:l,y:a}}const _d=25;function h0(e,t){const n=gt(e),r=Wt(e),o=n.visualViewport;let s=r.clientWidth,l=r.clientHeight,a=0,u=0;if(o){s=o.width,l=o.height;const f=Xl();(!f||f&&t==="fixed")&&(a=o.offsetLeft,u=o.offsetTop)}const c=ql(r);if(c<=0){const f=r.ownerDocument,h=f.body,d=getComputedStyle(h),m=f.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,v=Math.abs(r.clientWidth-h.clientWidth-m);v<=_d&&(s-=v)}else c<=_d&&(s+=c);return{width:s,height:l,x:a,y:u}}function m0(e,t){const n=fr(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Bt(e)?Vr(e):Kt(1),l=e.clientWidth*s.x,a=e.clientHeight*s.y,u=o*s.x,c=r*s.y;return{width:l,height:a,x:u,y:c}}function Ad(e,t,n){let r;if(t==="viewport")r=h0(e,n);else if(t==="document")r=p0(Wt(e));else if(De(t))r=m0(t,n);else{const o=zh(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Nl(r)}function Kh(e,t){const n=fn(e);return n===t||!De(n)||sn(n)?!1:Nt(n).position==="fixed"||Kh(n,t)}function g0(e,t){const n=t.get(e);if(n)return n;let r=zn(e,[],!1).filter(a=>De(a)&&so(a)!=="body"),o=null;const s=Nt(e).position==="fixed";let l=s?fn(e):e;for(;De(l)&&!sn(l);){const a=Nt(l),u=ec(l);!u&&a.position==="fixed"&&(o=null),(s?!u&&!o:!u&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||os(l)&&!u&&Kh(e,l))?r=r.filter(f=>f!==l):o=a,l=fn(l)}return t.set(e,r),r}function y0(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const l=[...n==="clippingAncestors"?Ql(t)?[]:g0(t,this._c):[].concat(n),r],a=Ad(t,l[0],o);let u=a.top,c=a.right,f=a.bottom,h=a.left;for(let d=1;d<l.length;d++){const m=Ad(t,l[d],o);u=pt(m.top,u),c=to(m.right,c),f=to(m.bottom,f),h=pt(m.left,h)}return{width:c-h,height:f-u,x:h,y:u}}function x0(e){const{width:t,height:n}=$h(e);return{width:t,height:n}}function v0(e,t,n){const r=Bt(t),o=Wt(t),s=n==="fixed",l=fr(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const u=Kt(0);function c(){u.x=ql(o)}if(r||!r&&!s)if((so(t)!=="body"||os(o))&&(a=Zl(t)),r){const m=fr(t,!0,s,t);u.x=m.x+t.clientLeft,u.y=m.y+t.clientTop}else o&&c();s&&!r&&o&&c();const f=o&&!r&&!s?Fh(o,a):Kt(0),h=l.left+a.scrollLeft-u.x-f.x,d=l.top+a.scrollTop-u.y-f.y;return{x:h,y:d,width:l.width,height:l.height}}function $i(e){return Nt(e).position==="static"}function Ld(e,t){if(!Bt(e)||Nt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Wt(e)===n&&(n=n.ownerDocument.body),n}function Hh(e,t){const n=gt(e);if(Ql(e))return n;if(!Bt(e)){let o=fn(e);for(;o&&!sn(o);){if(De(o)&&!$i(o))return o;o=fn(o)}return n}let r=Ld(e,t);for(;r&&pv(r)&&$i(r);)r=Ld(r,t);return r&&sn(r)&&$i(r)&&!ec(r)?n:r||gv(e)||n}const b0=async function(e){const t=this.getOffsetParent||Hh,n=this.getDimensions,r=await n(e.floating);return{reference:v0(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function w0(e){return Nt(e).direction==="rtl"}const S0={convertOffsetParentRelativeRectToViewportRelativeRect:d0,getDocumentElement:Wt,getClippingRect:y0,getOffsetParent:Hh,getElementRects:b0,getClientRects:f0,getDimensions:x0,getScale:Vr,isElement:De,isRTL:w0};function Wh(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function C0(e,t){let n=null,r;const o=Wt(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function l(a,u){a===void 0&&(a=!1),u===void 0&&(u=1),s();const c=e.getBoundingClientRect(),{left:f,top:h,width:d,height:m}=c;if(a||t(),!d||!m)return;const v=Ps(h),w=Ps(o.clientWidth-(f+d)),S=Ps(o.clientHeight-(h+m)),p=Ps(f),y={rootMargin:-v+"px "+-w+"px "+-S+"px "+-p+"px",threshold:pt(0,to(1,u))||1};let x=!0;function k(C){const T=C[0].intersectionRatio;if(T!==u){if(!x)return l();T?l(!1,T):r=setTimeout(()=>{l(!1,1e-7)},1e3)}T===1&&!Wh(c,e.getBoundingClientRect())&&l(),x=!1}try{n=new IntersectionObserver(k,{...y,root:o.ownerDocument})}catch{n=new IntersectionObserver(k,y)}n.observe(e)}return l(!0),s}function pn(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,c=tc(e),f=o||s?[...c?zn(c):[],...t?zn(t):[]]:[];f.forEach(p=>{o&&p.addEventListener("scroll",n,{passive:!0}),s&&p.addEventListener("resize",n)});const h=c&&a?C0(c,n):null;let d=-1,m=null;l&&(m=new ResizeObserver(p=>{let[g]=p;g&&g.target===c&&m&&t&&(m.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var y;(y=m)==null||y.observe(t)})),n()}),c&&!u&&m.observe(c),t&&m.observe(t));let v,w=u?fr(e):null;u&&S();function S(){const p=fr(e);w&&!Wh(w,p)&&n(),w=p,v=requestAnimationFrame(S)}return n(),()=>{var p;f.forEach(g=>{o&&g.removeEventListener("scroll",n),s&&g.removeEventListener("resize",n)}),h==null||h(),(p=m)==null||p.disconnect(),m=null,u&&cancelAnimationFrame(v)}}const k0=l0,E0=i0,j0=r0,T0=a0,N0=(e,t,n)=>{const r=new Map,o={platform:S0,...n},s={...o.platform,_c:r};return n0(e,t,{...o,platform:s})};var R0=typeof document<"u",P0=function(){},Gs=R0?b.useLayoutEffect:P0;function Il(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Il(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Il(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Bh(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Dd(e,t){const n=Bh(e);return Math.round(t*n)/n}function zi(e){const t=b.useRef(e);return Gs(()=>{t.current=e}),t}function I0(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:l}={},transform:a=!0,whileElementsMounted:u,open:c}=e,[f,h]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,m]=b.useState(r);Il(d,r)||m(r);const[v,w]=b.useState(null),[S,p]=b.useState(null),g=b.useCallback(j=>{j!==C.current&&(C.current=j,w(j))},[]),y=b.useCallback(j=>{j!==T.current&&(T.current=j,p(j))},[]),x=s||v,k=l||S,C=b.useRef(null),T=b.useRef(null),E=b.useRef(f),A=u!=null,I=zi(u),L=zi(o),B=zi(c),K=b.useCallback(()=>{if(!C.current||!T.current)return;const j={placement:t,strategy:n,middleware:d};L.current&&(j.platform=L.current),N0(C.current,T.current,j).then(R=>{const P={...R,isPositioned:B.current!==!1};D.current&&!Il(E.current,P)&&(E.current=P,Xu.flushSync(()=>{h(P)}))})},[d,t,n,L,B]);Gs(()=>{c===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,h(j=>({...j,isPositioned:!1})))},[c]);const D=b.useRef(!1);Gs(()=>(D.current=!0,()=>{D.current=!1}),[]),Gs(()=>{if(x&&(C.current=x),k&&(T.current=k),x&&k){if(I.current)return I.current(x,k,K);K()}},[x,k,K,I,A]);const H=b.useMemo(()=>({reference:C,floating:T,setReference:g,setFloating:y}),[g,y]),Q=b.useMemo(()=>({reference:x,floating:k}),[x,k]),J=b.useMemo(()=>{const j={position:n,left:0,top:0};if(!Q.floating)return j;const R=Dd(Q.floating,f.x),P=Dd(Q.floating,f.y);return a?{...j,transform:"translate("+R+"px, "+P+"px)",...Bh(Q.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:R,top:P}},[n,a,Q.floating,f.x,f.y]);return b.useMemo(()=>({...f,update:K,refs:H,elements:Q,floatingStyles:J}),[f,K,H,Q,J])}const hn=(e,t)=>{const n=k0(e);return{name:n.name,fn:n.fn,options:[e,t]}},mn=(e,t)=>{const n=E0(e);return{name:n.name,fn:n.fn,options:[e,t]}},gn=(e,t)=>{const n=j0(e);return{name:n.name,fn:n.fn,options:[e,t]}},eu=(e,t)=>{const n=T0(e);return{name:n.name,fn:n.fn,options:[e,t]}},_0="data-floating-ui-focusable",Od="active",Md="selected",A0={...pf};let $d=!1,L0=0;const zd=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+L0++;function D0(){const[e,t]=b.useState(()=>$d?zd():void 0);return lr(()=>{e==null&&t(zd())},[]),b.useEffect(()=>{$d=!0},[]),e}const O0=A0.useId,Vh=O0||D0;function M0(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const $0=b.createContext(null),z0=b.createContext(null),F0=()=>{var e;return((e=b.useContext($0))==null?void 0:e.id)||null},Uh=()=>b.useContext(z0);function nc(e){return"data-floating-ui-"+e}const K0={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Fd=b.forwardRef(function(t,n){const[r,o]=b.useState();lr(()=>{Hv()&&o("button")},[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[nc("focus-guard")]:"",style:K0};return i.jsx("span",{...t,...s})}),H0={clipPath:"inset(50%)",position:"fixed",top:0,left:0},Gh=b.createContext(null),Kd=nc("portal");function W0(e){e===void 0&&(e={});const{id:t,root:n}=e,r=Vh(),o=B0(),[s,l]=b.useState(null),a=b.useRef(null);return lr(()=>()=>{s==null||s.remove(),queueMicrotask(()=>{a.current=null})},[s]),lr(()=>{if(!r||a.current)return;const u=t?document.getElementById(t):null;if(!u)return;const c=document.createElement("div");c.id=r,c.setAttribute(Kd,""),u.appendChild(c),a.current=c,l(c)},[t,r]),lr(()=>{if(n===null||!r||a.current)return;let u=n||(o==null?void 0:o.portalNode);u&&!Ju(u)&&(u=u.current),u=u||document.body;let c=null;t&&(c=document.createElement("div"),c.id=t,u.appendChild(c));const f=document.createElement("div");f.id=r,f.setAttribute(Kd,""),u=c||u,u.appendChild(f),a.current=f,l(f)},[t,n,r,o]),s}function yn(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,s=W0({id:n,root:r}),[l,a]=b.useState(null),u=b.useRef(null),c=b.useRef(null),f=b.useRef(null),h=b.useRef(null),d=l==null?void 0:l.modal,m=l==null?void 0:l.open,v=!!l&&!l.modal&&l.open&&o&&!!(r||s);return b.useEffect(()=>{if(!s||!o||d)return;function w(S){s&&Mi(S)&&(S.type==="focusin"?Pd:Jv)(s)}return s.addEventListener("focusin",w,!0),s.addEventListener("focusout",w,!0),()=>{s.removeEventListener("focusin",w,!0),s.removeEventListener("focusout",w,!0)}},[s,o,d]),b.useEffect(()=>{s&&(m||Pd(s))},[m,s]),i.jsxs(Gh.Provider,{value:b.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:u,afterOutsideRef:c,beforeInsideRef:f,afterInsideRef:h,portalNode:s,setFocusManagerState:a}),[o,s]),children:[v&&s&&i.jsx(Fd,{"data-type":"outside",ref:u,onFocus:w=>{if(Mi(w,s)){var S;(S=f.current)==null||S.focus()}else{const p=l?l.domReference:null,g=qv(p);g==null||g.focus()}}}),v&&s&&i.jsx("span",{"aria-owns":s.id,style:H0}),s&&Xu.createPortal(t,s),v&&s&&i.jsx(Fd,{"data-type":"outside",ref:c,onFocus:w=>{if(Mi(w,s)){var S;(S=h.current)==null||S.focus()}else{const p=l?l.domReference:null,g=Zv(p);g==null||g.focus(),l!=null&&l.closeOnFocusOut&&(l==null||l.onOpenChange(!1,w.nativeEvent,"focus-out"))}}})]})}const B0=()=>b.useContext(Gh),V0={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},U0={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Hd=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function pr(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:s}=e,{enabled:l=!0,escapeKey:a=!0,outsidePress:u=!0,outsidePressEvent:c="pointerdown",referencePress:f=!1,referencePressEvent:h="pointerdown",ancestorScroll:d=!1,bubbles:m,capture:v}=t,w=Uh(),S=Er(typeof u=="function"?u:()=>!1),p=typeof u=="function"?S:u,g=b.useRef(!1),{escapeKey:y,outsidePress:x}=Hd(m),{escapeKey:k,outsidePress:C}=Hd(v),T=b.useRef(!1),E=Er(D=>{var H;if(!n||!l||!a||D.key!=="Escape"||T.current)return;const Q=(H=s.current.floatingContext)==null?void 0:H.nodeId,J=w?Us(w.nodesRef.current,Q):[];if(!y&&(D.stopPropagation(),J.length>0)){let j=!0;if(J.forEach(R=>{var P;if((P=R.context)!=null&&P.open&&!R.context.dataRef.current.__escapeKeyBubbles){j=!1;return}}),!j)return}r(!1,Vv(D)?D.nativeEvent:D,"escape-key")}),A=Er(D=>{var H;const Q=()=>{var J;E(D),(J=xo(D))==null||J.removeEventListener("keydown",Q)};(H=xo(D))==null||H.addEventListener("keydown",Q)}),I=Er(D=>{var H;const Q=s.current.insideReactTree;s.current.insideReactTree=!1;const J=g.current;if(g.current=!1,c==="click"&&J||Q||typeof p=="function"&&!p(D))return;const j=xo(D),R="["+nc("inert")+"]",P=qo(o.floating).querySelectorAll(R);let G=De(j)?j:null;for(;G&&!sn(G);){const $=fn(G);if(sn($)||!De($))break;G=$}if(P.length&&De(j)&&!Bv(j)&&!Ja(j,o.floating)&&Array.from(P).every($=>!Ja(G,$)))return;if(Bt(j)&&K){const $=sn(j),ne=Nt(j),ge=/auto|scroll/,q=$||ge.test(ne.overflowX),Gn=$||ge.test(ne.overflowY),bn=q&&j.clientWidth>0&&j.scrollWidth>j.clientWidth,ae=Gn&&j.clientHeight>0&&j.scrollHeight>j.clientHeight,me=ne.direction==="rtl",st=ae&&(me?D.offsetX<=j.offsetWidth-j.clientWidth:D.offsetX>j.clientWidth),Je=bn&&D.offsetY>j.clientHeight;if(st||Je)return}const Y=(H=s.current.floatingContext)==null?void 0:H.nodeId,Ce=w&&Us(w.nodesRef.current,Y).some($=>{var ne;return Oi(D,(ne=$.context)==null?void 0:ne.elements.floating)});if(Oi(D,o.floating)||Oi(D,o.domReference)||Ce)return;const _e=w?Us(w.nodesRef.current,Y):[];if(_e.length>0){let $=!0;if(_e.forEach(ne=>{var ge;if((ge=ne.context)!=null&&ge.open&&!ne.context.dataRef.current.__outsidePressBubbles){$=!1;return}}),!$)return}r(!1,D,"outside-press")}),L=Er(D=>{var H;const Q=()=>{var J;I(D),(J=xo(D))==null||J.removeEventListener(c,Q)};(H=xo(D))==null||H.addEventListener(c,Q)});b.useEffect(()=>{if(!n||!l)return;s.current.__escapeKeyBubbles=y,s.current.__outsidePressBubbles=x;let D=-1;function H(P){r(!1,P,"ancestor-scroll")}function Q(){window.clearTimeout(D),T.current=!0}function J(){D=window.setTimeout(()=>{T.current=!1},Xl()?5:0)}const j=qo(o.floating);a&&(j.addEventListener("keydown",k?A:E,k),j.addEventListener("compositionstart",Q),j.addEventListener("compositionend",J)),p&&j.addEventListener(c,C?L:I,C);let R=[];return d&&(De(o.domReference)&&(R=zn(o.domReference)),De(o.floating)&&(R=R.concat(zn(o.floating))),!De(o.reference)&&o.reference&&o.reference.contextElement&&(R=R.concat(zn(o.reference.contextElement)))),R=R.filter(P=>{var G;return P!==((G=j.defaultView)==null?void 0:G.visualViewport)}),R.forEach(P=>{P.addEventListener("scroll",H,{passive:!0})}),()=>{a&&(j.removeEventListener("keydown",k?A:E,k),j.removeEventListener("compositionstart",Q),j.removeEventListener("compositionend",J)),p&&j.removeEventListener(c,C?L:I,C),R.forEach(P=>{P.removeEventListener("scroll",H)}),window.clearTimeout(D)}},[s,o,a,p,c,n,r,d,l,y,x,E,k,A,I,C,L]),b.useEffect(()=>{s.current.insideReactTree=!1},[s,p,c]);const B=b.useMemo(()=>({onKeyDown:E,...f&&{[V0[h]]:D=>{r(!1,D.nativeEvent,"reference-press")},...h!=="click"&&{onClick(D){r(!1,D.nativeEvent,"reference-press")}}}}),[E,r,f,h]),K=b.useMemo(()=>{function D(H){H.button===0&&(g.current=!0)}return{onKeyDown:E,onMouseDown:D,onMouseUp:D,[U0[c]]:()=>{s.current.insideReactTree=!0}}},[E,c,s]);return b.useMemo(()=>l?{reference:B,floating:K}:{},[l,B,K])}function G0(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Vh(),s=b.useRef({}),[l]=b.useState(()=>M0()),a=F0()!=null,[u,c]=b.useState(r.reference),f=Er((m,v,w)=>{s.current.openEvent=m?v:void 0,l.emit("openchange",{open:m,event:v,reason:w,nested:a}),n==null||n(m,v,w)}),h=b.useMemo(()=>({setPositionReference:c}),[]),d=b.useMemo(()=>({reference:u||r.reference||null,floating:r.floating||null,domReference:r.reference}),[u,r.reference,r.floating]);return b.useMemo(()=>({dataRef:s,open:t,onOpenChange:f,elements:d,events:l,floatingId:o,refs:h}),[t,f,d,l,o,h])}function xn(e){e===void 0&&(e={});const{nodeId:t}=e,n=G0({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,l]=b.useState(null),[a,u]=b.useState(null),f=(o==null?void 0:o.domReference)||s,h=b.useRef(null),d=Uh();lr(()=>{f&&(h.current=f)},[f]);const m=I0({...e,elements:{...o,...a&&{reference:a}}}),v=b.useCallback(y=>{const x=De(y)?{getBoundingClientRect:()=>y.getBoundingClientRect(),getClientRects:()=>y.getClientRects(),contextElement:y}:y;u(x),m.refs.setReference(x)},[m.refs]),w=b.useCallback(y=>{(De(y)||y===null)&&(h.current=y,l(y)),(De(m.refs.reference.current)||m.refs.reference.current===null||y!==null&&!De(y))&&m.refs.setReference(y)},[m.refs]),S=b.useMemo(()=>({...m.refs,setReference:w,setPositionReference:v,domReference:h}),[m.refs,w,v]),p=b.useMemo(()=>({...m.elements,domReference:f}),[m.elements,f]),g=b.useMemo(()=>({...m,...r,refs:S,elements:p,nodeId:t}),[m,S,p,t,r]);return lr(()=>{r.dataRef.current.floatingContext=g;const y=d==null?void 0:d.nodesRef.current.find(x=>x.id===t);y&&(y.context=g)}),b.useMemo(()=>({...m,context:g,refs:S,elements:p}),[m,S,p,g])}function Fi(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[Od]:l,[Md]:a,...u}=e;s=u}return{...n==="floating"&&{tabIndex:-1,[_0]:""},...s,...t.map(l=>{const a=l?l[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((l,a)=>(a&&Object.entries(a).forEach(u=>{let[c,f]=u;if(!(o&&[Od,Md].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof f=="function"){var h;(h=r.get(c))==null||h.push(f),l[c]=function(){for(var d,m=arguments.length,v=new Array(m),w=0;w<m;w++)v[w]=arguments[w];return(d=r.get(c))==null?void 0:d.map(S=>S(...v)).find(S=>S!==void 0)}}}else l[c]=f}),l),{})}}function hr(e){e===void 0&&(e=[]);const t=e.map(a=>a==null?void 0:a.reference),n=e.map(a=>a==null?void 0:a.floating),r=e.map(a=>a==null?void 0:a.item),o=b.useCallback(a=>Fi(a,e,"reference"),t),s=b.useCallback(a=>Fi(a,e,"floating"),n),l=b.useCallback(a=>Fi(a,e,"item"),r);return b.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:l}),[o,s,l])}const mr={"m-":{category:"spacing",themeKey:"spacing",valueType:"scalar",renderMode:"boxmodel",isComposite:!0,compositeRelatedPrefixes:["m-","mx-","my-","mt-","mr-","mb-","ml-","ms-","me-","p-","px-","py-","pt-","pr-","pb-","pl-","ps-","pe-","space-x-","space-y-","border-","border-t-","border-r-","border-b-","border-l-","rounded-","rounded-t-","rounded-r-","rounded-b-","rounded-l-","rounded-tl-","rounded-tr-","rounded-br-","rounded-bl-"],compositeExactMatches:["border","rounded"]},"mx-":{category:"spacing",themeKey:"spacing",valueType:"scalar"},"my-":{category:"spacing",themeKey:"spacing",valueType:"scalar"},"mt-":{category:"spacing",themeKey:"spacing",valueType:"scalar"},"mr-":{category:"spacing",themeKey:"spacing",valueType:"scalar"},"mb-":{category:"spacing",themeKey:"spacing",valueType:"scalar"},"ml-":{category:"spacing",themeKey:"spacing",valueType:"scalar"},"ms-":{category:"spacing",themeKey:"spacing",valueType:"scalar"},"me-":{category:"spacing",themeKey:"spacing",valueType:"scalar"},"p-":{category:"spacing",themeKey:"spacing",valueType:"scalar"},"px-":{category:"spacing",themeKey:"spacing",valueType:"scalar"},"py-":{category:"spacing",themeKey:"spacing",valueType:"scalar"},"pt-":{category:"spacing",themeKey:"spacing",valueType:"scalar"},"pr-":{category:"spacing",themeKey:"spacing",valueType:"scalar"},"pb-":{category:"spacing",themeKey:"spacing",valueType:"scalar"},"pl-":{category:"spacing",themeKey:"spacing",valueType:"scalar"},"ps-":{category:"spacing",themeKey:"spacing",valueType:"scalar"},"pe-":{category:"spacing",themeKey:"spacing",valueType:"scalar"},"gap-":{category:"flexbox",themeKey:"spacing",valueType:"scalar",addable:!0,controlGroup:"flex-container",propertyKey:"gap"},"gap-x-":{category:"flexbox",themeKey:"spacing",valueType:"scalar",controlGroup:"flex-container",propertyKey:"gap-x"},"gap-y-":{category:"flexbox",themeKey:"spacing",valueType:"scalar",controlGroup:"flex-container",propertyKey:"gap-y"},"space-x-":{category:"spacing",themeKey:"spacing",valueType:"scalar"},"space-y-":{category:"spacing",themeKey:"spacing",valueType:"scalar"},"w-":{category:"sizing",themeKey:"spacing",valueType:"scalar",addable:!0,propertyKey:"width"},"h-":{category:"sizing",themeKey:"spacing",valueType:"scalar",addable:!0,propertyKey:"height"},"min-w-":{category:"sizing",themeKey:"spacing",valueType:"scalar",addable:!0,propertyKey:"min-width"},"max-w-":{category:"sizing",themeKey:"spacing",valueType:"scalar",addable:!0,propertyKey:"max-width"},"min-h-":{category:"sizing",themeKey:"spacing",valueType:"scalar",addable:!0,propertyKey:"min-height"},"max-h-":{category:"sizing",themeKey:"spacing",valueType:"scalar",addable:!0,propertyKey:"max-height"},"size-":{category:"sizing",themeKey:"spacing",valueType:"scalar",addable:!0,propertyKey:"size"},"font-":{category:"typography",themeKey:"fontWeight",valueType:"scalar",addable:!0},"text-":{category:"typography",themeKey:null,valueType:"enum"},"leading-":{category:"typography",themeKey:"lineHeight",valueType:"scalar",addable:!0},"tracking-":{category:"typography",themeKey:"letterSpacing",valueType:"scalar",addable:!0},"text-left":{category:"typography",themeKey:null,valueType:"enum",addable:!0,propertyKey:"text-align",enumAlts:["text-left","text-center","text-right","text-justify","text-start","text-end"]},"text-center":{category:"typography",themeKey:null,valueType:"enum",propertyKey:"text-align",enumAlts:["text-left","text-center","text-right","text-justify","text-start","text-end"]},"text-right":{category:"typography",themeKey:null,valueType:"enum",propertyKey:"text-align",enumAlts:["text-left","text-center","text-right","text-justify","text-start","text-end"]},"text-justify":{category:"typography",themeKey:null,valueType:"enum",propertyKey:"text-align",enumAlts:["text-left","text-center","text-right","text-justify","text-start","text-end"]},"text-start":{category:"typography",themeKey:null,valueType:"enum",propertyKey:"text-align",enumAlts:["text-left","text-center","text-right","text-justify","text-start","text-end"]},"text-end":{category:"typography",themeKey:null,valueType:"enum",propertyKey:"text-align",enumAlts:["text-left","text-center","text-right","text-justify","text-start","text-end"]},italic:{category:"typography",themeKey:null,valueType:"enum",addable:!0,propertyKey:"font-style",enumAlts:["italic","not-italic"]},"not-italic":{category:"typography",themeKey:null,valueType:"enum",propertyKey:"font-style",enumAlts:["italic","not-italic"]},underline:{category:"typography",themeKey:null,valueType:"enum",addable:!0,propertyKey:"text-decoration",enumAlts:["underline","line-through","overline","no-underline"]},"line-through":{category:"typography",themeKey:null,valueType:"enum",propertyKey:"text-decoration",enumAlts:["underline","line-through","overline","no-underline"]},overline:{category:"typography",themeKey:null,valueType:"enum",propertyKey:"text-decoration",enumAlts:["underline","line-through","overline","no-underline"]},"no-underline":{category:"typography",themeKey:null,valueType:"enum",propertyKey:"text-decoration",enumAlts:["underline","line-through","overline","no-underline"]},uppercase:{category:"typography",themeKey:null,valueType:"enum",addable:!0,propertyKey:"text-transform",enumAlts:["uppercase","lowercase","capitalize","normal-case"]},lowercase:{category:"typography",themeKey:null,valueType:"enum",propertyKey:"text-transform",enumAlts:["uppercase","lowercase","capitalize","normal-case"]},capitalize:{category:"typography",themeKey:null,valueType:"enum",propertyKey:"text-transform",enumAlts:["uppercase","lowercase","capitalize","normal-case"]},"normal-case":{category:"typography",themeKey:null,valueType:"enum",propertyKey:"text-transform",enumAlts:["uppercase","lowercase","capitalize","normal-case"]},truncate:{category:"typography",themeKey:null,valueType:"enum"},"font-sans":{category:"typography",themeKey:null,valueType:"enum",addable:!0,propertyKey:"font-family",enumAlts:["font-sans","font-serif","font-mono"]},"font-serif":{category:"typography",themeKey:null,valueType:"enum",propertyKey:"font-family",enumAlts:["font-sans","font-serif","font-mono"]},"font-mono":{category:"typography",themeKey:null,valueType:"enum",propertyKey:"font-family",enumAlts:["font-sans","font-serif","font-mono"]},"align-baseline":{category:"typography",themeKey:null,valueType:"enum",addable:!0,propertyKey:"vertical-align",enumAlts:["align-baseline","align-top","align-middle","align-bottom","align-text-top","align-text-bottom","align-sub","align-super"]},"align-top":{category:"typography",themeKey:null,valueType:"enum",propertyKey:"vertical-align",enumAlts:["align-baseline","align-top","align-middle","align-bottom","align-text-top","align-text-bottom","align-sub","align-super"]},"align-middle":{category:"typography",themeKey:null,valueType:"enum",propertyKey:"vertical-align",enumAlts:["align-baseline","align-top","align-middle","align-bottom","align-text-top","align-text-bottom","align-sub","align-super"]},"align-bottom":{category:"typography",themeKey:null,valueType:"enum",propertyKey:"vertical-align",enumAlts:["align-baseline","align-top","align-middle","align-bottom","align-text-top","align-text-bottom","align-sub","align-super"]},"align-text-top":{category:"typography",themeKey:null,valueType:"enum",propertyKey:"vertical-align",enumAlts:["align-baseline","align-top","align-middle","align-bottom","align-text-top","align-text-bottom","align-sub","align-super"]},"align-text-bottom":{category:"typography",themeKey:null,valueType:"enum",propertyKey:"vertical-align",enumAlts:["align-baseline","align-top","align-middle","align-bottom","align-text-top","align-text-bottom","align-sub","align-super"]},"align-sub":{category:"typography",themeKey:null,valueType:"enum",propertyKey:"vertical-align",enumAlts:["align-baseline","align-top","align-middle","align-bottom","align-text-top","align-text-bottom","align-sub","align-super"]},"align-super":{category:"typography",themeKey:null,valueType:"enum",propertyKey:"vertical-align",enumAlts:["align-baseline","align-top","align-middle","align-bottom","align-text-top","align-text-bottom","align-sub","align-super"]},"bg-":{category:"color",themeKey:"colors",valueType:"color",renderMode:"gradient-editor",isComposite:!0,compositeRelatedPrefixes:["bg-","bg-gradient-to-","from-","via-","to-"]},"bg-gradient-to-":{category:"gradient",themeKey:null,valueType:"enum"},"from-":{category:"gradient",themeKey:"colors",valueType:"color"},"via-":{category:"gradient",themeKey:"colors",valueType:"color"},"to-":{category:"gradient",themeKey:"colors",valueType:"color"},"ring-":{category:"color",themeKey:"colors",valueType:"color"},"outline-":{category:"color",themeKey:"colors",valueType:"color"},"fill-":{category:"color",themeKey:"colors",valueType:"color"},"stroke-":{category:"color",themeKey:"colors",valueType:"color"},"decoration-":{category:"color",themeKey:"colors",valueType:"color"},border:{category:"borders",themeKey:"borderWidth",valueType:"scalar"},"border-":{category:"borders",themeKey:"borderWidth",valueType:"scalar"},"border-t-":{category:"borders",themeKey:"borderWidth",valueType:"scalar"},"border-r-":{category:"borders",themeKey:"borderWidth",valueType:"scalar"},"border-b-":{category:"borders",themeKey:"borderWidth",valueType:"scalar"},"border-l-":{category:"borders",themeKey:"borderWidth",valueType:"scalar"},rounded:{category:"borders",themeKey:"borderRadius",valueType:"scalar"},"rounded-":{category:"borders",themeKey:"borderRadius",valueType:"scalar"},"rounded-t-":{category:"borders",themeKey:"borderRadius",valueType:"scalar"},"rounded-r-":{category:"borders",themeKey:"borderRadius",valueType:"scalar"},"rounded-b-":{category:"borders",themeKey:"borderRadius",valueType:"scalar"},"rounded-l-":{category:"borders",themeKey:"borderRadius",valueType:"scalar"},"rounded-tl-":{category:"borders",themeKey:"borderRadius",valueType:"scalar"},"rounded-tr-":{category:"borders",themeKey:"borderRadius",valueType:"scalar"},"rounded-br-":{category:"borders",themeKey:"borderRadius",valueType:"scalar"},"rounded-bl-":{category:"borders",themeKey:"borderRadius",valueType:"scalar"},"opacity-":{category:"effects",themeKey:"opacity",valueType:"scalar",addable:!0},"shadow-":{category:"effects",themeKey:null,valueType:"enum"},block:{category:"layout",themeKey:null,valueType:"enum",addable:!0,propertyKey:"display",enumAlts:["block","inline-block","inline","flex","inline-flex","grid","inline-grid","hidden","table","contents"]},"inline-block":{category:"layout",themeKey:null,valueType:"enum",propertyKey:"display",enumAlts:["block","inline-block","inline","flex","inline-flex","grid","inline-grid","hidden","table","contents"]},inline:{category:"layout",themeKey:null,valueType:"enum",propertyKey:"display",enumAlts:["block","inline-block","inline","flex","inline-flex","grid","inline-grid","hidden","table","contents"]},grid:{category:"layout",themeKey:null,valueType:"enum",propertyKey:"display",enumAlts:["block","inline-block","inline","flex","inline-flex","grid","inline-grid","hidden","table","contents"]},"inline-grid":{category:"layout",themeKey:null,valueType:"enum",propertyKey:"display",enumAlts:["block","inline-block","inline","flex","inline-flex","grid","inline-grid","hidden","table","contents"]},hidden:{category:"layout",themeKey:null,valueType:"enum",propertyKey:"display",enumAlts:["block","inline-block","inline","flex","inline-flex","grid","inline-grid","hidden","table","contents"]},table:{category:"layout",themeKey:null,valueType:"enum",propertyKey:"display",enumAlts:["block","inline-block","inline","flex","inline-flex","grid","inline-grid","hidden","table","contents"]},contents:{category:"layout",themeKey:null,valueType:"enum",propertyKey:"display",enumAlts:["block","inline-block","inline","flex","inline-flex","grid","inline-grid","hidden","table","contents"]},static:{category:"layout",themeKey:null,valueType:"enum"},fixed:{category:"layout",themeKey:null,valueType:"enum"},absolute:{category:"layout",themeKey:null,valueType:"enum"},relative:{category:"layout",themeKey:null,valueType:"enum"},sticky:{category:"layout",themeKey:null,valueType:"enum"},"inset-":{category:"layout",themeKey:"spacing",valueType:"scalar"},"top-":{category:"layout",themeKey:"spacing",valueType:"scalar"},"right-":{category:"layout",themeKey:"spacing",valueType:"scalar"},"bottom-":{category:"layout",themeKey:"spacing",valueType:"scalar"},"left-":{category:"layout",themeKey:"spacing",valueType:"scalar"},"z-":{category:"layout",themeKey:null,valueType:"enum"},flex:{category:"layout",themeKey:null,valueType:"enum",controlGroup:"flex-container",propertyKey:"display",enumAlts:["block","inline-block","inline","flex","inline-flex","grid","inline-grid","hidden","table","contents"]},"inline-flex":{category:"layout",themeKey:null,valueType:"enum",controlGroup:"flex-container",propertyKey:"display",enumAlts:["block","inline-block","inline","flex","inline-flex","grid","inline-grid","hidden","table","contents"]},"flex-row":{category:"flexbox",themeKey:null,valueType:"enum",addable:!0,controlGroup:"flex-container",propertyKey:"flex-direction",enumAlts:["flex-row","flex-col","flex-row-reverse","flex-col-reverse"]},"flex-col":{category:"flexbox",themeKey:null,valueType:"enum",controlGroup:"flex-container",propertyKey:"flex-direction",enumAlts:["flex-row","flex-col","flex-row-reverse","flex-col-reverse"]},"flex-row-reverse":{category:"flexbox",themeKey:null,valueType:"enum",controlGroup:"flex-container",propertyKey:"flex-direction",enumAlts:["flex-row","flex-col","flex-row-reverse","flex-col-reverse"]},"flex-col-reverse":{category:"flexbox",themeKey:null,valueType:"enum",controlGroup:"flex-container",propertyKey:"flex-direction",enumAlts:["flex-row","flex-col","flex-row-reverse","flex-col-reverse"]},"flex-wrap":{category:"flexbox",themeKey:null,valueType:"enum",addable:!0,controlGroup:"flex-container",propertyKey:"flex-wrap",enumAlts:["flex-wrap","flex-nowrap","flex-wrap-reverse"]},"flex-nowrap":{category:"flexbox",themeKey:null,valueType:"enum",controlGroup:"flex-container",propertyKey:"flex-wrap",enumAlts:["flex-wrap","flex-nowrap","flex-wrap-reverse"]},"flex-wrap-reverse":{category:"flexbox",themeKey:null,valueType:"enum",controlGroup:"flex-container",propertyKey:"flex-wrap",enumAlts:["flex-wrap","flex-nowrap","flex-wrap-reverse"]},"flex-1":{category:"flexbox",themeKey:null,valueType:"enum"},"flex-auto":{category:"flexbox",themeKey:null,valueType:"enum"},"flex-initial":{category:"flexbox",themeKey:null,valueType:"enum"},"flex-none":{category:"flexbox",themeKey:null,valueType:"enum"},grow:{category:"flexbox",themeKey:null,valueType:"enum"},"grow-0":{category:"flexbox",themeKey:null,valueType:"enum"},shrink:{category:"flexbox",themeKey:null,valueType:"enum"},"shrink-0":{category:"flexbox",themeKey:null,valueType:"enum"},"justify-start":{category:"flexbox",themeKey:null,valueType:"enum",addable:!0,controlGroup:"flex-container",propertyKey:"justify-content",enumAlts:["justify-start","justify-end","justify-center","justify-between","justify-around","justify-evenly","justify-stretch"]},"justify-end":{category:"flexbox",themeKey:null,valueType:"enum",controlGroup:"flex-container",propertyKey:"justify-content",enumAlts:["justify-start","justify-end","justify-center","justify-between","justify-around","justify-evenly","justify-stretch"]},"justify-center":{category:"flexbox",themeKey:null,valueType:"enum",controlGroup:"flex-container",propertyKey:"justify-content",enumAlts:["justify-start","justify-end","justify-center","justify-between","justify-around","justify-evenly","justify-stretch"]},"justify-between":{category:"flexbox",themeKey:null,valueType:"enum",controlGroup:"flex-container",propertyKey:"justify-content",enumAlts:["justify-start","justify-end","justify-center","justify-between","justify-around","justify-evenly","justify-stretch"]},"justify-around":{category:"flexbox",themeKey:null,valueType:"enum",controlGroup:"flex-container",propertyKey:"justify-content",enumAlts:["justify-start","justify-end","justify-center","justify-between","justify-around","justify-evenly","justify-stretch"]},"justify-evenly":{category:"flexbox",themeKey:null,valueType:"enum",controlGroup:"flex-container",propertyKey:"justify-content",enumAlts:["justify-start","justify-end","justify-center","justify-between","justify-around","justify-evenly","justify-stretch"]},"justify-stretch":{category:"flexbox",themeKey:null,valueType:"enum",controlGroup:"flex-container",propertyKey:"justify-content",enumAlts:["justify-start","justify-end","justify-center","justify-between","justify-around","justify-evenly","justify-stretch"]},"items-start":{category:"flexbox",themeKey:null,valueType:"enum",addable:!0,controlGroup:"flex-container",propertyKey:"align-items",enumAlts:["items-start","items-end","items-center","items-baseline","items-stretch"]},"items-end":{category:"flexbox",themeKey:null,valueType:"enum",controlGroup:"flex-container",propertyKey:"align-items",enumAlts:["items-start","items-end","items-center","items-baseline","items-stretch"]},"items-center":{category:"flexbox",themeKey:null,valueType:"enum",controlGroup:"flex-container",propertyKey:"align-items",enumAlts:["items-start","items-end","items-center","items-baseline","items-stretch"]},"items-baseline":{category:"flexbox",themeKey:null,valueType:"enum",controlGroup:"flex-container",propertyKey:"align-items",enumAlts:["items-start","items-end","items-center","items-baseline","items-stretch"]},"items-stretch":{category:"flexbox",themeKey:null,valueType:"enum",controlGroup:"flex-container",propertyKey:"align-items",enumAlts:["items-start","items-end","items-center","items-baseline","items-stretch"]},"content-normal":{category:"flexbox",themeKey:null,valueType:"enum",addable:!0,propertyKey:"align-content",enumAlts:["content-normal","content-start","content-end","content-center","content-between","content-around","content-evenly","content-baseline","content-stretch"]},"content-start":{category:"flexbox",themeKey:null,valueType:"enum",propertyKey:"align-content",enumAlts:["content-normal","content-start","content-end","content-center","content-between","content-around","content-evenly","content-baseline","content-stretch"]},"content-end":{category:"flexbox",themeKey:null,valueType:"enum",propertyKey:"align-content",enumAlts:["content-normal","content-start","content-end","content-center","content-between","content-around","content-evenly","content-baseline","content-stretch"]},"content-center":{category:"flexbox",themeKey:null,valueType:"enum",propertyKey:"align-content",enumAlts:["content-normal","content-start","content-end","content-center","content-between","content-around","content-evenly","content-baseline","content-stretch"]},"content-between":{category:"flexbox",themeKey:null,valueType:"enum",propertyKey:"align-content",enumAlts:["content-normal","content-start","content-end","content-center","content-between","content-around","content-evenly","content-baseline","content-stretch"]},"content-around":{category:"flexbox",themeKey:null,valueType:"enum",propertyKey:"align-content",enumAlts:["content-normal","content-start","content-end","content-center","content-between","content-around","content-evenly","content-baseline","content-stretch"]},"content-evenly":{category:"flexbox",themeKey:null,valueType:"enum",propertyKey:"align-content",enumAlts:["content-normal","content-start","content-end","content-center","content-between","content-around","content-evenly","content-baseline","content-stretch"]},"content-baseline":{category:"flexbox",themeKey:null,valueType:"enum",propertyKey:"align-content",enumAlts:["content-normal","content-start","content-end","content-center","content-between","content-around","content-evenly","content-baseline","content-stretch"]},"content-stretch":{category:"flexbox",themeKey:null,valueType:"enum",propertyKey:"align-content",enumAlts:["content-normal","content-start","content-end","content-center","content-between","content-around","content-evenly","content-baseline","content-stretch"]},"justify-items-start":{category:"flexbox",themeKey:null,valueType:"enum",addable:!0,propertyKey:"justify-items",enumAlts:["justify-items-start","justify-items-end","justify-items-center","justify-items-stretch"]},"justify-items-end":{category:"flexbox",themeKey:null,valueType:"enum",propertyKey:"justify-items",enumAlts:["justify-items-start","justify-items-end","justify-items-center","justify-items-stretch"]},"justify-items-center":{category:"flexbox",themeKey:null,valueType:"enum",propertyKey:"justify-items",enumAlts:["justify-items-start","justify-items-end","justify-items-center","justify-items-stretch"]},"justify-items-stretch":{category:"flexbox",themeKey:null,valueType:"enum",propertyKey:"justify-items",enumAlts:["justify-items-start","justify-items-end","justify-items-center","justify-items-stretch"]},"self-auto":{category:"flexbox",themeKey:null,valueType:"enum"},"self-start":{category:"flexbox",themeKey:null,valueType:"enum"},"self-end":{category:"flexbox",themeKey:null,valueType:"enum"},"self-center":{category:"flexbox",themeKey:null,valueType:"enum"},"self-stretch":{category:"flexbox",themeKey:null,valueType:"enum"},"self-baseline":{category:"flexbox",themeKey:null,valueType:"enum"},"basis-":{category:"flexbox",themeKey:"spacing",valueType:"scalar"},"grid-cols-":{category:"flexbox",themeKey:null,valueType:"enum"},"grid-rows-":{category:"flexbox",themeKey:null,valueType:"enum"},"col-span-":{category:"flexbox",themeKey:null,valueType:"enum"},"row-span-":{category:"flexbox",themeKey:null,valueType:"enum"},"order-":{category:"flexbox",themeKey:null,valueType:"enum"}},Y0=(()=>{const e=new Map;for(const[t,n]of Object.entries(mr)){if(!n.controlGroup)continue;const r=n.propertyKey??t.replace(/-$/g,"");e.has(n.controlGroup)||e.set(n.controlGroup,new Set),e.get(n.controlGroup).add(r)}return e})(),Q0=(()=>{const e=new Map;for(const[t,n]of Object.entries(mr))n.controlGroup&&(e.has(n.controlGroup)||e.set(n.controlGroup,new Set),e.get(n.controlGroup).add(t));return e})();function X0(){const e={};for(const[t,n]of Object.entries(mr))if(n.valueType==="enum"&&n.enumAlts){const r=n.propertyKey??t.replace(/-$/g,"");for(const o of n.enumAlts)e[o]||(e[o]={alternatives:n.enumAlts,propertyKey:r})}return e}function Z0(){const e={spacing:[],sizing:[],typography:[],color:[],borders:[],effects:[],layout:[],flexbox:[],gradient:[]},t=new Set;for(const[n,r]of Object.entries(mr)){if(!r.addable)continue;const o=r.propertyKey??n.replace(/-$/g,"");if(t.has(o))continue;t.add(o);const s=o.replace(/-/g," ").replace(/\b\w/g,a=>a.toUpperCase()),l=r.enumAlts?r.enumAlts.slice(0,2).join("/")+(r.enumAlts.length>2?"/…":""):`${n}*`;e[r.category].push({name:s,prefixHint:l,prefix:n})}return e}function Ys({prefix:e,currentValue:t,colors:n,locked:r,lockedValue:o,onHover:s,onLeave:l,onClick:a,onRemove:u,onRemoveHover:c}){return i.jsxs("div",{className:"p-2 bg-bv-surface border border-bv-border rounded-md my-2",onMouseLeave:()=>{r||l()},children:[i.jsxs("div",{className:"flex items-center gap-0.5 mb-0.5",children:[i.jsx("span",{className:"w-[52px] text-[10px] text-bv-muted text-right pr-1.5 shrink-0"}),u&&i.jsx("div",{title:"Remove class",className:`w-5 h-5 rounded cursor-pointer border-2 shrink-0 transition-[border-color,transform] flex items-center justify-center ${t===""?"outline outline-2 outline-offset-2 outline-bv-orange border-transparent":"border-transparent hover:border-bv-orange hover:scale-110"}`,onMouseEnter:()=>{!r&&c&&c()},onClick:u,children:i.jsxs("svg",{viewBox:"0 0 10 10",width:"14",height:"14",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("line",{x1:"1",y1:"1",x2:"9",y2:"9",stroke:"#F5532D",strokeWidth:"1.8",strokeLinecap:"round"}),i.jsx("line",{x1:"9",y1:"1",x2:"1",y2:"9",stroke:"#F5532D",strokeWidth:"1.8",strokeLinecap:"round"})]})}),["black","white","transparent"].map(f=>n[f]!==void 0?i.jsx(Wd,{prefix:e,colorName:f,colorValue:n[f],isCurrent:f===t,isLocked:o===`${e}${f}`,locked:r,onHover:s,onClick:a},f):null)]}),zx.map(f=>{const h=n[f];return!h||typeof h!="object"?null:i.jsxs("div",{className:"flex items-center gap-0.5 mb-0.5",children:[i.jsx("span",{className:"w-[52px] text-[10px] text-bv-muted text-right pr-1.5 shrink-0",children:f}),Fx.map(d=>h[d]!==void 0?i.jsx(Wd,{prefix:e,colorName:`${f}-${d}`,colorValue:h[d],isCurrent:`${f}-${d}`===t,isLocked:o===`${e}${f}-${d}`,locked:r,onHover:s,onClick:a},`${f}-${d}`):null)]},f)})]})}function Wd({prefix:e,colorName:t,colorValue:n,isCurrent:r,isLocked:o,locked:s,onHover:l,onClick:a}){const u=`${e}${t}`,c=o?"outline outline-2 outline-offset-2 outline-bv-teal border-transparent":r?"outline outline-2 outline-offset-2 outline-bv-orange border-transparent":s?"border-transparent":"border-transparent hover:border-bv-text hover:scale-110 hover:z-10",f=t==="transparent"?{background:"repeating-conic-gradient(#808080 0% 25%, transparent 0% 50%) 50% / 8px 8px"}:{backgroundColor:n};return i.jsx("div",{title:u,className:`w-5 h-5 rounded cursor-pointer border-2 shrink-0 transition-[border-color,transform] ${c}`,style:f,onMouseEnter:()=>{s||l(u)},onClick:h=>{h.stopPropagation(),a(u)}})}const vr=b.forwardRef(function({onClose:t,children:n,...r},o){const s=b.useRef(null);return b.useEffect(()=>{var l;(l=s.current)==null||l.focus({preventScroll:!0})},[]),i.jsx("div",{ref:l=>{s.current=l,typeof o=="function"?o(l):o&&(o.current=l)},tabIndex:-1,onBlur:l=>{var a;(a=s.current)!=null&&a.contains(l.relatedTarget)||t()},onKeyDown:l=>{l.code==="Escape"&&t()},...r,children:n})}),q0=4,J0=10;function kn({values:e,currentValue:t,lockedValue:n,locked:r,ghost:o,onStart:s,onHover:l,onLeave:a,onClick:u,onRemove:c,onRemoveHover:f}){const[h,d]=b.useState(!1),[m,v]=b.useState(null),w=b.useRef(null),S=b.useRef(null),p=b.useRef(null),g=b.useRef(null),{refs:y,floatingStyles:x}=xn({open:h,strategy:"fixed",placement:"bottom-start",middleware:[hn(2),gn(),mn({padding:4})],whileElementsMounted:pn}),k=n!==null&&e.includes(n),C=m!==null?e[m]:k?n:t;b.useEffect(()=>{var K,D;h&&g.current&&((D=(K=g.current).scrollIntoView)==null||D.call(K,{block:"nearest"}))},[h]);const T=r&&!k;function E(K){if(T)return;s==null||s();const D=k?n:t,H=e.indexOf(D);S.current={startX:K.clientX,startIndex:H>=0?H:0,didScrub:!1},K.currentTarget.setPointerCapture(K.pointerId),K.preventDefault()}function A(K){const D=S.current;if(!D)return;const H=K.clientX-D.startX;if(!D.didScrub&&Math.abs(H)>q0&&(D.didScrub=!0,d(!1)),D.didScrub){const Q=Math.round(H/J0),J=Math.max(0,Math.min(e.length-1,D.startIndex+Q));w.current=J,v(J),l(e[J])}}function I(){const K=S.current;if(!K)return;const D=w.current;K.didScrub&&D!==null?u(e[D]):K.didScrub||d(H=>(H&&a(),!H)),w.current=null,v(null),S.current=null}const L=m!==null,B=L?"bg-bv-teal/9 text-bv-teal ring-1 ring-bv-teal":k?"bg-bv-surface-hi text-bv-text ring-1 ring-bv-border hover:bg-bv-teal/9 hover:text-bv-teal hover:ring-bv-teal":h?"bg-bv-surface-hi text-bv-text ring-1 ring-bv-border":T?"bg-bv-surface text-bv-text-mid":o?"border border-dashed border-bv-border text-bv-muted bg-transparent hover:border-bv-teal hover:text-bv-teal":"bg-bv-surface text-bv-text-mid hover:bg-bv-surface-hi hover:text-bv-text";return i.jsxs("div",{ref:p,className:"relative inline-block",children:[i.jsxs("div",{ref:y.setReference,className:`group select-none px-2 py-0.5 rounded-md text-[11px] font-mono transition-colors ${T?"cursor-default":"cursor-ew-resize"} ${B}`,onPointerDown:E,onPointerMove:A,onPointerUp:I,children:[!T&&i.jsx("span",{className:`inline-block mr-0.5 text-[9px] transition-opacity ${L?"opacity-100":"opacity-0 group-hover:opacity-50"}`,children:"‹"}),C,!T&&i.jsx("span",{className:`inline-block ml-0.5 text-[9px] transition-opacity ${L?"opacity-100":"opacity-0 group-hover:opacity-50"}`,children:"›"})]}),h&&i.jsx(yn,{children:i.jsxs(vr,{ref:y.setFloating,style:x,className:"z-50 max-h-52 overflow-y-auto bg-bv-bg border border-bv-border rounded-md shadow-md min-w-[5rem]",onPointerDown:K=>K.stopPropagation(),onMouseLeave:a,onClose:()=>{d(!1),a()},children:[c&&i.jsxs("div",{className:`flex items-center gap-1.5 px-2.5 py-[3px] text-[11px] font-mono cursor-pointer border-b border-bv-border text-bv-muted hover:text-red-400 ${t===""||n===""?"text-bv-orange":""}`,onMouseEnter:f,onClick:K=>{K.stopPropagation(),c(),d(!1)},children:[i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0 opacity-70",children:[i.jsx("circle",{cx:"6",cy:"6",r:"5.5"}),i.jsx("line",{x1:"4",y1:"4",x2:"8",y2:"8"}),i.jsx("line",{x1:"8",y1:"4",x2:"4",y2:"8"})]}),"remove"]}),e.map(K=>{const D=K===(n??t),H=D?"bg-bv-teal/9 text-bv-teal":"text-bv-text-mid hover:bg-bv-surface hover:text-bv-text";return i.jsx("div",{ref:D?g:void 0,className:`px-2.5 py-[3px] text-[11px] font-mono cursor-pointer ${H}`,onMouseEnter:()=>l(K),onClick:Q=>{Q.stopPropagation(),u(K),d(!1)},children:K},K)})]})})]})}const e1={px:.0625};function $r(e){return isNaN(Number(e))?e1[e]??1/0:Number(e)}function Sr(e,t,n){return t==="spacing"&&(n!=null&&n.spacing)?Object.keys(n.spacing).sort((o,s)=>$r(o)-$r(s)).map(o=>`${e}${o}`):t==="fontSize"?[..._x]:t==="fontWeight"?[...Ax]:t==="borderRadius"?Va:t==="lineHeight"?[...Lx]:t==="letterSpacing"?[...Dx]:t==="opacity"?Ox:[]}const t1=4,n1=10;function Ur({placeholder:e,values:t,currentValue:n,displayValue:r,formatValue:o,axis:s="x",disabled:l,onHover:a,onLeave:u,onClick:c,onScrubStart:f,onScrubEnd:h,onOpen:d,onClose:m,onRemove:v,onRemoveHover:w}){const[S,p]=b.useState(!1),[g,y]=b.useState(null),x=b.useRef(null),k=b.useRef(null),C=b.useRef(null),{refs:T,floatingStyles:E}=xn({open:S,strategy:"fixed",placement:"bottom-start",middleware:[hn(4),gn(),mn({padding:4})],whileElementsMounted:pn}),A=n!=null,I=n?t.indexOf(n):-1,L=g!==null?t[g]:null,B=L?o?o(L):L:r??e;b.useEffect(()=>{var P,G;S&&C.current&&((G=(P=C.current).scrollIntoView)==null||G.call(P,{block:"nearest"}))},[S]);function K(P){var Y,Ce;if(l)return;P.preventDefault(),P.stopPropagation();const G=I>=0?I:0;x.current={startX:P.clientX,startY:P.clientY,startIndex:G,didScrub:!1},(Ce=(Y=P.target).setPointerCapture)==null||Ce.call(Y,P.pointerId)}function D(P){const G=x.current;if(!G)return;const Y=s==="y"?-(P.clientY-G.startY):P.clientX-G.startX;if(!G.didScrub&&Math.abs(Y)>t1&&(G.didScrub=!0,p(!1),f==null||f()),G.didScrub){const Ce=Math.round(Y/n1),_e=Math.max(0,Math.min(t.length-1,G.startIndex+Ce));y(_e),a==null||a(t[_e])}}function H(){const P=x.current;P&&(P.didScrub&&g!==null?(c==null||c(t[g]),y(null),x.current=null,h==null||h()):P.didScrub||(y(null),x.current=null,p(G=>G?(m==null||m(),u==null||u(),!1):(d==null||d(),!0))))}const Q=g!==null,j=["bm-slot",A||Q?"bm-has-val":"",Q?"bm-scrubbing":""].filter(Boolean).join(" "),R=l?"default":s==="y"?"ns-resize":"ew-resize";return i.jsxs("span",{ref:P=>{k.current=P,T.setReference(P)},className:j,style:{position:"relative",cursor:R},onPointerDown:K,onPointerMove:D,onPointerUp:H,role:"button",tabIndex:l?-1:0,children:[B,S&&i.jsx(yn,{children:i.jsxs(vr,{ref:T.setFloating,style:E,className:"bm-mini-dropdown",onClick:P=>P.stopPropagation(),onMouseLeave:()=>u==null?void 0:u(),onPointerDown:P=>P.stopPropagation(),onMouseDown:P=>{P.stopPropagation(),P.preventDefault()},onClose:()=>{p(!1),m==null||m(),u==null||u()},children:[v&&i.jsxs("div",{className:"bm-mini-dropdown-item bm-mini-dropdown-remove",tabIndex:-1,onMouseEnter:w,onMouseDown:P=>{P.preventDefault(),v(),p(!1),m==null||m()},children:[i.jsxs("svg",{viewBox:"0 0 10 10",width:"8",height:"8",xmlns:"http://www.w3.org/2000/svg",style:{display:"inline-block",flexShrink:0},children:[i.jsx("line",{x1:"1",y1:"1",x2:"9",y2:"9",stroke:"#F5532D",strokeWidth:"1.8",strokeLinecap:"round"}),i.jsx("line",{x1:"9",y1:"1",x2:"1",y2:"9",stroke:"#F5532D",strokeWidth:"1.8",strokeLinecap:"round"})]}),"remove"]}),t.map(P=>{const G=P===n;return i.jsx("div",{ref:G?C:void 0,tabIndex:-1,className:`bm-mini-dropdown-item${G?" bm-active":""}`,onMouseEnter:()=>a==null?void 0:a(P),onMouseDown:Y=>{Y.preventDefault(),c==null||c(P),p(!1),m==null||m()},onClick:Y=>{Y.detail===0&&(Y.stopPropagation(),c==null||c(P),p(!1),m==null||m())},onKeyDown:Y=>{(Y.key==="Enter"||Y.key===" ")&&(Y.preventDefault(),c==null||c(P),p(!1),m==null||m())},children:P},P)})]})})]})}function Bd(e,t){const r={padding:"p",margin:"m",border:"border-",outline:"outline-"}[t];return e.startsWith(r)?e.slice(r.length):e}function r1({value:e,placeholder:t,layer:n,frozen:r,scaleValues:o,axis:s,onClick:l,onValueChange:a,onValueHover:u,onValueLeave:c,onScrubStart:f,onScrubEnd:h,onOpen:d,onClose:m,onValueRemove:v,onValueRemoveHover:w}){const S=e!=null,p=S?Bd(e,n):null;if(o&&o.length>0)return i.jsx(Ur,{placeholder:t,values:o,currentValue:e,displayValue:p,formatValue:y=>Bd(y,n),axis:s,disabled:r,onHover:u,onLeave:c,onClick:a,onScrubStart:f,onScrubEnd:h,onOpen:d,onClose:m,onRemove:v,onRemoveHover:w});const g=`bm-slot${S?" bm-has-val":""}`;return i.jsx("span",{className:g,onClick:r?void 0:y=>l==null?void 0:l(y.currentTarget),role:"button",tabIndex:r?-1:0,children:p??t})}const o1={top:["y","t"],right:["r"],bottom:["b"],left:["x","l"],tr:["color"],bl:["style"],br:["offset"]},s1={margin:["top","right","bottom","left"],outline:["top","right","bottom","left","tr","bl","br"],border:["top","right","bottom","left","tr","bl"],padding:["top","right","bottom","left"]},l1={top:"y",bottom:"y",left:"x",right:"x",tr:"x",bl:"x",br:"x"};function i1({layer:e,classState:t,shorthandValue:n,shorthandScaleValues:r,slots:o,isHovered:s,frozen:l,onHoverChange:a,onSlotClick:u,onSlotChange:c,onSlotHover:f,onScrubStart:h,onScrubEnd:d,onSlotOpen:m,onSlotClose:v,onSlotRemove:w,onSlotRemoveHover:S,children:p}){const g=`bm-layer bm-${e}${s?" bm-hovered":""}`,[y,x]=b.useState(null),k=new Map(o.map(B=>[B.key,B])),C=(t==="shorthand"||t==="mixed")&&n,T=r&&r.length>0?i.jsx("span",{className:"bm-name bm-name-scrubber",children:i.jsx(Ur,{placeholder:e,values:r,currentValue:C?n:null,displayValue:C?n:null,formatValue:B=>B,axis:"x",disabled:l,onHover:B=>f==null?void 0:f("shorthand",B),onLeave:()=>f==null?void 0:f("shorthand",null),onClick:B=>c==null?void 0:c("shorthand",B),onScrubStart:()=>{h==null||h()},onScrubEnd:d,onOpen:()=>{x("__shorthand__"),m==null||m()},onClose:()=>{x(null),v==null||v()},onRemove:w?()=>w("shorthand"):void 0,onRemoveHover:S?()=>S("shorthand"):void 0})}):C?i.jsx("span",{className:"bm-name",children:i.jsx("span",{className:"bm-val",onClick:B=>u==null?void 0:u("shorthand",B.currentTarget),children:n})}):i.jsx("span",{className:"bm-name",children:e}),A=(s1[e]??[]).map(B=>{const D=(o1[B]??[]).map(R=>k.get(R)).filter(R=>R!=null);if(D.length===0)return null;const H=D.some(R=>R.value!=null),J=`bm-slot-group bm-sg-${B}${H?" bm-has-values":""}${y===B?" bm-sg-active":""}`,j=l1[B];return i.jsx("div",{className:J,children:D.map(R=>i.jsx(r1,{slotKey:R.key,value:R.value,placeholder:R.placeholder,layer:e,isExpanded:s,frozen:l,scaleValues:R.scaleValues,axis:j,onClick:P=>u==null?void 0:u(R.key,P),onValueChange:c?P=>c(R.key,P):void 0,onValueHover:f?P=>f(R.key,P):void 0,onValueLeave:f?()=>f(R.key,null):void 0,onScrubStart:h,onScrubEnd:d,onOpen:()=>{x(B),m==null||m()},onClose:()=>{x(null),v==null||v()},onValueRemove:w?()=>w(R.key):void 0,onValueRemoveHover:S?()=>S(R.key):void 0},R.key))},B)}),I=B=>{B.stopPropagation(),l||a(!0)},L=B=>{const K=B.relatedTarget,D=B.currentTarget;K&&D.contains(K)||l||a(!1)};return i.jsxs("div",{className:g,onMouseOver:I,onMouseOut:L,"data-layer":e,children:[T,A,p]})}const Vd=["margin","outline","border","padding"];function a1({layers:e,frozen:t=!1,onSlotClick:n,onSlotChange:r,onSlotHover:o,onSlotRemove:s,onSlotRemoveHover:l,onEditStart:a}){const[u,c]=b.useState(null),[f,h]=b.useState(null),d=t||f!==null,m=new Map(e.map(y=>[y.layer,y])),v=(y,x)=>{d||c(x?y:null)},w=(y,x,k)=>{d||n==null||n(y,x,k)};let p=i.jsx("div",{className:"bm-content"});for(let y=Vd.length-1;y>=0;y--){const x=Vd[y],k=m.get(x);k&&(p=i.jsx(i1,{layer:k.layer,classState:k.classState,shorthandValue:k.shorthandValue,shorthandScaleValues:k.shorthandScaleValues,slots:k.slots,isHovered:u===x||f===x,frozen:d,onHoverChange:C=>v(x,C),onSlotClick:(C,T)=>w(x,C,T),onSlotChange:r?(C,T)=>r(x,C,T):void 0,onSlotHover:o?(C,T)=>o(x,C,T):void 0,onSlotRemove:s?C=>s(x,C):void 0,onSlotRemoveHover:l?C=>l(x,C):void 0,onScrubStart:()=>{h(x),a==null||a()},onScrubEnd:()=>h(null),onSlotOpen:()=>{h(x),a==null||a()},onSlotClose:()=>h(null),children:p}))}const g=`bm-root${d?" bm-frozen":""}`;return i.jsx("div",{className:g,children:p})}const u1={margin:{shorthand:"m",x:"mx",y:"my",t:"mt",r:"mr",b:"mb",l:"ml"},outline:{shorthand:"outline",x:"outline-x",y:"outline-y",t:"outline-t",r:"outline-r",b:"outline-b",l:"outline-l"},border:{shorthand:"border",x:"border-x",y:"border-y",t:"border-t",r:"border-r",b:"border-b",l:"border-l"},padding:{shorthand:"p",x:"px",y:"py",t:"pt",r:"pr",b:"pb",l:"pl"}},c1=["y","t","r","b","x","l"];function d1(e){const t=c1.map(n=>({key:n,placeholder:n}));return(e==="border"||e==="outline")&&t.push({key:"color",placeholder:"color"},{key:"style",placeholder:"style"}),e==="outline"&&t.push({key:"offset",placeholder:"offset"}),t}function f1(e,t){const n=u1[e],r=d1(e),o=t[n.shorthand]??null,s=o!=null?o===""?n.shorthand:`${n.shorthand}-${o}`:null,l=r.map(({key:d,placeholder:m})=>{let v;if(d==="color"){const p=e==="outline"?"outline-color":"border-color";v=p in t?p:void 0}else if(d==="style"){const p=e==="outline"?"outline-style":"border-style";v=p in t?p:void 0}else d==="offset"?v="outline-offset"in t?"outline-offset":void 0:v=n[d];const w=v?t[v]??null:null;let S;return(d==="color"||d==="style")&&w!=null?S=`${e==="outline"?"outline":"border"}-${w}`:S=w!=null&&v?`${v}-${w}`:null,{key:d,value:S,placeholder:m}}),a=s!=null,u=l.some(d=>(d.key==="x"||d.key==="y")&&d.value!=null),c=l.some(d=>(d.key==="t"||d.key==="r"||d.key==="b"||d.key==="l")&&d.value!=null),f=u||c;let h;return!a&&!f?h="none":a&&!f?h="shorthand":!a&&u&&!c?h="axis":a?h="mixed":h="individual",{layer:e,classState:h,shorthandValue:s,slots:l}}function p1(e,t,n){var l,a,u;if(t==="color")return[];if(t==="style"){const c=e==="outline"?"outline":"border";return $x.map(f=>`${c}-${f}`)}let r;e==="border"||e==="outline"?t==="offset"?r=(l=n==null?void 0:n.theme)!=null&&l.spacing?Object.keys(n.theme.spacing).sort((c,f)=>$r(c)-$r(f)):Ua:r=(a=n==null?void 0:n.theme)!=null&&a.borderWidth?Object.keys(n.theme.borderWidth):Eh:r=(u=n==null?void 0:n.theme)!=null&&u.spacing?Object.keys(n.theme.spacing).sort((c,f)=>$r(c)-$r(f)):Ua;const s={margin:{shorthand:"m",t:"mt",r:"mr",b:"mb",l:"ml",x:"mx",y:"my"},padding:{shorthand:"p",t:"pt",r:"pr",b:"pb",l:"pl",x:"px",y:"py"},border:{t:"border-t",r:"border-r",b:"border-b",l:"border-l",x:"border-x",y:"border-y",offset:"outline-offset"},outline:{t:"outline-t",r:"outline-r",b:"outline-b",l:"outline-l",x:"outline-x",y:"outline-y",offset:"outline-offset"}}[e][t];return s?r.map(c=>c===""?s:`${s}-${c}`):[]}function Cr(e,t){const n={};for(const l of e){let a;l.color!==void 0?a=`${l.property}-color`:l.style!==void 0?a=`${l.property}-style`:l.side!==void 0?a=l.property.length<=2?l.property+l.side:`${l.property}-${l.side}`:a=l.property;const u=l.scale??l.color??l.style??l.align??l.size??l.value??"";n[a]=u}const r={margin:"m",padding:"p",border:"border",outline:"outline"},o={margin:!1,padding:!1,border:!0,outline:!1};return["margin","outline","border","padding"].map(l=>{var h,d;const a=f1(l,n),u=a.slots.map(m=>{const v=p1(l,m.key,t);return v.length>0?{...m,scaleValues:v}:m}),f=(o[l]?(h=t==null?void 0:t.theme)!=null&&h.borderWidth?Object.keys(t.theme.borderWidth):Eh:(d=t==null?void 0:t.theme)!=null&&d.spacing?Object.keys(t.theme.spacing):Ua).map(m=>m===""?r[l]:`${r[l]}-${m}`);return{...a,slots:u,shorthandScaleValues:f}})}const h1={tl:[1,1],t:[1,2],tr:[1,3],l:[2,1],all:[2,2],r:[2,3],bl:[3,1],b:[3,2],br:[3,3]},m1={tl:"x",t:"x",tr:"x",l:"y",all:"x",r:"y",bl:"x",b:"x",br:"x"};function Ki(e){return e==="rounded"?"—":e.replace(/^rounded-/,"").replace(/^(?:tl|tr|br|bl|[trbl])-/,"")}function g1({slot:e,frozen:t,isActive:n,onSlotClick:r,onSlotChange:o,onSlotHover:s,onSlotRemove:l,onSlotRemoveHover:a,onScrubStart:u,onScrubEnd:c,onOpen:f,onClose:h}){const[d,m]=h1[e.key],v=e.value!=null,w=`cm-slot${v?" cm-has-val":""}`,S=e.key==="all"?"cm-cell cm-cell-all cm-content":`cm-cell cm-cell-${e.key}`,p={gridRow:d,gridColumn:m},g=m1[e.key];return e.scaleValues&&e.scaleValues.length>0?i.jsx("div",{className:S,style:p,children:i.jsx(Ur,{placeholder:e.placeholder,values:e.scaleValues,currentValue:e.value,displayValue:v?Ki(e.value):null,formatValue:Ki,axis:g,disabled:t,onHover:y=>s(e.key,y),onLeave:()=>s(e.key,null),onClick:y=>o(e.key,y),onScrubStart:()=>u(e.key),onScrubEnd:c,onOpen:()=>f(e.key),onClose:h,onRemove:l?()=>l(e.key):void 0,onRemoveHover:a?()=>a(e.key):void 0})}):i.jsx("div",{className:S,style:p,children:i.jsx("span",{className:w,role:"button",tabIndex:t?-1:0,onClick:t?void 0:y=>r(e.key,y.currentTarget),children:v?Ki(e.value):e.placeholder})})}function y1({state:e,frozen:t=!1,onSlotClick:n,onSlotChange:r,onSlotHover:o,onSlotRemove:s,onSlotRemoveHover:l,onEditStart:a}){const[u,c]=b.useState(null),f=t||u!==null,h=new Map(e.slots.map(w=>[w.key,w])),d=h.get("all")??{key:"all",value:e.shorthandValue,placeholder:"all",scaleValues:e.shorthandScaleValues},m=["tl","t","tr","l","all","r","bl","b","br"],v=`cm-root${f?" cm-frozen":""}${u?" cm-active":""}`;return i.jsx("div",{className:v,children:i.jsx("div",{className:"cm-grid",children:m.map(w=>{const S=w==="all"?d:h.get(w)??{key:w,value:null,placeholder:w,scaleValues:void 0};return i.jsx(g1,{slot:S,frozen:f,isActive:u===w,onSlotClick:(p,g)=>n==null?void 0:n(p,g),onSlotChange:(p,g)=>r==null?void 0:r(p,g),onSlotHover:(p,g)=>o==null?void 0:o(p,g),onSlotRemove:s,onSlotRemoveHover:l,onScrubStart:p=>{c(p),a==null||a()},onScrubEnd:()=>c(null),onOpen:p=>{c(p),a==null||a()},onClose:()=>c(null)},w)})})})}function Ud({label:e,availableProperties:t=[],onAddProperty:n,isEmpty:r=!1,classCount:o=0,children:s}){const[l,a]=b.useState(!1),[u,c]=b.useState(r),f=b.useRef(r),h=b.useRef(null);b.useEffect(()=>{f.current&&!r&&c(!1),f.current=r},[r]),b.useEffect(()=>{if(!l)return;function m(v){h.current&&!h.current.contains(v.target)&&a(!1)}return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[l]);function d(m){n==null||n(m),a(!1)}return i.jsxs("div",{className:"px-4 py-3",children:[i.jsxs("div",{className:"group/sec flex items-center gap-1.5 cursor-pointer select-none",onClick:()=>c(m=>!m),children:[i.jsx("svg",{className:`w-3 h-3 text-bv-muted transition-transform ${u?"":"rotate-90"}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 5l7 7-7 7"})}),i.jsx("span",{className:"text-[10px] font-semibold text-bv-text",children:e}),u&&o>0&&i.jsx("span",{className:"ml-1 px-1.5 py-0.5 rounded-full text-[9px] font-semibold leading-none bg-bv-teal/20 text-bv-teal tabular-nums",children:o}),t.length>0&&i.jsxs("div",{ref:h,className:"relative ml-auto",children:[i.jsx("button",{type:"button","aria-label":`Add ${e} property`,className:`w-5 h-5 flex items-center justify-center rounded transition-all cursor-pointer border-none ${l?"text-bv-text bg-bv-surface-hi":"text-bv-muted bg-transparent opacity-75 group-hover/sec:opacity-100 hover:text-bv-text hover:bg-bv-surface-hi"}`,onClick:m=>{m.stopPropagation(),a(v=>!v)},children:i.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M12 5v14m-7-7h14"})})}),l&&i.jsx(vr,{className:"absolute z-50 top-[calc(100%+2px)] right-0 bg-bv-bg border border-bv-border rounded-md shadow-[0_4px_16px_rgba(0,0,0,0.10)] min-w-[180px] max-w-[calc(100vw-16px)] py-1",onClose:()=>a(!1),children:t.map(m=>i.jsxs("button",{type:"button",className:"w-full px-2.5 py-[5px] text-[11px] font-[family-name:var(--font-ui)] text-bv-text-mid flex items-center gap-1.5 transition-colors hover:bg-bv-teal/10 hover:text-bv-teal cursor-pointer border-none bg-transparent text-left whitespace-nowrap",onClick:()=>d(m.prefix),children:[m.name,i.jsx("span",{className:"font-mono text-[10px] text-bv-muted group-hover:text-bv-teal/60",children:m.prefixHint})]},m.prefix))})]})]}),i.jsx("div",{className:`overflow-hidden transition-[max-height,opacity] duration-200 ease-in-out ${u?"max-h-0 opacity-0":"max-h-[600px] opacity-100"}`,children:r?i.jsxs("div",{className:"text-[10px] text-bv-muted italic mt-2",children:["No ",e.toLowerCase()," classes — click + to add"]}):i.jsx("div",{className:"flex flex-wrap gap-1 mt-2.5",children:s})})]})}const x1=[{dir:"tl",arrow:"↖"},{dir:"t",arrow:"↑"},{dir:"tr",arrow:"↗"},{dir:"l",arrow:"←"},"center",{dir:"r",arrow:"→"},{dir:"bl",arrow:"↙"},{dir:"b",arrow:"↓"},{dir:"br",arrow:"↘"}];function v1({direction:e,mode:t,onHover:n,onLeave:r,onDirectionClick:o,onSolidClick:s,solidColorName:l}){const a=t==="solid";return i.jsxs("div",{className:"flex flex-col items-center shrink-0",children:[i.jsx("div",{className:"grid grid-cols-3 gap-0.5",onMouseLeave:r,children:x1.map((u,c)=>{if(u==="center"){const h=a;return i.jsx("button",{type:"button",className:`w-5 h-5 rounded-[3px] flex items-center justify-center text-xs cursor-pointer transition-all duration-150
58
+ ${h?"border-[1.5px] border-bv-teal bg-bv-teal text-white":"border-[1.5px] border-bv-border bg-bv-bg text-bv-muted hover:border-bv-teal hover:bg-bv-teal/9 hover:text-bv-teal"}`,title:"Solid color",onClick:s,children:"●"},"center")}const f=!a&&e===u.dir;return i.jsx("button",{type:"button",className:`w-5 h-5 rounded-[3px] flex items-center justify-center text-[10px] cursor-pointer transition-all duration-150
59
+ ${a?"opacity-35 hover:opacity-100":""}
60
+ ${f?"border-[1.5px] border-bv-teal bg-bv-teal text-white":"border-[1.5px] border-bv-border bg-bv-bg text-bv-muted hover:border-bv-teal hover:bg-bv-teal/9 hover:text-bv-teal"}`,onMouseEnter:()=>n(u.dir),onClick:()=>o(u.dir),children:u.arrow},u.dir)})}),i.jsx("div",{className:"text-[10px] font-mono text-bv-text-mid mt-0.75 max-w-[68px] truncate text-center",children:a?l?i.jsx("span",{className:"text-bv-text font-bold",children:l}):i.jsx("span",{className:"text-bv-muted italic",children:"none"}):i.jsxs("span",{children:["to-",i.jsx("span",{className:"text-bv-teal font-bold",children:e})]})})]})}function b1(e,t){const r=[...e].sort((o,s)=>(o.position??0)-(s.position??0)).map(o=>o.position!=null?`${o.hex} ${o.position}%`:o.hex);return`linear-gradient(${t}, ${r.join(", ")})`}function Hi(e){return Math.round(Math.max(0,Math.min(100,e))/5)*5}function w1({stop:e,isEndpoint:t,isSelected:n,onDragStart:r,onClick:o,onRemove:s}){const l=b.useRef(!1),a=b.useCallback(h=>{h.preventDefault(),h.stopPropagation(),l.current=!1,r(e.id,h.clientX);const d=()=>{l.current=!0},m=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",m)};document.addEventListener("mousemove",d),document.addEventListener("mouseup",m)},[e.id,r]),u=b.useCallback(h=>{h.stopPropagation(),l.current||o(e.id,h.currentTarget)},[e.id,o]),c=b.useCallback(h=>{h.stopPropagation(),s(e.id)},[e.id,s]),f=e.position??0;return i.jsxs("div",{className:`absolute top-0 cursor-grab select-none z-10
61
+ hover:z-20
62
+ ${n?"z-25":""}`,style:{left:`${f}%`,transform:"translateX(-50%)",width:22,height:26,filter:"drop-shadow(0 1px 2px rgba(0,0,0,0.2))"},onMouseDown:a,onClick:u,title:`${e.role}-${e.colorName}${e.position!=null?` ${e.position}%`:""}`,children:[i.jsx("svg",{viewBox:"0 0 22 26",width:22,height:26,xmlns:"http://www.w3.org/2000/svg",children:i.jsx("path",{d:"M2 1 L20 1 L20 16 L11 25 L2 16 Z",fill:e.hex,stroke:n?"#00848B":"white",strokeWidth:n?2:1.5,strokeLinejoin:"round"})}),!t&&i.jsx("div",{className:"absolute -top-1.5 -right-1.5 w-3.5 h-3.5 rounded-full bg-bv-orange text-white text-[9px] leading-3.5 text-center cursor-pointer z-40 hidden group-hover/handle:block hover:block!",style:{display:void 0},onClick:c,onMouseDown:h=>h.stopPropagation(),children:"×"})]})}function S1({stops:e,direction:t,onStopDrag:n,onStopDragEnd:r,onStopClick:o,onBarClick:s,onStopRemove:l,selectedStopId:a}){const u=b.useRef(null),c=b.useRef(null),f=[...e].sort((v,w)=>(v.position??0)-(w.position??0)),h=b.useCallback((v,w)=>{const S=e.find(y=>y.id===v);if(!S)return;c.current={stopId:v,startX:w,startPos:S.position??0};const p=y=>{const x=c.current;if(!x||!u.current)return;const k=u.current.getBoundingClientRect(),T=(y.clientX-x.startX)/k.width*100,E=Hi(x.startPos+T);n(x.stopId,E)},g=y=>{document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",g);const x=c.current;if(x&&u.current){const k=u.current.getBoundingClientRect(),T=(y.clientX-x.startX)/k.width*100,E=Hi(x.startPos+T);r(x.stopId,E)}c.current=null};document.addEventListener("mousemove",p),document.addEventListener("mouseup",g)},[e,n,r]),d=b.useCallback(v=>{if(!u.current)return;const w=u.current.getBoundingClientRect(),S=(v.clientX-w.left)/w.width*100;s(Hi(S))},[s]),m=b1(f,t);return i.jsxs("div",{className:"relative flex-1 min-w-0",style:{paddingTop:28},children:[f.map((v,w)=>i.jsx(w1,{stop:v,isEndpoint:w===0||w===f.length-1,isSelected:v.id===a,onDragStart:h,onClick:o,onRemove:l},v.id)),i.jsx("div",{ref:u,className:"h-9 rounded-md cursor-pointer relative",style:{background:m,border:"1px solid rgba(0,0,0,0.08)",boxShadow:"inset 0 1px 2px rgba(0,0,0,0.06)"},onClick:d,children:i.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-lg font-bold text-white/0 hover:text-white/60 transition-colors pointer-events-none",children:"+"})})]})}const C1={t:"to top",tr:"to top right",r:"to right",br:"to bottom right",b:"to bottom",bl:"to bottom left",l:"to left",tl:"to top left"};function k1(e){var Je,lt;const{direction:t,stops:n,mode:r,solidColorName:o,solidColorHex:s,onPreview:l,onPreviewBatch:a,onRevert:u,onStage:c}=e,[f,h]=b.useState(t),[d,m]=b.useState(n),[v,w]=b.useState(r),[S,p]=b.useState(o),[g,y]=b.useState(s),[x,k]=b.useState(null),[C,T]=b.useState(!1),[E,A]=b.useState(null),[I,L]=b.useState(null),B=b.useRef(n.length+1),K=b.useCallback(X=>{if(v==="gradient")l(`bg-gradient-to-${f}`,`bg-gradient-to-${X}`);else{const oe=S??"slate-500",ie=S?`bg-${S}`:"";a([{oldClass:ie,newClass:`bg-gradient-to-${X}`},{oldClass:"",newClass:`from-${oe}`},{oldClass:"",newClass:`to-${oe}`}])}},[f,v,S,l,a]),D=b.useCallback(()=>{u()},[u]),H=b.useCallback(X=>{if(h(X),w("gradient"),v==="gradient"&&d.length>=2){const oe=`bg-gradient-to-${f}`,ie=`bg-gradient-to-${X}`;c(oe,ie)}else{const oe=S??"slate-500",ie=g??rr(oe,e.colors),N={id:"1",role:"from",colorName:oe,hex:ie,position:0},O={id:"2",role:"to",colorName:oe,hex:ie,position:100};B.current=3,m([N,O]);const z=S?`bg-${S}`:"";c(z,`bg-gradient-to-${X}`),c("",`from-${oe}`),c("",`to-${oe}`)}},[f,v,d,S,g,e.colors,c]),Q=b.useCallback(()=>{w("solid"),T(!1),k(null),A(null),d.length>0&&!S&&(p(d[0].colorName),y(d[0].hex))},[d,S]),J=b.useCallback((X,oe)=>{m(N=>N.map(O=>O.id===X?{...O,position:oe}:O));const ie=d.find(N=>N.id===X);if(ie){const N=ie.position!=null?`${ie.role}-${ie.position}%`:"",O=`${ie.role}-${oe}%`;l(N,O)}},[d,l]),j=b.useCallback((X,oe)=>{m(N=>N.map(O=>O.id===X?{...O,position:oe}:O));const ie=d.find(N=>N.id===X);if(ie){const N=ie.position!=null?`${ie.role}-${ie.position}%`:"",O=`${ie.role}-${oe}%`;c(N,O)}},[d,c]),R=b.useCallback((X,oe)=>{x===X&&C?(k(null),T(!1),A(null),L(null)):(k(X),T(!0),A("stop"),L(oe))},[x,C]),P=b.useCallback(X=>{const oe=String(B.current++),ie=[...d].sort((z,ee)=>(z.position??0)-(ee.position??0));let N=ie[0];for(const z of ie)(z.position??0)<=X&&(N=z);const O={id:oe,role:"via",colorName:(N==null?void 0:N.colorName)??"gray-500",hex:(N==null?void 0:N.hex)??"#6B7280",position:X};m(z=>[...z,O]),k(oe),T(!0),A("stop")},[d]),G=b.useCallback(X=>{const oe=d.find(N=>N.id===X);if(!oe)return;const ie=d.filter(N=>N.id!==X);if(k(null),T(!1),A(null),L(null),ie.length>=2)m(ie),c(`${oe.role}-${oe.colorName}`,"");else if(ie.length===1){const N=ie[0];m([]),w("solid"),p(N.colorName),y(N.hex),c(`bg-gradient-to-${f}`,""),d.forEach(O=>c(`${O.role}-${O.colorName}`,"")),c("",`bg-${N.colorName}`)}else m([]),w("none"),p(null),y(null),c(`bg-gradient-to-${f}`,""),d.forEach(N=>c(`${N.role}-${N.colorName}`,""))},[d,f,c]),Y=b.useCallback(X=>{T(!0),A("solid"),k(null),L(X)},[]),Ce=b.useCallback(()=>{l(S?`bg-${S}`:"","")},[S,l]),_e=b.useCallback(()=>{S&&c(`bg-${S}`,""),p(null),y(null),T(!1),A(null),L(null)},[S,c]),$=b.useCallback(X=>{if(E==="stop"&&x){const oe=d.find(ie=>ie.id===x);oe&&l(`${oe.role}-${oe.colorName}`,X)}else E==="solid"&&l(`bg-${S}`,X)},[E,x,d,S,l]),ne=b.useCallback(()=>{u()},[u]),ge=b.useCallback(X=>{if(E==="stop"&&x){const oe=d.find(ie=>ie.id===x);if(oe){const ie=oe.role+"-",N=X.startsWith(ie)?X.slice(ie.length):X;m(O=>O.map(z=>z.id===x?{...z,colorName:N,hex:rr(N,e.colors)}:z)),c(`${oe.role}-${oe.colorName}`,`${oe.role}-${N}`),T(!1),k(null),A(null),L(null)}}else if(E==="solid"){const oe="bg-",ie=X.startsWith(oe)?X.slice(oe.length):X,N=S?`bg-${S}`:"";p(ie),y(rr(ie,e.colors)),c(N,`bg-${ie}`),T(!1),A(null),L(null)}},[E,x,d,S,c,e.colors]),q=b.useCallback(()=>{T(!1),k(null),A(null),L(null),u()},[u]),Gn=E==="stop"&&x?(((Je=d.find(X=>X.id===x))==null?void 0:Je.role)??"from")+"-":"bg-",bn=E==="stop"&&x?((lt=d.find(X=>X.id===x))==null?void 0:lt.colorName)??"":S??"",ae=C1[f],st=!!(x?d.find(X=>X.id===x):null);return{direction:f,stops:d,mode:v,solidColorName:S,solidColorHex:g,selectedStopId:x,colorPickerOpen:C,editingTarget:E,anchorEl:I,colorPrefix:Gn,colorPickerCurrentValue:bn,directionCSS:ae,selectedStopIsRemovable:st,handleDirectionHover:K,handleDirectionLeave:D,handleDirectionClick:H,handleSolidToggle:Q,handleStopDrag:J,handleStopDragEnd:j,handleStopClick:R,handleBarClick:P,handleStopRemove:G,handleSwatchClick:Y,handleHoverRemoveSolid:Ce,handleRemoveSolid:_e,handleColorHover:$,handleColorLeave:ne,handleColorClick:ge,handleCloseColorPicker:q}}function rr(e,t){if(console.log(`[resolveColorHex] Looking up colorName="${e}", available top-level keys:`,Object.keys(t).join(", ")),typeof t[e]=="string")return console.log(`[resolveColorHex] Found direct match: colors["${e}"] = "${t[e]}"`),t[e];if(t[e]&&typeof t[e]=="object"&&typeof t[e].DEFAULT=="string")return console.log(`[resolveColorHex] Found DEFAULT match: colors["${e}"].DEFAULT = "${t[e].DEFAULT}"`),t[e].DEFAULT;const n=e.lastIndexOf("-");if(n>0){const r=e.slice(0,n),o=e.slice(n+1);if(console.log(`[resolveColorHex] Trying hue="${r}" shade="${o}", colors["${r}"] =`,typeof t[r],t[r]?Object.keys(t[r]).slice(0,5).join(", "):"undefined"),t[r]&&typeof t[r][o]=="string")return console.log(`[resolveColorHex] Found hue-shade match: colors["${r}"]["${o}"] = "${t[r][o]}"`),t[r][o]}return console.warn(`[resolveColorHex] FALLBACK #888888 for colorName="${e}" — color not found in config`),"#888888"}function E1(e){const t=k1(e),n=t.mode==="solid",{refs:r,floatingStyles:o,context:s}=xn({open:t.colorPickerOpen,onOpenChange:u=>{u||t.handleCloseColorPicker()},strategy:"fixed",placement:"bottom-start",middleware:[hn(4),gn(),mn({padding:8}),eu({apply({availableHeight:u,elements:c}){Object.assign(c.floating.style,{maxHeight:`${u}px`})},padding:8})],whileElementsMounted:pn}),l=pr(s),{getFloatingProps:a}=hr([l]);return b.useEffect(()=>{t.anchorEl&&r.setReference(t.anchorEl)},[t.anchorEl]),i.jsxs("div",{className:"group",children:[i.jsxs("div",{className:"flex items-start gap-2.5 mb-2",children:[i.jsx(v1,{direction:t.direction,mode:t.mode,onHover:t.handleDirectionHover,onLeave:t.handleDirectionLeave,onDirectionClick:t.handleDirectionClick,onSolidClick:t.handleSolidToggle,solidColorName:t.solidColorName}),n?i.jsx("div",{className:"flex-1 min-w-0 self-stretch rounded-md cursor-pointer relative overflow-hidden",style:{background:t.solidColorHex??"transparent",border:"1px solid rgba(255,255,255,0.12)",boxShadow:"inset 0 1px 2px rgba(0,0,0,0.06)",minHeight:36},onClick:u=>t.handleSwatchClick(u.currentTarget),title:t.solidColorName?`bg-${t.solidColorName}`:"Click to pick color",children:!t.solidColorHex&&i.jsxs("svg",{className:"absolute inset-0 w-full h-full",viewBox:"0 0 100 100",preserveAspectRatio:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("line",{x1:"4",y1:"4",x2:"96",y2:"96",stroke:"#F5532D",strokeWidth:"3",strokeLinecap:"round"}),i.jsx("line",{x1:"96",y1:"4",x2:"4",y2:"96",stroke:"#F5532D",strokeWidth:"3",strokeLinecap:"round"})]})}):i.jsx(S1,{stops:t.stops,direction:t.directionCSS,onStopDrag:t.handleStopDrag,onStopDragEnd:t.handleStopDragEnd,onStopClick:t.handleStopClick,onBarClick:t.handleBarClick,onStopRemove:t.handleStopRemove,selectedStopId:t.selectedStopId})]}),t.colorPickerOpen&&i.jsx(yn,{children:i.jsxs("div",{ref:r.setFloating,style:{...o,zIndex:9999,overflowY:"auto"},...a(),children:[i.jsx(Ys,{prefix:t.colorPrefix,currentValue:t.colorPickerCurrentValue,colors:e.colors,locked:!1,lockedValue:null,onHover:t.handleColorHover,onLeave:t.handleColorLeave,onClick:t.handleColorClick,onRemove:t.editingTarget==="solid"?t.handleRemoveSolid:void 0,onRemoveHover:t.editingTarget==="solid"?t.handleHoverRemoveSolid:void 0}),t.selectedStopIsRemovable&&i.jsx("button",{type:"button",className:"mt-1.5 w-full text-[10px] text-bv-orange border border-bv-orange/40 rounded px-2 py-0.5 cursor-pointer hover:bg-bv-orange hover:text-white transition-colors",onClick:()=>{t.selectedStopId&&t.handleStopRemove(t.selectedStopId)},children:"Remove stop"})]})}),i.jsx("div",{className:"min-h-[1rem] text-[10px] text-bv-muted italic opacity-0 invisible transition-opacity duration-150 group-hover:opacity-100 group-hover:visible group-focus-within:opacity-100 group-focus-within:visible",children:n?"Click the swatch to change color · Click a direction arrow for gradient":"Click handles to change color · Drag to reposition · Click bar to add stop"})]})}function j1(e,t,n){var y;const r=new Map;for(const x of e)r.set(x.fullClass,!0);if(n)for(const x of n)x.kind==="class-change"&&x.status==="staged"&&(x.originalClass&&r.delete(x.originalClass),x.newClass&&r.set(x.newClass,!0));const o=e.find(x=>x.property==="bg-gradient-to"),s=Array.from(r.keys()).find(x=>x.startsWith("bg-gradient-to-")),a=(s==null?void 0:s.replace("bg-gradient-to-",""))||(o==null?void 0:o.fullClass.slice(15))||"r",c=((y=Array.from(r.keys()).filter(x=>x.startsWith("bg-")&&!x.startsWith("bg-gradient-to-"))[0])==null?void 0:y.replace("bg-",""))??null,f=(c==null?void 0:c.split("/")[0])??null,h=f?rr(f,t):null,d=Array.from(r.keys()),m=d.filter(x=>x.startsWith("from-")),v=d.filter(x=>x.startsWith("via-")),w=d.filter(x=>x.startsWith("to-")),S=!!(s||m.length>0&&w.length>0),p=S?"gradient":"solid",g=[];if(S){let x=1;for(const k of m){const C=k.replace("from-",""),T=C.split("/")[0];g.push({id:String(x++),role:"from",colorName:C,hex:rr(T,t),position:null})}for(const k of v){const C=k.replace("via-",""),T=C.split("/")[0];g.push({id:String(x++),role:"via",colorName:C,hex:rr(T,t),position:null})}for(const k of w){const C=k.replace("to-",""),T=C.split("/")[0];g.push({id:String(x++),role:"to",colorName:C,hex:rr(T,t),position:null})}}return{direction:a,stops:g,mode:p,solidColorName:c,solidColorHex:h,colors:t}}const He="#00848B",gr="rgba(0,132,139,0.18)",T1="#F5532D",Et="#4a4a4a",Wn="#333333",ze="#999999",nt="'Roboto Mono', 'Menlo', ui-monospace, monospace",Ht={width:60,height:60,borderRadius:5,borderWidth:"1.5px",borderStyle:"solid",borderColor:Et,background:Wn,display:"flex",padding:4,overflow:"hidden",transition:"border-color 150ms ease-in-out, background-color 150ms ease-in-out, box-shadow 150ms ease-in-out",boxSizing:"border-box"},tu={background:He,opacity:.65,borderRadius:2,flexShrink:0,transition:"opacity 150ms ease-in-out"},Gd={...tu,opacity:.9},Yh={flexShrink:0,background:T1,opacity:.18,borderRadius:1,transition:"opacity 150ms ease-in-out"},N1={...Yh,opacity:.38};function Zt({label:e,isActive:t,containerStyle:n,onClick:r,onHover:o,children:s}){const[l,a]=b.useState(!1),u=t||l,c={...Ht,borderColor:u?He:Et,background:u?gr:Wn,boxShadow:t?"0 0 0 2px rgba(0,132,139,0.35)":"none",...n};return i.jsxs("div",{className:"cursor-pointer",style:{display:"flex",flexDirection:"column",alignItems:"center",gap:3},onMouseEnter:()=>{a(!0),o==null||o()},onMouseLeave:()=>a(!1),onClick:r,children:[i.jsx("div",{style:c,children:s(u)}),i.jsx("span",{style:{fontSize:9,fontFamily:nt,color:u?He:ze,fontWeight:u?600:400,textAlign:"center",transition:"color 150ms ease-in-out"},children:e})]})}const Wi=[{value:"flex-row",label:"row",arrow:"→"},{value:"flex-col",label:"col",arrow:"↓"},{value:"flex-row-reverse",label:"row-reverse",arrow:"←"},{value:"flex-col-reverse",label:"col-reverse",arrow:"↑"}];function Qh({direction:e,color:t}){const n={stroke:t,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",fill:"none"};switch(e){case"flex-row":return i.jsxs("svg",{width:"30",height:"30",viewBox:"0 0 30 30",children:[i.jsx("line",{x1:"5",y1:"15",x2:"25",y2:"15",...n}),i.jsx("polyline",{points:"19,9 25,15 19,21",...n})]});case"flex-col":return i.jsxs("svg",{width:"30",height:"30",viewBox:"0 0 30 30",children:[i.jsx("line",{x1:"15",y1:"5",x2:"15",y2:"25",...n}),i.jsx("polyline",{points:"9,19 15,25 21,19",...n})]});case"flex-row-reverse":return i.jsxs("svg",{width:"30",height:"30",viewBox:"0 0 30 30",children:[i.jsx("line",{x1:"25",y1:"15",x2:"5",y2:"15",...n}),i.jsx("polyline",{points:"11,9 5,15 11,21",...n})]});case"flex-col-reverse":return i.jsxs("svg",{width:"30",height:"30",viewBox:"0 0 30 30",children:[i.jsx("line",{x1:"15",y1:"25",x2:"15",y2:"5",...n}),i.jsx("polyline",{points:"9,11 15,5 21,11",...n})]})}}function R1({currentValue:e,lockedValue:t,locked:n,onHover:r,onLeave:o,onClick:s}){const[l,a]=b.useState(!1),{refs:u,floatingStyles:c,context:f}=xn({open:l,onOpenChange:C=>{C||(a(!1),o())},strategy:"fixed",placement:"bottom-start",middleware:[hn(4),gn(),mn({padding:8})],whileElementsMounted:pn}),h=pr(f),{getReferenceProps:d,getFloatingProps:m}=hr([h]),v=t!==null&&Wi.some(C=>C.value===t),w=n&&!v,S=v?t:e??"",p=Wi.find(C=>C.value===S),g=!p;function y(){a(!1),o()}function x(){w||a(C=>(C&&o(),!C))}const k=g?{...Ht,borderStyle:"dashed",borderColor:l?He:Et,background:l?gr:"transparent",alignItems:"center",justifyContent:"center",cursor:w?"default":"pointer"}:{...Ht,borderColor:l?He:Et,background:l?gr:Wn,boxShadow:l?"0 0 0 2px rgba(0,132,139,0.18)":"none",alignItems:"center",justifyContent:"center",cursor:w?"default":"pointer"};return i.jsxs("div",{style:{display:"inline-flex",flexDirection:"column",gap:2},children:[i.jsx("span",{style:{fontSize:9,fontFamily:nt,color:ze,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Direction"}),i.jsxs("div",{ref:u.setReference,role:"button",tabIndex:w?-1:0,"aria-label":"Direction",style:{display:"flex",flexDirection:"column",alignItems:"center",gap:3},onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&x()},onClick:x,...d(),children:[i.jsx("div",{style:k,children:p?i.jsx(Qh,{direction:p.value,color:l?He:ze}):i.jsx("span",{style:{fontSize:10,fontFamily:nt,color:ze},children:"—"})}),i.jsx("span",{style:{fontSize:9,fontFamily:nt,color:l?He:ze,fontWeight:l?600:400,textAlign:"center",transition:"color 150ms ease-in-out"},children:(p==null?void 0:p.label)??"—"})]}),l&&i.jsx(yn,{children:i.jsx("div",{ref:u.setFloating,style:c,className:"z-[9999]",...m(),children:i.jsx(vr,{style:{background:"#1e1e1e",border:`1px solid ${Et}`,borderRadius:8,boxShadow:"0 4px 16px rgba(0,0,0,0.35)",padding:8},onMouseLeave:o,onClose:y,children:i.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 60px)",gap:4},children:Wi.map(C=>{const T=C.value===S;return i.jsx(P1,{option:C,isActive:T,onHover:()=>r(C.value),onClick:()=>{s(C.value),y()}},C.value)})})})})})]})}function P1({option:e,isActive:t,onHover:n,onClick:r}){const[o,s]=b.useState(!1),l=t||o,a={...Ht,borderColor:l?He:Et,background:l?gr:Wn,boxShadow:t?"0 0 0 2px rgba(0,132,139,0.35)":"none",alignItems:"center",justifyContent:"center"};return i.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:3,cursor:"pointer"},onMouseEnter:()=>{s(!0),n()},onMouseLeave:()=>s(!1),onClick:r,children:[i.jsx("div",{style:a,children:i.jsx(Qh,{direction:e.value,color:l?He:ze})}),i.jsx("span",{style:{fontSize:9,fontFamily:nt,color:l?He:ze,fontWeight:l?600:400,textAlign:"center",transition:"color 150ms ease-in-out"},children:e.label})]})}const Bi=[{value:"flex-nowrap",label:"no-wrap"},{value:"flex-wrap",label:"wrap"},{value:"flex-wrap-reverse",label:"wrap-reverse"}],I1=e=>({stroke:e,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",fill:"none"});function Xh({mode:e,color:t}){const n=I1(t),r={...n,strokeDasharray:"2 3"};return e==="flex-nowrap"?i.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",children:[i.jsx("line",{x1:"3",y1:"7",x2:"37",y2:"7",...n}),i.jsx("polyline",{points:"31,1 37,7 31,13",...n})]}):e==="flex-wrap"?i.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",children:[i.jsx("line",{x1:"3",y1:"7",x2:"37",y2:"7",...n}),i.jsx("line",{x1:"37",y1:"7",x2:"3",y2:"33",...r}),i.jsx("line",{x1:"3",y1:"33",x2:"37",y2:"33",...n}),i.jsx("polyline",{points:"31,27 37,33 31,39",...n})]}):i.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",children:[i.jsx("line",{x1:"3",y1:"33",x2:"37",y2:"33",...n}),i.jsx("line",{x1:"37",y1:"33",x2:"3",y2:"7",...r}),i.jsx("line",{x1:"3",y1:"7",x2:"37",y2:"7",...n}),i.jsx("polyline",{points:"31,1 37,7 31,13",...n})]})}function _1({option:e,isActive:t,onHover:n,onClick:r}){const[o,s]=b.useState(!1),l=t||o,a={...Ht,borderColor:l?He:Et,background:l?gr:Wn,boxShadow:t?"0 0 0 2px rgba(0,132,139,0.35)":"none",alignItems:"center",justifyContent:"center"};return i.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:3,cursor:"pointer"},onMouseEnter:()=>{s(!0),n()},onMouseLeave:()=>s(!1),onClick:r,children:[i.jsx("div",{style:a,children:i.jsx(Xh,{mode:e.value,color:l?He:ze})}),i.jsx("span",{style:{fontSize:9,fontFamily:nt,color:l?He:ze,fontWeight:l?600:400,textAlign:"center",transition:"color 150ms ease-in-out"},children:e.label})]})}function A1({currentValue:e,lockedValue:t,locked:n,onHover:r,onLeave:o,onClick:s}){const[l,a]=b.useState(!1),{refs:u,floatingStyles:c,context:f}=xn({open:l,onOpenChange:C=>{C||(a(!1),o())},strategy:"fixed",placement:"bottom-start",middleware:[hn(4),gn(),mn({padding:8})],whileElementsMounted:pn}),h=pr(f),{getReferenceProps:d,getFloatingProps:m}=hr([h]),v=t!==null&&Bi.some(C=>C.value===t),w=n&&!v,S=!v&&e===null,p=v?t:e??"",g=Bi.find(C=>C.value===p),y=(g==null?void 0:g.label)??"Wrap";function x(){a(!1),o()}function k(){w||a(C=>(C&&o(),!C))}return i.jsxs("div",{style:{display:"inline-flex",flexDirection:"column",gap:2},children:[i.jsx("span",{style:{fontSize:9,fontFamily:nt,color:ze,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Wrap"}),i.jsxs("div",{ref:u.setReference,role:"button",tabIndex:w?-1:0,"aria-label":"Wrap",style:{display:"flex",flexDirection:"column",alignItems:"center",gap:3},onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&k()},onClick:k,...d(),children:[S?i.jsx("div",{style:{...Ht,borderStyle:"dashed",borderColor:l?He:Et,background:l?gr:"transparent",alignItems:"center",justifyContent:"center"},children:i.jsx("span",{style:{fontSize:10,fontFamily:nt,color:ze},children:"—"})}):i.jsx("div",{style:{...Ht,borderColor:l?He:Et,background:l?gr:Wn,boxShadow:l?"0 0 0 2px rgba(0,132,139,0.18)":"none",alignItems:"center",justifyContent:"center"},children:i.jsx(Xh,{mode:p,color:l?He:ze})}),i.jsx("span",{style:{fontSize:9,fontFamily:nt,color:l?He:ze,fontWeight:l?600:400,textAlign:"center",transition:"color 150ms ease-in-out"},children:y})]}),l&&i.jsx(yn,{children:i.jsx("div",{ref:u.setFloating,style:c,className:"z-[9999]",...m(),children:i.jsx(vr,{style:{background:"#1e1e1e",border:`1px solid ${Et}`,borderRadius:8,boxShadow:"0 4px 16px rgba(0,0,0,0.35)",padding:8},onMouseLeave:o,onClose:x,children:i.jsx("div",{className:"grid gap-1",style:{gridTemplateColumns:"repeat(3, 60px)"},children:Bi.map(C=>{const T=C.value===p;return i.jsx(_1,{option:C,isActive:T,onHover:()=>r(C.value),onClick:()=>{s(C.value),x()}},C.value)})})})})})]})}function L1({flexDirection:e="row",activeValue:t,onSelect:n,onHover:r}){const o=e.startsWith("column"),s=e;function l(d,m){const v=m?Gd:tu;return o?{...v,width:"100%",height:d}:{...v,width:d,height:"100%"}}function a(d){const m=d?Gd:tu;return o?{...m,flex:1,width:"100%"}:{...m,flex:1,height:"100%"}}function u(d,m){return{...m?N1:Yh,flex:d}}const c=d=>t===d,f=d=>()=>n==null?void 0:n(d),h=d=>()=>r==null?void 0:r(d);return i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 60px)",gap:4},children:[i.jsx(Zt,{label:"start",isActive:c("justify-start"),onClick:f("justify-start"),onHover:h("justify-start"),containerStyle:{flexDirection:s,justifyContent:"flex-start",gap:2},children:d=>i.jsxs(i.Fragment,{children:[i.jsx("div",{style:l(10,d)}),i.jsx("div",{style:l(14,d)}),i.jsx("div",{style:l(8,d)})]})}),i.jsx(Zt,{label:"center",isActive:c("justify-center"),onClick:f("justify-center"),onHover:h("justify-center"),containerStyle:{flexDirection:s,justifyContent:"center",gap:2},children:d=>i.jsxs(i.Fragment,{children:[i.jsx("div",{style:l(10,d)}),i.jsx("div",{style:l(14,d)}),i.jsx("div",{style:l(8,d)})]})}),i.jsx(Zt,{label:"stretch",isActive:c("justify-stretch"),onClick:f("justify-stretch"),onHover:h("justify-stretch"),containerStyle:{flexDirection:s,gap:2},children:d=>i.jsxs(i.Fragment,{children:[i.jsx("div",{style:a(d)}),i.jsx("div",{style:a(d)}),i.jsx("div",{style:a(d)})]})}),i.jsx(Zt,{label:"between",isActive:c("justify-between"),onClick:f("justify-between"),onHover:h("justify-between"),containerStyle:{flexDirection:s},children:d=>i.jsxs(i.Fragment,{children:[i.jsx("div",{style:l(12,d)}),i.jsx("div",{style:u(1,d)}),i.jsx("div",{style:l(12,d)})]})}),i.jsx(Zt,{label:"around",isActive:c("justify-around"),onClick:f("justify-around"),onHover:h("justify-around"),containerStyle:{flexDirection:s},children:d=>i.jsxs(i.Fragment,{children:[i.jsx("div",{style:u(1,d)}),i.jsx("div",{style:l(12,d)}),i.jsx("div",{style:u(2,d)}),i.jsx("div",{style:l(12,d)}),i.jsx("div",{style:u(1,d)})]})}),i.jsx(Zt,{label:"evenly",isActive:c("justify-evenly"),onClick:f("justify-evenly"),onHover:h("justify-evenly"),containerStyle:{flexDirection:s},children:d=>i.jsxs(i.Fragment,{children:[i.jsx("div",{style:u(1,d)}),i.jsx("div",{style:l(12,d)}),i.jsx("div",{style:u(1,d)}),i.jsx("div",{style:l(12,d)}),i.jsx("div",{style:u(1,d)})]})}),i.jsx(Zt,{label:"end",isActive:c("justify-end"),onClick:f("justify-end"),onHover:h("justify-end"),containerStyle:{flexDirection:s,justifyContent:"flex-end",gap:2},children:d=>i.jsxs(i.Fragment,{children:[i.jsx("div",{style:l(10,d)}),i.jsx("div",{style:l(14,d)}),i.jsx("div",{style:l(8,d)})]})})]})}const ln="bg-bv-teal/50 rounded-[2px] shrink-0 group-hover:bg-bv-teal/70 transition-colors duration-150",D1="bg-bv-orange/10 rounded-[2px]";function en({isCol:e,main:t}){return i.jsx("div",{className:ln,style:e?{height:t}:{width:t}})}function Qn({flex:e=1}){return i.jsx("div",{className:D1,style:{flex:e}})}function Yt({isCol:e,w:t,h:n}){return i.jsx("div",{className:ln,style:e?{width:n,height:t}:{width:t,height:n}})}function Vi({isCol:e,w:t,h:n,pt:r}){return i.jsx("div",{className:`${ln} text-[5px] text-white/80 leading-none overflow-hidden text-center`,style:e?{width:n,height:t,paddingLeft:r}:{width:t,height:n,paddingTop:r},children:"t"})}function Ui(e){return i.jsxs(i.Fragment,{children:[i.jsx(en,{isCol:e,main:10}),i.jsx(en,{isCol:e,main:14}),i.jsx(en,{isCol:e,main:8})]})}const Yd=[{value:"justify-start",label:"start",getContainerStyle:e=>({flexDirection:e,justifyContent:"flex-start",gap:2}),renderItems:e=>Ui(e.startsWith("column"))},{value:"justify-center",label:"center",getContainerStyle:e=>({flexDirection:e,justifyContent:"center",gap:2}),renderItems:e=>Ui(e.startsWith("column"))},{value:"justify-stretch",label:"stretch",getContainerStyle:e=>({flexDirection:e,gap:2}),renderItems:()=>i.jsxs(i.Fragment,{children:[i.jsx("div",{className:`${ln} flex-1`}),i.jsx("div",{className:`${ln} flex-1`}),i.jsx("div",{className:`${ln} flex-1`})]})},{value:"justify-between",label:"between",getContainerStyle:e=>({flexDirection:e}),renderItems:e=>{const t=e.startsWith("column");return i.jsxs(i.Fragment,{children:[i.jsx(en,{isCol:t,main:12}),i.jsx(Qn,{}),i.jsx(en,{isCol:t,main:12})]})}},{value:"justify-around",label:"around",getContainerStyle:e=>({flexDirection:e}),renderItems:e=>{const t=e.startsWith("column");return i.jsxs(i.Fragment,{children:[i.jsx(Qn,{flex:1}),i.jsx(en,{isCol:t,main:12}),i.jsx(Qn,{flex:2}),i.jsx(en,{isCol:t,main:12}),i.jsx(Qn,{flex:1})]})}},{value:"justify-evenly",label:"evenly",getContainerStyle:e=>({flexDirection:e}),renderItems:e=>{const t=e.startsWith("column");return i.jsxs(i.Fragment,{children:[i.jsx(Qn,{}),i.jsx(en,{isCol:t,main:12}),i.jsx(Qn,{}),i.jsx(en,{isCol:t,main:12}),i.jsx(Qn,{})]})}},{value:"justify-end",label:"end",getContainerStyle:e=>({flexDirection:e,justifyContent:"flex-end",gap:2}),renderItems:e=>Ui(e.startsWith("column"))}],Gi=[{value:"items-start",label:"start",getContainerStyle:e=>({flexDirection:e,alignItems:"flex-start",gap:3}),renderItems:e=>{const t=e.startsWith("column");return i.jsxs(i.Fragment,{children:[i.jsx(Yt,{isCol:t,w:13,h:22}),i.jsx(Yt,{isCol:t,w:15,h:42}),i.jsx(Yt,{isCol:t,w:11,h:14})]})}},{value:"items-center",label:"center",getContainerStyle:e=>({flexDirection:e,alignItems:"center",gap:3}),renderItems:e=>{const t=e.startsWith("column");return i.jsxs(i.Fragment,{children:[i.jsx(Yt,{isCol:t,w:13,h:22}),i.jsx(Yt,{isCol:t,w:15,h:42}),i.jsx(Yt,{isCol:t,w:11,h:14})]})}},{value:"items-baseline",label:"baseline",getContainerStyle:e=>({flexDirection:e,alignItems:"baseline",gap:3}),renderItems:e=>{const t=e.startsWith("column");return i.jsxs(i.Fragment,{children:[i.jsx(Vi,{isCol:t,w:13,h:38,pt:17}),i.jsx(Vi,{isCol:t,w:15,h:26,pt:3}),i.jsx(Vi,{isCol:t,w:11,h:32,pt:10})]})}},{value:"items-stretch",label:"stretch",getContainerStyle:e=>({flexDirection:e,alignItems:"stretch",gap:3}),renderItems:e=>{const t=e.startsWith("column");return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:ln,style:t?{height:13}:{width:13}}),i.jsx("div",{className:ln,style:t?{height:15}:{width:15}}),i.jsx("div",{className:ln,style:t?{height:11}:{width:11}})]})}},{value:"items-end",label:"end",getContainerStyle:e=>({flexDirection:e,alignItems:"flex-end",gap:3}),renderItems:e=>{const t=e.startsWith("column");return i.jsxs(i.Fragment,{children:[i.jsx(Yt,{isCol:t,w:13,h:22}),i.jsx(Yt,{isCol:t,w:15,h:42}),i.jsx(Yt,{isCol:t,w:11,h:14})]})}}];function O1({currentValue:e,lockedValue:t,locked:n,flexDirection:r="row",onHover:o,onLeave:s,onClick:l,onRemove:a,onRemoveHover:u}){const[c,f]=b.useState(!1),{refs:h,floatingStyles:d,context:m}=xn({open:c,onOpenChange:I=>{I||(f(!1),s())},strategy:"fixed",placement:"bottom-start",middleware:[hn(4),gn(),mn({padding:8})],whileElementsMounted:pn}),v=pr(m),{getReferenceProps:w,getFloatingProps:S}=hr([v]),p=t!==null&&Yd.some(I=>I.value===t),g=n&&!p,y=!p&&(e===null||e===""),x=p?t:e??"",k=Yd.find(I=>I.value===x),C=(k==null?void 0:k.label)??"—";function T(){f(!1),s()}function E(){g||f(I=>(I&&s(),!I))}const A={...Ht,borderStyle:"dashed",alignItems:"center",justifyContent:"center"};return i.jsxs("div",{className:"flex flex-col items-start gap-1",children:[i.jsx("span",{style:{fontSize:9,fontFamily:nt,color:ze,fontWeight:500},children:"JUSTIFY →"}),i.jsx("div",{ref:h.setReference,className:"cursor-pointer",role:"button",tabIndex:g?-1:0,onKeyDown:I=>{(I.key==="Enter"||I.key===" ")&&E()},onClick:E,...w(),children:y?i.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[i.jsx("div",{style:A,children:i.jsx("span",{style:{fontSize:9,fontFamily:nt,color:ze},children:"—"})}),i.jsx("span",{style:{fontSize:9,fontFamily:nt,color:ze},children:"none"})]}):i.jsx(Zt,{label:C,isActive:c,containerStyle:(k==null?void 0:k.getContainerStyle(r))??{flexDirection:r},children:I=>(k==null?void 0:k.renderItems(r))??null})}),c&&i.jsx(yn,{children:i.jsx("div",{ref:h.setFloating,style:d,className:"z-[9999]",...S(),children:i.jsxs(vr,{className:"bg-bv-bg border border-bv-border rounded-lg shadow-lg p-2 flex flex-col gap-1",onMouseLeave:s,onClose:T,children:[a&&i.jsxs("div",{className:"flex items-center gap-1.5 px-1.5 py-1 text-[10px] font-mono text-bv-muted border-b border-bv-border mb-1 pb-1.5 cursor-pointer transition-colors duration-150 hover:text-bv-orange",onMouseEnter:u,onMouseLeave:s,onClick:()=>{a(),T()},children:[i.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",className:"shrink-0",children:[i.jsx("line",{x1:"1",y1:"1",x2:"9",y2:"9",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),i.jsx("line",{x1:"9",y1:"1",x2:"1",y2:"9",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})]}),"remove"]}),i.jsx(L1,{flexDirection:r,activeValue:x,onSelect:I=>{l(I),T()},onHover:o})]})})})]})}function M1({currentValue:e,lockedValue:t,locked:n,flexDirection:r="row",onHover:o,onLeave:s,onClick:l,onRemove:a,onRemoveHover:u}){const[c,f]=b.useState(!1),{refs:h,floatingStyles:d,context:m}=xn({open:c,onOpenChange:L=>{L||(f(!1),s())},strategy:"fixed",placement:"bottom-start",middleware:[hn(4),gn(),mn({padding:8})],whileElementsMounted:pn}),v=pr(m),{getReferenceProps:w,getFloatingProps:S}=hr([v]),p=t!==null&&Gi.some(L=>L.value===t),g=n&&!p,y=!p&&(e===null||e===""),x=p?t:e??"",k=Gi.find(L=>L.value===x),C=(k==null?void 0:k.label)??"—",T=r;function E(){f(!1),s()}function A(){g||f(L=>(L&&s(),!L))}const I=y?{...Ht,borderStyle:"dashed",borderColor:Et,background:Wn,cursor:g?"default":"pointer",alignItems:"center",justifyContent:"center"}:{...Ht,borderColor:c?He:Et,background:c?"rgba(0,132,139,0.09)":Wn,cursor:g?"default":"pointer",...k?k.getContainerStyle(r):{}};return i.jsxs("div",{style:{display:"inline-flex",flexDirection:"column",alignItems:"center",gap:2},children:[i.jsx("span",{style:{fontSize:9,fontFamily:nt,color:ze,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Align ↓"}),i.jsx("div",{ref:h.setReference,role:"button",tabIndex:g?-1:0,onKeyDown:L=>{(L.key==="Enter"||L.key===" ")&&A()},onClick:A,...w(),children:i.jsx("div",{style:I,children:y?i.jsx("span",{style:{fontSize:9,fontFamily:nt,color:ze},children:"—"}):k==null?void 0:k.renderItems(r)})}),i.jsx("span",{style:{fontSize:9,fontFamily:nt,color:c?He:ze,fontWeight:c?600:400,textAlign:"center",transition:"color 150ms ease-in-out"},children:y?"—":C}),c&&i.jsx(yn,{children:i.jsx("div",{ref:h.setFloating,style:d,className:"z-[9999]",...S(),children:i.jsxs(vr,{className:"bg-bv-bg border border-bv-border rounded-lg shadow-lg p-2 flex flex-col gap-1",onMouseLeave:s,onClose:E,children:[a&&i.jsxs("div",{className:"flex items-center gap-1.5 px-1.5 py-1 text-[10px] font-mono text-bv-muted border-b border-bv-border mb-1 pb-1.5 cursor-pointer transition-colors duration-150 hover:text-bv-orange",onMouseEnter:u,onMouseLeave:s,onClick:()=>{a(),E()},children:[i.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",className:"shrink-0",children:[i.jsx("line",{x1:"1",y1:"1",x2:"9",y2:"9",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),i.jsx("line",{x1:"9",y1:"1",x2:"1",y2:"9",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})]}),"remove"]}),i.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 60px)",gap:4},children:Gi.map(L=>i.jsx(Zt,{label:L.label,isActive:L.value===x,containerStyle:{flexDirection:T,...L.getContainerStyle(r)},onHover:()=>o(L.value),onClick:()=>{l(L.value),E()},children:B=>L.renderItems(r)},L.value))})]})})})]})}function Qd(e){return e.replace(/^gap-x-/,"x-")}function Xd(e){return e.replace(/^gap-y-/,"y-")}function $1({slots:e,onSlotChange:t,onSlotHover:n,onSlotRemove:r,onSlotRemoveHover:o}){const[s,l]=b.useState(null),[a,u]=b.useState(null),c=e.find(S=>S.key==="gap"),f=e.find(S=>S.key==="gap-x"),h=e.find(S=>S.key==="gap-y");function d(S,p){u(p!=null?S:null),n==null||n(S,p)}function m(S){u(S)}function v(){u(null)}const w=a==="gap-x"?"gm-active-x":a==="gap-y"?"gm-active-y":a==="gap"?"gm-active-gap":"";return i.jsx("div",{className:"gm-root",children:i.jsxs("div",{className:`gm-grid${w?` ${w}`:""}`,children:[i.jsx("div",{className:"gm-col-highlight",style:{gridArea:"1 / 2 / 4 / 3"}}),i.jsx("div",{className:"gm-row-highlight",style:{gridArea:"2 / 1 / 3 / 4"}}),i.jsx("div",{className:"gm-box gm-box-tl",style:{gridArea:"1 / 1"}}),i.jsx("div",{className:"gm-cell",style:{gridArea:"1 / 2"},onMouseEnter:()=>m("gap-x"),onMouseLeave:v,children:(f==null?void 0:f.scaleValues)&&i.jsx(Ur,{placeholder:"x",values:f.scaleValues,currentValue:f.value,displayValue:f.value?Qd(f.value):null,formatValue:Qd,axis:"x",disabled:s!==null&&s!=="gap-x",onHover:S=>d("gap-x",S),onLeave:()=>d("gap-x",null),onClick:S=>t==null?void 0:t("gap-x",S),onOpen:()=>l("gap-x"),onClose:()=>l(null),onScrubStart:()=>l("gap-x"),onScrubEnd:()=>l(null),onRemove:f.value?()=>r==null?void 0:r("gap-x"):void 0,onRemoveHover:f.value?()=>{u(null),o==null||o("gap-x")}:void 0})}),i.jsx("div",{className:"gm-box gm-box-tr",style:{gridArea:"1 / 3"}}),i.jsx("div",{className:"gm-cell",style:{gridArea:"2 / 1"},onMouseEnter:()=>m("gap-y"),onMouseLeave:v,children:(h==null?void 0:h.scaleValues)&&i.jsx(Ur,{placeholder:"y",values:h.scaleValues,currentValue:h.value,displayValue:h.value?Xd(h.value):null,formatValue:Xd,axis:"y",disabled:s!==null&&s!=="gap-y",onHover:S=>d("gap-y",S),onLeave:()=>d("gap-y",null),onClick:S=>t==null?void 0:t("gap-y",S),onOpen:()=>l("gap-y"),onClose:()=>l(null),onScrubStart:()=>l("gap-y"),onScrubEnd:()=>l(null),onRemove:h.value?()=>r==null?void 0:r("gap-y"):void 0,onRemoveHover:h.value?()=>{u(null),o==null||o("gap-y")}:void 0})}),i.jsx("div",{className:"gm-cell",style:{gridArea:"2 / 2"},onMouseEnter:()=>m("gap"),onMouseLeave:v,children:(c==null?void 0:c.scaleValues)&&i.jsx(Ur,{placeholder:"gap",values:c.scaleValues,currentValue:c.value,displayValue:c.value??null,axis:"x",disabled:s!==null&&s!=="gap",onHover:S=>d("gap",S),onLeave:()=>d("gap",null),onClick:S=>t==null?void 0:t("gap",S),onOpen:()=>l("gap"),onClose:()=>l(null),onScrubStart:()=>l("gap"),onScrubEnd:()=>l(null),onRemove:c.value?()=>r==null?void 0:r("gap"):void 0,onRemoveHover:c.value?()=>{u(null),o==null||o("gap")}:void 0})}),i.jsx("div",{className:"gm-box gm-box-bl",style:{gridArea:"3 / 1"}})]})})}const Zh={shadow:"Shadow","inset-shadow":"Inset Shadow",ring:"Ring","inset-ring":"Inset Ring","text-shadow":"Text Shadow"},Zd={shadow:"shadow-md","inset-shadow":"inset-shadow-sm",ring:"ring-2","inset-ring":"inset-ring-2","text-shadow":"text-shadow-md"};function z1(e){switch(e){case"shadow":return[...Zu];case"inset-shadow":return[...Ch];case"ring":return[...Ba];case"inset-ring":return[...Ba];case"text-shadow":return[...qu]}}function qd(e,t){return`${e==="shadow"?"shadow-":e==="inset-shadow"?"inset-shadow-":e==="ring"?"ring-":e==="inset-ring"?"inset-ring-":"text-shadow-"}${t}`}function F1(e,t){const n=e==="shadow"?"shadow-":e==="inset-shadow"?"inset-shadow-":e==="ring"?"ring-":e==="inset-ring"?"inset-ring-":"text-shadow-";return t.startsWith(n)?t.slice(n.length):t}function K1(e){if(e.isNone||!e.sizeClass)return"none";const t=r=>{if(!e.colorHex)return r;if(e.opacity!==null&&e.opacity<100){const o=(e.opacity/100).toFixed(2),s=parseInt(e.colorHex.slice(1,3),16),l=parseInt(e.colorHex.slice(3,5),16),a=parseInt(e.colorHex.slice(5,7),16);return`rgba(${s},${l},${a},${o})`}return e.colorHex},n=e.colorHex?t(e.colorHex):void 0;switch(e.type){case"shadow":{const r=ko(e.sizeClass,"shadow-");return B1(r,n)}case"inset-shadow":{const r=ko(e.sizeClass,"inset-shadow-");return V1(r,n)}case"ring":{const r=ko(e.sizeClass,"ring-");return`0 0 0 ${r==="0"?0:Number(r)||1}px ${n??"rgba(99,102,241,0.5)"}`}case"inset-ring":{const r=ko(e.sizeClass,"inset-ring-");return`inset 0 0 0 ${r==="0"?0:Number(r)||1}px ${n??"rgba(99,102,241,0.5)"}`}case"text-shadow":return"none"}}function H1(e){if(e.isNone||!e.sizeClass)return"none";const t=o=>{if(!e.colorHex)return o;if(e.opacity!==null&&e.opacity<100){const s=(e.opacity/100).toFixed(2),l=parseInt(e.colorHex.slice(1,3),16),a=parseInt(e.colorHex.slice(3,5),16),u=parseInt(e.colorHex.slice(5,7),16);return`rgba(${l},${a},${u},${s})`}return e.colorHex},n=e.colorHex?t(e.colorHex):void 0,r=ko(e.sizeClass,"text-shadow-");return W1(r,n)}function W1(e,t){const n=t??"rgba(0,0,0,0.25)";return{"2xs":`0 1px 0 ${n}`,xs:`0 1px 1px ${n}`,sm:`0 1px 2px ${n}`,md:`0 2px 4px ${n}`,lg:`0 4px 6px ${n}`}[e]??"none"}function ko(e,t){return e.startsWith(t)?e.slice(t.length):e}function B1(e,t){const n=t??"rgba(0,0,0,0.15)";return{"2xs":`0 1px ${n}`,xs:`0 1px 2px 0 ${n}`,sm:`0 1px 3px 0 ${n}, 0 1px 2px -1px ${n}`,md:`0 4px 6px -1px ${n}, 0 2px 4px -2px ${n}`,lg:`0 10px 15px -3px ${n}, 0 4px 6px -4px ${n}`,xl:`0 20px 25px -5px ${n}, 0 8px 10px -6px ${n}`,"2xl":`0 25px 50px -12px ${n}`}[e]??"none"}function V1(e,t){const n=t??"rgba(0,0,0,0.05)";return{"2xs":`inset 0 0.5px ${n}`,xs:`inset 0 1px 1px ${n}`,sm:`inset 0 2px 4px ${n}`}[e]??"none"}const U1=Array.from({length:21},(e,t)=>`${t*5}%`);function G1({layer:e,onSizeHover:t,onSizeLeave:n,onSizeClick:r,onColorClick:o,onOpacityHover:s,onOpacityLeave:l,onOpacityClick:a,onRemove:u,onRemoveHover:c}){const[f,h]=b.useState(!1),d=b.useRef(),m={onMouseEnter:()=>{clearTimeout(d.current),h(!0)},onMouseLeave:()=>{d.current=setTimeout(()=>h(!1),60)}},v=z1(e.type),w=K1(e),S=e.type==="text-shadow"?H1(e):"none",p=e.isNone,g=e.sizeClass?F1(e.type,e.sizeClass):v[0],y=!!e.colorHex,x=e.opacity!==null?`${e.opacity}%`:"100%",k=e.colorHex??void 0;function C(E){t(qd(e.type,E))}function T(E){r(qd(e.type,E))}return i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"flex items-center justify-center",...m,children:i.jsx("span",{className:"w-1 h-1 rounded-full bg-bv-orange"})}),i.jsx("span",{className:"flex items-center text-[9px] font-semibold uppercase tracking-[0.8px] text-bv-text-mid font-mono whitespace-nowrap",...m,children:Zh[e.type]}),i.jsx("span",{className:"flex items-center",...m,children:i.jsx(kn,{values:v,currentValue:g,lockedValue:null,locked:!1,onHover:C,onLeave:n,onClick:T})}),i.jsx("button",{type:"button",className:`w-[26px] h-[26px] rounded-[5px] border shrink-0 cursor-pointer transition-[border-color] ${e.colorHex?"border-bv-border hover:border-bv-teal":"border-dashed border-bv-border hover:border-bv-teal"} ${p?"opacity-30 pointer-events-none":""}`,onClick:E=>o(E.currentTarget),title:e.colorClass?e.colorClass:"Default color — click to override",...m,children:e.colorHex?i.jsx("div",{className:"w-full h-full rounded-[4px]",style:{background:k,opacity:e.opacity!==null?e.opacity/100:1}}):i.jsx("div",{className:"w-full h-full rounded-[4px] flex items-center justify-center",children:i.jsx("span",{className:"w-2 h-2 rounded-full bg-bv-text-mid opacity-40"})})}),i.jsx("span",{className:`flex items-center ${p||!y?"opacity-30 pointer-events-none":""}`,...m,children:y&&!p?i.jsx(kn,{values:U1,currentValue:x,lockedValue:null,locked:!1,onHover:s,onLeave:l,onClick:a}):i.jsx("span",{className:"flex items-center justify-center w-full h-[26px] bg-bv-surface border border-bv-border rounded-[5px]",children:i.jsx("span",{className:"font-mono text-[11px] text-bv-muted select-none",children:"—"})})}),i.jsx("span",{className:"ml-4 flex w-[26px] h-[26px] rounded-[5px] bg-bv-surface-hi border border-bv-border transition-[box-shadow] duration-200 items-center justify-center overflow-hidden",style:e.type==="text-shadow"?{}:{boxShadow:w},title:`Preview: ${e.sizeClass??""} ${e.colorClass??""}`.trim(),...m,children:e.type==="text-shadow"&&i.jsx("span",{className:"text-[11px] font-semibold text-bv-text select-none transition-[text-shadow] duration-200",style:{textShadow:S},children:"Aa"})}),i.jsx("button",{type:"button",className:`ml-4 w-[18px] h-[18px] rounded-[3px] border-none bg-transparent text-bv-muted text-xs cursor-pointer flex items-center justify-center transition-all hover:text-bv-orange hover:bg-bv-orange/10 ${f?"opacity-100":"opacity-0"}`,onClick:u,onMouseEnter:()=>{clearTimeout(d.current),h(!0),c()},onMouseLeave:()=>{d.current=setTimeout(()=>h(!1),60)},title:"Remove layer",children:"×"})]})}const Y1=["shadow","inset-shadow","ring","inset-ring","text-shadow"];function Q1({layers:e,onPreview:t,onRevert:n,onStage:r,onAdd:o,onRemove:s,onRemoveHover:l,onColorClick:a}){function u(f){const h=[];return f.sizeClass&&h.push(f.sizeClass),f.colorClass&&h.push(f.opacity!==null?`${f.colorClass}/${f.opacity}`:f.colorClass),h}const c=Y1.map(f=>({type:f,layer:e.find(h=>h.type===f)}));return i.jsx("div",{className:"grid items-center gap-x-1.5 gap-y-1",style:{gridTemplateColumns:"16px auto 1fr 26px 1fr 26px 18px"},children:c.map(({type:f,layer:h},d)=>i.jsxs(b.Fragment,{children:[d>0&&i.jsx("div",{className:"h-px bg-bv-border opacity-50",style:{gridColumn:"1 / -1"}}),h?i.jsx(G1,{layer:h,onSizeHover:m=>t(h.sizeClass??"",m),onSizeLeave:n,onSizeClick:m=>r(h.sizeClass??"",m),onColorClick:m=>a==null?void 0:a(h,m),onOpacityHover:m=>{if(!h.colorClass)return;const v=h.colorClass.split("/")[0],w=parseInt(m),S=w===100?v:`${v}/${w}`,p=h.opacity!==null?`${v}/${h.opacity}`:v;t(p,S)},onOpacityLeave:n,onOpacityClick:m=>{if(!h.colorClass)return;const v=h.colorClass.split("/")[0],w=parseInt(m),S=w===100?v:`${v}/${w}`,p=h.opacity!==null?`${v}/${h.opacity}`:v;r(p,S)},onRemove:()=>s(u(h)),onRemoveHover:()=>l(u(h))}):i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:"w-4 h-4 rounded-[3px] border border-dashed border-bv-border bg-transparent text-bv-muted text-[11px] cursor-pointer flex items-center justify-center transition-all hover:border-bv-teal hover:border-solid hover:text-bv-teal hover:bg-bv-teal/10",onClick:()=>o(Zd[f]),title:`Add ${Zd[f]}`,children:"+"}),i.jsx("div",{className:"flex items-center leading-none text-[9px] font-mono uppercase tracking-[0.6px] text-bv-muted whitespace-nowrap",children:Zh[f]})]})]},f))})}const Jd=[{prop:"shadow",prefix:"shadow-",sizeSet:Cl},{prop:"inset-shadow",prefix:"inset-shadow-",sizeSet:kl},{prop:"ring",prefix:"ring-",sizeSet:eo},{prop:"inset-ring",prefix:"inset-ring-",sizeSet:eo},{prop:"text-shadow",prefix:"text-shadow-",sizeSet:El}];function kr(e,t,n,r,o){if(!t)return n?[...e,n]:e;if(e.includes(t))return n?e.map(c=>c===t?n:c):e.filter(c=>c!==t);if(e.length===0)return n?[n]:[];const s=t.startsWith(r)?t.slice(r.length).split("/")[0]:"",l=o.has(s);let a=!1;const u=e.flatMap(c=>{const f=c.startsWith(r)?c.slice(r.length).split("/")[0]:"";return o.has(f)===l&&!a?(a=!0,n?[n]:[]):[c]});return a?u:n?[...e,n]:e}function X1(e,t){if(!t)return null;const n=e.lastIndexOf("-");if(n===-1){const a=t[e];return typeof a=="string"?a:null}const r=e.slice(0,n),o=e.slice(n+1),s=t[r];if(!s)return null;if(typeof s=="string")return s;const l=s[o];return typeof l=="string"?l:null}function Z1(e,t){const n=e.trim().split(/\s+/).filter(Boolean),r=t==null?void 0:t.colors,o=[{type:"shadow",prefix:"shadow-",sizeSet:Cl},{type:"inset-shadow",prefix:"inset-shadow-",sizeSet:kl},{type:"ring",prefix:"ring-",sizeSet:eo},{type:"inset-ring",prefix:"inset-ring-",sizeSet:eo},{type:"text-shadow",prefix:"text-shadow-",sizeSet:El}],s=[];for(const{type:l,prefix:a,sizeSet:u}of o){const c=n.filter(v=>v===a.slice(0,-1)||v.startsWith(a));if(c.length===0)continue;let f=null,h=null,d=null,m=null;for(const v of c){const S=v.slice(a.length).split("/")[0];if(u.has(S))f=v;else{h=v;const p=v.split("/");p.length===2&&(m=parseInt(p[1])),d=X1(S,r??null)}}s.push({type:l,sizeClass:f,colorClass:h,colorHex:d,opacity:m,isNone:f!==null&&(f.endsWith("-none")||f.endsWith("-0"))})}return s}function q1(e,t){const n=new Set(["shadow","inset-shadow","ring","inset-ring","text-shadow","shadow-size","shadow-color","inset-shadow-size","inset-shadow-color","ring-size","ring-color","inset-ring-size","inset-ring-color","text-shadow-size","text-shadow-color"]),r=t.filter(l=>n.has(l.property)),o=e.trim().split(/\s+/).filter(Boolean),s=o.filter(l=>!Jd.some(({prefix:a})=>l===a.slice(0,-1)||l.startsWith(a)));for(const{prop:l,prefix:a,sizeSet:u}of Jd){const c=r.find(v=>v.property===l),f=r.find(v=>v.property===`${l}-size`),h=r.find(v=>v.property===`${l}-color`),d=o.filter(v=>v===a.slice(0,-1)||v.startsWith(a));if(c){if(c.newClass)s.push(...kr(d,c.originalClass,c.newClass,a,u));else{const v=c.originalClass.startsWith(a)?c.originalClass.slice(a.length).split("/")[0]:"";u.has(v)||!c.originalClass||s.push(...kr(d,c.originalClass,c.newClass,a,u))}continue}let m=[...d];f&&(f.newClass?m=kr(m,f.originalClass,f.newClass,a,u):f.originalClass&&(m=kr(m,f.originalClass,"",a,u))),h&&(h.newClass?m=kr(m,h.originalClass,h.newClass,a,u):h.originalClass&&(m=kr(m,h.originalClass,"",a,u))),s.push(...m)}return s.join(" ")}const J1={spacing:"Spacing",sizing:"Sizing",typography:"Typography",color:"Backgrounds",borders:"Radius",effects:"Effects",layout:"Layout",flexbox:"Flexbox & Grid",overflow:"Overflow"},eb=["layout","borders","sizing","typography","color","flexbox","shadows","effects"];function ef(e){const t=e.scale??e.color??e.style??e.align??e.size??e.value;return t?e.fullClass.slice(0,e.fullClass.length-t.length):e.property+"-"}function tb(e){return e.section==="spacing"||e.property==="border"||e.property==="rounded"||e.property==="bg"||e.property==="bg-gradient-to"||e.property==="from"||e.property==="via"||e.property==="to"||e.property==="shadow"||e.property==="text-shadow"}function Xn(e){const t=e.filter(l=>l.property==="rounded"),n=[{prefix:/^rounded-tl(-|$)/,key:"tl"},{prefix:/^rounded-tr(-|$)/,key:"tr"},{prefix:/^rounded-br(-|$)/,key:"br"},{prefix:/^rounded-bl(-|$)/,key:"bl"},{prefix:/^rounded-t(-|$)/,key:"t"},{prefix:/^rounded-r(-|$)/,key:"r"},{prefix:/^rounded-b(-|$)/,key:"b"},{prefix:/^rounded-l(-|$)/,key:"l"}],r=new Map;let o=null;for(const l of t){const a=l.fullClass,u=n.find(c=>c.prefix.test(a));u?r.set(u.key,a):o=a}return{shorthandValue:o,shorthandScaleValues:Va,slots:["all","t","r","b","l","tl","tr","br","bl"].map(l=>({key:l,value:l==="all"?o:r.get(l)??null,placeholder:l,scaleValues:l==="all"?Va:Mx(`rounded-${l}`)}))}}const Zn=X0(),qh=Z0(),nb={"text-size":{scaleName:"fontSize",valueType:"scalar"},"text-color":{scaleName:null,valueType:"color"}};qh.typography.unshift({name:"Font size",prefixHint:"text-sm/base/lg/…",prefix:"text-size"},{name:"Text color",prefixHint:"text-{color}",prefix:"text-color"});function Qs(e){const t=nb[e];if(t)return{...t,stagingKey:e};const n=Object.entries(mr).find(([o,s])=>(s.propertyKey??o.replace(/-$/g,""))===e&&s.addable);if(n){const[o,s]=n;return{scaleName:s.themeKey,valueType:s.valueType,enumAlts:s.enumAlts,stagingKey:e}}const r=mr[e];return r?{scaleName:r.themeKey,valueType:r.valueType,enumAlts:r.enumAlts,stagingKey:e.replace(/-$/g,"")}:null}function rb(e,t,n,r){const o=new Set(t.map(l=>l.fullClass)),s=new Set(t.map(l=>l.property));return e.filter(l=>{if(n.has(l.prefix)||r!=null&&r.has(l.prefix))return!1;const a=Qs(l.prefix);if((a==null?void 0:a.valueType)==="enum"&&a.enumAlts)return!a.enumAlts.some(u=>o.has(u));if(a&&a.valueType!=="enum"){if(l.prefix==="text-size")return!t.some(u=>u.property==="text"&&u.scaleName==="fontSize");if(l.prefix==="text-color")return!t.some(u=>u.property==="text"&&u.color!==void 0)}return!s.has(l.prefix.replace(/-$/g,""))})}function ob(e){const t=new Map;for(const n of e){const r=n.section??"unknown",o=t.get(r)||[];o.push(n),t.set(r,o)}return t}function sb({componentName:e,instanceCount:t,rawClasses:n,parsedClasses:r,tailwindConfig:o,patchManager:s}){var oe,ie;const[l,a]=b.useState(null),[u,c]=b.useState(new Map),[f,h]=b.useState(new Map),[d,m]=b.useState(null),[v,w]=b.useState(null),[S,p]=b.useState(null),g=b.useRef(null),{refs:y,floatingStyles:x,context:k}=xn({open:d!==null,onOpenChange:N=>{N||(m(null),s.revertPreview())},strategy:"fixed",placement:"bottom-start",middleware:[hn(4),gn(),mn({padding:8}),eu({apply({availableHeight:N,elements:O}){Object.assign(O.floating.style,{maxHeight:`${N}px`})},padding:8})],whileElementsMounted:pn}),C=pr(k),{getFloatingProps:T}=hr([C]);b.useEffect(()=>{d!=null&&d.anchorEl&&y.setReference(d.anchorEl)},[d==null?void 0:d.anchorEl]);const{refs:E,floatingStyles:A,context:I}=xn({open:v!==null||S!==null,onOpenChange:N=>{N||(w(null),p(null),s.revertPreview())},strategy:"fixed",placement:"bottom-start",middleware:[hn(4),gn(),mn({padding:8}),eu({apply({availableHeight:N,elements:O}){Object.assign(O.floating.style,{maxHeight:`${N}px`})},padding:8})],whileElementsMounted:pn}),L=pr(I),{getFloatingProps:B}=hr([L]);b.useEffect(()=>{const N=(v==null?void 0:v.anchorEl)??(S==null?void 0:S.anchorEl);N&&E.setReference(N)},[v==null?void 0:v.anchorEl,S==null?void 0:S.anchorEl]);const[K,D]=b.useState(new Set),[H,Q]=b.useState(!1),J=b.useRef(r.map(N=>N.fullClass).join(" ")),j=r.map(N=>N.fullClass).join(" ");b.useEffect(()=>{J.current!==j&&(J.current=j,s.revertPreview(),c(new Map),h(new Map),m(null),w(null),D(new Set))});const R=e,P=s.patches.filter(N=>N.status==="staged"&&N.elementKey===R),G=new Set(P.filter(N=>N.originalClass==="").map(N=>N.property));function Y(N,O){const z=P.find(be=>be.property===N),ee=(O==null?void 0:O.fullClass)??(z==null?void 0:z.originalClass)??"",se=(z==null?void 0:z.newClass)??(O==null?void 0:O.fullClass)??"";return{originalClass:ee,effectiveClass:se,hasValue:se!==""}}function Ce(N){return u.size===0?N:N.map(O=>{const z=u.get(`${O.layer}-shorthand`),ee=O.slots.map(be=>{const je=u.get(`${O.layer}-${be.key}`);return je!==void 0?{...be,value:je}:be}),se=z??O.shorthandValue;let ye=O.classState;return z!==void 0&&(ye=ee.some(je=>je.value!=null)?"mixed":"shorthand"),{...O,shorthandValue:se,classState:ye,slots:ee}})}function _e(N){if(f.size===0)return N;const O=f.get("all");return{...N,shorthandValue:O===void 0?N.shorthandValue:O,slots:N.slots.map(z=>{const ee=f.get(z.key);return ee===void 0?z:{...z,value:ee}})}}const $=ob(r);function ne(N,O){s.preview(N,O)}function ge(){s.revertPreview()}function q(N,O,z){s.stage(R,N,O,z)}function Gn(N,O){const z=N||O,ee=z.startsWith("bg-gradient-to-")?"bg-gradient-to-":z.startsWith("from-")?"from-":z.startsWith("via-")?"via-":z.startsWith("to-")?"to-":"bg-";q(ee,N,O)}function bn(N,O){s.revertPreview(),pe("overlay",{type:"CLEAR_HIGHLIGHTS"}),N.color!==void 0&&O?(w(z=>(z==null?void 0:z.cls.fullClass)===N.fullClass?null:{cls:N,anchorEl:O}),a(null)):(w(null),a(N))}function ae(N,O){s.preview(N.fullClass,O)}function me(N){s.revertPreview()}function st(N){const O=mr[N];if(!((O==null?void 0:O.controlGroup)==="flex-container"&&(O==null?void 0:O.propertyKey)==="display")){if((O==null?void 0:O.controlGroup)==="flex-container"){const z=r.some(se=>se.fullClass==="flex"||se.fullClass==="inline-flex"),ee=P.some(se=>se.property==="display"&&se.originalClass===""&&(se.newClass==="flex"||se.newClass==="inline-flex"));!z&&!ee&&s.stage(R,"display","","flex")}}D(z=>new Set(z).add(N))}function Je(N,O){s.preview("",O)}function lt(N){s.revertPreview()}function X(N,O){const z=Qs(N);s.stage(R,(z==null?void 0:z.stagingKey)??N,"",O),D(ee=>{const se=new Set(ee);return se.delete(N),se})}return i.jsxs("div",{className:"divide-y divide-bv-border",children:[i.jsxs("div",{className:"px-4 py-3",children:[i.jsxs("div",{className:"flex items-center gap-1.5 cursor-pointer select-none",onClick:()=>Q(N=>!N),children:[i.jsx("svg",{className:`w-3 h-3 text-bv-muted transition-transform ${H?"":"rotate-90"}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 5l7 7-7 7"})}),i.jsx("span",{className:"text-[10px] font-semibold text-bv-text",children:"Box model"})]}),i.jsx("div",{className:`overflow-hidden transition-[max-height,opacity] duration-200 ease-in-out ${H?"max-h-0 opacity-0":"max-h-[600px] opacity-100"}`,children:i.jsxs("div",{className:"mt-3",children:[i.jsx(a1,{layers:Ce(Cr(r,o)),onEditStart:()=>{pe("overlay",{type:"CLEAR_HIGHLIGHTS"}),m(null)},onSlotClick:(N,O,z)=>{var je;if(O!=="color"||!z){m(null);return}const ee=Cr(r,o).find(Vt=>Vt.layer===N),se=`${N}-color`,ye=u.get(se)??((je=ee==null?void 0:ee.slots.find(Vt=>Vt.key==="color"))==null?void 0:je.value)??"",be=N==="outline"?"outline-":"border-";m(Vt=>(Vt==null?void 0:Vt.layer)===N?null:{layer:N,prefix:be,currentClass:ye,staged:!1,anchorEl:z})},onSlotHover:(N,O,z)=>{var ee;if(z===null)s.revertPreview();else{const se=`${N}-${O}`,ye=Cr(r,o).find(je=>je.layer===N),be=O==="shorthand"?u.get(se)??(ye==null?void 0:ye.shorthandValue):u.get(se)??((ee=ye==null?void 0:ye.slots.find(je=>je.key===O))==null?void 0:ee.value);s.preview(be??"",z)}},onSlotChange:(N,O,z)=>{var be;const ee=`${N}-${O}`,se=Cr(r,o).find(je=>je.layer===N),ye=O==="shorthand"?u.get(ee)??(se==null?void 0:se.shorthandValue):u.get(ee)??((be=se==null?void 0:se.slots.find(je=>je.key===O))==null?void 0:be.value);q(`${N}-${O}`,ye??"",z),c(je=>new Map(je).set(ee,z))},onSlotRemoveHover:(N,O)=>{var ye;const z=`${N}-${O}`,ee=Cr(r,o).find(be=>be.layer===N),se=O==="shorthand"?u.get(z)??(ee==null?void 0:ee.shorthandValue):u.get(z)??((ye=ee==null?void 0:ee.slots.find(be=>be.key===O))==null?void 0:ye.value);se&&s.preview(se,"")},onSlotRemove:(N,O)=>{var ye;const z=`${N}-${O}`,ee=Cr(r,o).find(be=>be.layer===N),se=O==="shorthand"?u.get(z)??(ee==null?void 0:ee.shorthandValue):u.get(z)??((ye=ee==null?void 0:ee.slots.find(be=>be.key===O))==null?void 0:ye.value);se&&(q(`${N}-${O}`,se,""),c(be=>{const je=new Map(be);return je.delete(z),je}))}}),d&&i.jsx(yn,{children:i.jsx("div",{ref:y.setFloating,style:{...x,zIndex:9999,overflowY:"auto"},...T(),children:i.jsx(Ys,{prefix:d.prefix,currentValue:d.currentClass.startsWith(d.prefix)?d.currentClass.slice(d.prefix.length):"",colors:(o==null?void 0:o.colors)||{},locked:!1,lockedValue:((oe=P.find(N=>N.property===d.prefix))==null?void 0:oe.newClass)??null,onHover:N=>{g.current=N,s.preview(d.currentClass,N)},onLeave:()=>{d.staged&&g.current?(s.preview(g.current,d.currentClass),g.current=null):s.revertPreview()},onClick:N=>{const O=`${d.layer}-color`;q(d.prefix,d.currentClass,N),c(z=>new Map(z).set(O,N)),m(z=>z?{...z,currentClass:N,staged:!0}:null)}})})})]})})]}),(v||S)&&i.jsx(yn,{children:i.jsxs("div",{ref:E.setFloating,style:{...A,zIndex:9999,overflowY:"auto"},...B(),children:[v&&i.jsx(Ys,{prefix:ef(v.cls),currentValue:v.cls.color??"",colors:(o==null?void 0:o.colors)||{},locked:!1,lockedValue:((ie=P.find(N=>N.property===v.cls.property))==null?void 0:ie.newClass)??null,onHover:N=>ne(v.cls.fullClass,N),onLeave:ge,onClick:N=>q(v.cls.property,v.cls.fullClass,N),onRemoveHover:()=>ne(v.cls.fullClass,""),onRemove:()=>{q(v.cls.property,v.cls.fullClass,""),w(null)}}),S&&(()=>{const{layer:N}=S,O=N.type==="shadow"?"shadow-":N.type==="inset-shadow"?"inset-shadow-":N.type==="ring"?"ring-":N.type==="text-shadow"?"text-shadow-":"inset-ring-",z=N.colorClass??"",ee=z?z.slice(O.length).split("/")[0]:"";return i.jsx(Ys,{prefix:O,currentValue:ee,colors:(o==null?void 0:o.colors)||{},locked:!1,lockedValue:null,onHover:se=>ne(z,se),onLeave:ge,onClick:se=>{const ye=N.type==="shadow"?"shadow-color":N.type==="inset-shadow"?"inset-shadow-color":N.type==="ring"?"ring-color":N.type==="text-shadow"?"text-shadow-color":"inset-ring-color";s.stage(R,ye,z,se),p(null)},onRemoveHover:()=>{z&&ne(z,"")},onRemove:()=>{if(z){const se=N.type==="shadow"?"shadow-color":N.type==="inset-shadow"?"inset-shadow-color":N.type==="ring"?"ring-color":N.type==="text-shadow"?"text-shadow-color":"inset-ring-color";s.stage(R,se,z,"")}p(null)}})})()]})}),eb.map(N=>{if(N==="shadows"){const _=q1(n,P),re=Z1(_,o);return i.jsx(Ud,{label:"Shadows & Rings",onAddProperty:()=>{},isEmpty:!1,classCount:re.length,children:i.jsx(Q1,{layers:re,onPreview:(V,U)=>s.preview(V,U),onRevert:()=>s.revertPreview(),onStage:(V,U)=>{const fe=V||U,ue=Oe=>{if(Oe.startsWith("shadow-")){const Ve=Oe.slice(7).split("/")[0];return Cl.has(Ve)}if(Oe.startsWith("inset-shadow-")){const Ve=Oe.slice(13).split("/")[0];return kl.has(Ve)}if(Oe.startsWith("ring-")||Oe.startsWith("inset-ring-")){const Ve=Oe.slice(Oe.startsWith("ring-")?5:11).split("/")[0];return eo.has(Ve)}if(Oe.startsWith("text-shadow-")){const Ve=Oe.slice(12).split("/")[0];return El.has(Ve)}return!1},Te=fe.startsWith("text-shadow")?"text-shadow":fe.startsWith("inset-shadow")?"inset-shadow":fe.startsWith("inset-ring")?"inset-ring":fe.startsWith("ring")?"ring":"shadow",Ut=ue(V)||V===""&&ue(U)?`${Te}-size`:`${Te}-color`;s.stage(R,Ut,V,U)},onAdd:V=>{const U=V.startsWith("text-shadow")?"text-shadow-size":V.startsWith("inset-shadow")?"inset-shadow-size":V.startsWith("inset-ring")?"inset-ring-size":V.startsWith("ring")?"ring-size":"shadow-size";s.stage(R,U,"",V)},onRemove:V=>{const U=ue=>{if(ue.startsWith("shadow-")){const Te=ue.slice(7).split("/")[0];return Cl.has(Te)}if(ue.startsWith("inset-shadow-")){const Te=ue.slice(13).split("/")[0];return kl.has(Te)}if(ue.startsWith("ring-")||ue.startsWith("inset-ring-")){const Te=ue.slice(ue.startsWith("ring-")?5:11).split("/")[0];return eo.has(Te)}if(ue.startsWith("text-shadow-")){const Te=ue.slice(12).split("/")[0];return El.has(Te)}return!1},fe=[...V].reverse();for(const ue of fe){const Te=ue.startsWith("text-shadow")?"text-shadow":ue.startsWith("inset-shadow")?"inset-shadow":ue.startsWith("inset-ring")?"inset-ring":ue.startsWith("ring")?"ring":"shadow",Ut=U(ue)?`${Te}-size`:`${Te}-color`;s.stage(R,Ut,ue,"")}},onRemoveHover:V=>{V.length===1?s.preview(V[0],""):V.length>1&&s.preview(V.join(" "),"")},onColorClick:(V,U)=>{w(null),p(fe=>(fe==null?void 0:fe.layer.type)===V.type?null:{layer:V,anchorEl:U})}})},"shadows")}const z=($.get(N)||[]).filter(_=>!tb(_)),ee=qh[N]||[],se=Y0.get("flex-container")??new Set,ye=Q0.get("flex-container")??new Set,be=r.find(_=>_.fullClass==="flex"||_.fullClass==="inline-flex"),je=Y("display",be),Vt=je.effectiveClass==="flex"||je.effectiveClass==="inline-flex",em=r.some(_=>{if(_.fullClass==="flex"||_.fullClass==="inline-flex")return!1;const re=Zn[_.fullClass];return!!(re&&re.propertyKey!=="display"&&se.has(re.propertyKey)||se.has(_.property))}),tm=[...ye].some(_=>K.has(_)||G.has(_.replace(/-$/,""))),br=N==="flexbox"&&(Vt||em||tm),nm=br?ee.filter(_=>!ye.has(_.prefix)):ee,rm=rb(nm,z,K,G),Jl=ee.filter(_=>K.has(_.prefix)).map(_=>_.prefix),ei=ee.filter(_=>G.has(_.prefix.replace(/-$/g,""))).map(_=>_.prefix),om=N==="color"||N==="flexbox"&&br||N==="borders"?!1:z.length===0&&Jl.length===0&&ei.length===0,sm=N==="borders"?Xn(r).slots.filter(_=>_.value!=null).length+(Xn(r).shorthandValue?1:0):z.length+Jl.length+ei.length;return i.jsxs(Ud,{label:J1[N]??N,availableProperties:rm,onAddProperty:st,isEmpty:om,classCount:sm,children:[N==="borders"&&i.jsx(y1,{state:_e(Xn(r)),onSlotHover:(_,re)=>{var ue;const V=Xn(r),fe=(_==="all"?f.get("all")??V.shorthandValue:f.get(_)??((ue=V.slots.find(Te=>Te.key===_))==null?void 0:ue.value)??null)??"";re===null?s.revertPreview():s.preview(fe,re)},onSlotChange:(_,re)=>{var fe;const V=Xn(r),U=f.get(_)??(_==="all"?V.shorthandValue:(fe=V.slots.find(ue=>ue.key===_))==null?void 0:fe.value)??"";q(`rounded-${_}`,U,re),h(ue=>new Map(ue).set(_,re))},onSlotRemove:_=>{var V;const re=f.get(_)??((V=Xn(r).slots.find(U=>U.key===_))==null?void 0:V.value)??"";re&&(q(`rounded-${_}`,re,""),h(U=>new Map(U).set(_,null)))},onSlotRemoveHover:_=>{var V;const re=f.get(_)??((V=Xn(r).slots.find(U=>U.key===_))==null?void 0:V.value)??"";re&&s.preview(re,"")},onEditStart:()=>pe("overlay",{type:"CLEAR_HIGHLIGHTS"})}),N==="color"&&i.jsx(E1,{...j1(r,(o==null?void 0:o.colors)||{},P.filter(_=>_.elementKey===R)),onPreview:ne,onPreviewBatch:_=>s.previewBatch(_),onRevert:ge,onStage:Gn}),N==="flexbox"&&br&&(()=>{const _=r,re=_.find(le=>{const xe=Zn[le.fullClass];return(xe==null?void 0:xe.propertyKey)==="flex-direction"}),V=_.find(le=>{const xe=Zn[le.fullClass];return(xe==null?void 0:xe.propertyKey)==="justify-content"}),U=_.find(le=>{const xe=Zn[le.fullClass];return(xe==null?void 0:xe.propertyKey)==="align-items"}),fe=_.find(le=>{const xe=Zn[le.fullClass];return(xe==null?void 0:xe.propertyKey)==="flex-wrap"}),ue={"flex-row":"row","flex-col":"column","flex-row-reverse":"row-reverse","flex-col-reverse":"column-reverse"},Te=Y("flex-direction",re),is=Te.effectiveClass?ue[Te.effectiveClass]??"row":"row",Ut=Y("flex-wrap",fe),Oe=Y("justify-content",V),Ve=Y("align-items",U),lm=r.find(le=>le.property==="gap"),im=r.find(le=>le.property==="gap-x"),am=r.find(le=>le.property==="gap-y"),lo=Y("gap",lm),io=Y("gap-x",im),ao=Y("gap-y",am),um=[{key:"gap",value:lo.effectiveClass||null,scaleValues:Sr("gap-","spacing",o)},{key:"gap-x",value:io.effectiveClass||null,scaleValues:Sr("gap-x-","spacing",o)},{key:"gap-y",value:ao.effectiveClass||null,scaleValues:Sr("gap-y-","spacing",o)}];return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex justify-between items-start w-full",children:[i.jsx(R1,{currentValue:(re==null?void 0:re.fullClass)??null,lockedValue:Te.effectiveClass!==Te.originalClass?Te.effectiveClass:null,locked:!1,onHover:le=>ne(Te.effectiveClass,le),onLeave:ge,onClick:le=>q("flex-direction",Te.originalClass,le)}),i.jsx(A1,{currentValue:(fe==null?void 0:fe.fullClass)??null,lockedValue:Ut.effectiveClass!==Ut.originalClass?Ut.effectiveClass:null,locked:!1,onHover:le=>ne(Ut.effectiveClass,le),onLeave:ge,onClick:le=>q("flex-wrap",Ut.originalClass,le)}),i.jsx(O1,{currentValue:(V==null?void 0:V.fullClass)??null,lockedValue:Oe.effectiveClass!==Oe.originalClass?Oe.effectiveClass:null,locked:!1,flexDirection:is,onHover:le=>ne(Oe.effectiveClass,le),onLeave:ge,onClick:le=>q("justify-content",Oe.originalClass,le),onRemove:Oe.hasValue?()=>q("justify-content",Oe.originalClass,""):void 0,onRemoveHover:Oe.hasValue?()=>ne(Oe.effectiveClass,""):void 0}),i.jsx(M1,{currentValue:(U==null?void 0:U.fullClass)??null,lockedValue:Ve.effectiveClass!==Ve.originalClass?Ve.effectiveClass:null,locked:!1,flexDirection:is,onHover:le=>ne(Ve.effectiveClass,le),onLeave:ge,onClick:le=>q("align-items",Ve.originalClass,le),onRemove:Ve.hasValue?()=>q("align-items",Ve.originalClass,""):void 0,onRemoveHover:Ve.hasValue?()=>ne(Ve.effectiveClass,""):void 0})]}),i.jsx("div",{className:"h-px w-full bg-bv-border opacity-50 my-2"}),i.jsx($1,{slots:um,onSlotHover:(le,xe)=>{const rc=le==="gap"?lo:le==="gap-x"?io:ao;xe===null?s.revertPreview():s.preview(rc.effectiveClass,xe)},onSlotRemoveHover:le=>{const xe=le==="gap"?lo:le==="gap-x"?io:ao;xe.hasValue&&s.preview(xe.effectiveClass,"")},onSlotChange:(le,xe)=>{q(le,(le==="gap"?lo:le==="gap-x"?io:ao).originalClass,xe)},onSlotRemove:le=>{const xe=le==="gap"?lo:le==="gap-x"?io:ao;xe.hasValue&&(s.preview(xe.effectiveClass,""),q(le,xe.originalClass,""))}})]})})(),z.map(_=>{var re,V;if(br){const U=Zn[_.fullClass];if(U&&se.has(U.propertyKey)||se.has(_.property))return null}if(_.scaleName!==void 0){const U=Sr(ef(_),_.scaleName,o);if(U.length>0){const fe=((re=P.find(ue=>ue.property===_.property))==null?void 0:re.newClass)??null;return i.jsx(kn,{values:U,currentValue:_.fullClass,lockedValue:fe,locked:!1,onStart:()=>pe("overlay",{type:"CLEAR_HIGHLIGHTS"}),onHover:ue=>ae(_,ue),onLeave:()=>me(),onClick:ue=>q(_.property,_.fullClass,ue),onRemoveHover:()=>s.preview(_.fullClass,""),onRemove:()=>q(_.property,_.fullClass,"")},_.fullClass)}}if(_.scaleName===void 0&&_.color===void 0){const U=Zn[_.fullClass];if(U){const fe=((V=P.find(ue=>ue.property===U.propertyKey))==null?void 0:V.newClass)??null;return i.jsx(kn,{values:U.alternatives,currentValue:_.fullClass,lockedValue:fe,locked:!1,onStart:()=>pe("overlay",{type:"CLEAR_HIGHLIGHTS"}),onHover:ue=>ae(_,ue),onLeave:()=>me(),onClick:ue=>q(U.propertyKey,_.fullClass,ue),onRemoveHover:()=>s.preview(_.fullClass,""),onRemove:()=>q(U.propertyKey,_.fullClass,"")},_.fullClass)}}return i.jsxs("div",{className:`group flex items-center gap-1 px-2 py-0.5 rounded cursor-pointer text-[11px] font-mono border transition-colors ${(l==null?void 0:l.fullClass)===_.fullClass||(v==null?void 0:v.cls.fullClass)===_.fullClass?"border-bv-border bg-bv-surface-hi text-bv-text":"bg-bv-surface text-bv-text-mid border-transparent hover:border-bv-teal hover:text-bv-teal"}`,onClick:U=>bn(_,U.currentTarget),children:[_.fullClass,i.jsx("span",{className:"opacity-0 group-hover:opacity-60 hover:!opacity-100 ml-0.5 shrink-0",title:"Remove class",onClick:U=>{U.stopPropagation(),q(_.property,_.fullClass,"")},onMouseEnter:U=>{U.stopPropagation(),s.preview(_.fullClass,"")},onMouseLeave:U=>{U.stopPropagation(),s.revertPreview()},children:i.jsxs("svg",{viewBox:"0 0 10 10",width:"8",height:"8",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("line",{x1:"1",y1:"1",x2:"9",y2:"9",stroke:"#F5532D",strokeWidth:"1.8",strokeLinecap:"round"}),i.jsx("line",{x1:"9",y1:"1",x2:"1",y2:"9",stroke:"#F5532D",strokeWidth:"1.8",strokeLinecap:"round"})]})})]},_.fullClass)}),ei.filter(_=>!(br&&ye.has(_))).map(_=>{const re=Qs(_);if(!re)return null;if(re.valueType==="scalar"){const V=Sr(_,re.scaleName,o);if(V.length===0)return null;const U=P.find(fe=>fe.property===re.stagingKey);return i.jsx(kn,{values:V,currentValue:(U==null?void 0:U.newClass)??V[Math.floor(V.length/2)],lockedValue:(U==null?void 0:U.newClass)??null,locked:!1,onStart:()=>pe("overlay",{type:"CLEAR_HIGHLIGHTS"}),onHover:fe=>Je(_,fe),onLeave:()=>lt(),onClick:fe=>X(_,fe)},`staged-${_}`)}if(re.valueType==="enum"&&re.enumAlts){const V=P.find(U=>U.property===re.stagingKey);return i.jsx(kn,{values:re.enumAlts,currentValue:(V==null?void 0:V.newClass)??re.enumAlts[0],lockedValue:(V==null?void 0:V.newClass)??null,locked:!1,onStart:()=>pe("overlay",{type:"CLEAR_HIGHLIGHTS"}),onHover:U=>Je(_,U),onLeave:()=>lt(),onClick:U=>X(_,U)},`staged-${_}`)}return null}),Jl.filter(_=>!(br&&ye.has(_))).map(_=>{const re=Qs(_);if(!re)return null;if(re.valueType==="scalar"){const V=Sr(_,re.scaleName,o);if(V.length>0)return i.jsx(kn,{values:V,currentValue:V[Math.floor(V.length/2)],lockedValue:null,locked:!1,ghost:!0,onStart:()=>pe("overlay",{type:"CLEAR_HIGHLIGHTS"}),onHover:U=>Je(_,U),onLeave:()=>lt(),onClick:U=>X(_,U)},`pending-${_}`)}return re.valueType==="enum"&&re.enumAlts?i.jsx(kn,{values:re.enumAlts,currentValue:re.enumAlts[0],lockedValue:null,locked:!1,ghost:!0,onStart:()=>pe("overlay",{type:"CLEAR_HIGHLIGHTS"}),onHover:V=>Je(_,V),onLeave:()=>lt(),onClick:V=>X(_,V)},`pending-${_}`):re.valueType==="color"?i.jsxs("div",{"data-testid":`pending-ghost-${_}`,className:"px-2 py-0.5 rounded cursor-pointer text-[11px] font-mono border border-dashed border-bv-border text-bv-muted hover:border-bv-teal hover:text-bv-teal transition-colors",onClick:V=>{w({cls:{property:"text",fullClass:"",section:"typography",color:""},anchorEl:V.currentTarget}),a(null)},children:[_==="text-color"?"text-":_,"color"]},`pending-${_}`):null})]},N)})]})}const lb=b.lazy(()=>Ky(()=>import("./DesignMode-D0K3dC8Q.js"),[]).then(e=>({default:e.DesignMode}))),Jh=new URLSearchParams(window.location.search),ib=Jh.get("mode"),vo=Jh.get("embedded")==="storybook";function ab(e,t){const n=`<${t}>`;switch(e){case"before":return`Before ${n}`;case"after":return`After ${n}`;case"first-child":return`First in ${n}`;case"last-child":return`Last in ${n}`;default:return`${e} ${n}`}}function ub(){return ib==="design"?i.jsx(b.Suspense,{fallback:null,children:i.jsx(lb,{})}):i.jsx(cb,{})}function cb(){const[e,t]=b.useState(!1),n=Ix(),[r,o]=b.useState(!1),[s,l]=b.useState(!1),{mode:a,elementData:u,selectionId:c,insertPoint:f,selectModeActive:h,textEditing:d,currentTabs:m,activeTab:v,isPicking:w,handleModeChange:S,handleTabChange:p,handleWsMessage:g}=fv(),y=w&&!s,x=!!u||!!f,k=b.useCallback($=>{l($)},[]);b.useEffect(()=>{l(!1)},[a]),b.useEffect(()=>{const $=Wy(()=>{if(t(!0),!vo)try{const q=localStorage.getItem("tw-panel-container");q&&q!=="popover"&&pe("overlay",{type:"SWITCH_CONTAINER",container:q})}catch{}}),ne=By(()=>t(!1)),ge=wl(q=>{g(q)||(q.type==="QUEUE_UPDATE"?n.handleQueueUpdate({draftCount:q.draftCount,committedCount:q.committedCount,implementingCount:q.implementingCount,implementedCount:q.implementedCount,partialCount:q.partialCount,errorCount:q.errorCount,draft:q.draft,commits:q.commits,agentWaiting:q.agentWaiting}):q.type==="PATCH_UPDATE"&&n.handlePatchUpdate({staged:q.staged,committed:q.committed,implementing:q.implementing,implemented:q.implemented,patches:q.patches}))});return gh(),t(Vy()),()=>{$(),ne(),ge()}},[]);const{draft:C,committed:T,implementing:E,implemented:A,partial:I,error:L}=n.counts,B=(C>0||T>0)&&!n.agentWaiting&&E===0,K=new Map(n.patches.filter($=>$.status==="staged").map($=>[$.id,{id:$.id,kind:$.kind??"class-change",elementKey:$.elementKey,status:$.status,originalClass:$.originalClass,newClass:$.newClass,property:$.property,timestamp:$.timestamp,component:$.component,message:$.message,image:$.image}])),D=new Set(n.queueState.draft.map($=>$.id)),H=[...n.queueState.draft.map($=>K.get($.id)??$),...n.patches.filter($=>$.status==="staged"&&!D.has($.id)).map($=>K.get($.id))],Q=n.queueState.commits.filter($=>$.status==="committed"),J=n.queueState.commits.filter($=>$.status==="implementing"),j=n.queueState.commits.filter($=>$.status==="implemented"),R="Please implement the next change and continue implementing changes with VyBit.";async function P($){if(navigator.clipboard){try{if((await navigator.permissions.query({name:"clipboard-write"})).state==="denied"){Y($);return}}catch{}navigator.clipboard.writeText($).catch(()=>Y($))}else Y($)}function G(){P(R),o(!0),setTimeout(()=>o(!1),2e3)}function Y($){const ne=document.createElement("textarea");ne.value=$,ne.style.position="fixed",ne.style.opacity="0",document.body.appendChild(ne),ne.select(),document.execCommand("copy"),document.body.removeChild(ne)}const Ce=i.jsxs("div",{className:"shrink-0",children:[!e&&i.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1.5 bg-amber-950/40 border-t border-amber-800/40 text-amber-300 text-[10px] font-medium",children:[i.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-bv-orange animate-pulse shrink-0"}),i.jsxs("span",{className:"flex-1 leading-tight",children:["No agent listening —"," ",i.jsx("a",{href:"https://github.com/bitovi/vybit?tab=readme-ov-file#telling-your-agent-to-start-making-features",target:"_blank",rel:"noreferrer",className:"underline hover:text-amber-100",children:"ask your agent"})," ","to start!"]}),i.jsx("button",{onClick:G,className:`shrink-0 px-1.5 py-0.5 rounded border font-semibold text-[9px] transition-colors ${r?"border-emerald-700/50 bg-emerald-900/40 text-emerald-300":"border-amber-700/50 bg-amber-900/40 hover:bg-amber-800/40 text-amber-300"}`,title:`Copy: "${R}"`,children:r?"Copied!":"Copy prompt"})]}),B&&i.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1.5 bg-amber-950/40 border-t border-amber-800/40 text-amber-300 text-[10px] font-medium",children:[i.jsx("svg",{width:"12",height:"12",viewBox:"0 0 20 20",fill:"currentColor",className:"shrink-0 text-amber-400",children:i.jsx("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.19-1.458-1.516-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})}),i.jsxs("span",{className:"flex-1 leading-tight",children:["No agent watching —"," ",i.jsx("a",{href:"https://github.com/bitovi/vybit?tab=readme-ov-file#telling-your-agent-to-start-making-features",target:"_blank",rel:"noreferrer",className:"underline hover:text-amber-100",children:"ask your agent"})," ","to start"]}),i.jsx("button",{onClick:G,className:`shrink-0 px-1.5 py-0.5 rounded border font-semibold text-[9px] transition-colors ${r?"border-emerald-700/50 bg-emerald-900/40 text-emerald-300":"border-amber-700/50 bg-amber-900/40 hover:bg-amber-800/40 text-amber-300"}`,title:`Copy: "${R}"`,children:r?"Copied!":"Copy prompt"})]}),i.jsxs("div",{className:"flex items-center justify-center px-3 py-1.5 border-t border-bv-border gap-3 text-[10px]",children:[i.jsx(Ns,{label:"draft",count:C,items:H,activeColor:"text-amber-400",onDiscard:$=>n.discard($),onCommitAll:()=>n.commitAll(),onDiscardAll:()=>n.discardAll()}),i.jsx(Ns,{label:"committed",count:T,items:Q.flatMap($=>$.patches),activeColor:"text-bv-orange",onDiscard:$=>n.discardCommit($)}),i.jsx(Ns,{label:"implementing",count:E,items:J.flatMap($=>$.patches),activeColor:"text-blue-400"}),i.jsx(Ns,{label:"implemented",count:A,items:j.flatMap($=>$.patches),activeColor:"text-bv-teal"})]})]});if(!u)return a===null?i.jsxs("div",{className:"h-full flex flex-col",children:[i.jsx("div",{className:"px-3 pt-3 pb-2 border-b border-bv-border",children:i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsx(Ts,{mode:a,onModeChange:S,isPicking:y,isEngaged:x}),!vo&&i.jsx(Es,{})]})}),i.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-4 p-6",children:[i.jsxs("button",{onClick:()=>S("select"),className:"w-full flex flex-col items-center gap-3 px-6 py-5 rounded-lg border border-bv-border bg-bv-surface hover:border-bv-teal hover:bg-bv-teal/5 transition-all cursor-pointer",children:[i.jsx("div",{className:"w-14 h-14 rounded-full bg-bv-teal/10 text-bv-teal flex items-center justify-center",children:i.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 64 64",fill:"currentColor",children:[i.jsx("path",{d:"M2,9C1.447,9,1,8.552,1,8V2c0-0.552,0.447-1,1-1h6c0.553,0,1,0.448,1,1S8.553,3,8,3H3v5C3,8.552,2.553,9,2,9z"}),i.jsx("path",{d:"M8,48H2c-0.553,0-1-0.448-1-1v-6c0-0.552,0.447-1,1-1s1,0.448,1,1v5h5c0.553,0,1,0.448,1,1S8.553,48,8,48z"}),i.jsx("path",{d:"M47,9c-0.553,0-1-0.448-1-1V3h-5c-0.553,0-1-0.448-1-1s0.447-1,1-1h6c0.553,0,1,0.448,1,1v6C48,8.552,47.553,9,47,9z"}),i.jsx("path",{d:"M21,3h-6c-0.553,0-1-0.448-1-1s0.447-1,1-1h6c0.553,0,1,0.448,1,1S21.553,3,21,3z"}),i.jsx("path",{d:"M2,22c-0.553,0-1-0.448-1-1v-6c0-0.552,0.447-1,1-1s1,0.448,1,1v6C3,21.552,2.553,22,2,22z"}),i.jsx("path",{d:"M2,35c-0.553,0-1-0.448-1-1v-6c0-0.552,0.447-1,1-1s1,0.448,1,1v6C3,34.552,2.553,35,2,35z"}),i.jsx("path",{d:"M47,22c-0.553,0-1-0.448-1-1v-6c0-0.552,0.447-1,1-1s1,0.448,1,1v6C48,21.552,47.553,22,47,22z"}),i.jsx("path",{d:"M47,31c-0.553,0-1-0.448-1-1v-2c0-0.552,0.447-1,1-1s1,0.448,1,1v2C48,30.552,47.553,31,47,31z"}),i.jsx("path",{d:"M34,3h-6c-0.553,0-1-0.448-1-1s0.447-1,1-1h6c0.553,0,1,0.448,1,1S34.553,3,34,3z"}),i.jsx("path",{d:"M21,48h-6c-0.553,0-1-0.448-1-1s0.447-1,1-1h6c0.553,0,1,0.448,1,1S21.553,48,21,48z"}),i.jsx("path",{d:"M30,48h-2c-0.553,0-1-0.448-1-1s0.447-1,1-1h2c0.553,0,1,0.448,1,1S30.553,48,30,48z"}),i.jsx("path",{d:"M62.707,57.293L51.688,46.274l10.759-5.379c0.368-0.184,0.586-0.575,0.549-0.985c-0.037-0.41-0.322-0.755-0.717-0.87l-31-9c-0.355-0.1-0.729-0.005-0.986,0.253c-0.258,0.258-0.355,0.636-0.253,0.986l9,31c0.114,0.396,0.46,0.68,0.869,0.717C39.94,62.999,39.971,63,40,63c0.376,0,0.724-0.212,0.895-0.553l5.38-10.759l11.019,11.019c0.391,0.391,1.023,0.391,1.414,0l4-4C63.098,58.316,63.098,57.684,62.707,57.293z"})]})}),i.jsx("span",{className:"text-[13px] text-bv-text font-medium",children:"Select an element"}),i.jsx("span",{className:"text-[11px] text-bv-text-mid text-center leading-relaxed",children:"to change its design, its text, or to replace it with something else"})]}),i.jsxs("button",{onClick:()=>S("insert"),className:"w-full flex flex-col items-center gap-3 px-6 py-4 rounded-lg border border-bv-border bg-bv-surface hover:border-bv-teal hover:bg-bv-teal/5 transition-all cursor-pointer",children:[i.jsx("div",{className:"w-14 h-14 rounded-full bg-bv-teal/10 text-bv-teal flex items-center justify-center",children:i.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"square",strokeLinejoin:"miter",children:[i.jsx("rect",{x:"4",y:"2",width:"16",height:"8",rx:"2"}),i.jsx("path",{d:"m17,14h1c1.105,0,2,.895,2,2"}),i.jsx("path",{d:"m4,16c0-1.105.895-2,2-2h1"}),i.jsx("path",{d:"m7,22h-1c-1.105,0-2-.895-2-2"}),i.jsx("path",{d:"m20,20c0,1.105-.895,2-2,2h-1"}),i.jsx("line",{x1:"13",y1:"14",x2:"11",y2:"14"}),i.jsx("line",{x1:"13",y1:"22",x2:"11",y2:"22"})]})}),i.jsx("span",{className:"text-[13px] text-bv-text font-medium",children:"Insert to add new content"})]}),i.jsxs("button",{onClick:()=>S("bug-report"),className:"w-full flex flex-col items-center gap-3 px-6 py-4 rounded-lg border border-bv-border bg-bv-surface hover:border-bv-teal hover:bg-bv-teal/5 transition-all cursor-pointer",children:[i.jsx("div",{className:"w-14 h-14 rounded-full bg-bv-teal/10 text-bv-teal flex items-center justify-center",children:i.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 16 16",fill:"currentColor",children:[i.jsx("path",{d:"M11.5,6C11.5,4.067,9.933,2.5,8,2.5S4.5,4.067,4.5,6v1h7V6Z"}),i.jsx("rect",{x:"3",y:"8",width:"10",height:"6",rx:"2"}),i.jsx("path",{d:"M1,5.5h2.2C3.07,5.01,3,4.51,3,4h0V3.5H1c-.552,0-1,.448-1,1S.448,5.5,1,5.5Z"}),i.jsx("path",{d:"M15,3.5h-2c0,.51-.07,1.01-.2,1.5H15c.552,0,1-.448,1-1s-.448-1-1-1Z"}),i.jsx("path",{d:"M1,11.5h2.05c.232,.89,.62,1.71,1.13,2.5H1c-.552,0-1-.448-1-1s.448-1,1-1h0Z"}),i.jsx("path",{d:"M15,10.5h-2.05c-.232,.89-.62,1.71-1.13,2.5h3.18c.552,0,1-.448,1-1s-.448-1-1-1Z"}),i.jsx("path",{d:"M1,7.5h2v2H1c-.552,0-1-.448-1-1s.448-1,1-1Z"}),i.jsx("path",{d:"M13,7.5h2c.552,0,1,.448,1,1s-.448,1-1,1h-2v-2Z"}),i.jsx("rect",{x:"7",y:"9",width:"2",height:"4",rx:".5"})]})}),i.jsx("span",{className:"text-[13px] text-bv-text font-medium",children:"Report a bug"}),i.jsx("span",{className:"text-[11px] text-bv-text-mid text-center leading-relaxed",children:"Select events from recording history and describe the issue"})]})]}),Ce]}):a==="bug-report"?i.jsxs("div",{className:"h-full flex flex-col",children:[i.jsx("div",{className:"px-3 pt-3 pb-2 border-b border-bv-border",children:i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsx(Ts,{mode:a,onModeChange:S,isPicking:y,isEngaged:x}),i.jsx("div",{className:"flex-1 min-w-0",children:i.jsx("span",{className:"font-[family-name:var(--font-display)] font-bold text-[13px] text-bv-text leading-tight",children:"Bug Report"})}),!vo&&i.jsx(Es,{})]})}),i.jsx(Rx,{onSubmit:$=>{var ge;const ne={id:crypto.randomUUID(),kind:"bug-report",elementKey:((ge=$.bugElement)==null?void 0:ge.selectorPath)??"bug-report",status:"staged",originalClass:"",newClass:"",property:"bug-report",timestamp:new Date().toISOString(),bugDescription:$.bugDescription,bugScreenshots:$.bugScreenshots,bugTimeline:$.bugTimeline,bugTimeRange:$.bugTimeRange,bugElement:$.bugElement};Nn({type:"BUG_REPORT_STAGE",patch:ne})}}),Ce]}):i.jsxs("div",{className:"h-full flex flex-col",children:[i.jsx("div",{className:"px-3 pt-3 pb-2 border-b border-bv-border",children:i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsx(Ts,{mode:a,onModeChange:S,isPicking:y,isEngaged:x}),i.jsx("div",{className:"flex-1 min-w-0",children:a==="insert"?i.jsx("span",{className:"text-[11px] text-bv-teal font-medium",children:f?ab(f.position,f.targetName):"Pick a placement on the page"}):h?i.jsx("span",{className:"text-[11px] text-bv-teal font-medium",children:"Click an element on the page"}):i.jsx("span",{className:"text-[12px] text-bv-muted",children:"No element selected"})}),!vo&&i.jsx(Es,{})]})}),i.jsx(Sd,{tabs:m,activeTab:v,onTabChange:p}),i.jsx("div",{className:"flex-1 overflow-auto",children:v==="replace"?i.jsx(js,{insertMode:"replace",hasPageSelection:!!u||!!f,onArmedChange:k}):v==="place"?i.jsx(js,{insertMode:"place",hasPageSelection:!!u||!!f,onArmedChange:k}):h?i.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 p-8",children:[i.jsx("div",{className:"w-10 h-10 rounded-full bg-bv-teal text-white flex items-center justify-center",children:i.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 16 16",fill:"currentColor",children:[i.jsx("path",{d:"M14,0H2C.895,0,0,.895,0,2V14c0,1.105,.895,2,2,2H6c.552,0,1-.448,1-1h0c0-.552-.448-1-1-1H2V2H14V6c0,.552,.448,1,1,1h0c.552,0,1-.448,1-1V2c0-1.105-.895-2-2-2Z"}),i.jsx("path",{d:"M12.043,10.629l2.578-.644c.268-.068,.43-.339,.362-.607-.043-.172-.175-.308-.345-.358l-7-2c-.175-.051-.363-.002-.492,.126-.128,.129-.177,.317-.126,.492l2,7c.061,.214,.257,.362,.48,.362h.009c.226-.004,.421-.16,.476-.379l.644-2.578,3.664,3.664c.397,.384,1.03,.373,1.414-.025,.374-.388,.374-1.002,0-1.389l-3.664-3.664Z"})]})}),i.jsx("span",{className:"text-[12px] text-bv-teal font-medium",children:"Selection mode active"}),i.jsxs("span",{className:"text-[12px] text-bv-muted text-center leading-relaxed",children:["Hover over elements on the page to preview, then click to select.",i.jsx("br",{}),"Press"," ",i.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded bg-white/6 border border-white/8 font-mono text-[10px] text-bv-text-mid leading-none",children:"Esc"})," ","to cancel."]})]}):i.jsx("div",{className:"flex flex-1 flex-col justify-center p-4",children:i.jsxs("button",{onClick:()=>{S("select")},className:"w-full flex flex-col items-center gap-3 px-6 py-5 rounded-lg border border-bv-border bg-bv-surface hover:border-bv-teal hover:bg-bv-teal/5 transition-all cursor-pointer",children:[i.jsx("div",{className:"w-14 h-14 rounded-full bg-bv-teal/10 text-bv-teal flex items-center justify-center",children:i.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 64 64",fill:"currentColor",children:[i.jsx("path",{d:"M2,9C1.447,9,1,8.552,1,8V2c0-0.552,0.447-1,1-1h6c0.553,0,1,0.448,1,1S8.553,3,8,3H3v5C3,8.552,2.553,9,2,9z"}),i.jsx("path",{d:"M8,48H2c-0.553,0-1-0.448-1-1v-6c0-0.552,0.447-1,1-1s1,0.448,1,1v5h5c0.553,0,1,0.448,1,1S8.553,48,8,48z"}),i.jsx("path",{d:"M47,9c-0.553,0-1-0.448-1-1V3h-5c-0.553,0-1-0.448-1-1s0.447-1,1-1h6c0.553,0,1,0.448,1,1v6C48,8.552,47.553,9,47,9z"}),i.jsx("path",{d:"M21,3h-6c-0.553,0-1-0.448-1-1s0.447-1,1-1h6c0.553,0,1,0.448,1,1S21.553,3,21,3z"}),i.jsx("path",{d:"M2,22c-0.553,0-1-0.448-1-1v-6c0-0.552,0.447-1,1-1s1,0.448,1,1v6C3,21.552,2.553,22,2,22z"}),i.jsx("path",{d:"M2,35c-0.553,0-1-0.448-1-1v-6c0-0.552,0.447-1,1-1s1,0.448,1,1v6C3,34.552,2.553,35,2,35z"}),i.jsx("path",{d:"M47,22c-0.553,0-1-0.448-1-1v-6c0-0.552,0.447-1,1-1s1,0.448,1,1v6C48,21.552,47.553,22,47,22z"}),i.jsx("path",{d:"M47,31c-0.553,0-1-0.448-1-1v-2c0-0.552,0.447-1,1-1s1,0.448,1,1v2C48,30.552,47.553,31,47,31z"}),i.jsx("path",{d:"M34,3h-6c-0.553,0-1-0.448-1-1s0.447-1,1-1h6c0.553,0,1,0.448,1,1S34.553,3,34,3z"}),i.jsx("path",{d:"M21,48h-6c-0.553,0-1-0.448-1-1s0.447-1,1-1h6c0.553,0,1,0.448,1,1S21.553,48,21,48z"}),i.jsx("path",{d:"M30,48h-2c-0.553,0-1-0.448-1-1s0.447-1,1-1h2c0.553,0,1,0.448,1,1S30.553,48,30,48z"}),i.jsx("path",{d:"M62.707,57.293L51.688,46.274l10.759-5.379c0.368-0.184,0.586-0.575,0.549-0.985c-0.037-0.41-0.322-0.755-0.717-0.87l-31-9c-0.355-0.1-0.729-0.005-0.986,0.253c-0.258,0.258-0.355,0.636-0.253,0.986l9,31c0.114,0.396,0.46,0.68,0.869,0.717C39.94,62.999,39.971,63,40,63c0.376,0,0.724-0.212,0.895-0.553l5.38-10.759l11.019,11.019c0.391,0.391,1.023,0.391,1.414,0l4-4C63.098,58.316,63.098,57.684,62.707,57.293z"})]})}),i.jsx("span",{className:"text-[12px] text-bv-text font-medium",children:"Select an element to inspect"}),i.jsxs("span",{className:"inline-flex items-center gap-1",children:[i.jsx("span",{className:"w-5 h-5 rounded flex items-center justify-center bg-white/6 border border-white/8 font-mono text-[10px] font-semibold text-bv-text-mid leading-none",children:"⌘"}),i.jsx("span",{className:"w-5 h-5 rounded flex items-center justify-center bg-white/6 border border-white/8 font-mono text-[10px] font-semibold text-bv-text-mid leading-none",children:"⇧"}),i.jsx("span",{className:"w-5 h-5 rounded flex items-center justify-center bg-white/6 border border-white/8 font-mono text-[10px] font-semibold text-bv-text-mid leading-none",children:"C"})]})]})})}),Ce]});const _e=u.parsedClasses;return i.jsxs("div",{className:"h-full flex flex-col",children:[i.jsx("div",{className:"px-3 pt-3 pb-2 border-b border-bv-border",children:i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[i.jsx(Ts,{mode:a,onModeChange:S,isPicking:y,isEngaged:x}),i.jsxs("div",{className:"font-[family-name:var(--font-display)] font-bold text-[13px] text-bv-text leading-tight truncate",children:[u.componentName," ",i.jsxs("span",{className:"font-[family-name:var(--font-ui)] font-normal text-bv-text-mid",children:["— ",u.instanceCount," instance",u.instanceCount!==1?"s":""]})]})]}),!vo&&i.jsx(Es,{})]})}),i.jsx(Sd,{tabs:m,activeTab:v,onTabChange:p}),d&&i.jsx("div",{className:"px-3 py-2 bg-bv-teal/10 border-b border-bv-teal/30 text-xs text-bv-teal font-medium",children:"Editing text in the page…"}),i.jsxs("div",{className:`flex-1 overflow-auto ${d?"opacity-40 pointer-events-none":""}`,children:[v==="design"&&i.jsx(sb,{componentName:u.componentName,instanceCount:u.instanceCount,rawClasses:u.classes,parsedClasses:_e,tailwindConfig:u.tailwindConfig,patchManager:n},c),v==="replace"&&i.jsx(js,{insertMode:"replace",hasPageSelection:!!u||!!f,onArmedChange:k}),v==="place"&&i.jsx(js,{insertMode:"place",hasPageSelection:!!u||!!f,onArmedChange:k})]}),Ce]})}Yi.createRoot(document.getElementById("root")).render(i.jsx(ff.StrictMode,{children:i.jsx(ub,{})}));export{nx as G,wh as S,b as a,wl as b,gh as c,i as j,Wy as o,fb as r,Nn as s};