@hanmariyang/drafting 1.6.3 → 1.6.4
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.
|
@@ -6,7 +6,7 @@ var ch=Object.defineProperty;var uh=(r,i,a)=>i in r?ch(r,i,{enumerable:!0,config
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var ed;function ph(){if(ed)return Ce;ed=1;var r=Symbol.for("react.element"),i=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),g=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),
|
|
9
|
+
*/var ed;function ph(){if(ed)return Ce;ed=1;var r=Symbol.for("react.element"),i=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),g=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),j=Symbol.iterator;function S(_){return _===null||typeof _!="object"?null:(_=j&&_[j]||_["@@iterator"],typeof _=="function"?_:null)}var P={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,b={};function w(_,D,ye){this.props=_,this.context=D,this.refs=b,this.updater=ye||P}w.prototype.isReactComponent={},w.prototype.setState=function(_,D){if(typeof _!="object"&&typeof _!="function"&&_!=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,_,D,"setState")},w.prototype.forceUpdate=function(_){this.updater.enqueueForceUpdate(this,_,"forceUpdate")};function $(){}$.prototype=w.prototype;function W(_,D,ye){this.props=_,this.context=D,this.refs=b,this.updater=ye||P}var A=W.prototype=new $;A.constructor=W,k(A,w.prototype),A.isPureReactComponent=!0;var Y=Array.isArray,M=Object.prototype.hasOwnProperty,Z={current:null},H={key:!0,ref:!0,__self:!0,__source:!0};function L(_,D,ye){var ke,we={},Se=null,Pe=null;if(D!=null)for(ke in D.ref!==void 0&&(Pe=D.ref),D.key!==void 0&&(Se=""+D.key),D)M.call(D,ke)&&!H.hasOwnProperty(ke)&&(we[ke]=D[ke]);var Ne=arguments.length-2;if(Ne===1)we.children=ye;else if(1<Ne){for(var B=Array(Ne),ie=0;ie<Ne;ie++)B[ie]=arguments[ie+2];we.children=B}if(_&&_.defaultProps)for(ke in Ne=_.defaultProps,Ne)we[ke]===void 0&&(we[ke]=Ne[ke]);return{$$typeof:r,type:_,key:Se,ref:Pe,props:we,_owner:Z.current}}function F(_,D){return{$$typeof:r,type:_.type,key:D,ref:_.ref,props:_.props,_owner:_._owner}}function O(_){return typeof _=="object"&&_!==null&&_.$$typeof===r}function J(_){var D={"=":"=0",":":"=2"};return"$"+_.replace(/[=:]/g,function(ye){return D[ye]})}var te=/\/+/g;function oe(_,D){return typeof _=="object"&&_!==null&&_.key!=null?J(""+_.key):D.toString(36)}function ue(_,D,ye,ke,we){var Se=typeof _;(Se==="undefined"||Se==="boolean")&&(_=null);var Pe=!1;if(_===null)Pe=!0;else switch(Se){case"string":case"number":Pe=!0;break;case"object":switch(_.$$typeof){case r:case i:Pe=!0}}if(Pe)return Pe=_,we=we(Pe),_=ke===""?"."+oe(Pe,0):ke,Y(we)?(ye="",_!=null&&(ye=_.replace(te,"$&/")+"/"),ue(we,D,ye,"",function(ie){return ie})):we!=null&&(O(we)&&(we=F(we,ye+(!we.key||Pe&&Pe.key===we.key?"":(""+we.key).replace(te,"$&/")+"/")+_)),D.push(we)),1;if(Pe=0,ke=ke===""?".":ke+":",Y(_))for(var Ne=0;Ne<_.length;Ne++){Se=_[Ne];var B=ke+oe(Se,Ne);Pe+=ue(Se,D,ye,B,we)}else if(B=S(_),typeof B=="function")for(_=B.call(_),Ne=0;!(Se=_.next()).done;)Se=Se.value,B=ke+oe(Se,Ne++),Pe+=ue(Se,D,ye,B,we);else if(Se==="object")throw D=String(_),Error("Objects are not valid as a React child (found: "+(D==="[object Object]"?"object with keys {"+Object.keys(_).join(", ")+"}":D)+"). If you meant to render a collection of children, use an array instead.");return Pe}function ge(_,D,ye){if(_==null)return _;var ke=[],we=0;return ue(_,ke,"","",function(Se){return D.call(ye,Se,we++)}),ke}function Ee(_){if(_._status===-1){var D=_._result;D=D(),D.then(function(ye){(_._status===0||_._status===-1)&&(_._status=1,_._result=ye)},function(ye){(_._status===0||_._status===-1)&&(_._status=2,_._result=ye)}),_._status===-1&&(_._status=0,_._result=D)}if(_._status===1)return _._result.default;throw _._result}var xe={current:null},q={transition:null},le={ReactCurrentDispatcher:xe,ReactCurrentBatchConfig:q,ReactCurrentOwner:Z};function X(){throw Error("act(...) is not supported in production builds of React.")}return Ce.Children={map:ge,forEach:function(_,D,ye){ge(_,function(){D.apply(this,arguments)},ye)},count:function(_){var D=0;return ge(_,function(){D++}),D},toArray:function(_){return ge(_,function(D){return D})||[]},only:function(_){if(!O(_))throw Error("React.Children.only expected to receive a single React element child.");return _}},Ce.Component=w,Ce.Fragment=a,Ce.Profiler=d,Ce.PureComponent=W,Ce.StrictMode=u,Ce.Suspense=h,Ce.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=le,Ce.act=X,Ce.cloneElement=function(_,D,ye){if(_==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+_+".");var ke=k({},_.props),we=_.key,Se=_.ref,Pe=_._owner;if(D!=null){if(D.ref!==void 0&&(Se=D.ref,Pe=Z.current),D.key!==void 0&&(we=""+D.key),_.type&&_.type.defaultProps)var Ne=_.type.defaultProps;for(B in D)M.call(D,B)&&!H.hasOwnProperty(B)&&(ke[B]=D[B]===void 0&&Ne!==void 0?Ne[B]:D[B])}var B=arguments.length-2;if(B===1)ke.children=ye;else if(1<B){Ne=Array(B);for(var ie=0;ie<B;ie++)Ne[ie]=arguments[ie+2];ke.children=Ne}return{$$typeof:r,type:_.type,key:we,ref:Se,props:ke,_owner:Pe}},Ce.createContext=function(_){return _={$$typeof:g,_currentValue:_,_currentValue2:_,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},_.Provider={$$typeof:f,_context:_},_.Consumer=_},Ce.createElement=L,Ce.createFactory=function(_){var D=L.bind(null,_);return D.type=_,D},Ce.createRef=function(){return{current:null}},Ce.forwardRef=function(_){return{$$typeof:m,render:_}},Ce.isValidElement=O,Ce.lazy=function(_){return{$$typeof:x,_payload:{_status:-1,_result:_},_init:Ee}},Ce.memo=function(_,D){return{$$typeof:v,type:_,compare:D===void 0?null:D}},Ce.startTransition=function(_){var D=q.transition;q.transition={};try{_()}finally{q.transition=D}},Ce.unstable_act=X,Ce.useCallback=function(_,D){return xe.current.useCallback(_,D)},Ce.useContext=function(_){return xe.current.useContext(_)},Ce.useDebugValue=function(){},Ce.useDeferredValue=function(_){return xe.current.useDeferredValue(_)},Ce.useEffect=function(_,D){return xe.current.useEffect(_,D)},Ce.useId=function(){return xe.current.useId()},Ce.useImperativeHandle=function(_,D,ye){return xe.current.useImperativeHandle(_,D,ye)},Ce.useInsertionEffect=function(_,D){return xe.current.useInsertionEffect(_,D)},Ce.useLayoutEffect=function(_,D){return xe.current.useLayoutEffect(_,D)},Ce.useMemo=function(_,D){return xe.current.useMemo(_,D)},Ce.useReducer=function(_,D,ye){return xe.current.useReducer(_,D,ye)},Ce.useRef=function(_){return xe.current.useRef(_)},Ce.useState=function(_){return xe.current.useState(_)},Ce.useSyncExternalStore=function(_,D,ye){return xe.current.useSyncExternalStore(_,D,ye)},Ce.useTransition=function(){return xe.current.useTransition()},Ce.version="18.3.1",Ce}var td;function Ga(){return td||(td=1,ba.exports=ph()),ba.exports}/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.production.min.js
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@ var ch=Object.defineProperty;var uh=(r,i,a)=>i in r?ch(r,i,{enumerable:!0,config
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var nd;function hh(){if(nd)return lr;nd=1;var r=Ga(),i=Symbol.for("react.element"),a=Symbol.for("react.fragment"),u=Object.prototype.hasOwnProperty,d=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function g(m,h,v){var x,
|
|
17
|
+
*/var nd;function hh(){if(nd)return lr;nd=1;var r=Ga(),i=Symbol.for("react.element"),a=Symbol.for("react.fragment"),u=Object.prototype.hasOwnProperty,d=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function g(m,h,v){var x,j={},S=null,P=null;v!==void 0&&(S=""+v),h.key!==void 0&&(S=""+h.key),h.ref!==void 0&&(P=h.ref);for(x in h)u.call(h,x)&&!f.hasOwnProperty(x)&&(j[x]=h[x]);if(m&&m.defaultProps)for(x in h=m.defaultProps,h)j[x]===void 0&&(j[x]=h[x]);return{$$typeof:i,type:m,key:S,ref:P,props:j,_owner:d.current}}return lr.Fragment=a,lr.jsx=g,lr.jsxs=g,lr}var sd;function mh(){return sd||(sd=1,Pa.exports=hh()),Pa.exports}var s=mh(),y=Ga();const bd=fh(y),gh=dh({__proto__:null,default:bd},[y]);var wl={},_a={exports:{}},vt={},Ta={exports:{}},Ra={};/**
|
|
18
18
|
* @license React
|
|
19
19
|
* scheduler.production.min.js
|
|
20
20
|
*
|
|
@@ -22,7 +22,7 @@ var ch=Object.defineProperty;var uh=(r,i,a)=>i in r?ch(r,i,{enumerable:!0,config
|
|
|
22
22
|
*
|
|
23
23
|
* This source code is licensed under the MIT license found in the
|
|
24
24
|
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var rd;function vh(){return rd||(rd=1,(function(r){function i(q,le){var X=q.length;q.push(le);e:for(;0<X;){var
|
|
25
|
+
*/var rd;function vh(){return rd||(rd=1,(function(r){function i(q,le){var X=q.length;q.push(le);e:for(;0<X;){var _=X-1>>>1,D=q[_];if(0<d(D,le))q[_]=le,q[X]=D,X=_;else break e}}function a(q){return q.length===0?null:q[0]}function u(q){if(q.length===0)return null;var le=q[0],X=q.pop();if(X!==le){q[0]=X;e:for(var _=0,D=q.length,ye=D>>>1;_<ye;){var ke=2*(_+1)-1,we=q[ke],Se=ke+1,Pe=q[Se];if(0>d(we,X))Se<D&&0>d(Pe,we)?(q[_]=Pe,q[Se]=X,_=Se):(q[_]=we,q[ke]=X,_=ke);else if(Se<D&&0>d(Pe,X))q[_]=Pe,q[Se]=X,_=Se;else break e}}return le}function d(q,le){var X=q.sortIndex-le.sortIndex;return X!==0?X:q.id-le.id}if(typeof performance=="object"&&typeof performance.now=="function"){var f=performance;r.unstable_now=function(){return f.now()}}else{var g=Date,m=g.now();r.unstable_now=function(){return g.now()-m}}var h=[],v=[],x=1,j=null,S=3,P=!1,k=!1,b=!1,w=typeof setTimeout=="function"?setTimeout:null,$=typeof clearTimeout=="function"?clearTimeout:null,W=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function A(q){for(var le=a(v);le!==null;){if(le.callback===null)u(v);else if(le.startTime<=q)u(v),le.sortIndex=le.expirationTime,i(h,le);else break;le=a(v)}}function Y(q){if(b=!1,A(q),!k)if(a(h)!==null)k=!0,Ee(M);else{var le=a(v);le!==null&&xe(Y,le.startTime-q)}}function M(q,le){k=!1,b&&(b=!1,$(L),L=-1),P=!0;var X=S;try{for(A(le),j=a(h);j!==null&&(!(j.expirationTime>le)||q&&!J());){var _=j.callback;if(typeof _=="function"){j.callback=null,S=j.priorityLevel;var D=_(j.expirationTime<=le);le=r.unstable_now(),typeof D=="function"?j.callback=D:j===a(h)&&u(h),A(le)}else u(h);j=a(h)}if(j!==null)var ye=!0;else{var ke=a(v);ke!==null&&xe(Y,ke.startTime-le),ye=!1}return ye}finally{j=null,S=X,P=!1}}var Z=!1,H=null,L=-1,F=5,O=-1;function J(){return!(r.unstable_now()-O<F)}function te(){if(H!==null){var q=r.unstable_now();O=q;var le=!0;try{le=H(!0,q)}finally{le?oe():(Z=!1,H=null)}}else Z=!1}var oe;if(typeof W=="function")oe=function(){W(te)};else if(typeof MessageChannel<"u"){var ue=new MessageChannel,ge=ue.port2;ue.port1.onmessage=te,oe=function(){ge.postMessage(null)}}else oe=function(){w(te,0)};function Ee(q){H=q,Z||(Z=!0,oe())}function xe(q,le){L=w(function(){q(r.unstable_now())},le)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(q){q.callback=null},r.unstable_continueExecution=function(){k||P||(k=!0,Ee(M))},r.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<q?Math.floor(1e3/q):5},r.unstable_getCurrentPriorityLevel=function(){return S},r.unstable_getFirstCallbackNode=function(){return a(h)},r.unstable_next=function(q){switch(S){case 1:case 2:case 3:var le=3;break;default:le=S}var X=S;S=le;try{return q()}finally{S=X}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=function(){},r.unstable_runWithPriority=function(q,le){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var X=S;S=q;try{return le()}finally{S=X}},r.unstable_scheduleCallback=function(q,le,X){var _=r.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?_+X:_):X=_,q){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=X+D,q={id:x++,callback:le,priorityLevel:q,startTime:X,expirationTime:D,sortIndex:-1},X>_?(q.sortIndex=X,i(v,q),a(h)===null&&q===a(v)&&(b?($(L),L=-1):b=!0,xe(Y,X-_))):(q.sortIndex=D,i(h,q),k||P||(k=!0,Ee(M))),q},r.unstable_shouldYield=J,r.unstable_wrapCallback=function(q){var le=S;return function(){var X=S;S=le;try{return q.apply(this,arguments)}finally{S=X}}}})(Ra)),Ra}var ld;function xh(){return ld||(ld=1,Ta.exports=vh()),Ta.exports}/**
|
|
26
26
|
* @license React
|
|
27
27
|
* react-dom.production.min.js
|
|
28
28
|
*
|
|
@@ -30,14 +30,14 @@ var ch=Object.defineProperty;var uh=(r,i,a)=>i in r?ch(r,i,{enumerable:!0,config
|
|
|
30
30
|
*
|
|
31
31
|
* This source code is licensed under the MIT license found in the
|
|
32
32
|
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var id;function yh(){if(id)return vt;id=1;var r=Ga(),i=xh();function a(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 u=new Set,d={};function f(e,t){g(e,t),g(e+"Capture",t)}function g(e,t){for(d[e]=t,e=0;e<t.length;e++)u.add(t[e])}var m=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,v=/^[: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]*$/,x={},
|
|
34
|
-
`+
|
|
33
|
+
*/var id;function yh(){if(id)return vt;id=1;var r=Ga(),i=xh();function a(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 u=new Set,d={};function f(e,t){g(e,t),g(e+"Capture",t)}function g(e,t){for(d[e]=t,e=0;e<t.length;e++)u.add(t[e])}var m=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,v=/^[: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]*$/,x={},j={};function S(e){return h.call(j,e)?!0:h.call(x,e)?!1:v.test(e)?j[e]=!0:(x[e]=!0,!1)}function P(e,t,n,l){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return l?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function k(e,t,n,l){if(t===null||typeof t>"u"||P(e,t,n,l))return!0;if(l)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 b(e,t,n,l,o,c,p){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=l,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=c,this.removeEmptyString=p}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){w[e]=new b(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];w[t]=new b(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){w[e]=new b(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){w[e]=new b(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){w[e]=new b(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){w[e]=new b(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){w[e]=new b(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){w[e]=new b(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){w[e]=new b(e,5,!1,e.toLowerCase(),null,!1,!1)});var $=/[\-:]([a-z])/g;function W(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($,W);w[t]=new b(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($,W);w[t]=new b(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($,W);w[t]=new b(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){w[e]=new b(e,1,!1,e.toLowerCase(),null,!1,!1)}),w.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){w[e]=new b(e,1,!1,e.toLowerCase(),null,!0,!0)});function A(e,t,n,l){var o=w.hasOwnProperty(t)?w[t]:null;(o!==null?o.type!==0:l||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(k(t,n,o,l)&&(n=null),l||o===null?S(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,l=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,l?e.setAttributeNS(l,t,n):e.setAttribute(t,n))))}var Y=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,M=Symbol.for("react.element"),Z=Symbol.for("react.portal"),H=Symbol.for("react.fragment"),L=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),O=Symbol.for("react.provider"),J=Symbol.for("react.context"),te=Symbol.for("react.forward_ref"),oe=Symbol.for("react.suspense"),ue=Symbol.for("react.suspense_list"),ge=Symbol.for("react.memo"),Ee=Symbol.for("react.lazy"),xe=Symbol.for("react.offscreen"),q=Symbol.iterator;function le(e){return e===null||typeof e!="object"?null:(e=q&&e[q]||e["@@iterator"],typeof e=="function"?e:null)}var X=Object.assign,_;function D(e){if(_===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);_=t&&t[1]||""}return`
|
|
34
|
+
`+_+e}var ye=!1;function ke(e,t){if(!e||ye)return"";ye=!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(I){var l=I}Reflect.construct(e,[],t)}else{try{t.call()}catch(I){l=I}e.call(t.prototype)}else{try{throw Error()}catch(I){l=I}e()}}catch(I){if(I&&l&&typeof I.stack=="string"){for(var o=I.stack.split(`
|
|
35
35
|
`),c=l.stack.split(`
|
|
36
|
-
`),p=o.length-1,
|
|
37
|
-
`+o[p].replace(" at new "," at ");return e.displayName&&E.includes("<anonymous>")&&(E=E.replace("<anonymous>",e.displayName)),E}while(1<=p&&0<=w);break}}}finally{ye=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?D(e):""}function we(e){switch(e.tag){case 5:return D(e.type);case 16:return D("Lazy");case 13:return D("Suspense");case 19:return D("SuspenseList");case 0:case 2:case 15:return e=ke(e.type,!1),e;case 11:return e=ke(e.type.render,!1),e;case 1:return e=ke(e.type,!0),e;default:return""}}function Se(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 H:return"Fragment";case Z:return"Portal";case F:return"Profiler";case L:return"StrictMode";case oe:return"Suspense";case ue:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case J:return(e.displayName||"Context")+".Consumer";case O:return(e._context.displayName||"Context")+".Provider";case te:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ge:return t=e.displayName||null,t!==null?t:Se(e.type)||"Memo";case Ee:t=e._payload,e=e._init;try{return Se(e(t))}catch{}}return null}function Pe(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 Se(t);case 8:return t===L?"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 Ne(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function B(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ie(e){var t=B(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),l=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,c=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(p){l=""+p,c.call(this,p)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return l},setValue:function(p){l=""+p},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function pe(e){e._valueTracker||(e._valueTracker=ie(e))}function Ue(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=B(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}function nt(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 he(e,t){var n=t.checked;return X({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function ce(e,t){var n=t.defaultValue==null?"":t.defaultValue,l=t.checked!=null?t.checked:t.defaultChecked;n=Ne(t.value!=null?t.value:n),e._wrapperState={initialChecked:l,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function me(e,t){t=t.checked,t!=null&&A(e,"checked",t,!1)}function ve(e,t){me(e,t);var n=Ne(t.value),l=t.type;if(n!=null)l==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(l==="submit"||l==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Te(e,t.type,n):t.hasOwnProperty("defaultValue")&&Te(e,t.type,Ne(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function De(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var l=t.type;if(!(l!=="submit"&&l!=="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 Te(e,t,n){(t!=="number"||nt(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var js=Array.isArray;function Un(e,t,n,l){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&&l&&(e[n].defaultSelected=!0)}else{for(n=""+Ne(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,l&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Al(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(a(91));return X({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function co(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(a(92));if(js(n)){if(1<n.length)throw Error(a(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Ne(n)}}function uo(e,t){var n=Ne(t.value),l=Ne(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),l!=null&&(e.defaultValue=""+l)}function fo(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function po(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 Ml(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?po(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var hr,ho=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,l,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,l,o)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(hr=hr||document.createElement("div"),hr.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=hr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ks(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ws={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},pf=["Webkit","ms","Moz","O"];Object.keys(ws).forEach(function(e){pf.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ws[t]=ws[e]})});function mo(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ws.hasOwnProperty(e)&&ws[e]?(""+t).trim():t+"px"}function go(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var l=n.indexOf("--")===0,o=mo(n,t[n],l);n==="float"&&(n="cssFloat"),l?e.setProperty(n,o):e[n]=o}}var hf=X({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 Dl(e,t){if(t){if(hf[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(a(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(a(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(a(61))}if(t.style!=null&&typeof t.style!="object")throw Error(a(62))}}function Fl(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 Bl=null;function Ul(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Wl=null,Wn=null,Vn=null;function vo(e){if(e=Vs(e)){if(typeof Wl!="function")throw Error(a(280));var t=e.stateNode;t&&(t=Ar(t),Wl(e.stateNode,e.type,t))}}function xo(e){Wn?Vn?Vn.push(e):Vn=[e]:Wn=e}function yo(){if(Wn){var e=Wn,t=Vn;if(Vn=Wn=null,vo(e),t)for(e=0;e<t.length;e++)vo(t[e])}}function jo(e,t){return e(t)}function ko(){}var Vl=!1;function wo(e,t,n){if(Vl)return e(t,n);Vl=!0;try{return jo(e,t,n)}finally{Vl=!1,(Wn!==null||Vn!==null)&&(ko(),yo())}}function Ns(e,t){var n=e.stateNode;if(n===null)return null;var l=Ar(n);if(l===null)return null;n=l[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":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(a(231,t,typeof n));return n}var Hl=!1;if(m)try{var Ss={};Object.defineProperty(Ss,"passive",{get:function(){Hl=!0}}),window.addEventListener("test",Ss,Ss),window.removeEventListener("test",Ss,Ss)}catch{Hl=!1}function mf(e,t,n,l,o,c,p,w,E){var $=Array.prototype.slice.call(arguments,3);try{t.apply(n,$)}catch(V){this.onError(V)}}var Cs=!1,mr=null,gr=!1,Kl=null,gf={onError:function(e){Cs=!0,mr=e}};function vf(e,t,n,l,o,c,p,w,E){Cs=!1,mr=null,mf.apply(gf,arguments)}function xf(e,t,n,l,o,c,p,w,E){if(vf.apply(this,arguments),Cs){if(Cs){var $=mr;Cs=!1,mr=null}else throw Error(a(198));gr||(gr=!0,Kl=$)}}function Sn(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function No(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 So(e){if(Sn(e)!==e)throw Error(a(188))}function yf(e){var t=e.alternate;if(!t){if(t=Sn(e),t===null)throw Error(a(188));return t!==e?null:e}for(var n=e,l=t;;){var o=n.return;if(o===null)break;var c=o.alternate;if(c===null){if(l=o.return,l!==null){n=l;continue}break}if(o.child===c.child){for(c=o.child;c;){if(c===n)return So(o),e;if(c===l)return So(o),t;c=c.sibling}throw Error(a(188))}if(n.return!==l.return)n=o,l=c;else{for(var p=!1,w=o.child;w;){if(w===n){p=!0,n=o,l=c;break}if(w===l){p=!0,l=o,n=c;break}w=w.sibling}if(!p){for(w=c.child;w;){if(w===n){p=!0,n=c,l=o;break}if(w===l){p=!0,l=c,n=o;break}w=w.sibling}if(!p)throw Error(a(189))}}if(n.alternate!==l)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function Co(e){return e=yf(e),e!==null?Eo(e):null}function Eo(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Eo(e);if(t!==null)return t;e=e.sibling}return null}var Po=i.unstable_scheduleCallback,bo=i.unstable_cancelCallback,jf=i.unstable_shouldYield,kf=i.unstable_requestPaint,qe=i.unstable_now,wf=i.unstable_getCurrentPriorityLevel,ql=i.unstable_ImmediatePriority,_o=i.unstable_UserBlockingPriority,vr=i.unstable_NormalPriority,Nf=i.unstable_LowPriority,To=i.unstable_IdlePriority,xr=null,zt=null;function Sf(e){if(zt&&typeof zt.onCommitFiberRoot=="function")try{zt.onCommitFiberRoot(xr,e,void 0,(e.current.flags&128)===128)}catch{}}var _t=Math.clz32?Math.clz32:Pf,Cf=Math.log,Ef=Math.LN2;function Pf(e){return e>>>=0,e===0?32:31-(Cf(e)/Ef|0)|0}var yr=64,jr=4194304;function Es(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 kr(e,t){var n=e.pendingLanes;if(n===0)return 0;var l=0,o=e.suspendedLanes,c=e.pingedLanes,p=n&268435455;if(p!==0){var w=p&~o;w!==0?l=Es(w):(c&=p,c!==0&&(l=Es(c)))}else p=n&~o,p!==0?l=Es(p):c!==0&&(l=Es(c));if(l===0)return 0;if(t!==0&&t!==l&&(t&o)===0&&(o=l&-l,c=t&-t,o>=c||o===16&&(c&4194240)!==0))return t;if((l&4)!==0&&(l|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=l;0<t;)n=31-_t(t),o=1<<n,l|=e[n],t&=~o;return l}function bf(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 _f(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,o=e.expirationTimes,c=e.pendingLanes;0<c;){var p=31-_t(c),w=1<<p,E=o[p];E===-1?((w&n)===0||(w&l)!==0)&&(o[p]=bf(w,t)):E<=t&&(e.expiredLanes|=w),c&=~w}}function Ql(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Ro(){var e=yr;return yr<<=1,(yr&4194240)===0&&(yr=64),e}function Gl(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ps(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-_t(t),e[t]=n}function Tf(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 l=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-_t(n),c=1<<o;t[o]=0,l[o]=-1,e[o]=-1,n&=~c}}function Jl(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-_t(n),o=1<<l;o&t|e[l]&t&&(e[l]|=t),n&=~o}}var Ie=0;function Lo(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var $o,Yl,Io,Oo,zo,Zl=!1,wr=[],en=null,tn=null,nn=null,bs=new Map,_s=new Map,sn=[],Rf="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 Ao(e,t){switch(e){case"focusin":case"focusout":en=null;break;case"dragenter":case"dragleave":tn=null;break;case"mouseover":case"mouseout":nn=null;break;case"pointerover":case"pointerout":bs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":_s.delete(t.pointerId)}}function Ts(e,t,n,l,o,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:c,targetContainers:[o]},t!==null&&(t=Vs(t),t!==null&&Yl(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function Lf(e,t,n,l,o){switch(t){case"focusin":return en=Ts(en,e,t,n,l,o),!0;case"dragenter":return tn=Ts(tn,e,t,n,l,o),!0;case"mouseover":return nn=Ts(nn,e,t,n,l,o),!0;case"pointerover":var c=o.pointerId;return bs.set(c,Ts(bs.get(c)||null,e,t,n,l,o)),!0;case"gotpointercapture":return c=o.pointerId,_s.set(c,Ts(_s.get(c)||null,e,t,n,l,o)),!0}return!1}function Mo(e){var t=Cn(e.target);if(t!==null){var n=Sn(t);if(n!==null){if(t=n.tag,t===13){if(t=No(n),t!==null){e.blockedOn=t,zo(e.priority,function(){Io(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 Nr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=ei(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);Bl=l,n.target.dispatchEvent(l),Bl=null}else return t=Vs(n),t!==null&&Yl(t),e.blockedOn=n,!1;t.shift()}return!0}function Do(e,t,n){Nr(e)&&n.delete(t)}function $f(){Zl=!1,en!==null&&Nr(en)&&(en=null),tn!==null&&Nr(tn)&&(tn=null),nn!==null&&Nr(nn)&&(nn=null),bs.forEach(Do),_s.forEach(Do)}function Rs(e,t){e.blockedOn===t&&(e.blockedOn=null,Zl||(Zl=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,$f)))}function Ls(e){function t(o){return Rs(o,e)}if(0<wr.length){Rs(wr[0],e);for(var n=1;n<wr.length;n++){var l=wr[n];l.blockedOn===e&&(l.blockedOn=null)}}for(en!==null&&Rs(en,e),tn!==null&&Rs(tn,e),nn!==null&&Rs(nn,e),bs.forEach(t),_s.forEach(t),n=0;n<sn.length;n++)l=sn[n],l.blockedOn===e&&(l.blockedOn=null);for(;0<sn.length&&(n=sn[0],n.blockedOn===null);)Mo(n),n.blockedOn===null&&sn.shift()}var Hn=Y.ReactCurrentBatchConfig,Sr=!0;function If(e,t,n,l){var o=Ie,c=Hn.transition;Hn.transition=null;try{Ie=1,Xl(e,t,n,l)}finally{Ie=o,Hn.transition=c}}function Of(e,t,n,l){var o=Ie,c=Hn.transition;Hn.transition=null;try{Ie=4,Xl(e,t,n,l)}finally{Ie=o,Hn.transition=c}}function Xl(e,t,n,l){if(Sr){var o=ei(e,t,n,l);if(o===null)vi(e,t,l,Cr,n),Ao(e,l);else if(Lf(o,e,t,n,l))l.stopPropagation();else if(Ao(e,l),t&4&&-1<Rf.indexOf(e)){for(;o!==null;){var c=Vs(o);if(c!==null&&$o(c),c=ei(e,t,n,l),c===null&&vi(e,t,l,Cr,n),c===o)break;o=c}o!==null&&l.stopPropagation()}else vi(e,t,l,null,n)}}var Cr=null;function ei(e,t,n,l){if(Cr=null,e=Ul(l),e=Cn(e),e!==null)if(t=Sn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=No(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 Cr=e,null}function Fo(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(wf()){case ql:return 1;case _o:return 4;case vr:case Nf:return 16;case To:return 536870912;default:return 16}default:return 16}}var rn=null,ti=null,Er=null;function Bo(){if(Er)return Er;var e,t=ti,n=t.length,l,o="value"in rn?rn.value:rn.textContent,c=o.length;for(e=0;e<n&&t[e]===o[e];e++);var p=n-e;for(l=1;l<=p&&t[n-l]===o[c-l];l++);return Er=o.slice(e,1<l?1-l:void 0)}function Pr(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 br(){return!0}function Uo(){return!1}function yt(e){function t(n,l,o,c,p){this._reactName=n,this._targetInst=o,this.type=l,this.nativeEvent=c,this.target=p,this.currentTarget=null;for(var w in e)e.hasOwnProperty(w)&&(n=e[w],this[w]=n?n(c):c[w]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?br:Uo,this.isPropagationStopped=Uo,this}return X(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=br)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=br)},persist:function(){},isPersistent:br}),t}var Kn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ni=yt(Kn),$s=X({},Kn,{view:0,detail:0}),zf=yt($s),si,ri,Is,_r=X({},$s,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ii,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!==Is&&(Is&&e.type==="mousemove"?(si=e.screenX-Is.screenX,ri=e.screenY-Is.screenY):ri=si=0,Is=e),si)},movementY:function(e){return"movementY"in e?e.movementY:ri}}),Wo=yt(_r),Af=X({},_r,{dataTransfer:0}),Mf=yt(Af),Df=X({},$s,{relatedTarget:0}),li=yt(Df),Ff=X({},Kn,{animationName:0,elapsedTime:0,pseudoElement:0}),Bf=yt(Ff),Uf=X({},Kn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Wf=yt(Uf),Vf=X({},Kn,{data:0}),Vo=yt(Vf),Hf={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Kf={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"},qf={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Qf(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=qf[e])?!!t[e]:!1}function ii(){return Qf}var Gf=X({},$s,{key:function(e){if(e.key){var t=Hf[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Pr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Kf[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ii,charCode:function(e){return e.type==="keypress"?Pr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Pr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Jf=yt(Gf),Yf=X({},_r,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ho=yt(Yf),Zf=X({},$s,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ii}),Xf=yt(Zf),ep=X({},Kn,{propertyName:0,elapsedTime:0,pseudoElement:0}),tp=yt(ep),np=X({},_r,{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}),sp=yt(np),rp=[9,13,27,32],ai=m&&"CompositionEvent"in window,Os=null;m&&"documentMode"in document&&(Os=document.documentMode);var lp=m&&"TextEvent"in window&&!Os,Ko=m&&(!ai||Os&&8<Os&&11>=Os),qo=" ",Qo=!1;function Go(e,t){switch(e){case"keyup":return rp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Jo(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var qn=!1;function ip(e,t){switch(e){case"compositionend":return Jo(t);case"keypress":return t.which!==32?null:(Qo=!0,qo);case"textInput":return e=t.data,e===qo&&Qo?null:e;default:return null}}function ap(e,t){if(qn)return e==="compositionend"||!ai&&Go(e,t)?(e=Bo(),Er=ti=rn=null,qn=!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 Ko&&t.locale!=="ko"?null:t.data;default:return null}}var op={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 Yo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!op[e.type]:t==="textarea"}function Zo(e,t,n,l){xo(l),t=Ir(t,"onChange"),0<t.length&&(n=new ni("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var zs=null,As=null;function cp(e){gc(e,0)}function Tr(e){var t=Zn(e);if(Ue(t))return e}function up(e,t){if(e==="change")return t}var Xo=!1;if(m){var oi;if(m){var ci="oninput"in document;if(!ci){var ec=document.createElement("div");ec.setAttribute("oninput","return;"),ci=typeof ec.oninput=="function"}oi=ci}else oi=!1;Xo=oi&&(!document.documentMode||9<document.documentMode)}function tc(){zs&&(zs.detachEvent("onpropertychange",nc),As=zs=null)}function nc(e){if(e.propertyName==="value"&&Tr(As)){var t=[];Zo(t,As,e,Ul(e)),wo(cp,t)}}function dp(e,t,n){e==="focusin"?(tc(),zs=t,As=n,zs.attachEvent("onpropertychange",nc)):e==="focusout"&&tc()}function fp(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Tr(As)}function pp(e,t){if(e==="click")return Tr(t)}function hp(e,t){if(e==="input"||e==="change")return Tr(t)}function mp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Tt=typeof Object.is=="function"?Object.is:mp;function Ms(e,t){if(Tt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),l=Object.keys(t);if(n.length!==l.length)return!1;for(l=0;l<n.length;l++){var o=n[l];if(!h.call(t,o)||!Tt(e[o],t[o]))return!1}return!0}function sc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function rc(e,t){var n=sc(e);e=0;for(var l;n;){if(n.nodeType===3){if(l=e+n.textContent.length,e<=t&&l>=t)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=sc(n)}}function lc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?lc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ic(){for(var e=window,t=nt();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=nt(e.document)}return t}function ui(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 gp(e){var t=ic(),n=e.focusedElem,l=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&lc(n.ownerDocument.documentElement,n)){if(l!==null&&ui(n)){if(t=l.start,e=l.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,c=Math.min(l.start,o);l=l.end===void 0?c:Math.min(l.end,o),!e.extend&&c>l&&(o=l,l=c,c=o),o=rc(n,c);var p=rc(n,l);o&&p&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==p.node||e.focusOffset!==p.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),c>l?(e.addRange(t),e.extend(p.node,p.offset)):(t.setEnd(p.node,p.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 vp=m&&"documentMode"in document&&11>=document.documentMode,Qn=null,di=null,Ds=null,fi=!1;function ac(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;fi||Qn==null||Qn!==nt(l)||(l=Qn,"selectionStart"in l&&ui(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Ds&&Ms(Ds,l)||(Ds=l,l=Ir(di,"onSelect"),0<l.length&&(t=new ni("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=Qn)))}function Rr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Gn={animationend:Rr("Animation","AnimationEnd"),animationiteration:Rr("Animation","AnimationIteration"),animationstart:Rr("Animation","AnimationStart"),transitionend:Rr("Transition","TransitionEnd")},pi={},oc={};m&&(oc=document.createElement("div").style,"AnimationEvent"in window||(delete Gn.animationend.animation,delete Gn.animationiteration.animation,delete Gn.animationstart.animation),"TransitionEvent"in window||delete Gn.transitionend.transition);function Lr(e){if(pi[e])return pi[e];if(!Gn[e])return e;var t=Gn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in oc)return pi[e]=t[n];return e}var cc=Lr("animationend"),uc=Lr("animationiteration"),dc=Lr("animationstart"),fc=Lr("transitionend"),pc=new Map,hc="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 ln(e,t){pc.set(e,t),f(t,[e])}for(var hi=0;hi<hc.length;hi++){var mi=hc[hi],xp=mi.toLowerCase(),yp=mi[0].toUpperCase()+mi.slice(1);ln(xp,"on"+yp)}ln(cc,"onAnimationEnd"),ln(uc,"onAnimationIteration"),ln(dc,"onAnimationStart"),ln("dblclick","onDoubleClick"),ln("focusin","onFocus"),ln("focusout","onBlur"),ln(fc,"onTransitionEnd"),g("onMouseEnter",["mouseout","mouseover"]),g("onMouseLeave",["mouseout","mouseover"]),g("onPointerEnter",["pointerout","pointerover"]),g("onPointerLeave",["pointerout","pointerover"]),f("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),f("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),f("onBeforeInput",["compositionend","keypress","textInput","paste"]),f("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),f("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),f("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Fs="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(" "),jp=new Set("cancel close invalid load scroll toggle".split(" ").concat(Fs));function mc(e,t,n){var l=e.type||"unknown-event";e.currentTarget=n,xf(l,t,void 0,e),e.currentTarget=null}function gc(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],o=l.event;l=l.listeners;e:{var c=void 0;if(t)for(var p=l.length-1;0<=p;p--){var w=l[p],E=w.instance,$=w.currentTarget;if(w=w.listener,E!==c&&o.isPropagationStopped())break e;mc(o,w,$),c=E}else for(p=0;p<l.length;p++){if(w=l[p],E=w.instance,$=w.currentTarget,w=w.listener,E!==c&&o.isPropagationStopped())break e;mc(o,w,$),c=E}}}if(gr)throw e=Kl,gr=!1,Kl=null,e}function Ae(e,t){var n=t[Ni];n===void 0&&(n=t[Ni]=new Set);var l=e+"__bubble";n.has(l)||(vc(t,e,2,!1),n.add(l))}function gi(e,t,n){var l=0;t&&(l|=4),vc(n,e,l,t)}var $r="_reactListening"+Math.random().toString(36).slice(2);function Bs(e){if(!e[$r]){e[$r]=!0,u.forEach(function(n){n!=="selectionchange"&&(jp.has(n)||gi(n,!1,e),gi(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[$r]||(t[$r]=!0,gi("selectionchange",!1,t))}}function vc(e,t,n,l){switch(Fo(t)){case 1:var o=If;break;case 4:o=Of;break;default:o=Xl}n=o.bind(null,t,n,e),o=void 0,!Hl||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),l?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 vi(e,t,n,l,o){var c=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var p=l.tag;if(p===3||p===4){var w=l.stateNode.containerInfo;if(w===o||w.nodeType===8&&w.parentNode===o)break;if(p===4)for(p=l.return;p!==null;){var E=p.tag;if((E===3||E===4)&&(E=p.stateNode.containerInfo,E===o||E.nodeType===8&&E.parentNode===o))return;p=p.return}for(;w!==null;){if(p=Cn(w),p===null)return;if(E=p.tag,E===5||E===6){l=c=p;continue e}w=w.parentNode}}l=l.return}wo(function(){var $=c,V=Ul(n),K=[];e:{var U=pc.get(e);if(U!==void 0){var ee=ni,se=e;switch(e){case"keypress":if(Pr(n)===0)break e;case"keydown":case"keyup":ee=Jf;break;case"focusin":se="focus",ee=li;break;case"focusout":se="blur",ee=li;break;case"beforeblur":case"afterblur":ee=li;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":ee=Wo;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ee=Mf;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ee=Xf;break;case cc:case uc:case dc:ee=Bf;break;case fc:ee=tp;break;case"scroll":ee=zf;break;case"wheel":ee=sp;break;case"copy":case"cut":case"paste":ee=Wf;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ee=Ho}var re=(t&4)!==0,Qe=!re&&e==="scroll",_=re?U!==null?U+"Capture":null:U;re=[];for(var P=$,R;P!==null;){R=P;var Q=R.stateNode;if(R.tag===5&&Q!==null&&(R=Q,_!==null&&(Q=Ns(P,_),Q!=null&&re.push(Us(P,Q,R)))),Qe)break;P=P.return}0<re.length&&(U=new ee(U,se,null,n,V),K.push({event:U,listeners:re}))}}if((t&7)===0){e:{if(U=e==="mouseover"||e==="pointerover",ee=e==="mouseout"||e==="pointerout",U&&n!==Bl&&(se=n.relatedTarget||n.fromElement)&&(Cn(se)||se[Wt]))break e;if((ee||U)&&(U=V.window===V?V:(U=V.ownerDocument)?U.defaultView||U.parentWindow:window,ee?(se=n.relatedTarget||n.toElement,ee=$,se=se?Cn(se):null,se!==null&&(Qe=Sn(se),se!==Qe||se.tag!==5&&se.tag!==6)&&(se=null)):(ee=null,se=$),ee!==se)){if(re=Wo,Q="onMouseLeave",_="onMouseEnter",P="mouse",(e==="pointerout"||e==="pointerover")&&(re=Ho,Q="onPointerLeave",_="onPointerEnter",P="pointer"),Qe=ee==null?U:Zn(ee),R=se==null?U:Zn(se),U=new re(Q,P+"leave",ee,n,V),U.target=Qe,U.relatedTarget=R,Q=null,Cn(V)===$&&(re=new re(_,P+"enter",se,n,V),re.target=R,re.relatedTarget=Qe,Q=re),Qe=Q,ee&&se)t:{for(re=ee,_=se,P=0,R=re;R;R=Jn(R))P++;for(R=0,Q=_;Q;Q=Jn(Q))R++;for(;0<P-R;)re=Jn(re),P--;for(;0<R-P;)_=Jn(_),R--;for(;P--;){if(re===_||_!==null&&re===_.alternate)break t;re=Jn(re),_=Jn(_)}re=null}else re=null;ee!==null&&xc(K,U,ee,re,!1),se!==null&&Qe!==null&&xc(K,Qe,se,re,!0)}}e:{if(U=$?Zn($):window,ee=U.nodeName&&U.nodeName.toLowerCase(),ee==="select"||ee==="input"&&U.type==="file")var ae=up;else if(Yo(U))if(Xo)ae=hp;else{ae=fp;var de=dp}else(ee=U.nodeName)&&ee.toLowerCase()==="input"&&(U.type==="checkbox"||U.type==="radio")&&(ae=pp);if(ae&&(ae=ae(e,$))){Zo(K,ae,n,V);break e}de&&de(e,U,$),e==="focusout"&&(de=U._wrapperState)&&de.controlled&&U.type==="number"&&Te(U,"number",U.value)}switch(de=$?Zn($):window,e){case"focusin":(Yo(de)||de.contentEditable==="true")&&(Qn=de,di=$,Ds=null);break;case"focusout":Ds=di=Qn=null;break;case"mousedown":fi=!0;break;case"contextmenu":case"mouseup":case"dragend":fi=!1,ac(K,n,V);break;case"selectionchange":if(vp)break;case"keydown":case"keyup":ac(K,n,V)}var fe;if(ai)e:{switch(e){case"compositionstart":var je="onCompositionStart";break e;case"compositionend":je="onCompositionEnd";break e;case"compositionupdate":je="onCompositionUpdate";break e}je=void 0}else qn?Go(e,n)&&(je="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(je="onCompositionStart");je&&(Ko&&n.locale!=="ko"&&(qn||je!=="onCompositionStart"?je==="onCompositionEnd"&&qn&&(fe=Bo()):(rn=V,ti="value"in rn?rn.value:rn.textContent,qn=!0)),de=Ir($,je),0<de.length&&(je=new Vo(je,e,null,n,V),K.push({event:je,listeners:de}),fe?je.data=fe:(fe=Jo(n),fe!==null&&(je.data=fe)))),(fe=lp?ip(e,n):ap(e,n))&&($=Ir($,"onBeforeInput"),0<$.length&&(V=new Vo("onBeforeInput","beforeinput",null,n,V),K.push({event:V,listeners:$}),V.data=fe))}gc(K,t)})}function Us(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ir(e,t){for(var n=t+"Capture",l=[];e!==null;){var o=e,c=o.stateNode;o.tag===5&&c!==null&&(o=c,c=Ns(e,n),c!=null&&l.unshift(Us(e,c,o)),c=Ns(e,t),c!=null&&l.push(Us(e,c,o))),e=e.return}return l}function Jn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function xc(e,t,n,l,o){for(var c=t._reactName,p=[];n!==null&&n!==l;){var w=n,E=w.alternate,$=w.stateNode;if(E!==null&&E===l)break;w.tag===5&&$!==null&&(w=$,o?(E=Ns(n,c),E!=null&&p.unshift(Us(n,E,w))):o||(E=Ns(n,c),E!=null&&p.push(Us(n,E,w)))),n=n.return}p.length!==0&&e.push({event:t,listeners:p})}var kp=/\r\n?/g,wp=/\u0000|\uFFFD/g;function yc(e){return(typeof e=="string"?e:""+e).replace(kp,`
|
|
38
|
-
`).replace(wp,"")}function Or(e,t,n){if(t=yc(t),yc(e)!==t&&n)throw Error(a(425))}function zr(){}var xi=null,yi=null;function ji(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 ki=typeof setTimeout=="function"?setTimeout:void 0,Np=typeof clearTimeout=="function"?clearTimeout:void 0,jc=typeof Promise=="function"?Promise:void 0,Sp=typeof queueMicrotask=="function"?queueMicrotask:typeof jc<"u"?function(e){return jc.resolve(null).then(e).catch(Cp)}:ki;function Cp(e){setTimeout(function(){throw e})}function wi(e,t){var n=t,l=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(l===0){e.removeChild(o),Ls(t);return}l--}else n!=="$"&&n!=="$?"&&n!=="$!"||l++;n=o}while(n);Ls(t)}function an(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 kc(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 Yn=Math.random().toString(36).slice(2),At="__reactFiber$"+Yn,Ws="__reactProps$"+Yn,Wt="__reactContainer$"+Yn,Ni="__reactEvents$"+Yn,Ep="__reactListeners$"+Yn,Pp="__reactHandles$"+Yn;function Cn(e){var t=e[At];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Wt]||n[At]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=kc(e);e!==null;){if(n=e[At])return n;e=kc(e)}return t}e=n,n=e.parentNode}return null}function Vs(e){return e=e[At]||e[Wt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Zn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(a(33))}function Ar(e){return e[Ws]||null}var Si=[],Xn=-1;function on(e){return{current:e}}function Me(e){0>Xn||(e.current=Si[Xn],Si[Xn]=null,Xn--)}function ze(e,t){Xn++,Si[Xn]=e.current,e.current=t}var cn={},lt=on(cn),ft=on(!1),En=cn;function es(e,t){var n=e.type.contextTypes;if(!n)return cn;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===t)return l.__reactInternalMemoizedMaskedChildContext;var o={},c;for(c in n)o[c]=t[c];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function pt(e){return e=e.childContextTypes,e!=null}function Mr(){Me(ft),Me(lt)}function wc(e,t,n){if(lt.current!==cn)throw Error(a(168));ze(lt,t),ze(ft,n)}function Nc(e,t,n){var l=e.stateNode;if(t=t.childContextTypes,typeof l.getChildContext!="function")return n;l=l.getChildContext();for(var o in l)if(!(o in t))throw Error(a(108,Pe(e)||"Unknown",o));return X({},n,l)}function Dr(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||cn,En=lt.current,ze(lt,e),ze(ft,ft.current),!0}function Sc(e,t,n){var l=e.stateNode;if(!l)throw Error(a(169));n?(e=Nc(e,t,En),l.__reactInternalMemoizedMergedChildContext=e,Me(ft),Me(lt),ze(lt,e)):Me(ft),ze(ft,n)}var Vt=null,Fr=!1,Ci=!1;function Cc(e){Vt===null?Vt=[e]:Vt.push(e)}function bp(e){Fr=!0,Cc(e)}function un(){if(!Ci&&Vt!==null){Ci=!0;var e=0,t=Ie;try{var n=Vt;for(Ie=1;e<n.length;e++){var l=n[e];do l=l(!0);while(l!==null)}Vt=null,Fr=!1}catch(o){throw Vt!==null&&(Vt=Vt.slice(e+1)),Po(ql,un),o}finally{Ie=t,Ci=!1}}return null}var ts=[],ns=0,Br=null,Ur=0,Nt=[],St=0,Pn=null,Ht=1,Kt="";function bn(e,t){ts[ns++]=Ur,ts[ns++]=Br,Br=e,Ur=t}function Ec(e,t,n){Nt[St++]=Ht,Nt[St++]=Kt,Nt[St++]=Pn,Pn=e;var l=Ht;e=Kt;var o=32-_t(l)-1;l&=~(1<<o),n+=1;var c=32-_t(t)+o;if(30<c){var p=o-o%5;c=(l&(1<<p)-1).toString(32),l>>=p,o-=p,Ht=1<<32-_t(t)+o|n<<o|l,Kt=c+e}else Ht=1<<c|n<<o|l,Kt=e}function Ei(e){e.return!==null&&(bn(e,1),Ec(e,1,0))}function Pi(e){for(;e===Br;)Br=ts[--ns],ts[ns]=null,Ur=ts[--ns],ts[ns]=null;for(;e===Pn;)Pn=Nt[--St],Nt[St]=null,Kt=Nt[--St],Nt[St]=null,Ht=Nt[--St],Nt[St]=null}var jt=null,kt=null,Fe=!1,Rt=null;function Pc(e,t){var n=bt(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 bc(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,jt=e,kt=an(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,jt=e,kt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Pn!==null?{id:Ht,overflow:Kt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=bt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,jt=e,kt=null,!0):!1;default:return!1}}function bi(e){return(e.mode&1)!==0&&(e.flags&128)===0}function _i(e){if(Fe){var t=kt;if(t){var n=t;if(!bc(e,t)){if(bi(e))throw Error(a(418));t=an(n.nextSibling);var l=jt;t&&bc(e,t)?Pc(l,n):(e.flags=e.flags&-4097|2,Fe=!1,jt=e)}}else{if(bi(e))throw Error(a(418));e.flags=e.flags&-4097|2,Fe=!1,jt=e}}}function _c(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;jt=e}function Wr(e){if(e!==jt)return!1;if(!Fe)return _c(e),Fe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!ji(e.type,e.memoizedProps)),t&&(t=kt)){if(bi(e))throw Tc(),Error(a(418));for(;t;)Pc(e,t),t=an(t.nextSibling)}if(_c(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){kt=an(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}kt=null}}else kt=jt?an(e.stateNode.nextSibling):null;return!0}function Tc(){for(var e=kt;e;)e=an(e.nextSibling)}function ss(){kt=jt=null,Fe=!1}function Ti(e){Rt===null?Rt=[e]:Rt.push(e)}var _p=Y.ReactCurrentBatchConfig;function Hs(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(a(309));var l=n.stateNode}if(!l)throw Error(a(147,e));var o=l,c=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===c?t.ref:(t=function(p){var w=o.refs;p===null?delete w[c]:w[c]=p},t._stringRef=c,t)}if(typeof e!="string")throw Error(a(284));if(!n._owner)throw Error(a(290,e))}return e}function Vr(e,t){throw e=Object.prototype.toString.call(t),Error(a(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Rc(e){var t=e._init;return t(e._payload)}function Lc(e){function t(_,P){if(e){var R=_.deletions;R===null?(_.deletions=[P],_.flags|=16):R.push(P)}}function n(_,P){if(!e)return null;for(;P!==null;)t(_,P),P=P.sibling;return null}function l(_,P){for(_=new Map;P!==null;)P.key!==null?_.set(P.key,P):_.set(P.index,P),P=P.sibling;return _}function o(_,P){return _=xn(_,P),_.index=0,_.sibling=null,_}function c(_,P,R){return _.index=R,e?(R=_.alternate,R!==null?(R=R.index,R<P?(_.flags|=2,P):R):(_.flags|=2,P)):(_.flags|=1048576,P)}function p(_){return e&&_.alternate===null&&(_.flags|=2),_}function w(_,P,R,Q){return P===null||P.tag!==6?(P=ka(R,_.mode,Q),P.return=_,P):(P=o(P,R),P.return=_,P)}function E(_,P,R,Q){var ae=R.type;return ae===H?V(_,P,R.props.children,Q,R.key):P!==null&&(P.elementType===ae||typeof ae=="object"&&ae!==null&&ae.$$typeof===Ee&&Rc(ae)===P.type)?(Q=o(P,R.props),Q.ref=Hs(_,P,R),Q.return=_,Q):(Q=hl(R.type,R.key,R.props,null,_.mode,Q),Q.ref=Hs(_,P,R),Q.return=_,Q)}function $(_,P,R,Q){return P===null||P.tag!==4||P.stateNode.containerInfo!==R.containerInfo||P.stateNode.implementation!==R.implementation?(P=wa(R,_.mode,Q),P.return=_,P):(P=o(P,R.children||[]),P.return=_,P)}function V(_,P,R,Q,ae){return P===null||P.tag!==7?(P=zn(R,_.mode,Q,ae),P.return=_,P):(P=o(P,R),P.return=_,P)}function K(_,P,R){if(typeof P=="string"&&P!==""||typeof P=="number")return P=ka(""+P,_.mode,R),P.return=_,P;if(typeof P=="object"&&P!==null){switch(P.$$typeof){case M:return R=hl(P.type,P.key,P.props,null,_.mode,R),R.ref=Hs(_,null,P),R.return=_,R;case Z:return P=wa(P,_.mode,R),P.return=_,P;case Ee:var Q=P._init;return K(_,Q(P._payload),R)}if(js(P)||le(P))return P=zn(P,_.mode,R,null),P.return=_,P;Vr(_,P)}return null}function U(_,P,R,Q){var ae=P!==null?P.key:null;if(typeof R=="string"&&R!==""||typeof R=="number")return ae!==null?null:w(_,P,""+R,Q);if(typeof R=="object"&&R!==null){switch(R.$$typeof){case M:return R.key===ae?E(_,P,R,Q):null;case Z:return R.key===ae?$(_,P,R,Q):null;case Ee:return ae=R._init,U(_,P,ae(R._payload),Q)}if(js(R)||le(R))return ae!==null?null:V(_,P,R,Q,null);Vr(_,R)}return null}function ee(_,P,R,Q,ae){if(typeof Q=="string"&&Q!==""||typeof Q=="number")return _=_.get(R)||null,w(P,_,""+Q,ae);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case M:return _=_.get(Q.key===null?R:Q.key)||null,E(P,_,Q,ae);case Z:return _=_.get(Q.key===null?R:Q.key)||null,$(P,_,Q,ae);case Ee:var de=Q._init;return ee(_,P,R,de(Q._payload),ae)}if(js(Q)||le(Q))return _=_.get(R)||null,V(P,_,Q,ae,null);Vr(P,Q)}return null}function se(_,P,R,Q){for(var ae=null,de=null,fe=P,je=P=0,tt=null;fe!==null&&je<R.length;je++){fe.index>je?(tt=fe,fe=null):tt=fe.sibling;var _e=U(_,fe,R[je],Q);if(_e===null){fe===null&&(fe=tt);break}e&&fe&&_e.alternate===null&&t(_,fe),P=c(_e,P,je),de===null?ae=_e:de.sibling=_e,de=_e,fe=tt}if(je===R.length)return n(_,fe),Fe&&bn(_,je),ae;if(fe===null){for(;je<R.length;je++)fe=K(_,R[je],Q),fe!==null&&(P=c(fe,P,je),de===null?ae=fe:de.sibling=fe,de=fe);return Fe&&bn(_,je),ae}for(fe=l(_,fe);je<R.length;je++)tt=ee(fe,_,je,R[je],Q),tt!==null&&(e&&tt.alternate!==null&&fe.delete(tt.key===null?je:tt.key),P=c(tt,P,je),de===null?ae=tt:de.sibling=tt,de=tt);return e&&fe.forEach(function(yn){return t(_,yn)}),Fe&&bn(_,je),ae}function re(_,P,R,Q){var ae=le(R);if(typeof ae!="function")throw Error(a(150));if(R=ae.call(R),R==null)throw Error(a(151));for(var de=ae=null,fe=P,je=P=0,tt=null,_e=R.next();fe!==null&&!_e.done;je++,_e=R.next()){fe.index>je?(tt=fe,fe=null):tt=fe.sibling;var yn=U(_,fe,_e.value,Q);if(yn===null){fe===null&&(fe=tt);break}e&&fe&&yn.alternate===null&&t(_,fe),P=c(yn,P,je),de===null?ae=yn:de.sibling=yn,de=yn,fe=tt}if(_e.done)return n(_,fe),Fe&&bn(_,je),ae;if(fe===null){for(;!_e.done;je++,_e=R.next())_e=K(_,_e.value,Q),_e!==null&&(P=c(_e,P,je),de===null?ae=_e:de.sibling=_e,de=_e);return Fe&&bn(_,je),ae}for(fe=l(_,fe);!_e.done;je++,_e=R.next())_e=ee(fe,_,je,_e.value,Q),_e!==null&&(e&&_e.alternate!==null&&fe.delete(_e.key===null?je:_e.key),P=c(_e,P,je),de===null?ae=_e:de.sibling=_e,de=_e);return e&&fe.forEach(function(oh){return t(_,oh)}),Fe&&bn(_,je),ae}function Qe(_,P,R,Q){if(typeof R=="object"&&R!==null&&R.type===H&&R.key===null&&(R=R.props.children),typeof R=="object"&&R!==null){switch(R.$$typeof){case M:e:{for(var ae=R.key,de=P;de!==null;){if(de.key===ae){if(ae=R.type,ae===H){if(de.tag===7){n(_,de.sibling),P=o(de,R.props.children),P.return=_,_=P;break e}}else if(de.elementType===ae||typeof ae=="object"&&ae!==null&&ae.$$typeof===Ee&&Rc(ae)===de.type){n(_,de.sibling),P=o(de,R.props),P.ref=Hs(_,de,R),P.return=_,_=P;break e}n(_,de);break}else t(_,de);de=de.sibling}R.type===H?(P=zn(R.props.children,_.mode,Q,R.key),P.return=_,_=P):(Q=hl(R.type,R.key,R.props,null,_.mode,Q),Q.ref=Hs(_,P,R),Q.return=_,_=Q)}return p(_);case Z:e:{for(de=R.key;P!==null;){if(P.key===de)if(P.tag===4&&P.stateNode.containerInfo===R.containerInfo&&P.stateNode.implementation===R.implementation){n(_,P.sibling),P=o(P,R.children||[]),P.return=_,_=P;break e}else{n(_,P);break}else t(_,P);P=P.sibling}P=wa(R,_.mode,Q),P.return=_,_=P}return p(_);case Ee:return de=R._init,Qe(_,P,de(R._payload),Q)}if(js(R))return se(_,P,R,Q);if(le(R))return re(_,P,R,Q);Vr(_,R)}return typeof R=="string"&&R!==""||typeof R=="number"?(R=""+R,P!==null&&P.tag===6?(n(_,P.sibling),P=o(P,R),P.return=_,_=P):(n(_,P),P=ka(R,_.mode,Q),P.return=_,_=P),p(_)):n(_,P)}return Qe}var rs=Lc(!0),$c=Lc(!1),Hr=on(null),Kr=null,ls=null,Ri=null;function Li(){Ri=ls=Kr=null}function $i(e){var t=Hr.current;Me(Hr),e._currentValue=t}function Ii(e,t,n){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===n)break;e=e.return}}function is(e,t){Kr=e,Ri=ls=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(ht=!0),e.firstContext=null)}function Ct(e){var t=e._currentValue;if(Ri!==e)if(e={context:e,memoizedValue:t,next:null},ls===null){if(Kr===null)throw Error(a(308));ls=e,Kr.dependencies={lanes:0,firstContext:e}}else ls=ls.next=e;return t}var _n=null;function Oi(e){_n===null?_n=[e]:_n.push(e)}function Ic(e,t,n,l){var o=t.interleaved;return o===null?(n.next=n,Oi(t)):(n.next=o.next,o.next=n),t.interleaved=n,qt(e,l)}function qt(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 dn=!1;function zi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Oc(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 Qt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function fn(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(be&2)!==0){var o=l.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),l.pending=t,qt(e,n)}return o=l.interleaved,o===null?(t.next=t,Oi(l)):(t.next=o.next,o.next=t),l.interleaved=t,qt(e,n)}function qr(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Jl(e,n)}}function zc(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var o=null,c=null;if(n=n.firstBaseUpdate,n!==null){do{var p={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};c===null?o=c=p:c=c.next=p,n=n.next}while(n!==null);c===null?o=c=t:c=c.next=t}else o=c=t;n={baseState:l.baseState,firstBaseUpdate:o,lastBaseUpdate:c,shared:l.shared,effects:l.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Qr(e,t,n,l){var o=e.updateQueue;dn=!1;var c=o.firstBaseUpdate,p=o.lastBaseUpdate,w=o.shared.pending;if(w!==null){o.shared.pending=null;var E=w,$=E.next;E.next=null,p===null?c=$:p.next=$,p=E;var V=e.alternate;V!==null&&(V=V.updateQueue,w=V.lastBaseUpdate,w!==p&&(w===null?V.firstBaseUpdate=$:w.next=$,V.lastBaseUpdate=E))}if(c!==null){var K=o.baseState;p=0,V=$=E=null,w=c;do{var U=w.lane,ee=w.eventTime;if((l&U)===U){V!==null&&(V=V.next={eventTime:ee,lane:0,tag:w.tag,payload:w.payload,callback:w.callback,next:null});e:{var se=e,re=w;switch(U=t,ee=n,re.tag){case 1:if(se=re.payload,typeof se=="function"){K=se.call(ee,K,U);break e}K=se;break e;case 3:se.flags=se.flags&-65537|128;case 0:if(se=re.payload,U=typeof se=="function"?se.call(ee,K,U):se,U==null)break e;K=X({},K,U);break e;case 2:dn=!0}}w.callback!==null&&w.lane!==0&&(e.flags|=64,U=o.effects,U===null?o.effects=[w]:U.push(w))}else ee={eventTime:ee,lane:U,tag:w.tag,payload:w.payload,callback:w.callback,next:null},V===null?($=V=ee,E=K):V=V.next=ee,p|=U;if(w=w.next,w===null){if(w=o.shared.pending,w===null)break;U=w,w=U.next,U.next=null,o.lastBaseUpdate=U,o.shared.pending=null}}while(!0);if(V===null&&(E=K),o.baseState=E,o.firstBaseUpdate=$,o.lastBaseUpdate=V,t=o.shared.interleaved,t!==null){o=t;do p|=o.lane,o=o.next;while(o!==t)}else c===null&&(o.shared.lanes=0);Ln|=p,e.lanes=p,e.memoizedState=K}}function Ac(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var l=e[t],o=l.callback;if(o!==null){if(l.callback=null,l=n,typeof o!="function")throw Error(a(191,o));o.call(l)}}}var Ks={},Mt=on(Ks),qs=on(Ks),Qs=on(Ks);function Tn(e){if(e===Ks)throw Error(a(174));return e}function Ai(e,t){switch(ze(Qs,t),ze(qs,e),ze(Mt,Ks),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ml(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ml(t,e)}Me(Mt),ze(Mt,t)}function as(){Me(Mt),Me(qs),Me(Qs)}function Mc(e){Tn(Qs.current);var t=Tn(Mt.current),n=Ml(t,e.type);t!==n&&(ze(qs,e),ze(Mt,n))}function Mi(e){qs.current===e&&(Me(Mt),Me(qs))}var We=on(0);function Gr(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)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Di=[];function Fi(){for(var e=0;e<Di.length;e++)Di[e]._workInProgressVersionPrimary=null;Di.length=0}var Jr=Y.ReactCurrentDispatcher,Bi=Y.ReactCurrentBatchConfig,Rn=0,Ve=null,Ye=null,Xe=null,Yr=!1,Gs=!1,Js=0,Tp=0;function it(){throw Error(a(321))}function Ui(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Tt(e[n],t[n]))return!1;return!0}function Wi(e,t,n,l,o,c){if(Rn=c,Ve=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Jr.current=e===null||e.memoizedState===null?Ip:Op,e=n(l,o),Gs){c=0;do{if(Gs=!1,Js=0,25<=c)throw Error(a(301));c+=1,Xe=Ye=null,t.updateQueue=null,Jr.current=zp,e=n(l,o)}while(Gs)}if(Jr.current=el,t=Ye!==null&&Ye.next!==null,Rn=0,Xe=Ye=Ve=null,Yr=!1,t)throw Error(a(300));return e}function Vi(){var e=Js!==0;return Js=0,e}function Dt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xe===null?Ve.memoizedState=Xe=e:Xe=Xe.next=e,Xe}function Et(){if(Ye===null){var e=Ve.alternate;e=e!==null?e.memoizedState:null}else e=Ye.next;var t=Xe===null?Ve.memoizedState:Xe.next;if(t!==null)Xe=t,Ye=e;else{if(e===null)throw Error(a(310));Ye=e,e={memoizedState:Ye.memoizedState,baseState:Ye.baseState,baseQueue:Ye.baseQueue,queue:Ye.queue,next:null},Xe===null?Ve.memoizedState=Xe=e:Xe=Xe.next=e}return Xe}function Ys(e,t){return typeof t=="function"?t(e):t}function Hi(e){var t=Et(),n=t.queue;if(n===null)throw Error(a(311));n.lastRenderedReducer=e;var l=Ye,o=l.baseQueue,c=n.pending;if(c!==null){if(o!==null){var p=o.next;o.next=c.next,c.next=p}l.baseQueue=o=c,n.pending=null}if(o!==null){c=o.next,l=l.baseState;var w=p=null,E=null,$=c;do{var V=$.lane;if((Rn&V)===V)E!==null&&(E=E.next={lane:0,action:$.action,hasEagerState:$.hasEagerState,eagerState:$.eagerState,next:null}),l=$.hasEagerState?$.eagerState:e(l,$.action);else{var K={lane:V,action:$.action,hasEagerState:$.hasEagerState,eagerState:$.eagerState,next:null};E===null?(w=E=K,p=l):E=E.next=K,Ve.lanes|=V,Ln|=V}$=$.next}while($!==null&&$!==c);E===null?p=l:E.next=w,Tt(l,t.memoizedState)||(ht=!0),t.memoizedState=l,t.baseState=p,t.baseQueue=E,n.lastRenderedState=l}if(e=n.interleaved,e!==null){o=e;do c=o.lane,Ve.lanes|=c,Ln|=c,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ki(e){var t=Et(),n=t.queue;if(n===null)throw Error(a(311));n.lastRenderedReducer=e;var l=n.dispatch,o=n.pending,c=t.memoizedState;if(o!==null){n.pending=null;var p=o=o.next;do c=e(c,p.action),p=p.next;while(p!==o);Tt(c,t.memoizedState)||(ht=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),n.lastRenderedState=c}return[c,l]}function Dc(){}function Fc(e,t){var n=Ve,l=Et(),o=t(),c=!Tt(l.memoizedState,o);if(c&&(l.memoizedState=o,ht=!0),l=l.queue,qi(Wc.bind(null,n,l,e),[e]),l.getSnapshot!==t||c||Xe!==null&&Xe.memoizedState.tag&1){if(n.flags|=2048,Zs(9,Uc.bind(null,n,l,o,t),void 0,null),et===null)throw Error(a(349));(Rn&30)!==0||Bc(n,t,o)}return o}function Bc(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ve.updateQueue,t===null?(t={lastEffect:null,stores:null},Ve.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Uc(e,t,n,l){t.value=n,t.getSnapshot=l,Vc(t)&&Hc(e)}function Wc(e,t,n){return n(function(){Vc(t)&&Hc(e)})}function Vc(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Tt(e,n)}catch{return!0}}function Hc(e){var t=qt(e,1);t!==null&&Ot(t,e,1,-1)}function Kc(e){var t=Dt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ys,lastRenderedState:e},t.queue=e,e=e.dispatch=$p.bind(null,Ve,e),[t.memoizedState,e]}function Zs(e,t,n,l){return e={tag:e,create:t,destroy:n,deps:l,next:null},t=Ve.updateQueue,t===null?(t={lastEffect:null,stores:null},Ve.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(l=n.next,n.next=e,e.next=l,t.lastEffect=e)),e}function qc(){return Et().memoizedState}function Zr(e,t,n,l){var o=Dt();Ve.flags|=e,o.memoizedState=Zs(1|t,n,void 0,l===void 0?null:l)}function Xr(e,t,n,l){var o=Et();l=l===void 0?null:l;var c=void 0;if(Ye!==null){var p=Ye.memoizedState;if(c=p.destroy,l!==null&&Ui(l,p.deps)){o.memoizedState=Zs(t,n,c,l);return}}Ve.flags|=e,o.memoizedState=Zs(1|t,n,c,l)}function Qc(e,t){return Zr(8390656,8,e,t)}function qi(e,t){return Xr(2048,8,e,t)}function Gc(e,t){return Xr(4,2,e,t)}function Jc(e,t){return Xr(4,4,e,t)}function Yc(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 Zc(e,t,n){return n=n!=null?n.concat([e]):null,Xr(4,4,Yc.bind(null,t,e),n)}function Qi(){}function Xc(e,t){var n=Et();t=t===void 0?null:t;var l=n.memoizedState;return l!==null&&t!==null&&Ui(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function eu(e,t){var n=Et();t=t===void 0?null:t;var l=n.memoizedState;return l!==null&&t!==null&&Ui(t,l[1])?l[0]:(e=e(),n.memoizedState=[e,t],e)}function tu(e,t,n){return(Rn&21)===0?(e.baseState&&(e.baseState=!1,ht=!0),e.memoizedState=n):(Tt(n,t)||(n=Ro(),Ve.lanes|=n,Ln|=n,e.baseState=!0),t)}function Rp(e,t){var n=Ie;Ie=n!==0&&4>n?n:4,e(!0);var l=Bi.transition;Bi.transition={};try{e(!1),t()}finally{Ie=n,Bi.transition=l}}function nu(){return Et().memoizedState}function Lp(e,t,n){var l=gn(e);if(n={lane:l,action:n,hasEagerState:!1,eagerState:null,next:null},su(e))ru(t,n);else if(n=Ic(e,t,n,l),n!==null){var o=ut();Ot(n,e,l,o),lu(n,t,l)}}function $p(e,t,n){var l=gn(e),o={lane:l,action:n,hasEagerState:!1,eagerState:null,next:null};if(su(e))ru(t,o);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var p=t.lastRenderedState,w=c(p,n);if(o.hasEagerState=!0,o.eagerState=w,Tt(w,p)){var E=t.interleaved;E===null?(o.next=o,Oi(t)):(o.next=E.next,E.next=o),t.interleaved=o;return}}catch{}finally{}n=Ic(e,t,o,l),n!==null&&(o=ut(),Ot(n,e,l,o),lu(n,t,l))}}function su(e){var t=e.alternate;return e===Ve||t!==null&&t===Ve}function ru(e,t){Gs=Yr=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function lu(e,t,n){if((n&4194240)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Jl(e,n)}}var el={readContext:Ct,useCallback:it,useContext:it,useEffect:it,useImperativeHandle:it,useInsertionEffect:it,useLayoutEffect:it,useMemo:it,useReducer:it,useRef:it,useState:it,useDebugValue:it,useDeferredValue:it,useTransition:it,useMutableSource:it,useSyncExternalStore:it,useId:it,unstable_isNewReconciler:!1},Ip={readContext:Ct,useCallback:function(e,t){return Dt().memoizedState=[e,t===void 0?null:t],e},useContext:Ct,useEffect:Qc,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Zr(4194308,4,Yc.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Zr(4194308,4,e,t)},useInsertionEffect:function(e,t){return Zr(4,2,e,t)},useMemo:function(e,t){var n=Dt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var l=Dt();return t=n!==void 0?n(t):t,l.memoizedState=l.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},l.queue=e,e=e.dispatch=Lp.bind(null,Ve,e),[l.memoizedState,e]},useRef:function(e){var t=Dt();return e={current:e},t.memoizedState=e},useState:Kc,useDebugValue:Qi,useDeferredValue:function(e){return Dt().memoizedState=e},useTransition:function(){var e=Kc(!1),t=e[0];return e=Rp.bind(null,e[1]),Dt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var l=Ve,o=Dt();if(Fe){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),et===null)throw Error(a(349));(Rn&30)!==0||Bc(l,t,n)}o.memoizedState=n;var c={value:n,getSnapshot:t};return o.queue=c,Qc(Wc.bind(null,l,c,e),[e]),l.flags|=2048,Zs(9,Uc.bind(null,l,c,n,t),void 0,null),n},useId:function(){var e=Dt(),t=et.identifierPrefix;if(Fe){var n=Kt,l=Ht;n=(l&~(1<<32-_t(l)-1)).toString(32)+n,t=":"+t+"R"+n,n=Js++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Tp++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Op={readContext:Ct,useCallback:Xc,useContext:Ct,useEffect:qi,useImperativeHandle:Zc,useInsertionEffect:Gc,useLayoutEffect:Jc,useMemo:eu,useReducer:Hi,useRef:qc,useState:function(){return Hi(Ys)},useDebugValue:Qi,useDeferredValue:function(e){var t=Et();return tu(t,Ye.memoizedState,e)},useTransition:function(){var e=Hi(Ys)[0],t=Et().memoizedState;return[e,t]},useMutableSource:Dc,useSyncExternalStore:Fc,useId:nu,unstable_isNewReconciler:!1},zp={readContext:Ct,useCallback:Xc,useContext:Ct,useEffect:qi,useImperativeHandle:Zc,useInsertionEffect:Gc,useLayoutEffect:Jc,useMemo:eu,useReducer:Ki,useRef:qc,useState:function(){return Ki(Ys)},useDebugValue:Qi,useDeferredValue:function(e){var t=Et();return Ye===null?t.memoizedState=e:tu(t,Ye.memoizedState,e)},useTransition:function(){var e=Ki(Ys)[0],t=Et().memoizedState;return[e,t]},useMutableSource:Dc,useSyncExternalStore:Fc,useId:nu,unstable_isNewReconciler:!1};function Lt(e,t){if(e&&e.defaultProps){t=X({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Gi(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:X({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var tl={isMounted:function(e){return(e=e._reactInternals)?Sn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var l=ut(),o=gn(e),c=Qt(l,o);c.payload=t,n!=null&&(c.callback=n),t=fn(e,c,o),t!==null&&(Ot(t,e,o,l),qr(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=ut(),o=gn(e),c=Qt(l,o);c.tag=1,c.payload=t,n!=null&&(c.callback=n),t=fn(e,c,o),t!==null&&(Ot(t,e,o,l),qr(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ut(),l=gn(e),o=Qt(n,l);o.tag=2,t!=null&&(o.callback=t),t=fn(e,o,l),t!==null&&(Ot(t,e,l,n),qr(t,e,l))}};function iu(e,t,n,l,o,c,p){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,c,p):t.prototype&&t.prototype.isPureReactComponent?!Ms(n,l)||!Ms(o,c):!0}function au(e,t,n){var l=!1,o=cn,c=t.contextType;return typeof c=="object"&&c!==null?c=Ct(c):(o=pt(t)?En:lt.current,l=t.contextTypes,c=(l=l!=null)?es(e,o):cn),t=new t(n,c),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=tl,e.stateNode=t,t._reactInternals=e,l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=c),t}function ou(e,t,n,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,l),t.state!==e&&tl.enqueueReplaceState(t,t.state,null)}function Ji(e,t,n,l){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},zi(e);var c=t.contextType;typeof c=="object"&&c!==null?o.context=Ct(c):(c=pt(t)?En:lt.current,o.context=es(e,c)),o.state=e.memoizedState,c=t.getDerivedStateFromProps,typeof c=="function"&&(Gi(e,t,c,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&&tl.enqueueReplaceState(o,o.state,null),Qr(e,n,o,l),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function os(e,t){try{var n="",l=t;do n+=we(l),l=l.return;while(l);var o=n}catch(c){o=`
|
|
36
|
+
`),p=o.length-1,N=c.length-1;1<=p&&0<=N&&o[p]!==c[N];)N--;for(;1<=p&&0<=N;p--,N--)if(o[p]!==c[N]){if(p!==1||N!==1)do if(p--,N--,0>N||o[p]!==c[N]){var C=`
|
|
37
|
+
`+o[p].replace(" at new "," at ");return e.displayName&&C.includes("<anonymous>")&&(C=C.replace("<anonymous>",e.displayName)),C}while(1<=p&&0<=N);break}}}finally{ye=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?D(e):""}function we(e){switch(e.tag){case 5:return D(e.type);case 16:return D("Lazy");case 13:return D("Suspense");case 19:return D("SuspenseList");case 0:case 2:case 15:return e=ke(e.type,!1),e;case 11:return e=ke(e.type.render,!1),e;case 1:return e=ke(e.type,!0),e;default:return""}}function Se(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 H:return"Fragment";case Z:return"Portal";case F:return"Profiler";case L:return"StrictMode";case oe:return"Suspense";case ue:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case J:return(e.displayName||"Context")+".Consumer";case O:return(e._context.displayName||"Context")+".Provider";case te:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ge:return t=e.displayName||null,t!==null?t:Se(e.type)||"Memo";case Ee:t=e._payload,e=e._init;try{return Se(e(t))}catch{}}return null}function Pe(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 Se(t);case 8:return t===L?"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 Ne(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function B(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ie(e){var t=B(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),l=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,c=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(p){l=""+p,c.call(this,p)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return l},setValue:function(p){l=""+p},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function pe(e){e._valueTracker||(e._valueTracker=ie(e))}function Ue(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=B(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}function nt(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 he(e,t){var n=t.checked;return X({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function ce(e,t){var n=t.defaultValue==null?"":t.defaultValue,l=t.checked!=null?t.checked:t.defaultChecked;n=Ne(t.value!=null?t.value:n),e._wrapperState={initialChecked:l,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function me(e,t){t=t.checked,t!=null&&A(e,"checked",t,!1)}function ve(e,t){me(e,t);var n=Ne(t.value),l=t.type;if(n!=null)l==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(l==="submit"||l==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Te(e,t.type,n):t.hasOwnProperty("defaultValue")&&Te(e,t.type,Ne(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function De(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var l=t.type;if(!(l!=="submit"&&l!=="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 Te(e,t,n){(t!=="number"||nt(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var js=Array.isArray;function Wn(e,t,n,l){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&&l&&(e[n].defaultSelected=!0)}else{for(n=""+Ne(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,l&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Al(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(a(91));return X({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function co(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(a(92));if(js(n)){if(1<n.length)throw Error(a(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Ne(n)}}function uo(e,t){var n=Ne(t.value),l=Ne(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),l!=null&&(e.defaultValue=""+l)}function fo(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function po(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 Ml(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?po(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var hr,ho=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,l,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,l,o)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(hr=hr||document.createElement("div"),hr.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=hr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ks(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ws={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},pf=["Webkit","ms","Moz","O"];Object.keys(ws).forEach(function(e){pf.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ws[t]=ws[e]})});function mo(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ws.hasOwnProperty(e)&&ws[e]?(""+t).trim():t+"px"}function go(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var l=n.indexOf("--")===0,o=mo(n,t[n],l);n==="float"&&(n="cssFloat"),l?e.setProperty(n,o):e[n]=o}}var hf=X({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 Dl(e,t){if(t){if(hf[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(a(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(a(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(a(61))}if(t.style!=null&&typeof t.style!="object")throw Error(a(62))}}function Fl(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 Bl=null;function Ul(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Wl=null,Vn=null,Hn=null;function vo(e){if(e=Vs(e)){if(typeof Wl!="function")throw Error(a(280));var t=e.stateNode;t&&(t=Ar(t),Wl(e.stateNode,e.type,t))}}function xo(e){Vn?Hn?Hn.push(e):Hn=[e]:Vn=e}function yo(){if(Vn){var e=Vn,t=Hn;if(Hn=Vn=null,vo(e),t)for(e=0;e<t.length;e++)vo(t[e])}}function jo(e,t){return e(t)}function ko(){}var Vl=!1;function wo(e,t,n){if(Vl)return e(t,n);Vl=!0;try{return jo(e,t,n)}finally{Vl=!1,(Vn!==null||Hn!==null)&&(ko(),yo())}}function Ns(e,t){var n=e.stateNode;if(n===null)return null;var l=Ar(n);if(l===null)return null;n=l[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":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(a(231,t,typeof n));return n}var Hl=!1;if(m)try{var Ss={};Object.defineProperty(Ss,"passive",{get:function(){Hl=!0}}),window.addEventListener("test",Ss,Ss),window.removeEventListener("test",Ss,Ss)}catch{Hl=!1}function mf(e,t,n,l,o,c,p,N,C){var I=Array.prototype.slice.call(arguments,3);try{t.apply(n,I)}catch(V){this.onError(V)}}var Cs=!1,mr=null,gr=!1,Kl=null,gf={onError:function(e){Cs=!0,mr=e}};function vf(e,t,n,l,o,c,p,N,C){Cs=!1,mr=null,mf.apply(gf,arguments)}function xf(e,t,n,l,o,c,p,N,C){if(vf.apply(this,arguments),Cs){if(Cs){var I=mr;Cs=!1,mr=null}else throw Error(a(198));gr||(gr=!0,Kl=I)}}function Cn(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function No(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 So(e){if(Cn(e)!==e)throw Error(a(188))}function yf(e){var t=e.alternate;if(!t){if(t=Cn(e),t===null)throw Error(a(188));return t!==e?null:e}for(var n=e,l=t;;){var o=n.return;if(o===null)break;var c=o.alternate;if(c===null){if(l=o.return,l!==null){n=l;continue}break}if(o.child===c.child){for(c=o.child;c;){if(c===n)return So(o),e;if(c===l)return So(o),t;c=c.sibling}throw Error(a(188))}if(n.return!==l.return)n=o,l=c;else{for(var p=!1,N=o.child;N;){if(N===n){p=!0,n=o,l=c;break}if(N===l){p=!0,l=o,n=c;break}N=N.sibling}if(!p){for(N=c.child;N;){if(N===n){p=!0,n=c,l=o;break}if(N===l){p=!0,l=c,n=o;break}N=N.sibling}if(!p)throw Error(a(189))}}if(n.alternate!==l)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function Co(e){return e=yf(e),e!==null?Eo(e):null}function Eo(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Eo(e);if(t!==null)return t;e=e.sibling}return null}var Po=i.unstable_scheduleCallback,bo=i.unstable_cancelCallback,jf=i.unstable_shouldYield,kf=i.unstable_requestPaint,qe=i.unstable_now,wf=i.unstable_getCurrentPriorityLevel,ql=i.unstable_ImmediatePriority,_o=i.unstable_UserBlockingPriority,vr=i.unstable_NormalPriority,Nf=i.unstable_LowPriority,To=i.unstable_IdlePriority,xr=null,zt=null;function Sf(e){if(zt&&typeof zt.onCommitFiberRoot=="function")try{zt.onCommitFiberRoot(xr,e,void 0,(e.current.flags&128)===128)}catch{}}var _t=Math.clz32?Math.clz32:Pf,Cf=Math.log,Ef=Math.LN2;function Pf(e){return e>>>=0,e===0?32:31-(Cf(e)/Ef|0)|0}var yr=64,jr=4194304;function Es(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 kr(e,t){var n=e.pendingLanes;if(n===0)return 0;var l=0,o=e.suspendedLanes,c=e.pingedLanes,p=n&268435455;if(p!==0){var N=p&~o;N!==0?l=Es(N):(c&=p,c!==0&&(l=Es(c)))}else p=n&~o,p!==0?l=Es(p):c!==0&&(l=Es(c));if(l===0)return 0;if(t!==0&&t!==l&&(t&o)===0&&(o=l&-l,c=t&-t,o>=c||o===16&&(c&4194240)!==0))return t;if((l&4)!==0&&(l|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=l;0<t;)n=31-_t(t),o=1<<n,l|=e[n],t&=~o;return l}function bf(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 _f(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,o=e.expirationTimes,c=e.pendingLanes;0<c;){var p=31-_t(c),N=1<<p,C=o[p];C===-1?((N&n)===0||(N&l)!==0)&&(o[p]=bf(N,t)):C<=t&&(e.expiredLanes|=N),c&=~N}}function Ql(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Ro(){var e=yr;return yr<<=1,(yr&4194240)===0&&(yr=64),e}function Gl(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ps(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-_t(t),e[t]=n}function Tf(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 l=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-_t(n),c=1<<o;t[o]=0,l[o]=-1,e[o]=-1,n&=~c}}function Jl(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-_t(n),o=1<<l;o&t|e[l]&t&&(e[l]|=t),n&=~o}}var Ie=0;function Lo(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var $o,Yl,Io,Oo,zo,Zl=!1,wr=[],en=null,tn=null,nn=null,bs=new Map,_s=new Map,sn=[],Rf="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 Ao(e,t){switch(e){case"focusin":case"focusout":en=null;break;case"dragenter":case"dragleave":tn=null;break;case"mouseover":case"mouseout":nn=null;break;case"pointerover":case"pointerout":bs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":_s.delete(t.pointerId)}}function Ts(e,t,n,l,o,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:c,targetContainers:[o]},t!==null&&(t=Vs(t),t!==null&&Yl(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function Lf(e,t,n,l,o){switch(t){case"focusin":return en=Ts(en,e,t,n,l,o),!0;case"dragenter":return tn=Ts(tn,e,t,n,l,o),!0;case"mouseover":return nn=Ts(nn,e,t,n,l,o),!0;case"pointerover":var c=o.pointerId;return bs.set(c,Ts(bs.get(c)||null,e,t,n,l,o)),!0;case"gotpointercapture":return c=o.pointerId,_s.set(c,Ts(_s.get(c)||null,e,t,n,l,o)),!0}return!1}function Mo(e){var t=En(e.target);if(t!==null){var n=Cn(t);if(n!==null){if(t=n.tag,t===13){if(t=No(n),t!==null){e.blockedOn=t,zo(e.priority,function(){Io(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 Nr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=ei(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);Bl=l,n.target.dispatchEvent(l),Bl=null}else return t=Vs(n),t!==null&&Yl(t),e.blockedOn=n,!1;t.shift()}return!0}function Do(e,t,n){Nr(e)&&n.delete(t)}function $f(){Zl=!1,en!==null&&Nr(en)&&(en=null),tn!==null&&Nr(tn)&&(tn=null),nn!==null&&Nr(nn)&&(nn=null),bs.forEach(Do),_s.forEach(Do)}function Rs(e,t){e.blockedOn===t&&(e.blockedOn=null,Zl||(Zl=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,$f)))}function Ls(e){function t(o){return Rs(o,e)}if(0<wr.length){Rs(wr[0],e);for(var n=1;n<wr.length;n++){var l=wr[n];l.blockedOn===e&&(l.blockedOn=null)}}for(en!==null&&Rs(en,e),tn!==null&&Rs(tn,e),nn!==null&&Rs(nn,e),bs.forEach(t),_s.forEach(t),n=0;n<sn.length;n++)l=sn[n],l.blockedOn===e&&(l.blockedOn=null);for(;0<sn.length&&(n=sn[0],n.blockedOn===null);)Mo(n),n.blockedOn===null&&sn.shift()}var Kn=Y.ReactCurrentBatchConfig,Sr=!0;function If(e,t,n,l){var o=Ie,c=Kn.transition;Kn.transition=null;try{Ie=1,Xl(e,t,n,l)}finally{Ie=o,Kn.transition=c}}function Of(e,t,n,l){var o=Ie,c=Kn.transition;Kn.transition=null;try{Ie=4,Xl(e,t,n,l)}finally{Ie=o,Kn.transition=c}}function Xl(e,t,n,l){if(Sr){var o=ei(e,t,n,l);if(o===null)vi(e,t,l,Cr,n),Ao(e,l);else if(Lf(o,e,t,n,l))l.stopPropagation();else if(Ao(e,l),t&4&&-1<Rf.indexOf(e)){for(;o!==null;){var c=Vs(o);if(c!==null&&$o(c),c=ei(e,t,n,l),c===null&&vi(e,t,l,Cr,n),c===o)break;o=c}o!==null&&l.stopPropagation()}else vi(e,t,l,null,n)}}var Cr=null;function ei(e,t,n,l){if(Cr=null,e=Ul(l),e=En(e),e!==null)if(t=Cn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=No(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 Cr=e,null}function Fo(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(wf()){case ql:return 1;case _o:return 4;case vr:case Nf:return 16;case To:return 536870912;default:return 16}default:return 16}}var rn=null,ti=null,Er=null;function Bo(){if(Er)return Er;var e,t=ti,n=t.length,l,o="value"in rn?rn.value:rn.textContent,c=o.length;for(e=0;e<n&&t[e]===o[e];e++);var p=n-e;for(l=1;l<=p&&t[n-l]===o[c-l];l++);return Er=o.slice(e,1<l?1-l:void 0)}function Pr(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 br(){return!0}function Uo(){return!1}function yt(e){function t(n,l,o,c,p){this._reactName=n,this._targetInst=o,this.type=l,this.nativeEvent=c,this.target=p,this.currentTarget=null;for(var N in e)e.hasOwnProperty(N)&&(n=e[N],this[N]=n?n(c):c[N]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?br:Uo,this.isPropagationStopped=Uo,this}return X(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=br)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=br)},persist:function(){},isPersistent:br}),t}var qn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ni=yt(qn),$s=X({},qn,{view:0,detail:0}),zf=yt($s),si,ri,Is,_r=X({},$s,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ii,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!==Is&&(Is&&e.type==="mousemove"?(si=e.screenX-Is.screenX,ri=e.screenY-Is.screenY):ri=si=0,Is=e),si)},movementY:function(e){return"movementY"in e?e.movementY:ri}}),Wo=yt(_r),Af=X({},_r,{dataTransfer:0}),Mf=yt(Af),Df=X({},$s,{relatedTarget:0}),li=yt(Df),Ff=X({},qn,{animationName:0,elapsedTime:0,pseudoElement:0}),Bf=yt(Ff),Uf=X({},qn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Wf=yt(Uf),Vf=X({},qn,{data:0}),Vo=yt(Vf),Hf={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Kf={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"},qf={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Qf(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=qf[e])?!!t[e]:!1}function ii(){return Qf}var Gf=X({},$s,{key:function(e){if(e.key){var t=Hf[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Pr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Kf[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ii,charCode:function(e){return e.type==="keypress"?Pr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Pr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Jf=yt(Gf),Yf=X({},_r,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ho=yt(Yf),Zf=X({},$s,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ii}),Xf=yt(Zf),ep=X({},qn,{propertyName:0,elapsedTime:0,pseudoElement:0}),tp=yt(ep),np=X({},_r,{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}),sp=yt(np),rp=[9,13,27,32],ai=m&&"CompositionEvent"in window,Os=null;m&&"documentMode"in document&&(Os=document.documentMode);var lp=m&&"TextEvent"in window&&!Os,Ko=m&&(!ai||Os&&8<Os&&11>=Os),qo=" ",Qo=!1;function Go(e,t){switch(e){case"keyup":return rp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Jo(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Qn=!1;function ip(e,t){switch(e){case"compositionend":return Jo(t);case"keypress":return t.which!==32?null:(Qo=!0,qo);case"textInput":return e=t.data,e===qo&&Qo?null:e;default:return null}}function ap(e,t){if(Qn)return e==="compositionend"||!ai&&Go(e,t)?(e=Bo(),Er=ti=rn=null,Qn=!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 Ko&&t.locale!=="ko"?null:t.data;default:return null}}var op={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 Yo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!op[e.type]:t==="textarea"}function Zo(e,t,n,l){xo(l),t=Ir(t,"onChange"),0<t.length&&(n=new ni("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var zs=null,As=null;function cp(e){gc(e,0)}function Tr(e){var t=Xn(e);if(Ue(t))return e}function up(e,t){if(e==="change")return t}var Xo=!1;if(m){var oi;if(m){var ci="oninput"in document;if(!ci){var ec=document.createElement("div");ec.setAttribute("oninput","return;"),ci=typeof ec.oninput=="function"}oi=ci}else oi=!1;Xo=oi&&(!document.documentMode||9<document.documentMode)}function tc(){zs&&(zs.detachEvent("onpropertychange",nc),As=zs=null)}function nc(e){if(e.propertyName==="value"&&Tr(As)){var t=[];Zo(t,As,e,Ul(e)),wo(cp,t)}}function dp(e,t,n){e==="focusin"?(tc(),zs=t,As=n,zs.attachEvent("onpropertychange",nc)):e==="focusout"&&tc()}function fp(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Tr(As)}function pp(e,t){if(e==="click")return Tr(t)}function hp(e,t){if(e==="input"||e==="change")return Tr(t)}function mp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Tt=typeof Object.is=="function"?Object.is:mp;function Ms(e,t){if(Tt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),l=Object.keys(t);if(n.length!==l.length)return!1;for(l=0;l<n.length;l++){var o=n[l];if(!h.call(t,o)||!Tt(e[o],t[o]))return!1}return!0}function sc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function rc(e,t){var n=sc(e);e=0;for(var l;n;){if(n.nodeType===3){if(l=e+n.textContent.length,e<=t&&l>=t)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=sc(n)}}function lc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?lc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ic(){for(var e=window,t=nt();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=nt(e.document)}return t}function ui(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 gp(e){var t=ic(),n=e.focusedElem,l=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&lc(n.ownerDocument.documentElement,n)){if(l!==null&&ui(n)){if(t=l.start,e=l.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,c=Math.min(l.start,o);l=l.end===void 0?c:Math.min(l.end,o),!e.extend&&c>l&&(o=l,l=c,c=o),o=rc(n,c);var p=rc(n,l);o&&p&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==p.node||e.focusOffset!==p.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),c>l?(e.addRange(t),e.extend(p.node,p.offset)):(t.setEnd(p.node,p.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 vp=m&&"documentMode"in document&&11>=document.documentMode,Gn=null,di=null,Ds=null,fi=!1;function ac(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;fi||Gn==null||Gn!==nt(l)||(l=Gn,"selectionStart"in l&&ui(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Ds&&Ms(Ds,l)||(Ds=l,l=Ir(di,"onSelect"),0<l.length&&(t=new ni("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=Gn)))}function Rr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Jn={animationend:Rr("Animation","AnimationEnd"),animationiteration:Rr("Animation","AnimationIteration"),animationstart:Rr("Animation","AnimationStart"),transitionend:Rr("Transition","TransitionEnd")},pi={},oc={};m&&(oc=document.createElement("div").style,"AnimationEvent"in window||(delete Jn.animationend.animation,delete Jn.animationiteration.animation,delete Jn.animationstart.animation),"TransitionEvent"in window||delete Jn.transitionend.transition);function Lr(e){if(pi[e])return pi[e];if(!Jn[e])return e;var t=Jn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in oc)return pi[e]=t[n];return e}var cc=Lr("animationend"),uc=Lr("animationiteration"),dc=Lr("animationstart"),fc=Lr("transitionend"),pc=new Map,hc="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 ln(e,t){pc.set(e,t),f(t,[e])}for(var hi=0;hi<hc.length;hi++){var mi=hc[hi],xp=mi.toLowerCase(),yp=mi[0].toUpperCase()+mi.slice(1);ln(xp,"on"+yp)}ln(cc,"onAnimationEnd"),ln(uc,"onAnimationIteration"),ln(dc,"onAnimationStart"),ln("dblclick","onDoubleClick"),ln("focusin","onFocus"),ln("focusout","onBlur"),ln(fc,"onTransitionEnd"),g("onMouseEnter",["mouseout","mouseover"]),g("onMouseLeave",["mouseout","mouseover"]),g("onPointerEnter",["pointerout","pointerover"]),g("onPointerLeave",["pointerout","pointerover"]),f("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),f("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),f("onBeforeInput",["compositionend","keypress","textInput","paste"]),f("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),f("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),f("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Fs="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(" "),jp=new Set("cancel close invalid load scroll toggle".split(" ").concat(Fs));function mc(e,t,n){var l=e.type||"unknown-event";e.currentTarget=n,xf(l,t,void 0,e),e.currentTarget=null}function gc(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],o=l.event;l=l.listeners;e:{var c=void 0;if(t)for(var p=l.length-1;0<=p;p--){var N=l[p],C=N.instance,I=N.currentTarget;if(N=N.listener,C!==c&&o.isPropagationStopped())break e;mc(o,N,I),c=C}else for(p=0;p<l.length;p++){if(N=l[p],C=N.instance,I=N.currentTarget,N=N.listener,C!==c&&o.isPropagationStopped())break e;mc(o,N,I),c=C}}}if(gr)throw e=Kl,gr=!1,Kl=null,e}function Ae(e,t){var n=t[Ni];n===void 0&&(n=t[Ni]=new Set);var l=e+"__bubble";n.has(l)||(vc(t,e,2,!1),n.add(l))}function gi(e,t,n){var l=0;t&&(l|=4),vc(n,e,l,t)}var $r="_reactListening"+Math.random().toString(36).slice(2);function Bs(e){if(!e[$r]){e[$r]=!0,u.forEach(function(n){n!=="selectionchange"&&(jp.has(n)||gi(n,!1,e),gi(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[$r]||(t[$r]=!0,gi("selectionchange",!1,t))}}function vc(e,t,n,l){switch(Fo(t)){case 1:var o=If;break;case 4:o=Of;break;default:o=Xl}n=o.bind(null,t,n,e),o=void 0,!Hl||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),l?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 vi(e,t,n,l,o){var c=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var p=l.tag;if(p===3||p===4){var N=l.stateNode.containerInfo;if(N===o||N.nodeType===8&&N.parentNode===o)break;if(p===4)for(p=l.return;p!==null;){var C=p.tag;if((C===3||C===4)&&(C=p.stateNode.containerInfo,C===o||C.nodeType===8&&C.parentNode===o))return;p=p.return}for(;N!==null;){if(p=En(N),p===null)return;if(C=p.tag,C===5||C===6){l=c=p;continue e}N=N.parentNode}}l=l.return}wo(function(){var I=c,V=Ul(n),K=[];e:{var U=pc.get(e);if(U!==void 0){var ee=ni,se=e;switch(e){case"keypress":if(Pr(n)===0)break e;case"keydown":case"keyup":ee=Jf;break;case"focusin":se="focus",ee=li;break;case"focusout":se="blur",ee=li;break;case"beforeblur":case"afterblur":ee=li;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":ee=Wo;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ee=Mf;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ee=Xf;break;case cc:case uc:case dc:ee=Bf;break;case fc:ee=tp;break;case"scroll":ee=zf;break;case"wheel":ee=sp;break;case"copy":case"cut":case"paste":ee=Wf;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ee=Ho}var re=(t&4)!==0,Qe=!re&&e==="scroll",T=re?U!==null?U+"Capture":null:U;re=[];for(var E=I,R;E!==null;){R=E;var Q=R.stateNode;if(R.tag===5&&Q!==null&&(R=Q,T!==null&&(Q=Ns(E,T),Q!=null&&re.push(Us(E,Q,R)))),Qe)break;E=E.return}0<re.length&&(U=new ee(U,se,null,n,V),K.push({event:U,listeners:re}))}}if((t&7)===0){e:{if(U=e==="mouseover"||e==="pointerover",ee=e==="mouseout"||e==="pointerout",U&&n!==Bl&&(se=n.relatedTarget||n.fromElement)&&(En(se)||se[Wt]))break e;if((ee||U)&&(U=V.window===V?V:(U=V.ownerDocument)?U.defaultView||U.parentWindow:window,ee?(se=n.relatedTarget||n.toElement,ee=I,se=se?En(se):null,se!==null&&(Qe=Cn(se),se!==Qe||se.tag!==5&&se.tag!==6)&&(se=null)):(ee=null,se=I),ee!==se)){if(re=Wo,Q="onMouseLeave",T="onMouseEnter",E="mouse",(e==="pointerout"||e==="pointerover")&&(re=Ho,Q="onPointerLeave",T="onPointerEnter",E="pointer"),Qe=ee==null?U:Xn(ee),R=se==null?U:Xn(se),U=new re(Q,E+"leave",ee,n,V),U.target=Qe,U.relatedTarget=R,Q=null,En(V)===I&&(re=new re(T,E+"enter",se,n,V),re.target=R,re.relatedTarget=Qe,Q=re),Qe=Q,ee&&se)t:{for(re=ee,T=se,E=0,R=re;R;R=Yn(R))E++;for(R=0,Q=T;Q;Q=Yn(Q))R++;for(;0<E-R;)re=Yn(re),E--;for(;0<R-E;)T=Yn(T),R--;for(;E--;){if(re===T||T!==null&&re===T.alternate)break t;re=Yn(re),T=Yn(T)}re=null}else re=null;ee!==null&&xc(K,U,ee,re,!1),se!==null&&Qe!==null&&xc(K,Qe,se,re,!0)}}e:{if(U=I?Xn(I):window,ee=U.nodeName&&U.nodeName.toLowerCase(),ee==="select"||ee==="input"&&U.type==="file")var ae=up;else if(Yo(U))if(Xo)ae=hp;else{ae=fp;var de=dp}else(ee=U.nodeName)&&ee.toLowerCase()==="input"&&(U.type==="checkbox"||U.type==="radio")&&(ae=pp);if(ae&&(ae=ae(e,I))){Zo(K,ae,n,V);break e}de&&de(e,U,I),e==="focusout"&&(de=U._wrapperState)&&de.controlled&&U.type==="number"&&Te(U,"number",U.value)}switch(de=I?Xn(I):window,e){case"focusin":(Yo(de)||de.contentEditable==="true")&&(Gn=de,di=I,Ds=null);break;case"focusout":Ds=di=Gn=null;break;case"mousedown":fi=!0;break;case"contextmenu":case"mouseup":case"dragend":fi=!1,ac(K,n,V);break;case"selectionchange":if(vp)break;case"keydown":case"keyup":ac(K,n,V)}var fe;if(ai)e:{switch(e){case"compositionstart":var je="onCompositionStart";break e;case"compositionend":je="onCompositionEnd";break e;case"compositionupdate":je="onCompositionUpdate";break e}je=void 0}else Qn?Go(e,n)&&(je="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(je="onCompositionStart");je&&(Ko&&n.locale!=="ko"&&(Qn||je!=="onCompositionStart"?je==="onCompositionEnd"&&Qn&&(fe=Bo()):(rn=V,ti="value"in rn?rn.value:rn.textContent,Qn=!0)),de=Ir(I,je),0<de.length&&(je=new Vo(je,e,null,n,V),K.push({event:je,listeners:de}),fe?je.data=fe:(fe=Jo(n),fe!==null&&(je.data=fe)))),(fe=lp?ip(e,n):ap(e,n))&&(I=Ir(I,"onBeforeInput"),0<I.length&&(V=new Vo("onBeforeInput","beforeinput",null,n,V),K.push({event:V,listeners:I}),V.data=fe))}gc(K,t)})}function Us(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ir(e,t){for(var n=t+"Capture",l=[];e!==null;){var o=e,c=o.stateNode;o.tag===5&&c!==null&&(o=c,c=Ns(e,n),c!=null&&l.unshift(Us(e,c,o)),c=Ns(e,t),c!=null&&l.push(Us(e,c,o))),e=e.return}return l}function Yn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function xc(e,t,n,l,o){for(var c=t._reactName,p=[];n!==null&&n!==l;){var N=n,C=N.alternate,I=N.stateNode;if(C!==null&&C===l)break;N.tag===5&&I!==null&&(N=I,o?(C=Ns(n,c),C!=null&&p.unshift(Us(n,C,N))):o||(C=Ns(n,c),C!=null&&p.push(Us(n,C,N)))),n=n.return}p.length!==0&&e.push({event:t,listeners:p})}var kp=/\r\n?/g,wp=/\u0000|\uFFFD/g;function yc(e){return(typeof e=="string"?e:""+e).replace(kp,`
|
|
38
|
+
`).replace(wp,"")}function Or(e,t,n){if(t=yc(t),yc(e)!==t&&n)throw Error(a(425))}function zr(){}var xi=null,yi=null;function ji(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 ki=typeof setTimeout=="function"?setTimeout:void 0,Np=typeof clearTimeout=="function"?clearTimeout:void 0,jc=typeof Promise=="function"?Promise:void 0,Sp=typeof queueMicrotask=="function"?queueMicrotask:typeof jc<"u"?function(e){return jc.resolve(null).then(e).catch(Cp)}:ki;function Cp(e){setTimeout(function(){throw e})}function wi(e,t){var n=t,l=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(l===0){e.removeChild(o),Ls(t);return}l--}else n!=="$"&&n!=="$?"&&n!=="$!"||l++;n=o}while(n);Ls(t)}function an(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 kc(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 Zn=Math.random().toString(36).slice(2),At="__reactFiber$"+Zn,Ws="__reactProps$"+Zn,Wt="__reactContainer$"+Zn,Ni="__reactEvents$"+Zn,Ep="__reactListeners$"+Zn,Pp="__reactHandles$"+Zn;function En(e){var t=e[At];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Wt]||n[At]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=kc(e);e!==null;){if(n=e[At])return n;e=kc(e)}return t}e=n,n=e.parentNode}return null}function Vs(e){return e=e[At]||e[Wt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Xn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(a(33))}function Ar(e){return e[Ws]||null}var Si=[],es=-1;function on(e){return{current:e}}function Me(e){0>es||(e.current=Si[es],Si[es]=null,es--)}function ze(e,t){es++,Si[es]=e.current,e.current=t}var cn={},lt=on(cn),ft=on(!1),Pn=cn;function ts(e,t){var n=e.type.contextTypes;if(!n)return cn;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===t)return l.__reactInternalMemoizedMaskedChildContext;var o={},c;for(c in n)o[c]=t[c];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function pt(e){return e=e.childContextTypes,e!=null}function Mr(){Me(ft),Me(lt)}function wc(e,t,n){if(lt.current!==cn)throw Error(a(168));ze(lt,t),ze(ft,n)}function Nc(e,t,n){var l=e.stateNode;if(t=t.childContextTypes,typeof l.getChildContext!="function")return n;l=l.getChildContext();for(var o in l)if(!(o in t))throw Error(a(108,Pe(e)||"Unknown",o));return X({},n,l)}function Dr(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||cn,Pn=lt.current,ze(lt,e),ze(ft,ft.current),!0}function Sc(e,t,n){var l=e.stateNode;if(!l)throw Error(a(169));n?(e=Nc(e,t,Pn),l.__reactInternalMemoizedMergedChildContext=e,Me(ft),Me(lt),ze(lt,e)):Me(ft),ze(ft,n)}var Vt=null,Fr=!1,Ci=!1;function Cc(e){Vt===null?Vt=[e]:Vt.push(e)}function bp(e){Fr=!0,Cc(e)}function un(){if(!Ci&&Vt!==null){Ci=!0;var e=0,t=Ie;try{var n=Vt;for(Ie=1;e<n.length;e++){var l=n[e];do l=l(!0);while(l!==null)}Vt=null,Fr=!1}catch(o){throw Vt!==null&&(Vt=Vt.slice(e+1)),Po(ql,un),o}finally{Ie=t,Ci=!1}}return null}var ns=[],ss=0,Br=null,Ur=0,Nt=[],St=0,bn=null,Ht=1,Kt="";function _n(e,t){ns[ss++]=Ur,ns[ss++]=Br,Br=e,Ur=t}function Ec(e,t,n){Nt[St++]=Ht,Nt[St++]=Kt,Nt[St++]=bn,bn=e;var l=Ht;e=Kt;var o=32-_t(l)-1;l&=~(1<<o),n+=1;var c=32-_t(t)+o;if(30<c){var p=o-o%5;c=(l&(1<<p)-1).toString(32),l>>=p,o-=p,Ht=1<<32-_t(t)+o|n<<o|l,Kt=c+e}else Ht=1<<c|n<<o|l,Kt=e}function Ei(e){e.return!==null&&(_n(e,1),Ec(e,1,0))}function Pi(e){for(;e===Br;)Br=ns[--ss],ns[ss]=null,Ur=ns[--ss],ns[ss]=null;for(;e===bn;)bn=Nt[--St],Nt[St]=null,Kt=Nt[--St],Nt[St]=null,Ht=Nt[--St],Nt[St]=null}var jt=null,kt=null,Fe=!1,Rt=null;function Pc(e,t){var n=bt(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 bc(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,jt=e,kt=an(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,jt=e,kt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=bn!==null?{id:Ht,overflow:Kt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=bt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,jt=e,kt=null,!0):!1;default:return!1}}function bi(e){return(e.mode&1)!==0&&(e.flags&128)===0}function _i(e){if(Fe){var t=kt;if(t){var n=t;if(!bc(e,t)){if(bi(e))throw Error(a(418));t=an(n.nextSibling);var l=jt;t&&bc(e,t)?Pc(l,n):(e.flags=e.flags&-4097|2,Fe=!1,jt=e)}}else{if(bi(e))throw Error(a(418));e.flags=e.flags&-4097|2,Fe=!1,jt=e}}}function _c(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;jt=e}function Wr(e){if(e!==jt)return!1;if(!Fe)return _c(e),Fe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!ji(e.type,e.memoizedProps)),t&&(t=kt)){if(bi(e))throw Tc(),Error(a(418));for(;t;)Pc(e,t),t=an(t.nextSibling)}if(_c(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){kt=an(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}kt=null}}else kt=jt?an(e.stateNode.nextSibling):null;return!0}function Tc(){for(var e=kt;e;)e=an(e.nextSibling)}function rs(){kt=jt=null,Fe=!1}function Ti(e){Rt===null?Rt=[e]:Rt.push(e)}var _p=Y.ReactCurrentBatchConfig;function Hs(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(a(309));var l=n.stateNode}if(!l)throw Error(a(147,e));var o=l,c=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===c?t.ref:(t=function(p){var N=o.refs;p===null?delete N[c]:N[c]=p},t._stringRef=c,t)}if(typeof e!="string")throw Error(a(284));if(!n._owner)throw Error(a(290,e))}return e}function Vr(e,t){throw e=Object.prototype.toString.call(t),Error(a(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Rc(e){var t=e._init;return t(e._payload)}function Lc(e){function t(T,E){if(e){var R=T.deletions;R===null?(T.deletions=[E],T.flags|=16):R.push(E)}}function n(T,E){if(!e)return null;for(;E!==null;)t(T,E),E=E.sibling;return null}function l(T,E){for(T=new Map;E!==null;)E.key!==null?T.set(E.key,E):T.set(E.index,E),E=E.sibling;return T}function o(T,E){return T=xn(T,E),T.index=0,T.sibling=null,T}function c(T,E,R){return T.index=R,e?(R=T.alternate,R!==null?(R=R.index,R<E?(T.flags|=2,E):R):(T.flags|=2,E)):(T.flags|=1048576,E)}function p(T){return e&&T.alternate===null&&(T.flags|=2),T}function N(T,E,R,Q){return E===null||E.tag!==6?(E=ka(R,T.mode,Q),E.return=T,E):(E=o(E,R),E.return=T,E)}function C(T,E,R,Q){var ae=R.type;return ae===H?V(T,E,R.props.children,Q,R.key):E!==null&&(E.elementType===ae||typeof ae=="object"&&ae!==null&&ae.$$typeof===Ee&&Rc(ae)===E.type)?(Q=o(E,R.props),Q.ref=Hs(T,E,R),Q.return=T,Q):(Q=hl(R.type,R.key,R.props,null,T.mode,Q),Q.ref=Hs(T,E,R),Q.return=T,Q)}function I(T,E,R,Q){return E===null||E.tag!==4||E.stateNode.containerInfo!==R.containerInfo||E.stateNode.implementation!==R.implementation?(E=wa(R,T.mode,Q),E.return=T,E):(E=o(E,R.children||[]),E.return=T,E)}function V(T,E,R,Q,ae){return E===null||E.tag!==7?(E=An(R,T.mode,Q,ae),E.return=T,E):(E=o(E,R),E.return=T,E)}function K(T,E,R){if(typeof E=="string"&&E!==""||typeof E=="number")return E=ka(""+E,T.mode,R),E.return=T,E;if(typeof E=="object"&&E!==null){switch(E.$$typeof){case M:return R=hl(E.type,E.key,E.props,null,T.mode,R),R.ref=Hs(T,null,E),R.return=T,R;case Z:return E=wa(E,T.mode,R),E.return=T,E;case Ee:var Q=E._init;return K(T,Q(E._payload),R)}if(js(E)||le(E))return E=An(E,T.mode,R,null),E.return=T,E;Vr(T,E)}return null}function U(T,E,R,Q){var ae=E!==null?E.key:null;if(typeof R=="string"&&R!==""||typeof R=="number")return ae!==null?null:N(T,E,""+R,Q);if(typeof R=="object"&&R!==null){switch(R.$$typeof){case M:return R.key===ae?C(T,E,R,Q):null;case Z:return R.key===ae?I(T,E,R,Q):null;case Ee:return ae=R._init,U(T,E,ae(R._payload),Q)}if(js(R)||le(R))return ae!==null?null:V(T,E,R,Q,null);Vr(T,R)}return null}function ee(T,E,R,Q,ae){if(typeof Q=="string"&&Q!==""||typeof Q=="number")return T=T.get(R)||null,N(E,T,""+Q,ae);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case M:return T=T.get(Q.key===null?R:Q.key)||null,C(E,T,Q,ae);case Z:return T=T.get(Q.key===null?R:Q.key)||null,I(E,T,Q,ae);case Ee:var de=Q._init;return ee(T,E,R,de(Q._payload),ae)}if(js(Q)||le(Q))return T=T.get(R)||null,V(E,T,Q,ae,null);Vr(E,Q)}return null}function se(T,E,R,Q){for(var ae=null,de=null,fe=E,je=E=0,tt=null;fe!==null&&je<R.length;je++){fe.index>je?(tt=fe,fe=null):tt=fe.sibling;var _e=U(T,fe,R[je],Q);if(_e===null){fe===null&&(fe=tt);break}e&&fe&&_e.alternate===null&&t(T,fe),E=c(_e,E,je),de===null?ae=_e:de.sibling=_e,de=_e,fe=tt}if(je===R.length)return n(T,fe),Fe&&_n(T,je),ae;if(fe===null){for(;je<R.length;je++)fe=K(T,R[je],Q),fe!==null&&(E=c(fe,E,je),de===null?ae=fe:de.sibling=fe,de=fe);return Fe&&_n(T,je),ae}for(fe=l(T,fe);je<R.length;je++)tt=ee(fe,T,je,R[je],Q),tt!==null&&(e&&tt.alternate!==null&&fe.delete(tt.key===null?je:tt.key),E=c(tt,E,je),de===null?ae=tt:de.sibling=tt,de=tt);return e&&fe.forEach(function(yn){return t(T,yn)}),Fe&&_n(T,je),ae}function re(T,E,R,Q){var ae=le(R);if(typeof ae!="function")throw Error(a(150));if(R=ae.call(R),R==null)throw Error(a(151));for(var de=ae=null,fe=E,je=E=0,tt=null,_e=R.next();fe!==null&&!_e.done;je++,_e=R.next()){fe.index>je?(tt=fe,fe=null):tt=fe.sibling;var yn=U(T,fe,_e.value,Q);if(yn===null){fe===null&&(fe=tt);break}e&&fe&&yn.alternate===null&&t(T,fe),E=c(yn,E,je),de===null?ae=yn:de.sibling=yn,de=yn,fe=tt}if(_e.done)return n(T,fe),Fe&&_n(T,je),ae;if(fe===null){for(;!_e.done;je++,_e=R.next())_e=K(T,_e.value,Q),_e!==null&&(E=c(_e,E,je),de===null?ae=_e:de.sibling=_e,de=_e);return Fe&&_n(T,je),ae}for(fe=l(T,fe);!_e.done;je++,_e=R.next())_e=ee(fe,T,je,_e.value,Q),_e!==null&&(e&&_e.alternate!==null&&fe.delete(_e.key===null?je:_e.key),E=c(_e,E,je),de===null?ae=_e:de.sibling=_e,de=_e);return e&&fe.forEach(function(oh){return t(T,oh)}),Fe&&_n(T,je),ae}function Qe(T,E,R,Q){if(typeof R=="object"&&R!==null&&R.type===H&&R.key===null&&(R=R.props.children),typeof R=="object"&&R!==null){switch(R.$$typeof){case M:e:{for(var ae=R.key,de=E;de!==null;){if(de.key===ae){if(ae=R.type,ae===H){if(de.tag===7){n(T,de.sibling),E=o(de,R.props.children),E.return=T,T=E;break e}}else if(de.elementType===ae||typeof ae=="object"&&ae!==null&&ae.$$typeof===Ee&&Rc(ae)===de.type){n(T,de.sibling),E=o(de,R.props),E.ref=Hs(T,de,R),E.return=T,T=E;break e}n(T,de);break}else t(T,de);de=de.sibling}R.type===H?(E=An(R.props.children,T.mode,Q,R.key),E.return=T,T=E):(Q=hl(R.type,R.key,R.props,null,T.mode,Q),Q.ref=Hs(T,E,R),Q.return=T,T=Q)}return p(T);case Z:e:{for(de=R.key;E!==null;){if(E.key===de)if(E.tag===4&&E.stateNode.containerInfo===R.containerInfo&&E.stateNode.implementation===R.implementation){n(T,E.sibling),E=o(E,R.children||[]),E.return=T,T=E;break e}else{n(T,E);break}else t(T,E);E=E.sibling}E=wa(R,T.mode,Q),E.return=T,T=E}return p(T);case Ee:return de=R._init,Qe(T,E,de(R._payload),Q)}if(js(R))return se(T,E,R,Q);if(le(R))return re(T,E,R,Q);Vr(T,R)}return typeof R=="string"&&R!==""||typeof R=="number"?(R=""+R,E!==null&&E.tag===6?(n(T,E.sibling),E=o(E,R),E.return=T,T=E):(n(T,E),E=ka(R,T.mode,Q),E.return=T,T=E),p(T)):n(T,E)}return Qe}var ls=Lc(!0),$c=Lc(!1),Hr=on(null),Kr=null,is=null,Ri=null;function Li(){Ri=is=Kr=null}function $i(e){var t=Hr.current;Me(Hr),e._currentValue=t}function Ii(e,t,n){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===n)break;e=e.return}}function as(e,t){Kr=e,Ri=is=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(ht=!0),e.firstContext=null)}function Ct(e){var t=e._currentValue;if(Ri!==e)if(e={context:e,memoizedValue:t,next:null},is===null){if(Kr===null)throw Error(a(308));is=e,Kr.dependencies={lanes:0,firstContext:e}}else is=is.next=e;return t}var Tn=null;function Oi(e){Tn===null?Tn=[e]:Tn.push(e)}function Ic(e,t,n,l){var o=t.interleaved;return o===null?(n.next=n,Oi(t)):(n.next=o.next,o.next=n),t.interleaved=n,qt(e,l)}function qt(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 dn=!1;function zi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Oc(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 Qt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function fn(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(be&2)!==0){var o=l.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),l.pending=t,qt(e,n)}return o=l.interleaved,o===null?(t.next=t,Oi(l)):(t.next=o.next,o.next=t),l.interleaved=t,qt(e,n)}function qr(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Jl(e,n)}}function zc(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var o=null,c=null;if(n=n.firstBaseUpdate,n!==null){do{var p={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};c===null?o=c=p:c=c.next=p,n=n.next}while(n!==null);c===null?o=c=t:c=c.next=t}else o=c=t;n={baseState:l.baseState,firstBaseUpdate:o,lastBaseUpdate:c,shared:l.shared,effects:l.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Qr(e,t,n,l){var o=e.updateQueue;dn=!1;var c=o.firstBaseUpdate,p=o.lastBaseUpdate,N=o.shared.pending;if(N!==null){o.shared.pending=null;var C=N,I=C.next;C.next=null,p===null?c=I:p.next=I,p=C;var V=e.alternate;V!==null&&(V=V.updateQueue,N=V.lastBaseUpdate,N!==p&&(N===null?V.firstBaseUpdate=I:N.next=I,V.lastBaseUpdate=C))}if(c!==null){var K=o.baseState;p=0,V=I=C=null,N=c;do{var U=N.lane,ee=N.eventTime;if((l&U)===U){V!==null&&(V=V.next={eventTime:ee,lane:0,tag:N.tag,payload:N.payload,callback:N.callback,next:null});e:{var se=e,re=N;switch(U=t,ee=n,re.tag){case 1:if(se=re.payload,typeof se=="function"){K=se.call(ee,K,U);break e}K=se;break e;case 3:se.flags=se.flags&-65537|128;case 0:if(se=re.payload,U=typeof se=="function"?se.call(ee,K,U):se,U==null)break e;K=X({},K,U);break e;case 2:dn=!0}}N.callback!==null&&N.lane!==0&&(e.flags|=64,U=o.effects,U===null?o.effects=[N]:U.push(N))}else ee={eventTime:ee,lane:U,tag:N.tag,payload:N.payload,callback:N.callback,next:null},V===null?(I=V=ee,C=K):V=V.next=ee,p|=U;if(N=N.next,N===null){if(N=o.shared.pending,N===null)break;U=N,N=U.next,U.next=null,o.lastBaseUpdate=U,o.shared.pending=null}}while(!0);if(V===null&&(C=K),o.baseState=C,o.firstBaseUpdate=I,o.lastBaseUpdate=V,t=o.shared.interleaved,t!==null){o=t;do p|=o.lane,o=o.next;while(o!==t)}else c===null&&(o.shared.lanes=0);$n|=p,e.lanes=p,e.memoizedState=K}}function Ac(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var l=e[t],o=l.callback;if(o!==null){if(l.callback=null,l=n,typeof o!="function")throw Error(a(191,o));o.call(l)}}}var Ks={},Mt=on(Ks),qs=on(Ks),Qs=on(Ks);function Rn(e){if(e===Ks)throw Error(a(174));return e}function Ai(e,t){switch(ze(Qs,t),ze(qs,e),ze(Mt,Ks),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ml(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ml(t,e)}Me(Mt),ze(Mt,t)}function os(){Me(Mt),Me(qs),Me(Qs)}function Mc(e){Rn(Qs.current);var t=Rn(Mt.current),n=Ml(t,e.type);t!==n&&(ze(qs,e),ze(Mt,n))}function Mi(e){qs.current===e&&(Me(Mt),Me(qs))}var We=on(0);function Gr(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)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Di=[];function Fi(){for(var e=0;e<Di.length;e++)Di[e]._workInProgressVersionPrimary=null;Di.length=0}var Jr=Y.ReactCurrentDispatcher,Bi=Y.ReactCurrentBatchConfig,Ln=0,Ve=null,Ye=null,Xe=null,Yr=!1,Gs=!1,Js=0,Tp=0;function it(){throw Error(a(321))}function Ui(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Tt(e[n],t[n]))return!1;return!0}function Wi(e,t,n,l,o,c){if(Ln=c,Ve=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Jr.current=e===null||e.memoizedState===null?Ip:Op,e=n(l,o),Gs){c=0;do{if(Gs=!1,Js=0,25<=c)throw Error(a(301));c+=1,Xe=Ye=null,t.updateQueue=null,Jr.current=zp,e=n(l,o)}while(Gs)}if(Jr.current=el,t=Ye!==null&&Ye.next!==null,Ln=0,Xe=Ye=Ve=null,Yr=!1,t)throw Error(a(300));return e}function Vi(){var e=Js!==0;return Js=0,e}function Dt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xe===null?Ve.memoizedState=Xe=e:Xe=Xe.next=e,Xe}function Et(){if(Ye===null){var e=Ve.alternate;e=e!==null?e.memoizedState:null}else e=Ye.next;var t=Xe===null?Ve.memoizedState:Xe.next;if(t!==null)Xe=t,Ye=e;else{if(e===null)throw Error(a(310));Ye=e,e={memoizedState:Ye.memoizedState,baseState:Ye.baseState,baseQueue:Ye.baseQueue,queue:Ye.queue,next:null},Xe===null?Ve.memoizedState=Xe=e:Xe=Xe.next=e}return Xe}function Ys(e,t){return typeof t=="function"?t(e):t}function Hi(e){var t=Et(),n=t.queue;if(n===null)throw Error(a(311));n.lastRenderedReducer=e;var l=Ye,o=l.baseQueue,c=n.pending;if(c!==null){if(o!==null){var p=o.next;o.next=c.next,c.next=p}l.baseQueue=o=c,n.pending=null}if(o!==null){c=o.next,l=l.baseState;var N=p=null,C=null,I=c;do{var V=I.lane;if((Ln&V)===V)C!==null&&(C=C.next={lane:0,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null}),l=I.hasEagerState?I.eagerState:e(l,I.action);else{var K={lane:V,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null};C===null?(N=C=K,p=l):C=C.next=K,Ve.lanes|=V,$n|=V}I=I.next}while(I!==null&&I!==c);C===null?p=l:C.next=N,Tt(l,t.memoizedState)||(ht=!0),t.memoizedState=l,t.baseState=p,t.baseQueue=C,n.lastRenderedState=l}if(e=n.interleaved,e!==null){o=e;do c=o.lane,Ve.lanes|=c,$n|=c,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ki(e){var t=Et(),n=t.queue;if(n===null)throw Error(a(311));n.lastRenderedReducer=e;var l=n.dispatch,o=n.pending,c=t.memoizedState;if(o!==null){n.pending=null;var p=o=o.next;do c=e(c,p.action),p=p.next;while(p!==o);Tt(c,t.memoizedState)||(ht=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),n.lastRenderedState=c}return[c,l]}function Dc(){}function Fc(e,t){var n=Ve,l=Et(),o=t(),c=!Tt(l.memoizedState,o);if(c&&(l.memoizedState=o,ht=!0),l=l.queue,qi(Wc.bind(null,n,l,e),[e]),l.getSnapshot!==t||c||Xe!==null&&Xe.memoizedState.tag&1){if(n.flags|=2048,Zs(9,Uc.bind(null,n,l,o,t),void 0,null),et===null)throw Error(a(349));(Ln&30)!==0||Bc(n,t,o)}return o}function Bc(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ve.updateQueue,t===null?(t={lastEffect:null,stores:null},Ve.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Uc(e,t,n,l){t.value=n,t.getSnapshot=l,Vc(t)&&Hc(e)}function Wc(e,t,n){return n(function(){Vc(t)&&Hc(e)})}function Vc(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Tt(e,n)}catch{return!0}}function Hc(e){var t=qt(e,1);t!==null&&Ot(t,e,1,-1)}function Kc(e){var t=Dt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ys,lastRenderedState:e},t.queue=e,e=e.dispatch=$p.bind(null,Ve,e),[t.memoizedState,e]}function Zs(e,t,n,l){return e={tag:e,create:t,destroy:n,deps:l,next:null},t=Ve.updateQueue,t===null?(t={lastEffect:null,stores:null},Ve.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(l=n.next,n.next=e,e.next=l,t.lastEffect=e)),e}function qc(){return Et().memoizedState}function Zr(e,t,n,l){var o=Dt();Ve.flags|=e,o.memoizedState=Zs(1|t,n,void 0,l===void 0?null:l)}function Xr(e,t,n,l){var o=Et();l=l===void 0?null:l;var c=void 0;if(Ye!==null){var p=Ye.memoizedState;if(c=p.destroy,l!==null&&Ui(l,p.deps)){o.memoizedState=Zs(t,n,c,l);return}}Ve.flags|=e,o.memoizedState=Zs(1|t,n,c,l)}function Qc(e,t){return Zr(8390656,8,e,t)}function qi(e,t){return Xr(2048,8,e,t)}function Gc(e,t){return Xr(4,2,e,t)}function Jc(e,t){return Xr(4,4,e,t)}function Yc(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 Zc(e,t,n){return n=n!=null?n.concat([e]):null,Xr(4,4,Yc.bind(null,t,e),n)}function Qi(){}function Xc(e,t){var n=Et();t=t===void 0?null:t;var l=n.memoizedState;return l!==null&&t!==null&&Ui(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function eu(e,t){var n=Et();t=t===void 0?null:t;var l=n.memoizedState;return l!==null&&t!==null&&Ui(t,l[1])?l[0]:(e=e(),n.memoizedState=[e,t],e)}function tu(e,t,n){return(Ln&21)===0?(e.baseState&&(e.baseState=!1,ht=!0),e.memoizedState=n):(Tt(n,t)||(n=Ro(),Ve.lanes|=n,$n|=n,e.baseState=!0),t)}function Rp(e,t){var n=Ie;Ie=n!==0&&4>n?n:4,e(!0);var l=Bi.transition;Bi.transition={};try{e(!1),t()}finally{Ie=n,Bi.transition=l}}function nu(){return Et().memoizedState}function Lp(e,t,n){var l=gn(e);if(n={lane:l,action:n,hasEagerState:!1,eagerState:null,next:null},su(e))ru(t,n);else if(n=Ic(e,t,n,l),n!==null){var o=ut();Ot(n,e,l,o),lu(n,t,l)}}function $p(e,t,n){var l=gn(e),o={lane:l,action:n,hasEagerState:!1,eagerState:null,next:null};if(su(e))ru(t,o);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var p=t.lastRenderedState,N=c(p,n);if(o.hasEagerState=!0,o.eagerState=N,Tt(N,p)){var C=t.interleaved;C===null?(o.next=o,Oi(t)):(o.next=C.next,C.next=o),t.interleaved=o;return}}catch{}finally{}n=Ic(e,t,o,l),n!==null&&(o=ut(),Ot(n,e,l,o),lu(n,t,l))}}function su(e){var t=e.alternate;return e===Ve||t!==null&&t===Ve}function ru(e,t){Gs=Yr=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function lu(e,t,n){if((n&4194240)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Jl(e,n)}}var el={readContext:Ct,useCallback:it,useContext:it,useEffect:it,useImperativeHandle:it,useInsertionEffect:it,useLayoutEffect:it,useMemo:it,useReducer:it,useRef:it,useState:it,useDebugValue:it,useDeferredValue:it,useTransition:it,useMutableSource:it,useSyncExternalStore:it,useId:it,unstable_isNewReconciler:!1},Ip={readContext:Ct,useCallback:function(e,t){return Dt().memoizedState=[e,t===void 0?null:t],e},useContext:Ct,useEffect:Qc,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Zr(4194308,4,Yc.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Zr(4194308,4,e,t)},useInsertionEffect:function(e,t){return Zr(4,2,e,t)},useMemo:function(e,t){var n=Dt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var l=Dt();return t=n!==void 0?n(t):t,l.memoizedState=l.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},l.queue=e,e=e.dispatch=Lp.bind(null,Ve,e),[l.memoizedState,e]},useRef:function(e){var t=Dt();return e={current:e},t.memoizedState=e},useState:Kc,useDebugValue:Qi,useDeferredValue:function(e){return Dt().memoizedState=e},useTransition:function(){var e=Kc(!1),t=e[0];return e=Rp.bind(null,e[1]),Dt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var l=Ve,o=Dt();if(Fe){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),et===null)throw Error(a(349));(Ln&30)!==0||Bc(l,t,n)}o.memoizedState=n;var c={value:n,getSnapshot:t};return o.queue=c,Qc(Wc.bind(null,l,c,e),[e]),l.flags|=2048,Zs(9,Uc.bind(null,l,c,n,t),void 0,null),n},useId:function(){var e=Dt(),t=et.identifierPrefix;if(Fe){var n=Kt,l=Ht;n=(l&~(1<<32-_t(l)-1)).toString(32)+n,t=":"+t+"R"+n,n=Js++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Tp++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Op={readContext:Ct,useCallback:Xc,useContext:Ct,useEffect:qi,useImperativeHandle:Zc,useInsertionEffect:Gc,useLayoutEffect:Jc,useMemo:eu,useReducer:Hi,useRef:qc,useState:function(){return Hi(Ys)},useDebugValue:Qi,useDeferredValue:function(e){var t=Et();return tu(t,Ye.memoizedState,e)},useTransition:function(){var e=Hi(Ys)[0],t=Et().memoizedState;return[e,t]},useMutableSource:Dc,useSyncExternalStore:Fc,useId:nu,unstable_isNewReconciler:!1},zp={readContext:Ct,useCallback:Xc,useContext:Ct,useEffect:qi,useImperativeHandle:Zc,useInsertionEffect:Gc,useLayoutEffect:Jc,useMemo:eu,useReducer:Ki,useRef:qc,useState:function(){return Ki(Ys)},useDebugValue:Qi,useDeferredValue:function(e){var t=Et();return Ye===null?t.memoizedState=e:tu(t,Ye.memoizedState,e)},useTransition:function(){var e=Ki(Ys)[0],t=Et().memoizedState;return[e,t]},useMutableSource:Dc,useSyncExternalStore:Fc,useId:nu,unstable_isNewReconciler:!1};function Lt(e,t){if(e&&e.defaultProps){t=X({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Gi(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:X({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var tl={isMounted:function(e){return(e=e._reactInternals)?Cn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var l=ut(),o=gn(e),c=Qt(l,o);c.payload=t,n!=null&&(c.callback=n),t=fn(e,c,o),t!==null&&(Ot(t,e,o,l),qr(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=ut(),o=gn(e),c=Qt(l,o);c.tag=1,c.payload=t,n!=null&&(c.callback=n),t=fn(e,c,o),t!==null&&(Ot(t,e,o,l),qr(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ut(),l=gn(e),o=Qt(n,l);o.tag=2,t!=null&&(o.callback=t),t=fn(e,o,l),t!==null&&(Ot(t,e,l,n),qr(t,e,l))}};function iu(e,t,n,l,o,c,p){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,c,p):t.prototype&&t.prototype.isPureReactComponent?!Ms(n,l)||!Ms(o,c):!0}function au(e,t,n){var l=!1,o=cn,c=t.contextType;return typeof c=="object"&&c!==null?c=Ct(c):(o=pt(t)?Pn:lt.current,l=t.contextTypes,c=(l=l!=null)?ts(e,o):cn),t=new t(n,c),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=tl,e.stateNode=t,t._reactInternals=e,l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=c),t}function ou(e,t,n,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,l),t.state!==e&&tl.enqueueReplaceState(t,t.state,null)}function Ji(e,t,n,l){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},zi(e);var c=t.contextType;typeof c=="object"&&c!==null?o.context=Ct(c):(c=pt(t)?Pn:lt.current,o.context=ts(e,c)),o.state=e.memoizedState,c=t.getDerivedStateFromProps,typeof c=="function"&&(Gi(e,t,c,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&&tl.enqueueReplaceState(o,o.state,null),Qr(e,n,o,l),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function cs(e,t){try{var n="",l=t;do n+=we(l),l=l.return;while(l);var o=n}catch(c){o=`
|
|
39
39
|
Error generating stack: `+c.message+`
|
|
40
|
-
`+c.stack}return{value:e,source:t,stack:o,digest:null}}function Yi(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Zi(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Ap=typeof WeakMap=="function"?WeakMap:Map;function cu(e,t,n){n=Qt(-1,n),n.tag=3,n.payload={element:null};var l=t.value;return n.callback=function(){ol||(ol=!0,pa=l),Zi(e,t)},n}function uu(e,t,n){n=Qt(-1,n),n.tag=3;var l=e.type.getDerivedStateFromError;if(typeof l=="function"){var o=t.value;n.payload=function(){return l(o)},n.callback=function(){Zi(e,t)}}var c=e.stateNode;return c!==null&&typeof c.componentDidCatch=="function"&&(n.callback=function(){Zi(e,t),typeof l!="function"&&(hn===null?hn=new Set([this]):hn.add(this));var p=t.stack;this.componentDidCatch(t.value,{componentStack:p!==null?p:""})}),n}function du(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new Ap;var o=new Set;l.set(t,o)}else o=l.get(t),o===void 0&&(o=new Set,l.set(t,o));o.has(n)||(o.add(n),e=Yp.bind(null,e,t,n),t.then(e,e))}function fu(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 pu(e,t,n,l,o){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Qt(-1,1),t.tag=2,fn(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var Mp=Y.ReactCurrentOwner,ht=!1;function ct(e,t,n,l){t.child=e===null?$c(t,null,n,l):rs(t,e.child,n,l)}function hu(e,t,n,l,o){n=n.render;var c=t.ref;return is(t,o),l=Wi(e,t,n,l,c,o),n=Vi(),e!==null&&!ht?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Gt(e,t,o)):(Fe&&n&&Ei(t),t.flags|=1,ct(e,t,l,o),t.child)}function mu(e,t,n,l,o){if(e===null){var c=n.type;return typeof c=="function"&&!ja(c)&&c.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=c,gu(e,t,c,l,o)):(e=hl(n.type,null,l,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,(e.lanes&o)===0){var p=c.memoizedProps;if(n=n.compare,n=n!==null?n:Ms,n(p,l)&&e.ref===t.ref)return Gt(e,t,o)}return t.flags|=1,e=xn(c,l),e.ref=t.ref,e.return=t,t.child=e}function gu(e,t,n,l,o){if(e!==null){var c=e.memoizedProps;if(Ms(c,l)&&e.ref===t.ref)if(ht=!1,t.pendingProps=l=c,(e.lanes&o)!==0)(e.flags&131072)!==0&&(ht=!0);else return t.lanes=e.lanes,Gt(e,t,o)}return Xi(e,t,n,l,o)}function vu(e,t,n){var l=t.pendingProps,o=l.children,c=e!==null?e.memoizedState:null;if(l.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ze(us,wt),wt|=n;else{if((n&1073741824)===0)return e=c!==null?c.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ze(us,wt),wt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=c!==null?c.baseLanes:n,ze(us,wt),wt|=l}else c!==null?(l=c.baseLanes|n,t.memoizedState=null):l=n,ze(us,wt),wt|=l;return ct(e,t,o,n),t.child}function xu(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Xi(e,t,n,l,o){var c=pt(n)?En:lt.current;return c=es(t,c),is(t,o),n=Wi(e,t,n,l,c,o),l=Vi(),e!==null&&!ht?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Gt(e,t,o)):(Fe&&l&&Ei(t),t.flags|=1,ct(e,t,n,o),t.child)}function yu(e,t,n,l,o){if(pt(n)){var c=!0;Dr(t)}else c=!1;if(is(t,o),t.stateNode===null)sl(e,t),au(t,n,l),Ji(t,n,l,o),l=!0;else if(e===null){var p=t.stateNode,w=t.memoizedProps;p.props=w;var E=p.context,$=n.contextType;typeof $=="object"&&$!==null?$=Ct($):($=pt(n)?En:lt.current,$=es(t,$));var V=n.getDerivedStateFromProps,K=typeof V=="function"||typeof p.getSnapshotBeforeUpdate=="function";K||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(w!==l||E!==$)&&ou(t,p,l,$),dn=!1;var U=t.memoizedState;p.state=U,Qr(t,l,p,o),E=t.memoizedState,w!==l||U!==E||ft.current||dn?(typeof V=="function"&&(Gi(t,n,V,l),E=t.memoizedState),(w=dn||iu(t,n,w,l,U,E,$))?(K||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount()),typeof p.componentDidMount=="function"&&(t.flags|=4194308)):(typeof p.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=E),p.props=l,p.state=E,p.context=$,l=w):(typeof p.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{p=t.stateNode,Oc(e,t),w=t.memoizedProps,$=t.type===t.elementType?w:Lt(t.type,w),p.props=$,K=t.pendingProps,U=p.context,E=n.contextType,typeof E=="object"&&E!==null?E=Ct(E):(E=pt(n)?En:lt.current,E=es(t,E));var ee=n.getDerivedStateFromProps;(V=typeof ee=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(w!==K||U!==E)&&ou(t,p,l,E),dn=!1,U=t.memoizedState,p.state=U,Qr(t,l,p,o);var se=t.memoizedState;w!==K||U!==se||ft.current||dn?(typeof ee=="function"&&(Gi(t,n,ee,l),se=t.memoizedState),($=dn||iu(t,n,$,l,U,se,E)||!1)?(V||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(l,se,E),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(l,se,E)),typeof p.componentDidUpdate=="function"&&(t.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof p.componentDidUpdate!="function"||w===e.memoizedProps&&U===e.memoizedState||(t.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||w===e.memoizedProps&&U===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=se),p.props=l,p.state=se,p.context=E,l=$):(typeof p.componentDidUpdate!="function"||w===e.memoizedProps&&U===e.memoizedState||(t.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||w===e.memoizedProps&&U===e.memoizedState||(t.flags|=1024),l=!1)}return ea(e,t,n,l,c,o)}function ea(e,t,n,l,o,c){xu(e,t);var p=(t.flags&128)!==0;if(!l&&!p)return o&&Sc(t,n,!1),Gt(e,t,c);l=t.stateNode,Mp.current=t;var w=p&&typeof n.getDerivedStateFromError!="function"?null:l.render();return t.flags|=1,e!==null&&p?(t.child=rs(t,e.child,null,c),t.child=rs(t,null,w,c)):ct(e,t,w,c),t.memoizedState=l.state,o&&Sc(t,n,!0),t.child}function ju(e){var t=e.stateNode;t.pendingContext?wc(e,t.pendingContext,t.pendingContext!==t.context):t.context&&wc(e,t.context,!1),Ai(e,t.containerInfo)}function ku(e,t,n,l,o){return ss(),Ti(o),t.flags|=256,ct(e,t,n,l),t.child}var ta={dehydrated:null,treeContext:null,retryLane:0};function na(e){return{baseLanes:e,cachePool:null,transitions:null}}function wu(e,t,n){var l=t.pendingProps,o=We.current,c=!1,p=(t.flags&128)!==0,w;if((w=p)||(w=e!==null&&e.memoizedState===null?!1:(o&2)!==0),w?(c=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),ze(We,o&1),e===null)return _i(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(p=l.children,e=l.fallback,c?(l=t.mode,c=t.child,p={mode:"hidden",children:p},(l&1)===0&&c!==null?(c.childLanes=0,c.pendingProps=p):c=ml(p,l,0,null),e=zn(e,l,n,null),c.return=t,e.return=t,c.sibling=e,t.child=c,t.child.memoizedState=na(n),t.memoizedState=ta,e):sa(t,p));if(o=e.memoizedState,o!==null&&(w=o.dehydrated,w!==null))return Dp(e,t,p,l,w,o,n);if(c){c=l.fallback,p=t.mode,o=e.child,w=o.sibling;var E={mode:"hidden",children:l.children};return(p&1)===0&&t.child!==o?(l=t.child,l.childLanes=0,l.pendingProps=E,t.deletions=null):(l=xn(o,E),l.subtreeFlags=o.subtreeFlags&14680064),w!==null?c=xn(w,c):(c=zn(c,p,n,null),c.flags|=2),c.return=t,l.return=t,l.sibling=c,t.child=l,l=c,c=t.child,p=e.child.memoizedState,p=p===null?na(n):{baseLanes:p.baseLanes|n,cachePool:null,transitions:p.transitions},c.memoizedState=p,c.childLanes=e.childLanes&~n,t.memoizedState=ta,l}return c=e.child,e=c.sibling,l=xn(c,{mode:"visible",children:l.children}),(t.mode&1)===0&&(l.lanes=n),l.return=t,l.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=l,t.memoizedState=null,l}function sa(e,t){return t=ml({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function nl(e,t,n,l){return l!==null&&Ti(l),rs(t,e.child,null,n),e=sa(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Dp(e,t,n,l,o,c,p){if(n)return t.flags&256?(t.flags&=-257,l=Yi(Error(a(422))),nl(e,t,p,l)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(c=l.fallback,o=t.mode,l=ml({mode:"visible",children:l.children},o,0,null),c=zn(c,o,p,null),c.flags|=2,l.return=t,c.return=t,l.sibling=c,t.child=l,(t.mode&1)!==0&&rs(t,e.child,null,p),t.child.memoizedState=na(p),t.memoizedState=ta,c);if((t.mode&1)===0)return nl(e,t,p,null);if(o.data==="$!"){if(l=o.nextSibling&&o.nextSibling.dataset,l)var w=l.dgst;return l=w,c=Error(a(419)),l=Yi(c,l,void 0),nl(e,t,p,l)}if(w=(p&e.childLanes)!==0,ht||w){if(l=et,l!==null){switch(p&-p){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&(l.suspendedLanes|p))!==0?0:o,o!==0&&o!==c.retryLane&&(c.retryLane=o,qt(e,o),Ot(l,e,o,-1))}return ya(),l=Yi(Error(a(421))),nl(e,t,p,l)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=Zp.bind(null,e),o._reactRetry=t,null):(e=c.treeContext,kt=an(o.nextSibling),jt=t,Fe=!0,Rt=null,e!==null&&(Nt[St++]=Ht,Nt[St++]=Kt,Nt[St++]=Pn,Ht=e.id,Kt=e.overflow,Pn=t),t=sa(t,l.children),t.flags|=4096,t)}function Nu(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),Ii(e.return,t,n)}function ra(e,t,n,l,o){var c=e.memoizedState;c===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:o}:(c.isBackwards=t,c.rendering=null,c.renderingStartTime=0,c.last=l,c.tail=n,c.tailMode=o)}function Su(e,t,n){var l=t.pendingProps,o=l.revealOrder,c=l.tail;if(ct(e,t,l.children,n),l=We.current,(l&2)!==0)l=l&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Nu(e,n,t);else if(e.tag===19)Nu(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}l&=1}if(ze(We,l),(t.mode&1)===0)t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&Gr(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),ra(t,!1,o,n,c);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Gr(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}ra(t,!0,n,null,c);break;case"together":ra(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function sl(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Gt(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ln|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(a(153));if(t.child!==null){for(e=t.child,n=xn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=xn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Fp(e,t,n){switch(t.tag){case 3:ju(t),ss();break;case 5:Mc(t);break;case 1:pt(t.type)&&Dr(t);break;case 4:Ai(t,t.stateNode.containerInfo);break;case 10:var l=t.type._context,o=t.memoizedProps.value;ze(Hr,l._currentValue),l._currentValue=o;break;case 13:if(l=t.memoizedState,l!==null)return l.dehydrated!==null?(ze(We,We.current&1),t.flags|=128,null):(n&t.child.childLanes)!==0?wu(e,t,n):(ze(We,We.current&1),e=Gt(e,t,n),e!==null?e.sibling:null);ze(We,We.current&1);break;case 19:if(l=(n&t.childLanes)!==0,(e.flags&128)!==0){if(l)return Su(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ze(We,We.current),l)break;return null;case 22:case 23:return t.lanes=0,vu(e,t,n)}return Gt(e,t,n)}var Cu,la,Eu,Pu;Cu=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}},la=function(){},Eu=function(e,t,n,l){var o=e.memoizedProps;if(o!==l){e=t.stateNode,Tn(Mt.current);var c=null;switch(n){case"input":o=he(e,o),l=he(e,l),c=[];break;case"select":o=X({},o,{value:void 0}),l=X({},l,{value:void 0}),c=[];break;case"textarea":o=Al(e,o),l=Al(e,l),c=[];break;default:typeof o.onClick!="function"&&typeof l.onClick=="function"&&(e.onclick=zr)}Dl(n,l);var p;n=null;for($ in o)if(!l.hasOwnProperty($)&&o.hasOwnProperty($)&&o[$]!=null)if($==="style"){var w=o[$];for(p in w)w.hasOwnProperty(p)&&(n||(n={}),n[p]="")}else $!=="dangerouslySetInnerHTML"&&$!=="children"&&$!=="suppressContentEditableWarning"&&$!=="suppressHydrationWarning"&&$!=="autoFocus"&&(d.hasOwnProperty($)?c||(c=[]):(c=c||[]).push($,null));for($ in l){var E=l[$];if(w=o!=null?o[$]:void 0,l.hasOwnProperty($)&&E!==w&&(E!=null||w!=null))if($==="style")if(w){for(p in w)!w.hasOwnProperty(p)||E&&E.hasOwnProperty(p)||(n||(n={}),n[p]="");for(p in E)E.hasOwnProperty(p)&&w[p]!==E[p]&&(n||(n={}),n[p]=E[p])}else n||(c||(c=[]),c.push($,n)),n=E;else $==="dangerouslySetInnerHTML"?(E=E?E.__html:void 0,w=w?w.__html:void 0,E!=null&&w!==E&&(c=c||[]).push($,E)):$==="children"?typeof E!="string"&&typeof E!="number"||(c=c||[]).push($,""+E):$!=="suppressContentEditableWarning"&&$!=="suppressHydrationWarning"&&(d.hasOwnProperty($)?(E!=null&&$==="onScroll"&&Ae("scroll",e),c||w===E||(c=[])):(c=c||[]).push($,E))}n&&(c=c||[]).push("style",n);var $=c;(t.updateQueue=$)&&(t.flags|=4)}},Pu=function(e,t,n,l){n!==l&&(t.flags|=4)};function Xs(e,t){if(!Fe)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 l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function at(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,l=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,l|=o.subtreeFlags&14680064,l|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,l|=o.subtreeFlags,l|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function Bp(e,t,n){var l=t.pendingProps;switch(Pi(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return at(t),null;case 1:return pt(t.type)&&Mr(),at(t),null;case 3:return l=t.stateNode,as(),Me(ft),Me(lt),Fi(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Wr(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Rt!==null&&(ga(Rt),Rt=null))),la(e,t),at(t),null;case 5:Mi(t);var o=Tn(Qs.current);if(n=t.type,e!==null&&t.stateNode!=null)Eu(e,t,n,l,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!l){if(t.stateNode===null)throw Error(a(166));return at(t),null}if(e=Tn(Mt.current),Wr(t)){l=t.stateNode,n=t.type;var c=t.memoizedProps;switch(l[At]=t,l[Ws]=c,e=(t.mode&1)!==0,n){case"dialog":Ae("cancel",l),Ae("close",l);break;case"iframe":case"object":case"embed":Ae("load",l);break;case"video":case"audio":for(o=0;o<Fs.length;o++)Ae(Fs[o],l);break;case"source":Ae("error",l);break;case"img":case"image":case"link":Ae("error",l),Ae("load",l);break;case"details":Ae("toggle",l);break;case"input":ce(l,c),Ae("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!c.multiple},Ae("invalid",l);break;case"textarea":co(l,c),Ae("invalid",l)}Dl(n,c),o=null;for(var p in c)if(c.hasOwnProperty(p)){var w=c[p];p==="children"?typeof w=="string"?l.textContent!==w&&(c.suppressHydrationWarning!==!0&&Or(l.textContent,w,e),o=["children",w]):typeof w=="number"&&l.textContent!==""+w&&(c.suppressHydrationWarning!==!0&&Or(l.textContent,w,e),o=["children",""+w]):d.hasOwnProperty(p)&&w!=null&&p==="onScroll"&&Ae("scroll",l)}switch(n){case"input":pe(l),De(l,c,!0);break;case"textarea":pe(l),fo(l);break;case"select":case"option":break;default:typeof c.onClick=="function"&&(l.onclick=zr)}l=o,t.updateQueue=l,l!==null&&(t.flags|=4)}else{p=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=po(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=p.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof l.is=="string"?e=p.createElement(n,{is:l.is}):(e=p.createElement(n),n==="select"&&(p=e,l.multiple?p.multiple=!0:l.size&&(p.size=l.size))):e=p.createElementNS(e,n),e[At]=t,e[Ws]=l,Cu(e,t,!1,!1),t.stateNode=e;e:{switch(p=Fl(n,l),n){case"dialog":Ae("cancel",e),Ae("close",e),o=l;break;case"iframe":case"object":case"embed":Ae("load",e),o=l;break;case"video":case"audio":for(o=0;o<Fs.length;o++)Ae(Fs[o],e);o=l;break;case"source":Ae("error",e),o=l;break;case"img":case"image":case"link":Ae("error",e),Ae("load",e),o=l;break;case"details":Ae("toggle",e),o=l;break;case"input":ce(e,l),o=he(e,l),Ae("invalid",e);break;case"option":o=l;break;case"select":e._wrapperState={wasMultiple:!!l.multiple},o=X({},l,{value:void 0}),Ae("invalid",e);break;case"textarea":co(e,l),o=Al(e,l),Ae("invalid",e);break;default:o=l}Dl(n,o),w=o;for(c in w)if(w.hasOwnProperty(c)){var E=w[c];c==="style"?go(e,E):c==="dangerouslySetInnerHTML"?(E=E?E.__html:void 0,E!=null&&ho(e,E)):c==="children"?typeof E=="string"?(n!=="textarea"||E!=="")&&ks(e,E):typeof E=="number"&&ks(e,""+E):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(d.hasOwnProperty(c)?E!=null&&c==="onScroll"&&Ae("scroll",e):E!=null&&A(e,c,E,p))}switch(n){case"input":pe(e),De(e,l,!1);break;case"textarea":pe(e),fo(e);break;case"option":l.value!=null&&e.setAttribute("value",""+Ne(l.value));break;case"select":e.multiple=!!l.multiple,c=l.value,c!=null?Un(e,!!l.multiple,c,!1):l.defaultValue!=null&&Un(e,!!l.multiple,l.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=zr)}switch(n){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}}l&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return at(t),null;case 6:if(e&&t.stateNode!=null)Pu(e,t,e.memoizedProps,l);else{if(typeof l!="string"&&t.stateNode===null)throw Error(a(166));if(n=Tn(Qs.current),Tn(Mt.current),Wr(t)){if(l=t.stateNode,n=t.memoizedProps,l[At]=t,(c=l.nodeValue!==n)&&(e=jt,e!==null))switch(e.tag){case 3:Or(l.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Or(l.nodeValue,n,(e.mode&1)!==0)}c&&(t.flags|=4)}else l=(n.nodeType===9?n:n.ownerDocument).createTextNode(l),l[At]=t,t.stateNode=l}return at(t),null;case 13:if(Me(We),l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Fe&&kt!==null&&(t.mode&1)!==0&&(t.flags&128)===0)Tc(),ss(),t.flags|=98560,c=!1;else if(c=Wr(t),l!==null&&l.dehydrated!==null){if(e===null){if(!c)throw Error(a(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(a(317));c[At]=t}else ss(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;at(t),c=!1}else Rt!==null&&(ga(Rt),Rt=null),c=!0;if(!c)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=n,t):(l=l!==null,l!==(e!==null&&e.memoizedState!==null)&&l&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(We.current&1)!==0?Ze===0&&(Ze=3):ya())),t.updateQueue!==null&&(t.flags|=4),at(t),null);case 4:return as(),la(e,t),e===null&&Bs(t.stateNode.containerInfo),at(t),null;case 10:return $i(t.type._context),at(t),null;case 17:return pt(t.type)&&Mr(),at(t),null;case 19:if(Me(We),c=t.memoizedState,c===null)return at(t),null;if(l=(t.flags&128)!==0,p=c.rendering,p===null)if(l)Xs(c,!1);else{if(Ze!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(p=Gr(e),p!==null){for(t.flags|=128,Xs(c,!1),l=p.updateQueue,l!==null&&(t.updateQueue=l,t.flags|=4),t.subtreeFlags=0,l=n,n=t.child;n!==null;)c=n,e=l,c.flags&=14680066,p=c.alternate,p===null?(c.childLanes=0,c.lanes=e,c.child=null,c.subtreeFlags=0,c.memoizedProps=null,c.memoizedState=null,c.updateQueue=null,c.dependencies=null,c.stateNode=null):(c.childLanes=p.childLanes,c.lanes=p.lanes,c.child=p.child,c.subtreeFlags=0,c.deletions=null,c.memoizedProps=p.memoizedProps,c.memoizedState=p.memoizedState,c.updateQueue=p.updateQueue,c.type=p.type,e=p.dependencies,c.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ze(We,We.current&1|2),t.child}e=e.sibling}c.tail!==null&&qe()>ds&&(t.flags|=128,l=!0,Xs(c,!1),t.lanes=4194304)}else{if(!l)if(e=Gr(p),e!==null){if(t.flags|=128,l=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Xs(c,!0),c.tail===null&&c.tailMode==="hidden"&&!p.alternate&&!Fe)return at(t),null}else 2*qe()-c.renderingStartTime>ds&&n!==1073741824&&(t.flags|=128,l=!0,Xs(c,!1),t.lanes=4194304);c.isBackwards?(p.sibling=t.child,t.child=p):(n=c.last,n!==null?n.sibling=p:t.child=p,c.last=p)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=qe(),t.sibling=null,n=We.current,ze(We,l?n&1|2:n&1),t):(at(t),null);case 22:case 23:return xa(),l=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(t.flags|=8192),l&&(t.mode&1)!==0?(wt&1073741824)!==0&&(at(t),t.subtreeFlags&6&&(t.flags|=8192)):at(t),null;case 24:return null;case 25:return null}throw Error(a(156,t.tag))}function Up(e,t){switch(Pi(t),t.tag){case 1:return pt(t.type)&&Mr(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return as(),Me(ft),Me(lt),Fi(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Mi(t),null;case 13:if(Me(We),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));ss()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Me(We),null;case 4:return as(),null;case 10:return $i(t.type._context),null;case 22:case 23:return xa(),null;case 24:return null;default:return null}}var rl=!1,ot=!1,Wp=typeof WeakSet=="function"?WeakSet:Set,ne=null;function cs(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(l){He(e,t,l)}else n.current=null}function ia(e,t,n){try{n()}catch(l){He(e,t,l)}}var bu=!1;function Vp(e,t){if(xi=Sr,e=ic(),ui(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var o=l.anchorOffset,c=l.focusNode;l=l.focusOffset;try{n.nodeType,c.nodeType}catch{n=null;break e}var p=0,w=-1,E=-1,$=0,V=0,K=e,U=null;t:for(;;){for(var ee;K!==n||o!==0&&K.nodeType!==3||(w=p+o),K!==c||l!==0&&K.nodeType!==3||(E=p+l),K.nodeType===3&&(p+=K.nodeValue.length),(ee=K.firstChild)!==null;)U=K,K=ee;for(;;){if(K===e)break t;if(U===n&&++$===o&&(w=p),U===c&&++V===l&&(E=p),(ee=K.nextSibling)!==null)break;K=U,U=K.parentNode}K=ee}n=w===-1||E===-1?null:{start:w,end:E}}else n=null}n=n||{start:0,end:0}}else n=null;for(yi={focusedElem:e,selectionRange:n},Sr=!1,ne=t;ne!==null;)if(t=ne,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ne=e;else for(;ne!==null;){t=ne;try{var se=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(se!==null){var re=se.memoizedProps,Qe=se.memoizedState,_=t.stateNode,P=_.getSnapshotBeforeUpdate(t.elementType===t.type?re:Lt(t.type,re),Qe);_.__reactInternalSnapshotBeforeUpdate=P}break;case 3:var R=t.stateNode.containerInfo;R.nodeType===1?R.textContent="":R.nodeType===9&&R.documentElement&&R.removeChild(R.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(Q){He(t,t.return,Q)}if(e=t.sibling,e!==null){e.return=t.return,ne=e;break}ne=t.return}return se=bu,bu=!1,se}function er(e,t,n){var l=t.updateQueue;if(l=l!==null?l.lastEffect:null,l!==null){var o=l=l.next;do{if((o.tag&e)===e){var c=o.destroy;o.destroy=void 0,c!==void 0&&ia(t,n,c)}o=o.next}while(o!==l)}}function ll(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 l=n.create;n.destroy=l()}n=n.next}while(n!==t)}}function aa(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 _u(e){var t=e.alternate;t!==null&&(e.alternate=null,_u(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[At],delete t[Ws],delete t[Ni],delete t[Ep],delete t[Pp])),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 Tu(e){return e.tag===5||e.tag===3||e.tag===4}function Ru(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Tu(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 oa(e,t,n){var l=e.tag;if(l===5||l===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=zr));else if(l!==4&&(e=e.child,e!==null))for(oa(e,t,n),e=e.sibling;e!==null;)oa(e,t,n),e=e.sibling}function ca(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(l!==4&&(e=e.child,e!==null))for(ca(e,t,n),e=e.sibling;e!==null;)ca(e,t,n),e=e.sibling}var st=null,$t=!1;function pn(e,t,n){for(n=n.child;n!==null;)Lu(e,t,n),n=n.sibling}function Lu(e,t,n){if(zt&&typeof zt.onCommitFiberUnmount=="function")try{zt.onCommitFiberUnmount(xr,n)}catch{}switch(n.tag){case 5:ot||cs(n,t);case 6:var l=st,o=$t;st=null,pn(e,t,n),st=l,$t=o,st!==null&&($t?(e=st,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):st.removeChild(n.stateNode));break;case 18:st!==null&&($t?(e=st,n=n.stateNode,e.nodeType===8?wi(e.parentNode,n):e.nodeType===1&&wi(e,n),Ls(e)):wi(st,n.stateNode));break;case 4:l=st,o=$t,st=n.stateNode.containerInfo,$t=!0,pn(e,t,n),st=l,$t=o;break;case 0:case 11:case 14:case 15:if(!ot&&(l=n.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){o=l=l.next;do{var c=o,p=c.destroy;c=c.tag,p!==void 0&&((c&2)!==0||(c&4)!==0)&&ia(n,t,p),o=o.next}while(o!==l)}pn(e,t,n);break;case 1:if(!ot&&(cs(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=n.memoizedProps,l.state=n.memoizedState,l.componentWillUnmount()}catch(w){He(n,t,w)}pn(e,t,n);break;case 21:pn(e,t,n);break;case 22:n.mode&1?(ot=(l=ot)||n.memoizedState!==null,pn(e,t,n),ot=l):pn(e,t,n);break;default:pn(e,t,n)}}function $u(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Wp),t.forEach(function(l){var o=Xp.bind(null,e,l);n.has(l)||(n.add(l),l.then(o,o))})}}function It(e,t){var n=t.deletions;if(n!==null)for(var l=0;l<n.length;l++){var o=n[l];try{var c=e,p=t,w=p;e:for(;w!==null;){switch(w.tag){case 5:st=w.stateNode,$t=!1;break e;case 3:st=w.stateNode.containerInfo,$t=!0;break e;case 4:st=w.stateNode.containerInfo,$t=!0;break e}w=w.return}if(st===null)throw Error(a(160));Lu(c,p,o),st=null,$t=!1;var E=o.alternate;E!==null&&(E.return=null),o.return=null}catch($){He(o,t,$)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Iu(t,e),t=t.sibling}function Iu(e,t){var n=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(It(t,e),Ft(e),l&4){try{er(3,e,e.return),ll(3,e)}catch(re){He(e,e.return,re)}try{er(5,e,e.return)}catch(re){He(e,e.return,re)}}break;case 1:It(t,e),Ft(e),l&512&&n!==null&&cs(n,n.return);break;case 5:if(It(t,e),Ft(e),l&512&&n!==null&&cs(n,n.return),e.flags&32){var o=e.stateNode;try{ks(o,"")}catch(re){He(e,e.return,re)}}if(l&4&&(o=e.stateNode,o!=null)){var c=e.memoizedProps,p=n!==null?n.memoizedProps:c,w=e.type,E=e.updateQueue;if(e.updateQueue=null,E!==null)try{w==="input"&&c.type==="radio"&&c.name!=null&&me(o,c),Fl(w,p);var $=Fl(w,c);for(p=0;p<E.length;p+=2){var V=E[p],K=E[p+1];V==="style"?go(o,K):V==="dangerouslySetInnerHTML"?ho(o,K):V==="children"?ks(o,K):A(o,V,K,$)}switch(w){case"input":ve(o,c);break;case"textarea":uo(o,c);break;case"select":var U=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!c.multiple;var ee=c.value;ee!=null?Un(o,!!c.multiple,ee,!1):U!==!!c.multiple&&(c.defaultValue!=null?Un(o,!!c.multiple,c.defaultValue,!0):Un(o,!!c.multiple,c.multiple?[]:"",!1))}o[Ws]=c}catch(re){He(e,e.return,re)}}break;case 6:if(It(t,e),Ft(e),l&4){if(e.stateNode===null)throw Error(a(162));o=e.stateNode,c=e.memoizedProps;try{o.nodeValue=c}catch(re){He(e,e.return,re)}}break;case 3:if(It(t,e),Ft(e),l&4&&n!==null&&n.memoizedState.isDehydrated)try{Ls(t.containerInfo)}catch(re){He(e,e.return,re)}break;case 4:It(t,e),Ft(e);break;case 13:It(t,e),Ft(e),o=e.child,o.flags&8192&&(c=o.memoizedState!==null,o.stateNode.isHidden=c,!c||o.alternate!==null&&o.alternate.memoizedState!==null||(fa=qe())),l&4&&$u(e);break;case 22:if(V=n!==null&&n.memoizedState!==null,e.mode&1?(ot=($=ot)||V,It(t,e),ot=$):It(t,e),Ft(e),l&8192){if($=e.memoizedState!==null,(e.stateNode.isHidden=$)&&!V&&(e.mode&1)!==0)for(ne=e,V=e.child;V!==null;){for(K=ne=V;ne!==null;){switch(U=ne,ee=U.child,U.tag){case 0:case 11:case 14:case 15:er(4,U,U.return);break;case 1:cs(U,U.return);var se=U.stateNode;if(typeof se.componentWillUnmount=="function"){l=U,n=U.return;try{t=l,se.props=t.memoizedProps,se.state=t.memoizedState,se.componentWillUnmount()}catch(re){He(l,n,re)}}break;case 5:cs(U,U.return);break;case 22:if(U.memoizedState!==null){Au(K);continue}}ee!==null?(ee.return=U,ne=ee):Au(K)}V=V.sibling}e:for(V=null,K=e;;){if(K.tag===5){if(V===null){V=K;try{o=K.stateNode,$?(c=o.style,typeof c.setProperty=="function"?c.setProperty("display","none","important"):c.display="none"):(w=K.stateNode,E=K.memoizedProps.style,p=E!=null&&E.hasOwnProperty("display")?E.display:null,w.style.display=mo("display",p))}catch(re){He(e,e.return,re)}}}else if(K.tag===6){if(V===null)try{K.stateNode.nodeValue=$?"":K.memoizedProps}catch(re){He(e,e.return,re)}}else if((K.tag!==22&&K.tag!==23||K.memoizedState===null||K===e)&&K.child!==null){K.child.return=K,K=K.child;continue}if(K===e)break e;for(;K.sibling===null;){if(K.return===null||K.return===e)break e;V===K&&(V=null),K=K.return}V===K&&(V=null),K.sibling.return=K.return,K=K.sibling}}break;case 19:It(t,e),Ft(e),l&4&&$u(e);break;case 21:break;default:It(t,e),Ft(e)}}function Ft(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Tu(n)){var l=n;break e}n=n.return}throw Error(a(160))}switch(l.tag){case 5:var o=l.stateNode;l.flags&32&&(ks(o,""),l.flags&=-33);var c=Ru(e);ca(e,c,o);break;case 3:case 4:var p=l.stateNode.containerInfo,w=Ru(e);oa(e,w,p);break;default:throw Error(a(161))}}catch(E){He(e,e.return,E)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Hp(e,t,n){ne=e,Ou(e)}function Ou(e,t,n){for(var l=(e.mode&1)!==0;ne!==null;){var o=ne,c=o.child;if(o.tag===22&&l){var p=o.memoizedState!==null||rl;if(!p){var w=o.alternate,E=w!==null&&w.memoizedState!==null||ot;w=rl;var $=ot;if(rl=p,(ot=E)&&!$)for(ne=o;ne!==null;)p=ne,E=p.child,p.tag===22&&p.memoizedState!==null?Mu(o):E!==null?(E.return=p,ne=E):Mu(o);for(;c!==null;)ne=c,Ou(c),c=c.sibling;ne=o,rl=w,ot=$}zu(e)}else(o.subtreeFlags&8772)!==0&&c!==null?(c.return=o,ne=c):zu(e)}}function zu(e){for(;ne!==null;){var t=ne;if((t.flags&8772)!==0){var n=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:ot||ll(5,t);break;case 1:var l=t.stateNode;if(t.flags&4&&!ot)if(n===null)l.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:Lt(t.type,n.memoizedProps);l.componentDidUpdate(o,n.memoizedState,l.__reactInternalSnapshotBeforeUpdate)}var c=t.updateQueue;c!==null&&Ac(t,c,l);break;case 3:var p=t.updateQueue;if(p!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Ac(t,p,n)}break;case 5:var w=t.stateNode;if(n===null&&t.flags&4){n=w;var E=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":E.autoFocus&&n.focus();break;case"img":E.src&&(n.src=E.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var $=t.alternate;if($!==null){var V=$.memoizedState;if(V!==null){var K=V.dehydrated;K!==null&&Ls(K)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(a(163))}ot||t.flags&512&&aa(t)}catch(U){He(t,t.return,U)}}if(t===e){ne=null;break}if(n=t.sibling,n!==null){n.return=t.return,ne=n;break}ne=t.return}}function Au(e){for(;ne!==null;){var t=ne;if(t===e){ne=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ne=n;break}ne=t.return}}function Mu(e){for(;ne!==null;){var t=ne;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ll(4,t)}catch(E){He(t,n,E)}break;case 1:var l=t.stateNode;if(typeof l.componentDidMount=="function"){var o=t.return;try{l.componentDidMount()}catch(E){He(t,o,E)}}var c=t.return;try{aa(t)}catch(E){He(t,c,E)}break;case 5:var p=t.return;try{aa(t)}catch(E){He(t,p,E)}}}catch(E){He(t,t.return,E)}if(t===e){ne=null;break}var w=t.sibling;if(w!==null){w.return=t.return,ne=w;break}ne=t.return}}var Kp=Math.ceil,il=Y.ReactCurrentDispatcher,ua=Y.ReactCurrentOwner,Pt=Y.ReactCurrentBatchConfig,be=0,et=null,Je=null,rt=0,wt=0,us=on(0),Ze=0,tr=null,Ln=0,al=0,da=0,nr=null,mt=null,fa=0,ds=1/0,Jt=null,ol=!1,pa=null,hn=null,cl=!1,mn=null,ul=0,sr=0,ha=null,dl=-1,fl=0;function ut(){return(be&6)!==0?qe():dl!==-1?dl:dl=qe()}function gn(e){return(e.mode&1)===0?1:(be&2)!==0&&rt!==0?rt&-rt:_p.transition!==null?(fl===0&&(fl=Ro()),fl):(e=Ie,e!==0||(e=window.event,e=e===void 0?16:Fo(e.type)),e)}function Ot(e,t,n,l){if(50<sr)throw sr=0,ha=null,Error(a(185));Ps(e,n,l),((be&2)===0||e!==et)&&(e===et&&((be&2)===0&&(al|=n),Ze===4&&vn(e,rt)),gt(e,l),n===1&&be===0&&(t.mode&1)===0&&(ds=qe()+500,Fr&&un()))}function gt(e,t){var n=e.callbackNode;_f(e,t);var l=kr(e,e===et?rt:0);if(l===0)n!==null&&bo(n),e.callbackNode=null,e.callbackPriority=0;else if(t=l&-l,e.callbackPriority!==t){if(n!=null&&bo(n),t===1)e.tag===0?bp(Fu.bind(null,e)):Cc(Fu.bind(null,e)),Sp(function(){(be&6)===0&&un()}),n=null;else{switch(Lo(l)){case 1:n=ql;break;case 4:n=_o;break;case 16:n=vr;break;case 536870912:n=To;break;default:n=vr}n=Qu(n,Du.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Du(e,t){if(dl=-1,fl=0,(be&6)!==0)throw Error(a(327));var n=e.callbackNode;if(fs()&&e.callbackNode!==n)return null;var l=kr(e,e===et?rt:0);if(l===0)return null;if((l&30)!==0||(l&e.expiredLanes)!==0||t)t=pl(e,l);else{t=l;var o=be;be|=2;var c=Uu();(et!==e||rt!==t)&&(Jt=null,ds=qe()+500,In(e,t));do try{Gp();break}catch(w){Bu(e,w)}while(!0);Li(),il.current=c,be=o,Je!==null?t=0:(et=null,rt=0,t=Ze)}if(t!==0){if(t===2&&(o=Ql(e),o!==0&&(l=o,t=ma(e,o))),t===1)throw n=tr,In(e,0),vn(e,l),gt(e,qe()),n;if(t===6)vn(e,l);else{if(o=e.current.alternate,(l&30)===0&&!qp(o)&&(t=pl(e,l),t===2&&(c=Ql(e),c!==0&&(l=c,t=ma(e,c))),t===1))throw n=tr,In(e,0),vn(e,l),gt(e,qe()),n;switch(e.finishedWork=o,e.finishedLanes=l,t){case 0:case 1:throw Error(a(345));case 2:On(e,mt,Jt);break;case 3:if(vn(e,l),(l&130023424)===l&&(t=fa+500-qe(),10<t)){if(kr(e,0)!==0)break;if(o=e.suspendedLanes,(o&l)!==l){ut(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=ki(On.bind(null,e,mt,Jt),t);break}On(e,mt,Jt);break;case 4:if(vn(e,l),(l&4194240)===l)break;for(t=e.eventTimes,o=-1;0<l;){var p=31-_t(l);c=1<<p,p=t[p],p>o&&(o=p),l&=~c}if(l=o,l=qe()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*Kp(l/1960))-l,10<l){e.timeoutHandle=ki(On.bind(null,e,mt,Jt),l);break}On(e,mt,Jt);break;case 5:On(e,mt,Jt);break;default:throw Error(a(329))}}}return gt(e,qe()),e.callbackNode===n?Du.bind(null,e):null}function ma(e,t){var n=nr;return e.current.memoizedState.isDehydrated&&(In(e,t).flags|=256),e=pl(e,t),e!==2&&(t=mt,mt=n,t!==null&&ga(t)),e}function ga(e){mt===null?mt=e:mt.push.apply(mt,e)}function qp(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var l=0;l<n.length;l++){var o=n[l],c=o.getSnapshot;o=o.value;try{if(!Tt(c(),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 vn(e,t){for(t&=~da,t&=~al,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-_t(t),l=1<<n;e[n]=-1,t&=~l}}function Fu(e){if((be&6)!==0)throw Error(a(327));fs();var t=kr(e,0);if((t&1)===0)return gt(e,qe()),null;var n=pl(e,t);if(e.tag!==0&&n===2){var l=Ql(e);l!==0&&(t=l,n=ma(e,l))}if(n===1)throw n=tr,In(e,0),vn(e,t),gt(e,qe()),n;if(n===6)throw Error(a(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,On(e,mt,Jt),gt(e,qe()),null}function va(e,t){var n=be;be|=1;try{return e(t)}finally{be=n,be===0&&(ds=qe()+500,Fr&&un())}}function $n(e){mn!==null&&mn.tag===0&&(be&6)===0&&fs();var t=be;be|=1;var n=Pt.transition,l=Ie;try{if(Pt.transition=null,Ie=1,e)return e()}finally{Ie=l,Pt.transition=n,be=t,(be&6)===0&&un()}}function xa(){wt=us.current,Me(us)}function In(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Np(n)),Je!==null)for(n=Je.return;n!==null;){var l=n;switch(Pi(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&Mr();break;case 3:as(),Me(ft),Me(lt),Fi();break;case 5:Mi(l);break;case 4:as();break;case 13:Me(We);break;case 19:Me(We);break;case 10:$i(l.type._context);break;case 22:case 23:xa()}n=n.return}if(et=e,Je=e=xn(e.current,null),rt=wt=t,Ze=0,tr=null,da=al=Ln=0,mt=nr=null,_n!==null){for(t=0;t<_n.length;t++)if(n=_n[t],l=n.interleaved,l!==null){n.interleaved=null;var o=l.next,c=n.pending;if(c!==null){var p=c.next;c.next=o,l.next=p}n.pending=l}_n=null}return e}function Bu(e,t){do{var n=Je;try{if(Li(),Jr.current=el,Yr){for(var l=Ve.memoizedState;l!==null;){var o=l.queue;o!==null&&(o.pending=null),l=l.next}Yr=!1}if(Rn=0,Xe=Ye=Ve=null,Gs=!1,Js=0,ua.current=null,n===null||n.return===null){Ze=1,tr=t,Je=null;break}e:{var c=e,p=n.return,w=n,E=t;if(t=rt,w.flags|=32768,E!==null&&typeof E=="object"&&typeof E.then=="function"){var $=E,V=w,K=V.tag;if((V.mode&1)===0&&(K===0||K===11||K===15)){var U=V.alternate;U?(V.updateQueue=U.updateQueue,V.memoizedState=U.memoizedState,V.lanes=U.lanes):(V.updateQueue=null,V.memoizedState=null)}var ee=fu(p);if(ee!==null){ee.flags&=-257,pu(ee,p,w,c,t),ee.mode&1&&du(c,$,t),t=ee,E=$;var se=t.updateQueue;if(se===null){var re=new Set;re.add(E),t.updateQueue=re}else se.add(E);break e}else{if((t&1)===0){du(c,$,t),ya();break e}E=Error(a(426))}}else if(Fe&&w.mode&1){var Qe=fu(p);if(Qe!==null){(Qe.flags&65536)===0&&(Qe.flags|=256),pu(Qe,p,w,c,t),Ti(os(E,w));break e}}c=E=os(E,w),Ze!==4&&(Ze=2),nr===null?nr=[c]:nr.push(c),c=p;do{switch(c.tag){case 3:c.flags|=65536,t&=-t,c.lanes|=t;var _=cu(c,E,t);zc(c,_);break e;case 1:w=E;var P=c.type,R=c.stateNode;if((c.flags&128)===0&&(typeof P.getDerivedStateFromError=="function"||R!==null&&typeof R.componentDidCatch=="function"&&(hn===null||!hn.has(R)))){c.flags|=65536,t&=-t,c.lanes|=t;var Q=uu(c,w,t);zc(c,Q);break e}}c=c.return}while(c!==null)}Vu(n)}catch(ae){t=ae,Je===n&&n!==null&&(Je=n=n.return);continue}break}while(!0)}function Uu(){var e=il.current;return il.current=el,e===null?el:e}function ya(){(Ze===0||Ze===3||Ze===2)&&(Ze=4),et===null||(Ln&268435455)===0&&(al&268435455)===0||vn(et,rt)}function pl(e,t){var n=be;be|=2;var l=Uu();(et!==e||rt!==t)&&(Jt=null,In(e,t));do try{Qp();break}catch(o){Bu(e,o)}while(!0);if(Li(),be=n,il.current=l,Je!==null)throw Error(a(261));return et=null,rt=0,Ze}function Qp(){for(;Je!==null;)Wu(Je)}function Gp(){for(;Je!==null&&!jf();)Wu(Je)}function Wu(e){var t=qu(e.alternate,e,wt);e.memoizedProps=e.pendingProps,t===null?Vu(e):Je=t,ua.current=null}function Vu(e){var t=e;do{var n=t.alternate;if(e=t.return,(t.flags&32768)===0){if(n=Bp(n,t,wt),n!==null){Je=n;return}}else{if(n=Up(n,t),n!==null){n.flags&=32767,Je=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ze=6,Je=null;return}}if(t=t.sibling,t!==null){Je=t;return}Je=t=e}while(t!==null);Ze===0&&(Ze=5)}function On(e,t,n){var l=Ie,o=Pt.transition;try{Pt.transition=null,Ie=1,Jp(e,t,n,l)}finally{Pt.transition=o,Ie=l}return null}function Jp(e,t,n,l){do fs();while(mn!==null);if((be&6)!==0)throw Error(a(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(a(177));e.callbackNode=null,e.callbackPriority=0;var c=n.lanes|n.childLanes;if(Tf(e,c),e===et&&(Je=et=null,rt=0),(n.subtreeFlags&2064)===0&&(n.flags&2064)===0||cl||(cl=!0,Qu(vr,function(){return fs(),null})),c=(n.flags&15990)!==0,(n.subtreeFlags&15990)!==0||c){c=Pt.transition,Pt.transition=null;var p=Ie;Ie=1;var w=be;be|=4,ua.current=null,Vp(e,n),Iu(n,e),gp(yi),Sr=!!xi,yi=xi=null,e.current=n,Hp(n),kf(),be=w,Ie=p,Pt.transition=c}else e.current=n;if(cl&&(cl=!1,mn=e,ul=o),c=e.pendingLanes,c===0&&(hn=null),Sf(n.stateNode),gt(e,qe()),t!==null)for(l=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],l(o.value,{componentStack:o.stack,digest:o.digest});if(ol)throw ol=!1,e=pa,pa=null,e;return(ul&1)!==0&&e.tag!==0&&fs(),c=e.pendingLanes,(c&1)!==0?e===ha?sr++:(sr=0,ha=e):sr=0,un(),null}function fs(){if(mn!==null){var e=Lo(ul),t=Pt.transition,n=Ie;try{if(Pt.transition=null,Ie=16>e?16:e,mn===null)var l=!1;else{if(e=mn,mn=null,ul=0,(be&6)!==0)throw Error(a(331));var o=be;for(be|=4,ne=e.current;ne!==null;){var c=ne,p=c.child;if((ne.flags&16)!==0){var w=c.deletions;if(w!==null){for(var E=0;E<w.length;E++){var $=w[E];for(ne=$;ne!==null;){var V=ne;switch(V.tag){case 0:case 11:case 15:er(8,V,c)}var K=V.child;if(K!==null)K.return=V,ne=K;else for(;ne!==null;){V=ne;var U=V.sibling,ee=V.return;if(_u(V),V===$){ne=null;break}if(U!==null){U.return=ee,ne=U;break}ne=ee}}}var se=c.alternate;if(se!==null){var re=se.child;if(re!==null){se.child=null;do{var Qe=re.sibling;re.sibling=null,re=Qe}while(re!==null)}}ne=c}}if((c.subtreeFlags&2064)!==0&&p!==null)p.return=c,ne=p;else e:for(;ne!==null;){if(c=ne,(c.flags&2048)!==0)switch(c.tag){case 0:case 11:case 15:er(9,c,c.return)}var _=c.sibling;if(_!==null){_.return=c.return,ne=_;break e}ne=c.return}}var P=e.current;for(ne=P;ne!==null;){p=ne;var R=p.child;if((p.subtreeFlags&2064)!==0&&R!==null)R.return=p,ne=R;else e:for(p=P;ne!==null;){if(w=ne,(w.flags&2048)!==0)try{switch(w.tag){case 0:case 11:case 15:ll(9,w)}}catch(ae){He(w,w.return,ae)}if(w===p){ne=null;break e}var Q=w.sibling;if(Q!==null){Q.return=w.return,ne=Q;break e}ne=w.return}}if(be=o,un(),zt&&typeof zt.onPostCommitFiberRoot=="function")try{zt.onPostCommitFiberRoot(xr,e)}catch{}l=!0}return l}finally{Ie=n,Pt.transition=t}}return!1}function Hu(e,t,n){t=os(n,t),t=cu(e,t,1),e=fn(e,t,1),t=ut(),e!==null&&(Ps(e,1,t),gt(e,t))}function He(e,t,n){if(e.tag===3)Hu(e,e,n);else for(;t!==null;){if(t.tag===3){Hu(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(hn===null||!hn.has(l))){e=os(n,e),e=uu(t,e,1),t=fn(t,e,1),e=ut(),t!==null&&(Ps(t,1,e),gt(t,e));break}}t=t.return}}function Yp(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),t=ut(),e.pingedLanes|=e.suspendedLanes&n,et===e&&(rt&n)===n&&(Ze===4||Ze===3&&(rt&130023424)===rt&&500>qe()-fa?In(e,0):da|=n),gt(e,t)}function Ku(e,t){t===0&&((e.mode&1)===0?t=1:(t=jr,jr<<=1,(jr&130023424)===0&&(jr=4194304)));var n=ut();e=qt(e,t),e!==null&&(Ps(e,t,n),gt(e,n))}function Zp(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ku(e,n)}function Xp(e,t){var n=0;switch(e.tag){case 13:var l=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(a(314))}l!==null&&l.delete(t),Ku(e,n)}var qu;qu=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ft.current)ht=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return ht=!1,Fp(e,t,n);ht=(e.flags&131072)!==0}else ht=!1,Fe&&(t.flags&1048576)!==0&&Ec(t,Ur,t.index);switch(t.lanes=0,t.tag){case 2:var l=t.type;sl(e,t),e=t.pendingProps;var o=es(t,lt.current);is(t,n),o=Wi(null,t,l,e,o,n);var c=Vi();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,pt(l)?(c=!0,Dr(t)):c=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,zi(t),o.updater=tl,t.stateNode=o,o._reactInternals=t,Ji(t,l,e,n),t=ea(null,t,l,!0,c,n)):(t.tag=0,Fe&&c&&Ei(t),ct(null,t,o,n),t=t.child),t;case 16:l=t.elementType;e:{switch(sl(e,t),e=t.pendingProps,o=l._init,l=o(l._payload),t.type=l,o=t.tag=th(l),e=Lt(l,e),o){case 0:t=Xi(null,t,l,e,n);break e;case 1:t=yu(null,t,l,e,n);break e;case 11:t=hu(null,t,l,e,n);break e;case 14:t=mu(null,t,l,Lt(l.type,e),n);break e}throw Error(a(306,l,""))}return t;case 0:return l=t.type,o=t.pendingProps,o=t.elementType===l?o:Lt(l,o),Xi(e,t,l,o,n);case 1:return l=t.type,o=t.pendingProps,o=t.elementType===l?o:Lt(l,o),yu(e,t,l,o,n);case 3:e:{if(ju(t),e===null)throw Error(a(387));l=t.pendingProps,c=t.memoizedState,o=c.element,Oc(e,t),Qr(t,l,null,n);var p=t.memoizedState;if(l=p.element,c.isDehydrated)if(c={element:l,isDehydrated:!1,cache:p.cache,pendingSuspenseBoundaries:p.pendingSuspenseBoundaries,transitions:p.transitions},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){o=os(Error(a(423)),t),t=ku(e,t,l,n,o);break e}else if(l!==o){o=os(Error(a(424)),t),t=ku(e,t,l,n,o);break e}else for(kt=an(t.stateNode.containerInfo.firstChild),jt=t,Fe=!0,Rt=null,n=$c(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ss(),l===o){t=Gt(e,t,n);break e}ct(e,t,l,n)}t=t.child}return t;case 5:return Mc(t),e===null&&_i(t),l=t.type,o=t.pendingProps,c=e!==null?e.memoizedProps:null,p=o.children,ji(l,o)?p=null:c!==null&&ji(l,c)&&(t.flags|=32),xu(e,t),ct(e,t,p,n),t.child;case 6:return e===null&&_i(t),null;case 13:return wu(e,t,n);case 4:return Ai(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=rs(t,null,l,n):ct(e,t,l,n),t.child;case 11:return l=t.type,o=t.pendingProps,o=t.elementType===l?o:Lt(l,o),hu(e,t,l,o,n);case 7:return ct(e,t,t.pendingProps,n),t.child;case 8:return ct(e,t,t.pendingProps.children,n),t.child;case 12:return ct(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(l=t.type._context,o=t.pendingProps,c=t.memoizedProps,p=o.value,ze(Hr,l._currentValue),l._currentValue=p,c!==null)if(Tt(c.value,p)){if(c.children===o.children&&!ft.current){t=Gt(e,t,n);break e}}else for(c=t.child,c!==null&&(c.return=t);c!==null;){var w=c.dependencies;if(w!==null){p=c.child;for(var E=w.firstContext;E!==null;){if(E.context===l){if(c.tag===1){E=Qt(-1,n&-n),E.tag=2;var $=c.updateQueue;if($!==null){$=$.shared;var V=$.pending;V===null?E.next=E:(E.next=V.next,V.next=E),$.pending=E}}c.lanes|=n,E=c.alternate,E!==null&&(E.lanes|=n),Ii(c.return,n,t),w.lanes|=n;break}E=E.next}}else if(c.tag===10)p=c.type===t.type?null:c.child;else if(c.tag===18){if(p=c.return,p===null)throw Error(a(341));p.lanes|=n,w=p.alternate,w!==null&&(w.lanes|=n),Ii(p,n,t),p=c.sibling}else p=c.child;if(p!==null)p.return=c;else for(p=c;p!==null;){if(p===t){p=null;break}if(c=p.sibling,c!==null){c.return=p.return,p=c;break}p=p.return}c=p}ct(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,l=t.pendingProps.children,is(t,n),o=Ct(o),l=l(o),t.flags|=1,ct(e,t,l,n),t.child;case 14:return l=t.type,o=Lt(l,t.pendingProps),o=Lt(l.type,o),mu(e,t,l,o,n);case 15:return gu(e,t,t.type,t.pendingProps,n);case 17:return l=t.type,o=t.pendingProps,o=t.elementType===l?o:Lt(l,o),sl(e,t),t.tag=1,pt(l)?(e=!0,Dr(t)):e=!1,is(t,n),au(t,l,o),Ji(t,l,o,n),ea(null,t,l,!0,e,n);case 19:return Su(e,t,n);case 22:return vu(e,t,n)}throw Error(a(156,t.tag))};function Qu(e,t){return Po(e,t)}function eh(e,t,n,l){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=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function bt(e,t,n,l){return new eh(e,t,n,l)}function ja(e){return e=e.prototype,!(!e||!e.isReactComponent)}function th(e){if(typeof e=="function")return ja(e)?1:0;if(e!=null){if(e=e.$$typeof,e===te)return 11;if(e===ge)return 14}return 2}function xn(e,t){var n=e.alternate;return n===null?(n=bt(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 hl(e,t,n,l,o,c){var p=2;if(l=e,typeof e=="function")ja(e)&&(p=1);else if(typeof e=="string")p=5;else e:switch(e){case H:return zn(n.children,o,c,t);case L:p=8,o|=8;break;case F:return e=bt(12,n,t,o|2),e.elementType=F,e.lanes=c,e;case oe:return e=bt(13,n,t,o),e.elementType=oe,e.lanes=c,e;case ue:return e=bt(19,n,t,o),e.elementType=ue,e.lanes=c,e;case xe:return ml(n,o,c,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case O:p=10;break e;case J:p=9;break e;case te:p=11;break e;case ge:p=14;break e;case Ee:p=16,l=null;break e}throw Error(a(130,e==null?e:typeof e,""))}return t=bt(p,n,t,o),t.elementType=e,t.type=l,t.lanes=c,t}function zn(e,t,n,l){return e=bt(7,e,l,t),e.lanes=n,e}function ml(e,t,n,l){return e=bt(22,e,l,t),e.elementType=xe,e.lanes=n,e.stateNode={isHidden:!1},e}function ka(e,t,n){return e=bt(6,e,null,t),e.lanes=n,e}function wa(e,t,n){return t=bt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function nh(e,t,n,l,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=Gl(0),this.expirationTimes=Gl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gl(0),this.identifierPrefix=l,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Na(e,t,n,l,o,c,p,w,E){return e=new nh(e,t,n,w,E),t===1?(t=1,c===!0&&(t|=8)):t=0,c=bt(3,null,null,t),e.current=c,c.stateNode=e,c.memoizedState={element:l,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},zi(c),e}function sh(e,t,n){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Z,key:l==null?null:""+l,children:e,containerInfo:t,implementation:n}}function Gu(e){if(!e)return cn;e=e._reactInternals;e:{if(Sn(e)!==e||e.tag!==1)throw Error(a(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(pt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(a(171))}if(e.tag===1){var n=e.type;if(pt(n))return Nc(e,n,t)}return t}function Ju(e,t,n,l,o,c,p,w,E){return e=Na(n,l,!0,e,o,c,p,w,E),e.context=Gu(null),n=e.current,l=ut(),o=gn(n),c=Qt(l,o),c.callback=t??null,fn(n,c,o),e.current.lanes=o,Ps(e,o,l),gt(e,l),e}function gl(e,t,n,l){var o=t.current,c=ut(),p=gn(o);return n=Gu(n),t.context===null?t.context=n:t.pendingContext=n,t=Qt(c,p),t.payload={element:e},l=l===void 0?null:l,l!==null&&(t.callback=l),e=fn(o,t,p),e!==null&&(Ot(e,o,p,c),qr(e,o,p)),p}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 Yu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Sa(e,t){Yu(e,t),(e=e.alternate)&&Yu(e,t)}function rh(){return null}var Zu=typeof reportError=="function"?reportError:function(e){console.error(e)};function Ca(e){this._internalRoot=e}xl.prototype.render=Ca.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));gl(e,t,null,null)},xl.prototype.unmount=Ca.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;$n(function(){gl(null,e,null,null)}),t[Wt]=null}};function xl(e){this._internalRoot=e}xl.prototype.unstable_scheduleHydration=function(e){if(e){var t=Oo();e={blockedOn:null,target:e,priority:t};for(var n=0;n<sn.length&&t!==0&&t<sn[n].priority;n++);sn.splice(n,0,e),n===0&&Mo(e)}};function Ea(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function yl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Xu(){}function lh(e,t,n,l,o){if(o){if(typeof l=="function"){var c=l;l=function(){var $=vl(p);c.call($)}}var p=Ju(t,l,e,0,null,!1,!1,"",Xu);return e._reactRootContainer=p,e[Wt]=p.current,Bs(e.nodeType===8?e.parentNode:e),$n(),p}for(;o=e.lastChild;)e.removeChild(o);if(typeof l=="function"){var w=l;l=function(){var $=vl(E);w.call($)}}var E=Na(e,0,!1,null,null,!1,!1,"",Xu);return e._reactRootContainer=E,e[Wt]=E.current,Bs(e.nodeType===8?e.parentNode:e),$n(function(){gl(t,E,n,l)}),E}function jl(e,t,n,l,o){var c=n._reactRootContainer;if(c){var p=c;if(typeof o=="function"){var w=o;o=function(){var E=vl(p);w.call(E)}}gl(t,p,e,o)}else p=lh(n,t,e,o,l);return vl(p)}$o=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Es(t.pendingLanes);n!==0&&(Jl(t,n|1),gt(t,qe()),(be&6)===0&&(ds=qe()+500,un()))}break;case 13:$n(function(){var l=qt(e,1);if(l!==null){var o=ut();Ot(l,e,1,o)}}),Sa(e,1)}},Yl=function(e){if(e.tag===13){var t=qt(e,134217728);if(t!==null){var n=ut();Ot(t,e,134217728,n)}Sa(e,134217728)}},Io=function(e){if(e.tag===13){var t=gn(e),n=qt(e,t);if(n!==null){var l=ut();Ot(n,e,t,l)}Sa(e,t)}},Oo=function(){return Ie},zo=function(e,t){var n=Ie;try{return Ie=e,t()}finally{Ie=n}},Wl=function(e,t,n){switch(t){case"input":if(ve(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 l=n[t];if(l!==e&&l.form===e.form){var o=Ar(l);if(!o)throw Error(a(90));Ue(l),ve(l,o)}}}break;case"textarea":uo(e,n);break;case"select":t=n.value,t!=null&&Un(e,!!n.multiple,t,!1)}},jo=va,ko=$n;var ih={usingClientEntryPoint:!1,Events:[Vs,Zn,Ar,xo,yo,va]},rr={findFiberByHostInstance:Cn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ah={bundleType:rr.bundleType,version:rr.version,rendererPackageName:rr.rendererPackageName,rendererConfig:rr.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Y.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Co(e),e===null?null:e.stateNode},findFiberByHostInstance:rr.findFiberByHostInstance||rh,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 kl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!kl.isDisabled&&kl.supportsFiber)try{xr=kl.inject(ah),zt=kl}catch{}}return vt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ih,vt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ea(t))throw Error(a(200));return sh(e,t,null,n)},vt.createRoot=function(e,t){if(!Ea(e))throw Error(a(299));var n=!1,l="",o=Zu;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Na(e,1,!1,null,null,n,!1,l,o),e[Wt]=t.current,Bs(e.nodeType===8?e.parentNode:e),new Ca(t)},vt.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(a(188)):(e=Object.keys(e).join(","),Error(a(268,e)));return e=Co(t),e=e===null?null:e.stateNode,e},vt.flushSync=function(e){return $n(e)},vt.hydrate=function(e,t,n){if(!yl(t))throw Error(a(200));return jl(null,e,t,!0,n)},vt.hydrateRoot=function(e,t,n){if(!Ea(e))throw Error(a(405));var l=n!=null&&n.hydratedSources||null,o=!1,c="",p=Zu;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(c=n.identifierPrefix),n.onRecoverableError!==void 0&&(p=n.onRecoverableError)),t=Ju(t,null,e,1,n??null,o,!1,c,p),e[Wt]=t.current,Bs(e),l)for(e=0;e<l.length;e++)n=l[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new xl(t)},vt.render=function(e,t,n){if(!yl(t))throw Error(a(200));return jl(null,e,t,!1,n)},vt.unmountComponentAtNode=function(e){if(!yl(e))throw Error(a(40));return e._reactRootContainer?($n(function(){jl(null,null,e,!1,function(){e._reactRootContainer=null,e[Wt]=null})}),!0):!1},vt.unstable_batchedUpdates=va,vt.unstable_renderSubtreeIntoContainer=function(e,t,n,l){if(!yl(n))throw Error(a(200));if(e==null||e._reactInternals===void 0)throw Error(a(38));return jl(e,t,n,!1,l)},vt.version="18.3.1-next-f1338f8080-20240426",vt}var ad;function _d(){if(ad)return _a.exports;ad=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(i){console.error(i)}}return r(),_a.exports=yh(),_a.exports}var od;function jh(){if(od)return wl;od=1;var r=_d();return wl.createRoot=r.createRoot,wl.hydrateRoot=r.hydrateRoot,wl}var kh=jh();_d();/**
|
|
40
|
+
`+c.stack}return{value:e,source:t,stack:o,digest:null}}function Yi(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Zi(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Ap=typeof WeakMap=="function"?WeakMap:Map;function cu(e,t,n){n=Qt(-1,n),n.tag=3,n.payload={element:null};var l=t.value;return n.callback=function(){ol||(ol=!0,pa=l),Zi(e,t)},n}function uu(e,t,n){n=Qt(-1,n),n.tag=3;var l=e.type.getDerivedStateFromError;if(typeof l=="function"){var o=t.value;n.payload=function(){return l(o)},n.callback=function(){Zi(e,t)}}var c=e.stateNode;return c!==null&&typeof c.componentDidCatch=="function"&&(n.callback=function(){Zi(e,t),typeof l!="function"&&(hn===null?hn=new Set([this]):hn.add(this));var p=t.stack;this.componentDidCatch(t.value,{componentStack:p!==null?p:""})}),n}function du(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new Ap;var o=new Set;l.set(t,o)}else o=l.get(t),o===void 0&&(o=new Set,l.set(t,o));o.has(n)||(o.add(n),e=Yp.bind(null,e,t,n),t.then(e,e))}function fu(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 pu(e,t,n,l,o){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Qt(-1,1),t.tag=2,fn(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var Mp=Y.ReactCurrentOwner,ht=!1;function ct(e,t,n,l){t.child=e===null?$c(t,null,n,l):ls(t,e.child,n,l)}function hu(e,t,n,l,o){n=n.render;var c=t.ref;return as(t,o),l=Wi(e,t,n,l,c,o),n=Vi(),e!==null&&!ht?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Gt(e,t,o)):(Fe&&n&&Ei(t),t.flags|=1,ct(e,t,l,o),t.child)}function mu(e,t,n,l,o){if(e===null){var c=n.type;return typeof c=="function"&&!ja(c)&&c.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=c,gu(e,t,c,l,o)):(e=hl(n.type,null,l,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,(e.lanes&o)===0){var p=c.memoizedProps;if(n=n.compare,n=n!==null?n:Ms,n(p,l)&&e.ref===t.ref)return Gt(e,t,o)}return t.flags|=1,e=xn(c,l),e.ref=t.ref,e.return=t,t.child=e}function gu(e,t,n,l,o){if(e!==null){var c=e.memoizedProps;if(Ms(c,l)&&e.ref===t.ref)if(ht=!1,t.pendingProps=l=c,(e.lanes&o)!==0)(e.flags&131072)!==0&&(ht=!0);else return t.lanes=e.lanes,Gt(e,t,o)}return Xi(e,t,n,l,o)}function vu(e,t,n){var l=t.pendingProps,o=l.children,c=e!==null?e.memoizedState:null;if(l.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ze(ds,wt),wt|=n;else{if((n&1073741824)===0)return e=c!==null?c.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ze(ds,wt),wt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=c!==null?c.baseLanes:n,ze(ds,wt),wt|=l}else c!==null?(l=c.baseLanes|n,t.memoizedState=null):l=n,ze(ds,wt),wt|=l;return ct(e,t,o,n),t.child}function xu(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Xi(e,t,n,l,o){var c=pt(n)?Pn:lt.current;return c=ts(t,c),as(t,o),n=Wi(e,t,n,l,c,o),l=Vi(),e!==null&&!ht?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Gt(e,t,o)):(Fe&&l&&Ei(t),t.flags|=1,ct(e,t,n,o),t.child)}function yu(e,t,n,l,o){if(pt(n)){var c=!0;Dr(t)}else c=!1;if(as(t,o),t.stateNode===null)sl(e,t),au(t,n,l),Ji(t,n,l,o),l=!0;else if(e===null){var p=t.stateNode,N=t.memoizedProps;p.props=N;var C=p.context,I=n.contextType;typeof I=="object"&&I!==null?I=Ct(I):(I=pt(n)?Pn:lt.current,I=ts(t,I));var V=n.getDerivedStateFromProps,K=typeof V=="function"||typeof p.getSnapshotBeforeUpdate=="function";K||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(N!==l||C!==I)&&ou(t,p,l,I),dn=!1;var U=t.memoizedState;p.state=U,Qr(t,l,p,o),C=t.memoizedState,N!==l||U!==C||ft.current||dn?(typeof V=="function"&&(Gi(t,n,V,l),C=t.memoizedState),(N=dn||iu(t,n,N,l,U,C,I))?(K||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount()),typeof p.componentDidMount=="function"&&(t.flags|=4194308)):(typeof p.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=C),p.props=l,p.state=C,p.context=I,l=N):(typeof p.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{p=t.stateNode,Oc(e,t),N=t.memoizedProps,I=t.type===t.elementType?N:Lt(t.type,N),p.props=I,K=t.pendingProps,U=p.context,C=n.contextType,typeof C=="object"&&C!==null?C=Ct(C):(C=pt(n)?Pn:lt.current,C=ts(t,C));var ee=n.getDerivedStateFromProps;(V=typeof ee=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(N!==K||U!==C)&&ou(t,p,l,C),dn=!1,U=t.memoizedState,p.state=U,Qr(t,l,p,o);var se=t.memoizedState;N!==K||U!==se||ft.current||dn?(typeof ee=="function"&&(Gi(t,n,ee,l),se=t.memoizedState),(I=dn||iu(t,n,I,l,U,se,C)||!1)?(V||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(l,se,C),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(l,se,C)),typeof p.componentDidUpdate=="function"&&(t.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof p.componentDidUpdate!="function"||N===e.memoizedProps&&U===e.memoizedState||(t.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||N===e.memoizedProps&&U===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=se),p.props=l,p.state=se,p.context=C,l=I):(typeof p.componentDidUpdate!="function"||N===e.memoizedProps&&U===e.memoizedState||(t.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||N===e.memoizedProps&&U===e.memoizedState||(t.flags|=1024),l=!1)}return ea(e,t,n,l,c,o)}function ea(e,t,n,l,o,c){xu(e,t);var p=(t.flags&128)!==0;if(!l&&!p)return o&&Sc(t,n,!1),Gt(e,t,c);l=t.stateNode,Mp.current=t;var N=p&&typeof n.getDerivedStateFromError!="function"?null:l.render();return t.flags|=1,e!==null&&p?(t.child=ls(t,e.child,null,c),t.child=ls(t,null,N,c)):ct(e,t,N,c),t.memoizedState=l.state,o&&Sc(t,n,!0),t.child}function ju(e){var t=e.stateNode;t.pendingContext?wc(e,t.pendingContext,t.pendingContext!==t.context):t.context&&wc(e,t.context,!1),Ai(e,t.containerInfo)}function ku(e,t,n,l,o){return rs(),Ti(o),t.flags|=256,ct(e,t,n,l),t.child}var ta={dehydrated:null,treeContext:null,retryLane:0};function na(e){return{baseLanes:e,cachePool:null,transitions:null}}function wu(e,t,n){var l=t.pendingProps,o=We.current,c=!1,p=(t.flags&128)!==0,N;if((N=p)||(N=e!==null&&e.memoizedState===null?!1:(o&2)!==0),N?(c=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),ze(We,o&1),e===null)return _i(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(p=l.children,e=l.fallback,c?(l=t.mode,c=t.child,p={mode:"hidden",children:p},(l&1)===0&&c!==null?(c.childLanes=0,c.pendingProps=p):c=ml(p,l,0,null),e=An(e,l,n,null),c.return=t,e.return=t,c.sibling=e,t.child=c,t.child.memoizedState=na(n),t.memoizedState=ta,e):sa(t,p));if(o=e.memoizedState,o!==null&&(N=o.dehydrated,N!==null))return Dp(e,t,p,l,N,o,n);if(c){c=l.fallback,p=t.mode,o=e.child,N=o.sibling;var C={mode:"hidden",children:l.children};return(p&1)===0&&t.child!==o?(l=t.child,l.childLanes=0,l.pendingProps=C,t.deletions=null):(l=xn(o,C),l.subtreeFlags=o.subtreeFlags&14680064),N!==null?c=xn(N,c):(c=An(c,p,n,null),c.flags|=2),c.return=t,l.return=t,l.sibling=c,t.child=l,l=c,c=t.child,p=e.child.memoizedState,p=p===null?na(n):{baseLanes:p.baseLanes|n,cachePool:null,transitions:p.transitions},c.memoizedState=p,c.childLanes=e.childLanes&~n,t.memoizedState=ta,l}return c=e.child,e=c.sibling,l=xn(c,{mode:"visible",children:l.children}),(t.mode&1)===0&&(l.lanes=n),l.return=t,l.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=l,t.memoizedState=null,l}function sa(e,t){return t=ml({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function nl(e,t,n,l){return l!==null&&Ti(l),ls(t,e.child,null,n),e=sa(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Dp(e,t,n,l,o,c,p){if(n)return t.flags&256?(t.flags&=-257,l=Yi(Error(a(422))),nl(e,t,p,l)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(c=l.fallback,o=t.mode,l=ml({mode:"visible",children:l.children},o,0,null),c=An(c,o,p,null),c.flags|=2,l.return=t,c.return=t,l.sibling=c,t.child=l,(t.mode&1)!==0&&ls(t,e.child,null,p),t.child.memoizedState=na(p),t.memoizedState=ta,c);if((t.mode&1)===0)return nl(e,t,p,null);if(o.data==="$!"){if(l=o.nextSibling&&o.nextSibling.dataset,l)var N=l.dgst;return l=N,c=Error(a(419)),l=Yi(c,l,void 0),nl(e,t,p,l)}if(N=(p&e.childLanes)!==0,ht||N){if(l=et,l!==null){switch(p&-p){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&(l.suspendedLanes|p))!==0?0:o,o!==0&&o!==c.retryLane&&(c.retryLane=o,qt(e,o),Ot(l,e,o,-1))}return ya(),l=Yi(Error(a(421))),nl(e,t,p,l)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=Zp.bind(null,e),o._reactRetry=t,null):(e=c.treeContext,kt=an(o.nextSibling),jt=t,Fe=!0,Rt=null,e!==null&&(Nt[St++]=Ht,Nt[St++]=Kt,Nt[St++]=bn,Ht=e.id,Kt=e.overflow,bn=t),t=sa(t,l.children),t.flags|=4096,t)}function Nu(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),Ii(e.return,t,n)}function ra(e,t,n,l,o){var c=e.memoizedState;c===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:o}:(c.isBackwards=t,c.rendering=null,c.renderingStartTime=0,c.last=l,c.tail=n,c.tailMode=o)}function Su(e,t,n){var l=t.pendingProps,o=l.revealOrder,c=l.tail;if(ct(e,t,l.children,n),l=We.current,(l&2)!==0)l=l&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Nu(e,n,t);else if(e.tag===19)Nu(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}l&=1}if(ze(We,l),(t.mode&1)===0)t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&Gr(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),ra(t,!1,o,n,c);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Gr(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}ra(t,!0,n,null,c);break;case"together":ra(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function sl(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Gt(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),$n|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(a(153));if(t.child!==null){for(e=t.child,n=xn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=xn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Fp(e,t,n){switch(t.tag){case 3:ju(t),rs();break;case 5:Mc(t);break;case 1:pt(t.type)&&Dr(t);break;case 4:Ai(t,t.stateNode.containerInfo);break;case 10:var l=t.type._context,o=t.memoizedProps.value;ze(Hr,l._currentValue),l._currentValue=o;break;case 13:if(l=t.memoizedState,l!==null)return l.dehydrated!==null?(ze(We,We.current&1),t.flags|=128,null):(n&t.child.childLanes)!==0?wu(e,t,n):(ze(We,We.current&1),e=Gt(e,t,n),e!==null?e.sibling:null);ze(We,We.current&1);break;case 19:if(l=(n&t.childLanes)!==0,(e.flags&128)!==0){if(l)return Su(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ze(We,We.current),l)break;return null;case 22:case 23:return t.lanes=0,vu(e,t,n)}return Gt(e,t,n)}var Cu,la,Eu,Pu;Cu=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}},la=function(){},Eu=function(e,t,n,l){var o=e.memoizedProps;if(o!==l){e=t.stateNode,Rn(Mt.current);var c=null;switch(n){case"input":o=he(e,o),l=he(e,l),c=[];break;case"select":o=X({},o,{value:void 0}),l=X({},l,{value:void 0}),c=[];break;case"textarea":o=Al(e,o),l=Al(e,l),c=[];break;default:typeof o.onClick!="function"&&typeof l.onClick=="function"&&(e.onclick=zr)}Dl(n,l);var p;n=null;for(I in o)if(!l.hasOwnProperty(I)&&o.hasOwnProperty(I)&&o[I]!=null)if(I==="style"){var N=o[I];for(p in N)N.hasOwnProperty(p)&&(n||(n={}),n[p]="")}else I!=="dangerouslySetInnerHTML"&&I!=="children"&&I!=="suppressContentEditableWarning"&&I!=="suppressHydrationWarning"&&I!=="autoFocus"&&(d.hasOwnProperty(I)?c||(c=[]):(c=c||[]).push(I,null));for(I in l){var C=l[I];if(N=o!=null?o[I]:void 0,l.hasOwnProperty(I)&&C!==N&&(C!=null||N!=null))if(I==="style")if(N){for(p in N)!N.hasOwnProperty(p)||C&&C.hasOwnProperty(p)||(n||(n={}),n[p]="");for(p in C)C.hasOwnProperty(p)&&N[p]!==C[p]&&(n||(n={}),n[p]=C[p])}else n||(c||(c=[]),c.push(I,n)),n=C;else I==="dangerouslySetInnerHTML"?(C=C?C.__html:void 0,N=N?N.__html:void 0,C!=null&&N!==C&&(c=c||[]).push(I,C)):I==="children"?typeof C!="string"&&typeof C!="number"||(c=c||[]).push(I,""+C):I!=="suppressContentEditableWarning"&&I!=="suppressHydrationWarning"&&(d.hasOwnProperty(I)?(C!=null&&I==="onScroll"&&Ae("scroll",e),c||N===C||(c=[])):(c=c||[]).push(I,C))}n&&(c=c||[]).push("style",n);var I=c;(t.updateQueue=I)&&(t.flags|=4)}},Pu=function(e,t,n,l){n!==l&&(t.flags|=4)};function Xs(e,t){if(!Fe)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 l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function at(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,l=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,l|=o.subtreeFlags&14680064,l|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,l|=o.subtreeFlags,l|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function Bp(e,t,n){var l=t.pendingProps;switch(Pi(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return at(t),null;case 1:return pt(t.type)&&Mr(),at(t),null;case 3:return l=t.stateNode,os(),Me(ft),Me(lt),Fi(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Wr(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Rt!==null&&(ga(Rt),Rt=null))),la(e,t),at(t),null;case 5:Mi(t);var o=Rn(Qs.current);if(n=t.type,e!==null&&t.stateNode!=null)Eu(e,t,n,l,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!l){if(t.stateNode===null)throw Error(a(166));return at(t),null}if(e=Rn(Mt.current),Wr(t)){l=t.stateNode,n=t.type;var c=t.memoizedProps;switch(l[At]=t,l[Ws]=c,e=(t.mode&1)!==0,n){case"dialog":Ae("cancel",l),Ae("close",l);break;case"iframe":case"object":case"embed":Ae("load",l);break;case"video":case"audio":for(o=0;o<Fs.length;o++)Ae(Fs[o],l);break;case"source":Ae("error",l);break;case"img":case"image":case"link":Ae("error",l),Ae("load",l);break;case"details":Ae("toggle",l);break;case"input":ce(l,c),Ae("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!c.multiple},Ae("invalid",l);break;case"textarea":co(l,c),Ae("invalid",l)}Dl(n,c),o=null;for(var p in c)if(c.hasOwnProperty(p)){var N=c[p];p==="children"?typeof N=="string"?l.textContent!==N&&(c.suppressHydrationWarning!==!0&&Or(l.textContent,N,e),o=["children",N]):typeof N=="number"&&l.textContent!==""+N&&(c.suppressHydrationWarning!==!0&&Or(l.textContent,N,e),o=["children",""+N]):d.hasOwnProperty(p)&&N!=null&&p==="onScroll"&&Ae("scroll",l)}switch(n){case"input":pe(l),De(l,c,!0);break;case"textarea":pe(l),fo(l);break;case"select":case"option":break;default:typeof c.onClick=="function"&&(l.onclick=zr)}l=o,t.updateQueue=l,l!==null&&(t.flags|=4)}else{p=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=po(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=p.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof l.is=="string"?e=p.createElement(n,{is:l.is}):(e=p.createElement(n),n==="select"&&(p=e,l.multiple?p.multiple=!0:l.size&&(p.size=l.size))):e=p.createElementNS(e,n),e[At]=t,e[Ws]=l,Cu(e,t,!1,!1),t.stateNode=e;e:{switch(p=Fl(n,l),n){case"dialog":Ae("cancel",e),Ae("close",e),o=l;break;case"iframe":case"object":case"embed":Ae("load",e),o=l;break;case"video":case"audio":for(o=0;o<Fs.length;o++)Ae(Fs[o],e);o=l;break;case"source":Ae("error",e),o=l;break;case"img":case"image":case"link":Ae("error",e),Ae("load",e),o=l;break;case"details":Ae("toggle",e),o=l;break;case"input":ce(e,l),o=he(e,l),Ae("invalid",e);break;case"option":o=l;break;case"select":e._wrapperState={wasMultiple:!!l.multiple},o=X({},l,{value:void 0}),Ae("invalid",e);break;case"textarea":co(e,l),o=Al(e,l),Ae("invalid",e);break;default:o=l}Dl(n,o),N=o;for(c in N)if(N.hasOwnProperty(c)){var C=N[c];c==="style"?go(e,C):c==="dangerouslySetInnerHTML"?(C=C?C.__html:void 0,C!=null&&ho(e,C)):c==="children"?typeof C=="string"?(n!=="textarea"||C!=="")&&ks(e,C):typeof C=="number"&&ks(e,""+C):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(d.hasOwnProperty(c)?C!=null&&c==="onScroll"&&Ae("scroll",e):C!=null&&A(e,c,C,p))}switch(n){case"input":pe(e),De(e,l,!1);break;case"textarea":pe(e),fo(e);break;case"option":l.value!=null&&e.setAttribute("value",""+Ne(l.value));break;case"select":e.multiple=!!l.multiple,c=l.value,c!=null?Wn(e,!!l.multiple,c,!1):l.defaultValue!=null&&Wn(e,!!l.multiple,l.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=zr)}switch(n){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}}l&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return at(t),null;case 6:if(e&&t.stateNode!=null)Pu(e,t,e.memoizedProps,l);else{if(typeof l!="string"&&t.stateNode===null)throw Error(a(166));if(n=Rn(Qs.current),Rn(Mt.current),Wr(t)){if(l=t.stateNode,n=t.memoizedProps,l[At]=t,(c=l.nodeValue!==n)&&(e=jt,e!==null))switch(e.tag){case 3:Or(l.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Or(l.nodeValue,n,(e.mode&1)!==0)}c&&(t.flags|=4)}else l=(n.nodeType===9?n:n.ownerDocument).createTextNode(l),l[At]=t,t.stateNode=l}return at(t),null;case 13:if(Me(We),l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Fe&&kt!==null&&(t.mode&1)!==0&&(t.flags&128)===0)Tc(),rs(),t.flags|=98560,c=!1;else if(c=Wr(t),l!==null&&l.dehydrated!==null){if(e===null){if(!c)throw Error(a(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(a(317));c[At]=t}else rs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;at(t),c=!1}else Rt!==null&&(ga(Rt),Rt=null),c=!0;if(!c)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=n,t):(l=l!==null,l!==(e!==null&&e.memoizedState!==null)&&l&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(We.current&1)!==0?Ze===0&&(Ze=3):ya())),t.updateQueue!==null&&(t.flags|=4),at(t),null);case 4:return os(),la(e,t),e===null&&Bs(t.stateNode.containerInfo),at(t),null;case 10:return $i(t.type._context),at(t),null;case 17:return pt(t.type)&&Mr(),at(t),null;case 19:if(Me(We),c=t.memoizedState,c===null)return at(t),null;if(l=(t.flags&128)!==0,p=c.rendering,p===null)if(l)Xs(c,!1);else{if(Ze!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(p=Gr(e),p!==null){for(t.flags|=128,Xs(c,!1),l=p.updateQueue,l!==null&&(t.updateQueue=l,t.flags|=4),t.subtreeFlags=0,l=n,n=t.child;n!==null;)c=n,e=l,c.flags&=14680066,p=c.alternate,p===null?(c.childLanes=0,c.lanes=e,c.child=null,c.subtreeFlags=0,c.memoizedProps=null,c.memoizedState=null,c.updateQueue=null,c.dependencies=null,c.stateNode=null):(c.childLanes=p.childLanes,c.lanes=p.lanes,c.child=p.child,c.subtreeFlags=0,c.deletions=null,c.memoizedProps=p.memoizedProps,c.memoizedState=p.memoizedState,c.updateQueue=p.updateQueue,c.type=p.type,e=p.dependencies,c.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ze(We,We.current&1|2),t.child}e=e.sibling}c.tail!==null&&qe()>fs&&(t.flags|=128,l=!0,Xs(c,!1),t.lanes=4194304)}else{if(!l)if(e=Gr(p),e!==null){if(t.flags|=128,l=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Xs(c,!0),c.tail===null&&c.tailMode==="hidden"&&!p.alternate&&!Fe)return at(t),null}else 2*qe()-c.renderingStartTime>fs&&n!==1073741824&&(t.flags|=128,l=!0,Xs(c,!1),t.lanes=4194304);c.isBackwards?(p.sibling=t.child,t.child=p):(n=c.last,n!==null?n.sibling=p:t.child=p,c.last=p)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=qe(),t.sibling=null,n=We.current,ze(We,l?n&1|2:n&1),t):(at(t),null);case 22:case 23:return xa(),l=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(t.flags|=8192),l&&(t.mode&1)!==0?(wt&1073741824)!==0&&(at(t),t.subtreeFlags&6&&(t.flags|=8192)):at(t),null;case 24:return null;case 25:return null}throw Error(a(156,t.tag))}function Up(e,t){switch(Pi(t),t.tag){case 1:return pt(t.type)&&Mr(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return os(),Me(ft),Me(lt),Fi(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Mi(t),null;case 13:if(Me(We),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));rs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Me(We),null;case 4:return os(),null;case 10:return $i(t.type._context),null;case 22:case 23:return xa(),null;case 24:return null;default:return null}}var rl=!1,ot=!1,Wp=typeof WeakSet=="function"?WeakSet:Set,ne=null;function us(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(l){He(e,t,l)}else n.current=null}function ia(e,t,n){try{n()}catch(l){He(e,t,l)}}var bu=!1;function Vp(e,t){if(xi=Sr,e=ic(),ui(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var o=l.anchorOffset,c=l.focusNode;l=l.focusOffset;try{n.nodeType,c.nodeType}catch{n=null;break e}var p=0,N=-1,C=-1,I=0,V=0,K=e,U=null;t:for(;;){for(var ee;K!==n||o!==0&&K.nodeType!==3||(N=p+o),K!==c||l!==0&&K.nodeType!==3||(C=p+l),K.nodeType===3&&(p+=K.nodeValue.length),(ee=K.firstChild)!==null;)U=K,K=ee;for(;;){if(K===e)break t;if(U===n&&++I===o&&(N=p),U===c&&++V===l&&(C=p),(ee=K.nextSibling)!==null)break;K=U,U=K.parentNode}K=ee}n=N===-1||C===-1?null:{start:N,end:C}}else n=null}n=n||{start:0,end:0}}else n=null;for(yi={focusedElem:e,selectionRange:n},Sr=!1,ne=t;ne!==null;)if(t=ne,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ne=e;else for(;ne!==null;){t=ne;try{var se=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(se!==null){var re=se.memoizedProps,Qe=se.memoizedState,T=t.stateNode,E=T.getSnapshotBeforeUpdate(t.elementType===t.type?re:Lt(t.type,re),Qe);T.__reactInternalSnapshotBeforeUpdate=E}break;case 3:var R=t.stateNode.containerInfo;R.nodeType===1?R.textContent="":R.nodeType===9&&R.documentElement&&R.removeChild(R.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(Q){He(t,t.return,Q)}if(e=t.sibling,e!==null){e.return=t.return,ne=e;break}ne=t.return}return se=bu,bu=!1,se}function er(e,t,n){var l=t.updateQueue;if(l=l!==null?l.lastEffect:null,l!==null){var o=l=l.next;do{if((o.tag&e)===e){var c=o.destroy;o.destroy=void 0,c!==void 0&&ia(t,n,c)}o=o.next}while(o!==l)}}function ll(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 l=n.create;n.destroy=l()}n=n.next}while(n!==t)}}function aa(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 _u(e){var t=e.alternate;t!==null&&(e.alternate=null,_u(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[At],delete t[Ws],delete t[Ni],delete t[Ep],delete t[Pp])),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 Tu(e){return e.tag===5||e.tag===3||e.tag===4}function Ru(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Tu(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 oa(e,t,n){var l=e.tag;if(l===5||l===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=zr));else if(l!==4&&(e=e.child,e!==null))for(oa(e,t,n),e=e.sibling;e!==null;)oa(e,t,n),e=e.sibling}function ca(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(l!==4&&(e=e.child,e!==null))for(ca(e,t,n),e=e.sibling;e!==null;)ca(e,t,n),e=e.sibling}var st=null,$t=!1;function pn(e,t,n){for(n=n.child;n!==null;)Lu(e,t,n),n=n.sibling}function Lu(e,t,n){if(zt&&typeof zt.onCommitFiberUnmount=="function")try{zt.onCommitFiberUnmount(xr,n)}catch{}switch(n.tag){case 5:ot||us(n,t);case 6:var l=st,o=$t;st=null,pn(e,t,n),st=l,$t=o,st!==null&&($t?(e=st,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):st.removeChild(n.stateNode));break;case 18:st!==null&&($t?(e=st,n=n.stateNode,e.nodeType===8?wi(e.parentNode,n):e.nodeType===1&&wi(e,n),Ls(e)):wi(st,n.stateNode));break;case 4:l=st,o=$t,st=n.stateNode.containerInfo,$t=!0,pn(e,t,n),st=l,$t=o;break;case 0:case 11:case 14:case 15:if(!ot&&(l=n.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){o=l=l.next;do{var c=o,p=c.destroy;c=c.tag,p!==void 0&&((c&2)!==0||(c&4)!==0)&&ia(n,t,p),o=o.next}while(o!==l)}pn(e,t,n);break;case 1:if(!ot&&(us(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=n.memoizedProps,l.state=n.memoizedState,l.componentWillUnmount()}catch(N){He(n,t,N)}pn(e,t,n);break;case 21:pn(e,t,n);break;case 22:n.mode&1?(ot=(l=ot)||n.memoizedState!==null,pn(e,t,n),ot=l):pn(e,t,n);break;default:pn(e,t,n)}}function $u(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Wp),t.forEach(function(l){var o=Xp.bind(null,e,l);n.has(l)||(n.add(l),l.then(o,o))})}}function It(e,t){var n=t.deletions;if(n!==null)for(var l=0;l<n.length;l++){var o=n[l];try{var c=e,p=t,N=p;e:for(;N!==null;){switch(N.tag){case 5:st=N.stateNode,$t=!1;break e;case 3:st=N.stateNode.containerInfo,$t=!0;break e;case 4:st=N.stateNode.containerInfo,$t=!0;break e}N=N.return}if(st===null)throw Error(a(160));Lu(c,p,o),st=null,$t=!1;var C=o.alternate;C!==null&&(C.return=null),o.return=null}catch(I){He(o,t,I)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Iu(t,e),t=t.sibling}function Iu(e,t){var n=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(It(t,e),Ft(e),l&4){try{er(3,e,e.return),ll(3,e)}catch(re){He(e,e.return,re)}try{er(5,e,e.return)}catch(re){He(e,e.return,re)}}break;case 1:It(t,e),Ft(e),l&512&&n!==null&&us(n,n.return);break;case 5:if(It(t,e),Ft(e),l&512&&n!==null&&us(n,n.return),e.flags&32){var o=e.stateNode;try{ks(o,"")}catch(re){He(e,e.return,re)}}if(l&4&&(o=e.stateNode,o!=null)){var c=e.memoizedProps,p=n!==null?n.memoizedProps:c,N=e.type,C=e.updateQueue;if(e.updateQueue=null,C!==null)try{N==="input"&&c.type==="radio"&&c.name!=null&&me(o,c),Fl(N,p);var I=Fl(N,c);for(p=0;p<C.length;p+=2){var V=C[p],K=C[p+1];V==="style"?go(o,K):V==="dangerouslySetInnerHTML"?ho(o,K):V==="children"?ks(o,K):A(o,V,K,I)}switch(N){case"input":ve(o,c);break;case"textarea":uo(o,c);break;case"select":var U=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!c.multiple;var ee=c.value;ee!=null?Wn(o,!!c.multiple,ee,!1):U!==!!c.multiple&&(c.defaultValue!=null?Wn(o,!!c.multiple,c.defaultValue,!0):Wn(o,!!c.multiple,c.multiple?[]:"",!1))}o[Ws]=c}catch(re){He(e,e.return,re)}}break;case 6:if(It(t,e),Ft(e),l&4){if(e.stateNode===null)throw Error(a(162));o=e.stateNode,c=e.memoizedProps;try{o.nodeValue=c}catch(re){He(e,e.return,re)}}break;case 3:if(It(t,e),Ft(e),l&4&&n!==null&&n.memoizedState.isDehydrated)try{Ls(t.containerInfo)}catch(re){He(e,e.return,re)}break;case 4:It(t,e),Ft(e);break;case 13:It(t,e),Ft(e),o=e.child,o.flags&8192&&(c=o.memoizedState!==null,o.stateNode.isHidden=c,!c||o.alternate!==null&&o.alternate.memoizedState!==null||(fa=qe())),l&4&&$u(e);break;case 22:if(V=n!==null&&n.memoizedState!==null,e.mode&1?(ot=(I=ot)||V,It(t,e),ot=I):It(t,e),Ft(e),l&8192){if(I=e.memoizedState!==null,(e.stateNode.isHidden=I)&&!V&&(e.mode&1)!==0)for(ne=e,V=e.child;V!==null;){for(K=ne=V;ne!==null;){switch(U=ne,ee=U.child,U.tag){case 0:case 11:case 14:case 15:er(4,U,U.return);break;case 1:us(U,U.return);var se=U.stateNode;if(typeof se.componentWillUnmount=="function"){l=U,n=U.return;try{t=l,se.props=t.memoizedProps,se.state=t.memoizedState,se.componentWillUnmount()}catch(re){He(l,n,re)}}break;case 5:us(U,U.return);break;case 22:if(U.memoizedState!==null){Au(K);continue}}ee!==null?(ee.return=U,ne=ee):Au(K)}V=V.sibling}e:for(V=null,K=e;;){if(K.tag===5){if(V===null){V=K;try{o=K.stateNode,I?(c=o.style,typeof c.setProperty=="function"?c.setProperty("display","none","important"):c.display="none"):(N=K.stateNode,C=K.memoizedProps.style,p=C!=null&&C.hasOwnProperty("display")?C.display:null,N.style.display=mo("display",p))}catch(re){He(e,e.return,re)}}}else if(K.tag===6){if(V===null)try{K.stateNode.nodeValue=I?"":K.memoizedProps}catch(re){He(e,e.return,re)}}else if((K.tag!==22&&K.tag!==23||K.memoizedState===null||K===e)&&K.child!==null){K.child.return=K,K=K.child;continue}if(K===e)break e;for(;K.sibling===null;){if(K.return===null||K.return===e)break e;V===K&&(V=null),K=K.return}V===K&&(V=null),K.sibling.return=K.return,K=K.sibling}}break;case 19:It(t,e),Ft(e),l&4&&$u(e);break;case 21:break;default:It(t,e),Ft(e)}}function Ft(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Tu(n)){var l=n;break e}n=n.return}throw Error(a(160))}switch(l.tag){case 5:var o=l.stateNode;l.flags&32&&(ks(o,""),l.flags&=-33);var c=Ru(e);ca(e,c,o);break;case 3:case 4:var p=l.stateNode.containerInfo,N=Ru(e);oa(e,N,p);break;default:throw Error(a(161))}}catch(C){He(e,e.return,C)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Hp(e,t,n){ne=e,Ou(e)}function Ou(e,t,n){for(var l=(e.mode&1)!==0;ne!==null;){var o=ne,c=o.child;if(o.tag===22&&l){var p=o.memoizedState!==null||rl;if(!p){var N=o.alternate,C=N!==null&&N.memoizedState!==null||ot;N=rl;var I=ot;if(rl=p,(ot=C)&&!I)for(ne=o;ne!==null;)p=ne,C=p.child,p.tag===22&&p.memoizedState!==null?Mu(o):C!==null?(C.return=p,ne=C):Mu(o);for(;c!==null;)ne=c,Ou(c),c=c.sibling;ne=o,rl=N,ot=I}zu(e)}else(o.subtreeFlags&8772)!==0&&c!==null?(c.return=o,ne=c):zu(e)}}function zu(e){for(;ne!==null;){var t=ne;if((t.flags&8772)!==0){var n=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:ot||ll(5,t);break;case 1:var l=t.stateNode;if(t.flags&4&&!ot)if(n===null)l.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:Lt(t.type,n.memoizedProps);l.componentDidUpdate(o,n.memoizedState,l.__reactInternalSnapshotBeforeUpdate)}var c=t.updateQueue;c!==null&&Ac(t,c,l);break;case 3:var p=t.updateQueue;if(p!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Ac(t,p,n)}break;case 5:var N=t.stateNode;if(n===null&&t.flags&4){n=N;var C=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":C.autoFocus&&n.focus();break;case"img":C.src&&(n.src=C.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var I=t.alternate;if(I!==null){var V=I.memoizedState;if(V!==null){var K=V.dehydrated;K!==null&&Ls(K)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(a(163))}ot||t.flags&512&&aa(t)}catch(U){He(t,t.return,U)}}if(t===e){ne=null;break}if(n=t.sibling,n!==null){n.return=t.return,ne=n;break}ne=t.return}}function Au(e){for(;ne!==null;){var t=ne;if(t===e){ne=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ne=n;break}ne=t.return}}function Mu(e){for(;ne!==null;){var t=ne;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ll(4,t)}catch(C){He(t,n,C)}break;case 1:var l=t.stateNode;if(typeof l.componentDidMount=="function"){var o=t.return;try{l.componentDidMount()}catch(C){He(t,o,C)}}var c=t.return;try{aa(t)}catch(C){He(t,c,C)}break;case 5:var p=t.return;try{aa(t)}catch(C){He(t,p,C)}}}catch(C){He(t,t.return,C)}if(t===e){ne=null;break}var N=t.sibling;if(N!==null){N.return=t.return,ne=N;break}ne=t.return}}var Kp=Math.ceil,il=Y.ReactCurrentDispatcher,ua=Y.ReactCurrentOwner,Pt=Y.ReactCurrentBatchConfig,be=0,et=null,Je=null,rt=0,wt=0,ds=on(0),Ze=0,tr=null,$n=0,al=0,da=0,nr=null,mt=null,fa=0,fs=1/0,Jt=null,ol=!1,pa=null,hn=null,cl=!1,mn=null,ul=0,sr=0,ha=null,dl=-1,fl=0;function ut(){return(be&6)!==0?qe():dl!==-1?dl:dl=qe()}function gn(e){return(e.mode&1)===0?1:(be&2)!==0&&rt!==0?rt&-rt:_p.transition!==null?(fl===0&&(fl=Ro()),fl):(e=Ie,e!==0||(e=window.event,e=e===void 0?16:Fo(e.type)),e)}function Ot(e,t,n,l){if(50<sr)throw sr=0,ha=null,Error(a(185));Ps(e,n,l),((be&2)===0||e!==et)&&(e===et&&((be&2)===0&&(al|=n),Ze===4&&vn(e,rt)),gt(e,l),n===1&&be===0&&(t.mode&1)===0&&(fs=qe()+500,Fr&&un()))}function gt(e,t){var n=e.callbackNode;_f(e,t);var l=kr(e,e===et?rt:0);if(l===0)n!==null&&bo(n),e.callbackNode=null,e.callbackPriority=0;else if(t=l&-l,e.callbackPriority!==t){if(n!=null&&bo(n),t===1)e.tag===0?bp(Fu.bind(null,e)):Cc(Fu.bind(null,e)),Sp(function(){(be&6)===0&&un()}),n=null;else{switch(Lo(l)){case 1:n=ql;break;case 4:n=_o;break;case 16:n=vr;break;case 536870912:n=To;break;default:n=vr}n=Qu(n,Du.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Du(e,t){if(dl=-1,fl=0,(be&6)!==0)throw Error(a(327));var n=e.callbackNode;if(ps()&&e.callbackNode!==n)return null;var l=kr(e,e===et?rt:0);if(l===0)return null;if((l&30)!==0||(l&e.expiredLanes)!==0||t)t=pl(e,l);else{t=l;var o=be;be|=2;var c=Uu();(et!==e||rt!==t)&&(Jt=null,fs=qe()+500,On(e,t));do try{Gp();break}catch(N){Bu(e,N)}while(!0);Li(),il.current=c,be=o,Je!==null?t=0:(et=null,rt=0,t=Ze)}if(t!==0){if(t===2&&(o=Ql(e),o!==0&&(l=o,t=ma(e,o))),t===1)throw n=tr,On(e,0),vn(e,l),gt(e,qe()),n;if(t===6)vn(e,l);else{if(o=e.current.alternate,(l&30)===0&&!qp(o)&&(t=pl(e,l),t===2&&(c=Ql(e),c!==0&&(l=c,t=ma(e,c))),t===1))throw n=tr,On(e,0),vn(e,l),gt(e,qe()),n;switch(e.finishedWork=o,e.finishedLanes=l,t){case 0:case 1:throw Error(a(345));case 2:zn(e,mt,Jt);break;case 3:if(vn(e,l),(l&130023424)===l&&(t=fa+500-qe(),10<t)){if(kr(e,0)!==0)break;if(o=e.suspendedLanes,(o&l)!==l){ut(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=ki(zn.bind(null,e,mt,Jt),t);break}zn(e,mt,Jt);break;case 4:if(vn(e,l),(l&4194240)===l)break;for(t=e.eventTimes,o=-1;0<l;){var p=31-_t(l);c=1<<p,p=t[p],p>o&&(o=p),l&=~c}if(l=o,l=qe()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*Kp(l/1960))-l,10<l){e.timeoutHandle=ki(zn.bind(null,e,mt,Jt),l);break}zn(e,mt,Jt);break;case 5:zn(e,mt,Jt);break;default:throw Error(a(329))}}}return gt(e,qe()),e.callbackNode===n?Du.bind(null,e):null}function ma(e,t){var n=nr;return e.current.memoizedState.isDehydrated&&(On(e,t).flags|=256),e=pl(e,t),e!==2&&(t=mt,mt=n,t!==null&&ga(t)),e}function ga(e){mt===null?mt=e:mt.push.apply(mt,e)}function qp(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var l=0;l<n.length;l++){var o=n[l],c=o.getSnapshot;o=o.value;try{if(!Tt(c(),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 vn(e,t){for(t&=~da,t&=~al,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-_t(t),l=1<<n;e[n]=-1,t&=~l}}function Fu(e){if((be&6)!==0)throw Error(a(327));ps();var t=kr(e,0);if((t&1)===0)return gt(e,qe()),null;var n=pl(e,t);if(e.tag!==0&&n===2){var l=Ql(e);l!==0&&(t=l,n=ma(e,l))}if(n===1)throw n=tr,On(e,0),vn(e,t),gt(e,qe()),n;if(n===6)throw Error(a(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,zn(e,mt,Jt),gt(e,qe()),null}function va(e,t){var n=be;be|=1;try{return e(t)}finally{be=n,be===0&&(fs=qe()+500,Fr&&un())}}function In(e){mn!==null&&mn.tag===0&&(be&6)===0&&ps();var t=be;be|=1;var n=Pt.transition,l=Ie;try{if(Pt.transition=null,Ie=1,e)return e()}finally{Ie=l,Pt.transition=n,be=t,(be&6)===0&&un()}}function xa(){wt=ds.current,Me(ds)}function On(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Np(n)),Je!==null)for(n=Je.return;n!==null;){var l=n;switch(Pi(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&Mr();break;case 3:os(),Me(ft),Me(lt),Fi();break;case 5:Mi(l);break;case 4:os();break;case 13:Me(We);break;case 19:Me(We);break;case 10:$i(l.type._context);break;case 22:case 23:xa()}n=n.return}if(et=e,Je=e=xn(e.current,null),rt=wt=t,Ze=0,tr=null,da=al=$n=0,mt=nr=null,Tn!==null){for(t=0;t<Tn.length;t++)if(n=Tn[t],l=n.interleaved,l!==null){n.interleaved=null;var o=l.next,c=n.pending;if(c!==null){var p=c.next;c.next=o,l.next=p}n.pending=l}Tn=null}return e}function Bu(e,t){do{var n=Je;try{if(Li(),Jr.current=el,Yr){for(var l=Ve.memoizedState;l!==null;){var o=l.queue;o!==null&&(o.pending=null),l=l.next}Yr=!1}if(Ln=0,Xe=Ye=Ve=null,Gs=!1,Js=0,ua.current=null,n===null||n.return===null){Ze=1,tr=t,Je=null;break}e:{var c=e,p=n.return,N=n,C=t;if(t=rt,N.flags|=32768,C!==null&&typeof C=="object"&&typeof C.then=="function"){var I=C,V=N,K=V.tag;if((V.mode&1)===0&&(K===0||K===11||K===15)){var U=V.alternate;U?(V.updateQueue=U.updateQueue,V.memoizedState=U.memoizedState,V.lanes=U.lanes):(V.updateQueue=null,V.memoizedState=null)}var ee=fu(p);if(ee!==null){ee.flags&=-257,pu(ee,p,N,c,t),ee.mode&1&&du(c,I,t),t=ee,C=I;var se=t.updateQueue;if(se===null){var re=new Set;re.add(C),t.updateQueue=re}else se.add(C);break e}else{if((t&1)===0){du(c,I,t),ya();break e}C=Error(a(426))}}else if(Fe&&N.mode&1){var Qe=fu(p);if(Qe!==null){(Qe.flags&65536)===0&&(Qe.flags|=256),pu(Qe,p,N,c,t),Ti(cs(C,N));break e}}c=C=cs(C,N),Ze!==4&&(Ze=2),nr===null?nr=[c]:nr.push(c),c=p;do{switch(c.tag){case 3:c.flags|=65536,t&=-t,c.lanes|=t;var T=cu(c,C,t);zc(c,T);break e;case 1:N=C;var E=c.type,R=c.stateNode;if((c.flags&128)===0&&(typeof E.getDerivedStateFromError=="function"||R!==null&&typeof R.componentDidCatch=="function"&&(hn===null||!hn.has(R)))){c.flags|=65536,t&=-t,c.lanes|=t;var Q=uu(c,N,t);zc(c,Q);break e}}c=c.return}while(c!==null)}Vu(n)}catch(ae){t=ae,Je===n&&n!==null&&(Je=n=n.return);continue}break}while(!0)}function Uu(){var e=il.current;return il.current=el,e===null?el:e}function ya(){(Ze===0||Ze===3||Ze===2)&&(Ze=4),et===null||($n&268435455)===0&&(al&268435455)===0||vn(et,rt)}function pl(e,t){var n=be;be|=2;var l=Uu();(et!==e||rt!==t)&&(Jt=null,On(e,t));do try{Qp();break}catch(o){Bu(e,o)}while(!0);if(Li(),be=n,il.current=l,Je!==null)throw Error(a(261));return et=null,rt=0,Ze}function Qp(){for(;Je!==null;)Wu(Je)}function Gp(){for(;Je!==null&&!jf();)Wu(Je)}function Wu(e){var t=qu(e.alternate,e,wt);e.memoizedProps=e.pendingProps,t===null?Vu(e):Je=t,ua.current=null}function Vu(e){var t=e;do{var n=t.alternate;if(e=t.return,(t.flags&32768)===0){if(n=Bp(n,t,wt),n!==null){Je=n;return}}else{if(n=Up(n,t),n!==null){n.flags&=32767,Je=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ze=6,Je=null;return}}if(t=t.sibling,t!==null){Je=t;return}Je=t=e}while(t!==null);Ze===0&&(Ze=5)}function zn(e,t,n){var l=Ie,o=Pt.transition;try{Pt.transition=null,Ie=1,Jp(e,t,n,l)}finally{Pt.transition=o,Ie=l}return null}function Jp(e,t,n,l){do ps();while(mn!==null);if((be&6)!==0)throw Error(a(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(a(177));e.callbackNode=null,e.callbackPriority=0;var c=n.lanes|n.childLanes;if(Tf(e,c),e===et&&(Je=et=null,rt=0),(n.subtreeFlags&2064)===0&&(n.flags&2064)===0||cl||(cl=!0,Qu(vr,function(){return ps(),null})),c=(n.flags&15990)!==0,(n.subtreeFlags&15990)!==0||c){c=Pt.transition,Pt.transition=null;var p=Ie;Ie=1;var N=be;be|=4,ua.current=null,Vp(e,n),Iu(n,e),gp(yi),Sr=!!xi,yi=xi=null,e.current=n,Hp(n),kf(),be=N,Ie=p,Pt.transition=c}else e.current=n;if(cl&&(cl=!1,mn=e,ul=o),c=e.pendingLanes,c===0&&(hn=null),Sf(n.stateNode),gt(e,qe()),t!==null)for(l=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],l(o.value,{componentStack:o.stack,digest:o.digest});if(ol)throw ol=!1,e=pa,pa=null,e;return(ul&1)!==0&&e.tag!==0&&ps(),c=e.pendingLanes,(c&1)!==0?e===ha?sr++:(sr=0,ha=e):sr=0,un(),null}function ps(){if(mn!==null){var e=Lo(ul),t=Pt.transition,n=Ie;try{if(Pt.transition=null,Ie=16>e?16:e,mn===null)var l=!1;else{if(e=mn,mn=null,ul=0,(be&6)!==0)throw Error(a(331));var o=be;for(be|=4,ne=e.current;ne!==null;){var c=ne,p=c.child;if((ne.flags&16)!==0){var N=c.deletions;if(N!==null){for(var C=0;C<N.length;C++){var I=N[C];for(ne=I;ne!==null;){var V=ne;switch(V.tag){case 0:case 11:case 15:er(8,V,c)}var K=V.child;if(K!==null)K.return=V,ne=K;else for(;ne!==null;){V=ne;var U=V.sibling,ee=V.return;if(_u(V),V===I){ne=null;break}if(U!==null){U.return=ee,ne=U;break}ne=ee}}}var se=c.alternate;if(se!==null){var re=se.child;if(re!==null){se.child=null;do{var Qe=re.sibling;re.sibling=null,re=Qe}while(re!==null)}}ne=c}}if((c.subtreeFlags&2064)!==0&&p!==null)p.return=c,ne=p;else e:for(;ne!==null;){if(c=ne,(c.flags&2048)!==0)switch(c.tag){case 0:case 11:case 15:er(9,c,c.return)}var T=c.sibling;if(T!==null){T.return=c.return,ne=T;break e}ne=c.return}}var E=e.current;for(ne=E;ne!==null;){p=ne;var R=p.child;if((p.subtreeFlags&2064)!==0&&R!==null)R.return=p,ne=R;else e:for(p=E;ne!==null;){if(N=ne,(N.flags&2048)!==0)try{switch(N.tag){case 0:case 11:case 15:ll(9,N)}}catch(ae){He(N,N.return,ae)}if(N===p){ne=null;break e}var Q=N.sibling;if(Q!==null){Q.return=N.return,ne=Q;break e}ne=N.return}}if(be=o,un(),zt&&typeof zt.onPostCommitFiberRoot=="function")try{zt.onPostCommitFiberRoot(xr,e)}catch{}l=!0}return l}finally{Ie=n,Pt.transition=t}}return!1}function Hu(e,t,n){t=cs(n,t),t=cu(e,t,1),e=fn(e,t,1),t=ut(),e!==null&&(Ps(e,1,t),gt(e,t))}function He(e,t,n){if(e.tag===3)Hu(e,e,n);else for(;t!==null;){if(t.tag===3){Hu(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(hn===null||!hn.has(l))){e=cs(n,e),e=uu(t,e,1),t=fn(t,e,1),e=ut(),t!==null&&(Ps(t,1,e),gt(t,e));break}}t=t.return}}function Yp(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),t=ut(),e.pingedLanes|=e.suspendedLanes&n,et===e&&(rt&n)===n&&(Ze===4||Ze===3&&(rt&130023424)===rt&&500>qe()-fa?On(e,0):da|=n),gt(e,t)}function Ku(e,t){t===0&&((e.mode&1)===0?t=1:(t=jr,jr<<=1,(jr&130023424)===0&&(jr=4194304)));var n=ut();e=qt(e,t),e!==null&&(Ps(e,t,n),gt(e,n))}function Zp(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ku(e,n)}function Xp(e,t){var n=0;switch(e.tag){case 13:var l=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(a(314))}l!==null&&l.delete(t),Ku(e,n)}var qu;qu=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ft.current)ht=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return ht=!1,Fp(e,t,n);ht=(e.flags&131072)!==0}else ht=!1,Fe&&(t.flags&1048576)!==0&&Ec(t,Ur,t.index);switch(t.lanes=0,t.tag){case 2:var l=t.type;sl(e,t),e=t.pendingProps;var o=ts(t,lt.current);as(t,n),o=Wi(null,t,l,e,o,n);var c=Vi();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,pt(l)?(c=!0,Dr(t)):c=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,zi(t),o.updater=tl,t.stateNode=o,o._reactInternals=t,Ji(t,l,e,n),t=ea(null,t,l,!0,c,n)):(t.tag=0,Fe&&c&&Ei(t),ct(null,t,o,n),t=t.child),t;case 16:l=t.elementType;e:{switch(sl(e,t),e=t.pendingProps,o=l._init,l=o(l._payload),t.type=l,o=t.tag=th(l),e=Lt(l,e),o){case 0:t=Xi(null,t,l,e,n);break e;case 1:t=yu(null,t,l,e,n);break e;case 11:t=hu(null,t,l,e,n);break e;case 14:t=mu(null,t,l,Lt(l.type,e),n);break e}throw Error(a(306,l,""))}return t;case 0:return l=t.type,o=t.pendingProps,o=t.elementType===l?o:Lt(l,o),Xi(e,t,l,o,n);case 1:return l=t.type,o=t.pendingProps,o=t.elementType===l?o:Lt(l,o),yu(e,t,l,o,n);case 3:e:{if(ju(t),e===null)throw Error(a(387));l=t.pendingProps,c=t.memoizedState,o=c.element,Oc(e,t),Qr(t,l,null,n);var p=t.memoizedState;if(l=p.element,c.isDehydrated)if(c={element:l,isDehydrated:!1,cache:p.cache,pendingSuspenseBoundaries:p.pendingSuspenseBoundaries,transitions:p.transitions},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){o=cs(Error(a(423)),t),t=ku(e,t,l,n,o);break e}else if(l!==o){o=cs(Error(a(424)),t),t=ku(e,t,l,n,o);break e}else for(kt=an(t.stateNode.containerInfo.firstChild),jt=t,Fe=!0,Rt=null,n=$c(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(rs(),l===o){t=Gt(e,t,n);break e}ct(e,t,l,n)}t=t.child}return t;case 5:return Mc(t),e===null&&_i(t),l=t.type,o=t.pendingProps,c=e!==null?e.memoizedProps:null,p=o.children,ji(l,o)?p=null:c!==null&&ji(l,c)&&(t.flags|=32),xu(e,t),ct(e,t,p,n),t.child;case 6:return e===null&&_i(t),null;case 13:return wu(e,t,n);case 4:return Ai(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=ls(t,null,l,n):ct(e,t,l,n),t.child;case 11:return l=t.type,o=t.pendingProps,o=t.elementType===l?o:Lt(l,o),hu(e,t,l,o,n);case 7:return ct(e,t,t.pendingProps,n),t.child;case 8:return ct(e,t,t.pendingProps.children,n),t.child;case 12:return ct(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(l=t.type._context,o=t.pendingProps,c=t.memoizedProps,p=o.value,ze(Hr,l._currentValue),l._currentValue=p,c!==null)if(Tt(c.value,p)){if(c.children===o.children&&!ft.current){t=Gt(e,t,n);break e}}else for(c=t.child,c!==null&&(c.return=t);c!==null;){var N=c.dependencies;if(N!==null){p=c.child;for(var C=N.firstContext;C!==null;){if(C.context===l){if(c.tag===1){C=Qt(-1,n&-n),C.tag=2;var I=c.updateQueue;if(I!==null){I=I.shared;var V=I.pending;V===null?C.next=C:(C.next=V.next,V.next=C),I.pending=C}}c.lanes|=n,C=c.alternate,C!==null&&(C.lanes|=n),Ii(c.return,n,t),N.lanes|=n;break}C=C.next}}else if(c.tag===10)p=c.type===t.type?null:c.child;else if(c.tag===18){if(p=c.return,p===null)throw Error(a(341));p.lanes|=n,N=p.alternate,N!==null&&(N.lanes|=n),Ii(p,n,t),p=c.sibling}else p=c.child;if(p!==null)p.return=c;else for(p=c;p!==null;){if(p===t){p=null;break}if(c=p.sibling,c!==null){c.return=p.return,p=c;break}p=p.return}c=p}ct(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,l=t.pendingProps.children,as(t,n),o=Ct(o),l=l(o),t.flags|=1,ct(e,t,l,n),t.child;case 14:return l=t.type,o=Lt(l,t.pendingProps),o=Lt(l.type,o),mu(e,t,l,o,n);case 15:return gu(e,t,t.type,t.pendingProps,n);case 17:return l=t.type,o=t.pendingProps,o=t.elementType===l?o:Lt(l,o),sl(e,t),t.tag=1,pt(l)?(e=!0,Dr(t)):e=!1,as(t,n),au(t,l,o),Ji(t,l,o,n),ea(null,t,l,!0,e,n);case 19:return Su(e,t,n);case 22:return vu(e,t,n)}throw Error(a(156,t.tag))};function Qu(e,t){return Po(e,t)}function eh(e,t,n,l){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=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function bt(e,t,n,l){return new eh(e,t,n,l)}function ja(e){return e=e.prototype,!(!e||!e.isReactComponent)}function th(e){if(typeof e=="function")return ja(e)?1:0;if(e!=null){if(e=e.$$typeof,e===te)return 11;if(e===ge)return 14}return 2}function xn(e,t){var n=e.alternate;return n===null?(n=bt(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 hl(e,t,n,l,o,c){var p=2;if(l=e,typeof e=="function")ja(e)&&(p=1);else if(typeof e=="string")p=5;else e:switch(e){case H:return An(n.children,o,c,t);case L:p=8,o|=8;break;case F:return e=bt(12,n,t,o|2),e.elementType=F,e.lanes=c,e;case oe:return e=bt(13,n,t,o),e.elementType=oe,e.lanes=c,e;case ue:return e=bt(19,n,t,o),e.elementType=ue,e.lanes=c,e;case xe:return ml(n,o,c,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case O:p=10;break e;case J:p=9;break e;case te:p=11;break e;case ge:p=14;break e;case Ee:p=16,l=null;break e}throw Error(a(130,e==null?e:typeof e,""))}return t=bt(p,n,t,o),t.elementType=e,t.type=l,t.lanes=c,t}function An(e,t,n,l){return e=bt(7,e,l,t),e.lanes=n,e}function ml(e,t,n,l){return e=bt(22,e,l,t),e.elementType=xe,e.lanes=n,e.stateNode={isHidden:!1},e}function ka(e,t,n){return e=bt(6,e,null,t),e.lanes=n,e}function wa(e,t,n){return t=bt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function nh(e,t,n,l,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=Gl(0),this.expirationTimes=Gl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gl(0),this.identifierPrefix=l,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Na(e,t,n,l,o,c,p,N,C){return e=new nh(e,t,n,N,C),t===1?(t=1,c===!0&&(t|=8)):t=0,c=bt(3,null,null,t),e.current=c,c.stateNode=e,c.memoizedState={element:l,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},zi(c),e}function sh(e,t,n){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Z,key:l==null?null:""+l,children:e,containerInfo:t,implementation:n}}function Gu(e){if(!e)return cn;e=e._reactInternals;e:{if(Cn(e)!==e||e.tag!==1)throw Error(a(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(pt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(a(171))}if(e.tag===1){var n=e.type;if(pt(n))return Nc(e,n,t)}return t}function Ju(e,t,n,l,o,c,p,N,C){return e=Na(n,l,!0,e,o,c,p,N,C),e.context=Gu(null),n=e.current,l=ut(),o=gn(n),c=Qt(l,o),c.callback=t??null,fn(n,c,o),e.current.lanes=o,Ps(e,o,l),gt(e,l),e}function gl(e,t,n,l){var o=t.current,c=ut(),p=gn(o);return n=Gu(n),t.context===null?t.context=n:t.pendingContext=n,t=Qt(c,p),t.payload={element:e},l=l===void 0?null:l,l!==null&&(t.callback=l),e=fn(o,t,p),e!==null&&(Ot(e,o,p,c),qr(e,o,p)),p}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 Yu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Sa(e,t){Yu(e,t),(e=e.alternate)&&Yu(e,t)}function rh(){return null}var Zu=typeof reportError=="function"?reportError:function(e){console.error(e)};function Ca(e){this._internalRoot=e}xl.prototype.render=Ca.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));gl(e,t,null,null)},xl.prototype.unmount=Ca.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;In(function(){gl(null,e,null,null)}),t[Wt]=null}};function xl(e){this._internalRoot=e}xl.prototype.unstable_scheduleHydration=function(e){if(e){var t=Oo();e={blockedOn:null,target:e,priority:t};for(var n=0;n<sn.length&&t!==0&&t<sn[n].priority;n++);sn.splice(n,0,e),n===0&&Mo(e)}};function Ea(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function yl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Xu(){}function lh(e,t,n,l,o){if(o){if(typeof l=="function"){var c=l;l=function(){var I=vl(p);c.call(I)}}var p=Ju(t,l,e,0,null,!1,!1,"",Xu);return e._reactRootContainer=p,e[Wt]=p.current,Bs(e.nodeType===8?e.parentNode:e),In(),p}for(;o=e.lastChild;)e.removeChild(o);if(typeof l=="function"){var N=l;l=function(){var I=vl(C);N.call(I)}}var C=Na(e,0,!1,null,null,!1,!1,"",Xu);return e._reactRootContainer=C,e[Wt]=C.current,Bs(e.nodeType===8?e.parentNode:e),In(function(){gl(t,C,n,l)}),C}function jl(e,t,n,l,o){var c=n._reactRootContainer;if(c){var p=c;if(typeof o=="function"){var N=o;o=function(){var C=vl(p);N.call(C)}}gl(t,p,e,o)}else p=lh(n,t,e,o,l);return vl(p)}$o=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Es(t.pendingLanes);n!==0&&(Jl(t,n|1),gt(t,qe()),(be&6)===0&&(fs=qe()+500,un()))}break;case 13:In(function(){var l=qt(e,1);if(l!==null){var o=ut();Ot(l,e,1,o)}}),Sa(e,1)}},Yl=function(e){if(e.tag===13){var t=qt(e,134217728);if(t!==null){var n=ut();Ot(t,e,134217728,n)}Sa(e,134217728)}},Io=function(e){if(e.tag===13){var t=gn(e),n=qt(e,t);if(n!==null){var l=ut();Ot(n,e,t,l)}Sa(e,t)}},Oo=function(){return Ie},zo=function(e,t){var n=Ie;try{return Ie=e,t()}finally{Ie=n}},Wl=function(e,t,n){switch(t){case"input":if(ve(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 l=n[t];if(l!==e&&l.form===e.form){var o=Ar(l);if(!o)throw Error(a(90));Ue(l),ve(l,o)}}}break;case"textarea":uo(e,n);break;case"select":t=n.value,t!=null&&Wn(e,!!n.multiple,t,!1)}},jo=va,ko=In;var ih={usingClientEntryPoint:!1,Events:[Vs,Xn,Ar,xo,yo,va]},rr={findFiberByHostInstance:En,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ah={bundleType:rr.bundleType,version:rr.version,rendererPackageName:rr.rendererPackageName,rendererConfig:rr.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Y.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Co(e),e===null?null:e.stateNode},findFiberByHostInstance:rr.findFiberByHostInstance||rh,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 kl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!kl.isDisabled&&kl.supportsFiber)try{xr=kl.inject(ah),zt=kl}catch{}}return vt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ih,vt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ea(t))throw Error(a(200));return sh(e,t,null,n)},vt.createRoot=function(e,t){if(!Ea(e))throw Error(a(299));var n=!1,l="",o=Zu;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Na(e,1,!1,null,null,n,!1,l,o),e[Wt]=t.current,Bs(e.nodeType===8?e.parentNode:e),new Ca(t)},vt.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(a(188)):(e=Object.keys(e).join(","),Error(a(268,e)));return e=Co(t),e=e===null?null:e.stateNode,e},vt.flushSync=function(e){return In(e)},vt.hydrate=function(e,t,n){if(!yl(t))throw Error(a(200));return jl(null,e,t,!0,n)},vt.hydrateRoot=function(e,t,n){if(!Ea(e))throw Error(a(405));var l=n!=null&&n.hydratedSources||null,o=!1,c="",p=Zu;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(c=n.identifierPrefix),n.onRecoverableError!==void 0&&(p=n.onRecoverableError)),t=Ju(t,null,e,1,n??null,o,!1,c,p),e[Wt]=t.current,Bs(e),l)for(e=0;e<l.length;e++)n=l[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new xl(t)},vt.render=function(e,t,n){if(!yl(t))throw Error(a(200));return jl(null,e,t,!1,n)},vt.unmountComponentAtNode=function(e){if(!yl(e))throw Error(a(40));return e._reactRootContainer?(In(function(){jl(null,null,e,!1,function(){e._reactRootContainer=null,e[Wt]=null})}),!0):!1},vt.unstable_batchedUpdates=va,vt.unstable_renderSubtreeIntoContainer=function(e,t,n,l){if(!yl(n))throw Error(a(200));if(e==null||e._reactInternals===void 0)throw Error(a(38));return jl(e,t,n,!1,l)},vt.version="18.3.1-next-f1338f8080-20240426",vt}var ad;function _d(){if(ad)return _a.exports;ad=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(i){console.error(i)}}return r(),_a.exports=yh(),_a.exports}var od;function jh(){if(od)return wl;od=1;var r=_d();return wl.createRoot=r.createRoot,wl.hydrateRoot=r.hydrateRoot,wl}var kh=jh();_d();/**
|
|
41
41
|
* @remix-run/router v1.23.4
|
|
42
42
|
*
|
|
43
43
|
* Copyright (c) Remix Software Inc.
|
|
@@ -46,7 +46,7 @@ Error generating stack: `+c.message+`
|
|
|
46
46
|
* LICENSE.md file in the root directory of this source tree.
|
|
47
47
|
*
|
|
48
48
|
* @license MIT
|
|
49
|
-
*/function dr(){return dr=Object.assign?Object.assign.bind():function(r){for(var i=1;i<arguments.length;i++){var a=arguments[i];for(var u in a)({}).hasOwnProperty.call(a,u)&&(r[u]=a[u])}return r},dr.apply(null,arguments)}var kn;(function(r){r.Pop="POP",r.Push="PUSH",r.Replace="REPLACE"})(kn||(kn={}));const cd="popstate";function wh(r){r===void 0&&(r={});function i(u,d){let{pathname:f,search:g,hash:m}=u.location;return Aa("",{pathname:f,search:g,hash:m},d.state&&d.state.usr||null,d.state&&d.state.key||"default")}function a(u,d){return typeof d=="string"?d:Cl(d)}return Sh(i,a,null,r)}function Ge(r,i){if(r===!1||r===null||typeof r>"u")throw new Error(i)}function Td(r,i){if(!r){typeof console<"u"&&console.warn(i);try{throw new Error(i)}catch{}}}function Nh(){return Math.random().toString(36).substr(2,8)}function ud(r,i){return{usr:r.state,key:r.key,idx:i}}function Aa(r,i,a,u){return a===void 0&&(a=null),dr({pathname:typeof r=="string"?r:r.pathname,search:"",hash:""},typeof i=="string"?gs(i):i,{state:a,key:i&&i.key||u||Nh()})}function Cl(r){let{pathname:i="/",search:a="",hash:u=""}=r;return a&&a!=="?"&&(i+=a.charAt(0)==="?"?a:"?"+a),u&&u!=="#"&&(i+=u.charAt(0)==="#"?u:"#"+u),i}function gs(r){let i={};if(r){let a=r.indexOf("#");a>=0&&(i.hash=r.substr(a),r=r.substr(0,a));let u=r.indexOf("?");u>=0&&(i.search=r.substr(u),r=r.substr(0,u)),r&&(i.pathname=r)}return i}function Sh(r,i,a,u){u===void 0&&(u={});let{window:d=document.defaultView,v5Compat:f=!1}=u,g=d.history,m=kn.Pop,h=null,v=x();v==null&&(v=0,g.replaceState(dr({},g.state,{idx:v}),""));function x(){return(g.state||{idx:null}).idx}function
|
|
49
|
+
*/function dr(){return dr=Object.assign?Object.assign.bind():function(r){for(var i=1;i<arguments.length;i++){var a=arguments[i];for(var u in a)({}).hasOwnProperty.call(a,u)&&(r[u]=a[u])}return r},dr.apply(null,arguments)}var kn;(function(r){r.Pop="POP",r.Push="PUSH",r.Replace="REPLACE"})(kn||(kn={}));const cd="popstate";function wh(r){r===void 0&&(r={});function i(u,d){let{pathname:f,search:g,hash:m}=u.location;return Aa("",{pathname:f,search:g,hash:m},d.state&&d.state.usr||null,d.state&&d.state.key||"default")}function a(u,d){return typeof d=="string"?d:Cl(d)}return Sh(i,a,null,r)}function Ge(r,i){if(r===!1||r===null||typeof r>"u")throw new Error(i)}function Td(r,i){if(!r){typeof console<"u"&&console.warn(i);try{throw new Error(i)}catch{}}}function Nh(){return Math.random().toString(36).substr(2,8)}function ud(r,i){return{usr:r.state,key:r.key,idx:i}}function Aa(r,i,a,u){return a===void 0&&(a=null),dr({pathname:typeof r=="string"?r:r.pathname,search:"",hash:""},typeof i=="string"?gs(i):i,{state:a,key:i&&i.key||u||Nh()})}function Cl(r){let{pathname:i="/",search:a="",hash:u=""}=r;return a&&a!=="?"&&(i+=a.charAt(0)==="?"?a:"?"+a),u&&u!=="#"&&(i+=u.charAt(0)==="#"?u:"#"+u),i}function gs(r){let i={};if(r){let a=r.indexOf("#");a>=0&&(i.hash=r.substr(a),r=r.substr(0,a));let u=r.indexOf("?");u>=0&&(i.search=r.substr(u),r=r.substr(0,u)),r&&(i.pathname=r)}return i}function Sh(r,i,a,u){u===void 0&&(u={});let{window:d=document.defaultView,v5Compat:f=!1}=u,g=d.history,m=kn.Pop,h=null,v=x();v==null&&(v=0,g.replaceState(dr({},g.state,{idx:v}),""));function x(){return(g.state||{idx:null}).idx}function j(){m=kn.Pop;let w=x(),$=w==null?null:w-v;v=w,h&&h({action:m,location:b.location,delta:$})}function S(w,$){m=kn.Push;let W=Aa(b.location,w,$);v=x()+1;let A=ud(W,v),Y=b.createHref(W);try{g.pushState(A,"",Y)}catch(M){if(M instanceof DOMException&&M.name==="DataCloneError")throw M;d.location.assign(Y)}f&&h&&h({action:m,location:b.location,delta:1})}function P(w,$){m=kn.Replace;let W=Aa(b.location,w,$);v=x();let A=ud(W,v),Y=b.createHref(W);g.replaceState(A,"",Y),f&&h&&h({action:m,location:b.location,delta:0})}function k(w){let $=d.location.origin!=="null"?d.location.origin:d.location.href,W=typeof w=="string"?w:Cl(w);return W=W.replace(/ $/,"%20"),Ge($,"No window.location.(origin|href) available to create URL for href: "+W),new URL(W,$)}let b={get action(){return m},get location(){return r(d,g)},listen(w){if(h)throw new Error("A history only accepts one active listener");return d.addEventListener(cd,j),h=w,()=>{d.removeEventListener(cd,j),h=null}},createHref(w){return i(d,w)},createURL:k,encodeLocation(w){let $=k(w);return{pathname:$.pathname,search:$.search,hash:$.hash}},push:S,replace:P,go(w){return g.go(w)}};return b}var dd;(function(r){r.data="data",r.deferred="deferred",r.redirect="redirect",r.error="error"})(dd||(dd={}));function Ch(r,i,a){return a===void 0&&(a="/"),Eh(r,i,a)}function Eh(r,i,a,u){let d=typeof i=="string"?gs(i):i,f=Ja(d.pathname||"/",a);if(f==null)return null;let g=Rd(r);Ph(g);let m=null,h=Dh(f);for(let v=0;m==null&&v<g.length;++v)m=zh(g[v],h);return m}function Rd(r,i,a,u){i===void 0&&(i=[]),a===void 0&&(a=[]),u===void 0&&(u="");let d=(f,g,m)=>{let h={relativePath:m===void 0?f.path||"":m,caseSensitive:f.caseSensitive===!0,childrenIndex:g,route:f};h.relativePath.startsWith("/")&&(Ge(h.relativePath.startsWith(u),'Absolute route path "'+h.relativePath+'" nested under path '+('"'+u+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),h.relativePath=h.relativePath.slice(u.length));let v=wn([u,h.relativePath]),x=a.concat(h);f.children&&f.children.length>0&&(Ge(f.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+v+'".')),Rd(f.children,i,x,v)),!(f.path==null&&!f.index)&&i.push({path:v,score:Ih(v,f.index),routesMeta:x})};return r.forEach((f,g)=>{var m;if(f.path===""||!((m=f.path)!=null&&m.includes("?")))d(f,g);else for(let h of Ld(f.path))d(f,g,h)}),i}function Ld(r){let i=r.split("/");if(i.length===0)return[];let[a,...u]=i,d=a.endsWith("?"),f=a.replace(/\?$/,"");if(u.length===0)return d?[f,""]:[f];let g=Ld(u.join("/")),m=[];return m.push(...g.map(h=>h===""?f:[f,h].join("/"))),d&&m.push(...g),m.map(h=>r.startsWith("/")&&h===""?"/":h)}function Ph(r){r.sort((i,a)=>i.score!==a.score?a.score-i.score:Oh(i.routesMeta.map(u=>u.childrenIndex),a.routesMeta.map(u=>u.childrenIndex)))}const bh=/^:[\w-]+$/,_h=3,Th=2,Rh=1,Lh=10,$h=-2,fd=r=>r==="*";function Ih(r,i){let a=r.split("/"),u=a.length;return a.some(fd)&&(u+=$h),i&&(u+=Th),a.filter(d=>!fd(d)).reduce((d,f)=>d+(bh.test(f)?_h:f===""?Rh:Lh),u)}function Oh(r,i){return r.length===i.length&&r.slice(0,-1).every((u,d)=>u===i[d])?r[r.length-1]-i[i.length-1]:0}function zh(r,i,a){let{routesMeta:u}=r,d={},f="/",g=[];for(let m=0;m<u.length;++m){let h=u[m],v=m===u.length-1,x=f==="/"?i:i.slice(f.length)||"/",j=Ah({path:h.relativePath,caseSensitive:h.caseSensitive,end:v},x),S=h.route;if(!j)return null;Object.assign(d,j.params),g.push({params:d,pathname:wn([f,j.pathname]),pathnameBase:Uh(wn([f,j.pathnameBase])),route:S}),j.pathnameBase!=="/"&&(f=wn([f,j.pathnameBase]))}return g}function Ah(r,i){typeof r=="string"&&(r={path:r,caseSensitive:!1,end:!0});let[a,u]=Mh(r.path,r.caseSensitive,r.end),d=i.match(a);if(!d)return null;let f=d[0],g=f.replace(/(.)\/+$/,"$1"),m=d.slice(1);return{params:u.reduce((v,x,j)=>{let{paramName:S,isOptional:P}=x;if(S==="*"){let b=m[j]||"";g=f.slice(0,f.length-b.length).replace(/(.)\/+$/,"$1")}const k=m[j];return P&&!k?v[S]=void 0:v[S]=(k||"").replace(/%2F/g,"/"),v},{}),pathname:f,pathnameBase:g,pattern:r}}function Mh(r,i,a){i===void 0&&(i=!1),a===void 0&&(a=!0),Td(r==="*"||!r.endsWith("*")||r.endsWith("/*"),'Route path "'+r+'" will be treated as if it were '+('"'+r.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+r.replace(/\*$/,"/*")+'".'));let u=[],d="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(g,m,h)=>(u.push({paramName:m,isOptional:h!=null}),h?"/?([^\\/]+)?":"/([^\\/]+)"));return r.endsWith("*")?(u.push({paramName:"*"}),d+=r==="*"||r==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?d+="\\/*$":r!==""&&r!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,i?void 0:"i"),u]}function Dh(r){try{return r.split("/").map(i=>decodeURIComponent(i).replace(/\//g,"%2F")).join("/")}catch(i){return Td(!1,'The URL path "'+r+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+i+").")),r}}function Ja(r,i){if(i==="/")return r;if(!r.toLowerCase().startsWith(i.toLowerCase()))return null;let a=i.endsWith("/")?i.length-1:i.length,u=r.charAt(a);return u&&u!=="/"?null:r.slice(a)||"/"}function Fh(r,i){i===void 0&&(i="/");let{pathname:a,search:u="",hash:d=""}=typeof r=="string"?gs(r):r,f;return a?(a=$d(a),a.startsWith("/")?f=pd(a.substring(1),"/"):f=pd(a,i)):f=i,{pathname:f,search:Wh(u),hash:Vh(d)}}function pd(r,i){let a=i.replace(/\/+$/,"").split("/");return r.split("/").forEach(d=>{d===".."?a.length>1&&a.pop():d!=="."&&a.push(d)}),a.length>1?a.join("/"):"/"}function La(r,i,a,u){return"Cannot include a '"+r+"' character in a manually specified "+("`to."+i+"` field ["+JSON.stringify(u)+"]. Please separate it out to the ")+("`to."+a+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Bh(r){return r.filter((i,a)=>a===0||i.route.path&&i.route.path.length>0)}function Ya(r,i){let a=Bh(r);return i?a.map((u,d)=>d===a.length-1?u.pathname:u.pathnameBase):a.map(u=>u.pathnameBase)}function Za(r,i,a,u){u===void 0&&(u=!1);let d;typeof r=="string"?d=gs(r):(d=dr({},r),Ge(!d.pathname||!d.pathname.includes("?"),La("?","pathname","search",d)),Ge(!d.pathname||!d.pathname.includes("#"),La("#","pathname","hash",d)),Ge(!d.search||!d.search.includes("#"),La("#","search","hash",d)));let f=r===""||d.pathname==="",g=f?"/":d.pathname,m;if(g==null)m=a;else{let j=i.length-1;if(!u&&g.startsWith("..")){let S=g.split("/");for(;S[0]==="..";)S.shift(),j-=1;d.pathname=S.join("/")}m=j>=0?i[j]:"/"}let h=Fh(d,m),v=g&&g!=="/"&&g.endsWith("/"),x=(f||g===".")&&a.endsWith("/");return!h.pathname.endsWith("/")&&(v||x)&&(h.pathname+="/"),h}const $d=r=>r.replace(/\/\/+/g,"/"),wn=r=>$d(r.join("/")),Uh=r=>r.replace(/\/+$/,"").replace(/^\/*/,"/"),Wh=r=>!r||r==="?"?"":r.startsWith("?")?r:"?"+r,Vh=r=>!r||r==="#"?"":r.startsWith("#")?r:"#"+r;function Hh(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.internal=="boolean"&&"data"in r}const Id=["post","put","patch","delete"];new Set(Id);const Kh=["get",...Id];new Set(Kh);/**
|
|
50
50
|
* React Router v6.30.6
|
|
51
51
|
*
|
|
52
52
|
* Copyright (c) Remix Software Inc.
|
|
@@ -55,7 +55,7 @@ Error generating stack: `+c.message+`
|
|
|
55
55
|
* LICENSE.md file in the root directory of this source tree.
|
|
56
56
|
*
|
|
57
57
|
* @license MIT
|
|
58
|
-
*/function fr(){return fr=Object.assign?Object.assign.bind():function(r){for(var i=1;i<arguments.length;i++){var a=arguments[i];for(var u in a)({}).hasOwnProperty.call(a,u)&&(r[u]=a[u])}return r},fr.apply(null,arguments)}const Xa=y.createContext(null),qh=y.createContext(null),Nn=y.createContext(null),Ll=y.createContext(null),Xt=y.createContext({outlet:null,matches:[],isDataRoute:!1}),Od=y.createContext(null);function Qh(r,i){let{relative:a}=i===void 0?{}:i;vs()||Ge(!1);let{basename:u,navigator:d}=y.useContext(Nn),{hash:f,pathname:g,search:m}=Ad(r,{relative:a}),h=g;return u!=="/"&&(h=g==="/"?u:wn([u,g])),d.createHref({pathname:h,search:m,hash:f})}function vs(){return y.useContext(Ll)!=null}function xs(){return vs()||Ge(!1),y.useContext(Ll).location}function zd(r){y.useContext(Nn).static||y.useLayoutEffect(r)}function Ut(){let{isDataRoute:r}=y.useContext(Xt);return r?am():Gh()}function Gh(){vs()||Ge(!1);let r=y.useContext(Xa),{basename:i,future:a,navigator:u}=y.useContext(Nn),{matches:d}=y.useContext(Xt),{pathname:f}=xs(),g=JSON.stringify(Ya(d,a.v7_relativeSplatPath)),m=y.useRef(!1);return zd(()=>{m.current=!0}),y.useCallback(function(v,x){if(x===void 0&&(x={}),!m.current)return;if(typeof v=="number"){u.go(v);return}let
|
|
58
|
+
*/function fr(){return fr=Object.assign?Object.assign.bind():function(r){for(var i=1;i<arguments.length;i++){var a=arguments[i];for(var u in a)({}).hasOwnProperty.call(a,u)&&(r[u]=a[u])}return r},fr.apply(null,arguments)}const Xa=y.createContext(null),qh=y.createContext(null),Nn=y.createContext(null),Ll=y.createContext(null),Xt=y.createContext({outlet:null,matches:[],isDataRoute:!1}),Od=y.createContext(null);function Qh(r,i){let{relative:a}=i===void 0?{}:i;vs()||Ge(!1);let{basename:u,navigator:d}=y.useContext(Nn),{hash:f,pathname:g,search:m}=Ad(r,{relative:a}),h=g;return u!=="/"&&(h=g==="/"?u:wn([u,g])),d.createHref({pathname:h,search:m,hash:f})}function vs(){return y.useContext(Ll)!=null}function xs(){return vs()||Ge(!1),y.useContext(Ll).location}function zd(r){y.useContext(Nn).static||y.useLayoutEffect(r)}function Ut(){let{isDataRoute:r}=y.useContext(Xt);return r?am():Gh()}function Gh(){vs()||Ge(!1);let r=y.useContext(Xa),{basename:i,future:a,navigator:u}=y.useContext(Nn),{matches:d}=y.useContext(Xt),{pathname:f}=xs(),g=JSON.stringify(Ya(d,a.v7_relativeSplatPath)),m=y.useRef(!1);return zd(()=>{m.current=!0}),y.useCallback(function(v,x){if(x===void 0&&(x={}),!m.current)return;if(typeof v=="number"){u.go(v);return}let j=Za(v,JSON.parse(g),f,x.relative==="path");r==null&&i!=="/"&&(j.pathname=j.pathname==="/"?i:wn([i,j.pathname])),(x.replace?u.replace:u.push)(j,x.state,x)},[i,u,g,f,r])}function Sn(){let{matches:r}=y.useContext(Xt),i=r[r.length-1];return i?i.params:{}}function Ad(r,i){let{relative:a}=i===void 0?{}:i,{future:u}=y.useContext(Nn),{matches:d}=y.useContext(Xt),{pathname:f}=xs(),g=JSON.stringify(Ya(d,u.v7_relativeSplatPath));return y.useMemo(()=>Za(r,JSON.parse(g),f,a==="path"),[r,g,f,a])}function Jh(r,i){return Yh(r,i)}function Yh(r,i,a,u){vs()||Ge(!1);let{navigator:d}=y.useContext(Nn),{matches:f}=y.useContext(Xt),g=f[f.length-1],m=g?g.params:{};g&&g.pathname;let h=g?g.pathnameBase:"/";g&&g.route;let v=xs(),x;if(i){var j;let w=typeof i=="string"?gs(i):i;h==="/"||(j=w.pathname)!=null&&j.startsWith(h)||Ge(!1),x=w}else x=v;let S=x.pathname||"/",P=S;if(h!=="/"){let w=h.replace(/^\//,"").split("/");P="/"+S.replace(/^\//,"").split("/").slice(w.length).join("/")}let k=Ch(r,{pathname:P}),b=nm(k&&k.map(w=>Object.assign({},w,{params:Object.assign({},m,w.params),pathname:wn([h,d.encodeLocation?d.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?h:wn([h,d.encodeLocation?d.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),f,a,u);return i&&b?y.createElement(Ll.Provider,{value:{location:fr({pathname:"/",search:"",hash:"",state:null,key:"default"},x),navigationType:kn.Pop}},b):b}function Zh(){let r=im(),i=Hh(r)?r.status+" "+r.statusText:r instanceof Error?r.message:JSON.stringify(r),a=r instanceof Error?r.stack:null,d={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},i),a?y.createElement("pre",{style:d},a):null,null)}const Xh=y.createElement(Zh,null);class em extends y.Component{constructor(i){super(i),this.state={location:i.location,revalidation:i.revalidation,error:i.error}}static getDerivedStateFromError(i){return{error:i}}static getDerivedStateFromProps(i,a){return a.location!==i.location||a.revalidation!=="idle"&&i.revalidation==="idle"?{error:i.error,location:i.location,revalidation:i.revalidation}:{error:i.error!==void 0?i.error:a.error,location:a.location,revalidation:i.revalidation||a.revalidation}}componentDidCatch(i,a){console.error("React Router caught the following error during render",i,a)}render(){return this.state.error!==void 0?y.createElement(Xt.Provider,{value:this.props.routeContext},y.createElement(Od.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function tm(r){let{routeContext:i,match:a,children:u}=r,d=y.useContext(Xa);return d&&d.static&&d.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(d.staticContext._deepestRenderedBoundaryId=a.route.id),y.createElement(Xt.Provider,{value:i},u)}function nm(r,i,a,u){var d;if(i===void 0&&(i=[]),a===void 0&&(a=null),u===void 0&&(u=null),r==null){var f;if(!a)return null;if(a.errors)r=a.matches;else if((f=u)!=null&&f.v7_partialHydration&&i.length===0&&!a.initialized&&a.matches.length>0)r=a.matches;else return null}let g=r,m=(d=a)==null?void 0:d.errors;if(m!=null){let x=g.findIndex(j=>j.route.id&&(m==null?void 0:m[j.route.id])!==void 0);x>=0||Ge(!1),g=g.slice(0,Math.min(g.length,x+1))}let h=!1,v=-1;if(a&&u&&u.v7_partialHydration)for(let x=0;x<g.length;x++){let j=g[x];if((j.route.HydrateFallback||j.route.hydrateFallbackElement)&&(v=x),j.route.id){let{loaderData:S,errors:P}=a,k=j.route.loader&&S[j.route.id]===void 0&&(!P||P[j.route.id]===void 0);if(j.route.lazy||k){h=!0,v>=0?g=g.slice(0,v+1):g=[g[0]];break}}}return g.reduceRight((x,j,S)=>{let P,k=!1,b=null,w=null;a&&(P=m&&j.route.id?m[j.route.id]:void 0,b=j.route.errorElement||Xh,h&&(v<0&&S===0?(om("route-fallback"),k=!0,w=null):v===S&&(k=!0,w=j.route.hydrateFallbackElement||null)));let $=i.concat(g.slice(0,S+1)),W=()=>{let A;return P?A=b:k?A=w:j.route.Component?A=y.createElement(j.route.Component,null):j.route.element?A=j.route.element:A=x,y.createElement(tm,{match:j,routeContext:{outlet:x,matches:$,isDataRoute:a!=null},children:A})};return a&&(j.route.ErrorBoundary||j.route.errorElement||S===0)?y.createElement(em,{location:a.location,revalidation:a.revalidation,component:b,error:P,children:W(),routeContext:{outlet:null,matches:$,isDataRoute:!0}}):W()},null)}var Md=(function(r){return r.UseBlocker="useBlocker",r.UseRevalidator="useRevalidator",r.UseNavigateStable="useNavigate",r})(Md||{}),Dd=(function(r){return r.UseBlocker="useBlocker",r.UseLoaderData="useLoaderData",r.UseActionData="useActionData",r.UseRouteError="useRouteError",r.UseNavigation="useNavigation",r.UseRouteLoaderData="useRouteLoaderData",r.UseMatches="useMatches",r.UseRevalidator="useRevalidator",r.UseNavigateStable="useNavigate",r.UseRouteId="useRouteId",r})(Dd||{});function sm(r){let i=y.useContext(Xa);return i||Ge(!1),i}function rm(r){let i=y.useContext(qh);return i||Ge(!1),i}function lm(r){let i=y.useContext(Xt);return i||Ge(!1),i}function Fd(r){let i=lm(),a=i.matches[i.matches.length-1];return a.route.id||Ge(!1),a.route.id}function im(){var r;let i=y.useContext(Od),a=rm(),u=Fd();return i!==void 0?i:(r=a.errors)==null?void 0:r[u]}function am(){let{router:r}=sm(Md.UseNavigateStable),i=Fd(Dd.UseNavigateStable),a=y.useRef(!1);return zd(()=>{a.current=!0}),y.useCallback(function(d,f){f===void 0&&(f={}),a.current&&(typeof d=="number"?r.navigate(d):r.navigate(d,fr({fromRouteId:i},f)))},[r,i])}const hd={};function om(r,i,a){hd[r]||(hd[r]=!0)}function cm(r,i){r==null||r.v7_startTransition,r==null||r.v7_relativeSplatPath}function um(r){let{to:i,replace:a,state:u,relative:d}=r;vs()||Ge(!1);let{future:f,static:g}=y.useContext(Nn),{matches:m}=y.useContext(Xt),{pathname:h}=xs(),v=Ut(),x=Za(i,Ya(m,f.v7_relativeSplatPath),h,d==="path"),j=JSON.stringify(x);return y.useEffect(()=>v(JSON.parse(j),{replace:a,state:u,relative:d}),[v,j,d,a,u]),null}function jn(r){Ge(!1)}function dm(r){let{basename:i="/",children:a=null,location:u,navigationType:d=kn.Pop,navigator:f,static:g=!1,future:m}=r;vs()&&Ge(!1);let h=i.replace(/^\/*/,"/"),v=y.useMemo(()=>({basename:h,navigator:f,static:g,future:fr({v7_relativeSplatPath:!1},m)}),[h,m,f,g]);typeof u=="string"&&(u=gs(u));let{pathname:x="/",search:j="",hash:S="",state:P=null,key:k="default"}=u,b=y.useMemo(()=>{let w=Ja(x,h);return w==null?null:{location:{pathname:w,search:j,hash:S,state:P,key:k},navigationType:d}},[h,x,j,S,P,k,d]);return b==null?null:y.createElement(Nn.Provider,{value:v},y.createElement(Ll.Provider,{children:a,value:b}))}function fm(r){let{children:i,location:a}=r;return Jh(Ma(i),a)}new Promise(()=>{});function Ma(r,i){i===void 0&&(i=[]);let a=[];return y.Children.forEach(r,(u,d)=>{if(!y.isValidElement(u))return;let f=[...i,d];if(u.type===y.Fragment){a.push.apply(a,Ma(u.props.children,f));return}u.type!==jn&&Ge(!1),!u.props.index||!u.props.children||Ge(!1);let g={id:u.props.id||f.join("-"),caseSensitive:u.props.caseSensitive,element:u.props.element,Component:u.props.Component,index:u.props.index,path:u.props.path,loader:u.props.loader,action:u.props.action,errorElement:u.props.errorElement,ErrorBoundary:u.props.ErrorBoundary,hasErrorBoundary:u.props.ErrorBoundary!=null||u.props.errorElement!=null,shouldRevalidate:u.props.shouldRevalidate,handle:u.props.handle,lazy:u.props.lazy};u.props.children&&(g.children=Ma(u.props.children,f)),a.push(g)}),a}/**
|
|
59
59
|
* React Router DOM v6.30.6
|
|
60
60
|
*
|
|
61
61
|
* Copyright (c) Remix Software Inc.
|
|
@@ -64,42 +64,42 @@ Error generating stack: `+c.message+`
|
|
|
64
64
|
* LICENSE.md file in the root directory of this source tree.
|
|
65
65
|
*
|
|
66
66
|
* @license MIT
|
|
67
|
-
*/function Da(){return Da=Object.assign?Object.assign.bind():function(r){for(var i=1;i<arguments.length;i++){var a=arguments[i];for(var u in a)({}).hasOwnProperty.call(a,u)&&(r[u]=a[u])}return r},Da.apply(null,arguments)}function pm(r,i){if(r==null)return{};var a={};for(var u in r)if({}.hasOwnProperty.call(r,u)){if(i.indexOf(u)!==-1)continue;a[u]=r[u]}return a}function hm(r){return!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)}function mm(r,i){return r.button===0&&(!i||i==="_self")&&!hm(r)}function Fa(r){return r===void 0&&(r=""),new URLSearchParams(typeof r=="string"||Array.isArray(r)||r instanceof URLSearchParams?r:Object.keys(r).reduce((i,a)=>{let u=r[a];return i.concat(Array.isArray(u)?u.map(d=>[a,d]):[[a,u]])},[]))}function gm(r,i){let a=Fa(r);return i&&i.forEach((u,d)=>{a.has(d)||i.getAll(d).forEach(f=>{a.append(d,f)})}),a}const vm=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],xm="6";try{window.__reactRouterVersion=xm}catch{}const ym="startTransition",md=gh[ym];function jm(r){let{basename:i,children:a,future:u,window:d}=r,f=y.useRef();f.current==null&&(f.current=wh({window:d,v5Compat:!0}));let g=f.current,[m,h]=y.useState({action:g.action,location:g.location}),{v7_startTransition:v}=u||{},x=y.useCallback(k=>{v&&md?md(()=>h(k)):h(k)},[h,v]);return y.useLayoutEffect(()=>g.listen(x),[g,x]),y.useEffect(()=>cm(u),[u]),y.createElement(dm,{basename:i,children:a,location:m.location,navigationType:m.action,navigator:g,future:u})}const km=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",wm=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Mn=y.forwardRef(function(i,a){let{onClick:u,relative:d,reloadDocument:f,replace:g,state:m,target:h,to:v,preventScrollReset:x,viewTransition:k}=i,N=pm(i,vm),{basename:C}=y.useContext(Nn),j,T=!1;if(typeof v=="string"&&wm.test(v)&&(j=v,km))try{let A=new URL(window.location.href),Y=v.startsWith("//")?new URL(A.protocol+v):new URL(v),M=Ja(Y.pathname,C);Y.origin===A.origin&&M!=null?v=M+Y.search+Y.hash:T=!0}catch{}let S=Qh(v,{relative:d}),I=Nm(v,{replace:g,state:m,target:h,preventScrollReset:x,relative:d,viewTransition:k});function W(A){u&&u(A),A.defaultPrevented||I(A)}return y.createElement("a",Da({},N,{href:j||S,onClick:T||f?u:W,ref:a,target:h}))});var gd;(function(r){r.UseScrollRestoration="useScrollRestoration",r.UseSubmit="useSubmit",r.UseSubmitFetcher="useSubmitFetcher",r.UseFetcher="useFetcher",r.useViewTransitionState="useViewTransitionState"})(gd||(gd={}));var vd;(function(r){r.UseFetcher="useFetcher",r.UseFetchers="useFetchers",r.UseScrollRestoration="useScrollRestoration"})(vd||(vd={}));function Nm(r,i){let{target:a,replace:u,state:d,preventScrollReset:f,relative:g,viewTransition:m}=i===void 0?{}:i,h=Ut(),v=xs(),x=Ad(r,{relative:g});return y.useCallback(k=>{if(mm(k,a)){k.preventDefault();let N=u!==void 0?u:Cl(v)===Cl(x);h(r,{replace:N,state:d,preventScrollReset:f,relative:g,viewTransition:m})}},[v,h,x,u,d,a,r,f,g,m])}function Sm(r){let i=y.useRef(Fa(r)),a=y.useRef(!1),u=xs(),d=y.useMemo(()=>gm(u.search,a.current?null:i.current),[u.search]),f=Ut(),g=y.useCallback((m,h)=>{const v=Fa(typeof m=="function"?m(d):m);a.current=!0,f("?"+v,h)},[f,d]);return[d,g]}function Be(r){try{return JSON.parse(r.meta||"{}")}catch{return{}}}function ms(r){return r.openSuggestions??r.open_suggestions??0}function Bd(r){return{...r,sectionId:r.sectionId??r.section_id??void 0,quoteBefore:r.quoteBefore??r.quote_before??void 0,quoteAfter:r.quoteAfter??r.quote_after??void 0}}async function G(r,i){const a={...i==null?void 0:i.headers};(i==null?void 0:i.body)!=null&&(a["Content-Type"]="application/json");const u=await fetch(r,{...i,headers:a});if(!u.ok){let f=`${u.status}`;try{f=(await u.json()).error??f}catch{}throw new Error(f)}return(u.headers.get("content-type")??"").includes("application/json")?await u.json():await u.text()}const z={meta:()=>G("/api/meta"),listProjects:()=>G("/api/projects"),createProject:(r,i="")=>G("/api/projects",{method:"POST",body:JSON.stringify({name:r,description:i})}),getProject:r=>G(`/api/projects/${r}`),deleteProject:r=>G(`/api/projects/${r}`,{method:"DELETE"}),createSample:()=>G("/api/sample",{method:"POST"}),graph:r=>G(`/api/projects/${r}/graph`),createDocument:(r,i)=>G(`/api/projects/${r}/documents`,{method:"POST",body:JSON.stringify(i)}),getDocument:r=>G(`/api/documents/${r}`),renameDocument:(r,i)=>G(`/api/documents/${r}`,{method:"PATCH",body:JSON.stringify({title:i})}),deleteDocument:r=>G(`/api/documents/${r}`,{method:"DELETE"}),addSection:(r,i,a="")=>G(`/api/documents/${r}/sections`,{method:"POST",body:JSON.stringify({heading:i,body:a})}),updateSection:(r,i)=>G(`/api/sections/${r}`,{method:"PATCH",body:JSON.stringify(i)}),deleteSection:r=>G(`/api/sections/${r}`,{method:"DELETE"}),reorderSections:(r,i)=>G(`/api/documents/${r}/sections/reorder`,{method:"POST",body:JSON.stringify({orderedIds:i})}),parentContext:r=>G(`/api/documents/${r}/context/parent`),refreshContext:r=>G(`/api/documents/${r}/context/refresh`,{method:"POST",body:JSON.stringify({mode:"context-only"})}),versions:r=>G(`/api/documents/${r}/versions`),restoreVersion:(r,i)=>G(`/api/documents/${r}/versions/${i}/restore`,{method:"POST"}),undo:r=>G(`/api/documents/${r}/undo`,{method:"POST"}),templates:()=>G("/api/templates"),saveTemplate:r=>G(`/api/templates/${r.id}`,{method:"PUT",body:JSON.stringify(r)}),deleteTemplate:r=>G(`/api/templates/${r}`,{method:"DELETE"}),startInterview:r=>G(`/api/documents/${r}/interview`,{method:"POST"}),getInterview:r=>G(`/api/documents/${r}/interview`),answer:(r,i)=>G(`/api/interview/${r}/answer`,{method:"POST",body:JSON.stringify(i)}),completeInterview:r=>G(`/api/interview/${r}/complete`,{method:"POST"}),setAiMode:r=>G("/api/settings/ai-mode",{method:"PUT",body:JSON.stringify({mode:r})}),saveOpenaiEndpoint:(r,i)=>G("/api/settings/openai-endpoint",{method:"PUT",body:JSON.stringify({baseUrl:r,headers:i})}),openaiModels:()=>G("/api/settings/openai-models"),openrouterModels:()=>G("/api/settings/openrouter-models"),testCli:()=>G("/api/settings/cli/test",{method:"POST"}),setAgentBin:r=>G("/api/settings/agent-bin",{method:"PUT",body:JSON.stringify({path:r})}),keys:()=>G("/api/keys"),saveKey:(r,i,a="")=>G(`/api/keys/${r}`,{method:"PUT",body:JSON.stringify({key:i,label:a})}),deleteKey:r=>G(`/api/keys/${r}`,{method:"DELETE"}),testKey:(r,i)=>G(`/api/keys/${r}/test`,{method:"POST",body:JSON.stringify({model:i})}),settings:()=>G("/api/settings"),saveModels:r=>G("/api/settings/models",{method:"PUT",body:JSON.stringify(r)}),completeOnboarding:()=>G("/api/settings/onboarding/complete",{method:"POST"}),backupHref:"/api/backup",restore:r=>G("/api/restore",{method:"POST",body:JSON.stringify({data:r})}),suggestions:(r,i="open")=>G(`/api/documents/${r}/suggestions?status=${encodeURIComponent(i)}`),acceptSuggestion:r=>G(`/api/suggestions/${r}/accept`,{method:"POST"}),rejectSuggestion:r=>G(`/api/suggestions/${r}/reject`,{method:"POST"}),rewriteSuggestion:(r,i)=>G(`/api/suggestions/${r}/rewrite`,{method:"POST",body:JSON.stringify({instruction:i})}).then(a=>Bd(a.suggestion)),acceptAllSuggestions:r=>G(`/api/documents/${r}/accept-all`,{method:"POST"}),createShare:(r,i)=>G(`/api/documents/${r}/shares`,{method:"POST",body:JSON.stringify({expiresInHours:i})}),listShares:r=>G(`/api/documents/${r}/shares`),revokeShare:r=>G(`/api/shares/${r}/revoke`,{method:"POST"}),items:r=>G(`/api/documents/${r}/items`),createItem:(r,i)=>G(`/api/documents/${r}/items`,{method:"POST",body:JSON.stringify(i)}),updateItem:(r,i)=>G(`/api/items/${r}`,{method:"PATCH",body:JSON.stringify(i)}),deleteItem:r=>G(`/api/items/${r}`,{method:"DELETE"}),acceptItem:r=>G(`/api/items/${r}/accept`,{method:"POST"}),rejectItem:r=>G(`/api/items/${r}/reject`,{method:"POST"}),restoreItem:r=>G(`/api/items/${r}/restore`,{method:"POST"}),editLink:(r,i,a,u)=>G(`/api/items/${r}/link`,{method:"POST",body:JSON.stringify({field:i,ref:a,op:u})}),setStepPage:(r,i)=>G(`/api/items/${r}/step-page`,{method:"POST",body:JSON.stringify({page:i})}),setSection:(r,i)=>G(`/api/items/${r}/section`,{method:"POST",body:JSON.stringify({section:i})}),projectReqs:r=>G(`/api/projects/${r}/reqs`),linkFeatureToFlow:(r,i)=>G(`/api/items/${r}/link-feature`,{method:"POST",body:JSON.stringify({featureRef:i})}),unlinkFeatureFromFlow:(r,i)=>G(`/api/items/${r}/unlink-feature`,{method:"POST",body:JSON.stringify({featureRef:i})}),lint:r=>G(`/api/projects/${r}/lint`),lintSuggest:r=>G(`/api/projects/${r}/lint/suggest`,{method:"POST"}),lintWaiveAll:r=>G(`/api/projects/${r}/lint/waive-all`,{method:"POST"}),lintWaiveOne:(r,i)=>G(`/api/projects/${r}/lint/waive`,{method:"POST",body:JSON.stringify({key:i})}),wireframes:r=>G(`/api/projects/${r}/wireframes`),styleGuide:r=>G(`/api/projects/${r}/style-guide`),saveStyleGuide:(r,i)=>G(`/api/projects/${r}/style-guide`,{method:"PUT",body:JSON.stringify(i)}),exportProjectUrl:r=>`/api/projects/${r}/export`,importProject:r=>G("/api/projects/import",{method:"POST",body:JSON.stringify(r)}),designSystem:r=>G(`/api/projects/${r}/design-system`),generateDesignSystem:r=>G(`/api/documents/${r}/design-system/generate`,{method:"POST"}),acceptDesignSystem:r=>G(`/api/documents/${r}/design-system/accept`,{method:"POST"}),exploreDesignSystems:r=>G(`/api/documents/${r}/design-system/explore`,{method:"POST"}),selectDesignSystem:(r,i)=>G(`/api/documents/${r}/design-system/select`,{method:"POST",body:JSON.stringify({index:i})}),mockups:r=>G(`/api/projects/${r}/mockups`),mockup:(r,i)=>G(`/api/projects/${r}/mockups/${i}`),generateMockup:r=>G(`/api/items/${r}/mockup`,{method:"POST"}),acceptMockup:r=>G(`/api/items/${r}/mockup/accept`,{method:"POST"}),rejectMockup:r=>G(`/api/items/${r}/mockup/reject`,{method:"POST"}),compileHandoff:r=>G(`/api/projects/${r}/handoff`,{method:"POST"}),promptPackHref:r=>`/api/projects/${r}/handoff/prompt-pack`,hub:r=>G(`/api/projects/${r}/hub`),sampleDeliverables:()=>G("/api/sample/deliverables",{method:"POST"})};function Ud(r,i){const a=new EventSource(r);return a.addEventListener("section_start",u=>{var d;return(d=i.onSectionStart)==null?void 0:d.call(i,JSON.parse(u.data))}),a.addEventListener("token",u=>{var d;return(d=i.onToken)==null?void 0:d.call(i,JSON.parse(u.data))}),a.addEventListener("section_end",u=>{var d;return(d=i.onSectionEnd)==null?void 0:d.call(i,JSON.parse(u.data))}),a.addEventListener("done",()=>{var u;(u=i.onDone)==null||u.call(i),a.close()}),a.addEventListener("error",u=>{var f,g;const d=u.data;if(d)try{(f=i.onError)==null||f.call(i,JSON.parse(d).message)}catch{(g=i.onError)==null||g.call(i,"stream error")}a.close()}),a}const Cm=(r,i)=>Ud(`/api/documents/${r}/draft/stream`,i),Em=(r,i)=>Ud(`/api/sections/${r}/regenerate/stream`,i);function Pm(r,i){const a=new EventSource(`/api/documents/${r}/items/generate/stream`);return a.addEventListener("item",u=>{var d;return(d=i.onItem)==null?void 0:d.call(i,JSON.parse(u.data).item)}),a.addEventListener("done",u=>{var d,f;try{(d=i.onDone)==null||d.call(i,JSON.parse(u.data).count??0)}catch{(f=i.onDone)==null||f.call(i,0)}a.close()}),a.addEventListener("error",u=>{var f,g;const d=u.data;if(d)try{(f=i.onError)==null||f.call(i,JSON.parse(d).message)}catch{(g=i.onError)==null||g.call(i,"stream error")}a.close()}),a}async function Wd(r){const i=r.trim(),a=i.length>40?`${i.slice(0,40)}…`:i,u=await z.createProject(a,i),d=await z.createDocument(u.id,{type:"prd",title:"제품 요구사항"});try{await z.startInterview(d.id)}catch{}return`/projects/${u.id}/documents/${d.id}`}const Vd="drafting.lastDoc",Hd="drafting.openMode";function bm(r){try{localStorage.setItem(Vd,JSON.stringify(r))}catch{}}function _m(){try{const r=localStorage.getItem(Vd);if(!r)return null;const i=JSON.parse(r);return i&&i.pid&&i.did?i:null}catch{return null}}function Kd(){try{return localStorage.getItem(Hd)==="resume"?"resume":"start"}catch{return"start"}}function xd(r){try{localStorage.setItem(Hd,r)}catch{}}const Tm="수락하지 않은 문장은 문서에 없습니다";function xt({crumb:r,tbarRight:i,nav:a,panel:u,tagline:d,statusLeft:f,statusRight:g,children:m}){const[h,v]=y.useState(!1),[x,k]=y.useState(!1),N=!!a,C=!!u;return s.jsxs("div",{className:"app",children:[s.jsxs("header",{className:"tbar",children:[s.jsxs("span",{className:"lights",children:[s.jsx("i",{}),s.jsx("i",{}),s.jsx("i",{})]}),N&&s.jsx("button",{className:"btn ghost sm nav-toggle",onClick:()=>v(j=>!j),title:"탐색 열기",children:"트리"}),s.jsx("span",{className:"crumb",children:r}),s.jsxs("span",{className:"right",children:[i,C&&s.jsx("button",{className:"btn ghost panel-toggle",onClick:()=>k(j=>!j),title:"제안 패널 열기",children:"제안"})]})]}),s.jsxs("div",{className:`shell ${C?"":"no-panel"} ${N?"":"no-nav"}`,children:[N&&s.jsxs(s.Fragment,{children:[s.jsx("nav",{className:`nav ${h?"open":""}`,onClick:()=>v(!1),children:a}),h&&s.jsx("div",{className:"panel-scrim",onClick:()=>v(!1)})]}),m,C&&s.jsxs(s.Fragment,{children:[s.jsx("aside",{className:`panel ${x?"open":""}`,children:u}),x&&s.jsx("div",{className:"panel-scrim",onClick:()=>k(!1)})]})]}),s.jsxs("footer",{className:"statusbar",children:[f,s.jsx("span",{className:"sg",children:d??Tm}),s.jsx("span",{className:"r",children:g})]})]})}const Re="var(--ink)",hs="var(--sug)",El="var(--paper)",qd=3.2,yd=2.9,ps=2.1,$a=2,Qd=2.7,Pl=2.3,An=s.jsx("rect",{x:"31",y:"16",width:"58",height:"88",rx:"15",fill:El,stroke:Re,strokeWidth:qd}),Ba=s.jsxs(s.Fragment,{children:[s.jsx("circle",{className:"ch-eye",cx:"50",cy:"45",r:"3.6",fill:Re}),s.jsx("circle",{className:"ch-eye",cx:"70",cy:"45",r:"3.6",fill:Re})]}),Ua=s.jsx("path",{d:"M55 54 q5 4.5 10 0",stroke:Re,strokeWidth:ps,fill:"none",strokeLinecap:"round"}),Rm=s.jsx("circle",{cx:"47",cy:"76",r:"5.4",fill:hs}),ir=s.jsxs(s.Fragment,{children:[Rm,s.jsx("line",{x1:"57",y1:"76",x2:"75",y2:"76",stroke:Re,strokeWidth:Qd,strokeLinecap:"round"})]}),Wa=s.jsxs(s.Fragment,{children:[s.jsx("path",{d:"M46 44 q4 -4.5 8 0",stroke:Re,strokeWidth:Pl,fill:"none",strokeLinecap:"round"}),s.jsx("path",{d:"M66 44 q4 -4.5 8 0",stroke:Re,strokeWidth:Pl,fill:"none",strokeLinecap:"round"})]}),Gd=s.jsx("g",{className:"ch-tag",children:s.jsxs("g",{transform:"rotate(-9 60 60)",children:[s.jsx("rect",{x:"46",y:"52",width:"28",height:"15",rx:"5",fill:hs}),s.jsx("line",{x1:"52",y1:"59.5",x2:"68",y2:"59.5",stroke:El,strokeWidth:"2.4",strokeLinecap:"round"})]})});function Lm(r){switch(r){case"base":return{tilt:-2,body:s.jsxs(s.Fragment,{children:[An,Ba,Ua,ir]})};case"greet":return{tilt:-5,body:s.jsxs("g",{className:"ch-rock",children:[s.jsx("path",{d:"M46 16 h27 l16 16 v57 a15 15 0 0 1 -15 15 h-28 a15 15 0 0 1 -15 -15 v-58 a15 15 0 0 1 15 -15 z",fill:El,stroke:Re,strokeWidth:qd,strokeLinejoin:"round"}),s.jsx("path",{d:"M73 16 v16 h16 z",fill:"var(--sug-bg)",stroke:Re,strokeWidth:yd,strokeLinejoin:"round"}),Ba,s.jsx("path",{d:"M53 55 q7 6.5 14 0",stroke:Re,strokeWidth:ps,fill:"none",strokeLinecap:"round"}),ir]})};case"fetch":return{tilt:-2,body:s.jsxs(s.Fragment,{children:[An,Wa,Gd]})};case"write":return{tilt:3,body:s.jsxs(s.Fragment,{children:[An,s.jsx("circle",{className:"ch-eye",cx:"50",cy:"48",r:"3.2",fill:Re}),s.jsx("circle",{className:"ch-eye",cx:"70",cy:"48",r:"3.2",fill:Re}),s.jsx("line",{x1:"57",y1:"56",x2:"66",y2:"56",stroke:Re,strokeWidth:$a,strokeLinecap:"round"}),s.jsx("line",{className:"ch-draw",pathLength:1,x1:"45",y1:"78",x2:"63",y2:"78",stroke:Re,strokeWidth:Qd,strokeLinecap:"round"}),s.jsx("g",{className:"ch-pen",children:s.jsxs("g",{transform:"rotate(38 66 78)",children:[s.jsx("rect",{x:"63",y:"56",width:"7",height:"19",rx:"2",fill:Re}),s.jsx("path",{d:"M63 78 l3.5 7 l3.5 -7 z",fill:hs})]})})]})};case"think":return{tilt:-2,body:s.jsxs(s.Fragment,{children:[An,s.jsx("circle",{className:"ch-eye",cx:"49",cy:"41",r:"3.6",fill:Re}),s.jsx("circle",{className:"ch-eye",cx:"69",cy:"41",r:"3.6",fill:Re}),s.jsx("line",{x1:"56",y1:"55",x2:"64",y2:"55",stroke:Re,strokeWidth:$a,strokeLinecap:"round"}),ir,s.jsx("circle",{className:"ch-td",cx:"95",cy:"26",r:"3",fill:Re}),s.jsx("circle",{className:"ch-td ch-td2",cx:"104",cy:"19",r:"3.6",fill:Re}),s.jsx("circle",{className:"ch-td ch-td3",cx:"112",cy:"11",r:"4.2",fill:Re})]})};case"wait":return{tilt:6,body:s.jsxs("g",{className:"ch-bob",children:[An,s.jsx("path",{d:"M46 46 q4 3.5 8 0",stroke:Re,strokeWidth:ps,fill:"none",strokeLinecap:"round"}),s.jsx("path",{d:"M66 46 q4 3.5 8 0",stroke:Re,strokeWidth:ps,fill:"none",strokeLinecap:"round"}),s.jsx("line",{x1:"56",y1:"56",x2:"64",y2:"56",stroke:Re,strokeWidth:$a,strokeLinecap:"round"}),ir]})};case"done":return{tilt:0,body:s.jsxs(s.Fragment,{children:[An,Wa,s.jsx("path",{d:"M53 54 q7 6 14 0",stroke:Re,strokeWidth:ps,fill:"none",strokeLinecap:"round"}),ir,s.jsx("path",{className:"ch-sp",d:"M100 22 l2.4 6 l6 2.4 l-6 2.4 l-2.4 6 l-2.4 -6 l-6 -2.4 l6 -2.4 z",fill:hs}),s.jsx("path",{className:"ch-sp ch-sp2",d:"M108 44 l1.6 4 l4 1.6 l-4 1.6 l-1.6 4 l-1.6 -4 l-4 -1.6 l4 -1.6 z",fill:hs})]})};case"error":return{tilt:0,body:s.jsxs("g",{className:"ch-shiver",children:[s.jsx("path",{d:"M36 24 l14 -7 l11 6 l13 -5 l12 9 l-4 14 l5 12 l-6 13 l4 13 l-11 12 l-13 -4 l-12 6 l-11 -9 l3 -13 l-5 -12 l6 -12 l-6 -11 z",fill:El,stroke:Re,strokeWidth:yd,strokeLinejoin:"round"}),s.jsx("path",{d:"M50 40 l18 14 M52 66 l14 -8",stroke:Re,strokeWidth:"1.6",opacity:".25"}),s.jsx("path",{d:"M46 46 l7 7 M53 46 l-7 7",stroke:Re,strokeWidth:Pl,strokeLinecap:"round"}),s.jsx("path",{d:"M66 48 l7 7 M73 48 l-7 7",stroke:Re,strokeWidth:Pl,strokeLinecap:"round"}),s.jsx("path",{d:"M56 68 q5 -3.5 10 0",stroke:Re,strokeWidth:ps,fill:"none",strokeLinecap:"round"})]})}}}function $m(r,i){const a=r==="fetch"?Wa:Ba,u=r==="fetch"?Gd:i?Ua:s.jsxs(s.Fragment,{children:[Ua,s.jsx("circle",{cx:"60",cy:"76",r:"5.4",fill:hs})]});return{tilt:-2,body:s.jsxs(s.Fragment,{children:[An,a,u]})}}function Ke({pose:r="base",size:i=64,animate:a=!0,className:u=""}){const d=i<48&&r!=="error"?$m(r,i<24):Lm(r);return s.jsx("svg",{className:`ch ${a?"":"ch-static"} ${u}`,width:i,height:i,viewBox:"0 0 120 120",role:"img","aria-label":"초안이",children:s.jsx("g",{transform:`rotate(${d.tilt} 60 60)`,children:d.body})})}const Im="Drafting";function $l({mark:r=!0,className:i=""}){return s.jsxs("span",{className:`app-name ${i}`,children:[r&&s.jsx(Ke,{pose:"base",size:20,animate:!1,className:"logo-ch"}),Im]})}function Om(){const{meta:r}=zl(),i=Ut(),[a,u]=y.useState(null),[d,f]=y.useState(""),[g,m]=y.useState(!1),[h,v]=y.useState(""),[x,k]=y.useState(null),N=y.useRef(!1);y.useEffect(()=>{const A=_m();if(k(A),!N.current&&Kd()==="resume"&&A){N.current=!0,i(`/projects/${A.pid}/documents/${A.did}`,{replace:!0});return}z.listProjects().then(u).catch(()=>u([]))},[i]);async function C(){if(!(!d.trim()||g)){m(!0),v("");try{i(await Wd(d))}catch(A){v((A==null?void 0:A.message)??"생성에 실패했습니다"),m(!1)}}}async function j(){try{const{project:A,documentId:Y}=await z.createSample();i(Y?`/projects/${A.id}/documents/${Y}`:`/projects/${A.id}`)}catch(A){v((A==null?void 0:A.message)??"예시 생성에 실패했습니다")}}const T=a??[],S=T.length>0,I=T.some(A=>A.name.startsWith("예시:")),W=T.reduce((A,Y)=>A+ms(Y),0);return s.jsx(xt,{crumb:s.jsx($l,{}),tbarRight:s.jsxs(s.Fragment,{children:[W>0&&s.jsxs("span",{className:"sug-count",children:[s.jsx("i",{}),"제안 ",W]}),s.jsx(Mn,{className:"btn",to:"/settings",children:"설정"}),s.jsx("span",{className:"cmdk",children:"⌘K"})]}),tagline:"수락하지 않은 문장은 문서에 없습니다",statusLeft:S?s.jsxs("span",{children:[T.length,"개 프로젝트"]}):s.jsx("span",{children:"첫 실행"}),statusRight:s.jsxs(s.Fragment,{children:[(r==null?void 0:r.aiStub)&&s.jsx("span",{children:"STUB AI"}),s.jsxs("span",{children:["v",(r==null?void 0:r.version)??"…"]})]}),children:s.jsx("main",{className:"start",children:s.jsxs("div",{className:"start-in",children:[s.jsx(Ke,{pose:"greet",size:92,className:"start-ch"}),s.jsx("h1",{children:"무엇을 만들까요?"}),s.jsxs("p",{className:"start-phil",children:["한 줄이면 제가 인터뷰를 열게요. AI가 쓴 모든 것은 제안으로 들어오고,",s.jsx("br",{}),s.jsx("b",{children:"수락해야만 문서가 됩니다."})," 이름과 범위는 인터뷰에서 정리돼요."]}),s.jsxs("div",{className:"idea-box",children:[s.jsx("input",{className:"idea-input",placeholder:"예: 회의실 예약이 매번 겹쳐서 정리하는 도구가 필요해요",value:d,onChange:A=>f(A.target.value),onKeyDown:A=>A.key==="Enter"&&C(),autoFocus:!0}),s.jsx("button",{className:"btn pri idea-go",disabled:!d.trim()||g,onClick:C,children:g?"만드는 중…":"인터뷰 시작"})]}),h&&s.jsx("div",{className:"form-error",children:h}),s.jsx("div",{className:"start-import",children:s.jsxs("label",{className:"btn ghost sm",children:["프로젝트 가져오기 (.drafting)",s.jsx("input",{type:"file",accept:".drafting,application/json",style:{display:"none"},onChange:async A=>{var M;const Y=(M=A.target.files)==null?void 0:M[0];if(Y)try{const Z=JSON.parse(await Y.text()),{projectId:H}=await z.importProject(Z);i(`/projects/${H}`)}catch{v("가져오기 실패 · 올바른 .drafting 파일인지 확인하세요")}}})]})}),x&&s.jsxs("button",{className:"start-card resume",onClick:()=>i(`/projects/${x.pid}/documents/${x.did}`),children:[s.jsx("span",{className:"k mono",children:"이어서"}),s.jsxs("span",{className:"t",children:[s.jsx("b",{children:x.projectName}),s.jsx("span",{children:x.docTitle})]}),s.jsx("span",{className:"open mono",children:"열기"})]}),!I&&s.jsxs("button",{className:"start-card sample",onClick:j,children:[s.jsx("span",{className:"sdot"}),s.jsxs("span",{className:"t",children:[s.jsx("b",{children:"예시 기획서: 주간 리포트 봇"}),s.jsx("span",{children:"제안 3건이 검토를 기다리는 샘플 · 수락과 거절을 여기서 연습하세요"})]}),s.jsx("span",{className:"open mono",children:"둘러보기"})]}),S&&s.jsxs("div",{className:"start-projects",children:[s.jsx("div",{className:"grp-line mono",children:"기획 프로젝트"}),T.map(A=>{const Y=ms(A);return s.jsxs("button",{className:"start-row",onClick:()=>i(`/projects/${A.id}`),children:[s.jsx("span",{className:"nm",children:A.name}),A.description&&A.description!==A.name&&s.jsx("span",{className:"ds",children:A.description}),s.jsx("span",{className:"sp"}),Y>0&&s.jsxs("span",{className:"gd mono",children:[s.jsx("i",{}),Y]}),s.jsxs("span",{className:"dc mono",children:["문서 ",A.documentCount??0]})]},A.id)})]})]})})})}function zm({currentId:r,currentName:i}){const a=Ut(),[u,d]=y.useState(!1),[f,g]=y.useState(null);y.useEffect(()=>{d(!1),g(null)},[r]);function m(){const h=!u;d(h),h&&f===null&&z.listProjects().then(g).catch(()=>g([]))}return s.jsxs("div",{className:"switcher",children:[s.jsxs("div",{className:"sw-bar",children:[s.jsxs("button",{className:"sw-cur",onClick:m,title:"프로젝트 전환",children:[s.jsx("b",{children:i}),s.jsx("span",{className:"car",children:u?"▴":"▾"})]}),s.jsx("button",{className:"sw-plus",onClick:ff,title:"새 기획 (⌘N)",children:"+"})]}),u&&s.jsxs("div",{className:"sw-menu",children:[f===null?s.jsx("div",{className:"sw-empty",children:"불러오는 중…"}):f.map(h=>{const v=ms(h);return s.jsxs("button",{className:`sw-item ${h.id===r?"on":""}`,onClick:()=>{d(!1),a(`/projects/${h.id}`)},children:[s.jsx("span",{className:"nm",children:h.name}),v>0&&s.jsxs("span",{className:"gd",children:[s.jsx("i",{}),v]})]},h.id)}),s.jsx("button",{className:"sw-item alt",onClick:()=>{d(!1),a("/")},children:s.jsx("span",{className:"nm",children:"시작 화면"})})]})]})}const Am=[{key:"INT",type:"prd",label:"아이디어 인터뷰",dim:!0},{key:"PRD",type:"prd",label:"제품 요구사항"},{key:"SPEC",type:"feature-spec",label:"기능명세서"},{key:"IA",type:"ia",label:"정보 구조"},{key:"FLOW",type:"user-flow",label:"유저 플로우"},{key:"DS",type:"design-system",label:"디자인 시스템"}];function Mm(r,i){var a,u,d,f,g,m,h,v,x;return r==="feature-spec"?((a=i.prd)==null?void 0:a.id)??null:r==="ia"?((u=i["feature-spec"])==null?void 0:u.id)??((d=i.prd)==null?void 0:d.id)??null:r==="user-flow"?((f=i.ia)==null?void 0:f.id)??((g=i["feature-spec"])==null?void 0:g.id)??((m=i.prd)==null?void 0:m.id)??null:r==="design-system"?((h=i["user-flow"])==null?void 0:h.id)??((v=i.ia)==null?void 0:v.id)??((x=i.prd)==null?void 0:x.id)??null:null}const Dm={prd:"제품 요구사항","feature-spec":"기능명세서",ia:"정보 구조","user-flow":"유저 플로우","design-system":"디자인 시스템",handoff:"개발 지시서"};function ys({projectId:r,projectName:i,documents:a,active:u,activeCount:d}){const f=Ut(),[g,m]=y.useState(null),[h,v]=y.useState(!1),x={};for(const C of a)x[C.type]||(x[C.type]=C);y.useEffect(()=>{z.lint(r).then(C=>m(C.effectiveCount)).catch(()=>m(null))},[r,a.length]);async function k(C){if(h)return;let j=x[C.type];if(!j){v(!0);try{j=await z.createDocument(r,{type:C.type,title:Dm[C.type],parentDocumentId:Mm(C.type,x)})}finally{v(!1)}}f(`/projects/${r}/documents/${j.id}`)}function N(C){const j=x[C.type];return j?u===C.key&&d!=null?d:ms(j):0}return s.jsxs("div",{className:"dnav",children:[s.jsx(zm,{currentId:r,currentName:i}),s.jsx("div",{className:"grp",children:"산출물"}),Am.map(C=>{const j=C.key==="INT"?0:N(C),T=!!x[C.type];return s.jsxs("button",{className:`node ${u===C.key?"on":""} ${C.dim?"dim":""}`,onClick:()=>k(C),children:[s.jsx("span",{className:"tb",children:C.key}),s.jsx("span",{className:"nm",children:C.label}),j>0?s.jsxs("span",{className:"gd",children:[s.jsx("i",{}),j]}):T||C.key==="INT"?s.jsx("span",{className:"ok",children:"✓"}):null]},C.key)}),s.jsx("div",{className:"grp",children:"파생"}),s.jsxs("button",{className:`node ${u==="WF"?"on":""}`,onClick:()=>f(`/projects/${r}/wireframes`),children:[s.jsx("span",{className:"tb der",children:"WF"}),s.jsx("span",{className:"nm",children:"와이어프레임"}),s.jsx("span",{className:"auto",children:"자동"})]}),s.jsxs("button",{className:`node ${u==="DEV"?"on":""}`,onClick:()=>f(`/projects/${r}/handoff`),children:[s.jsx("span",{className:"tb der",children:"DEV"}),s.jsx("span",{className:"nm",children:"개발 지시서"}),g&&g>0?s.jsxs("span",{className:"lock",children:["검사 ",g,"건"]}):s.jsx("span",{className:"auto",children:"준비"})]}),s.jsx("div",{className:"navsp"}),s.jsx("button",{className:`hubln ${u==="HUB"?"on":""}`,onClick:()=>f(`/projects/${r}`),children:"◧ 산출물 허브"})]})}const Fm=[{key:"prd",badge:"PRD",title:"제품 요구사항"},{key:"feature-spec",badge:"SPEC",title:"기능명세서"},{key:"ia",badge:"IA",title:"정보 구조"},{key:"user-flow",badge:"FLOW",title:"유저 플로우"}];function Bm({roll:r}){const i=Math.max(r.total,1),a=Array.from({length:i},(u,d)=>d<r.accepted?"acc":d<r.accepted+r.proposed?"prop":"");return s.jsx("div",{className:"hbar",children:a.map((u,d)=>s.jsx("i",{className:u},d))})}function Um(){const{pid:r}=Fn(),i=Ut(),[a,u]=y.useState(null),[d,f]=y.useState(null),[g,m]=y.useState(!1),h=y.useCallback(async()=>{if(!r)return;const[C,j]=await Promise.all([z.getProject(r),z.hub(r).catch(()=>null)]);u(C),f(j)},[r]);y.useEffect(()=>{h().catch(()=>{})},[h]);async function v(){var C;if(!(!r||g)){m(!0);try{await z.lintSuggest(r);const j=(C=d==null?void 0:d.perDoc["feature-spec"])==null?void 0:C.documentId;j?i(`/projects/${r}/documents/${j}`):await h()}finally{m(!1)}}}function x(){const C=d==null?void 0:d.nextAction;!C||!r||(C.target==="handoff"?i(`/projects/${r}/handoff`):C.target==="document"&&C.documentId&&i(`/projects/${r}/documents/${C.documentId}`))}if(!a)return s.jsx(xt,{crumb:s.jsx("span",{children:"불러오는 중…"}),children:s.jsx("main",{className:"hub-main",children:s.jsx("div",{className:"center-empty",children:"불러오는 중…"})})});const k=d==null?void 0:d.lint,N=d==null?void 0:d.derived.handoff;return s.jsx(xt,{crumb:s.jsxs(s.Fragment,{children:[s.jsx("b",{className:"name",children:a.name}),s.jsx("span",{className:"sep",children:"/"}),s.jsx("span",{children:"산출물 허브"})]}),tbarRight:s.jsx("span",{className:"cmdk",children:"⌘K"}),nav:s.jsx(ys,{projectId:r,projectName:a.name,documents:a.documents,active:"HUB"}),tagline:"수락된 것만 문서 · 파생물은 수락분에서 자동 갱신",children:s.jsxs("main",{className:"hub-main",children:[s.jsx("div",{className:"eyebrow",children:"Deliverables"}),s.jsxs("div",{className:"hub-head",children:[s.jsx("h1",{className:"hub-h1",children:"산출물 6종"}),r&&s.jsx("a",{className:"btn ghost sm",href:z.exportProjectUrl(r),title:"전체 상태를 .drafting 파일로 — 다른 기기로 이동",children:"내보내기"})]}),s.jsx("div",{className:"hub-sub",children:"수락된 것만 문서 · 파생물은 수락분에서 자동 갱신"}),(d==null?void 0:d.nextAction)&&s.jsxs("div",{className:`next-action na-${d.nextAction.kind}`,children:[s.jsx(Ke,{pose:d.nextAction.kind==="done"?"done":"fetch",size:40}),s.jsxs("div",{className:"na-body",children:[s.jsx("div",{className:"na-eyebrow",children:"다음 할 일"}),s.jsx("b",{children:d.nextAction.label}),s.jsx("span",{children:d.nextAction.detail})]}),d.nextAction.target!=="none"&&s.jsx("button",{className:"na-go",onClick:x,children:"이어서 →"})]}),s.jsxs("div",{className:"hubgrid",children:[Fm.map(C=>{const j=d==null?void 0:d.perDoc[C.key];return s.jsxs("button",{className:"hcard",onClick:()=>(j==null?void 0:j.documentId)&&i(`/projects/${r}/documents/${j.documentId}`),children:[s.jsxs("div",{className:"ht",children:[s.jsx("span",{className:"tb",children:C.badge}),s.jsx("b",{children:C.title}),(j==null?void 0:j.stale)&&s.jsx("span",{className:"hpill stale",children:"재검토"}),j&&(j.openSuggestions??0)>0&&s.jsxs("span",{className:"hpill sug",children:["제안 ",j.openSuggestions]})]}),j?s.jsx(Bm,{roll:j}):s.jsx("div",{className:"hbar"}),s.jsxs("div",{className:"hfoot",children:[s.jsxs("span",{children:["수락 ",(j==null?void 0:j.accepted)??0,j&&j.proposed>0&&s.jsxs(s.Fragment,{children:[" · ",s.jsxs("b",{style:{color:"var(--sug)"},children:["제안 ",j.proposed]})]})]}),s.jsx("span",{className:"sp"}),s.jsx("span",{className:"st",children:j!=null&&j.documentId?"":"미생성"})]})]},C.key)}),s.jsxs("button",{className:"hcard",onClick:()=>i(`/projects/${r}/wireframes`),children:[s.jsxs("div",{className:"ht",children:[s.jsx("span",{className:"tb der",children:"WF"}),s.jsx("b",{children:"와이어프레임"})]}),s.jsxs("div",{className:"hfoot",style:{marginTop:2},children:[s.jsxs("span",{children:["IA 수락분에서 ",s.jsx("b",{children:"자동 렌더"})]}),s.jsx("span",{className:"sp"}),s.jsxs("span",{className:"st",children:["화면 ",(d==null?void 0:d.derived.wireframes.count)??0]})]}),s.jsxs("div",{className:"wfrow",children:[s.jsx("span",{className:"sk block"}),s.jsx("span",{className:"sk block"}),s.jsx("span",{className:"sk block"})]})]}),s.jsxs("button",{className:`hcard ${N!=null&&N.locked?"locked":""}`,onClick:()=>i(`/projects/${r}/handoff`),children:[s.jsxs("div",{className:"ht",children:[s.jsx("span",{className:"tb der",children:"DEV"}),s.jsx("b",{children:"개발 지시서"})]}),s.jsxs("div",{className:"hfoot",style:{marginTop:2},children:[N!=null&&N.locked?s.jsxs("span",{style:{color:"var(--warn)"},children:["정합성 검사 ",N.blocking,"건 위반"]}):s.jsx("span",{children:N!=null&&N.compiled?"컴파일됨":"검사 통과 · 생성 가능"}),s.jsx("span",{className:"sp"}),s.jsx("span",{className:"st",children:N!=null&&N.locked?"잠김":"준비"})]})]})]}),k&&k.effectiveCount>0&&s.jsxs("div",{className:"gate",children:[s.jsx(Ke,{pose:"fetch",size:34}),s.jsxs("b",{children:["검사 ",k.effectiveCount,"건 위반"]}),s.jsxs("span",{children:[k.violations.filter(C=>!C.waived).slice(0,2).map(C=>`${C.refs[0]} ${C.code}`).join(" · ")," ","— 수정안을 물어왔어요."]}),s.jsxs("button",{className:"go",disabled:g,onClick:v,children:["제안 ",k.effectiveCount,"건 보기"]})]})]})})}function Va(r,i=!0){return{id:r.id,heading:r.heading,body:r.body,streaming:!1,editable:i,status:r.status??"accepted"}}const Wm={add:"추가 제안",revise:"보강 제안",delete:"삭제 제안",question:"누락 질문",stale:"재검토",lint:"정합성"};function Vm(r){return Wm[r]??"제안"}function Hm(r,i){const[a,u]=y.useState([]),[d,f]=y.useState(!1),[g,m]=y.useState(!0),h=y.useCallback(async()=>{if(r){f(!0);try{const j=await z.suggestions(r,"open"),T=Array.isArray(j)?j:Array.isArray(j==null?void 0:j.suggestions)?j.suggestions:[];u(T.map(Bd)),m(!0)}catch{u([]),m(!1)}finally{f(!1)}}},[r]);y.useEffect(()=>{h().catch(()=>{})},[h]);const v=j=>u(T=>T.filter(S=>S.id!==j)),x=y.useCallback(async j=>{await z.acceptSuggestion(j),v(j),i()},[i]),k=y.useCallback(async j=>{await z.rejectSuggestion(j),v(j),i()},[i]),N=y.useCallback(async(j,T)=>{const S=await z.rewriteSuggestion(j,T);u(I=>I.map(W=>W.id===j?S??W:W)),i()},[i]),C=y.useCallback(async()=>{r&&(await z.acceptAllSuggestions(r),u([]),i())},[r,i]);return{suggestions:a,loading:d,supported:g,reload:h,accept:x,reject:k,rewrite:N,acceptAll:C}}function Jd({template:r,session:i,onSaveAnswer:a,onGenerate:u,streaming:d}){const[f,g]=y.useState(()=>Object.fromEntries(i.answers.map(S=>[S.questionId,S.answer]))),[m,h]=y.useState(i.current_index??0),v=y.useRef({});y.useEffect(()=>{g(Object.fromEntries(i.answers.map(S=>[S.questionId,S.answer]))),h(i.current_index??0)},[i.id]);const x=r.questions,k=x[Math.min(m,x.length-1)],N=x.filter(S=>(f[S.id]??"").trim()).length,C=Math.round(N/x.length*100);function j(S){g(I=>({...I,[k.id]:S})),clearTimeout(v.current[k.id]),v.current[k.id]=setTimeout(()=>{a({questionId:k.id,question:k.prompt,answer:S,currentIndex:m})},500)}function T(S){a({questionId:k.id,question:k.prompt,answer:f[k.id]??"",currentIndex:S}),h(Math.max(0,Math.min(x.length-1,S)))}return s.jsxs("div",{className:"interview",children:[s.jsx("div",{className:"q-progress",children:s.jsx("i",{style:{width:`${C}%`}})}),s.jsxs("div",{className:"q-meta",children:[r.name," · ",N,"/",x.length," 답변"]}),s.jsxs("div",{className:"q-card",children:[s.jsxs("div",{className:"q",children:["Q",m+1,". ",k.prompt]}),s.jsx("textarea",{className:"field",autoFocus:!0,value:f[k.id]??"",onChange:S=>j(S.target.value),placeholder:k.example?`예: ${k.example}`:"답변을 입력하세요"}),(k.hint||k.example)&&s.jsxs("div",{className:"q-hint",children:[k.hint&&s.jsxs("div",{children:[s.jsx("b",{children:"힌트"})," · ",k.hint]}),k.example&&s.jsxs("div",{children:[s.jsx("b",{children:"예시"})," · ",k.example]})]}),s.jsxs("div",{className:"q-nav",children:[s.jsx("button",{className:"btn",disabled:m===0,onClick:()=>T(m-1),children:"이전"}),m<x.length-1?s.jsx("button",{className:"btn pri",onClick:()=>T(m+1),children:"다음"}):s.jsx("span",{className:"ok",style:{alignSelf:"center"},children:"마지막 질문"})]})]}),s.jsx("div",{className:"q-list",children:x.map((S,I)=>s.jsxs("button",{className:`q-list-item ${I===m?"active":""} ${(f[S.id]??"").trim()?"answered":""}`,onClick:()=>T(I),children:[s.jsx("span",{className:"dot"})," Q",I+1,". ",S.prompt.slice(0,30),S.prompt.length>30?"…":""]},S.id))}),s.jsx("button",{className:"btn pri lg interview-cta",style:{width:"100%"},disabled:d||N===0,onClick:u,children:d?"초안 생성 중…":"AI 초안 생성"}),N===0&&s.jsx("div",{className:"q-meta",style:{marginTop:8},children:"최소 1개 답변 후 생성할 수 있습니다."})]})}function eo(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Bn=eo();function Yd(r){Bn=r}var ur={exec:()=>null};function $e(r,i=""){let a=typeof r=="string"?r:r.source;const u={replace:(d,f)=>{let g=typeof f=="string"?f:f.source;return g=g.replace(dt.caret,"$1"),a=a.replace(d,g),u},getRegex:()=>new RegExp(a,i)};return u}var dt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:r=>new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}#`),htmlBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}<(?:[a-z].*>|!--)`,"i")},Km=/^(?:[ \t]*(?:\n|$))+/,qm=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Qm=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,pr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Gm=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,to=/(?:[*+-]|\d{1,9}[.)])/,Zd=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Xd=$e(Zd).replace(/bull/g,to).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Jm=$e(Zd).replace(/bull/g,to).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),no=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Ym=/^[^\n]+/,so=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Zm=$e(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",so).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Xm=$e(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,to).getRegex(),Il="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ro=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,eg=$e("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ro).replace("tag",Il).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ef=$e(no).replace("hr",pr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Il).getRegex(),tg=$e(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ef).getRegex(),lo={blockquote:tg,code:qm,def:Zm,fences:Qm,heading:Gm,hr:pr,html:eg,lheading:Xd,list:Xm,newline:Km,paragraph:ef,table:ur,text:Ym},jd=$e("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",pr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Il).getRegex(),ng={...lo,lheading:Jm,table:jd,paragraph:$e(no).replace("hr",pr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",jd).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Il).getRegex()},sg={...lo,html:$e(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ro).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ur,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:$e(no).replace("hr",pr).replace("heading",` *#{1,6} *[^
|
|
68
|
-
]`).replace("lheading",Xd).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},
|
|
67
|
+
*/function Da(){return Da=Object.assign?Object.assign.bind():function(r){for(var i=1;i<arguments.length;i++){var a=arguments[i];for(var u in a)({}).hasOwnProperty.call(a,u)&&(r[u]=a[u])}return r},Da.apply(null,arguments)}function pm(r,i){if(r==null)return{};var a={};for(var u in r)if({}.hasOwnProperty.call(r,u)){if(i.indexOf(u)!==-1)continue;a[u]=r[u]}return a}function hm(r){return!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)}function mm(r,i){return r.button===0&&(!i||i==="_self")&&!hm(r)}function Fa(r){return r===void 0&&(r=""),new URLSearchParams(typeof r=="string"||Array.isArray(r)||r instanceof URLSearchParams?r:Object.keys(r).reduce((i,a)=>{let u=r[a];return i.concat(Array.isArray(u)?u.map(d=>[a,d]):[[a,u]])},[]))}function gm(r,i){let a=Fa(r);return i&&i.forEach((u,d)=>{a.has(d)||i.getAll(d).forEach(f=>{a.append(d,f)})}),a}const vm=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],xm="6";try{window.__reactRouterVersion=xm}catch{}const ym="startTransition",md=gh[ym];function jm(r){let{basename:i,children:a,future:u,window:d}=r,f=y.useRef();f.current==null&&(f.current=wh({window:d,v5Compat:!0}));let g=f.current,[m,h]=y.useState({action:g.action,location:g.location}),{v7_startTransition:v}=u||{},x=y.useCallback(j=>{v&&md?md(()=>h(j)):h(j)},[h,v]);return y.useLayoutEffect(()=>g.listen(x),[g,x]),y.useEffect(()=>cm(u),[u]),y.createElement(dm,{basename:i,children:a,location:m.location,navigationType:m.action,navigator:g,future:u})}const km=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",wm=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Dn=y.forwardRef(function(i,a){let{onClick:u,relative:d,reloadDocument:f,replace:g,state:m,target:h,to:v,preventScrollReset:x,viewTransition:j}=i,S=pm(i,vm),{basename:P}=y.useContext(Nn),k,b=!1;if(typeof v=="string"&&wm.test(v)&&(k=v,km))try{let A=new URL(window.location.href),Y=v.startsWith("//")?new URL(A.protocol+v):new URL(v),M=Ja(Y.pathname,P);Y.origin===A.origin&&M!=null?v=M+Y.search+Y.hash:b=!0}catch{}let w=Qh(v,{relative:d}),$=Nm(v,{replace:g,state:m,target:h,preventScrollReset:x,relative:d,viewTransition:j});function W(A){u&&u(A),A.defaultPrevented||$(A)}return y.createElement("a",Da({},S,{href:k||w,onClick:b||f?u:W,ref:a,target:h}))});var gd;(function(r){r.UseScrollRestoration="useScrollRestoration",r.UseSubmit="useSubmit",r.UseSubmitFetcher="useSubmitFetcher",r.UseFetcher="useFetcher",r.useViewTransitionState="useViewTransitionState"})(gd||(gd={}));var vd;(function(r){r.UseFetcher="useFetcher",r.UseFetchers="useFetchers",r.UseScrollRestoration="useScrollRestoration"})(vd||(vd={}));function Nm(r,i){let{target:a,replace:u,state:d,preventScrollReset:f,relative:g,viewTransition:m}=i===void 0?{}:i,h=Ut(),v=xs(),x=Ad(r,{relative:g});return y.useCallback(j=>{if(mm(j,a)){j.preventDefault();let S=u!==void 0?u:Cl(v)===Cl(x);h(r,{replace:S,state:d,preventScrollReset:f,relative:g,viewTransition:m})}},[v,h,x,u,d,a,r,f,g,m])}function Sm(r){let i=y.useRef(Fa(r)),a=y.useRef(!1),u=xs(),d=y.useMemo(()=>gm(u.search,a.current?null:i.current),[u.search]),f=Ut(),g=y.useCallback((m,h)=>{const v=Fa(typeof m=="function"?m(d):m);a.current=!0,f("?"+v,h)},[f,d]);return[d,g]}function Be(r){try{return JSON.parse(r.meta||"{}")}catch{return{}}}function Fn(r){return r.openSuggestions??r.open_suggestions??0}function Bd(r){return{...r,sectionId:r.sectionId??r.section_id??void 0,quoteBefore:r.quoteBefore??r.quote_before??void 0,quoteAfter:r.quoteAfter??r.quote_after??void 0}}async function G(r,i){const a={...i==null?void 0:i.headers};(i==null?void 0:i.body)!=null&&(a["Content-Type"]="application/json");const u=await fetch(r,{...i,headers:a});if(!u.ok){let f=`${u.status}`;try{f=(await u.json()).error??f}catch{}throw new Error(f)}return(u.headers.get("content-type")??"").includes("application/json")?await u.json():await u.text()}const z={meta:()=>G("/api/meta"),listProjects:()=>G("/api/projects"),createProject:(r,i="")=>G("/api/projects",{method:"POST",body:JSON.stringify({name:r,description:i})}),getProject:r=>G(`/api/projects/${r}`),deleteProject:r=>G(`/api/projects/${r}`,{method:"DELETE"}),createSample:()=>G("/api/sample",{method:"POST"}),graph:r=>G(`/api/projects/${r}/graph`),createDocument:(r,i)=>G(`/api/projects/${r}/documents`,{method:"POST",body:JSON.stringify(i)}),getDocument:r=>G(`/api/documents/${r}`),renameDocument:(r,i)=>G(`/api/documents/${r}`,{method:"PATCH",body:JSON.stringify({title:i})}),deleteDocument:r=>G(`/api/documents/${r}`,{method:"DELETE"}),addSection:(r,i,a="")=>G(`/api/documents/${r}/sections`,{method:"POST",body:JSON.stringify({heading:i,body:a})}),updateSection:(r,i)=>G(`/api/sections/${r}`,{method:"PATCH",body:JSON.stringify(i)}),deleteSection:r=>G(`/api/sections/${r}`,{method:"DELETE"}),reorderSections:(r,i)=>G(`/api/documents/${r}/sections/reorder`,{method:"POST",body:JSON.stringify({orderedIds:i})}),parentContext:r=>G(`/api/documents/${r}/context/parent`),refreshContext:r=>G(`/api/documents/${r}/context/refresh`,{method:"POST",body:JSON.stringify({mode:"context-only"})}),versions:r=>G(`/api/documents/${r}/versions`),restoreVersion:(r,i)=>G(`/api/documents/${r}/versions/${i}/restore`,{method:"POST"}),undo:r=>G(`/api/documents/${r}/undo`,{method:"POST"}),templates:()=>G("/api/templates"),saveTemplate:r=>G(`/api/templates/${r.id}`,{method:"PUT",body:JSON.stringify(r)}),deleteTemplate:r=>G(`/api/templates/${r}`,{method:"DELETE"}),startInterview:r=>G(`/api/documents/${r}/interview`,{method:"POST"}),getInterview:r=>G(`/api/documents/${r}/interview`),answer:(r,i)=>G(`/api/interview/${r}/answer`,{method:"POST",body:JSON.stringify(i)}),completeInterview:r=>G(`/api/interview/${r}/complete`,{method:"POST"}),setAiMode:r=>G("/api/settings/ai-mode",{method:"PUT",body:JSON.stringify({mode:r})}),saveOpenaiEndpoint:(r,i)=>G("/api/settings/openai-endpoint",{method:"PUT",body:JSON.stringify({baseUrl:r,headers:i})}),openaiModels:()=>G("/api/settings/openai-models"),openrouterModels:()=>G("/api/settings/openrouter-models"),testCli:()=>G("/api/settings/cli/test",{method:"POST"}),setAgentBin:r=>G("/api/settings/agent-bin",{method:"PUT",body:JSON.stringify({path:r})}),keys:()=>G("/api/keys"),saveKey:(r,i,a="")=>G(`/api/keys/${r}`,{method:"PUT",body:JSON.stringify({key:i,label:a})}),deleteKey:r=>G(`/api/keys/${r}`,{method:"DELETE"}),testKey:(r,i)=>G(`/api/keys/${r}/test`,{method:"POST",body:JSON.stringify({model:i})}),settings:()=>G("/api/settings"),saveModels:r=>G("/api/settings/models",{method:"PUT",body:JSON.stringify(r)}),completeOnboarding:()=>G("/api/settings/onboarding/complete",{method:"POST"}),backupHref:"/api/backup",restore:r=>G("/api/restore",{method:"POST",body:JSON.stringify({data:r})}),suggestions:(r,i="open")=>G(`/api/documents/${r}/suggestions?status=${encodeURIComponent(i)}`),acceptSuggestion:r=>G(`/api/suggestions/${r}/accept`,{method:"POST"}),rejectSuggestion:r=>G(`/api/suggestions/${r}/reject`,{method:"POST"}),rewriteSuggestion:(r,i)=>G(`/api/suggestions/${r}/rewrite`,{method:"POST",body:JSON.stringify({instruction:i})}).then(a=>Bd(a.suggestion)),acceptAllSuggestions:r=>G(`/api/documents/${r}/accept-all`,{method:"POST"}),createShare:(r,i)=>G(`/api/documents/${r}/shares`,{method:"POST",body:JSON.stringify({expiresInHours:i})}),listShares:r=>G(`/api/documents/${r}/shares`),revokeShare:r=>G(`/api/shares/${r}/revoke`,{method:"POST"}),items:r=>G(`/api/documents/${r}/items`),createItem:(r,i)=>G(`/api/documents/${r}/items`,{method:"POST",body:JSON.stringify(i)}),updateItem:(r,i)=>G(`/api/items/${r}`,{method:"PATCH",body:JSON.stringify(i)}),deleteItem:r=>G(`/api/items/${r}`,{method:"DELETE"}),acceptItem:r=>G(`/api/items/${r}/accept`,{method:"POST"}),rejectItem:r=>G(`/api/items/${r}/reject`,{method:"POST"}),restoreItem:r=>G(`/api/items/${r}/restore`,{method:"POST"}),editLink:(r,i,a,u)=>G(`/api/items/${r}/link`,{method:"POST",body:JSON.stringify({field:i,ref:a,op:u})}),setStepPage:(r,i)=>G(`/api/items/${r}/step-page`,{method:"POST",body:JSON.stringify({page:i})}),setSection:(r,i)=>G(`/api/items/${r}/section`,{method:"POST",body:JSON.stringify({section:i})}),projectReqs:r=>G(`/api/projects/${r}/reqs`),linkFeatureToFlow:(r,i)=>G(`/api/items/${r}/link-feature`,{method:"POST",body:JSON.stringify({featureRef:i})}),unlinkFeatureFromFlow:(r,i)=>G(`/api/items/${r}/unlink-feature`,{method:"POST",body:JSON.stringify({featureRef:i})}),lint:r=>G(`/api/projects/${r}/lint`),lintSuggest:r=>G(`/api/projects/${r}/lint/suggest`,{method:"POST"}),lintWaiveAll:r=>G(`/api/projects/${r}/lint/waive-all`,{method:"POST"}),lintWaiveOne:(r,i)=>G(`/api/projects/${r}/lint/waive`,{method:"POST",body:JSON.stringify({key:i})}),wireframes:r=>G(`/api/projects/${r}/wireframes`),styleGuide:r=>G(`/api/projects/${r}/style-guide`),saveStyleGuide:(r,i)=>G(`/api/projects/${r}/style-guide`,{method:"PUT",body:JSON.stringify(i)}),exportProjectUrl:r=>`/api/projects/${r}/export`,importProject:r=>G("/api/projects/import",{method:"POST",body:JSON.stringify(r)}),designSystem:r=>G(`/api/projects/${r}/design-system`),generateDesignSystem:r=>G(`/api/documents/${r}/design-system/generate`,{method:"POST"}),acceptDesignSystem:r=>G(`/api/documents/${r}/design-system/accept`,{method:"POST"}),exploreDesignSystems:r=>G(`/api/documents/${r}/design-system/explore`,{method:"POST"}),selectDesignSystem:(r,i)=>G(`/api/documents/${r}/design-system/select`,{method:"POST",body:JSON.stringify({index:i})}),mockups:r=>G(`/api/projects/${r}/mockups`),mockup:(r,i)=>G(`/api/projects/${r}/mockups/${i}`),generateMockup:r=>G(`/api/items/${r}/mockup`,{method:"POST"}),acceptMockup:r=>G(`/api/items/${r}/mockup/accept`,{method:"POST"}),rejectMockup:r=>G(`/api/items/${r}/mockup/reject`,{method:"POST"}),compileHandoff:r=>G(`/api/projects/${r}/handoff`,{method:"POST"}),promptPackHref:r=>`/api/projects/${r}/handoff/prompt-pack`,hub:r=>G(`/api/projects/${r}/hub`),sampleDeliverables:()=>G("/api/sample/deliverables",{method:"POST"})};function Ud(r,i){const a=new EventSource(r);return a.addEventListener("section_start",u=>{var d;return(d=i.onSectionStart)==null?void 0:d.call(i,JSON.parse(u.data))}),a.addEventListener("token",u=>{var d;return(d=i.onToken)==null?void 0:d.call(i,JSON.parse(u.data))}),a.addEventListener("section_end",u=>{var d;return(d=i.onSectionEnd)==null?void 0:d.call(i,JSON.parse(u.data))}),a.addEventListener("done",()=>{var u;(u=i.onDone)==null||u.call(i),a.close()}),a.addEventListener("error",u=>{var f,g;const d=u.data;if(d)try{(f=i.onError)==null||f.call(i,JSON.parse(d).message)}catch{(g=i.onError)==null||g.call(i,"stream error")}a.close()}),a}const Cm=(r,i)=>Ud(`/api/documents/${r}/draft/stream`,i),Em=(r,i)=>Ud(`/api/sections/${r}/regenerate/stream`,i);function Pm(r,i){const a=new EventSource(`/api/documents/${r}/items/generate/stream`);return a.addEventListener("item",u=>{var d;return(d=i.onItem)==null?void 0:d.call(i,JSON.parse(u.data).item)}),a.addEventListener("done",u=>{var d,f;try{(d=i.onDone)==null||d.call(i,JSON.parse(u.data).count??0)}catch{(f=i.onDone)==null||f.call(i,0)}a.close()}),a.addEventListener("error",u=>{var f,g;const d=u.data;if(d)try{(f=i.onError)==null||f.call(i,JSON.parse(d).message)}catch{(g=i.onError)==null||g.call(i,"stream error")}a.close()}),a}async function Wd(r){const i=r.trim(),a=i.length>40?`${i.slice(0,40)}…`:i,u=await z.createProject(a,i),d=await z.createDocument(u.id,{type:"prd",title:"제품 요구사항"});try{await z.startInterview(d.id)}catch{}return`/projects/${u.id}/documents/${d.id}`}const Vd="drafting.lastDoc",Hd="drafting.openMode";function bm(r){try{localStorage.setItem(Vd,JSON.stringify(r))}catch{}}function _m(){try{const r=localStorage.getItem(Vd);if(!r)return null;const i=JSON.parse(r);return i&&i.pid&&i.did?i:null}catch{return null}}function Kd(){try{return localStorage.getItem(Hd)==="resume"?"resume":"start"}catch{return"start"}}function xd(r){try{localStorage.setItem(Hd,r)}catch{}}const Tm="수락하지 않은 문장은 문서에 없습니다";function xt({crumb:r,tbarRight:i,nav:a,panel:u,tagline:d,statusLeft:f,statusRight:g,children:m}){const[h,v]=y.useState(!1),[x,j]=y.useState(!1),S=!!a,P=!!u;return s.jsxs("div",{className:"app",children:[s.jsxs("header",{className:"tbar",children:[s.jsxs("span",{className:"lights",children:[s.jsx("i",{}),s.jsx("i",{}),s.jsx("i",{})]}),S&&s.jsx("button",{className:"btn ghost sm nav-toggle",onClick:()=>v(k=>!k),title:"탐색 열기",children:"트리"}),s.jsx("span",{className:"crumb",children:r}),s.jsxs("span",{className:"right",children:[i,P&&s.jsx("button",{className:"btn ghost panel-toggle",onClick:()=>j(k=>!k),title:"제안 패널 열기",children:"제안"})]})]}),s.jsxs("div",{className:`shell ${P?"":"no-panel"} ${S?"":"no-nav"}`,children:[S&&s.jsxs(s.Fragment,{children:[s.jsx("nav",{className:`nav ${h?"open":""}`,onClick:()=>v(!1),children:a}),h&&s.jsx("div",{className:"panel-scrim",onClick:()=>v(!1)})]}),m,P&&s.jsxs(s.Fragment,{children:[s.jsx("aside",{className:`panel ${x?"open":""}`,children:u}),x&&s.jsx("div",{className:"panel-scrim",onClick:()=>j(!1)})]})]}),s.jsxs("footer",{className:"statusbar",children:[f,s.jsx("span",{className:"sg",children:d??Tm}),s.jsx("span",{className:"r",children:g})]})]})}const Re="var(--ink)",ms="var(--sug)",El="var(--paper)",qd=3.2,yd=2.9,hs=2.1,$a=2,Qd=2.7,Pl=2.3,Mn=s.jsx("rect",{x:"31",y:"16",width:"58",height:"88",rx:"15",fill:El,stroke:Re,strokeWidth:qd}),Ba=s.jsxs(s.Fragment,{children:[s.jsx("circle",{className:"ch-eye",cx:"50",cy:"45",r:"3.6",fill:Re}),s.jsx("circle",{className:"ch-eye",cx:"70",cy:"45",r:"3.6",fill:Re})]}),Ua=s.jsx("path",{d:"M55 54 q5 4.5 10 0",stroke:Re,strokeWidth:hs,fill:"none",strokeLinecap:"round"}),Rm=s.jsx("circle",{cx:"47",cy:"76",r:"5.4",fill:ms}),ir=s.jsxs(s.Fragment,{children:[Rm,s.jsx("line",{x1:"57",y1:"76",x2:"75",y2:"76",stroke:Re,strokeWidth:Qd,strokeLinecap:"round"})]}),Wa=s.jsxs(s.Fragment,{children:[s.jsx("path",{d:"M46 44 q4 -4.5 8 0",stroke:Re,strokeWidth:Pl,fill:"none",strokeLinecap:"round"}),s.jsx("path",{d:"M66 44 q4 -4.5 8 0",stroke:Re,strokeWidth:Pl,fill:"none",strokeLinecap:"round"})]}),Gd=s.jsx("g",{className:"ch-tag",children:s.jsxs("g",{transform:"rotate(-9 60 60)",children:[s.jsx("rect",{x:"46",y:"52",width:"28",height:"15",rx:"5",fill:ms}),s.jsx("line",{x1:"52",y1:"59.5",x2:"68",y2:"59.5",stroke:El,strokeWidth:"2.4",strokeLinecap:"round"})]})});function Lm(r){switch(r){case"base":return{tilt:-2,body:s.jsxs(s.Fragment,{children:[Mn,Ba,Ua,ir]})};case"greet":return{tilt:-5,body:s.jsxs("g",{className:"ch-rock",children:[s.jsx("path",{d:"M46 16 h27 l16 16 v57 a15 15 0 0 1 -15 15 h-28 a15 15 0 0 1 -15 -15 v-58 a15 15 0 0 1 15 -15 z",fill:El,stroke:Re,strokeWidth:qd,strokeLinejoin:"round"}),s.jsx("path",{d:"M73 16 v16 h16 z",fill:"var(--sug-bg)",stroke:Re,strokeWidth:yd,strokeLinejoin:"round"}),Ba,s.jsx("path",{d:"M53 55 q7 6.5 14 0",stroke:Re,strokeWidth:hs,fill:"none",strokeLinecap:"round"}),ir]})};case"fetch":return{tilt:-2,body:s.jsxs(s.Fragment,{children:[Mn,Wa,Gd]})};case"write":return{tilt:3,body:s.jsxs(s.Fragment,{children:[Mn,s.jsx("circle",{className:"ch-eye",cx:"50",cy:"48",r:"3.2",fill:Re}),s.jsx("circle",{className:"ch-eye",cx:"70",cy:"48",r:"3.2",fill:Re}),s.jsx("line",{x1:"57",y1:"56",x2:"66",y2:"56",stroke:Re,strokeWidth:$a,strokeLinecap:"round"}),s.jsx("line",{className:"ch-draw",pathLength:1,x1:"45",y1:"78",x2:"63",y2:"78",stroke:Re,strokeWidth:Qd,strokeLinecap:"round"}),s.jsx("g",{className:"ch-pen",children:s.jsxs("g",{transform:"rotate(38 66 78)",children:[s.jsx("rect",{x:"63",y:"56",width:"7",height:"19",rx:"2",fill:Re}),s.jsx("path",{d:"M63 78 l3.5 7 l3.5 -7 z",fill:ms})]})})]})};case"think":return{tilt:-2,body:s.jsxs(s.Fragment,{children:[Mn,s.jsx("circle",{className:"ch-eye",cx:"49",cy:"41",r:"3.6",fill:Re}),s.jsx("circle",{className:"ch-eye",cx:"69",cy:"41",r:"3.6",fill:Re}),s.jsx("line",{x1:"56",y1:"55",x2:"64",y2:"55",stroke:Re,strokeWidth:$a,strokeLinecap:"round"}),ir,s.jsx("circle",{className:"ch-td",cx:"95",cy:"26",r:"3",fill:Re}),s.jsx("circle",{className:"ch-td ch-td2",cx:"104",cy:"19",r:"3.6",fill:Re}),s.jsx("circle",{className:"ch-td ch-td3",cx:"112",cy:"11",r:"4.2",fill:Re})]})};case"wait":return{tilt:6,body:s.jsxs("g",{className:"ch-bob",children:[Mn,s.jsx("path",{d:"M46 46 q4 3.5 8 0",stroke:Re,strokeWidth:hs,fill:"none",strokeLinecap:"round"}),s.jsx("path",{d:"M66 46 q4 3.5 8 0",stroke:Re,strokeWidth:hs,fill:"none",strokeLinecap:"round"}),s.jsx("line",{x1:"56",y1:"56",x2:"64",y2:"56",stroke:Re,strokeWidth:$a,strokeLinecap:"round"}),ir]})};case"done":return{tilt:0,body:s.jsxs(s.Fragment,{children:[Mn,Wa,s.jsx("path",{d:"M53 54 q7 6 14 0",stroke:Re,strokeWidth:hs,fill:"none",strokeLinecap:"round"}),ir,s.jsx("path",{className:"ch-sp",d:"M100 22 l2.4 6 l6 2.4 l-6 2.4 l-2.4 6 l-2.4 -6 l-6 -2.4 l6 -2.4 z",fill:ms}),s.jsx("path",{className:"ch-sp ch-sp2",d:"M108 44 l1.6 4 l4 1.6 l-4 1.6 l-1.6 4 l-1.6 -4 l-4 -1.6 l4 -1.6 z",fill:ms})]})};case"error":return{tilt:0,body:s.jsxs("g",{className:"ch-shiver",children:[s.jsx("path",{d:"M36 24 l14 -7 l11 6 l13 -5 l12 9 l-4 14 l5 12 l-6 13 l4 13 l-11 12 l-13 -4 l-12 6 l-11 -9 l3 -13 l-5 -12 l6 -12 l-6 -11 z",fill:El,stroke:Re,strokeWidth:yd,strokeLinejoin:"round"}),s.jsx("path",{d:"M50 40 l18 14 M52 66 l14 -8",stroke:Re,strokeWidth:"1.6",opacity:".25"}),s.jsx("path",{d:"M46 46 l7 7 M53 46 l-7 7",stroke:Re,strokeWidth:Pl,strokeLinecap:"round"}),s.jsx("path",{d:"M66 48 l7 7 M73 48 l-7 7",stroke:Re,strokeWidth:Pl,strokeLinecap:"round"}),s.jsx("path",{d:"M56 68 q5 -3.5 10 0",stroke:Re,strokeWidth:hs,fill:"none",strokeLinecap:"round"})]})}}}function $m(r,i){const a=r==="fetch"?Wa:Ba,u=r==="fetch"?Gd:i?Ua:s.jsxs(s.Fragment,{children:[Ua,s.jsx("circle",{cx:"60",cy:"76",r:"5.4",fill:ms})]});return{tilt:-2,body:s.jsxs(s.Fragment,{children:[Mn,a,u]})}}function Ke({pose:r="base",size:i=64,animate:a=!0,className:u=""}){const d=i<48&&r!=="error"?$m(r,i<24):Lm(r);return s.jsx("svg",{className:`ch ${a?"":"ch-static"} ${u}`,width:i,height:i,viewBox:"0 0 120 120",role:"img","aria-label":"초안이",children:s.jsx("g",{transform:`rotate(${d.tilt} 60 60)`,children:d.body})})}const Im="Drafting";function $l({mark:r=!0,className:i=""}){return s.jsxs("span",{className:`app-name ${i}`,children:[r&&s.jsx(Ke,{pose:"base",size:20,animate:!1,className:"logo-ch"}),Im]})}function Om(){const{meta:r}=zl(),i=Ut(),[a,u]=y.useState(null),[d,f]=y.useState(""),[g,m]=y.useState(!1),[h,v]=y.useState(""),[x,j]=y.useState(null),S=y.useRef(!1);y.useEffect(()=>{const A=_m();if(j(A),!S.current&&Kd()==="resume"&&A){S.current=!0,i(`/projects/${A.pid}/documents/${A.did}`,{replace:!0});return}z.listProjects().then(u).catch(()=>u([]))},[i]);async function P(){if(!(!d.trim()||g)){m(!0),v("");try{i(await Wd(d))}catch(A){v((A==null?void 0:A.message)??"생성에 실패했습니다"),m(!1)}}}async function k(){try{const{project:A,documentId:Y}=await z.createSample();i(Y?`/projects/${A.id}/documents/${Y}`:`/projects/${A.id}`)}catch(A){v((A==null?void 0:A.message)??"예시 생성에 실패했습니다")}}const b=a??[],w=b.length>0,$=b.some(A=>A.name.startsWith("예시:")),W=b.reduce((A,Y)=>A+Fn(Y),0);return s.jsx(xt,{crumb:s.jsx($l,{}),tbarRight:s.jsxs(s.Fragment,{children:[W>0&&s.jsxs("span",{className:"sug-count",children:[s.jsx("i",{}),"제안 ",W]}),s.jsx(Dn,{className:"btn",to:"/settings",children:"설정"}),s.jsx("span",{className:"cmdk",children:"⌘K"})]}),tagline:"수락하지 않은 문장은 문서에 없습니다",statusLeft:w?s.jsxs("span",{children:[b.length,"개 프로젝트"]}):s.jsx("span",{children:"첫 실행"}),statusRight:s.jsxs(s.Fragment,{children:[(r==null?void 0:r.aiStub)&&s.jsx("span",{children:"STUB AI"}),s.jsxs("span",{children:["v",(r==null?void 0:r.version)??"…"]})]}),children:s.jsx("main",{className:"start",children:s.jsxs("div",{className:"start-in",children:[s.jsx(Ke,{pose:"greet",size:92,className:"start-ch"}),s.jsx("h1",{children:"무엇을 만들까요?"}),s.jsxs("p",{className:"start-phil",children:["한 줄이면 제가 인터뷰를 열게요. AI가 쓴 모든 것은 제안으로 들어오고,",s.jsx("br",{}),s.jsx("b",{children:"수락해야만 문서가 됩니다."})," 이름과 범위는 인터뷰에서 정리돼요."]}),s.jsxs("div",{className:"idea-box",children:[s.jsx("input",{className:"idea-input",placeholder:"예: 회의실 예약이 매번 겹쳐서 정리하는 도구가 필요해요",value:d,onChange:A=>f(A.target.value),onKeyDown:A=>A.key==="Enter"&&P(),autoFocus:!0}),s.jsx("button",{className:"btn pri idea-go",disabled:!d.trim()||g,onClick:P,children:g?"만드는 중…":"인터뷰 시작"})]}),h&&s.jsx("div",{className:"form-error",children:h}),s.jsx("div",{className:"start-import",children:s.jsxs("label",{className:"btn ghost sm",children:["프로젝트 가져오기 (.drafting)",s.jsx("input",{type:"file",accept:".drafting,application/json",style:{display:"none"},onChange:async A=>{var M;const Y=(M=A.target.files)==null?void 0:M[0];if(Y)try{const Z=JSON.parse(await Y.text()),{projectId:H}=await z.importProject(Z);i(`/projects/${H}`)}catch{v("가져오기 실패 · 올바른 .drafting 파일인지 확인하세요")}}})]})}),x&&s.jsxs("button",{className:"start-card resume",onClick:()=>i(`/projects/${x.pid}/documents/${x.did}`),children:[s.jsx("span",{className:"k mono",children:"이어서"}),s.jsxs("span",{className:"t",children:[s.jsx("b",{children:x.projectName}),s.jsx("span",{children:x.docTitle})]}),s.jsx("span",{className:"open mono",children:"열기"})]}),!$&&s.jsxs("button",{className:"start-card sample",onClick:k,children:[s.jsx("span",{className:"sdot"}),s.jsxs("span",{className:"t",children:[s.jsx("b",{children:"예시 기획서: 주간 리포트 봇"}),s.jsx("span",{children:"제안 3건이 검토를 기다리는 샘플 · 수락과 거절을 여기서 연습하세요"})]}),s.jsx("span",{className:"open mono",children:"둘러보기"})]}),w&&s.jsxs("div",{className:"start-projects",children:[s.jsx("div",{className:"grp-line mono",children:"기획 프로젝트"}),b.map(A=>{const Y=Fn(A);return s.jsxs("button",{className:"start-row",onClick:()=>i(`/projects/${A.id}`),children:[s.jsx("span",{className:"nm",children:A.name}),A.description&&A.description!==A.name&&s.jsx("span",{className:"ds",children:A.description}),s.jsx("span",{className:"sp"}),Y>0&&s.jsxs("span",{className:"gd mono",children:[s.jsx("i",{}),Y]}),s.jsxs("span",{className:"dc mono",children:["문서 ",A.documentCount??0]})]},A.id)})]})]})})})}const zm={prd:"PRD","feature-spec":"SPEC",ia:"IA","user-flow":"FLOW","design-system":"DS",handoff:"DEV"};function Am({currentId:r,currentName:i}){const a=Ut(),[u,d]=y.useState(!1),[f,g]=y.useState(null);y.useEffect(()=>{d(!1),g(null)},[r]);function m(){const h=!u;d(h),h&&f===null&&z.listProjects().then(g).catch(()=>g([]))}return s.jsxs("div",{className:"switcher",children:[s.jsxs("div",{className:"sw-bar",children:[s.jsxs("button",{className:"sw-cur",onClick:m,title:"프로젝트 전환",children:[s.jsx("b",{children:i}),s.jsx("span",{className:"car",children:u?"▴":"▾"})]}),s.jsx("button",{className:"sw-plus",onClick:ff,title:"새 기획 (⌘N)",children:"+"})]}),u&&s.jsxs("div",{className:"sw-menu",children:[f===null?s.jsx("div",{className:"sw-empty",children:"불러오는 중…"}):f.map(h=>{const v=Fn(h);return s.jsxs("button",{className:`sw-item ${h.id===r?"on":""}`,onClick:()=>{d(!1),a(`/projects/${h.id}`)},children:[s.jsx("span",{className:"nm",children:h.name}),v>0&&s.jsxs("span",{className:"gd",children:[s.jsx("i",{}),v]})]},h.id)}),s.jsx("button",{className:"sw-item alt",onClick:()=>{d(!1),a("/")},children:s.jsx("span",{className:"nm",children:"시작 화면"})})]})]})}const Mm=[{key:"INT",type:"prd",label:"아이디어 인터뷰",dim:!0},{key:"PRD",type:"prd",label:"제품 요구사항"},{key:"SPEC",type:"feature-spec",label:"기능명세서"},{key:"IA",type:"ia",label:"정보 구조"},{key:"FLOW",type:"user-flow",label:"유저 플로우"},{key:"DS",type:"design-system",label:"디자인 시스템"}];function Dm(r,i){var a,u,d,f,g,m,h,v,x;return r==="feature-spec"?((a=i.prd)==null?void 0:a.id)??null:r==="ia"?((u=i["feature-spec"])==null?void 0:u.id)??((d=i.prd)==null?void 0:d.id)??null:r==="user-flow"?((f=i.ia)==null?void 0:f.id)??((g=i["feature-spec"])==null?void 0:g.id)??((m=i.prd)==null?void 0:m.id)??null:r==="design-system"?((h=i["user-flow"])==null?void 0:h.id)??((v=i.ia)==null?void 0:v.id)??((x=i.prd)==null?void 0:x.id)??null:null}const Fm={prd:"제품 요구사항","feature-spec":"기능명세서",ia:"정보 구조","user-flow":"유저 플로우","design-system":"디자인 시스템",handoff:"개발 지시서"};function ys({projectId:r,projectName:i,documents:a,active:u,activeCount:d}){const f=Ut(),{did:g}=Sn(),[m,h]=y.useState(null),[v,x]=y.useState(!1),j={};for(const b of a)j[b.type]||(j[b.type]=b);const S=a.filter(b=>{var w;return((w=j[b.type])==null?void 0:w.id)!==b.id});y.useEffect(()=>{z.lint(r).then(b=>h(b.effectiveCount)).catch(()=>h(null))},[r,a.length]);async function P(b){if(v)return;let w=j[b.type];if(!w){x(!0);try{w=await z.createDocument(r,{type:b.type,title:Fm[b.type],parentDocumentId:Dm(b.type,j)})}finally{x(!1)}}f(`/projects/${r}/documents/${w.id}`)}function k(b){const w=j[b.type];return w?u===b.key&&d!=null?d:Fn(w):0}return s.jsxs("div",{className:"dnav",children:[s.jsx(Am,{currentId:r,currentName:i}),s.jsx("div",{className:"grp",children:"산출물"}),Mm.map(b=>{const w=b.key==="INT"?0:k(b),$=!!j[b.type];return s.jsxs("button",{className:`node ${u===b.key?"on":""} ${b.dim?"dim":""}`,onClick:()=>P(b),children:[s.jsx("span",{className:"tb",children:b.key}),s.jsx("span",{className:"nm",children:b.label}),w>0?s.jsxs("span",{className:"gd",children:[s.jsx("i",{}),w]}):$||b.key==="INT"?s.jsx("span",{className:"ok",children:"✓"}):null]},b.key)}),S.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grp",children:"기타 문서"}),S.map(b=>{const w=Fn(b);return s.jsxs("button",{className:`node ${b.id===g?"on":""}`,onClick:()=>f(`/projects/${r}/documents/${b.id}`),children:[s.jsx("span",{className:"tb",children:zm[b.type]}),s.jsx("span",{className:"nm",children:b.title}),w>0?s.jsxs("span",{className:"gd",children:[s.jsx("i",{}),w]}):s.jsx("span",{className:"ok",children:"✓"})]},b.id)})]}),s.jsx("div",{className:"grp",children:"파생"}),s.jsxs("button",{className:`node ${u==="WF"?"on":""}`,onClick:()=>f(`/projects/${r}/wireframes`),children:[s.jsx("span",{className:"tb der",children:"WF"}),s.jsx("span",{className:"nm",children:"와이어프레임"}),s.jsx("span",{className:"auto",children:"자동"})]}),s.jsxs("button",{className:`node ${u==="DEV"?"on":""}`,onClick:()=>f(`/projects/${r}/handoff`),children:[s.jsx("span",{className:"tb der",children:"DEV"}),s.jsx("span",{className:"nm",children:"개발 지시서"}),m&&m>0?s.jsxs("span",{className:"lock",children:["검사 ",m,"건"]}):s.jsx("span",{className:"auto",children:"준비"})]}),s.jsx("div",{className:"navsp"}),s.jsx("button",{className:`hubln ${u==="HUB"?"on":""}`,onClick:()=>f(`/projects/${r}`),children:"◧ 산출물 허브"})]})}const Bm=[{key:"prd",badge:"PRD",title:"제품 요구사항"},{key:"feature-spec",badge:"SPEC",title:"기능명세서"},{key:"ia",badge:"IA",title:"정보 구조"},{key:"user-flow",badge:"FLOW",title:"유저 플로우"}];function Um({roll:r}){const i=Math.max(r.total,1),a=Array.from({length:i},(u,d)=>d<r.accepted?"acc":d<r.accepted+r.proposed?"prop":"");return s.jsx("div",{className:"hbar",children:a.map((u,d)=>s.jsx("i",{className:u},d))})}function Wm(){const{pid:r}=Sn(),i=Ut(),[a,u]=y.useState(null),[d,f]=y.useState(null),[g,m]=y.useState(!1),h=y.useCallback(async()=>{if(!r)return;const[P,k]=await Promise.all([z.getProject(r),z.hub(r).catch(()=>null)]);u(P),f(k)},[r]);y.useEffect(()=>{h().catch(()=>{})},[h]);async function v(){var P;if(!(!r||g)){m(!0);try{await z.lintSuggest(r);const k=(P=d==null?void 0:d.perDoc["feature-spec"])==null?void 0:P.documentId;k?i(`/projects/${r}/documents/${k}`):await h()}finally{m(!1)}}}function x(){const P=d==null?void 0:d.nextAction;!P||!r||(P.target==="handoff"?i(`/projects/${r}/handoff`):P.target==="document"&&P.documentId&&i(`/projects/${r}/documents/${P.documentId}`))}if(!a)return s.jsx(xt,{crumb:s.jsx("span",{children:"불러오는 중…"}),children:s.jsx("main",{className:"hub-main",children:s.jsx("div",{className:"center-empty",children:"불러오는 중…"})})});const j=d==null?void 0:d.lint,S=d==null?void 0:d.derived.handoff;return s.jsx(xt,{crumb:s.jsxs(s.Fragment,{children:[s.jsx("b",{className:"name",children:a.name}),s.jsx("span",{className:"sep",children:"/"}),s.jsx("span",{children:"산출물 허브"})]}),tbarRight:s.jsx("span",{className:"cmdk",children:"⌘K"}),nav:s.jsx(ys,{projectId:r,projectName:a.name,documents:a.documents,active:"HUB"}),tagline:"수락된 것만 문서 · 파생물은 수락분에서 자동 갱신",children:s.jsxs("main",{className:"hub-main",children:[s.jsx("div",{className:"eyebrow",children:"Deliverables"}),s.jsxs("div",{className:"hub-head",children:[s.jsx("h1",{className:"hub-h1",children:"산출물 6종"}),r&&s.jsx("a",{className:"btn ghost sm",href:z.exportProjectUrl(r),title:"전체 상태를 .drafting 파일로 — 다른 기기로 이동",children:"내보내기"})]}),s.jsx("div",{className:"hub-sub",children:"수락된 것만 문서 · 파생물은 수락분에서 자동 갱신"}),(d==null?void 0:d.nextAction)&&s.jsxs("div",{className:`next-action na-${d.nextAction.kind}`,children:[s.jsx(Ke,{pose:d.nextAction.kind==="done"?"done":"fetch",size:40}),s.jsxs("div",{className:"na-body",children:[s.jsx("div",{className:"na-eyebrow",children:"다음 할 일"}),s.jsx("b",{children:d.nextAction.label}),s.jsx("span",{children:d.nextAction.detail})]}),d.nextAction.target!=="none"&&s.jsx("button",{className:"na-go",onClick:x,children:"이어서 →"})]}),s.jsxs("div",{className:"hubgrid",children:[Bm.map(P=>{const k=d==null?void 0:d.perDoc[P.key];return s.jsxs("button",{className:"hcard",onClick:()=>(k==null?void 0:k.documentId)&&i(`/projects/${r}/documents/${k.documentId}`),children:[s.jsxs("div",{className:"ht",children:[s.jsx("span",{className:"tb",children:P.badge}),s.jsx("b",{children:P.title}),(k==null?void 0:k.stale)&&s.jsx("span",{className:"hpill stale",children:"재검토"}),k&&(k.openSuggestions??0)>0&&s.jsxs("span",{className:"hpill sug",children:["제안 ",k.openSuggestions]})]}),k?s.jsx(Um,{roll:k}):s.jsx("div",{className:"hbar"}),s.jsxs("div",{className:"hfoot",children:[s.jsxs("span",{children:["수락 ",(k==null?void 0:k.accepted)??0,k&&k.proposed>0&&s.jsxs(s.Fragment,{children:[" · ",s.jsxs("b",{style:{color:"var(--sug)"},children:["제안 ",k.proposed]})]})]}),s.jsx("span",{className:"sp"}),s.jsx("span",{className:"st",children:k!=null&&k.documentId?"":"미생성"})]})]},P.key)}),s.jsxs("button",{className:"hcard",onClick:()=>i(`/projects/${r}/wireframes`),children:[s.jsxs("div",{className:"ht",children:[s.jsx("span",{className:"tb der",children:"WF"}),s.jsx("b",{children:"와이어프레임"})]}),s.jsxs("div",{className:"hfoot",style:{marginTop:2},children:[s.jsxs("span",{children:["IA 수락분에서 ",s.jsx("b",{children:"자동 렌더"})]}),s.jsx("span",{className:"sp"}),s.jsxs("span",{className:"st",children:["화면 ",(d==null?void 0:d.derived.wireframes.count)??0]})]}),s.jsxs("div",{className:"wfrow",children:[s.jsx("span",{className:"sk block"}),s.jsx("span",{className:"sk block"}),s.jsx("span",{className:"sk block"})]})]}),s.jsxs("button",{className:`hcard ${S!=null&&S.locked?"locked":""}`,onClick:()=>i(`/projects/${r}/handoff`),children:[s.jsxs("div",{className:"ht",children:[s.jsx("span",{className:"tb der",children:"DEV"}),s.jsx("b",{children:"개발 지시서"})]}),s.jsxs("div",{className:"hfoot",style:{marginTop:2},children:[S!=null&&S.locked?s.jsxs("span",{style:{color:"var(--warn)"},children:["정합성 검사 ",S.blocking,"건 위반"]}):s.jsx("span",{children:S!=null&&S.compiled?"컴파일됨":"검사 통과 · 생성 가능"}),s.jsx("span",{className:"sp"}),s.jsx("span",{className:"st",children:S!=null&&S.locked?"잠김":"준비"})]})]})]}),j&&j.effectiveCount>0&&s.jsxs("div",{className:"gate",children:[s.jsx(Ke,{pose:"fetch",size:34}),s.jsxs("b",{children:["검사 ",j.effectiveCount,"건 위반"]}),s.jsxs("span",{children:[j.violations.filter(P=>!P.waived).slice(0,2).map(P=>`${P.refs[0]} ${P.code}`).join(" · ")," ","— 수정안을 물어왔어요."]}),s.jsxs("button",{className:"go",disabled:g,onClick:v,children:["제안 ",j.effectiveCount,"건 보기"]})]})]})})}function Va(r,i=!0){return{id:r.id,heading:r.heading,body:r.body,streaming:!1,editable:i,status:r.status??"accepted"}}const Vm={add:"추가 제안",revise:"보강 제안",delete:"삭제 제안",question:"누락 질문",stale:"재검토",lint:"정합성"};function Hm(r){return Vm[r]??"제안"}function Km(r,i){const[a,u]=y.useState([]),[d,f]=y.useState(!1),[g,m]=y.useState(!0),h=y.useCallback(async()=>{if(r){f(!0);try{const k=await z.suggestions(r,"open"),b=Array.isArray(k)?k:Array.isArray(k==null?void 0:k.suggestions)?k.suggestions:[];u(b.map(Bd)),m(!0)}catch{u([]),m(!1)}finally{f(!1)}}},[r]);y.useEffect(()=>{h().catch(()=>{})},[h]);const v=k=>u(b=>b.filter(w=>w.id!==k)),x=y.useCallback(async k=>{await z.acceptSuggestion(k),v(k),i()},[i]),j=y.useCallback(async k=>{await z.rejectSuggestion(k),v(k),i()},[i]),S=y.useCallback(async(k,b)=>{const w=await z.rewriteSuggestion(k,b);u($=>$.map(W=>W.id===k?w??W:W)),i()},[i]),P=y.useCallback(async()=>{r&&(await z.acceptAllSuggestions(r),u([]),i())},[r,i]);return{suggestions:a,loading:d,supported:g,reload:h,accept:x,reject:j,rewrite:S,acceptAll:P}}function Jd({template:r,session:i,onSaveAnswer:a,onGenerate:u,streaming:d}){const[f,g]=y.useState(()=>Object.fromEntries(i.answers.map(w=>[w.questionId,w.answer]))),[m,h]=y.useState(i.current_index??0),v=y.useRef({});y.useEffect(()=>{g(Object.fromEntries(i.answers.map(w=>[w.questionId,w.answer]))),h(i.current_index??0)},[i.id]);const x=r.questions,j=x[Math.min(m,x.length-1)],S=x.filter(w=>(f[w.id]??"").trim()).length,P=Math.round(S/x.length*100);function k(w){g($=>({...$,[j.id]:w})),clearTimeout(v.current[j.id]),v.current[j.id]=setTimeout(()=>{a({questionId:j.id,question:j.prompt,answer:w,currentIndex:m})},500)}function b(w){a({questionId:j.id,question:j.prompt,answer:f[j.id]??"",currentIndex:w}),h(Math.max(0,Math.min(x.length-1,w)))}return s.jsxs("div",{className:"interview",children:[s.jsx("div",{className:"q-progress",children:s.jsx("i",{style:{width:`${P}%`}})}),s.jsxs("div",{className:"q-meta",children:[r.name," · ",S,"/",x.length," 답변"]}),s.jsxs("div",{className:"q-card",children:[s.jsxs("div",{className:"q",children:["Q",m+1,". ",j.prompt]}),s.jsx("textarea",{className:"field",autoFocus:!0,value:f[j.id]??"",onChange:w=>k(w.target.value),placeholder:j.example?`예: ${j.example}`:"답변을 입력하세요"}),(j.hint||j.example)&&s.jsxs("div",{className:"q-hint",children:[j.hint&&s.jsxs("div",{children:[s.jsx("b",{children:"힌트"})," · ",j.hint]}),j.example&&s.jsxs("div",{children:[s.jsx("b",{children:"예시"})," · ",j.example]})]}),s.jsxs("div",{className:"q-nav",children:[s.jsx("button",{className:"btn",disabled:m===0,onClick:()=>b(m-1),children:"이전"}),m<x.length-1?s.jsx("button",{className:"btn pri",onClick:()=>b(m+1),children:"다음"}):s.jsx("span",{className:"ok",style:{alignSelf:"center"},children:"마지막 질문"})]})]}),s.jsx("div",{className:"q-list",children:x.map((w,$)=>s.jsxs("button",{className:`q-list-item ${$===m?"active":""} ${(f[w.id]??"").trim()?"answered":""}`,onClick:()=>b($),children:[s.jsx("span",{className:"dot"})," Q",$+1,". ",w.prompt.slice(0,30),w.prompt.length>30?"…":""]},w.id))}),s.jsx("button",{className:"btn pri lg interview-cta",style:{width:"100%"},disabled:d||S===0,onClick:u,children:d?"초안 생성 중…":"AI 초안 생성"}),S===0&&s.jsx("div",{className:"q-meta",style:{marginTop:8},children:"최소 1개 답변 후 생성할 수 있습니다."})]})}function eo(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Un=eo();function Yd(r){Un=r}var ur={exec:()=>null};function $e(r,i=""){let a=typeof r=="string"?r:r.source;const u={replace:(d,f)=>{let g=typeof f=="string"?f:f.source;return g=g.replace(dt.caret,"$1"),a=a.replace(d,g),u},getRegex:()=>new RegExp(a,i)};return u}var dt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:r=>new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}#`),htmlBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}<(?:[a-z].*>|!--)`,"i")},qm=/^(?:[ \t]*(?:\n|$))+/,Qm=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Gm=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,pr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Jm=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,to=/(?:[*+-]|\d{1,9}[.)])/,Zd=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Xd=$e(Zd).replace(/bull/g,to).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Ym=$e(Zd).replace(/bull/g,to).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),no=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Zm=/^[^\n]+/,so=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Xm=$e(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",so).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),eg=$e(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,to).getRegex(),Il="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ro=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,tg=$e("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ro).replace("tag",Il).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ef=$e(no).replace("hr",pr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Il).getRegex(),ng=$e(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ef).getRegex(),lo={blockquote:ng,code:Qm,def:Xm,fences:Gm,heading:Jm,hr:pr,html:tg,lheading:Xd,list:eg,newline:qm,paragraph:ef,table:ur,text:Zm},jd=$e("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",pr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Il).getRegex(),sg={...lo,lheading:Ym,table:jd,paragraph:$e(no).replace("hr",pr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",jd).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Il).getRegex()},rg={...lo,html:$e(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ro).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ur,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:$e(no).replace("hr",pr).replace("heading",` *#{1,6} *[^
|
|
68
|
+
]`).replace("lheading",Xd).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},lg=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ig=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,tf=/^( {2,}|\\)\n(?!\s*$)/,ag=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ol=/[\p{P}\p{S}]/u,io=/[\s\p{P}\p{S}]/u,nf=/[^\s\p{P}\p{S}]/u,og=$e(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,io).getRegex(),sf=/(?!~)[\p{P}\p{S}]/u,cg=/(?!~)[\s\p{P}\p{S}]/u,ug=/(?:[^\s\p{P}\p{S}]|~)/u,dg=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,rf=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,fg=$e(rf,"u").replace(/punct/g,Ol).getRegex(),pg=$e(rf,"u").replace(/punct/g,sf).getRegex(),lf="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",hg=$e(lf,"gu").replace(/notPunctSpace/g,nf).replace(/punctSpace/g,io).replace(/punct/g,Ol).getRegex(),mg=$e(lf,"gu").replace(/notPunctSpace/g,ug).replace(/punctSpace/g,cg).replace(/punct/g,sf).getRegex(),gg=$e("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,nf).replace(/punctSpace/g,io).replace(/punct/g,Ol).getRegex(),vg=$e(/\\(punct)/,"gu").replace(/punct/g,Ol).getRegex(),xg=$e(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),yg=$e(ro).replace("(?:-->|$)","-->").getRegex(),jg=$e("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",yg).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),bl=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,kg=$e(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",bl).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),af=$e(/^!?\[(label)\]\[(ref)\]/).replace("label",bl).replace("ref",so).getRegex(),of=$e(/^!?\[(ref)\](?:\[\])?/).replace("ref",so).getRegex(),wg=$e("reflink|nolink(?!\\()","g").replace("reflink",af).replace("nolink",of).getRegex(),ao={_backpedal:ur,anyPunctuation:vg,autolink:xg,blockSkip:dg,br:tf,code:ig,del:ur,emStrongLDelim:fg,emStrongRDelimAst:hg,emStrongRDelimUnd:gg,escape:lg,link:kg,nolink:of,punctuation:og,reflink:af,reflinkSearch:wg,tag:jg,text:ag,url:ur},Ng={...ao,link:$e(/^!?\[(label)\]\((.*?)\)/).replace("label",bl).getRegex(),reflink:$e(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",bl).getRegex()},Ha={...ao,emStrongRDelimAst:mg,emStrongLDelim:pg,url:$e(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Sg={...Ha,br:$e(tf).replace("{2,}","*").getRegex(),text:$e(Ha.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Nl={normal:lo,gfm:sg,pedantic:rg},ar={normal:ao,gfm:Ha,breaks:Sg,pedantic:Ng},Cg={"&":"&","<":"<",">":">",'"':""","'":"'"},kd=r=>Cg[r];function Bt(r,i){if(i){if(dt.escapeTest.test(r))return r.replace(dt.escapeReplace,kd)}else if(dt.escapeTestNoEncode.test(r))return r.replace(dt.escapeReplaceNoEncode,kd);return r}function wd(r){try{r=encodeURI(r).replace(dt.percentDecode,"%")}catch{return null}return r}function Nd(r,i){var f;const a=r.replace(dt.findPipe,(g,m,h)=>{let v=!1,x=m;for(;--x>=0&&h[x]==="\\";)v=!v;return v?"|":" |"}),u=a.split(dt.splitPipe);let d=0;if(u[0].trim()||u.shift(),u.length>0&&!((f=u.at(-1))!=null&&f.trim())&&u.pop(),i)if(u.length>i)u.splice(i);else for(;u.length<i;)u.push("");for(;d<u.length;d++)u[d]=u[d].trim().replace(dt.slashPipe,"|");return u}function or(r,i,a){const u=r.length;if(u===0)return"";let d=0;for(;d<u&&r.charAt(u-d-1)===i;)d++;return r.slice(0,u-d)}function Eg(r,i){if(r.indexOf(i[1])===-1)return-1;let a=0;for(let u=0;u<r.length;u++)if(r[u]==="\\")u++;else if(r[u]===i[0])a++;else if(r[u]===i[1]&&(a--,a<0))return u;return a>0?-2:-1}function Sd(r,i,a,u,d){const f=i.href,g=i.title||null,m=r[1].replace(d.other.outputLinkReplace,"$1");u.state.inLink=!0;const h={type:r[0].charAt(0)==="!"?"image":"link",raw:a,href:f,title:g,text:m,tokens:u.inlineTokens(m)};return u.state.inLink=!1,h}function Pg(r,i,a){const u=r.match(a.other.indentCodeCompensation);if(u===null)return i;const d=u[1];return i.split(`
|
|
69
69
|
`).map(f=>{const g=f.match(a.other.beginningSpace);if(g===null)return f;const[m]=g;return m.length>=d.length?f.slice(d.length):f}).join(`
|
|
70
|
-
`)}var _l=class{constructor(r){Oe(this,"options");Oe(this,"rules");Oe(this,"lexer");this.options=r||
|
|
71
|
-
`)}}}fences(r){const i=this.rules.block.fences.exec(r);if(i){const a=i[0],u=
|
|
70
|
+
`)}var _l=class{constructor(r){Oe(this,"options");Oe(this,"rules");Oe(this,"lexer");this.options=r||Un}space(r){const i=this.rules.block.newline.exec(r);if(i&&i[0].length>0)return{type:"space",raw:i[0]}}code(r){const i=this.rules.block.code.exec(r);if(i){const a=i[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:i[0],codeBlockStyle:"indented",text:this.options.pedantic?a:or(a,`
|
|
71
|
+
`)}}}fences(r){const i=this.rules.block.fences.exec(r);if(i){const a=i[0],u=Pg(a,i[3]||"",this.rules);return{type:"code",raw:a,lang:i[2]?i[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):i[2],text:u}}}heading(r){const i=this.rules.block.heading.exec(r);if(i){let a=i[2].trim();if(this.rules.other.endingHash.test(a)){const u=or(a,"#");(this.options.pedantic||!u||this.rules.other.endingSpaceChar.test(u))&&(a=u.trim())}return{type:"heading",raw:i[0],depth:i[1].length,text:a,tokens:this.lexer.inline(a)}}}hr(r){const i=this.rules.block.hr.exec(r);if(i)return{type:"hr",raw:or(i[0],`
|
|
72
72
|
`)}}blockquote(r){const i=this.rules.block.blockquote.exec(r);if(i){let a=or(i[0],`
|
|
73
73
|
`).split(`
|
|
74
74
|
`),u="",d="";const f=[];for(;a.length>0;){let g=!1;const m=[];let h;for(h=0;h<a.length;h++)if(this.rules.other.blockquoteStart.test(a[h]))m.push(a[h]),g=!0;else if(!g)m.push(a[h]);else break;a=a.slice(h);const v=m.join(`
|
|
75
75
|
`),x=v.replace(this.rules.other.blockquoteSetextReplace,`
|
|
76
76
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");u=u?`${u}
|
|
77
77
|
${v}`:v,d=d?`${d}
|
|
78
|
-
${x}`:x;const
|
|
78
|
+
${x}`:x;const j=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(x,f,!0),this.lexer.state.top=j,a.length===0)break;const S=f.at(-1);if((S==null?void 0:S.type)==="code")break;if((S==null?void 0:S.type)==="blockquote"){const P=S,k=P.raw+`
|
|
79
79
|
`+a.join(`
|
|
80
|
-
`),
|
|
80
|
+
`),b=this.blockquote(k);f[f.length-1]=b,u=u.substring(0,u.length-P.raw.length)+b.raw,d=d.substring(0,d.length-P.text.length)+b.text;break}else if((S==null?void 0:S.type)==="list"){const P=S,k=P.raw+`
|
|
81
81
|
`+a.join(`
|
|
82
|
-
`),
|
|
83
|
-
`);continue}}return{type:"blockquote",raw:u,tokens:f,text:d}}}list(r){let i=this.rules.block.list.exec(r);if(i){let a=i[1].trim();const u=a.length>1,d={type:"list",raw:"",ordered:u,start:u?+a.slice(0,-1):"",loose:!1,items:[]};a=u?`\\d{1,9}\\${a.slice(-1)}`:`\\${a}`,this.options.pedantic&&(a=u?a:"[*+-]");const f=this.rules.other.listItemRegex(a);let g=!1;for(;r;){let h=!1,v="",x="";if(!(i=f.exec(r))||this.rules.block.hr.test(r))break;v=i[0],r=r.substring(v.length);let
|
|
84
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs
|
|
85
|
-
`,1)[0],
|
|
86
|
-
`,r=r.substring(
|
|
87
|
-
`,1)[0];let H;if(
|
|
88
|
-
`+H.slice(
|
|
89
|
-
`+
|
|
90
|
-
`,r=r.substring(Z.length+1),
|
|
82
|
+
`),b=this.list(k);f[f.length-1]=b,u=u.substring(0,u.length-S.raw.length)+b.raw,d=d.substring(0,d.length-P.raw.length)+b.raw,a=k.substring(f.at(-1).raw.length).split(`
|
|
83
|
+
`);continue}}return{type:"blockquote",raw:u,tokens:f,text:d}}}list(r){let i=this.rules.block.list.exec(r);if(i){let a=i[1].trim();const u=a.length>1,d={type:"list",raw:"",ordered:u,start:u?+a.slice(0,-1):"",loose:!1,items:[]};a=u?`\\d{1,9}\\${a.slice(-1)}`:`\\${a}`,this.options.pedantic&&(a=u?a:"[*+-]");const f=this.rules.other.listItemRegex(a);let g=!1;for(;r;){let h=!1,v="",x="";if(!(i=f.exec(r))||this.rules.block.hr.test(r))break;v=i[0],r=r.substring(v.length);let j=i[2].split(`
|
|
84
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,$=>" ".repeat(3*$.length)),S=r.split(`
|
|
85
|
+
`,1)[0],P=!j.trim(),k=0;if(this.options.pedantic?(k=2,x=j.trimStart()):P?k=i[1].length+1:(k=i[2].search(this.rules.other.nonSpaceChar),k=k>4?1:k,x=j.slice(k),k+=i[1].length),P&&this.rules.other.blankLine.test(S)&&(v+=S+`
|
|
86
|
+
`,r=r.substring(S.length+1),h=!0),!h){const $=this.rules.other.nextBulletRegex(k),W=this.rules.other.hrRegex(k),A=this.rules.other.fencesBeginRegex(k),Y=this.rules.other.headingBeginRegex(k),M=this.rules.other.htmlBeginRegex(k);for(;r;){const Z=r.split(`
|
|
87
|
+
`,1)[0];let H;if(S=Z,this.options.pedantic?(S=S.replace(this.rules.other.listReplaceNesting," "),H=S):H=S.replace(this.rules.other.tabCharGlobal," "),A.test(S)||Y.test(S)||M.test(S)||$.test(S)||W.test(S))break;if(H.search(this.rules.other.nonSpaceChar)>=k||!S.trim())x+=`
|
|
88
|
+
`+H.slice(k);else{if(P||j.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||A.test(j)||Y.test(j)||W.test(j))break;x+=`
|
|
89
|
+
`+S}!P&&!S.trim()&&(P=!0),v+=Z+`
|
|
90
|
+
`,r=r.substring(Z.length+1),j=H.slice(k)}}d.loose||(g?d.loose=!0:this.rules.other.doubleBlankLine.test(v)&&(g=!0));let b=null,w;this.options.gfm&&(b=this.rules.other.listIsTask.exec(x),b&&(w=b[0]!=="[ ] ",x=x.replace(this.rules.other.listReplaceTask,""))),d.items.push({type:"list_item",raw:v,task:!!b,checked:w,loose:!1,text:x,tokens:[]}),d.raw+=v}const m=d.items.at(-1);if(m)m.raw=m.raw.trimEnd(),m.text=m.text.trimEnd();else return;d.raw=d.raw.trimEnd();for(let h=0;h<d.items.length;h++)if(this.lexer.state.top=!1,d.items[h].tokens=this.lexer.blockTokens(d.items[h].text,[]),!d.loose){const v=d.items[h].tokens.filter(j=>j.type==="space"),x=v.length>0&&v.some(j=>this.rules.other.anyLine.test(j.raw));d.loose=x}if(d.loose)for(let h=0;h<d.items.length;h++)d.items[h].loose=!0;return d}}html(r){const i=this.rules.block.html.exec(r);if(i)return{type:"html",block:!0,raw:i[0],pre:i[1]==="pre"||i[1]==="script"||i[1]==="style",text:i[0]}}def(r){const i=this.rules.block.def.exec(r);if(i){const a=i[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),u=i[2]?i[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",d=i[3]?i[3].substring(1,i[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):i[3];return{type:"def",tag:a,raw:i[0],href:u,title:d}}}table(r){var g;const i=this.rules.block.table.exec(r);if(!i||!this.rules.other.tableDelimiter.test(i[2]))return;const a=Nd(i[1]),u=i[2].replace(this.rules.other.tableAlignChars,"").split("|"),d=(g=i[3])!=null&&g.trim()?i[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
91
91
|
`):[],f={type:"table",raw:i[0],header:[],align:[],rows:[]};if(a.length===u.length){for(const m of u)this.rules.other.tableAlignRight.test(m)?f.align.push("right"):this.rules.other.tableAlignCenter.test(m)?f.align.push("center"):this.rules.other.tableAlignLeft.test(m)?f.align.push("left"):f.align.push(null);for(let m=0;m<a.length;m++)f.header.push({text:a[m],tokens:this.lexer.inline(a[m]),header:!0,align:f.align[m]});for(const m of d)f.rows.push(Nd(m,f.header.length).map((h,v)=>({text:h,tokens:this.lexer.inline(h),header:!1,align:f.align[v]})));return f}}lheading(r){const i=this.rules.block.lheading.exec(r);if(i)return{type:"heading",raw:i[0],depth:i[2].charAt(0)==="="?1:2,text:i[1],tokens:this.lexer.inline(i[1])}}paragraph(r){const i=this.rules.block.paragraph.exec(r);if(i){const a=i[1].charAt(i[1].length-1)===`
|
|
92
|
-
`?i[1].slice(0,-1):i[1];return{type:"paragraph",raw:i[0],text:a,tokens:this.lexer.inline(a)}}}text(r){const i=this.rules.block.text.exec(r);if(i)return{type:"text",raw:i[0],text:i[0],tokens:this.lexer.inline(i[0])}}escape(r){const i=this.rules.inline.escape.exec(r);if(i)return{type:"escape",raw:i[0],text:i[1]}}tag(r){const i=this.rules.inline.tag.exec(r);if(i)return!this.lexer.state.inLink&&this.rules.other.startATag.test(i[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(i[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(i[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(i[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:i[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:i[0]}}link(r){const i=this.rules.inline.link.exec(r);if(i){const a=i[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(a)){if(!this.rules.other.endAngleBracket.test(a))return;const f=or(a.slice(0,-1),"\\");if((a.length-f.length)%2===0)return}else{const f=
|
|
92
|
+
`?i[1].slice(0,-1):i[1];return{type:"paragraph",raw:i[0],text:a,tokens:this.lexer.inline(a)}}}text(r){const i=this.rules.block.text.exec(r);if(i)return{type:"text",raw:i[0],text:i[0],tokens:this.lexer.inline(i[0])}}escape(r){const i=this.rules.inline.escape.exec(r);if(i)return{type:"escape",raw:i[0],text:i[1]}}tag(r){const i=this.rules.inline.tag.exec(r);if(i)return!this.lexer.state.inLink&&this.rules.other.startATag.test(i[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(i[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(i[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(i[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:i[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:i[0]}}link(r){const i=this.rules.inline.link.exec(r);if(i){const a=i[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(a)){if(!this.rules.other.endAngleBracket.test(a))return;const f=or(a.slice(0,-1),"\\");if((a.length-f.length)%2===0)return}else{const f=Eg(i[2],"()");if(f===-2)return;if(f>-1){const m=(i[0].indexOf("!")===0?5:4)+i[1].length+f;i[2]=i[2].substring(0,f),i[0]=i[0].substring(0,m).trim(),i[3]=""}}let u=i[2],d="";if(this.options.pedantic){const f=this.rules.other.pedanticHrefTitle.exec(u);f&&(u=f[1],d=f[3])}else d=i[3]?i[3].slice(1,-1):"";return u=u.trim(),this.rules.other.startAngleBracket.test(u)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(a)?u=u.slice(1):u=u.slice(1,-1)),Sd(i,{href:u&&u.replace(this.rules.inline.anyPunctuation,"$1"),title:d&&d.replace(this.rules.inline.anyPunctuation,"$1")},i[0],this.lexer,this.rules)}}reflink(r,i){let a;if((a=this.rules.inline.reflink.exec(r))||(a=this.rules.inline.nolink.exec(r))){const u=(a[2]||a[1]).replace(this.rules.other.multipleSpaceGlobal," "),d=i[u.toLowerCase()];if(!d){const f=a[0].charAt(0);return{type:"text",raw:f,text:f}}return Sd(a,d,a[0],this.lexer,this.rules)}}emStrong(r,i,a=""){let u=this.rules.inline.emStrongLDelim.exec(r);if(!u||u[3]&&a.match(this.rules.other.unicodeAlphaNumeric))return;if(!(u[1]||u[2]||"")||!a||this.rules.inline.punctuation.exec(a)){const f=[...u[0]].length-1;let g,m,h=f,v=0;const x=u[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(x.lastIndex=0,i=i.slice(-1*r.length+f);(u=x.exec(i))!=null;){if(g=u[1]||u[2]||u[3]||u[4]||u[5]||u[6],!g)continue;if(m=[...g].length,u[3]||u[4]){h+=m;continue}else if((u[5]||u[6])&&f%3&&!((f+m)%3)){v+=m;continue}if(h-=m,h>0)continue;m=Math.min(m,m+h+v);const j=[...u[0]][0].length,S=r.slice(0,f+u.index+j+m);if(Math.min(f,m)%2){const k=S.slice(1,-1);return{type:"em",raw:S,text:k,tokens:this.lexer.inlineTokens(k)}}const P=S.slice(2,-2);return{type:"strong",raw:S,text:P,tokens:this.lexer.inlineTokens(P)}}}}codespan(r){const i=this.rules.inline.code.exec(r);if(i){let a=i[2].replace(this.rules.other.newLineCharGlobal," ");const u=this.rules.other.nonSpaceChar.test(a),d=this.rules.other.startingSpaceChar.test(a)&&this.rules.other.endingSpaceChar.test(a);return u&&d&&(a=a.substring(1,a.length-1)),{type:"codespan",raw:i[0],text:a}}}br(r){const i=this.rules.inline.br.exec(r);if(i)return{type:"br",raw:i[0]}}del(r){const i=this.rules.inline.del.exec(r);if(i)return{type:"del",raw:i[0],text:i[2],tokens:this.lexer.inlineTokens(i[2])}}autolink(r){const i=this.rules.inline.autolink.exec(r);if(i){let a,u;return i[2]==="@"?(a=i[1],u="mailto:"+a):(a=i[1],u=a),{type:"link",raw:i[0],text:a,href:u,tokens:[{type:"text",raw:a,text:a}]}}}url(r){var a;let i;if(i=this.rules.inline.url.exec(r)){let u,d;if(i[2]==="@")u=i[0],d="mailto:"+u;else{let f;do f=i[0],i[0]=((a=this.rules.inline._backpedal.exec(i[0]))==null?void 0:a[0])??"";while(f!==i[0]);u=i[0],i[1]==="www."?d="http://"+i[0]:d=i[0]}return{type:"link",raw:i[0],text:u,href:d,tokens:[{type:"text",raw:u,text:u}]}}}inlineText(r){const i=this.rules.inline.text.exec(r);if(i){const a=this.lexer.state.inRawBlock;return{type:"text",raw:i[0],text:i[0],escaped:a}}}},Yt=class Ka{constructor(i){Oe(this,"tokens");Oe(this,"options");Oe(this,"state");Oe(this,"tokenizer");Oe(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=i||Un,this.options.tokenizer=this.options.tokenizer||new _l,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const a={other:dt,block:Nl.normal,inline:ar.normal};this.options.pedantic?(a.block=Nl.pedantic,a.inline=ar.pedantic):this.options.gfm&&(a.block=Nl.gfm,this.options.breaks?a.inline=ar.breaks:a.inline=ar.gfm),this.tokenizer.rules=a}static get rules(){return{block:Nl,inline:ar}}static lex(i,a){return new Ka(a).lex(i)}static lexInline(i,a){return new Ka(a).inlineTokens(i)}lex(i){i=i.replace(dt.carriageReturn,`
|
|
93
93
|
`),this.blockTokens(i,this.tokens);for(let a=0;a<this.inlineQueue.length;a++){const u=this.inlineQueue[a];this.inlineTokens(u.src,u.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(i,a=[],u=!1){var d,f,g;for(this.options.pedantic&&(i=i.replace(dt.tabCharGlobal," ").replace(dt.spaceLine,""));i;){let m;if((f=(d=this.options.extensions)==null?void 0:d.block)!=null&&f.some(v=>(m=v.call({lexer:this},i,a))?(i=i.substring(m.raw.length),a.push(m),!0):!1))continue;if(m=this.tokenizer.space(i)){i=i.substring(m.raw.length);const v=a.at(-1);m.raw.length===1&&v!==void 0?v.raw+=`
|
|
94
94
|
`:a.push(m);continue}if(m=this.tokenizer.code(i)){i=i.substring(m.raw.length);const v=a.at(-1);(v==null?void 0:v.type)==="paragraph"||(v==null?void 0:v.type)==="text"?(v.raw+=`
|
|
95
95
|
`+m.raw,v.text+=`
|
|
96
96
|
`+m.text,this.inlineQueue.at(-1).src=v.text):a.push(m);continue}if(m=this.tokenizer.fences(i)){i=i.substring(m.raw.length),a.push(m);continue}if(m=this.tokenizer.heading(i)){i=i.substring(m.raw.length),a.push(m);continue}if(m=this.tokenizer.hr(i)){i=i.substring(m.raw.length),a.push(m);continue}if(m=this.tokenizer.blockquote(i)){i=i.substring(m.raw.length),a.push(m);continue}if(m=this.tokenizer.list(i)){i=i.substring(m.raw.length),a.push(m);continue}if(m=this.tokenizer.html(i)){i=i.substring(m.raw.length),a.push(m);continue}if(m=this.tokenizer.def(i)){i=i.substring(m.raw.length);const v=a.at(-1);(v==null?void 0:v.type)==="paragraph"||(v==null?void 0:v.type)==="text"?(v.raw+=`
|
|
97
97
|
`+m.raw,v.text+=`
|
|
98
|
-
`+m.raw,this.inlineQueue.at(-1).src=v.text):this.tokens.links[m.tag]||(this.tokens.links[m.tag]={href:m.href,title:m.title});continue}if(m=this.tokenizer.table(i)){i=i.substring(m.raw.length),a.push(m);continue}if(m=this.tokenizer.lheading(i)){i=i.substring(m.raw.length),a.push(m);continue}let h=i;if((g=this.options.extensions)!=null&&g.startBlock){let v=1/0;const x=i.slice(1);let
|
|
98
|
+
`+m.raw,this.inlineQueue.at(-1).src=v.text):this.tokens.links[m.tag]||(this.tokens.links[m.tag]={href:m.href,title:m.title});continue}if(m=this.tokenizer.table(i)){i=i.substring(m.raw.length),a.push(m);continue}if(m=this.tokenizer.lheading(i)){i=i.substring(m.raw.length),a.push(m);continue}let h=i;if((g=this.options.extensions)!=null&&g.startBlock){let v=1/0;const x=i.slice(1);let j;this.options.extensions.startBlock.forEach(S=>{j=S.call({lexer:this},x),typeof j=="number"&&j>=0&&(v=Math.min(v,j))}),v<1/0&&v>=0&&(h=i.substring(0,v+1))}if(this.state.top&&(m=this.tokenizer.paragraph(h))){const v=a.at(-1);u&&(v==null?void 0:v.type)==="paragraph"?(v.raw+=`
|
|
99
99
|
`+m.raw,v.text+=`
|
|
100
100
|
`+m.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=v.text):a.push(m),u=h.length!==i.length,i=i.substring(m.raw.length);continue}if(m=this.tokenizer.text(i)){i=i.substring(m.raw.length);const v=a.at(-1);(v==null?void 0:v.type)==="text"?(v.raw+=`
|
|
101
101
|
`+m.raw,v.text+=`
|
|
102
|
-
`+m.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=v.text):a.push(m);continue}if(i){const v="Infinite loop on byte: "+i.charCodeAt(0);if(this.options.silent){console.error(v);break}else throw new Error(v)}}return this.state.top=!0,a}inline(i,a=[]){return this.inlineQueue.push({src:i,tokens:a}),a}inlineTokens(i,a=[]){var m,h,v;let u=i,d=null;if(this.tokens.links){const x=Object.keys(this.tokens.links);if(x.length>0)for(;(d=this.tokenizer.rules.inline.reflinkSearch.exec(u))!=null;)x.includes(d[0].slice(d[0].lastIndexOf("[")+1,-1))&&(u=u.slice(0,d.index)+"["+"a".repeat(d[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(d=this.tokenizer.rules.inline.anyPunctuation.exec(u))!=null;)u=u.slice(0,d.index)+"++"+u.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(d=this.tokenizer.rules.inline.blockSkip.exec(u))!=null;)u=u.slice(0,d.index)+"["+"a".repeat(d[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let f=!1,g="";for(;i;){f||(g=""),f=!1;let x;if((h=(m=this.options.extensions)==null?void 0:m.inline)!=null&&h.some(
|
|
102
|
+
`+m.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=v.text):a.push(m);continue}if(i){const v="Infinite loop on byte: "+i.charCodeAt(0);if(this.options.silent){console.error(v);break}else throw new Error(v)}}return this.state.top=!0,a}inline(i,a=[]){return this.inlineQueue.push({src:i,tokens:a}),a}inlineTokens(i,a=[]){var m,h,v;let u=i,d=null;if(this.tokens.links){const x=Object.keys(this.tokens.links);if(x.length>0)for(;(d=this.tokenizer.rules.inline.reflinkSearch.exec(u))!=null;)x.includes(d[0].slice(d[0].lastIndexOf("[")+1,-1))&&(u=u.slice(0,d.index)+"["+"a".repeat(d[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(d=this.tokenizer.rules.inline.anyPunctuation.exec(u))!=null;)u=u.slice(0,d.index)+"++"+u.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(d=this.tokenizer.rules.inline.blockSkip.exec(u))!=null;)u=u.slice(0,d.index)+"["+"a".repeat(d[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let f=!1,g="";for(;i;){f||(g=""),f=!1;let x;if((h=(m=this.options.extensions)==null?void 0:m.inline)!=null&&h.some(S=>(x=S.call({lexer:this},i,a))?(i=i.substring(x.raw.length),a.push(x),!0):!1))continue;if(x=this.tokenizer.escape(i)){i=i.substring(x.raw.length),a.push(x);continue}if(x=this.tokenizer.tag(i)){i=i.substring(x.raw.length),a.push(x);continue}if(x=this.tokenizer.link(i)){i=i.substring(x.raw.length),a.push(x);continue}if(x=this.tokenizer.reflink(i,this.tokens.links)){i=i.substring(x.raw.length);const S=a.at(-1);x.type==="text"&&(S==null?void 0:S.type)==="text"?(S.raw+=x.raw,S.text+=x.text):a.push(x);continue}if(x=this.tokenizer.emStrong(i,u,g)){i=i.substring(x.raw.length),a.push(x);continue}if(x=this.tokenizer.codespan(i)){i=i.substring(x.raw.length),a.push(x);continue}if(x=this.tokenizer.br(i)){i=i.substring(x.raw.length),a.push(x);continue}if(x=this.tokenizer.del(i)){i=i.substring(x.raw.length),a.push(x);continue}if(x=this.tokenizer.autolink(i)){i=i.substring(x.raw.length),a.push(x);continue}if(!this.state.inLink&&(x=this.tokenizer.url(i))){i=i.substring(x.raw.length),a.push(x);continue}let j=i;if((v=this.options.extensions)!=null&&v.startInline){let S=1/0;const P=i.slice(1);let k;this.options.extensions.startInline.forEach(b=>{k=b.call({lexer:this},P),typeof k=="number"&&k>=0&&(S=Math.min(S,k))}),S<1/0&&S>=0&&(j=i.substring(0,S+1))}if(x=this.tokenizer.inlineText(j)){i=i.substring(x.raw.length),x.raw.slice(-1)!=="_"&&(g=x.raw.slice(-1)),f=!0;const S=a.at(-1);(S==null?void 0:S.type)==="text"?(S.raw+=x.raw,S.text+=x.text):a.push(x);continue}if(i){const S="Infinite loop on byte: "+i.charCodeAt(0);if(this.options.silent){console.error(S);break}else throw new Error(S)}}return a}},Tl=class{constructor(r){Oe(this,"options");Oe(this,"parser");this.options=r||Un}space(r){return""}code({text:r,lang:i,escaped:a}){var f;const u=(f=(i||"").match(dt.notSpaceStart))==null?void 0:f[0],d=r.replace(dt.endingNewline,"")+`
|
|
103
103
|
`;return u?'<pre><code class="language-'+Bt(u)+'">'+(a?d:Bt(d,!0))+`</code></pre>
|
|
104
104
|
`:"<pre><code>"+(a?d:Bt(d,!0))+`</code></pre>
|
|
105
105
|
`}blockquote({tokens:r}){return`<blockquote>
|
|
@@ -117,9 +117,9 @@ ${this.parser.parse(r)}</blockquote>
|
|
|
117
117
|
`}tablerow({text:r}){return`<tr>
|
|
118
118
|
${r}</tr>
|
|
119
119
|
`}tablecell(r){const i=this.parser.parseInline(r.tokens),a=r.header?"th":"td";return(r.align?`<${a} align="${r.align}">`:`<${a}>`)+i+`</${a}>
|
|
120
|
-
`}strong({tokens:r}){return`<strong>${this.parser.parseInline(r)}</strong>`}em({tokens:r}){return`<em>${this.parser.parseInline(r)}</em>`}codespan({text:r}){return`<code>${Bt(r,!0)}</code>`}br(r){return"<br>"}del({tokens:r}){return`<del>${this.parser.parseInline(r)}</del>`}link({href:r,title:i,tokens:a}){const u=this.parser.parseInline(a),d=wd(r);if(d===null)return u;r=d;let f='<a href="'+r+'"';return i&&(f+=' title="'+Bt(i)+'"'),f+=">"+u+"</a>",f}image({href:r,title:i,text:a,tokens:u}){u&&(a=this.parser.parseInline(u,this.parser.textRenderer));const d=wd(r);if(d===null)return Bt(a);r=d;let f=`<img src="${r}" alt="${a}"`;return i&&(f+=` title="${Bt(i)}"`),f+=">",f}text(r){return"tokens"in r&&r.tokens?this.parser.parseInline(r.tokens):"escaped"in r&&r.escaped?r.text:Bt(r.text)}},oo=class{strong({text:r}){return r}em({text:r}){return r}codespan({text:r}){return r}del({text:r}){return r}html({text:r}){return r}text({text:r}){return r}link({text:r}){return""+r}image({text:r}){return""+r}br(){return""}},Zt=class qa{constructor(i){Oe(this,"options");Oe(this,"renderer");Oe(this,"textRenderer");this.options=i||
|
|
121
|
-
`+this.renderer.text(v);a?u+=this.renderer.paragraph({type:"paragraph",raw:x,text:x,tokens:[{type:"text",raw:x,text:x,escaped:!0}]}):u+=x;continue}default:{const v='Token with "'+h.type+'" type was not found.';if(this.options.silent)return console.error(v),"";throw new Error(v)}}}return u}parseInline(i,a=this.renderer){var d,f;let u="";for(let g=0;g<i.length;g++){const m=i[g];if((f=(d=this.options.extensions)==null?void 0:d.renderers)!=null&&f[m.type]){const v=this.options.extensions.renderers[m.type].call({parser:this},m);if(v!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(m.type)){u+=v||"";continue}}const h=m;switch(h.type){case"escape":{u+=a.text(h);break}case"html":{u+=a.html(h);break}case"link":{u+=a.link(h);break}case"image":{u+=a.image(h);break}case"strong":{u+=a.strong(h);break}case"em":{u+=a.em(h);break}case"codespan":{u+=a.codespan(h);break}case"br":{u+=a.br(h);break}case"del":{u+=a.del(h);break}case"text":{u+=a.text(h);break}default:{const v='Token with "'+h.type+'" type was not found.';if(this.options.silent)return console.error(v),"";throw new Error(v)}}}return u}},za,Sl=(za=class{constructor(r){Oe(this,"options");Oe(this,"block");this.options=r||
|
|
122
|
-
Please report this to https://github.com/markedjs/marked.`,r){const u="<p>An error occurred:</p><pre>"+Bt(a.message+"",!0)+"</pre>";return i?Promise.resolve(u):u}if(i)return Promise.reject(a);throw a}}},Dn=new Pg;function Le(r,i){return Dn.parse(r,i)}Le.options=Le.setOptions=function(r){return Dn.setOptions(r),Le.defaults=Dn.defaults,Yd(Le.defaults),Le};Le.getDefaults=eo;Le.defaults=Bn;Le.use=function(...r){return Dn.use(...r),Le.defaults=Dn.defaults,Yd(Le.defaults),Le};Le.walkTokens=function(r,i){return Dn.walkTokens(r,i)};Le.parseInline=Dn.parseInline;Le.Parser=Zt;Le.parser=Zt.parse;Le.Renderer=Tl;Le.TextRenderer=oo;Le.Lexer=Yt;Le.lexer=Yt.lex;Le.Tokenizer=_l;Le.Hooks=Sl;Le.parse=Le;Le.options;Le.setOptions;Le.use;Le.walkTokens;Le.parseInline;Zt.parse;Yt.lex;Le.setOptions({gfm:!0,breaks:!1});function bg(r){return r.replace(/<\s*(script|iframe)[^>]*>[\s\S]*?<\s*\/\s*\1\s*>/gi,"").replace(/\son\w+\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi,"").replace(/javascript:/gi,"")}function _g(r){return r.trim()?bg(Le.parse(r)):'<p class="muted">(비어 있음)</p>'}function Tg({doc:r,sections:i,setSections:a,streaming:u,focusSection:d,onFocusSection:f,onRegenerate:g,onRename:m,onStructuralChange:h,onSaveState:v,error:x,onBackToInterview:k,onStop:N}){const[C,j]=y.useState(r.title),[T,S]=y.useState(null),I=y.useRef({});y.useEffect(()=>j(r.title),[r.id,r.title]);function W(F,O){a(J=>J.map(te=>te.id===F?{...te,...O}:te)),v("saving"),clearTimeout(I.current[F]),I.current[F]=setTimeout(async()=>{await z.updateSection(F,O),v("saved"),h(),setTimeout(()=>v("idle"),1500)},2e3)}async function A(){const F=await z.addSection(r.id,"새 섹션","");a(O=>[...O,{...F,streaming:!1,editable:!0}]),h()}async function Y(F,O){let J=null;if(a(te=>{const oe=te.findIndex(Ee=>Ee.id===F),ue=oe+O;if(oe<0||ue<0||ue>=te.length)return te;const ge=[...te];return[ge[oe],ge[ue]]=[ge[ue],ge[oe]],J=ge,ge}),!!J){v("saving");try{await z.reorderSections(r.id,J.map(te=>te.id)),v("saved"),h(),setTimeout(()=>v("idle"),1200)}catch{a(te=>{const oe=te.findIndex(Ee=>Ee.id===F),ue=oe-O;if(oe<0||ue<0||ue>=te.length)return te;const ge=[...te];return[ge[oe],ge[ue]]=[ge[ue],ge[oe]],ge}),v("idle")}}}async function M(){try{const F=await z.undo(r.id);a(F.sections.map(O=>Va(O))),h(),v("saved"),setTimeout(()=>v("idle"),1200)}catch{}}async function Z(F){await z.deleteSection(F),a(O=>O.filter(J=>J.id!==F)),h()}const H=i.filter(F=>F.status==="proposed").length,L=i.filter(F=>F.status!=="proposed"&&F.status!=="rejected").length;return s.jsx("main",{className:"editor",children:s.jsxs("div",{className:"editor-inner",children:[s.jsxs("div",{className:"doc-head",children:[s.jsxs("div",{className:"eyebrow",children:[r.type.toUpperCase()," · V",r.version]}),s.jsx("h2",{contentEditable:!u,suppressContentEditableWarning:!0,onInput:F=>j(F.currentTarget.textContent??""),onBlur:()=>C.trim()&&C!==r.title&&m(C.trim()),children:r.title}),s.jsxs("div",{className:"meta",children:[s.jsxs("span",{children:["확정 ",L,"문장",H>0?` · 제안 ${H}건`:""]}),s.jsx("span",{className:"sep",children:"·"}),s.jsx("button",{className:"btn ghost sm",onClick:k,title:"인터뷰로 돌아가기",children:"인터뷰"}),s.jsx("span",{className:"sep",children:"·"}),s.jsx("button",{className:"btn ghost sm",disabled:u,onClick:M,title:"마지막 변경 되돌리기 (더 깊은 복원은 버전 기록)",children:"되돌리기"})]})]}),x&&s.jsx("div",{className:"err",style:{marginBottom:12},children:x}),u&&s.jsxs("div",{className:"ch-strip",children:[s.jsx(Ke,{pose:"write",size:34}),s.jsx("span",{children:"초안을 쓰는 중이에요. 다 쓰면 전부 제안으로 보여드릴게요."}),N&&s.jsx("button",{className:"btn sm",style:{marginLeft:"auto"},onClick:N,children:"중지"})]}),i.length===0&&!u&&s.jsxs("div",{className:"empty",children:[s.jsx(Ke,{pose:"wait",size:64}),s.jsxs("div",{style:{marginTop:10},children:[s.jsx("b",{children:"AI 초안 생성"}),"을 누르면 여기에 초안이 ",s.jsx("b",{children:"제안 상태"}),"로 채워집니다.",s.jsx("br",{}),"수락한 문장만 문서에 남습니다."]})]}),i.map((F,O)=>s.jsx(Rg,{section:F,focused:d===F.id,streaming:u,editing:T===F.id,canMoveUp:O>0,canMoveDown:O<i.length-1,onMove:J=>Y(F.id,J),onEnter:()=>F.status==="proposed"&&f(F.id),onLeave:()=>f(null),onToggleEdit:()=>S(J=>J===F.id?null:F.status==="proposed"?J:F.id),onEdit:J=>W(F.id,J),onRegenerate:()=>g(F.id),onRemove:()=>Z(F.id)},F.id)),!u&&i.length>0&&s.jsx("button",{className:"btn",style:{marginTop:12},onClick:A,children:"+ 섹션 추가"})]})})}function Rg({section:r,focused:i,streaming:a,editing:u,canMoveUp:d,canMoveDown:f,onMove:g,onEnter:m,onLeave:h,onToggleEdit:v,onEdit:x,onRegenerate:k,onRemove:N}){const C=r.status==="proposed",j=r.kindHint==="delete",T=["sec",C?"proposed":"",j?"del":"",i?"focus":""].join(" ");return s.jsxs("div",{className:T,onMouseEnter:m,onMouseLeave:h,children:[s.jsxs("div",{className:"sec-head",children:[u?s.jsx("input",{value:r.heading,disabled:r.streaming,onChange:S=>x({heading:S.target.value}),style:{flex:1,border:"1px solid var(--hair)",borderRadius:6,padding:"4px 8px",fontWeight:800}}):s.jsx("h3",{children:r.heading}),r.streaming?s.jsx("span",{className:"pill",style:{color:"var(--sug)",borderColor:"var(--sug-line)"},children:r.body.trim()?"스트리밍 중…":"생각 중…"}):s.jsxs("div",{className:"sec-tools",children:[s.jsx("button",{className:"btn icon",disabled:a||!d,onClick:()=>g(-1),title:"위로","aria-label":"섹션 위로",children:"↑"}),s.jsx("button",{className:"btn icon",disabled:a||!f,onClick:()=>g(1),title:"아래로","aria-label":"섹션 아래로",children:"↓"}),!C&&s.jsx("button",{className:"btn",onClick:v,title:"편집 토글",children:u?"완료":"편집"}),s.jsx("button",{className:"btn",disabled:a,onClick:k,title:"이 섹션만 재생성 (다른 섹션 불변)",children:"재생성"}),!C&&s.jsx("button",{className:"btn danger",disabled:a,onClick:N,children:"삭제"})]})]}),u&&!C?s.jsx("div",{className:"sec-edit",children:s.jsx("textarea",{value:r.body,onChange:S=>x({body:S.target.value}),placeholder:"마크다운으로 편집…"})}):r.streaming&&!r.body.trim()?s.jsx("div",{className:"sec-body thinking",children:"모델이 생각하고 있어요… (추론형 모델은 잠시 걸립니다)"}):s.jsx("div",{className:`sec-body ${r.streaming?"cursor":""}`,dangerouslySetInnerHTML:{__html:_g(r.body)}})]})}function Lg({s:r,onFocusSection:i,focusedSection:a,doneLine:u}){const{suggestions:d,accept:f,reject:g,rewrite:m,acceptAll:h}=r,v=d.length;return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"ph",children:["제안 ",s.jsx("span",{className:"cnt",children:v}),s.jsx("button",{className:"all",disabled:v===0,onClick:()=>h(),children:"모두 수락"})]}),v===0?s.jsxs("div",{className:"panel-empty",children:[s.jsx(Ke,{pose:"wait",size:72}),"검토할 제안이 없어요.",s.jsx("br",{}),s.jsx("b",{children:"문서를 이어 쓰면 다시 물어올게요."})]}):d.map(x=>s.jsx($g,{sg:x,focused:!!x.sectionId&&a===x.sectionId,onAccept:()=>f(x.id),onReject:()=>g(x.id),onRewrite:k=>m(x.id,k),onEnter:()=>x.sectionId&&i(x.sectionId),onLeave:()=>i(null)},x.id)),u&&s.jsx("div",{className:"done-line",children:u})]})}function $g({sg:r,focused:i,onAccept:a,onReject:u,onRewrite:d,onEnter:f,onLeave:g}){const[m,h]=y.useState(!1),[v,x]=y.useState(""),[k,N]=y.useState(!1),C=r.kind==="question",j=r.kind==="lint"||r.kind==="delete";function T(I){N(!0),h(!0),window.setTimeout(()=>{I().catch(()=>{h(!1),N(!1)})},180)}async function S(){const I=v.trim();if(!(!I||k)){N(!0);try{await d(I),x("")}finally{N(!1)}}}return s.jsxs("div",{className:`sug-card ${m?"collapsing":""} ${i?"focus":""}`,onMouseEnter:f,onMouseLeave:g,children:[s.jsxs("div",{className:"who",children:[s.jsx(Ke,{pose:"fetch",size:20,animate:!1}),s.jsx("b",{children:r.title||Vm(r.kind)}),s.jsx("span",{className:"why",children:r.source})]}),r.body,(r.quoteBefore||r.quoteAfter)&&s.jsxs("div",{className:"quote",children:[r.quoteBefore&&s.jsxs("span",{children:["“",r.quoteBefore,"” "]}),r.quoteAfter&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"arrow",children:"→"})," ",s.jsxs("span",{children:["“",r.quoteAfter,"”"]})]})]}),s.jsxs("div",{className:"sug-acts",children:[s.jsx("button",{className:"btn ok",disabled:k,onClick:()=>T(a),children:C?"답하기":j?"정리 수락 (항목 제외)":"수락"}),s.jsx("button",{className:"btn",disabled:k,onClick:()=>T(u),children:C?"넘기기":j?"유지":"거절"})]}),!C&&r.kind!=="lint"&&s.jsx("div",{className:"sug-acts rewrite",children:s.jsx("input",{placeholder:"고쳐쓰기 지시",value:v,disabled:k,onChange:I=>x(I.target.value),onKeyDown:I=>I.key==="Enter"&&S()})})]})}const Ig={save:"저장",context_inherit:"컨텍스트 승계",restore:"복원"};function Og({docId:r,onClose:i,onRestored:a}){const[u,d]=y.useState([]),[f,g]=y.useState(!1);y.useEffect(()=>{z.versions(r).then(d).catch(()=>{})},[r]);async function m(h){g(!0);try{await z.restoreVersion(r,h.id),a(),i()}finally{g(!1)}}return s.jsx("div",{className:"overlay",onClick:i,children:s.jsxs("div",{className:"dialog",onClick:h=>h.stopPropagation(),children:[s.jsx("h2",{children:"버전 히스토리"}),s.jsx("p",{className:"subtle",children:"저장·재생성·컨텍스트 승계 시점의 스냅샷입니다. 특정 버전으로 복원할 수 있습니다."}),u.length===0?s.jsx("div",{className:"center-empty",children:"아직 버전이 없습니다."}):s.jsx("div",{className:"rows",style:{marginTop:"0.75rem"},children:u.map(h=>{var v;return s.jsxs("div",{className:"row",children:[s.jsxs("span",{className:"mono",children:["v",h.version]}),s.jsx("span",{className:"pill",children:Ig[h.event_type]}),s.jsxs("span",{className:"grow muted",style:{fontSize:"0.78rem"},children:[new Date(h.created_at).toLocaleString(),typeof((v=h.meta)==null?void 0:v.reason)=="string"?` · ${h.meta.reason}`:""]}),s.jsx("button",{className:"btn sm",disabled:f,onClick:()=>m(h),children:"복원"})]},h.id)})}),s.jsx("div",{style:{textAlign:"right",marginTop:"1rem"},children:s.jsx("button",{className:"btn",onClick:i,children:"닫기"})})]})})}const zg=[{label:"만료 없음",hours:null},{label:"1시간",hours:1},{label:"24시간",hours:24},{label:"7일",hours:168}];function Ag({docId:r,onClose:i}){const[a,u]=y.useState([]),[d,f]=y.useState(null),[g,m]=y.useState("");async function h(){u(await z.listShares(r))}y.useEffect(()=>{h().catch(()=>{})},[r]);async function v(){await z.createShare(r,d),await h()}async function x(N){await z.revokeShare(N),await h()}function k(N){var j;const C=location.origin+N;(j=navigator.clipboard)==null||j.writeText(C).then(()=>{m(N),setTimeout(()=>m(""),1200)})}return s.jsx("div",{className:"overlay",onClick:i,children:s.jsxs("div",{className:"dialog",onClick:N=>N.stopPropagation(),children:[s.jsx("h2",{children:"공유 링크"}),s.jsx("p",{className:"subtle",children:"읽기 전용 HTML 링크입니다. 로그인 없이 열람할 수 있고, 편집은 불가능합니다."}),s.jsxs("div",{className:"toolbar",children:[s.jsx("select",{className:"field",style:{maxWidth:160},value:String(d),onChange:N=>f(N.target.value==="null"?null:Number(N.target.value)),children:zg.map(N=>s.jsx("option",{value:String(N.hours),children:N.label},N.label))}),s.jsx("button",{className:"btn pri",onClick:v,children:"링크 생성"})]}),a.length===0?s.jsx("div",{className:"center-empty",children:"아직 공유 링크가 없습니다."}):s.jsx("div",{className:"rows",children:a.map(N=>s.jsxs("div",{className:"row",style:{flexWrap:"wrap"},children:[s.jsx("a",{className:"grow mono",href:N.url,target:"_blank",rel:"noreferrer",children:N.url}),N.revoked===1?s.jsx("span",{className:"err",children:"취소됨"}):N.expired?s.jsx("span",{className:"err",children:"만료됨"}):s.jsx("span",{className:"ok",children:"활성"}),s.jsx("button",{className:"btn sm",onClick:()=>k(N.url),children:g===N.url?"복사됨":"복사"}),N.revoked!==1&&s.jsx("button",{className:"btn sm danger",onClick:()=>x(N.id),children:"취소"})]},N.id))}),s.jsx("div",{style:{textAlign:"right",marginTop:"1rem"},children:s.jsx("button",{className:"btn",onClick:i,children:"닫기"})})]})})}function Mg({docId:r,onClose:i,onRefreshed:a}){const[u,d]=y.useState(null),[f,g]=y.useState(!1);y.useEffect(()=>{z.parentContext(r).then(d).catch(()=>{})},[r]);async function m(){g(!0);try{await z.refreshContext(r),a(),i()}finally{g(!1)}}return s.jsx("div",{className:"overlay",onClick:i,children:s.jsxs("div",{className:"dialog",onClick:h=>h.stopPropagation(),children:[s.jsx("h2",{children:"상위 문서가 변경되었습니다"}),s.jsxs("p",{className:"subtle",children:["상위 문서",u!=null&&u.parentTitle?` "${u.parentTitle}"`:"",(u==null?void 0:u.parentVersion)!=null?` (v${u.parentVersion})`:"","가 바뀌어, 이 문서가 참조하는 컨텍스트가 낡았습니다. 무엇을 하시겠습니까?"]}),(u==null?void 0:u.available)&&s.jsxs("div",{className:"mini-card",style:{cursor:"default",marginTop:"0.5rem"},children:[s.jsx("div",{className:"subtle",style:{marginBottom:"0.3rem"},children:"최신 상위 컨텍스트 미리보기"}),(u.sections??[]).map((h,v)=>s.jsxs("div",{style:{marginBottom:"0.4rem"},children:[s.jsx("b",{children:h.heading}),s.jsxs("div",{className:"muted",style:{fontSize:"0.8rem"},children:[h.body.slice(0,120),h.body.length>120?"…":""]})]},v))]}),s.jsx("div",{className:"divider"}),s.jsxs("div",{className:"rows",children:[s.jsx("button",{className:"btn pri lg",disabled:f,onClick:m,children:"(A) 컨텍스트만 갱신 · 이 문서 본문은 그대로 둡니다"}),s.jsxs("div",{className:"subtle",children:["(B) 특정 섹션을 상위 내용에 맞춰 다시 쓰려면, 갱신 후 각 섹션의 ",s.jsx("b",{children:"재생성"}),"을 개별로 누르세요. 자동으로 덮어쓰지 않습니다."]}),s.jsx("button",{className:"btn ghost",onClick:i,children:"(C) 나중에 · 배지를 유지합니다"})]})]})})}const Cd={prd:"PRD","feature-spec":"기능명세",ia:"IA","user-flow":"유저플로우","design-system":"디자인 시스템",handoff:"개발 지시서"};function Dg(r){return/Claude Code|구독|subscription|API 키|API key|로그인|log ?in|authenticat|인증|key 모드|BYOK/i.test(r||"")}function Fg(){const{pid:r,did:i}=Fn(),a=i,{meta:u}=zl(),[d,f]=y.useState(null),[g,m]=y.useState([]),[h,v]=y.useState(null),[x,k]=y.useState(null),[N,C]=y.useState(!1),[j,T]=y.useState(null),[S,I]=y.useState(!1),[W,A]=y.useState("editor"),[Y,M]=y.useState(""),[Z,H]=y.useState(!1),[L,F]=y.useState(!1),O=y.useRef(null);function J(){F(!0),O.current&&clearTimeout(O.current),O.current=setTimeout(()=>F(!1),2600)}const[te,oe]=y.useState(null),[ue,ge]=y.useState(null),[Ee,xe]=y.useState("idle"),q=y.useRef(null),le=y.useCallback(async()=>{const ce=await z.getDocument(a);f(ce.document),C(ce.parentContextAvailable)},[a]),X=y.useCallback(async()=>{const ce=await z.getDocument(a);f(ce.document),C(ce.parentContextAvailable),m(me=>{const ve=ce.sections.map(Te=>Va(Te));return new Set(me.filter(Te=>Te.streaming).map(Te=>Te.id)).size?me:ve})},[a]),b=Hm(a,X),D=y.useCallback(async()=>{const ce=await z.getDocument(a);f(ce.document),m(ce.sections.map(ve=>Va(ve))),C(ce.parentContextAvailable),A(ce.sections.length===0?"interview":"editor");const me=await z.startInterview(a);v(me.session),k(me.template),r&&z.getProject(r).then(T).catch(()=>{})},[a,r]);y.useEffect(()=>(D().catch(ce=>M(ce.message)),()=>{var ce;return(ce=q.current)==null?void 0:ce.close()}),[D]),y.useEffect(()=>{d&&j&&r&&bm({pid:r,did:d.id,docTitle:d.title,projectName:j.name,ts:new Date().toISOString()})},[d,j,r]);function ye(){var ce;h&&(M(""),H(!1),z.completeInterview(h.id).catch(()=>{}),I(!0),m([]),A("editor"),(ce=q.current)==null||ce.close(),q.current=Cm(a,{onSectionStart:me=>m(ve=>[...ve,{id:me.sectionId,heading:me.heading,body:"",streaming:!0,editable:!1}]),onToken:me=>m(ve=>ve.map(De=>De.id===me.sectionId?{...De,body:De.body+me.delta}:De)),onSectionEnd:me=>m(ve=>ve.map(De=>De.id===me.sectionId?{...De,streaming:!1,editable:!0}:De)),onDone:()=>{I(!1),le(),b.reload(),m(me=>{const ve=me.filter(De=>!De.body.trim()).length;return ve>0&&ve>=me.length/2?M(`생성된 본문이 비어 있어요(${ve}/${me.length} 섹션). 추론형 모델은 토큰 예산이 작으면 본문을 못 냅니다 — 설정에서 max tokens 를 늘리거나 다른 모델로 시도하세요.`):me.length>0&&J(),me})},onError:me=>{I(!1),M(me||"초안 생성 실패 · 설정에서 AI 키를 확인하세요."),H(Dg(me))}}))}function ke(){var ce;(ce=q.current)==null||ce.close(),q.current=null,I(!1),m(me=>me.map(ve=>({...ve,streaming:!1,editable:!0}))),le(),b.reload()}function we(ce){var me;M(""),I(!0),m(ve=>ve.map(De=>De.id===ce?{...De,body:"",streaming:!0,editable:!1}:De)),(me=q.current)==null||me.close(),q.current=Em(ce,{onToken:ve=>m(De=>De.map(Te=>Te.id===ve.sectionId?{...Te,body:Te.body+ve.delta}:Te)),onSectionEnd:ve=>m(De=>De.map(Te=>Te.id===ve.sectionId?{...Te,streaming:!1,editable:!0}:Te)),onDone:()=>{I(!1),le(),b.reload()},onError:ve=>{I(!1),M(ve||"재생성 실패")}})}async function Se(ce){const me=await z.renameDocument(a,ce);f(me)}if(!d)return s.jsx(xt,{crumb:s.jsx("span",{children:"불러오는 중…"}),children:s.jsx("main",{className:"editor",children:s.jsx("div",{className:"editor-inner center-empty",children:Y?s.jsx("span",{className:"err",children:Y}):"불러오는 중…"})})});const Pe=d.context_stale===1&&N,Ne=b.suggestions.length,B=s.jsxs(s.Fragment,{children:[s.jsx(Mn,{to:"/",children:"프로젝트"}),s.jsx("span",{className:"sep",children:"/"}),s.jsx(Mn,{to:`/projects/${r}`,children:(j==null?void 0:j.name)??"프로젝트"}),s.jsx("span",{className:"sep",children:"/"}),s.jsx("b",{className:"name",children:Cd[d.type]})]}),ie=s.jsxs(s.Fragment,{children:[Pe&&s.jsxs("span",{className:"sug-count",onClick:()=>oe("context"),title:"컨텍스트 갱신 필요",children:[s.jsx("i",{}),"갱신 필요"]}),s.jsxs("span",{className:`sug-count ${Ne?"":"zero"}`,onClick:()=>b.reload(),children:[s.jsx("i",{}),"제안 ",Ne]}),s.jsx("button",{className:"btn",onClick:()=>oe("versions"),children:"버전"}),s.jsx("button",{className:"btn",onClick:()=>oe("share"),children:"공유"}),s.jsx("a",{className:"btn pri",href:`/api/documents/${a}/export.md`,title:"수락된 것만 내보내집니다",children:"내보내기"}),s.jsx("span",{className:"cmdk",children:"⌘K"})]}),pe=j?s.jsx(ys,{projectId:r,projectName:j.name,documents:j.documents,active:"PRD",activeCount:Ne}):void 0,Ue=Ne>0?`제안 ${Ne} · 수락 전에는 내보내기에 포함되지 않습니다`:"수락하지 않은 문장은 문서에 없습니다",nt=s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"오프라인 OK"}),(u==null?void 0:u.aiStub)&&s.jsx("span",{children:"STUB AI"}),s.jsxs("span",{children:["v",d.version]})]});if(W==="interview")return s.jsx(xt,{crumb:B,tbarRight:ie,nav:pe,tagline:"인터뷰 답변이 이후 제안 카드의 근거가 됩니다",statusLeft:s.jsx("span",{children:"인터뷰"}),statusRight:nt,children:s.jsx("main",{className:"interview-screen",children:s.jsxs("div",{className:"interview-inner",children:[s.jsxs("div",{className:"doc-head",children:[s.jsxs("div",{className:"eyebrow",children:[Cd[d.type]," · 인터뷰"]}),s.jsx("h2",{style:{fontSize:22},children:d.title}),s.jsx("div",{className:"meta",children:"답변한 뒤 AI 초안을 제안으로 받습니다"})]}),Y&&s.jsx("div",{className:"err",style:{marginBottom:12},children:Y}),h&&x?s.jsx(Jd,{template:x,session:h,streaming:S,onSaveAnswer:async ce=>{const me=await z.answer(h.id,ce);v(me)},onGenerate:ye}):s.jsx("div",{className:"muted",children:"인터뷰 템플릿을 불러오는 중…"})]})})});const he=b.supported?void 0:s.jsx("span",{children:"제안 API 준비 중 · 초안은 편집기에서 직접 수정할 수 있습니다"});return s.jsxs(xt,{crumb:B,tbarRight:ie,nav:pe,panel:s.jsx(Lg,{s:b,onFocusSection:ge,focusedSection:ue,doneLine:he}),tagline:Ue,statusLeft:s.jsx("span",{className:"save",children:Ee==="saving"?"저장 중…":Ee==="saved"?"로컬 저장됨 · 방금":"로컬 저장됨"}),statusRight:nt,children:[Z&&s.jsxs("div",{className:"gen-block-banner",children:[s.jsxs("div",{children:[s.jsx("b",{children:"AI 생성이 막혔어요."})," 이 계정은 Claude Code 접근이 막혀 있을 수 있어요(조직 차단).",s.jsx("span",{className:"muted",children:" 인터뷰 답변은 그대로 보존돼 있어, 키를 등록하면 다시 채워집니다."})]}),s.jsxs("div",{className:"acts",children:[s.jsx(Mn,{className:"btn",to:"/settings",children:"설정에서 키 등록"}),s.jsx("button",{className:"btn pri",disabled:S,onClick:ye,children:"다시 생성"})]})]}),s.jsx(Tg,{doc:d,sections:g,setSections:m,streaming:S,focusSection:ue,onFocusSection:ge,onRegenerate:we,onRename:Se,onStructuralChange:le,onSaveState:xe,error:Y,onBackToInterview:()=>A("interview"),onStop:ke}),te==="versions"&&s.jsx(Og,{docId:a,onClose:()=>oe(null),onRestored:D}),te==="share"&&s.jsx(Ag,{docId:a,onClose:()=>oe(null)}),te==="context"&&s.jsx(Mg,{docId:a,onClose:()=>oe(null),onRefreshed:()=>{le(),b.reload()}}),L&&s.jsxs("div",{className:"ceremony",role:"status","aria-live":"polite",children:[s.jsx(Ke,{pose:"done",size:40}),s.jsx("span",{children:"초안이 준비됐어요. 마음에 드는 문장만 수락하세요."})]})]})}const Ia=["P0","P1","P2"];function Bg({projectId:r,items:i,selected:a,onSelect:u,onAccept:d,onReject:f,onChanged:g,flows:m=[],onLinkFeature:h,onUnlinkFeature:v,reqs:x=[],onEditLink:k}){const[N,C]=y.useState(new Map),[j,T]=y.useState(0),S=y.useCallback(()=>{z.lint(r).then(O=>{const J=new Map;for(const te of O.violations)te.waived||J.set(te.refs[0],te);C(J),T(O.effectiveCount)}).catch(()=>{})},[r]);y.useEffect(()=>{S()},[S,i]);async function I(O){const J=Be(O),te=J.priority??"P2",oe=Ia[(Ia.indexOf(te)+1)%Ia.length];await z.updateItem(O.id,{meta:{...J,priority:oe}}),g==null||g(),S()}async function W(O){O.key&&(await z.lintWaiveOne(r,O.key),S())}const A=i.filter(O=>O.kind==="feature-group"&&O.status!=="rejected"),Y=O=>i.filter(J=>J.kind==="feature"&&J.parent_id===O&&J.status!=="rejected"),M=i.filter(O=>O.kind==="feature"&&O.status!=="rejected"),Z=M.filter(O=>Be(O).priority==="P0").length,H=M.filter(O=>Be(O).priority==="P1").length,L=M.filter(O=>O.status==="accepted").length,F=M.filter(O=>O.status==="proposed").length;return s.jsxs("div",{className:"editor-inner",children:[s.jsx("div",{className:"eyebrow",children:"SPEC · Feature Specification"}),s.jsx("h1",{className:"struct-h1",children:"기능명세서"}),s.jsx("div",{className:"dmeta",children:"항목 트리 · 서버 채번 · 수락한 항목만 문서"}),s.jsxs("div",{className:"sumbar",children:[s.jsxs("span",{className:"sumchip",children:["항목 ",s.jsx("b",{children:M.length})]}),s.jsxs("span",{className:"sumchip",children:["P0 ",s.jsx("b",{children:Z})," · P1 ",s.jsx("b",{children:H})]}),s.jsxs("span",{className:"sumchip",children:["수락 ",s.jsx("b",{children:L})]}),F>0&&s.jsxs("span",{className:"sumchip g",children:["제안 ",F]}),j>0&&s.jsxs("span",{className:"sumchip am",children:["검사 위반 ",j]})]}),s.jsxs("div",{className:"colhead",children:[s.jsx("span",{className:"c1",children:"ID"}),s.jsx("span",{className:"c2",children:"항목"}),s.jsx("span",{className:"c3",children:"근거"}),s.jsx("span",{className:"c4",children:"우선"})]}),A.map(O=>{var Ee;const J=Y(O.id),te=new Set;for(const xe of J)for(const q of((Ee=Be(xe).links)==null?void 0:Ee.pages)??[])te.add(q);const oe=J.filter(xe=>xe.status==="accepted").length,ue=J.filter(xe=>xe.status==="proposed").length,ge=N.get(O.ref_id);return s.jsxs("div",{children:[s.jsxs("div",{className:"grouprow",children:[s.jsx("span",{className:"gid",children:O.ref_id}),s.jsx("b",{children:O.title}),[...te].length>0&&s.jsx("span",{className:"pgchip",children:[...te].join("·")}),ge&&s.jsx("span",{className:"dpill amber",children:"검사 위반"}),s.jsxs("span",{className:"gsum",children:["하위 ",J.length," · 수락 ",oe," · 제안 ",ue]})]}),J.map(xe=>s.jsx(Ug,{feature:xe,open:a===xe.id||xe.status==="proposed",violation:N.get(xe.ref_id)??null,onToggle:()=>u(a===xe.id?null:xe.id),onAccept:()=>d(xe.id),onReject:()=>f(xe.id),onCyclePriority:()=>I(xe),onWaive:W,flows:m,onLinkFeature:h,onUnlinkFeature:v,reqs:x,onEditLink:k},xe.id))]},O.id)})]})}function Ug({feature:r,open:i,violation:a,onToggle:u,onAccept:d,onReject:f,onCyclePriority:g,onWaive:m,flows:h,onLinkFeature:v,onUnlinkFeature:x,reqs:k,onEditLink:N}){var Y,M,Z,H;const C=Be(r),j=r.status==="proposed",T=h.filter(L=>{var F;return(((F=Be(L).links)==null?void 0:F.features)??[]).includes(r.ref_id)}),S=h.filter(L=>{var F;return!(((F=Be(L).links)==null?void 0:F.features)??[]).includes(r.ref_id)}),I=((Y=C.links)==null?void 0:Y.reqs)??[],W=k.filter(L=>!I.includes(L.id)),A=r.body.split(`
|
|
123
|
-
`).map(L=>L.replace(/^[·\-*]\s*/,"").trim()).filter(Boolean);return i?s.jsxs("div",{className:`exp ${a?"viol":""}`,children:[s.jsxs("div",{className:"xh",children:[s.jsx("span",{className:"rid",children:r.ref_id}),s.jsx("b",{children:r.title}),j?s.jsx("span",{className:"dpill",children:"제안됨"}):a?s.jsx("span",{className:"dpill amber",children:a.code}):s.jsx("span",{className:"dpill",style:{color:"var(--ink)",borderColor:"var(--hair)"},children:"수락됨"}),s.jsx("button",{className:"pri-edit",title:"우선순위 변경 (P0→P1→P2)",onClick:L=>{L.stopPropagation(),g()},children:C.priority??"P?"}),s.jsxs("span",{className:"mini",children:[s.jsx("button",{onClick:d,title:"수락",children:"✓"}),s.jsx("button",{className:"no",onClick:f,title:"거절",children:"×"})]})]}),a&&s.jsxs("div",{className:"viol-bar",children:[s.jsx("span",{className:"vcode",children:a.code}),s.jsx("span",{className:"vmsg",children:a.message}),s.jsx("button",{className:"btn sm",onClick:()=>m(a),title:"이 위반만 무시(내용 유지)",children:"무시"})]}),A.length>0&&s.jsxs("div",{className:"ac",children:[s.jsx("span",{className:"lb",children:"수용 기준"}),A.map((L,F)=>s.jsxs("div",{children:["· ",L]},F))]}),s.jsxs("div",{className:"links",children:[s.jsx("span",{className:"lb",style:{width:"auto",margin:"0 4px 0 0",display:"inline"},children:"연결"}),(((M=C.links)==null?void 0:M.pages)??[]).map(L=>s.jsx("span",{className:"pgchip",children:L},L)),(((Z=C.links)==null?void 0:Z.flows)??[]).map(L=>s.jsx("span",{className:"pgchip",children:L},L)),(((H=C.links)==null?void 0:H.reqs)??[]).map(L=>s.jsx("span",{className:"pgchip",children:L},L))]}),h.length>0&&(v||x)&&s.jsxs("div",{className:"flow-linker",children:[s.jsx("span",{className:"lb",style:{width:"auto",margin:"0 4px 0 0",display:"inline"},children:"플로우"}),T.length===0&&s.jsx("span",{className:"muted",style:{fontSize:11},children:"연결된 플로우 없음"}),T.map(L=>s.jsxs("span",{className:"flowchip",children:[L.ref_id,x&&s.jsx("button",{title:"연결 해제",onClick:()=>x(L.id,r.ref_id),children:"×"})]},L.id)),v&&S.length>0&&s.jsxs("select",{className:"field",style:{maxWidth:220,fontSize:12},value:"",onChange:L=>{L.target.value&&v(L.target.value,r.ref_id)},children:[s.jsx("option",{value:"",children:"+ 플로우에 추가…"}),S.map(L=>s.jsxs("option",{value:L.id,children:[L.ref_id," ",L.title]},L.id))]})]}),N&&(k.length>0||I.length>0)&&s.jsxs("div",{className:"flow-linker",children:[s.jsx("span",{className:"lb",style:{width:"auto",margin:"0 4px 0 0",display:"inline"},children:"요구"}),I.length===0&&s.jsx("span",{className:"muted",style:{fontSize:11},children:"연결된 요구 없음"}),I.map(L=>s.jsxs("span",{className:"flowchip",children:[L,s.jsx("button",{title:"연결 해제",onClick:()=>N(r.id,"reqs",L,"remove"),children:"×"})]},L)),W.length>0&&s.jsxs("select",{className:"field",style:{maxWidth:240,fontSize:12},value:"",onChange:L=>L.target.value&&N(r.id,"reqs",L.target.value,"add"),children:[s.jsx("option",{value:"",children:"+ 요구에 연결…"}),W.map(L=>s.jsxs("option",{value:L.id,children:[L.id," ",L.heading]},L.id))]})]}),C.source&&s.jsxs("div",{className:"quote",children:["근거 · ",C.source]})]}):s.jsxs("button",{className:`trow lv2 ${j?"sug":""}`,onClick:u,children:[s.jsx("span",{className:"rid",children:r.ref_id}),s.jsx("span",{className:"rt",children:r.title}),a&&s.jsx("span",{className:"dpill amber",children:a.code}),s.jsx("span",{className:"src",children:C.source??""}),s.jsx("span",{className:"pri-tag",children:C.priority??""})]})}const cf={LIST:"LIST",DETAIL:"DETAIL",FORM:"FORM",DASH:"DASH",SETTINGS:"SET",GENERIC:"PAGE"};function Oa(r){const i=Be(r).page_type??"GENERIC";return i in cf?i:"GENERIC"}function uf({type:r}){return r==="DASH"?s.jsxs("div",{className:"iav-glyph dash",children:[s.jsx("span",{className:"g"}),s.jsx("span",{className:"g"}),s.jsx("span",{className:"g"}),s.jsx("span",{className:"g"})]}):r==="FORM"?s.jsxs("div",{className:"iav-glyph form",children:[s.jsxs("span",{className:"f",children:[s.jsx("b",{}),s.jsx("i",{})]}),s.jsxs("span",{className:"f",children:[s.jsx("b",{}),s.jsx("i",{})]})]}):r==="SETTINGS"?s.jsxs("div",{className:"iav-glyph settings",children:[s.jsxs("span",{className:"r on",children:[s.jsx("b",{}),s.jsx("i",{})]}),s.jsxs("span",{className:"r",children:[s.jsx("b",{}),s.jsx("i",{})]}),s.jsxs("span",{className:"r on",children:[s.jsx("b",{}),s.jsx("i",{})]})]}):r==="DETAIL"?s.jsxs("div",{className:"iav-glyph detail",children:[s.jsx("span",{className:"g"}),s.jsx("span",{className:"g"}),s.jsx("span",{className:"g"})]}):s.jsxs("div",{className:"iav-glyph list",children:[s.jsx("span",{className:"g"}),s.jsx("span",{className:"g"}),s.jsx("span",{className:"g"}),s.jsx("span",{className:"g",style:{width:"58%"}})]})}function Wg({projectId:r,items:i,selected:a,onSelect:u,onAccept:d,onReject:f,generating:g,onRegenerate:m,features:h=[],flowItems:v=[],onEditLink:x,onSetSection:k}){const[N,C]=y.useState(new Map),[j,T]=y.useState("map");y.useEffect(()=>{z.lint(r).then(O=>{const J=new Map;for(const te of O.violations)te.waived||J.set(te.refs[0],te);C(J)}).catch(()=>{})},[r,i]);const S=y.useMemo(()=>i.filter(O=>O.kind==="page"&&O.status!=="rejected"),[i]),I=y.useMemo(()=>v.filter(O=>O.kind==="step"),[v]),W=v.some(O=>O.kind==="flow"),A=O=>{const J=new Set;for(const te of I)if(Be(te).page===O){const oe=v.find(ue=>ue.id===te.parent_id);oe&&J.add(oe.ref_id)}return[...J]},Y=O=>{var J;return((J=Be(O).links)==null?void 0:J.features)??[]},M=y.useMemo(()=>{const O=S.filter(ue=>N.has(ue.ref_id)).length,J=W?S.filter(ue=>A(ue.ref_id).length===0).length:0,te=new Set(S.flatMap(ue=>Y(ue))),oe=h.filter(ue=>!te.has(ue.ref_id));return{violCount:O,unreachable:J,unlinked:oe,placed:h.length-oe.length}},[S,N,h,v,W]),Z=S.find(O=>O.id===a)??null,H=O=>(Be(O).section??"").trim(),L=y.useMemo(()=>{const O=[],J=new Map;for(const oe of S){const ue=H(oe)||"__none";J.has(ue)||(J.set(ue,[]),O.push(ue)),J.get(ue).push(oe)}O.sort((oe,ue)=>(oe==="__none"?1:0)-(ue==="__none"?1:0));const te=O.filter(oe=>oe!=="__none");return{order:O,map:J,hasSections:te.length>0,names:te}},[S]),F=O=>{const J=Oa(O),te=N.get(O.ref_id),oe=Y(O).length===0,ue=W&&A(O.ref_id).length===0,ge=O.status==="proposed"?"prop":te||oe||ue?"viol":a===O.id?"sel":"",Ee=oe?"근거 기능 없음":ue?"도달 플로우 없음":te?"검사 위반":"";return s.jsxs("button",{className:`iav-card ${ge}`,onClick:()=>u(O.id),"aria-pressed":a===O.id,children:[s.jsx(uf,{type:J}),s.jsxs("span",{className:"cap",children:[s.jsx("span",{className:"rid",children:O.ref_id}),s.jsx("span",{className:"ttl",children:O.title}),s.jsx("span",{className:"iav-chip",children:cf[J]})]}),O.status==="proposed"?s.jsx("span",{className:"flag prop",children:"+ 제안됨 — 수락하면 확정"}):Ee&&s.jsxs("span",{className:"flag warn",children:["△ ",Ee]})]},O.id)};return s.jsxs("div",{className:"editor-inner",children:[s.jsx("div",{className:"eyebrow",children:"IA · Information Architecture"}),s.jsx("h1",{className:"struct-h1",children:"정보 구조"}),s.jsx("div",{className:"dmeta",children:"사이트맵 = 정본 · 와이어프레임이 이 구조를 그대로 렌더"}),S.length>0&&s.jsxs("div",{className:"iav-health",children:[s.jsxs("span",{className:"iav-stat total",children:[s.jsx("span",{className:"num",children:S.length})," 화면"]}),M.violCount>0&&s.jsxs("span",{className:"iav-stat warn",children:[s.jsx("span",{className:"dot"}),s.jsx("span",{className:"num",children:M.violCount})," 검사 위반"]}),W&&M.unreachable>0&&s.jsxs("span",{className:"iav-stat warn",children:[s.jsx("span",{className:"dot"}),s.jsx("span",{className:"num",children:M.unreachable})," 도달 플로우 없음"]}),h.length>0&&M.unlinked.length>0&&s.jsxs("span",{className:"iav-stat warn",children:[s.jsx("span",{className:"dot"}),s.jsx("span",{className:"num",children:M.unlinked.length})," 미연결 기능"]}),h.length>0&&s.jsxs("span",{className:"iav-stat",children:[s.jsxs("span",{className:"num",children:[M.placed," / ",h.length]})," ","기능 배치됨"]})]}),s.jsxs("div",{className:"iav-tabs",role:"tablist",children:[s.jsx("button",{className:`iav-tab ${j==="map"?"on":""}`,role:"tab","aria-selected":j==="map",onClick:()=>T("map"),children:"사이트맵"}),s.jsx("button",{className:`iav-tab ${j==="matrix"?"on":""}`,role:"tab","aria-selected":j==="matrix",onClick:()=>T("matrix"),children:"커버리지"}),s.jsx("button",{className:`iav-tab ${j==="list"?"on":""}`,role:"tab","aria-selected":j==="list",onClick:()=>T("list"),children:"리스트 편집"}),s.jsx("button",{className:"btn sm",style:{marginLeft:"auto"},disabled:g,onClick:m,children:g?"생성 중…":"다시 생성"})]}),S.length===0?s.jsxs("div",{className:"iav-empty",children:["아직 화면이 없어요. ",s.jsx("b",{children:"다시 생성"}),"으로 기능명세에서 화면을 제안받으세요."]}):j==="list"?s.jsx("div",{className:"ia-list",children:S.map(O=>{const J=Oa(O),te=N.get(O.ref_id);return s.jsxs("div",{className:`row ${O.status==="proposed"?"sug":""}`,children:[s.jsx("span",{className:"rid",children:O.ref_id}),s.jsx("span",{className:"rt",children:O.title}),s.jsx("span",{className:"typechip",children:J}),te&&s.jsx("span",{className:"dpill amber",children:"검사 위반"}),O.status==="proposed"&&s.jsxs("span",{className:"mini",children:[s.jsx("button",{onClick:()=>d(O.id),children:"✓"}),s.jsx("button",{className:"no",onClick:()=>f(O.id),children:"×"})]})]},O.id)})}):j==="matrix"?s.jsx(Hg,{pages:S,features:h,onPick:O=>{u(O),T("map")}}):s.jsxs("div",{className:"iav-stage",children:[L.hasSections?s.jsxs("div",{className:"iav-tree",children:[s.jsxs("div",{className:"iav-approot",children:[s.jsx("span",{className:"mid",children:"APP"})," 사이트맵"]}),L.order.map(O=>s.jsxs("section",{className:"iav-sec",children:[s.jsxs("div",{className:"iav-sechd",children:[s.jsx("span",{className:"branch","aria-hidden":!0}),s.jsx("span",{className:"nm",children:O==="__none"?"미분류":O}),s.jsx("span",{className:"cnt",children:L.map.get(O).length})]}),s.jsx("div",{className:"iav-grid",children:L.map.get(O).map(F)})]},O))]}):s.jsx("div",{className:"iav-grid",children:S.map(F)}),Z?s.jsx(Vg,{page:Z,type:Oa(Z),flows:A(Z.ref_id),hasFlowDoc:W,violation:N.get(Z.ref_id)??null,features:h,sections:L.names,currentSection:H(Z),onAccept:()=>d(Z.id),onReject:()=>f(Z.id),onEditLink:x,onSetSection:k}):s.jsx("aside",{className:"iav-insp empty",children:"화면을 선택하면 근거 기능·진입 플로우·상태를 봅니다."})]})]})}function Vg({page:r,type:i,flows:a,hasFlowDoc:u,violation:d,features:f,sections:g,currentSection:m,onAccept:h,onReject:v,onEditLink:x,onSetSection:k}){var T;const N=((T=Be(r).links)==null?void 0:T.features)??[],C=f.filter(S=>!N.includes(S.ref_id)),j=S=>{var I;return((I=f.find(W=>W.ref_id===S))==null?void 0:I.title)??""};return s.jsxs("aside",{className:"iav-insp",children:[s.jsxs("div",{className:"ihd",children:[s.jsx("div",{className:"big",children:s.jsx(uf,{type:i})}),s.jsxs("div",{className:"ht",children:[s.jsx("h4",{children:r.title}),s.jsxs("div",{className:"sub",children:[r.ref_id," · ",i]})]})]}),s.jsxs("div",{className:"ibody",children:[s.jsxs("div",{className:"iav-krow",children:[s.jsx("span",{className:"iav-k",children:"섹션"}),k?s.jsxs(s.Fragment,{children:[s.jsxs("select",{className:"iav-addsel",value:g.includes(m)?m:"",onChange:S=>k(r.id,S.target.value),children:[s.jsx("option",{value:"",children:"(최상위)"}),g.map(S=>s.jsx("option",{value:S,children:S},S))]}),s.jsx("input",{className:"iav-secnew",placeholder:"+ 새 섹션",onKeyDown:S=>{const I=S.currentTarget.value.trim();S.key==="Enter"&&I&&(k(r.id,I),S.currentTarget.value="")}})]}):s.jsx("span",{className:"iav-lchip",children:m||"최상위"})]}),s.jsxs("div",{className:"iav-krow",children:[s.jsx("span",{className:"iav-k",children:"근거 기능"}),N.map(S=>x?s.jsxs("button",{className:"iav-lchip rm",title:j(S),onClick:()=>x(r.id,"features",S,"remove"),children:[S," ",s.jsx("span",{"aria-hidden":!0,children:"×"})]},S):s.jsx("span",{className:"iav-lchip",title:j(S),children:S},S)),N.length===0&&s.jsx("span",{className:"iav-none",children:"근거 기능 없음"}),x&&C.length>0&&s.jsxs("select",{className:"iav-addsel",value:"",onChange:S=>S.target.value&&x(r.id,"features",S.target.value,"add"),children:[s.jsx("option",{value:"",children:"+ 기능 연결…"}),C.map(S=>s.jsxs("option",{value:S.ref_id,children:[S.ref_id," ",S.title]},S.id))]})]}),s.jsxs("div",{className:"iav-krow",children:[s.jsx("span",{className:"iav-k",children:"진입 플로우"}),a.length?a.map(S=>s.jsx("span",{className:"iav-lchip",children:S},S)):u?s.jsx("span",{className:"iav-none warn",children:"도달 플로우 없음"}):s.jsx("span",{className:"iav-none",children:"유저플로우 미작성"})]}),s.jsxs("div",{className:"iav-krow",children:[s.jsx("span",{className:"iav-k",children:"상태"}),s.jsxs("span",{className:"iav-status",children:[r.status==="proposed"?"제안됨":"수락됨",d?` · ${d.code}`:" · 와이어프레임 최신"]})]}),r.status==="proposed"&&s.jsxs("div",{className:"iav-iacts",children:[s.jsx("button",{className:"btn ok",onClick:h,children:"수락"}),s.jsx("button",{className:"btn",onClick:v,children:"거절"})]})]})]})}function Hg({pages:r,features:i,onPick:a}){if(i.length===0)return s.jsx("div",{className:"iav-empty",children:"기능명세가 아직 없어요. 기능이 있어야 화면과의 커버리지를 볼 수 있습니다."});const u=(g,m)=>{var h;return(((h=Be(g).links)==null?void 0:h.features)??[]).includes(m)},d=g=>i.filter(m=>u(g,m.ref_id)).length,f=g=>r.filter(m=>u(m,g)).length;return s.jsx("div",{className:"iav-mtxwrap",children:s.jsxs("table",{className:"iav-mtx",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"corner",children:"기능 \ 화면"}),r.map(g=>s.jsx("th",{children:s.jsxs("button",{className:"colh",onClick:()=>a(g.id),title:g.title,children:[s.jsx("span",{className:"rid",children:g.ref_id}),s.jsx("span",{className:"ct",children:g.title})]})},g.id)),s.jsx("th",{className:"sumh",children:"배치"})]})}),s.jsxs("tbody",{children:[i.map(g=>{const m=f(g.ref_id);return s.jsxs("tr",{children:[s.jsxs("th",{className:"rowh",children:[s.jsx("span",{className:"rid",children:g.ref_id}),g.title]}),r.map(h=>s.jsx("td",{className:"cell",children:u(h,g.ref_id)?s.jsx("span",{className:"on-c","aria-label":"연결됨",children:"●"}):s.jsx("span",{className:"off-c","aria-hidden":!0,children:"·"})},h.id)),s.jsx("td",{className:"cell",children:m>0?s.jsx("span",{className:"num",children:m}):s.jsx("span",{className:"gaptag",children:"⚠ 화면 없음"})})]},g.id)}),s.jsxs("tr",{className:"footr",children:[s.jsx("th",{className:"rowh muted",children:"담는 기능"}),r.map(g=>{const m=d(g);return s.jsx("td",{className:`cell ${m===0?"gapcol":""}`,children:m===0?s.jsx("span",{className:"gaptag",children:"⚠ 0"}):s.jsx("span",{className:"num",children:m})},g.id)}),s.jsx("td",{})]})]})]})})}function Kg({items:r,onAccept:i,onReject:a,onChanged:u,pages:d=[],onSetStepPage:f}){const[g,m]=y.useState(!1),h=r.filter(k=>k.kind==="flow"&&k.status!=="rejected"),v=k=>r.filter(N=>N.kind==="step"&&N.parent_id===k&&N.status!=="rejected").sort((N,C)=>N.position-C.position);function x(){var T,S;const k=["flowchart LR"];for(const I of h){const W=v(I.id),A=W.filter(M=>!Be(M).branch),Y=M=>M.ref_id.replace(/[.\-]/g,"_");A.forEach((M,Z)=>{const H=Be(M),L=`${H.page?H.page+" ":""}${M.title}`,F=H.node==="start"||H.node==="end"?`([${L}])`:H.node==="decision"?`{${M.title}}`:`[${L}]`;k.push(` ${Y(M)}${F}`),Z>0&&k.push(` ${Y(A[Z-1])} --> ${Y(M)}`)});for(const M of W.filter(Z=>Be(Z).branch)){const Z=Be(M),H=(((T=Z.branch)==null?void 0:T.from_step)??"").replace(/[.\-]/g,"_");H&&k.push(` ${H} -->|${((S=Z.branch)==null?void 0:S.label)??"예"}| ${Y(M)}[${M.title}]`)}}const N=new Blob([k.join(`
|
|
124
|
-
`)],{type:"text/plain"}),C=URL.createObjectURL(N),j=document.createElement("a");j.href=C,j.download="flows.mmd",j.click(),URL.revokeObjectURL(C)}return s.jsxs("div",{className:"editor-inner",children:[s.jsx("div",{className:"eyebrow",children:"FLOW · User Flow"}),s.jsx("h1",{className:"struct-h1",children:"유저 플로우"}),s.jsxs("div",{className:"dmeta",children:["노드 = 화면(PG-)·판단(◇)·완료(●) — 편집은 스텝, 보기는 다이어그램",s.jsx("button",{className:"btn sm",style:{marginLeft:10},onClick:()=>m(k=>!k),children:g?"다이어그램":"스텝 편집"}),s.jsx("button",{className:"btn sm",onClick:x,children:"mermaid 내보내기"})]}),h.map(k=>{const N=v(k.id),C=N.filter(S=>!Be(S).branch),j=N.filter(S=>Be(S).branch),T=Be(k);return g?s.jsxs("div",{className:"flane",children:[s.jsxs("div",{className:"fh",children:[s.jsx("span",{className:"rid",children:k.ref_id}),s.jsx("b",{children:k.title}),s.jsx("span",{className:"src",children:T.source??""})]}),s.jsx("div",{className:"ia-list",children:N.map(S=>{const I=Be(S);return s.jsxs("div",{className:"trow",children:[s.jsx("span",{className:"rid",children:S.ref_id}),s.jsx("input",{className:"field",style:{flex:1,fontSize:12},defaultValue:S.title,onBlur:async W=>{W.target.value.trim()&&W.target.value!==S.title&&(await z.updateItem(S.id,{title:W.target.value.trim()}),u==null||u())}}),s.jsx("span",{className:"typechip",children:I.node??"screen"}),f&&d.length>0?s.jsxs("select",{className:"field",style:{maxWidth:150,fontSize:11},value:I.page??"",onChange:W=>f(S.id,W.target.value||null),children:[s.jsx("option",{value:"",children:"화면 없음"}),d.map(W=>s.jsxs("option",{value:W.ref_id,children:[W.ref_id," ",W.title]},W.id))]}):I.page&&s.jsx("span",{className:"pgchip",children:I.page}),s.jsx("span",{className:"mini",children:s.jsx("button",{className:"no",title:"스텝 삭제",onClick:async()=>{await z.deleteItem(S.id),u==null||u()},children:"×"})})]},S.id)})})]},k.id):s.jsxs("div",{className:"flane",children:[s.jsxs("div",{className:"fh",children:[s.jsx("span",{className:"rid",children:k.ref_id}),s.jsx("b",{children:k.title}),s.jsx("span",{className:"src",children:T.source??""}),k.status==="proposed"&&s.jsxs("span",{className:"mini",style:{marginLeft:8},children:[s.jsx("button",{onClick:()=>i(k.id),children:"✓"}),s.jsx("button",{className:"no",onClick:()=>a(k.id),children:"×"})]})]}),s.jsx("div",{className:"ftrack",children:C.map((S,I)=>{const W=Be(S),A=I>0&&Be(C[I-1]).node==="decision";return s.jsx(qg,{step:S,meta:W,edgeBefore:I>0,edgeLabel:A?"아니오":void 0},S.id)})}),j.map(S=>{var W;const I=Be(S);return s.jsxs("div",{className:"fbranch",children:[s.jsx("div",{className:"bend"}),s.jsxs("span",{className:"floop",children:[((W=I.branch)==null?void 0:W.label)??"예"," ·"]}),s.jsxs("div",{className:"fnode",children:[s.jsx("span",{className:"fid",children:I.page??""}),s.jsx("b",{children:S.title})]}),I.note&&s.jsxs("span",{className:"floop",children:["→ ",I.note]})]},S.id)})]},k.id)})]})}function qg({step:r,meta:i,edgeBefore:a,edgeLabel:u}){const d=a?s.jsx("div",{className:"fedge",children:u&&s.jsx("span",{className:"elb",children:u})}):null;if(i.node==="decision")return s.jsxs(s.Fragment,{children:[d,s.jsx("div",{className:"fdec",children:r.title})]});const f=i.node==="start"?"startn":i.node==="end"?"endn":"",g=i.node==="start"?"시작":i.node==="end"?"완료":i.page??"";return s.jsxs(s.Fragment,{children:[d,s.jsxs("div",{className:`fnode ${f}`,children:[s.jsx("span",{className:"fid",children:g}),s.jsx("b",{children:r.title})]})]})}const Qg={"feature-spec":"SPEC",ia:"IA","user-flow":"FLOW"},Ed={"feature-spec":"SPEC · Feature Specification",ia:"IA · Information Architecture","user-flow":"FLOW · User Flow"},cr={"feature-spec":"기능명세서",ia:"정보 구조","user-flow":"유저 플로우"};function Gg({doc:r}){const{pid:i}=Fn(),a=Ut(),u=r.id,d=r.type,[f,g]=y.useState(r),[m,h]=y.useState([]),[v,x]=y.useState([]),[k,N]=y.useState(null),[C,j]=y.useState(!1),[T,S]=y.useState(null),[I,W]=y.useState(""),A=y.useRef(null),[Y,M]=y.useState([]),[Z,H]=y.useState([]),[L,F]=y.useState([]),[O,J]=y.useState([]),[te,oe]=y.useState([]),ue=y.useCallback(async he=>{if(d==="feature-spec"){const ce=he.find(ve=>ve.type==="user-flow"),me=ce?await z.items(ce.id).then(ve=>ve.items).catch(()=>[]):[];M(me.filter(ve=>ve.kind==="flow"&&ve.status!=="rejected")),i&&z.projectReqs(i).then(ve=>H(ve.reqs)).catch(()=>{})}else if(d==="ia"){const ce=he.find(Te=>Te.type==="feature-spec"),me=ce?await z.items(ce.id).then(Te=>Te.items).catch(()=>[]):[];F(me.filter(Te=>Te.kind==="feature"&&Te.status!=="rejected"));const ve=he.find(Te=>Te.type==="user-flow"),De=ve?await z.items(ve.id).then(Te=>Te.items).catch(()=>[]):[];oe(De.filter(Te=>Te.status!=="rejected"))}else if(d==="user-flow"){const ce=he.find(ve=>ve.type==="ia"),me=ce?await z.items(ce.id).then(ve=>ve.items).catch(()=>[]):[];J(me.filter(ve=>ve.kind==="page"&&ve.status!=="rejected"))}},[d,i]),ge=y.useCallback(async()=>{const[he,ce]=await Promise.all([z.items(u).then(me=>me.items),z.suggestions(u,"open").then(me=>Array.isArray(me)?me:me.suggestions).catch(()=>[])]);h(he),x(ce)},[u]),Ee=y.useCallback(async()=>{g((await z.getDocument(u)).document),await ge(),i&&z.getProject(i).then(he=>{N(he),ue(he.documents)}).catch(()=>{})},[u,i,ge,ue]);y.useEffect(()=>(Ee().catch(he=>W(he.message)),()=>{var he;return(he=A.current)==null?void 0:he.close()}),[Ee]);function xe(){var he;W(""),j(!0),h([]),(he=A.current)==null||he.close(),A.current=Pm(u,{onItem:ce=>h(me=>[...me,ce]),onDone:()=>{j(!1),ge()},onError:ce=>{j(!1),W(ce||"생성 실패 · 설정에서 AI 키/CLI 를 확인하세요.")}})}async function q(he){await z.acceptItem(he),await ge()}async function le(he){await z.rejectItem(he),await ge()}async function X(he){await z.restoreItem(he),await ge()}async function b(he){await z.acceptSuggestion(he),await ge()}async function D(he){await z.rejectSuggestion(he),await ge()}async function ye(){i&&(await z.lintSuggest(i),await ge())}async function ke(){i&&(await z.lintWaiveAll(i),await ge())}async function we(he,ce){await z.linkFeatureToFlow(he,ce),k&&await ue(k.documents),await ge()}async function Se(he,ce){await z.unlinkFeatureFromFlow(he,ce),k&&await ue(k.documents),await ge()}async function Pe(he,ce,me,ve){await z.editLink(he,ce,me,ve),k&&await ue(k.documents),await ge()}async function Ne(he,ce){await z.setStepPage(he,ce),k&&await ue(k.documents),await ge()}async function B(he,ce){await z.setSection(he,ce),await ge()}const ie=v.length,pe=m.length===0&&!C,Ue=s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:`sug-count ${ie?"":"zero"}`,children:[s.jsx("i",{}),"제안 ",ie]}),s.jsx("button",{className:"btn",onClick:ye,children:"정합성 검사"}),s.jsx("button",{className:"btn",title:"모든 위반을 무시(내용은 그대로 유지). 게이트만 통과합니다.",onClick:ke,children:"위반 모두 무시"}),s.jsx("a",{className:"btn",href:`/api/documents/${u}/export.md`,children:"MD"}),s.jsx("a",{className:"btn",href:`/api/documents/${u}/export.html?print=1`,target:"_blank",rel:"noreferrer",title:"브라우저 인쇄 대화상자에서 'PDF로 저장'",children:"PDF"}),s.jsx("span",{className:"cmdk",children:"⌘K"})]}),nt=(()=>{if(C&&m.length===0)return s.jsxs("div",{className:"editor-inner",children:[s.jsx("div",{className:"eyebrow",children:Ed[d]}),s.jsx("h1",{className:"struct-h1",children:cr[d]}),s.jsxs("div",{className:"ch-strip",style:{marginTop:18},children:[s.jsx(Ke,{pose:"write",size:40}),s.jsxs("span",{children:[cr[d]," 구조를 제안받는 중이에요… 항목이 하나씩 채워집니다. (추론형 모델은 잠시 걸립니다)"]})]})]});if(pe)return s.jsxs("div",{className:"editor-inner",children:[s.jsx("div",{className:"eyebrow",children:Ed[d]}),s.jsx("h1",{className:"struct-h1",children:cr[d]}),s.jsx("div",{className:"dmeta",children:"아직 항목이 없습니다. 상위 문서에서 구조를 제안받으세요."}),s.jsxs("div",{className:"empty",style:{marginTop:18},children:[s.jsx(Ke,{pose:"write",size:64}),s.jsxs("div",{style:{marginTop:10},children:[s.jsx("b",{children:cr[d]})," 를 초안으로 제안받습니다. 번호는 서버가 매기고, 모든 항목은 수락 전까지 제안 상태입니다."]}),s.jsx("button",{className:"btn pri lg",style:{marginTop:14},onClick:xe,children:"구조 제안받기"})]}),I&&s.jsx("div",{className:"err",style:{marginTop:12},children:I})]});const he={items:m,selected:T,onSelect:S,onAccept:q,onReject:le,generating:C,onRegenerate:xe,onChanged:ge};return d==="feature-spec"?s.jsx(Bg,{...he,projectId:i,flows:Y,reqs:Z,onLinkFeature:we,onUnlinkFeature:Se,onEditLink:Pe}):d==="ia"?s.jsx(Wg,{...he,projectId:i,features:L,flowItems:te,onEditLink:Pe,onSetSection:B,onNavPage:ce=>a(`/projects/${i}/wireframes?focus=${ce}`)}):s.jsx(Kg,{...he,pages:O,onSetStepPage:Ne})})();return s.jsx(xt,{crumb:s.jsxs(s.Fragment,{children:[s.jsx("b",{className:"name",children:(k==null?void 0:k.name)??"프로젝트"}),s.jsx("span",{className:"sep",children:"/"}),s.jsx("span",{children:cr[d]})]}),tbarRight:Ue,nav:k?s.jsx(ys,{projectId:i,projectName:k.name,documents:k.documents,active:Qg[d],activeCount:ie}):void 0,panel:s.jsx(Yg,{suggestions:v,onAccept:b,onReject:D,onSuggestLint:ye}),tagline:ie>0?`제안 ${ie} · 수락 전에는 내보내기에 포함되지 않습니다`:"수락하지 않은 항목은 문서에 없습니다",statusLeft:s.jsx("span",{children:f.status==="streaming"?"생성 중…":`항목 ${m.length}`}),statusRight:s.jsxs("span",{children:["v",f.version]}),children:s.jsxs("main",{className:"ed structure-ed",children:[C&&m.length>0&&s.jsxs("div",{className:"ch-strip",style:{margin:"0 0 12px"},children:[s.jsx(Ke,{pose:"write",size:34}),s.jsxs("span",{children:["구조를 제안받는 중… 항목 ",m.length,"개 도착"]})]}),nt,!pe&&!C&&s.jsx(Jg,{items:m,onRestore:X})]})})}function Jg({items:r,onRestore:i}){const[a,u]=y.useState(!1),[d,f]=y.useState(null),g=r.filter(h=>h.status==="rejected");if(g.length===0)return null;async function m(h){f(h);try{await i(h)}finally{f(null)}}return s.jsxs("div",{className:"rejected-bar",children:[s.jsxs("button",{className:"rejected-head",onClick:()=>u(h=>!h),children:[s.jsxs("span",{children:["제외된 항목 ",g.length,"개"]}),s.jsx("span",{className:"muted",children:a?"접기":"펼쳐서 되살리기"})]}),a&&s.jsx("div",{className:"rejected-list",children:g.map(h=>s.jsxs("div",{className:"rejected-row",children:[s.jsx("span",{className:"rid",children:h.ref_id}),s.jsx("span",{className:"rtitle",children:h.title}),s.jsx("button",{className:"btn sm",disabled:d===h.id,onClick:()=>m(h.id),children:"되살리기"})]},h.id))})]})}function Yg({suggestions:r,onAccept:i,onReject:a,onSuggestLint:u}){const d=r.length;return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"ph",children:["제안 ",s.jsx("span",{className:"cnt",children:d})]}),d===0?s.jsxs("div",{className:"panel-empty",children:[s.jsx(Ke,{pose:"wait",size:72}),"검토할 제안이 없어요.",s.jsx("br",{}),s.jsx("button",{className:"btn sm",style:{marginTop:10},onClick:u,children:"정합성 검사 실행"})]}):r.map(f=>f.kind==="lint"?s.jsxs("div",{className:"scard compile",children:[s.jsxs("div",{className:"sh",children:[s.jsx(Ke,{pose:"fetch",size:20,animate:!1}),s.jsx("b",{children:f.title}),s.jsx("span",{className:"lintcode",children:f.source})]}),s.jsx("p",{children:f.body}),s.jsxs("div",{className:"scard-acts",children:[s.jsx("button",{className:"a",onClick:()=>i(f.id),children:"수정 적용"}),s.jsx("button",{className:"r",onClick:()=>a(f.id),children:"무시"})]})]},f.id):s.jsxs("div",{className:"scard",children:[s.jsxs("div",{className:"sh",children:[s.jsx(Ke,{pose:"fetch",size:20,animate:!1}),s.jsx("b",{children:f.title}),s.jsxs("span",{className:"ssrc",children:["근거 ",f.source]})]}),s.jsx("p",{children:f.body}),s.jsxs("div",{className:"scard-acts",children:[s.jsx("button",{className:"a",onClick:()=>i(f.id),children:"수락"}),s.jsx("button",{className:"r",onClick:()=>a(f.id),children:"거절"})]})]},f.id))]})}function Zg({doc:r}){const{pid:i}=Fn(),[a,u]=y.useState(null),[d,f]=y.useState(null),[g,m]=y.useState(null),[h,v]=y.useState(null),[x,k]=y.useState(null),[N,C]=y.useState("interview"),[j,T]=y.useState(!1),[S,I]=y.useState(""),W=y.useCallback(async()=>{const L=await z.startInterview(r.id);if(f(L.session),m(L.template),i){z.getProject(i).then(u).catch(()=>{});const F=await z.designSystem(i).catch(()=>({record:null}));F.record&&(v(F.record),C("result"))}},[r.id,i]);y.useEffect(()=>{W().catch(L=>I(L.message))},[W]);async function A(){if(d){T(!0),I("");try{await z.completeInterview(d.id).catch(()=>{});const L=await z.generateDesignSystem(r.id);v(L.record),C("result")}catch(L){I(L.message||"디자인 시스템 생성에 실패했어요")}finally{T(!1)}}}async function Y(){const L=await z.acceptDesignSystem(r.id);v(L.record)}async function M(){if(d){T(!0),I("");try{await z.completeInterview(d.id).catch(()=>{});const L=await z.exploreDesignSystems(r.id);k(L.candidates),C("explore")}catch(L){I(L.message||"방향 탐색에 실패했어요")}finally{T(!1)}}}async function Z(L){const F=await z.selectDesignSystem(r.id,L);v(F.record),C("result")}const H=h==null?void 0:h.guide;return s.jsx(xt,{crumb:s.jsxs(s.Fragment,{children:[s.jsx("b",{className:"name",children:(a==null?void 0:a.name)??"프로젝트"}),s.jsx("span",{className:"sep",children:"/"}),s.jsx("span",{children:"디자인 시스템"})]}),nav:a?s.jsx(ys,{projectId:i,projectName:a.name,documents:a.documents,active:"DS"}):void 0,tagline:"인터뷰로 디자인 시스템을 설계 · 수락하면 와이어프레임·시안이 이 시스템으로 렌더",children:N==="interview"?s.jsx("main",{className:"interview-screen",children:s.jsxs("div",{className:"interview-inner",children:[s.jsx("div",{className:"eyebrow",children:"디자인 시스템 · 인터뷰"}),s.jsx("h1",{className:"struct-h1",children:"디자인 시스템 설계"}),s.jsx("div",{className:"dmeta",children:"색·타이포·간격·형태·컴포넌트·톤을 인터뷰로. 답 후 AI 가 시스템을 제안합니다."}),S&&s.jsx("div",{className:"genwarn",children:S}),d&&g?s.jsx(Jd,{template:g,session:d,streaming:j,onSaveAnswer:async L=>{const F=await z.answer(d.id,L);f(F)},onGenerate:A}):s.jsxs("div",{className:"empty",style:{marginTop:18},children:[s.jsx(Ke,{pose:"think",size:56})," 불러오는 중…"]}),s.jsx("div",{className:"ds-explore-cta",children:s.jsx("button",{className:"btn ghost sm",disabled:j,onClick:M,children:j?"탐색 중…":"또는 3가지 방향으로 탐색"})})]})}):N==="explore"?s.jsxs("main",{className:"ed wfwrap",children:[s.jsx("div",{className:"eyebrow",children:"디자인 시스템 · 방향 탐색"}),s.jsx("h1",{className:"struct-h1",children:"3가지 방향"}),s.jsx("div",{className:"dmeta",children:"강조색은 유지하고 성격만 다르게. 하나를 고르면 제안으로 확정됩니다."}),S&&s.jsx("div",{className:"genwarn",children:S}),s.jsx("div",{className:"ds-cands",children:(x??[]).map((L,F)=>s.jsxs("div",{className:"ds-cand",children:[s.jsx("div",{className:"ds-cand-tile",children:s.jsx("iframe",{srcDoc:L.styleTileHtml,sandbox:"",title:`방향 ${F+1}`,scrolling:"no"})}),s.jsx("p",{className:"ds-cand-r",children:L.rationale}),s.jsx("button",{className:"btn ok",onClick:()=>Z(F),children:"이 방향 선택"})]},F))}),s.jsx("div",{className:"ds-explore-cta",children:s.jsx("button",{className:"btn ghost sm",onClick:()=>C("interview"),children:"인터뷰로 돌아가기"})})]}):s.jsxs("main",{className:"ed wfwrap",children:[s.jsxs("div",{className:"eyebrow",children:["디자인 시스템 · ",(h==null?void 0:h.status)==="accepted"?"수락됨":"제안됨"]}),s.jsx("h1",{className:"struct-h1",children:"디자인 시스템"}),s.jsx("div",{className:"dmeta",children:(h==null?void 0:h.status)==="accepted"?"이 시스템이 와이어프레임·시안을 구동합니다.":"제안된 시스템입니다. 수락하면 와이어프레임·시안에 반영됩니다."}),S&&s.jsx("div",{className:"genwarn",children:S}),s.jsxs("div",{className:"ds-stage",children:[s.jsx("div",{className:"ds-tile",children:h&&s.jsx("iframe",{className:"ds-frame",srcDoc:h.styleTileHtml,sandbox:"",title:"디자인 시스템 스타일 타일"})}),s.jsxs("aside",{className:"ds-side",children:[s.jsxs("div",{className:"ds-rationale",children:[s.jsx("span",{className:"k",children:"설계 근거"}),s.jsx("p",{children:h==null?void 0:h.rationale})]}),H&&(h==null?void 0:h.system)&&s.jsxs("div",{className:"ds-tokens",children:[s.jsx("span",{className:"k",children:"토큰"}),s.jsxs("ul",{children:[s.jsxs("li",{children:["강조 ",s.jsx("code",{children:H.accent})," · 모드 ",s.jsx("b",{children:h.system.color.dark?h.system.color.primary==="dark"?"다크+라이트":"라이트+다크":H.mode})]}),s.jsxs("li",{children:["상태색 ",s.jsx("span",{className:"stdot",style:{background:h.system.color.state.success}}),s.jsx("span",{className:"stdot",style:{background:h.system.color.state.warning}}),s.jsx("span",{className:"stdot",style:{background:h.system.color.state.danger}}),s.jsx("span",{className:"stdot",style:{background:h.system.color.state.info}})]}),s.jsxs("li",{children:["타입 ",s.jsxs("b",{children:[h.system.type.scale.display,"/",h.system.type.scale.title,"/",h.system.type.scale.body,"/",h.system.type.scale.caption]}),"px"]}),s.jsxs("li",{children:["여백 4px 그리드 · 밀도 ",s.jsx("b",{children:H.density})," · 서체 ",s.jsx("b",{children:H.font})]}),s.jsxs("li",{children:["모서리 ",s.jsxs("b",{children:[H.radius,"px"]})," · 그림자 ",s.jsx("b",{children:h.system.shape.shadow})]}),(h.system.a11y.highContrast||h.system.a11y.colorblindSafe||h.system.a11y.notes)&&s.jsxs("li",{children:["접근성 ",s.jsx("b",{children:[h.system.a11y.highContrast&&"고대비",h.system.a11y.colorblindSafe&&"색맹안전"].filter(Boolean).join("·")||"지정"})]})]})]}),s.jsxs("div",{className:"ds-acts",children:[(h==null?void 0:h.status)!=="accepted"&&s.jsx("button",{className:"btn ok",onClick:Y,children:"수락 · 시스템으로 채택"}),s.jsx("button",{className:"btn",disabled:j,onClick:A,children:j?"생성 중…":"재생성"}),s.jsx("button",{className:"btn",disabled:j,onClick:M,children:"다른 방향 보기 (3안)"}),s.jsx("button",{className:"btn ghost",onClick:()=>C("interview"),children:"인터뷰 다시"})]})]})]})]})})}const Xg=new Set(["feature-spec","ia","user-flow"]);function ev(){const{pid:r,did:i}=Fn(),[a,u]=y.useState(null),[d,f]=y.useState("");return y.useEffect(()=>{let g=!0;return u(null),f(""),z.getDocument(i).then(m=>g&&u(m.document)).catch(m=>g&&f(m.message)),()=>{g=!1}},[i]),d?s.jsx(xt,{crumb:s.jsx("span",{children:"오류"}),children:s.jsx("main",{className:"editor",children:s.jsx("div",{className:"center-empty err",children:d})})}):a?a.type==="handoff"?s.jsx(um,{to:`/projects/${r}/handoff`,replace:!0}):a.type==="design-system"?s.jsx(Zg,{doc:a},a.id):Xg.has(a.type)?s.jsx(Gg,{doc:a},a.id):s.jsx(Fg,{}):s.jsx(xt,{crumb:s.jsx("span",{children:"불러오는 중…"}),children:s.jsx("main",{className:"editor",children:s.jsx("div",{className:"center-empty",children:"불러오는 중…"})})})}const tv={clean:"Clean",warm:"Warm",mono:"Mono",vivid:"Vivid",dark:"Dark"},nv={compact:"조밀",cozy:"보통",spacious:"여유"};function sv(){const{pid:r}=Fn(),[i]=Sm(),[a,u]=y.useState(null),[d,f]=y.useState([]),[g,m]=y.useState(!1),[h,v]=y.useState(null),[x,k]=y.useState(null),[N,C]=y.useState([]),[j,T]=y.useState({}),S=y.useCallback(async()=>{if(!r)return;const[M,Z,H,L]=await Promise.all([z.getProject(r),z.wireframes(r),z.styleGuide(r),z.mockups(r)]);u(M),f(Z.wireframes),v(H.guide),k(H.render),C(H.presets);const F={};for(const O of L.mockups)F[O.pageRef]=O.status;T(F)},[r]);y.useEffect(()=>{S().catch(()=>{})},[S]),y.useEffect(()=>{const M=i.get("focus");M&&I(M)},[i,d.length]);function I(M){const Z=document.getElementById(`wf-${M}`);Z&&(Z.scrollIntoView({behavior:"smooth",block:"center"}),Z.classList.add("wf-flash"),window.setTimeout(()=>Z.classList.remove("wf-flash"),900))}async function W(M){if(!r)return;const Z=await z.saveStyleGuide(r,M);v(Z.guide),k(Z.render)}const A=(M,Z)=>T(H=>{const L={...H};return Z?L[M]=Z:delete L[M],L}),Y=h&&x?{"--wf-accent":h.accent,"--wf-bg":h.bg,"--wf-surface":h.surface,"--wf-ink":h.ink,"--wf-sub":h.sub,"--wf-line":h.line,"--wf-radius":`${h.radius}px`,"--wf-font":x.fontStack,"--wf-gap":`${x.gap}px`}:{};return s.jsx(xt,{crumb:s.jsxs(s.Fragment,{children:[s.jsx("b",{className:"name",children:(a==null?void 0:a.name)??"프로젝트"}),s.jsx("span",{className:"sep",children:"/"}),s.jsx("span",{children:"와이어프레임"})]}),tbarRight:s.jsxs(s.Fragment,{children:[s.jsx("button",{className:`btn ${g?"ok":""}`,onClick:()=>m(M=>!M),children:g?"인터랙티브 켜짐":"인터랙티브 열기"}),s.jsx("span",{className:"cmdk",children:"⌘K"})]}),nav:a?s.jsx(ys,{projectId:r,projectName:a.name,documents:a.documents,active:"WF"}):void 0,tagline:"테마는 와이어프레임·시안 공용 · 시안(AI)은 옵트인 · 결정적 와이어프레임은 무료",children:s.jsxs("main",{className:"ed wfwrap",style:Y,children:[s.jsx("div",{className:"eyebrow",children:"WF · Wireframes → 시안"}),s.jsx("h1",{className:"struct-h1",children:"와이어프레임"}),s.jsxs("div",{className:"dmeta",children:["IA 수락분 ",d.length,"화면 · 결정적 와이어프레임(무료) + 테마 적용 · AI 시안은 화면별 옵트인"]}),h&&s.jsxs("div",{className:"wf-theme",children:[s.jsx("span",{className:"tk",children:"테마"}),s.jsx("div",{className:"tpresets",children:N.map(M=>s.jsx("button",{className:`tchip ${h.preset===M?"on":""}`,onClick:()=>W({preset:M}),children:tv[M]??M},M))}),s.jsx("label",{className:"tacc",title:"강조색",children:s.jsx("input",{type:"color",value:h.accent,onChange:M=>W({accent:M.target.value})})}),s.jsx("div",{className:"tseg",children:["compact","cozy","spacious"].map(M=>s.jsx("button",{className:h.density===M?"on":"",onClick:()=>W({density:M}),children:nv[M]},M))})]}),d.length===0?s.jsxs("div",{className:"empty",style:{marginTop:18},children:[s.jsx(Ke,{pose:"think",size:64}),s.jsxs("div",{style:{marginTop:10},children:["IA 화면을 수락하면 여기에 ",s.jsx("b",{children:"자동으로 렌더"}),"됩니다."]})]}):s.jsx("div",{className:"pgrid",children:d.map(M=>s.jsx(rv,{pid:r,wf:M,interactive:g,onHotspot:I,mockStatus:j[M.ref],onStatus:A},M.ref))})]})})}function rv({pid:r,wf:i,interactive:a,onHotspot:u,mockStatus:d,onStatus:f}){const[g,m]=y.useState(d?"mock":"wire"),[h,v]=y.useState(null),[x,k]=y.useState(!1),[N,C]=y.useState(null);y.useEffect(()=>{g==="mock"&&d&&h===null&&z.mockup(r,i.ref).then(W=>v(W.html)).catch(()=>{})},[g,d,h,r,i.ref]);async function j(){k(!0),C(null),m("mock");try{const W=await z.generateMockup(i.itemId);v(W.html),f(i.ref,"proposed")}catch(W){C(W.message||"시안 생성에 실패했어요")}finally{k(!1)}}async function T(){await z.acceptMockup(i.itemId),f(i.ref,"accepted")}async function S(){await z.rejectMockup(i.itemId),v(null),f(i.ref,void 0),m("wire")}const I=i.hotspot?s.jsx("span",{className:"hot",style:{cursor:a?"pointer":"default"},onClick:W=>{W.stopPropagation(),a&&i.hotspot&&u(i.hotspot.toPage)},children:i.hotspot.label}):null;return s.jsxs("div",{className:"proto",id:`wf-${i.ref}`,children:[s.jsxs("div",{className:"phead",children:[s.jsx("b",{children:i.ref})," ",i.title," ",s.jsx("span",{className:"typechip",children:i.pageType}),s.jsx("span",{className:"sp",style:{flex:1}}),s.jsxs("div",{className:"wf-toggle",children:[s.jsx("button",{className:g==="wire"?"on":"",onClick:()=>m("wire"),children:"와이어"}),s.jsxs("button",{className:g==="mock"?"on":"",onClick:()=>m("mock"),children:["시안",d==="accepted"?" ✓":""]})]})]}),g==="wire"?s.jsxs("div",{className:"papp themed",children:[s.jsx(lv,{wf:i,hot:I}),s.jsx("div",{className:`pstate ${i.lintWarning?"warn":""}`,children:i.lintWarning?`검사 위반 · ${i.lintWarning}`:`근거 ${i.featureRefs.join("·")||"—"}${i.flowRefs.length?" · 진입 "+i.flowRefs.join("·"):""}`})]}):x?s.jsxs("div",{className:"mockgen",children:[s.jsx(Ke,{pose:"fetch",size:44}),s.jsx("p",{children:s.jsx("b",{children:"시안 생성 중…"})}),s.jsx("span",{className:"mnote",children:"AI 가 이 화면을 테마에 맞춰 디자인합니다 · 최대 1분 정도 걸릴 수 있어요"})]}):N?s.jsxs("div",{className:"mockgen",children:[s.jsx("p",{className:"mockerr",children:"시안 생성에 실패했어요"}),s.jsx("span",{className:"mnote",children:N}),s.jsx("button",{className:"btn ok",onClick:j,children:"다시 시도"}),s.jsx("span",{className:"mnote",children:"설정(⌘,)의 AI 엔진에서 CLI 로그인 또는 API 키 상태를 확인하세요"})]}):h?s.jsxs("div",{className:"mockwrap",children:[s.jsx("iframe",{className:"mockframe",srcDoc:h,sandbox:"",title:`${i.ref} 시안`,loading:"lazy"}),s.jsxs("div",{className:"mockacts",children:[s.jsx("span",{className:`mstat ${d==="accepted"?"ok":""}`,children:d==="accepted"?"시안 수락됨":"제안된 시안"}),s.jsx("span",{className:"sp",style:{flex:1}}),d!=="accepted"&&s.jsx("button",{className:"btn ok sm",disabled:x,onClick:T,children:"수락"}),s.jsx("button",{className:"btn sm",disabled:x,onClick:j,children:"재생성"}),s.jsx("button",{className:"btn sm",disabled:x,onClick:S,children:"삭제"})]})]}):s.jsxs("div",{className:"mockgen",children:[s.jsx(Ke,{pose:"fetch",size:40,animate:!1}),s.jsxs("p",{children:["이 화면의 ",s.jsx("b",{children:"고해상도 시안"}),"을 테마에 맞춰 생성합니다."]}),s.jsx("button",{className:"btn ok",onClick:j,children:"시안 생성"}),s.jsx("span",{className:"mnote",children:"AI 사용 · 구조는 와이어프레임 탭에서 무료로 확인"})]})]})}function lv({wf:r,hot:i}){const a=r.seed;switch(r.pageType){case"LIST":return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"pnav",children:[r.title,s.jsx("span",{className:"navr",children:"목록"})]}),s.jsxs("div",{className:"pbody",children:[s.jsx("div",{className:"pinput",children:a.search??"검색"}),s.jsx("div",{className:"plist",children:(a.rows??[]).map((u,d)=>s.jsxs("div",{className:"plirow",children:[s.jsx("b",{children:u.title}),s.jsx("span",{className:"m",children:u.meta}),s.jsx("span",{className:"sp"}),s.jsxs("span",{className:"pbtn sm",children:[u.action,u.hot&&i]})]},d))})]})]});case"DETAIL":return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"pnav",children:[s.jsx("span",{className:"back",children:"‹"}),a.detailTitle??r.title]}),s.jsxs("div",{className:"pbody",children:[s.jsx("div",{className:"slotwrap",children:(a.slots??[]).map((u,d)=>s.jsx("span",{className:`slot ${u.state==="idle"?"":u.state}`,children:u.label},d))}),(a.blocks??[]).map((u,d)=>s.jsx("div",{className:"pinput",children:u},d)),s.jsxs("div",{className:"pbtn",children:[a.cta??"확인",i]})]})]});case"FORM":return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"pnav",children:[s.jsx("span",{className:"back",children:"‹"}),r.title]}),s.jsxs("div",{className:"pbody",children:[(a.fields??[]).map((u,d)=>s.jsxs("div",{className:"ffield",children:[s.jsx("span",{className:"lb2",children:u.label}),s.jsx("div",{className:"pinput",children:u.value})]},d)),s.jsxs("div",{className:"pbtn",children:[a.cta??"저장",i]})]})]});case"DASH":return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"pnav",children:[r.title,s.jsx("span",{className:"navr",children:"이번 주"})]}),s.jsxs("div",{className:"pbody",children:[s.jsx("div",{className:"statrow",children:(a.stats??[]).map((u,d)=>s.jsxs("div",{className:"stat",children:[s.jsx("div",{className:"sv",children:u.value}),s.jsx("div",{className:"sl",children:u.label})]},d))}),s.jsx("div",{className:"chart",children:(a.bars??[]).map((u,d)=>s.jsx("i",{style:{height:`${u}%`}},d))})]})]});case"SETTINGS":return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"pnav",children:[s.jsx("span",{className:"back",children:"‹"}),r.title]}),s.jsx("div",{className:"pbody",children:(a.toggles??[]).map((u,d)=>s.jsxs("div",{className:"tgl",children:[u.label,s.jsx("span",{className:"sp"}),s.jsx("span",{className:`sw ${u.on?"":"off"}`})]},d))})]});default:return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"pnav",children:r.title}),s.jsxs("div",{className:"pbody",children:[(a.blocks??[r.title]).map((u,d)=>s.jsx("div",{className:"sk block",children:s.jsx("span",{style:{fontSize:10,color:"var(--sub)",padding:"4px 8px",display:"block"},children:u})},d)),s.jsxs("div",{className:"pbtn",children:["열기",i]})]})]})}}const iv=[["E-BROKEN-REF","참조 무결성 (기능→요구, 스텝→화면)"],["E-DUP-REF","중복 번호 없음"],["W-ORPHAN-SPEC","고아 기능 없음"],["W-UNREACHED-PAGE","미도달 화면 없음"],["W-EMPTY-PAGE","빈 화면 없음"],["W-NO-FLOW","P0 기능 플로우 연결"]];function av(){const{pid:r}=Fn(),[i,a]=y.useState(null),[u,d]=y.useState(null),[f,g]=y.useState(null),[m,h]=y.useState([]),[v,x]=y.useState([]),[k,N]=y.useState(!1),[C,j]=y.useState(""),[T,S]=y.useState(""),I=y.useCallback(async()=>{if(!r)return;const[L,F]=await Promise.all([z.getProject(r),z.hub(r)]);a(L),d(F.lint);const O=F.derived.handoff.documentId;if(g(O),O){const J=await z.getDocument(O);h(J.sections);const te=await z.suggestions(O,"open").then(oe=>Array.isArray(oe)?oe:oe.suggestions).catch(()=>[]);x(te)}else h([]),x([])},[r]);y.useEffect(()=>{I().catch(L=>j(L.message))},[I]);async function W(){if(!(!r||k)){N(!0),j("");try{await z.compileHandoff(r),await I()}catch(L){j(L.message||"검사 위반이 남아 있어요.")}finally{N(!1)}}}async function A(L){await z.acceptSuggestion(L),await I()}async function Y(){if(!f)return;const L=await z.createShare(f,null);S(L.url)}const M=(u==null?void 0:u.gatePasses)??!1;function Z(L){const F=(u==null?void 0:u.violations.filter(J=>J.code===L&&!J.waived).length)??0,O=(u==null?void 0:u.violations.filter(J=>J.code===L&&J.waived).length)??0;return F>0?{ok:!1,text:`위반 ${F}`}:O>0?{ok:!0,text:`통과 · 무시 ${O}`}:{ok:!0,text:"통과"}}const H=s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"ph",children:["제안 ",v.length]}),v.length===0?s.jsxs("div",{className:"panel-empty",children:[s.jsx(Ke,{pose:"wait",size:72}),f?"지시서가 확정되었어요.":"검사를 통과하면 지시서를 컴파일할 수 있어요."]}):v.map(L=>s.jsxs("div",{className:"scard",children:[s.jsxs("div",{className:"sh",children:[s.jsx(Ke,{pose:"fetch",size:20,animate:!1}),s.jsx("b",{children:L.title}),s.jsx("span",{className:"ssrc",children:L.source})]}),s.jsx("p",{children:L.body}),s.jsx("div",{className:"scard-acts",children:s.jsx("button",{className:"a",onClick:()=>A(L.id),children:"수락"})})]},L.id))]});return s.jsx(xt,{crumb:s.jsxs(s.Fragment,{children:[s.jsx("b",{className:"name",children:(i==null?void 0:i.name)??"프로젝트"}),s.jsx("span",{className:"sep",children:"/"}),s.jsx("span",{children:"개발 지시서"})]}),tbarRight:s.jsxs(s.Fragment,{children:[s.jsx("a",{className:"btn",href:`/api/projects/${r}/handoff/tickets.md`,title:"수락된 기능을 GitHub 체크리스트(개발 티켓)로 내보내기",children:"개발 티켓"}),f&&s.jsxs(s.Fragment,{children:[s.jsx("a",{className:"btn",href:`/api/documents/${f}/export.html?print=1`,target:"_blank",rel:"noreferrer",title:"브라우저 인쇄 대화상자에서 'PDF로 저장'",children:"PDF"}),s.jsx("a",{className:"btn pri",href:z.promptPackHref(r),children:"프롬프트 팩 내보내기"})]}),s.jsx("span",{className:"cmdk",children:"⌘K"})]}),nav:i?s.jsx(ys,{projectId:r,projectName:i.name,documents:i.documents,active:"DEV"}):void 0,panel:f?H:void 0,tagline:"수락하지 않은 항목은 지시서에 없습니다",children:s.jsx("main",{className:"ed",children:s.jsxs("div",{className:"editor-inner",children:[s.jsx("div",{className:"eyebrow",children:"DEV · Handoff — Compiled"}),s.jsx("h1",{className:"struct-h1",children:"개발 지시서"}),s.jsx("div",{className:"dmeta",children:"수락분 전체에서 컴파일 · 검사 통과가 생성 조건"}),iv.map(([L,F])=>{const O=Z(L);return s.jsxs("div",{className:"check",children:[s.jsx("span",{className:"cid",children:L}),s.jsx("span",{className:"rt",children:F}),s.jsx("span",{className:O.ok?"cok":"cwarn",children:O.text})]},L)}),C&&s.jsx("div",{className:"err",style:{marginTop:12},children:C}),!f&&s.jsxs("div",{className:"hoact",style:{marginTop:18},children:[s.jsx("button",{className:"btn pri lg",disabled:!M||k,onClick:W,children:M?"지시서 생성":"검사 위반 해소 필요"}),!M&&s.jsx("span",{className:"hint",children:"위반을 수정하거나 무시(waive)하면 생성됩니다"})]}),f&&m.map(L=>s.jsxs("div",{className:`hosec ${L.status==="proposed"?"proposed":""}`,children:[s.jsx("div",{className:"hohead",children:L.heading}),s.jsx("div",{className:"hobody",children:L.body})]},L.id)),f&&s.jsxs("div",{className:"hoact",style:{marginTop:16},children:[s.jsx("a",{className:"btn pri",href:z.promptPackHref(r),children:"Claude Code로 발주"}),s.jsx("a",{className:"btn",href:`/api/documents/${f}/export.md`,children:"Markdown"}),s.jsx("button",{className:"btn",onClick:Y,children:"공유 링크"}),s.jsx("button",{className:"btn",onClick:W,disabled:k,children:"재컴파일"}),s.jsx("span",{className:"hint",children:"수락하지 않은 항목은 지시서에 없습니다"})]}),T&&s.jsxs("div",{className:"mini-card",style:{marginTop:10},children:[s.jsx("span",{className:"mono",children:"공유 링크: "}),s.jsx("a",{className:"mono",href:T,target:"_blank",rel:"noreferrer",children:T})]})]})})})}function Rl(r){const i=(r||"").toLowerCase();return/찾지 못|not found|미감지|no such|실행 실패|enoent/.test(i)?{cause:"claude CLI 를 못 찾았습니다",action:"claude 를 설치·로그인하거나, 설정에서 claude 전체 경로를 지정하세요. 안 되면 API 키(BYOK)로 전환하는 게 빠릅니다."}:/oauth|session expired|not logged|log ?in|authenticat|credential|invalid api key|unauthorized/.test(i)?{cause:"로그인 세션을 읽지 못했습니다 (만료 또는 앱이 키체인 접근 불가)",action:"터미널에서 claude 로그인 상태를 확인하세요. 앱을 파일 복사로 설치했다면 정식(공증) 인스톨러로 재설치가 확실합니다. 급하면 API 키(BYOK)로 전환."}:/disabled|subscription access|organization|blocked|api key instead|403|401/.test(i)?{cause:"조직이 Claude Code 구독 접근을 막았을 수 있습니다",action:"API 키(BYOK)로 전환해 Anthropic/OpenRouter 키를 등록하세요."}:/시간 초과|timeout|timed out/.test(i)?{cause:"응답이 지연됐습니다",action:"네트워크·로그인 상태를 확인하고 다시 시도하세요."}:{cause:"구독 엔진을 쓸 수 없습니다",action:"API 키(BYOK)로 전환하거나 claude 설치·로그인 상태를 확인하세요."}}const Pd=["anthropic","openai","openrouter"],ov=["prd","feature-spec","ia","user-flow"],cv={prd:"PRD","feature-spec":"기능명세",ia:"IA","user-flow":"유저플로우","design-system":"디자인 시스템",handoff:"지시서"};function uv(){const{reload:r,meta:i}=zl(),[a,u]=y.useState([]),[d,f]=y.useState({}),[g,m]=y.useState({}),[h,v]=y.useState({}),[x,k]=y.useState(""),[N,C]=y.useState(Kd()),[j,T]=y.useState(""),[S,I]=y.useState(""),[W,A]=y.useState(""),[Y,M]=y.useState(""),[Z,H]=y.useState(""),[L,F]=y.useState(""),[O,J]=y.useState(""),[te,oe]=y.useState([]),[ue,ge]=y.useState([]),[Ee,xe]=y.useState(""),q=Array.from(new Set([...te,...ue]));async function le(){u(await z.keys())}y.useEffect(()=>{le().catch(()=>{}),z.settings().then(B=>v(B.providerModels??{})).catch(()=>{})},[]),y.useEffect(()=>{A((i==null?void 0:i.agentBinPath)??"")},[i==null?void 0:i.agentBinPath]),y.useEffect(()=>{H((i==null?void 0:i.openaiBaseUrl)??""),i!=null&&i.openaiBaseUrl&&z.openaiModels().then(B=>oe(B.models??[])).catch(()=>{})},[i==null?void 0:i.openaiBaseUrl]),y.useEffect(()=>{a.some(B=>B.provider==="openrouter")&&z.openrouterModels().then(B=>ge(B.models??[])).catch(()=>{})},[a]);function X(B){const ie={};for(const pe of B.split(`
|
|
125
|
-
`)){const Ue=pe.indexOf(":");if(Ue<=0)continue;const nt=pe.slice(0,Ue).trim(),he=pe.slice(Ue+1).trim();nt&&he&&(ie[nt]=he)}return ie}async function b(){var B;J("저장·감지 중…");try{const ie=X(L),pe=await z.saveOpenaiEndpoint(Z.trim(),ie);await r(),pe.baseUrl&&H(pe.baseUrl),oe(pe.models??[]),Z.trim()?pe.detected==="no-key"?J("저장됨 · openai 키를 먼저 등록하면 경로 자동 감지·모델 목록을 불러옵니다"):(B=pe.models)!=null&&B.length?J(`저장됨 · 경로 자동 감지(${pe.detected}) · 모델 ${pe.models.length}개 불러옴`):J("저장됨 · 모델 목록을 못 불러왔습니다(키·주소 확인)"):J("게이트웨이 해제됨 · 표준 OpenAI 사용")}catch(ie){J(`실패 · ${ie.message}`)}setTimeout(()=>J(""),4e3)}async function D(B){const ie=(d[B]??"").trim();if(!ie)return;m(Ue=>({...Ue,[B]:"저장 중…"})),await z.saveKey(B,ie),f(Ue=>({...Ue,[B]:""})),await le(),await r();const pe=await z.testKey(B);m(Ue=>({...Ue,[B]:pe.ok?"연결 성공":`실패 · ${pe.detail??""}`}))}async function ye(B){m(pe=>({...pe,[B]:"테스트 중…"}));const ie=await z.testKey(B);m(pe=>({...pe,[B]:ie.ok?"연결 성공":`실패 · ${ie.detail??""}`}))}async function ke(B){await z.deleteKey(B),await le(),await r()}function we(B,ie,pe){v(Ue=>({...Ue,[B]:{...Ue[B],[ie]:ie==="maxTokens"?Number(pe)||void 0:pe||void 0}}))}async function Se(){await z.saveModels(h),k("저장됨"),setTimeout(()=>k(""),1500)}const Pe=B=>B==="연결 성공";async function Ne(B){if(confirm("복원하면 현재 워크스페이스가 이 백업으로 완전히 교체됩니다. 계속할까요?")){xe("복원 중…");try{const ie=await new Promise((pe,Ue)=>{const nt=new FileReader;nt.onload=()=>pe(String(nt.result).split(",")[1]??""),nt.onerror=()=>Ue(new Error("파일을 읽지 못했습니다")),nt.readAsDataURL(B)});await z.restore(ie),xe("복원 완료 · 새로고침합니다…"),setTimeout(()=>window.location.assign("/"),900)}catch(ie){xe(`실패 · ${ie.message}`)}}}return s.jsx(xt,{crumb:s.jsxs(s.Fragment,{children:[s.jsx(Mn,{to:"/",children:s.jsx($l,{})}),s.jsx("span",{className:"sep",children:"/"}),s.jsx("b",{children:"설정"})]}),tbarRight:s.jsx("span",{className:"cmdk",children:"⌘K"}),tagline:"키는 서버에 암호화되어 저장됩니다 · 평문은 저장되지 않습니다",statusRight:s.jsxs("span",{children:["v",(i==null?void 0:i.version)??"…"]}),children:s.jsx("main",{className:"settings",children:s.jsxs("div",{className:"settings-inner",children:[s.jsx("div",{className:"eyebrow",style:{fontFamily:"var(--mono)",fontSize:10,letterSpacing:"0.16em",color:"var(--sub)",marginBottom:8,textTransform:"uppercase"},children:"설정"}),s.jsx("h1",{children:"설정"}),s.jsx("div",{className:"rows",style:{marginBottom:14},children:s.jsxs("div",{className:"row",children:[s.jsx(Mn,{className:"btn",to:"/templates",children:"템플릿 라이브러리 편집"}),s.jsx("span",{className:"muted",style:{fontSize:12},children:"인터뷰 질문·섹션·지침을 문서 유형별로 커스터마이즈"})]})}),s.jsx("h3",{children:"AI 엔진"}),s.jsx("p",{className:"subtle",children:"Claude Code(구독)는 API 키 없이 로컬 CLI 로 생성합니다. docker 등 CLI 가 없는 환경에서는 API 키(BYOK)를 사용하세요."}),s.jsxs("div",{className:"rows",children:[s.jsxs("div",{className:"row",style:{flexWrap:"wrap"},children:[s.jsxs("label",{className:"opt",children:[s.jsx("input",{type:"radio",name:"aiMode",checked:(i==null?void 0:i.aiMode)==="cli",disabled:!(i!=null&&i.cliAvailable),onChange:async()=>{await z.setAiMode("cli"),await r()}}),"Claude Code (구독",i!=null&&i.cliAvailable?"":" · CLI 미감지",")"]}),s.jsxs("label",{className:"opt",children:[s.jsx("input",{type:"radio",name:"aiMode",checked:(i==null?void 0:i.aiMode)==="byok",onChange:async()=>{await z.setAiMode("byok"),await r()}}),"API 키 (BYOK)"]}),s.jsx("button",{className:"btn",onClick:async()=>{T("테스트 중…"),I("");try{const B=await z.testCli();B.ok?T("연결 성공 · 구독 엔진 사용 가능"):(T(""),I(B.detail||"연결 실패"))}catch(B){T(""),I(B.message||"연결 실패")}},children:"CLI 테스트"}),j&&s.jsx("span",{className:"muted",style:{fontSize:12},children:j})]}),S&&s.jsxs("div",{className:"cli-help",role:"alert",children:[s.jsxs("b",{children:["구독(CLI) 연결 실패 — ",Rl(S).cause]}),s.jsx("p",{children:Rl(S).action}),s.jsxs("div",{className:"cli-help-acts",children:[s.jsx("button",{className:"btn ok sm",onClick:async()=>{await z.setAiMode("byok"),I(""),await r()},children:"API 키(BYOK)로 전환"}),s.jsxs("details",{children:[s.jsx("summary",{children:"원문 보기"}),s.jsx("code",{children:S})]})]})]}),s.jsxs("div",{className:"row",style:{flexWrap:"wrap",gap:8},children:[s.jsx("span",{className:"muted",style:{fontSize:12,width:"100%"},children:i!=null&&i.cliBin?`감지된 CLI: ${i.cliBin}`:"CLI 미감지 · nvm/fnm 등 비표준 경로면 아래에 claude 전체 경로를 직접 지정하세요"}),s.jsx("input",{className:"input",style:{flex:1,minWidth:260,fontFamily:"var(--mono, monospace)",fontSize:12},placeholder:"예: /Users/you/.nvm/versions/node/v22.14.0/bin/claude",value:W,onChange:B=>A(B.target.value)}),s.jsx("button",{className:"btn",onClick:async()=>{M("저장 중…");const B=await z.setAgentBin(W.trim());await r(),M(B.cliAvailable?`적용됨 · ${B.cliBin??""}`:"경로에서 claude 를 찾지 못했습니다")},children:"경로 적용"}),W&&s.jsx("button",{className:"btn ghost",onClick:async()=>{A(""),await z.setAgentBin(""),await r(),M("해제됨 · 자동 탐색으로 복귀")},children:"해제"}),Y&&s.jsx("span",{className:"muted",style:{fontSize:12,width:"100%"},children:Y})]})]}),s.jsx("h3",{children:"실행 시 착지"}),s.jsx("p",{className:"subtle",children:"앱을 열 때 어디에 착지할지 정합니다."}),s.jsx("div",{className:"rows",children:s.jsxs("div",{className:"row",children:[s.jsxs("label",{className:"opt",children:[s.jsx("input",{type:"radio",name:"openMode",checked:N==="start",onChange:()=>{xd("start"),C("start")}}),"시작 화면 (기본)"]}),s.jsxs("label",{className:"opt",children:[s.jsx("input",{type:"radio",name:"openMode",checked:N==="resume",onChange:()=>{xd("resume"),C("resume")}}),"마지막 문서로 이어서"]})]})}),s.jsx("h3",{children:"AI 제공자 키 (BYOK)"}),s.jsx("p",{className:"subtle",children:"키는 서버에 AES-256-GCM으로 암호화되어 저장됩니다. 평문은 저장되지 않습니다."}),s.jsx("div",{className:"rows",children:Pd.map(B=>{const ie=a.find(pe=>pe.provider===B);return s.jsxs("div",{className:"row",style:{flexWrap:"wrap"},children:[s.jsx("b",{style:{width:100},children:B}),ie!=null&&ie.configured?s.jsxs("span",{className:"ok",children:["등록됨 ····",ie.last4]}):s.jsx("span",{className:"muted",children:"미등록"}),s.jsx("input",{className:"field grow",type:"password",placeholder:"새 키 입력 (교체 시)",value:d[B]??"",onChange:pe=>f(Ue=>({...Ue,[B]:pe.target.value}))}),s.jsx("button",{className:"btn",disabled:!(d[B]??"").trim(),onClick:()=>D(B),children:"저장"}),s.jsx("button",{className:"btn",disabled:!(ie!=null&&ie.configured),onClick:()=>ye(B),children:"테스트"}),s.jsx("button",{className:"btn danger",disabled:!(ie!=null&&ie.configured),onClick:()=>ke(B),children:"삭제"}),g[B]&&s.jsx("span",{className:Pe(g[B])?"ok":"err",style:{width:"100%"},children:g[B]})]},B)})}),s.jsx("div",{className:"divider"}),s.jsx("h3",{children:"OpenAI 호환 게이트웨이 (선택)"}),s.jsxs("p",{className:"subtle",children:["LiteLLM·Azure·사내 프록시 등 OpenAI 호환 엔드포인트를 쓰려면 base URL 을 넣으세요. 비워두면 표준 OpenAI 를 사용합니다. 키는 위 ",s.jsx("b",{children:"openai"})," 칸에 게이트웨이 키를 등록하고, 아래 모델 칸에 게이트웨이가 제공하는 모델 id 를 지정하세요."]}),s.jsxs("div",{className:"rows",children:[s.jsxs("div",{className:"row",style:{flexWrap:"wrap"},children:[s.jsx("b",{style:{width:100},children:"base URL"}),s.jsx("input",{className:"field grow",placeholder:"예: https://gateway.example.com/v1 (비우면 표준 OpenAI)",value:Z,onChange:B=>H(B.target.value)}),s.jsx("button",{className:"btn pri",onClick:b,children:"저장"}),O&&s.jsx("span",{className:O.startsWith("실패")?"err":"ok",style:{width:"100%"},children:O})]}),s.jsxs("div",{className:"row",style:{flexWrap:"wrap"},children:[s.jsx("b",{style:{width:100},children:"추가 헤더"}),s.jsx("textarea",{className:"field grow",rows:2,style:{resize:"vertical",fontFamily:"var(--mono)",fontSize:12},placeholder:"선택 · 한 줄에 하나: 예) X-My-Header: value (표준 Bearer 는 자동 전송)",value:L,onChange:B=>F(B.target.value)})]}),te.length>0&&s.jsx("div",{className:"row",children:s.jsxs("span",{className:"muted",style:{fontSize:12},children:["이 게이트웨이 모델 ",te.length,"개: ",te.join(", ")," · 아래 모델 칸에서 드롭다운으로 고르세요."]})})]}),ue.length>0&&s.jsx("div",{className:"row",children:s.jsxs("span",{className:"muted",style:{fontSize:12},children:["OpenRouter 사용 가능 모델 ",ue.length,"개 · 아래 모델 칸에서 드롭다운으로 고르세요."]})}),q.length>0&&s.jsx("datalist",{id:"gw-models",children:q.map(B=>s.jsx("option",{value:B},B))}),s.jsx("div",{className:"divider"}),s.jsx("h3",{children:"문서 유형별 모델 · 토큰 예산 (SPEC-19)"}),s.jsx("p",{className:"subtle",children:"비워두면 기본값을 사용합니다. 다음 AI 호출부터 적용됩니다."}),s.jsx("div",{className:"rows",children:["default",...ov].map(B=>{const ie=h[B]??{};return s.jsxs("div",{className:"row",style:{flexWrap:"wrap"},children:[s.jsx("b",{style:{width:100},children:B==="default"?"기본값":cv[B]}),s.jsxs("select",{className:"field",style:{maxWidth:150},value:ie.provider??"",onChange:pe=>we(B,"provider",pe.target.value),children:[s.jsx("option",{value:"",children:"(기본 제공자)"}),Pd.map(pe=>s.jsx("option",{value:pe,children:pe},pe))]}),s.jsx("input",{className:"field grow",list:q.length?"gw-models":void 0,placeholder:q.length?"목록에서 선택하거나 직접 입력":"모델 id (예: anthropic/claude-sonnet-4.6)",value:ie.model??"",onChange:pe=>we(B,"model",pe.target.value)}),s.jsx("input",{className:"field",style:{maxWidth:130},type:"number",placeholder:"max tokens",value:ie.maxTokens??"",onChange:pe=>we(B,"maxTokens",pe.target.value)})]},B)})}),s.jsxs("div",{className:"new-row",style:{marginTop:12,maxWidth:300},children:[s.jsx("button",{className:"btn pri",onClick:Se,children:"모델 설정 저장"}),x&&s.jsx("span",{className:"ok",style:{alignSelf:"center"},children:x})]}),s.jsx("div",{className:"divider"}),s.jsx("h3",{children:"워크스페이스 백업 · 복원"}),s.jsxs("p",{className:"subtle",children:["전체 데이터(프로젝트·문서·제안·설정)를 한 파일로 내려받고, 다른 기기로 옮기거나 위험한 작업 전에 대비하세요. ",s.jsx("b",{children:"복원은 현재 워크스페이스를 통째로 교체"}),"합니다."]}),s.jsx("div",{className:"rows",children:s.jsxs("div",{className:"row",style:{flexWrap:"wrap"},children:[s.jsx("a",{className:"btn",href:z.backupHref,download:!0,children:"백업 내려받기"}),s.jsxs("label",{className:"btn",style:{cursor:"pointer"},children:["복원(파일 선택)",s.jsx("input",{type:"file",accept:".sqlite,application/octet-stream",style:{display:"none"},onChange:B=>{var pe;const ie=(pe=B.target.files)==null?void 0:pe[0];ie&&Ne(ie),B.target.value=""}})]}),Ee&&s.jsx("span",{className:Ee.startsWith("실패")?"err":"ok",style:{width:"100%"},children:Ee})]})})]})})})}const dv=["prd","feature-spec","ia","user-flow"],fv={file:"기본",custom:"커스텀",override:"수정됨"};function pv(){return{id:"",docType:"prd",name:"",description:"",questions:[{id:"q1",prompt:"",hint:"",example:""}],sections:["개요"],draftGuidance:"명확한 기획 문서를 작성한다. 한국어로 작성한다.",source:"custom"}}function hv(){const[r,i]=y.useState([]),[a,u]=y.useState(null),[d,f]=y.useState(!1),[g,m]=y.useState("");async function h(){i(await z.templates())}y.useEffect(()=>{h().catch(()=>{})},[]);function v(j){u(JSON.parse(JSON.stringify(j))),f(!1),m("")}function x(){u(pv()),f(!0),m("")}function k(j){u(T=>T&&{...T,...j})}async function N(){if(a){m("저장 중…");try{const j=await z.saveTemplate(a);m("저장됨 · 다음 인터뷰부터 적용됩니다"),await h(),u(j),f(!1)}catch(j){m(`실패 · ${j.message}`)}}}async function C(){if(a&&confirm("이 템플릿의 커스텀 내용을 지웁니다. (기본 템플릿이 있으면 기본으로 복귀)"))try{const j=await z.deleteTemplate(a.id);await h(),u(j.reverted??null),m("되돌렸습니다")}catch(j){m(`실패 · ${j.message}`)}}return s.jsx(xt,{crumb:s.jsxs(s.Fragment,{children:[s.jsx(Mn,{to:"/",children:s.jsx($l,{})}),s.jsx("span",{className:"sep",children:"/"}),s.jsx("b",{children:"템플릿 라이브러리"})]}),tbarRight:s.jsx("span",{className:"cmdk",children:"⌘K"}),tagline:"인터뷰 질문·섹션·지침을 문서 유형별로 커스터마이즈 — 파일은 건드리지 않고 앱에 저장됩니다",children:s.jsx("main",{className:"settings",children:s.jsxs("div",{className:"tpl-wrap",children:[s.jsxs("aside",{className:"tpl-list",children:[s.jsxs("div",{className:"tpl-list-head",children:[s.jsx("b",{children:"템플릿"}),s.jsx("button",{className:"btn sm",onClick:x,children:"+ 새로"})]}),r.map(j=>s.jsxs("button",{className:`tpl-row ${(a==null?void 0:a.id)===j.id&&!d?"active":""}`,onClick:()=>v(j),children:[s.jsx("span",{className:"tpl-name",children:j.name}),s.jsxs("span",{className:"tpl-meta",children:[j.docType," · 질문 ",j.questions.length]}),j.source&&j.source!=="file"&&s.jsx("span",{className:"tpl-src",children:fv[j.source]})]},j.id))]}),s.jsx("section",{className:"tpl-edit",children:a?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"tpl-form-head",children:[s.jsx("h3",{children:d?"새 템플릿":a.name||a.id}),a.source&&a.source!=="file"&&!d&&s.jsx("button",{className:"btn sm danger",onClick:C,children:"기본으로 되돌리기"})]}),s.jsxs("label",{className:"lbl",children:["ID ",d?"(소문자·숫자·하이픈)":""]}),s.jsx("input",{className:"field",value:a.id,disabled:!d,placeholder:"예: prd-lean",onChange:j=>k({id:j.target.value})}),s.jsxs("div",{className:"tpl-2col",children:[s.jsxs("div",{children:[s.jsx("label",{className:"lbl",children:"이름"}),s.jsx("input",{className:"field",value:a.name,onChange:j=>k({name:j.target.value})})]}),s.jsxs("div",{children:[s.jsx("label",{className:"lbl",children:"문서 유형"}),s.jsx("select",{className:"field",value:a.docType,onChange:j=>k({docType:j.target.value}),children:dv.map(j=>s.jsx("option",{value:j,children:j},j))})]})]}),s.jsx("label",{className:"lbl",children:"설명"}),s.jsx("input",{className:"field",value:a.description,onChange:j=>k({description:j.target.value})}),s.jsx("label",{className:"lbl",children:"생성 지침 (system prompt)"}),s.jsx("textarea",{className:"field",rows:3,style:{resize:"vertical"},value:a.draftGuidance,onChange:j=>k({draftGuidance:j.target.value})}),s.jsx("label",{className:"lbl",children:"섹션 (초안이 만들 순서)"}),a.sections.map((j,T)=>s.jsxs("div",{className:"tpl-inline",children:[s.jsx("input",{className:"field",value:j,onChange:S=>{const I=[...a.sections];I[T]=S.target.value,k({sections:I})}}),s.jsx("button",{className:"btn sm",onClick:()=>k({sections:a.sections.filter((S,I)=>I!==T)}),children:"×"})]},T)),s.jsx("button",{className:"btn sm",onClick:()=>k({sections:[...a.sections,"새 섹션"]}),children:"+ 섹션"}),s.jsx("label",{className:"lbl",style:{marginTop:14},children:"인터뷰 질문"}),a.questions.map((j,T)=>s.jsxs("div",{className:"tpl-q",children:[s.jsxs("div",{className:"tpl-inline",children:[s.jsx("input",{className:"field",style:{maxWidth:90},placeholder:"id",value:j.id,onChange:S=>{const I=[...a.questions];I[T]={...j,id:S.target.value},k({questions:I})}}),s.jsx("input",{className:"field",placeholder:"질문",value:j.prompt,onChange:S=>{const I=[...a.questions];I[T]={...j,prompt:S.target.value},k({questions:I})}}),s.jsx("button",{className:"btn sm",onClick:()=>k({questions:a.questions.filter((S,I)=>I!==T)}),children:"×"})]}),s.jsxs("div",{className:"tpl-inline",children:[s.jsx("input",{className:"field",placeholder:"힌트(선택)",value:j.hint??"",onChange:S=>{const I=[...a.questions];I[T]={...j,hint:S.target.value},k({questions:I})}}),s.jsx("input",{className:"field",placeholder:"예시(선택)",value:j.example??"",onChange:S=>{const I=[...a.questions];I[T]={...j,example:S.target.value},k({questions:I})}})]})]},T)),s.jsx("button",{className:"btn sm",onClick:()=>k({questions:[...a.questions,{id:`q${a.questions.length+1}`,prompt:""}]}),children:"+ 질문"}),s.jsxs("div",{className:"tpl-save",children:[s.jsx("button",{className:"btn pri",onClick:N,children:"저장"}),g&&s.jsx("span",{className:g.startsWith("실패")?"err":"ok",children:g})]})]}):s.jsxs("div",{className:"muted",style:{padding:24},children:["왼쪽에서 템플릿을 고르거나 ",s.jsx("b",{children:"+ 새로"})," 를 눌러 만드세요."]})})]})})})}const mv=[{id:"anthropic",name:"Anthropic",placeholder:"sk-ant-…",hint:"console.anthropic.com"},{id:"openai",name:"OpenAI",placeholder:"sk-…",hint:"platform.openai.com"},{id:"openrouter",name:"OpenRouter",placeholder:"sk-or-…",hint:"openrouter.ai/keys"}];function gv({onDone:r}){const{meta:i}=zl(),[a,u]=y.useState(0),[d,f]=y.useState([]),[g,m]=y.useState({}),[h,v]=y.useState({}),[x,k]=y.useState(!1),[N,C]=y.useState(""),[j,T]=y.useState(""),[S,I]=y.useState("");async function W(){var H;I("저장·감지 중…");try{const L=await z.saveOpenaiEndpoint(j.trim());L.baseUrl&&T(L.baseUrl),I((H=L.models)!=null&&H.length?`연결됨 · 모델 ${L.models.length}개 (openai 칸에 게이트웨이 키를 등록하세요)`:"저장됨 · openai 칸에 게이트웨이 키를 먼저 등록하면 모델을 불러옵니다")}catch(L){I(`실패 · ${L.message}`)}}y.useEffect(()=>{z.keys().then(f).catch(()=>{})},[]);const A=d.some(H=>H.configured)||!!(i!=null&&i.aiStub);async function Y(H){const L=(g[H]??"").trim();if(L){k(!0),v(F=>({...F,[H]:"저장 중…"}));try{await z.saveKey(H,L);const F=await z.testKey(H);v(O=>({...O,[H]:F.ok?"연결 성공":`실패 · ${F.detail??""}`})),f(await z.keys()),m(O=>({...O,[H]:""}))}catch(F){v(O=>({...O,[H]:`실패 · ${F.message}`}))}finally{k(!1)}}}async function M(){k(!0),await z.completeOnboarding(),await r()}async function Z(){k(!0),C("Claude Code 생성 권한 확인 중…");try{const H=await z.testCli();if(!H.ok){C(""),u(1);const L=Rl(H.detail??"");v(F=>({...F,_cli:`${L.cause} — ${L.action}`}));return}await z.setAiMode("cli"),await z.completeOnboarding(),await r()}catch(H){C(""),u(1);const L=Rl(H.message);v(F=>({...F,_cli:`${L.cause} — ${L.action}`}))}finally{k(!1)}}return s.jsx("div",{className:"overlay",children:s.jsxs("div",{className:"dialog",children:[s.jsxs("div",{className:"wizard-step",children:[s.jsx("span",{className:`wizard-dot ${a===0?"active":""}`}),s.jsx("span",{className:`wizard-dot ${a===1?"active":""}`})]}),a===0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{textAlign:"center",marginBottom:6},children:s.jsx(Ke,{pose:"greet",size:72})}),s.jsxs("h2",{children:[s.jsx($l,{}),"에 오신 것을 환영합니다"]}),s.jsxs("p",{className:"subtle",children:["AI가 쓴 모든 것은 ",s.jsx("b",{style:{color:"var(--sug)"},children:"제안"}),"으로 들어오고, 수락해야만 문서가 됩니다. 당신이 편집장입니다."]}),i!=null&&i.cliAvailable?s.jsx("div",{className:"mini-card",children:s.jsxs("p",{className:"subtle",style:{margin:0},children:[s.jsx("b",{children:"Claude Code 를 찾았어요."})," 구독 로그인으로 생성하니 API 키가 필요 없습니다.",i.cliBin&&s.jsxs("span",{className:"muted",children:[" (",i.cliBin,")"]})]})}):s.jsx("div",{className:"mini-card",children:s.jsxs("p",{className:"subtle",style:{margin:0},children:[s.jsx("b",{children:"BYOK(Bring Your Own Key)"})," 방식으로 시작합니다. 키는 이 서버에"," ",s.jsx("b",{children:"암호화되어 저장"}),"되며 평문으로 노출되지 않습니다. (Claude Code CLI 가 있는 환경에서는 키 없이 시작할 수 있어요.)"]})}),(i==null?void 0:i.aiStub)&&s.jsx("p",{className:"ok",children:"STUB 모드가 켜져 있어 키 없이도 진행할 수 있습니다(오프라인 데모용)."}),s.jsxs("div",{className:"foot-actions",children:[i!=null&&i.cliAvailable?s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"btn",disabled:x,onClick:()=>u(1),children:"API 키로 쓸래요"}),s.jsx("button",{className:"btn pri lg",disabled:x,onClick:Z,children:"키 없이 시작하기"})]}):s.jsx("button",{className:"btn pri lg",onClick:()=>u(1),children:"시작하기"}),N&&s.jsx("p",{className:"subtle",style:{width:"100%",marginTop:8},children:N})]})]}),a===1&&s.jsxs(s.Fragment,{children:[s.jsx("h2",{children:"AI 키 등록"}),s.jsx("p",{className:"subtle",children:"등록 후 각 키의 연결을 테스트합니다. 건너뛸 수 없습니다."}),h._cli&&s.jsx("div",{className:"err",style:{marginBottom:4},children:h._cli}),s.jsxs("div",{className:"mini-card",style:{marginBottom:4},children:[s.jsx("label",{className:"lbl",style:{marginTop:0},children:"OpenAI 호환 게이트웨이 (선택 · LiteLLM·Azure·사내 프록시)"}),s.jsxs("div",{className:"h-row",children:[s.jsx("input",{className:"field",placeholder:"예: https://gateway.example.com (비우면 표준 provider)",value:j,onChange:H=>T(H.target.value)}),s.jsx("button",{className:"btn",disabled:x||!j.trim(),onClick:W,children:"연결"})]}),S&&s.jsx("div",{className:S.startsWith("실패")?"err":"ok",style:{marginTop:4},children:S}),s.jsxs("p",{className:"muted",style:{fontSize:11,marginTop:4},children:["게이트웨이를 쓰면 아래 ",s.jsx("b",{children:"openai"})," 칸에 게이트웨이 키를 등록하세요. (/v1 은 자동 감지)"]})]}),mv.map(H=>{var F;const L=(F=d.find(O=>O.provider===H.id))==null?void 0:F.configured;return s.jsxs("div",{style:{marginTop:"1rem"},children:[s.jsxs("label",{className:"lbl",children:[H.name," ",L&&s.jsx("span",{className:"ok",children:"· 등록됨"}),s.jsxs("span",{className:"muted",children:[" · ",H.hint]})]}),s.jsxs("div",{className:"h-row",children:[s.jsx("input",{className:"field",type:"password",placeholder:H.placeholder,value:g[H.id]??"",onChange:O=>m(J=>({...J,[H.id]:O.target.value}))}),s.jsx("button",{className:"btn",disabled:x||!(g[H.id]??"").trim(),onClick:()=>Y(H.id),children:"저장·테스트"})]}),h[H.id]&&s.jsx("div",{className:h[H.id]==="연결 성공"?"ok":"err",children:h[H.id]})]},H.id)}),s.jsx("div",{className:"divider"}),s.jsxs("div",{className:"h-row",style:{justifyContent:"space-between"},children:[s.jsx("button",{className:"btn ghost",onClick:()=>u(0),children:"뒤로"}),s.jsx("button",{className:"btn pri lg",disabled:!A||x,onClick:M,children:A?"완료하고 시작":"키를 1개 이상 등록하세요"})]})]})]})})}function vv({onClose:r}){const i=Ut(),[a,u]=y.useState(""),[d,f]=y.useState(!1),[g,m]=y.useState(""),h=y.useRef(null);y.useEffect(()=>{var k;(k=h.current)==null||k.focus();const x=N=>{N.key==="Escape"&&r()};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[r]);async function v(){if(!(!a.trim()||d)){f(!0),m("");try{const x=await Wd(a);r(),i(x)}catch(x){m((x==null?void 0:x.message)??"생성에 실패했습니다"),f(!1)}}}return s.jsx("div",{className:"sheet-veil",onClick:r,children:s.jsxs("div",{className:"plan-sheet",onClick:x=>x.stopPropagation(),children:[s.jsx("div",{className:"eyebrow",children:"New Plan · ⌘N"}),s.jsx("h2",{children:"무엇을 만들까요?"}),s.jsx("input",{ref:h,className:"field",placeholder:"아이디어 한 줄. 이름과 범위는 인터뷰에서 정리됩니다.",value:a,onChange:x=>u(x.target.value),onKeyDown:x=>x.key==="Enter"&&v()}),g&&s.jsx("div",{className:"form-error",children:g}),s.jsxs("div",{className:"plan-sheet-row",children:[s.jsx("button",{className:"btn pri",disabled:!a.trim()||d,onClick:v,children:d?"만드는 중…":"인터뷰 시작"}),s.jsx("button",{className:"btn",onClick:r,children:"닫기"}),s.jsx("span",{className:"hint mono",children:"답이 곧 제안의 근거가 됩니다"})]})]})})}function xv({onClose:r}){const i=Ut(),[a,u]=y.useState(""),[d,f]=y.useState(0),[g,m]=y.useState([]),h=y.useRef(null),v=y.useRef(null);y.useEffect(()=>{var j;(j=h.current)==null||j.focus();let C=!0;return(async()=>{const T=[{key:"a:new",kind:"action",label:"새 기획",detail:"⌘N",go:()=>{r(),ff()}},{key:"a:start",kind:"action",label:"시작 화면",go:()=>{r(),i("/")}},{key:"a:settings",kind:"action",label:"설정",go:()=>{r(),i("/settings")}},{key:"a:templates",kind:"action",label:"템플릿 라이브러리",go:()=>{r(),i("/templates")}}];C&&m(T);try{const S=await z.listProjects(),I=[...T];for(const A of S)I.push({key:`p:${A.id}`,kind:"project",label:A.name,count:ms(A),go:()=>{r(),i(`/projects/${A.id}`)}});const W=await Promise.all(S.map(A=>z.getProject(A.id).then(Y=>({p:A,docs:Y.documents})).catch(()=>({p:A,docs:[]}))));for(const{p:A,docs:Y}of W)for(const M of Y)I.push({key:`d:${M.id}`,kind:"document",label:M.title,detail:A.name,count:ms(M),go:()=>{r(),i(`/projects/${A.id}/documents/${M.id}`)}});C&&m(I)}catch{}})(),()=>{C=!1}},[i,r]);const x=y.useMemo(()=>{const C=a.trim().toLowerCase();return C?g.filter(j=>j.label.toLowerCase().includes(C)||(j.detail??"").toLowerCase().includes(C)):g},[g,a]);y.useEffect(()=>f(0),[a]),y.useEffect(()=>{var C,j;(j=(C=v.current)==null?void 0:C.querySelector(".pal-item.on"))==null||j.scrollIntoView({block:"nearest"})},[d]);function k(C){var j;C.key==="ArrowDown"?(C.preventDefault(),f(T=>Math.min(T+1,x.length-1))):C.key==="ArrowUp"?(C.preventDefault(),f(T=>Math.max(T-1,0))):C.key==="Enter"?(C.preventDefault(),(j=x[d])==null||j.go()):C.key==="Escape"&&r()}const N={action:"GO",project:"PROJ",document:"DOC"};return s.jsx("div",{className:"sheet-veil pal-veil",onClick:r,children:s.jsxs("div",{className:"palette",onClick:C=>C.stopPropagation(),children:[s.jsx("input",{ref:h,className:"pal-input",placeholder:"프로젝트·문서로 점프, 또는 명령…",value:a,onChange:C=>u(C.target.value),onKeyDown:k}),s.jsx("div",{className:"pal-list",ref:v,children:x.length===0?s.jsx("div",{className:"pal-empty",children:"일치하는 항목이 없습니다"}):x.map((C,j)=>s.jsxs("button",{className:`pal-item ${j===d?"on":""}`,onMouseEnter:()=>f(j),onClick:C.go,children:[s.jsx("span",{className:"t mono",children:N[C.kind]}),s.jsx("span",{className:"nm",children:C.label}),C.detail&&s.jsx("span",{className:"dt",children:C.detail}),(C.count??0)>0&&s.jsxs("span",{className:"gd mono",children:[s.jsx("i",{}),C.count]})]},C.key))}),s.jsx("div",{className:"pal-foot mono",children:"↑↓ 이동 · Enter 열기 · Esc 닫기"})]})})}const df=y.createContext({meta:null,reload:async()=>{}}),zl=()=>y.useContext(df),Qa="drafting:new-plan";function ff(){window.dispatchEvent(new CustomEvent(Qa))}function yv(){const[r,i]=y.useState(null),[a,u]=y.useState(!1),[d,f]=y.useState(!1),g=y.useCallback(async()=>{i(await z.meta())},[]);y.useEffect(()=>{g().catch(()=>i(null))},[g]),y.useEffect(()=>{const h=x=>{(x.metaKey||x.ctrlKey)&&!x.shiftKey&&!x.altKey&&x.key.toLowerCase()==="n"&&(x.preventDefault(),u(!0)),(x.metaKey||x.ctrlKey)&&!x.shiftKey&&!x.altKey&&x.key.toLowerCase()==="k"&&(x.preventDefault(),f(k=>!k))},v=()=>u(!0);return window.addEventListener("keydown",h),window.addEventListener(Qa,v),()=>{window.removeEventListener("keydown",h),window.removeEventListener(Qa,v)}},[]);const m=r!==null&&!r.onboardingComplete;return s.jsxs(df.Provider,{value:{meta:r,reload:g},children:[s.jsxs(fm,{children:[s.jsx(jn,{path:"/",element:s.jsx(Om,{})}),s.jsx(jn,{path:"/projects/:pid",element:s.jsx(Um,{})}),s.jsx(jn,{path:"/projects/:pid/documents/:did",element:s.jsx(ev,{})}),s.jsx(jn,{path:"/projects/:pid/wireframes",element:s.jsx(sv,{})}),s.jsx(jn,{path:"/projects/:pid/handoff",element:s.jsx(av,{})}),s.jsx(jn,{path:"/settings",element:s.jsx(uv,{})}),s.jsx(jn,{path:"/templates",element:s.jsx(hv,{})})]}),a&&s.jsx(vv,{onClose:()=>u(!1)}),d&&s.jsx(xv,{onClose:()=>f(!1)}),m&&s.jsx(gv,{onDone:g})]})}kh.createRoot(document.getElementById("root")).render(s.jsx(bd.StrictMode,{children:s.jsx(jm,{children:s.jsx(yv,{})})}));
|
|
120
|
+
`}strong({tokens:r}){return`<strong>${this.parser.parseInline(r)}</strong>`}em({tokens:r}){return`<em>${this.parser.parseInline(r)}</em>`}codespan({text:r}){return`<code>${Bt(r,!0)}</code>`}br(r){return"<br>"}del({tokens:r}){return`<del>${this.parser.parseInline(r)}</del>`}link({href:r,title:i,tokens:a}){const u=this.parser.parseInline(a),d=wd(r);if(d===null)return u;r=d;let f='<a href="'+r+'"';return i&&(f+=' title="'+Bt(i)+'"'),f+=">"+u+"</a>",f}image({href:r,title:i,text:a,tokens:u}){u&&(a=this.parser.parseInline(u,this.parser.textRenderer));const d=wd(r);if(d===null)return Bt(a);r=d;let f=`<img src="${r}" alt="${a}"`;return i&&(f+=` title="${Bt(i)}"`),f+=">",f}text(r){return"tokens"in r&&r.tokens?this.parser.parseInline(r.tokens):"escaped"in r&&r.escaped?r.text:Bt(r.text)}},oo=class{strong({text:r}){return r}em({text:r}){return r}codespan({text:r}){return r}del({text:r}){return r}html({text:r}){return r}text({text:r}){return r}link({text:r}){return""+r}image({text:r}){return""+r}br(){return""}},Zt=class qa{constructor(i){Oe(this,"options");Oe(this,"renderer");Oe(this,"textRenderer");this.options=i||Un,this.options.renderer=this.options.renderer||new Tl,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new oo}static parse(i,a){return new qa(a).parse(i)}static parseInline(i,a){return new qa(a).parseInline(i)}parse(i,a=!0){var d,f;let u="";for(let g=0;g<i.length;g++){const m=i[g];if((f=(d=this.options.extensions)==null?void 0:d.renderers)!=null&&f[m.type]){const v=m,x=this.options.extensions.renderers[v.type].call({parser:this},v);if(x!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(v.type)){u+=x||"";continue}}const h=m;switch(h.type){case"space":{u+=this.renderer.space(h);continue}case"hr":{u+=this.renderer.hr(h);continue}case"heading":{u+=this.renderer.heading(h);continue}case"code":{u+=this.renderer.code(h);continue}case"table":{u+=this.renderer.table(h);continue}case"blockquote":{u+=this.renderer.blockquote(h);continue}case"list":{u+=this.renderer.list(h);continue}case"html":{u+=this.renderer.html(h);continue}case"paragraph":{u+=this.renderer.paragraph(h);continue}case"text":{let v=h,x=this.renderer.text(v);for(;g+1<i.length&&i[g+1].type==="text";)v=i[++g],x+=`
|
|
121
|
+
`+this.renderer.text(v);a?u+=this.renderer.paragraph({type:"paragraph",raw:x,text:x,tokens:[{type:"text",raw:x,text:x,escaped:!0}]}):u+=x;continue}default:{const v='Token with "'+h.type+'" type was not found.';if(this.options.silent)return console.error(v),"";throw new Error(v)}}}return u}parseInline(i,a=this.renderer){var d,f;let u="";for(let g=0;g<i.length;g++){const m=i[g];if((f=(d=this.options.extensions)==null?void 0:d.renderers)!=null&&f[m.type]){const v=this.options.extensions.renderers[m.type].call({parser:this},m);if(v!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(m.type)){u+=v||"";continue}}const h=m;switch(h.type){case"escape":{u+=a.text(h);break}case"html":{u+=a.html(h);break}case"link":{u+=a.link(h);break}case"image":{u+=a.image(h);break}case"strong":{u+=a.strong(h);break}case"em":{u+=a.em(h);break}case"codespan":{u+=a.codespan(h);break}case"br":{u+=a.br(h);break}case"del":{u+=a.del(h);break}case"text":{u+=a.text(h);break}default:{const v='Token with "'+h.type+'" type was not found.';if(this.options.silent)return console.error(v),"";throw new Error(v)}}}return u}},za,Sl=(za=class{constructor(r){Oe(this,"options");Oe(this,"block");this.options=r||Un}preprocess(r){return r}postprocess(r){return r}processAllTokens(r){return r}provideLexer(){return this.block?Yt.lex:Yt.lexInline}provideParser(){return this.block?Zt.parse:Zt.parseInline}},Oe(za,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),za),bg=class{constructor(...r){Oe(this,"defaults",eo());Oe(this,"options",this.setOptions);Oe(this,"parse",this.parseMarkdown(!0));Oe(this,"parseInline",this.parseMarkdown(!1));Oe(this,"Parser",Zt);Oe(this,"Renderer",Tl);Oe(this,"TextRenderer",oo);Oe(this,"Lexer",Yt);Oe(this,"Tokenizer",_l);Oe(this,"Hooks",Sl);this.use(...r)}walkTokens(r,i){var u,d;let a=[];for(const f of r)switch(a=a.concat(i.call(this,f)),f.type){case"table":{const g=f;for(const m of g.header)a=a.concat(this.walkTokens(m.tokens,i));for(const m of g.rows)for(const h of m)a=a.concat(this.walkTokens(h.tokens,i));break}case"list":{const g=f;a=a.concat(this.walkTokens(g.items,i));break}default:{const g=f;(d=(u=this.defaults.extensions)==null?void 0:u.childTokens)!=null&&d[g.type]?this.defaults.extensions.childTokens[g.type].forEach(m=>{const h=g[m].flat(1/0);a=a.concat(this.walkTokens(h,i))}):g.tokens&&(a=a.concat(this.walkTokens(g.tokens,i)))}}return a}use(...r){const i=this.defaults.extensions||{renderers:{},childTokens:{}};return r.forEach(a=>{const u={...a};if(u.async=this.defaults.async||u.async||!1,a.extensions&&(a.extensions.forEach(d=>{if(!d.name)throw new Error("extension name required");if("renderer"in d){const f=i.renderers[d.name];f?i.renderers[d.name]=function(...g){let m=d.renderer.apply(this,g);return m===!1&&(m=f.apply(this,g)),m}:i.renderers[d.name]=d.renderer}if("tokenizer"in d){if(!d.level||d.level!=="block"&&d.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const f=i[d.level];f?f.unshift(d.tokenizer):i[d.level]=[d.tokenizer],d.start&&(d.level==="block"?i.startBlock?i.startBlock.push(d.start):i.startBlock=[d.start]:d.level==="inline"&&(i.startInline?i.startInline.push(d.start):i.startInline=[d.start]))}"childTokens"in d&&d.childTokens&&(i.childTokens[d.name]=d.childTokens)}),u.extensions=i),a.renderer){const d=this.defaults.renderer||new Tl(this.defaults);for(const f in a.renderer){if(!(f in d))throw new Error(`renderer '${f}' does not exist`);if(["options","parser"].includes(f))continue;const g=f,m=a.renderer[g],h=d[g];d[g]=(...v)=>{let x=m.apply(d,v);return x===!1&&(x=h.apply(d,v)),x||""}}u.renderer=d}if(a.tokenizer){const d=this.defaults.tokenizer||new _l(this.defaults);for(const f in a.tokenizer){if(!(f in d))throw new Error(`tokenizer '${f}' does not exist`);if(["options","rules","lexer"].includes(f))continue;const g=f,m=a.tokenizer[g],h=d[g];d[g]=(...v)=>{let x=m.apply(d,v);return x===!1&&(x=h.apply(d,v)),x}}u.tokenizer=d}if(a.hooks){const d=this.defaults.hooks||new Sl;for(const f in a.hooks){if(!(f in d))throw new Error(`hook '${f}' does not exist`);if(["options","block"].includes(f))continue;const g=f,m=a.hooks[g],h=d[g];Sl.passThroughHooks.has(f)?d[g]=v=>{if(this.defaults.async)return Promise.resolve(m.call(d,v)).then(j=>h.call(d,j));const x=m.call(d,v);return h.call(d,x)}:d[g]=(...v)=>{let x=m.apply(d,v);return x===!1&&(x=h.apply(d,v)),x}}u.hooks=d}if(a.walkTokens){const d=this.defaults.walkTokens,f=a.walkTokens;u.walkTokens=function(g){let m=[];return m.push(f.call(this,g)),d&&(m=m.concat(d.call(this,g))),m}}this.defaults={...this.defaults,...u}}),this}setOptions(r){return this.defaults={...this.defaults,...r},this}lexer(r,i){return Yt.lex(r,i??this.defaults)}parser(r,i){return Zt.parse(r,i??this.defaults)}parseMarkdown(r){return(a,u)=>{const d={...u},f={...this.defaults,...d},g=this.onError(!!f.silent,!!f.async);if(this.defaults.async===!0&&d.async===!1)return g(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof a>"u"||a===null)return g(new Error("marked(): input parameter is undefined or null"));if(typeof a!="string")return g(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(a)+", string expected"));f.hooks&&(f.hooks.options=f,f.hooks.block=r);const m=f.hooks?f.hooks.provideLexer():r?Yt.lex:Yt.lexInline,h=f.hooks?f.hooks.provideParser():r?Zt.parse:Zt.parseInline;if(f.async)return Promise.resolve(f.hooks?f.hooks.preprocess(a):a).then(v=>m(v,f)).then(v=>f.hooks?f.hooks.processAllTokens(v):v).then(v=>f.walkTokens?Promise.all(this.walkTokens(v,f.walkTokens)).then(()=>v):v).then(v=>h(v,f)).then(v=>f.hooks?f.hooks.postprocess(v):v).catch(g);try{f.hooks&&(a=f.hooks.preprocess(a));let v=m(a,f);f.hooks&&(v=f.hooks.processAllTokens(v)),f.walkTokens&&this.walkTokens(v,f.walkTokens);let x=h(v,f);return f.hooks&&(x=f.hooks.postprocess(x)),x}catch(v){return g(v)}}}onError(r,i){return a=>{if(a.message+=`
|
|
122
|
+
Please report this to https://github.com/markedjs/marked.`,r){const u="<p>An error occurred:</p><pre>"+Bt(a.message+"",!0)+"</pre>";return i?Promise.resolve(u):u}if(i)return Promise.reject(a);throw a}}},Bn=new bg;function Le(r,i){return Bn.parse(r,i)}Le.options=Le.setOptions=function(r){return Bn.setOptions(r),Le.defaults=Bn.defaults,Yd(Le.defaults),Le};Le.getDefaults=eo;Le.defaults=Un;Le.use=function(...r){return Bn.use(...r),Le.defaults=Bn.defaults,Yd(Le.defaults),Le};Le.walkTokens=function(r,i){return Bn.walkTokens(r,i)};Le.parseInline=Bn.parseInline;Le.Parser=Zt;Le.parser=Zt.parse;Le.Renderer=Tl;Le.TextRenderer=oo;Le.Lexer=Yt;Le.lexer=Yt.lex;Le.Tokenizer=_l;Le.Hooks=Sl;Le.parse=Le;Le.options;Le.setOptions;Le.use;Le.walkTokens;Le.parseInline;Zt.parse;Yt.lex;Le.setOptions({gfm:!0,breaks:!1});function _g(r){return r.replace(/<\s*(script|iframe)[^>]*>[\s\S]*?<\s*\/\s*\1\s*>/gi,"").replace(/\son\w+\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi,"").replace(/javascript:/gi,"")}function Tg(r){return r.trim()?_g(Le.parse(r)):'<p class="muted">(비어 있음)</p>'}function Rg({doc:r,sections:i,setSections:a,streaming:u,focusSection:d,onFocusSection:f,onRegenerate:g,onRename:m,onStructuralChange:h,onSaveState:v,error:x,onBackToInterview:j,onStop:S}){const[P,k]=y.useState(r.title),[b,w]=y.useState(null),$=y.useRef({});y.useEffect(()=>k(r.title),[r.id,r.title]);function W(F,O){a(J=>J.map(te=>te.id===F?{...te,...O}:te)),v("saving"),clearTimeout($.current[F]),$.current[F]=setTimeout(async()=>{await z.updateSection(F,O),v("saved"),h(),setTimeout(()=>v("idle"),1500)},2e3)}async function A(){const F=await z.addSection(r.id,"새 섹션","");a(O=>[...O,{...F,streaming:!1,editable:!0}]),h()}async function Y(F,O){let J=null;if(a(te=>{const oe=te.findIndex(Ee=>Ee.id===F),ue=oe+O;if(oe<0||ue<0||ue>=te.length)return te;const ge=[...te];return[ge[oe],ge[ue]]=[ge[ue],ge[oe]],J=ge,ge}),!!J){v("saving");try{await z.reorderSections(r.id,J.map(te=>te.id)),v("saved"),h(),setTimeout(()=>v("idle"),1200)}catch{a(te=>{const oe=te.findIndex(Ee=>Ee.id===F),ue=oe-O;if(oe<0||ue<0||ue>=te.length)return te;const ge=[...te];return[ge[oe],ge[ue]]=[ge[ue],ge[oe]],ge}),v("idle")}}}async function M(){try{const F=await z.undo(r.id);a(F.sections.map(O=>Va(O))),h(),v("saved"),setTimeout(()=>v("idle"),1200)}catch{}}async function Z(F){await z.deleteSection(F),a(O=>O.filter(J=>J.id!==F)),h()}const H=i.filter(F=>F.status==="proposed").length,L=i.filter(F=>F.status!=="proposed"&&F.status!=="rejected").length;return s.jsx("main",{className:"editor",children:s.jsxs("div",{className:"editor-inner",children:[s.jsxs("div",{className:"doc-head",children:[s.jsxs("div",{className:"eyebrow",children:[r.type.toUpperCase()," · V",r.version]}),s.jsx("h2",{contentEditable:!u,suppressContentEditableWarning:!0,onInput:F=>k(F.currentTarget.textContent??""),onBlur:()=>P.trim()&&P!==r.title&&m(P.trim()),children:r.title}),s.jsxs("div",{className:"meta",children:[s.jsxs("span",{children:["확정 ",L,"문장",H>0?` · 제안 ${H}건`:""]}),s.jsx("span",{className:"sep",children:"·"}),s.jsx("button",{className:"btn ghost sm",onClick:j,title:"인터뷰로 돌아가기",children:"인터뷰"}),s.jsx("span",{className:"sep",children:"·"}),s.jsx("button",{className:"btn ghost sm",disabled:u,onClick:M,title:"마지막 변경 되돌리기 (더 깊은 복원은 버전 기록)",children:"되돌리기"})]})]}),x&&s.jsx("div",{className:"err",style:{marginBottom:12},children:x}),u&&s.jsxs("div",{className:"ch-strip",children:[s.jsx(Ke,{pose:"write",size:34}),s.jsx("span",{children:"초안을 쓰는 중이에요. 다 쓰면 전부 제안으로 보여드릴게요."}),S&&s.jsx("button",{className:"btn sm",style:{marginLeft:"auto"},onClick:S,children:"중지"})]}),i.length===0&&!u&&s.jsxs("div",{className:"empty",children:[s.jsx(Ke,{pose:"wait",size:64}),s.jsxs("div",{style:{marginTop:10},children:[s.jsx("b",{children:"AI 초안 생성"}),"을 누르면 여기에 초안이 ",s.jsx("b",{children:"제안 상태"}),"로 채워집니다.",s.jsx("br",{}),"수락한 문장만 문서에 남습니다."]})]}),i.map((F,O)=>s.jsx(Lg,{section:F,focused:d===F.id,streaming:u,editing:b===F.id,canMoveUp:O>0,canMoveDown:O<i.length-1,onMove:J=>Y(F.id,J),onEnter:()=>F.status==="proposed"&&f(F.id),onLeave:()=>f(null),onToggleEdit:()=>w(J=>J===F.id?null:F.status==="proposed"?J:F.id),onEdit:J=>W(F.id,J),onRegenerate:()=>g(F.id),onRemove:()=>Z(F.id)},F.id)),!u&&i.length>0&&s.jsx("button",{className:"btn",style:{marginTop:12},onClick:A,children:"+ 섹션 추가"})]})})}function Lg({section:r,focused:i,streaming:a,editing:u,canMoveUp:d,canMoveDown:f,onMove:g,onEnter:m,onLeave:h,onToggleEdit:v,onEdit:x,onRegenerate:j,onRemove:S}){const P=r.status==="proposed",k=r.kindHint==="delete",b=["sec",P?"proposed":"",k?"del":"",i?"focus":""].join(" ");return s.jsxs("div",{className:b,onMouseEnter:m,onMouseLeave:h,children:[s.jsxs("div",{className:"sec-head",children:[u?s.jsx("input",{value:r.heading,disabled:r.streaming,onChange:w=>x({heading:w.target.value}),style:{flex:1,border:"1px solid var(--hair)",borderRadius:6,padding:"4px 8px",fontWeight:800}}):s.jsx("h3",{children:r.heading}),r.streaming?s.jsx("span",{className:"pill",style:{color:"var(--sug)",borderColor:"var(--sug-line)"},children:r.body.trim()?"스트리밍 중…":"생각 중…"}):s.jsxs("div",{className:"sec-tools",children:[s.jsx("button",{className:"btn icon",disabled:a||!d,onClick:()=>g(-1),title:"위로","aria-label":"섹션 위로",children:"↑"}),s.jsx("button",{className:"btn icon",disabled:a||!f,onClick:()=>g(1),title:"아래로","aria-label":"섹션 아래로",children:"↓"}),!P&&s.jsx("button",{className:"btn",onClick:v,title:"편집 토글",children:u?"완료":"편집"}),s.jsx("button",{className:"btn",disabled:a,onClick:j,title:"이 섹션만 재생성 (다른 섹션 불변)",children:"재생성"}),!P&&s.jsx("button",{className:"btn danger",disabled:a,onClick:S,children:"삭제"})]})]}),u&&!P?s.jsx("div",{className:"sec-edit",children:s.jsx("textarea",{value:r.body,onChange:w=>x({body:w.target.value}),placeholder:"마크다운으로 편집…"})}):r.streaming&&!r.body.trim()?s.jsx("div",{className:"sec-body thinking",children:"모델이 생각하고 있어요… (추론형 모델은 잠시 걸립니다)"}):s.jsx("div",{className:`sec-body ${r.streaming?"cursor":""}`,dangerouslySetInnerHTML:{__html:Tg(r.body)}})]})}function $g({s:r,onFocusSection:i,focusedSection:a,doneLine:u}){const{suggestions:d,accept:f,reject:g,rewrite:m,acceptAll:h}=r,v=d.length;return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"ph",children:["제안 ",s.jsx("span",{className:"cnt",children:v}),s.jsx("button",{className:"all",disabled:v===0,onClick:()=>h(),children:"모두 수락"})]}),v===0?s.jsxs("div",{className:"panel-empty",children:[s.jsx(Ke,{pose:"wait",size:72}),"검토할 제안이 없어요.",s.jsx("br",{}),s.jsx("b",{children:"문서를 이어 쓰면 다시 물어올게요."})]}):d.map(x=>s.jsx(Ig,{sg:x,focused:!!x.sectionId&&a===x.sectionId,onAccept:()=>f(x.id),onReject:()=>g(x.id),onRewrite:j=>m(x.id,j),onEnter:()=>x.sectionId&&i(x.sectionId),onLeave:()=>i(null)},x.id)),u&&s.jsx("div",{className:"done-line",children:u})]})}function Ig({sg:r,focused:i,onAccept:a,onReject:u,onRewrite:d,onEnter:f,onLeave:g}){const[m,h]=y.useState(!1),[v,x]=y.useState(""),[j,S]=y.useState(!1),P=r.kind==="question",k=r.kind==="lint"||r.kind==="delete";function b($){S(!0),h(!0),window.setTimeout(()=>{$().catch(()=>{h(!1),S(!1)})},180)}async function w(){const $=v.trim();if(!(!$||j)){S(!0);try{await d($),x("")}finally{S(!1)}}}return s.jsxs("div",{className:`sug-card ${m?"collapsing":""} ${i?"focus":""}`,onMouseEnter:f,onMouseLeave:g,children:[s.jsxs("div",{className:"who",children:[s.jsx(Ke,{pose:"fetch",size:20,animate:!1}),s.jsx("b",{children:r.title||Hm(r.kind)}),s.jsx("span",{className:"why",children:r.source})]}),r.body,(r.quoteBefore||r.quoteAfter)&&s.jsxs("div",{className:"quote",children:[r.quoteBefore&&s.jsxs("span",{children:["“",r.quoteBefore,"” "]}),r.quoteAfter&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"arrow",children:"→"})," ",s.jsxs("span",{children:["“",r.quoteAfter,"”"]})]})]}),s.jsxs("div",{className:"sug-acts",children:[s.jsx("button",{className:"btn ok",disabled:j,onClick:()=>b(a),children:P?"답하기":k?"정리 수락 (항목 제외)":"수락"}),s.jsx("button",{className:"btn",disabled:j,onClick:()=>b(u),children:P?"넘기기":k?"유지":"거절"})]}),!P&&r.kind!=="lint"&&s.jsx("div",{className:"sug-acts rewrite",children:s.jsx("input",{placeholder:"고쳐쓰기 지시",value:v,disabled:j,onChange:$=>x($.target.value),onKeyDown:$=>$.key==="Enter"&&w()})})]})}const Og={save:"저장",context_inherit:"컨텍스트 승계",restore:"복원"};function zg({docId:r,onClose:i,onRestored:a}){const[u,d]=y.useState([]),[f,g]=y.useState(!1);y.useEffect(()=>{z.versions(r).then(d).catch(()=>{})},[r]);async function m(h){g(!0);try{await z.restoreVersion(r,h.id),a(),i()}finally{g(!1)}}return s.jsx("div",{className:"overlay",onClick:i,children:s.jsxs("div",{className:"dialog",onClick:h=>h.stopPropagation(),children:[s.jsx("h2",{children:"버전 히스토리"}),s.jsx("p",{className:"subtle",children:"저장·재생성·컨텍스트 승계 시점의 스냅샷입니다. 특정 버전으로 복원할 수 있습니다."}),u.length===0?s.jsx("div",{className:"center-empty",children:"아직 버전이 없습니다."}):s.jsx("div",{className:"rows",style:{marginTop:"0.75rem"},children:u.map(h=>{var v;return s.jsxs("div",{className:"row",children:[s.jsxs("span",{className:"mono",children:["v",h.version]}),s.jsx("span",{className:"pill",children:Og[h.event_type]}),s.jsxs("span",{className:"grow muted",style:{fontSize:"0.78rem"},children:[new Date(h.created_at).toLocaleString(),typeof((v=h.meta)==null?void 0:v.reason)=="string"?` · ${h.meta.reason}`:""]}),s.jsx("button",{className:"btn sm",disabled:f,onClick:()=>m(h),children:"복원"})]},h.id)})}),s.jsx("div",{style:{textAlign:"right",marginTop:"1rem"},children:s.jsx("button",{className:"btn",onClick:i,children:"닫기"})})]})})}const Ag=[{label:"만료 없음",hours:null},{label:"1시간",hours:1},{label:"24시간",hours:24},{label:"7일",hours:168}];function Mg({docId:r,onClose:i}){const[a,u]=y.useState([]),[d,f]=y.useState(null),[g,m]=y.useState("");async function h(){u(await z.listShares(r))}y.useEffect(()=>{h().catch(()=>{})},[r]);async function v(){await z.createShare(r,d),await h()}async function x(S){await z.revokeShare(S),await h()}function j(S){var k;const P=location.origin+S;(k=navigator.clipboard)==null||k.writeText(P).then(()=>{m(S),setTimeout(()=>m(""),1200)})}return s.jsx("div",{className:"overlay",onClick:i,children:s.jsxs("div",{className:"dialog",onClick:S=>S.stopPropagation(),children:[s.jsx("h2",{children:"공유 링크"}),s.jsx("p",{className:"subtle",children:"읽기 전용 HTML 링크입니다. 로그인 없이 열람할 수 있고, 편집은 불가능합니다."}),s.jsxs("div",{className:"toolbar",children:[s.jsx("select",{className:"field",style:{maxWidth:160},value:String(d),onChange:S=>f(S.target.value==="null"?null:Number(S.target.value)),children:Ag.map(S=>s.jsx("option",{value:String(S.hours),children:S.label},S.label))}),s.jsx("button",{className:"btn pri",onClick:v,children:"링크 생성"})]}),a.length===0?s.jsx("div",{className:"center-empty",children:"아직 공유 링크가 없습니다."}):s.jsx("div",{className:"rows",children:a.map(S=>s.jsxs("div",{className:"row",style:{flexWrap:"wrap"},children:[s.jsx("a",{className:"grow mono",href:S.url,target:"_blank",rel:"noreferrer",children:S.url}),S.revoked===1?s.jsx("span",{className:"err",children:"취소됨"}):S.expired?s.jsx("span",{className:"err",children:"만료됨"}):s.jsx("span",{className:"ok",children:"활성"}),s.jsx("button",{className:"btn sm",onClick:()=>j(S.url),children:g===S.url?"복사됨":"복사"}),S.revoked!==1&&s.jsx("button",{className:"btn sm danger",onClick:()=>x(S.id),children:"취소"})]},S.id))}),s.jsx("div",{style:{textAlign:"right",marginTop:"1rem"},children:s.jsx("button",{className:"btn",onClick:i,children:"닫기"})})]})})}function Dg({docId:r,onClose:i,onRefreshed:a}){const[u,d]=y.useState(null),[f,g]=y.useState(!1);y.useEffect(()=>{z.parentContext(r).then(d).catch(()=>{})},[r]);async function m(){g(!0);try{await z.refreshContext(r),a(),i()}finally{g(!1)}}return s.jsx("div",{className:"overlay",onClick:i,children:s.jsxs("div",{className:"dialog",onClick:h=>h.stopPropagation(),children:[s.jsx("h2",{children:"상위 문서가 변경되었습니다"}),s.jsxs("p",{className:"subtle",children:["상위 문서",u!=null&&u.parentTitle?` "${u.parentTitle}"`:"",(u==null?void 0:u.parentVersion)!=null?` (v${u.parentVersion})`:"","가 바뀌어, 이 문서가 참조하는 컨텍스트가 낡았습니다. 무엇을 하시겠습니까?"]}),(u==null?void 0:u.available)&&s.jsxs("div",{className:"mini-card",style:{cursor:"default",marginTop:"0.5rem"},children:[s.jsx("div",{className:"subtle",style:{marginBottom:"0.3rem"},children:"최신 상위 컨텍스트 미리보기"}),(u.sections??[]).map((h,v)=>s.jsxs("div",{style:{marginBottom:"0.4rem"},children:[s.jsx("b",{children:h.heading}),s.jsxs("div",{className:"muted",style:{fontSize:"0.8rem"},children:[h.body.slice(0,120),h.body.length>120?"…":""]})]},v))]}),s.jsx("div",{className:"divider"}),s.jsxs("div",{className:"rows",children:[s.jsx("button",{className:"btn pri lg",disabled:f,onClick:m,children:"(A) 컨텍스트만 갱신 · 이 문서 본문은 그대로 둡니다"}),s.jsxs("div",{className:"subtle",children:["(B) 특정 섹션을 상위 내용에 맞춰 다시 쓰려면, 갱신 후 각 섹션의 ",s.jsx("b",{children:"재생성"}),"을 개별로 누르세요. 자동으로 덮어쓰지 않습니다."]}),s.jsx("button",{className:"btn ghost",onClick:i,children:"(C) 나중에 · 배지를 유지합니다"})]})]})})}const Cd={prd:"PRD","feature-spec":"기능명세",ia:"IA","user-flow":"유저플로우","design-system":"디자인 시스템",handoff:"개발 지시서"};function Fg(r){return/Claude Code|구독|subscription|API 키|API key|로그인|log ?in|authenticat|인증|key 모드|BYOK/i.test(r||"")}function Bg(){const{pid:r,did:i}=Sn(),a=i,{meta:u}=zl(),[d,f]=y.useState(null),[g,m]=y.useState([]),[h,v]=y.useState(null),[x,j]=y.useState(null),[S,P]=y.useState(!1),[k,b]=y.useState(null),[w,$]=y.useState(!1),[W,A]=y.useState("editor"),[Y,M]=y.useState(""),[Z,H]=y.useState(!1),[L,F]=y.useState(!1),O=y.useRef(null);function J(){F(!0),O.current&&clearTimeout(O.current),O.current=setTimeout(()=>F(!1),2600)}const[te,oe]=y.useState(null),[ue,ge]=y.useState(null),[Ee,xe]=y.useState("idle"),q=y.useRef(null),le=y.useCallback(async()=>{const ce=await z.getDocument(a);f(ce.document),P(ce.parentContextAvailable)},[a]),X=y.useCallback(async()=>{const ce=await z.getDocument(a);f(ce.document),P(ce.parentContextAvailable),m(me=>{const ve=ce.sections.map(Te=>Va(Te));return new Set(me.filter(Te=>Te.streaming).map(Te=>Te.id)).size?me:ve})},[a]),_=Km(a,X),D=y.useCallback(async()=>{const ce=await z.getDocument(a);f(ce.document),m(ce.sections.map(ve=>Va(ve))),P(ce.parentContextAvailable),A(ce.sections.length===0?"interview":"editor");const me=await z.startInterview(a);v(me.session),j(me.template),r&&z.getProject(r).then(b).catch(()=>{})},[a,r]);y.useEffect(()=>(D().catch(ce=>M(ce.message)),()=>{var ce;return(ce=q.current)==null?void 0:ce.close()}),[D]),y.useEffect(()=>{d&&k&&r&&bm({pid:r,did:d.id,docTitle:d.title,projectName:k.name,ts:new Date().toISOString()})},[d,k,r]);function ye(){var ce;h&&(M(""),H(!1),z.completeInterview(h.id).catch(()=>{}),$(!0),m([]),A("editor"),(ce=q.current)==null||ce.close(),q.current=Cm(a,{onSectionStart:me=>m(ve=>[...ve,{id:me.sectionId,heading:me.heading,body:"",streaming:!0,editable:!1}]),onToken:me=>m(ve=>ve.map(De=>De.id===me.sectionId?{...De,body:De.body+me.delta}:De)),onSectionEnd:me=>m(ve=>ve.map(De=>De.id===me.sectionId?{...De,streaming:!1,editable:!0}:De)),onDone:()=>{$(!1),le(),_.reload(),m(me=>{const ve=me.filter(De=>!De.body.trim()).length;return ve>0&&ve>=me.length/2?M(`생성된 본문이 비어 있어요(${ve}/${me.length} 섹션). 추론형 모델은 토큰 예산이 작으면 본문을 못 냅니다 — 설정에서 max tokens 를 늘리거나 다른 모델로 시도하세요.`):me.length>0&&J(),me})},onError:me=>{$(!1),M(me||"초안 생성 실패 · 설정에서 AI 키를 확인하세요."),H(Fg(me))}}))}function ke(){var ce;(ce=q.current)==null||ce.close(),q.current=null,$(!1),m(me=>me.map(ve=>({...ve,streaming:!1,editable:!0}))),le(),_.reload()}function we(ce){var me;M(""),$(!0),m(ve=>ve.map(De=>De.id===ce?{...De,body:"",streaming:!0,editable:!1}:De)),(me=q.current)==null||me.close(),q.current=Em(ce,{onToken:ve=>m(De=>De.map(Te=>Te.id===ve.sectionId?{...Te,body:Te.body+ve.delta}:Te)),onSectionEnd:ve=>m(De=>De.map(Te=>Te.id===ve.sectionId?{...Te,streaming:!1,editable:!0}:Te)),onDone:()=>{$(!1),le(),_.reload()},onError:ve=>{$(!1),M(ve||"재생성 실패")}})}async function Se(ce){const me=await z.renameDocument(a,ce);f(me)}if(!d)return s.jsx(xt,{crumb:s.jsx("span",{children:"불러오는 중…"}),children:s.jsx("main",{className:"editor",children:s.jsx("div",{className:"editor-inner center-empty",children:Y?s.jsx("span",{className:"err",children:Y}):"불러오는 중…"})})});const Pe=d.context_stale===1&&S,Ne=_.suggestions.length,B=s.jsxs(s.Fragment,{children:[s.jsx(Dn,{to:"/",children:"프로젝트"}),s.jsx("span",{className:"sep",children:"/"}),s.jsx(Dn,{to:`/projects/${r}`,children:(k==null?void 0:k.name)??"프로젝트"}),s.jsx("span",{className:"sep",children:"/"}),s.jsx("b",{className:"name",children:Cd[d.type]})]}),ie=s.jsxs(s.Fragment,{children:[Pe&&s.jsxs("span",{className:"sug-count",onClick:()=>oe("context"),title:"컨텍스트 갱신 필요",children:[s.jsx("i",{}),"갱신 필요"]}),s.jsxs("span",{className:`sug-count ${Ne?"":"zero"}`,onClick:()=>_.reload(),children:[s.jsx("i",{}),"제안 ",Ne]}),s.jsx("button",{className:"btn",onClick:()=>oe("versions"),children:"버전"}),s.jsx("button",{className:"btn",onClick:()=>oe("share"),children:"공유"}),s.jsx("a",{className:"btn pri",href:`/api/documents/${a}/export.md`,title:"수락된 것만 내보내집니다",children:"내보내기"}),s.jsx("span",{className:"cmdk",children:"⌘K"})]}),pe=k?s.jsx(ys,{projectId:r,projectName:k.name,documents:k.documents,active:"PRD",activeCount:Ne}):void 0,Ue=Ne>0?`제안 ${Ne} · 수락 전에는 내보내기에 포함되지 않습니다`:"수락하지 않은 문장은 문서에 없습니다",nt=s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"오프라인 OK"}),(u==null?void 0:u.aiStub)&&s.jsx("span",{children:"STUB AI"}),s.jsxs("span",{children:["v",d.version]})]});if(W==="interview")return s.jsx(xt,{crumb:B,tbarRight:ie,nav:pe,tagline:"인터뷰 답변이 이후 제안 카드의 근거가 됩니다",statusLeft:s.jsx("span",{children:"인터뷰"}),statusRight:nt,children:s.jsx("main",{className:"interview-screen",children:s.jsxs("div",{className:"interview-inner",children:[s.jsxs("div",{className:"doc-head",children:[s.jsxs("div",{className:"eyebrow",children:[Cd[d.type]," · 인터뷰"]}),s.jsx("h2",{style:{fontSize:22},children:d.title}),s.jsx("div",{className:"meta",children:"답변한 뒤 AI 초안을 제안으로 받습니다"})]}),Y&&s.jsx("div",{className:"err",style:{marginBottom:12},children:Y}),h&&x?s.jsx(Jd,{template:x,session:h,streaming:w,onSaveAnswer:async ce=>{const me=await z.answer(h.id,ce);v(me)},onGenerate:ye}):s.jsx("div",{className:"muted",children:"인터뷰 템플릿을 불러오는 중…"})]})})});const he=_.supported?void 0:s.jsx("span",{children:"제안 API 준비 중 · 초안은 편집기에서 직접 수정할 수 있습니다"});return s.jsxs(xt,{crumb:B,tbarRight:ie,nav:pe,panel:s.jsx($g,{s:_,onFocusSection:ge,focusedSection:ue,doneLine:he}),tagline:Ue,statusLeft:s.jsx("span",{className:"save",children:Ee==="saving"?"저장 중…":Ee==="saved"?"로컬 저장됨 · 방금":"로컬 저장됨"}),statusRight:nt,children:[Z&&s.jsxs("div",{className:"gen-block-banner",children:[s.jsxs("div",{children:[s.jsx("b",{children:"AI 생성이 막혔어요."})," 이 계정은 Claude Code 접근이 막혀 있을 수 있어요(조직 차단).",s.jsx("span",{className:"muted",children:" 인터뷰 답변은 그대로 보존돼 있어, 키를 등록하면 다시 채워집니다."})]}),s.jsxs("div",{className:"acts",children:[s.jsx(Dn,{className:"btn",to:"/settings",children:"설정에서 키 등록"}),s.jsx("button",{className:"btn pri",disabled:w,onClick:ye,children:"다시 생성"})]})]}),s.jsx(Rg,{doc:d,sections:g,setSections:m,streaming:w,focusSection:ue,onFocusSection:ge,onRegenerate:we,onRename:Se,onStructuralChange:le,onSaveState:xe,error:Y,onBackToInterview:()=>A("interview"),onStop:ke}),te==="versions"&&s.jsx(zg,{docId:a,onClose:()=>oe(null),onRestored:D}),te==="share"&&s.jsx(Mg,{docId:a,onClose:()=>oe(null)}),te==="context"&&s.jsx(Dg,{docId:a,onClose:()=>oe(null),onRefreshed:()=>{le(),_.reload()}}),L&&s.jsxs("div",{className:"ceremony",role:"status","aria-live":"polite",children:[s.jsx(Ke,{pose:"done",size:40}),s.jsx("span",{children:"초안이 준비됐어요. 마음에 드는 문장만 수락하세요."})]})]})}const Ia=["P0","P1","P2"];function Ug({projectId:r,items:i,selected:a,onSelect:u,onAccept:d,onReject:f,onChanged:g,flows:m=[],onLinkFeature:h,onUnlinkFeature:v,reqs:x=[],onEditLink:j}){const[S,P]=y.useState(new Map),[k,b]=y.useState(0),w=y.useCallback(()=>{z.lint(r).then(O=>{const J=new Map;for(const te of O.violations)te.waived||J.set(te.refs[0],te);P(J),b(O.effectiveCount)}).catch(()=>{})},[r]);y.useEffect(()=>{w()},[w,i]);async function $(O){const J=Be(O),te=J.priority??"P2",oe=Ia[(Ia.indexOf(te)+1)%Ia.length];await z.updateItem(O.id,{meta:{...J,priority:oe}}),g==null||g(),w()}async function W(O){O.key&&(await z.lintWaiveOne(r,O.key),w())}const A=i.filter(O=>O.kind==="feature-group"&&O.status!=="rejected"),Y=O=>i.filter(J=>J.kind==="feature"&&J.parent_id===O&&J.status!=="rejected"),M=i.filter(O=>O.kind==="feature"&&O.status!=="rejected"),Z=M.filter(O=>Be(O).priority==="P0").length,H=M.filter(O=>Be(O).priority==="P1").length,L=M.filter(O=>O.status==="accepted").length,F=M.filter(O=>O.status==="proposed").length;return s.jsxs("div",{className:"editor-inner",children:[s.jsx("div",{className:"eyebrow",children:"SPEC · Feature Specification"}),s.jsx("h1",{className:"struct-h1",children:"기능명세서"}),s.jsx("div",{className:"dmeta",children:"항목 트리 · 서버 채번 · 수락한 항목만 문서"}),s.jsxs("div",{className:"sumbar",children:[s.jsxs("span",{className:"sumchip",children:["항목 ",s.jsx("b",{children:M.length})]}),s.jsxs("span",{className:"sumchip",children:["P0 ",s.jsx("b",{children:Z})," · P1 ",s.jsx("b",{children:H})]}),s.jsxs("span",{className:"sumchip",children:["수락 ",s.jsx("b",{children:L})]}),F>0&&s.jsxs("span",{className:"sumchip g",children:["제안 ",F]}),k>0&&s.jsxs("span",{className:"sumchip am",children:["검사 위반 ",k]})]}),s.jsxs("div",{className:"colhead",children:[s.jsx("span",{className:"c1",children:"ID"}),s.jsx("span",{className:"c2",children:"항목"}),s.jsx("span",{className:"c3",children:"근거"}),s.jsx("span",{className:"c4",children:"우선"})]}),A.map(O=>{var Ee;const J=Y(O.id),te=new Set;for(const xe of J)for(const q of((Ee=Be(xe).links)==null?void 0:Ee.pages)??[])te.add(q);const oe=J.filter(xe=>xe.status==="accepted").length,ue=J.filter(xe=>xe.status==="proposed").length,ge=S.get(O.ref_id);return s.jsxs("div",{children:[s.jsxs("div",{className:"grouprow",children:[s.jsx("span",{className:"gid",children:O.ref_id}),s.jsx("b",{children:O.title}),[...te].length>0&&s.jsx("span",{className:"pgchip",children:[...te].join("·")}),ge&&s.jsx("span",{className:"dpill amber",children:"검사 위반"}),s.jsxs("span",{className:"gsum",children:["하위 ",J.length," · 수락 ",oe," · 제안 ",ue]})]}),J.map(xe=>s.jsx(Wg,{feature:xe,open:a===xe.id||xe.status==="proposed",violation:S.get(xe.ref_id)??null,onToggle:()=>u(a===xe.id?null:xe.id),onAccept:()=>d(xe.id),onReject:()=>f(xe.id),onCyclePriority:()=>$(xe),onWaive:W,flows:m,onLinkFeature:h,onUnlinkFeature:v,reqs:x,onEditLink:j},xe.id))]},O.id)})]})}function Wg({feature:r,open:i,violation:a,onToggle:u,onAccept:d,onReject:f,onCyclePriority:g,onWaive:m,flows:h,onLinkFeature:v,onUnlinkFeature:x,reqs:j,onEditLink:S}){var Y,M,Z,H;const P=Be(r),k=r.status==="proposed",b=h.filter(L=>{var F;return(((F=Be(L).links)==null?void 0:F.features)??[]).includes(r.ref_id)}),w=h.filter(L=>{var F;return!(((F=Be(L).links)==null?void 0:F.features)??[]).includes(r.ref_id)}),$=((Y=P.links)==null?void 0:Y.reqs)??[],W=j.filter(L=>!$.includes(L.id)),A=r.body.split(`
|
|
123
|
+
`).map(L=>L.replace(/^[·\-*]\s*/,"").trim()).filter(Boolean);return i?s.jsxs("div",{className:`exp ${a?"viol":""}`,children:[s.jsxs("div",{className:"xh",children:[s.jsx("span",{className:"rid",children:r.ref_id}),s.jsx("b",{children:r.title}),k?s.jsx("span",{className:"dpill",children:"제안됨"}):a?s.jsx("span",{className:"dpill amber",children:a.code}):s.jsx("span",{className:"dpill",style:{color:"var(--ink)",borderColor:"var(--hair)"},children:"수락됨"}),s.jsx("button",{className:"pri-edit",title:"우선순위 변경 (P0→P1→P2)",onClick:L=>{L.stopPropagation(),g()},children:P.priority??"P?"}),s.jsxs("span",{className:"mini",children:[s.jsx("button",{onClick:d,title:"수락",children:"✓"}),s.jsx("button",{className:"no",onClick:f,title:"거절",children:"×"})]})]}),a&&s.jsxs("div",{className:"viol-bar",children:[s.jsx("span",{className:"vcode",children:a.code}),s.jsx("span",{className:"vmsg",children:a.message}),s.jsx("button",{className:"btn sm",onClick:()=>m(a),title:"이 위반만 무시(내용 유지)",children:"무시"})]}),A.length>0&&s.jsxs("div",{className:"ac",children:[s.jsx("span",{className:"lb",children:"수용 기준"}),A.map((L,F)=>s.jsxs("div",{children:["· ",L]},F))]}),s.jsxs("div",{className:"links",children:[s.jsx("span",{className:"lb",style:{width:"auto",margin:"0 4px 0 0",display:"inline"},children:"연결"}),(((M=P.links)==null?void 0:M.pages)??[]).map(L=>s.jsx("span",{className:"pgchip",children:L},L)),(((Z=P.links)==null?void 0:Z.flows)??[]).map(L=>s.jsx("span",{className:"pgchip",children:L},L)),(((H=P.links)==null?void 0:H.reqs)??[]).map(L=>s.jsx("span",{className:"pgchip",children:L},L))]}),h.length>0&&(v||x)&&s.jsxs("div",{className:"flow-linker",children:[s.jsx("span",{className:"lb",style:{width:"auto",margin:"0 4px 0 0",display:"inline"},children:"플로우"}),b.length===0&&s.jsx("span",{className:"muted",style:{fontSize:11},children:"연결된 플로우 없음"}),b.map(L=>s.jsxs("span",{className:"flowchip",children:[L.ref_id,x&&s.jsx("button",{title:"연결 해제",onClick:()=>x(L.id,r.ref_id),children:"×"})]},L.id)),v&&w.length>0&&s.jsxs("select",{className:"field",style:{maxWidth:220,fontSize:12},value:"",onChange:L=>{L.target.value&&v(L.target.value,r.ref_id)},children:[s.jsx("option",{value:"",children:"+ 플로우에 추가…"}),w.map(L=>s.jsxs("option",{value:L.id,children:[L.ref_id," ",L.title]},L.id))]})]}),S&&(j.length>0||$.length>0)&&s.jsxs("div",{className:"flow-linker",children:[s.jsx("span",{className:"lb",style:{width:"auto",margin:"0 4px 0 0",display:"inline"},children:"요구"}),$.length===0&&s.jsx("span",{className:"muted",style:{fontSize:11},children:"연결된 요구 없음"}),$.map(L=>s.jsxs("span",{className:"flowchip",children:[L,s.jsx("button",{title:"연결 해제",onClick:()=>S(r.id,"reqs",L,"remove"),children:"×"})]},L)),W.length>0&&s.jsxs("select",{className:"field",style:{maxWidth:240,fontSize:12},value:"",onChange:L=>L.target.value&&S(r.id,"reqs",L.target.value,"add"),children:[s.jsx("option",{value:"",children:"+ 요구에 연결…"}),W.map(L=>s.jsxs("option",{value:L.id,children:[L.id," ",L.heading]},L.id))]})]}),P.source&&s.jsxs("div",{className:"quote",children:["근거 · ",P.source]})]}):s.jsxs("button",{className:`trow lv2 ${k?"sug":""}`,onClick:u,children:[s.jsx("span",{className:"rid",children:r.ref_id}),s.jsx("span",{className:"rt",children:r.title}),a&&s.jsx("span",{className:"dpill amber",children:a.code}),s.jsx("span",{className:"src",children:P.source??""}),s.jsx("span",{className:"pri-tag",children:P.priority??""})]})}const cf={LIST:"LIST",DETAIL:"DETAIL",FORM:"FORM",DASH:"DASH",SETTINGS:"SET",GENERIC:"PAGE"};function Oa(r){const i=Be(r).page_type??"GENERIC";return i in cf?i:"GENERIC"}function uf({type:r}){return r==="DASH"?s.jsxs("div",{className:"iav-glyph dash",children:[s.jsx("span",{className:"g"}),s.jsx("span",{className:"g"}),s.jsx("span",{className:"g"}),s.jsx("span",{className:"g"})]}):r==="FORM"?s.jsxs("div",{className:"iav-glyph form",children:[s.jsxs("span",{className:"f",children:[s.jsx("b",{}),s.jsx("i",{})]}),s.jsxs("span",{className:"f",children:[s.jsx("b",{}),s.jsx("i",{})]})]}):r==="SETTINGS"?s.jsxs("div",{className:"iav-glyph settings",children:[s.jsxs("span",{className:"r on",children:[s.jsx("b",{}),s.jsx("i",{})]}),s.jsxs("span",{className:"r",children:[s.jsx("b",{}),s.jsx("i",{})]}),s.jsxs("span",{className:"r on",children:[s.jsx("b",{}),s.jsx("i",{})]})]}):r==="DETAIL"?s.jsxs("div",{className:"iav-glyph detail",children:[s.jsx("span",{className:"g"}),s.jsx("span",{className:"g"}),s.jsx("span",{className:"g"})]}):s.jsxs("div",{className:"iav-glyph list",children:[s.jsx("span",{className:"g"}),s.jsx("span",{className:"g"}),s.jsx("span",{className:"g"}),s.jsx("span",{className:"g",style:{width:"58%"}})]})}function Vg({projectId:r,items:i,selected:a,onSelect:u,onAccept:d,onReject:f,generating:g,onRegenerate:m,features:h=[],flowItems:v=[],onEditLink:x,onSetSection:j}){const[S,P]=y.useState(new Map),[k,b]=y.useState("map");y.useEffect(()=>{z.lint(r).then(O=>{const J=new Map;for(const te of O.violations)te.waived||J.set(te.refs[0],te);P(J)}).catch(()=>{})},[r,i]);const w=y.useMemo(()=>i.filter(O=>O.kind==="page"&&O.status!=="rejected"),[i]),$=y.useMemo(()=>v.filter(O=>O.kind==="step"),[v]),W=v.some(O=>O.kind==="flow"),A=O=>{const J=new Set;for(const te of $)if(Be(te).page===O){const oe=v.find(ue=>ue.id===te.parent_id);oe&&J.add(oe.ref_id)}return[...J]},Y=O=>{var J;return((J=Be(O).links)==null?void 0:J.features)??[]},M=y.useMemo(()=>{const O=w.filter(ue=>S.has(ue.ref_id)).length,J=W?w.filter(ue=>A(ue.ref_id).length===0).length:0,te=new Set(w.flatMap(ue=>Y(ue))),oe=h.filter(ue=>!te.has(ue.ref_id));return{violCount:O,unreachable:J,unlinked:oe,placed:h.length-oe.length}},[w,S,h,v,W]),Z=w.find(O=>O.id===a)??null,H=O=>(Be(O).section??"").trim(),L=y.useMemo(()=>{const O=[],J=new Map;for(const oe of w){const ue=H(oe)||"__none";J.has(ue)||(J.set(ue,[]),O.push(ue)),J.get(ue).push(oe)}O.sort((oe,ue)=>(oe==="__none"?1:0)-(ue==="__none"?1:0));const te=O.filter(oe=>oe!=="__none");return{order:O,map:J,hasSections:te.length>0,names:te}},[w]),F=O=>{const J=Oa(O),te=S.get(O.ref_id),oe=Y(O).length===0,ue=W&&A(O.ref_id).length===0,ge=O.status==="proposed"?"prop":te||oe||ue?"viol":a===O.id?"sel":"",Ee=oe?"근거 기능 없음":ue?"도달 플로우 없음":te?"검사 위반":"";return s.jsxs("button",{className:`iav-card ${ge}`,onClick:()=>u(O.id),"aria-pressed":a===O.id,children:[s.jsx(uf,{type:J}),s.jsxs("span",{className:"cap",children:[s.jsx("span",{className:"rid",children:O.ref_id}),s.jsx("span",{className:"ttl",children:O.title}),s.jsx("span",{className:"iav-chip",children:cf[J]})]}),O.status==="proposed"?s.jsx("span",{className:"flag prop",children:"+ 제안됨 — 수락하면 확정"}):Ee&&s.jsxs("span",{className:"flag warn",children:["△ ",Ee]})]},O.id)};return s.jsxs("div",{className:"editor-inner",children:[s.jsx("div",{className:"eyebrow",children:"IA · Information Architecture"}),s.jsx("h1",{className:"struct-h1",children:"정보 구조"}),s.jsx("div",{className:"dmeta",children:"사이트맵 = 정본 · 와이어프레임이 이 구조를 그대로 렌더"}),w.length>0&&s.jsxs("div",{className:"iav-health",children:[s.jsxs("span",{className:"iav-stat total",children:[s.jsx("span",{className:"num",children:w.length})," 화면"]}),M.violCount>0&&s.jsxs("span",{className:"iav-stat warn",children:[s.jsx("span",{className:"dot"}),s.jsx("span",{className:"num",children:M.violCount})," 검사 위반"]}),W&&M.unreachable>0&&s.jsxs("span",{className:"iav-stat warn",children:[s.jsx("span",{className:"dot"}),s.jsx("span",{className:"num",children:M.unreachable})," 도달 플로우 없음"]}),h.length>0&&M.unlinked.length>0&&s.jsxs("span",{className:"iav-stat warn",children:[s.jsx("span",{className:"dot"}),s.jsx("span",{className:"num",children:M.unlinked.length})," 미연결 기능"]}),h.length>0&&s.jsxs("span",{className:"iav-stat",children:[s.jsxs("span",{className:"num",children:[M.placed," / ",h.length]})," ","기능 배치됨"]})]}),s.jsxs("div",{className:"iav-tabs",role:"tablist",children:[s.jsx("button",{className:`iav-tab ${k==="map"?"on":""}`,role:"tab","aria-selected":k==="map",onClick:()=>b("map"),children:"사이트맵"}),s.jsx("button",{className:`iav-tab ${k==="matrix"?"on":""}`,role:"tab","aria-selected":k==="matrix",onClick:()=>b("matrix"),children:"커버리지"}),s.jsx("button",{className:`iav-tab ${k==="list"?"on":""}`,role:"tab","aria-selected":k==="list",onClick:()=>b("list"),children:"리스트 편집"}),s.jsx("button",{className:"btn sm",style:{marginLeft:"auto"},disabled:g,onClick:m,children:g?"생성 중…":"다시 생성"})]}),w.length===0?s.jsxs("div",{className:"iav-empty",children:["아직 화면이 없어요. ",s.jsx("b",{children:"다시 생성"}),"으로 기능명세에서 화면을 제안받으세요."]}):k==="list"?s.jsx("div",{className:"ia-list",children:w.map(O=>{const J=Oa(O),te=S.get(O.ref_id);return s.jsxs("div",{className:`row ${O.status==="proposed"?"sug":""}`,children:[s.jsx("span",{className:"rid",children:O.ref_id}),s.jsx("span",{className:"rt",children:O.title}),s.jsx("span",{className:"typechip",children:J}),te&&s.jsx("span",{className:"dpill amber",children:"검사 위반"}),O.status==="proposed"&&s.jsxs("span",{className:"mini",children:[s.jsx("button",{onClick:()=>d(O.id),children:"✓"}),s.jsx("button",{className:"no",onClick:()=>f(O.id),children:"×"})]})]},O.id)})}):k==="matrix"?s.jsx(Kg,{pages:w,features:h,onPick:O=>{u(O),b("map")}}):s.jsxs("div",{className:"iav-stage",children:[L.hasSections?s.jsxs("div",{className:"iav-tree",children:[s.jsxs("div",{className:"iav-approot",children:[s.jsx("span",{className:"mid",children:"APP"})," 사이트맵"]}),L.order.map(O=>s.jsxs("section",{className:"iav-sec",children:[s.jsxs("div",{className:"iav-sechd",children:[s.jsx("span",{className:"branch","aria-hidden":!0}),s.jsx("span",{className:"nm",children:O==="__none"?"미분류":O}),s.jsx("span",{className:"cnt",children:L.map.get(O).length})]}),s.jsx("div",{className:"iav-grid",children:L.map.get(O).map(F)})]},O))]}):s.jsx("div",{className:"iav-grid",children:w.map(F)}),Z?s.jsx(Hg,{page:Z,type:Oa(Z),flows:A(Z.ref_id),hasFlowDoc:W,violation:S.get(Z.ref_id)??null,features:h,sections:L.names,currentSection:H(Z),onAccept:()=>d(Z.id),onReject:()=>f(Z.id),onEditLink:x,onSetSection:j}):s.jsx("aside",{className:"iav-insp empty",children:"화면을 선택하면 근거 기능·진입 플로우·상태를 봅니다."})]})]})}function Hg({page:r,type:i,flows:a,hasFlowDoc:u,violation:d,features:f,sections:g,currentSection:m,onAccept:h,onReject:v,onEditLink:x,onSetSection:j}){var b;const S=((b=Be(r).links)==null?void 0:b.features)??[],P=f.filter(w=>!S.includes(w.ref_id)),k=w=>{var $;return(($=f.find(W=>W.ref_id===w))==null?void 0:$.title)??""};return s.jsxs("aside",{className:"iav-insp",children:[s.jsxs("div",{className:"ihd",children:[s.jsx("div",{className:"big",children:s.jsx(uf,{type:i})}),s.jsxs("div",{className:"ht",children:[s.jsx("h4",{children:r.title}),s.jsxs("div",{className:"sub",children:[r.ref_id," · ",i]})]})]}),s.jsxs("div",{className:"ibody",children:[s.jsxs("div",{className:"iav-krow",children:[s.jsx("span",{className:"iav-k",children:"섹션"}),j?s.jsxs(s.Fragment,{children:[s.jsxs("select",{className:"iav-addsel",value:g.includes(m)?m:"",onChange:w=>j(r.id,w.target.value),children:[s.jsx("option",{value:"",children:"(최상위)"}),g.map(w=>s.jsx("option",{value:w,children:w},w))]}),s.jsx("input",{className:"iav-secnew",placeholder:"+ 새 섹션",onKeyDown:w=>{const $=w.currentTarget.value.trim();w.key==="Enter"&&$&&(j(r.id,$),w.currentTarget.value="")}})]}):s.jsx("span",{className:"iav-lchip",children:m||"최상위"})]}),s.jsxs("div",{className:"iav-krow",children:[s.jsx("span",{className:"iav-k",children:"근거 기능"}),S.map(w=>x?s.jsxs("button",{className:"iav-lchip rm",title:k(w),onClick:()=>x(r.id,"features",w,"remove"),children:[w," ",s.jsx("span",{"aria-hidden":!0,children:"×"})]},w):s.jsx("span",{className:"iav-lchip",title:k(w),children:w},w)),S.length===0&&s.jsx("span",{className:"iav-none",children:"근거 기능 없음"}),x&&P.length>0&&s.jsxs("select",{className:"iav-addsel",value:"",onChange:w=>w.target.value&&x(r.id,"features",w.target.value,"add"),children:[s.jsx("option",{value:"",children:"+ 기능 연결…"}),P.map(w=>s.jsxs("option",{value:w.ref_id,children:[w.ref_id," ",w.title]},w.id))]})]}),s.jsxs("div",{className:"iav-krow",children:[s.jsx("span",{className:"iav-k",children:"진입 플로우"}),a.length?a.map(w=>s.jsx("span",{className:"iav-lchip",children:w},w)):u?s.jsx("span",{className:"iav-none warn",children:"도달 플로우 없음"}):s.jsx("span",{className:"iav-none",children:"유저플로우 미작성"})]}),s.jsxs("div",{className:"iav-krow",children:[s.jsx("span",{className:"iav-k",children:"상태"}),s.jsxs("span",{className:"iav-status",children:[r.status==="proposed"?"제안됨":"수락됨",d?` · ${d.code}`:" · 와이어프레임 최신"]})]}),r.status==="proposed"&&s.jsxs("div",{className:"iav-iacts",children:[s.jsx("button",{className:"btn ok",onClick:h,children:"수락"}),s.jsx("button",{className:"btn",onClick:v,children:"거절"})]})]})]})}function Kg({pages:r,features:i,onPick:a}){if(i.length===0)return s.jsx("div",{className:"iav-empty",children:"기능명세가 아직 없어요. 기능이 있어야 화면과의 커버리지를 볼 수 있습니다."});const u=(g,m)=>{var h;return(((h=Be(g).links)==null?void 0:h.features)??[]).includes(m)},d=g=>i.filter(m=>u(g,m.ref_id)).length,f=g=>r.filter(m=>u(m,g)).length;return s.jsx("div",{className:"iav-mtxwrap",children:s.jsxs("table",{className:"iav-mtx",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"corner",children:"기능 \ 화면"}),r.map(g=>s.jsx("th",{children:s.jsxs("button",{className:"colh",onClick:()=>a(g.id),title:g.title,children:[s.jsx("span",{className:"rid",children:g.ref_id}),s.jsx("span",{className:"ct",children:g.title})]})},g.id)),s.jsx("th",{className:"sumh",children:"배치"})]})}),s.jsxs("tbody",{children:[i.map(g=>{const m=f(g.ref_id);return s.jsxs("tr",{children:[s.jsxs("th",{className:"rowh",children:[s.jsx("span",{className:"rid",children:g.ref_id}),g.title]}),r.map(h=>s.jsx("td",{className:"cell",children:u(h,g.ref_id)?s.jsx("span",{className:"on-c","aria-label":"연결됨",children:"●"}):s.jsx("span",{className:"off-c","aria-hidden":!0,children:"·"})},h.id)),s.jsx("td",{className:"cell",children:m>0?s.jsx("span",{className:"num",children:m}):s.jsx("span",{className:"gaptag",children:"⚠ 화면 없음"})})]},g.id)}),s.jsxs("tr",{className:"footr",children:[s.jsx("th",{className:"rowh muted",children:"담는 기능"}),r.map(g=>{const m=d(g);return s.jsx("td",{className:`cell ${m===0?"gapcol":""}`,children:m===0?s.jsx("span",{className:"gaptag",children:"⚠ 0"}):s.jsx("span",{className:"num",children:m})},g.id)}),s.jsx("td",{})]})]})]})})}function qg({items:r,onAccept:i,onReject:a,onChanged:u,pages:d=[],onSetStepPage:f}){const[g,m]=y.useState(!1),h=r.filter(j=>j.kind==="flow"&&j.status!=="rejected"),v=j=>r.filter(S=>S.kind==="step"&&S.parent_id===j&&S.status!=="rejected").sort((S,P)=>S.position-P.position);function x(){var b,w;const j=["flowchart LR"];for(const $ of h){const W=v($.id),A=W.filter(M=>!Be(M).branch),Y=M=>M.ref_id.replace(/[.\-]/g,"_");A.forEach((M,Z)=>{const H=Be(M),L=`${H.page?H.page+" ":""}${M.title}`,F=H.node==="start"||H.node==="end"?`([${L}])`:H.node==="decision"?`{${M.title}}`:`[${L}]`;j.push(` ${Y(M)}${F}`),Z>0&&j.push(` ${Y(A[Z-1])} --> ${Y(M)}`)});for(const M of W.filter(Z=>Be(Z).branch)){const Z=Be(M),H=(((b=Z.branch)==null?void 0:b.from_step)??"").replace(/[.\-]/g,"_");H&&j.push(` ${H} -->|${((w=Z.branch)==null?void 0:w.label)??"예"}| ${Y(M)}[${M.title}]`)}}const S=new Blob([j.join(`
|
|
124
|
+
`)],{type:"text/plain"}),P=URL.createObjectURL(S),k=document.createElement("a");k.href=P,k.download="flows.mmd",k.click(),URL.revokeObjectURL(P)}return s.jsxs("div",{className:"editor-inner",children:[s.jsx("div",{className:"eyebrow",children:"FLOW · User Flow"}),s.jsx("h1",{className:"struct-h1",children:"유저 플로우"}),s.jsxs("div",{className:"dmeta",children:["노드 = 화면(PG-)·판단(◇)·완료(●) — 편집은 스텝, 보기는 다이어그램",s.jsx("button",{className:"btn sm",style:{marginLeft:10},onClick:()=>m(j=>!j),children:g?"다이어그램":"스텝 편집"}),s.jsx("button",{className:"btn sm",onClick:x,children:"mermaid 내보내기"})]}),h.map(j=>{const S=v(j.id),P=S.filter(w=>!Be(w).branch),k=S.filter(w=>Be(w).branch),b=Be(j);return g?s.jsxs("div",{className:"flane",children:[s.jsxs("div",{className:"fh",children:[s.jsx("span",{className:"rid",children:j.ref_id}),s.jsx("b",{children:j.title}),s.jsx("span",{className:"src",children:b.source??""})]}),s.jsx("div",{className:"ia-list",children:S.map(w=>{const $=Be(w);return s.jsxs("div",{className:"trow",children:[s.jsx("span",{className:"rid",children:w.ref_id}),s.jsx("input",{className:"field",style:{flex:1,fontSize:12},defaultValue:w.title,onBlur:async W=>{W.target.value.trim()&&W.target.value!==w.title&&(await z.updateItem(w.id,{title:W.target.value.trim()}),u==null||u())}}),s.jsx("span",{className:"typechip",children:$.node??"screen"}),f&&d.length>0?s.jsxs("select",{className:"field",style:{maxWidth:150,fontSize:11},value:$.page??"",onChange:W=>f(w.id,W.target.value||null),children:[s.jsx("option",{value:"",children:"화면 없음"}),d.map(W=>s.jsxs("option",{value:W.ref_id,children:[W.ref_id," ",W.title]},W.id))]}):$.page&&s.jsx("span",{className:"pgchip",children:$.page}),s.jsx("span",{className:"mini",children:s.jsx("button",{className:"no",title:"스텝 삭제",onClick:async()=>{await z.deleteItem(w.id),u==null||u()},children:"×"})})]},w.id)})})]},j.id):s.jsxs("div",{className:"flane",children:[s.jsxs("div",{className:"fh",children:[s.jsx("span",{className:"rid",children:j.ref_id}),s.jsx("b",{children:j.title}),s.jsx("span",{className:"src",children:b.source??""}),j.status==="proposed"&&s.jsxs("span",{className:"mini",style:{marginLeft:8},children:[s.jsx("button",{onClick:()=>i(j.id),children:"✓"}),s.jsx("button",{className:"no",onClick:()=>a(j.id),children:"×"})]})]}),s.jsx("div",{className:"ftrack",children:P.map((w,$)=>{const W=Be(w),A=$>0&&Be(P[$-1]).node==="decision";return s.jsx(Qg,{step:w,meta:W,edgeBefore:$>0,edgeLabel:A?"아니오":void 0},w.id)})}),k.map(w=>{var W;const $=Be(w);return s.jsxs("div",{className:"fbranch",children:[s.jsx("div",{className:"bend"}),s.jsxs("span",{className:"floop",children:[((W=$.branch)==null?void 0:W.label)??"예"," ·"]}),s.jsxs("div",{className:"fnode",children:[s.jsx("span",{className:"fid",children:$.page??""}),s.jsx("b",{children:w.title})]}),$.note&&s.jsxs("span",{className:"floop",children:["→ ",$.note]})]},w.id)})]},j.id)})]})}function Qg({step:r,meta:i,edgeBefore:a,edgeLabel:u}){const d=a?s.jsx("div",{className:"fedge",children:u&&s.jsx("span",{className:"elb",children:u})}):null;if(i.node==="decision")return s.jsxs(s.Fragment,{children:[d,s.jsx("div",{className:"fdec",children:r.title})]});const f=i.node==="start"?"startn":i.node==="end"?"endn":"",g=i.node==="start"?"시작":i.node==="end"?"완료":i.page??"";return s.jsxs(s.Fragment,{children:[d,s.jsxs("div",{className:`fnode ${f}`,children:[s.jsx("span",{className:"fid",children:g}),s.jsx("b",{children:r.title})]})]})}const Gg={"feature-spec":"SPEC",ia:"IA","user-flow":"FLOW"},Ed={"feature-spec":"SPEC · Feature Specification",ia:"IA · Information Architecture","user-flow":"FLOW · User Flow"},cr={"feature-spec":"기능명세서",ia:"정보 구조","user-flow":"유저 플로우"};function Jg({doc:r}){const{pid:i}=Sn(),a=Ut(),u=r.id,d=r.type,[f,g]=y.useState(r),[m,h]=y.useState([]),[v,x]=y.useState([]),[j,S]=y.useState(null),[P,k]=y.useState(!1),[b,w]=y.useState(null),[$,W]=y.useState(""),A=y.useRef(null),[Y,M]=y.useState([]),[Z,H]=y.useState([]),[L,F]=y.useState([]),[O,J]=y.useState([]),[te,oe]=y.useState([]),ue=y.useCallback(async he=>{if(d==="feature-spec"){const ce=he.find(ve=>ve.type==="user-flow"),me=ce?await z.items(ce.id).then(ve=>ve.items).catch(()=>[]):[];M(me.filter(ve=>ve.kind==="flow"&&ve.status!=="rejected")),i&&z.projectReqs(i).then(ve=>H(ve.reqs)).catch(()=>{})}else if(d==="ia"){const ce=he.find(Te=>Te.type==="feature-spec"),me=ce?await z.items(ce.id).then(Te=>Te.items).catch(()=>[]):[];F(me.filter(Te=>Te.kind==="feature"&&Te.status!=="rejected"));const ve=he.find(Te=>Te.type==="user-flow"),De=ve?await z.items(ve.id).then(Te=>Te.items).catch(()=>[]):[];oe(De.filter(Te=>Te.status!=="rejected"))}else if(d==="user-flow"){const ce=he.find(ve=>ve.type==="ia"),me=ce?await z.items(ce.id).then(ve=>ve.items).catch(()=>[]):[];J(me.filter(ve=>ve.kind==="page"&&ve.status!=="rejected"))}},[d,i]),ge=y.useCallback(async()=>{const[he,ce]=await Promise.all([z.items(u).then(me=>me.items),z.suggestions(u,"open").then(me=>Array.isArray(me)?me:me.suggestions).catch(()=>[])]);h(he),x(ce)},[u]),Ee=y.useCallback(async()=>{g((await z.getDocument(u)).document),await ge(),i&&z.getProject(i).then(he=>{S(he),ue(he.documents)}).catch(()=>{})},[u,i,ge,ue]);y.useEffect(()=>(Ee().catch(he=>W(he.message)),()=>{var he;return(he=A.current)==null?void 0:he.close()}),[Ee]);function xe(){var he;W(""),k(!0),h([]),(he=A.current)==null||he.close(),A.current=Pm(u,{onItem:ce=>h(me=>[...me,ce]),onDone:()=>{k(!1),ge()},onError:ce=>{k(!1),W(ce||"생성 실패 · 설정에서 AI 키/CLI 를 확인하세요.")}})}async function q(he){await z.acceptItem(he),await ge()}async function le(he){await z.rejectItem(he),await ge()}async function X(he){await z.restoreItem(he),await ge()}async function _(he){await z.acceptSuggestion(he),await ge()}async function D(he){await z.rejectSuggestion(he),await ge()}async function ye(){i&&(await z.lintSuggest(i),await ge())}async function ke(){i&&(await z.lintWaiveAll(i),await ge())}async function we(he,ce){await z.linkFeatureToFlow(he,ce),j&&await ue(j.documents),await ge()}async function Se(he,ce){await z.unlinkFeatureFromFlow(he,ce),j&&await ue(j.documents),await ge()}async function Pe(he,ce,me,ve){await z.editLink(he,ce,me,ve),j&&await ue(j.documents),await ge()}async function Ne(he,ce){await z.setStepPage(he,ce),j&&await ue(j.documents),await ge()}async function B(he,ce){await z.setSection(he,ce),await ge()}const ie=v.length,pe=m.length===0&&!P,Ue=s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:`sug-count ${ie?"":"zero"}`,children:[s.jsx("i",{}),"제안 ",ie]}),s.jsx("button",{className:"btn",onClick:ye,children:"정합성 검사"}),s.jsx("button",{className:"btn",title:"모든 위반을 무시(내용은 그대로 유지). 게이트만 통과합니다.",onClick:ke,children:"위반 모두 무시"}),s.jsx("a",{className:"btn",href:`/api/documents/${u}/export.md`,children:"MD"}),s.jsx("a",{className:"btn",href:`/api/documents/${u}/export.html?print=1`,target:"_blank",rel:"noreferrer",title:"브라우저 인쇄 대화상자에서 'PDF로 저장'",children:"PDF"}),s.jsx("span",{className:"cmdk",children:"⌘K"})]}),nt=(()=>{if(P&&m.length===0)return s.jsxs("div",{className:"editor-inner",children:[s.jsx("div",{className:"eyebrow",children:Ed[d]}),s.jsx("h1",{className:"struct-h1",children:cr[d]}),s.jsxs("div",{className:"ch-strip",style:{marginTop:18},children:[s.jsx(Ke,{pose:"write",size:40}),s.jsxs("span",{children:[cr[d]," 구조를 제안받는 중이에요… 항목이 하나씩 채워집니다. (추론형 모델은 잠시 걸립니다)"]})]})]});if(pe)return s.jsxs("div",{className:"editor-inner",children:[s.jsx("div",{className:"eyebrow",children:Ed[d]}),s.jsx("h1",{className:"struct-h1",children:cr[d]}),s.jsx("div",{className:"dmeta",children:"아직 항목이 없습니다. 상위 문서에서 구조를 제안받으세요."}),s.jsxs("div",{className:"empty",style:{marginTop:18},children:[s.jsx(Ke,{pose:"write",size:64}),s.jsxs("div",{style:{marginTop:10},children:[s.jsx("b",{children:cr[d]})," 를 초안으로 제안받습니다. 번호는 서버가 매기고, 모든 항목은 수락 전까지 제안 상태입니다."]}),s.jsx("button",{className:"btn pri lg",style:{marginTop:14},onClick:xe,children:"구조 제안받기"})]}),$&&s.jsx("div",{className:"err",style:{marginTop:12},children:$})]});const he={items:m,selected:b,onSelect:w,onAccept:q,onReject:le,generating:P,onRegenerate:xe,onChanged:ge};return d==="feature-spec"?s.jsx(Ug,{...he,projectId:i,flows:Y,reqs:Z,onLinkFeature:we,onUnlinkFeature:Se,onEditLink:Pe}):d==="ia"?s.jsx(Vg,{...he,projectId:i,features:L,flowItems:te,onEditLink:Pe,onSetSection:B,onNavPage:ce=>a(`/projects/${i}/wireframes?focus=${ce}`)}):s.jsx(qg,{...he,pages:O,onSetStepPage:Ne})})();return s.jsx(xt,{crumb:s.jsxs(s.Fragment,{children:[s.jsx("b",{className:"name",children:(j==null?void 0:j.name)??"프로젝트"}),s.jsx("span",{className:"sep",children:"/"}),s.jsx("span",{children:cr[d]})]}),tbarRight:Ue,nav:j?s.jsx(ys,{projectId:i,projectName:j.name,documents:j.documents,active:Gg[d],activeCount:ie}):void 0,panel:s.jsx(Zg,{suggestions:v,onAccept:_,onReject:D,onSuggestLint:ye}),tagline:ie>0?`제안 ${ie} · 수락 전에는 내보내기에 포함되지 않습니다`:"수락하지 않은 항목은 문서에 없습니다",statusLeft:s.jsx("span",{children:f.status==="streaming"?"생성 중…":`항목 ${m.length}`}),statusRight:s.jsxs("span",{children:["v",f.version]}),children:s.jsxs("main",{className:"ed structure-ed",children:[P&&m.length>0&&s.jsxs("div",{className:"ch-strip",style:{margin:"0 0 12px"},children:[s.jsx(Ke,{pose:"write",size:34}),s.jsxs("span",{children:["구조를 제안받는 중… 항목 ",m.length,"개 도착"]})]}),nt,!pe&&!P&&s.jsx(Yg,{items:m,onRestore:X})]})})}function Yg({items:r,onRestore:i}){const[a,u]=y.useState(!1),[d,f]=y.useState(null),g=r.filter(h=>h.status==="rejected");if(g.length===0)return null;async function m(h){f(h);try{await i(h)}finally{f(null)}}return s.jsxs("div",{className:"rejected-bar",children:[s.jsxs("button",{className:"rejected-head",onClick:()=>u(h=>!h),children:[s.jsxs("span",{children:["제외된 항목 ",g.length,"개"]}),s.jsx("span",{className:"muted",children:a?"접기":"펼쳐서 되살리기"})]}),a&&s.jsx("div",{className:"rejected-list",children:g.map(h=>s.jsxs("div",{className:"rejected-row",children:[s.jsx("span",{className:"rid",children:h.ref_id}),s.jsx("span",{className:"rtitle",children:h.title}),s.jsx("button",{className:"btn sm",disabled:d===h.id,onClick:()=>m(h.id),children:"되살리기"})]},h.id))})]})}function Zg({suggestions:r,onAccept:i,onReject:a,onSuggestLint:u}){const d=r.length;return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"ph",children:["제안 ",s.jsx("span",{className:"cnt",children:d})]}),d===0?s.jsxs("div",{className:"panel-empty",children:[s.jsx(Ke,{pose:"wait",size:72}),"검토할 제안이 없어요.",s.jsx("br",{}),s.jsx("button",{className:"btn sm",style:{marginTop:10},onClick:u,children:"정합성 검사 실행"})]}):r.map(f=>f.kind==="lint"?s.jsxs("div",{className:"scard compile",children:[s.jsxs("div",{className:"sh",children:[s.jsx(Ke,{pose:"fetch",size:20,animate:!1}),s.jsx("b",{children:f.title}),s.jsx("span",{className:"lintcode",children:f.source})]}),s.jsx("p",{children:f.body}),s.jsxs("div",{className:"scard-acts",children:[s.jsx("button",{className:"a",onClick:()=>i(f.id),children:"수정 적용"}),s.jsx("button",{className:"r",onClick:()=>a(f.id),children:"무시"})]})]},f.id):s.jsxs("div",{className:"scard",children:[s.jsxs("div",{className:"sh",children:[s.jsx(Ke,{pose:"fetch",size:20,animate:!1}),s.jsx("b",{children:f.title}),s.jsxs("span",{className:"ssrc",children:["근거 ",f.source]})]}),s.jsx("p",{children:f.body}),s.jsxs("div",{className:"scard-acts",children:[s.jsx("button",{className:"a",onClick:()=>i(f.id),children:"수락"}),s.jsx("button",{className:"r",onClick:()=>a(f.id),children:"거절"})]})]},f.id))]})}function Xg({doc:r}){const{pid:i}=Sn(),[a,u]=y.useState(null),[d,f]=y.useState(null),[g,m]=y.useState(null),[h,v]=y.useState(null),[x,j]=y.useState(null),[S,P]=y.useState("interview"),[k,b]=y.useState(!1),[w,$]=y.useState(""),W=y.useCallback(async()=>{const L=await z.startInterview(r.id);if(f(L.session),m(L.template),i){z.getProject(i).then(u).catch(()=>{});const F=await z.designSystem(i).catch(()=>({record:null}));F.record&&(v(F.record),P("result"))}},[r.id,i]);y.useEffect(()=>{W().catch(L=>$(L.message))},[W]);async function A(){if(d){b(!0),$("");try{await z.completeInterview(d.id).catch(()=>{});const L=await z.generateDesignSystem(r.id);v(L.record),P("result")}catch(L){$(L.message||"디자인 시스템 생성에 실패했어요")}finally{b(!1)}}}async function Y(){const L=await z.acceptDesignSystem(r.id);v(L.record)}async function M(){if(d){b(!0),$("");try{await z.completeInterview(d.id).catch(()=>{});const L=await z.exploreDesignSystems(r.id);j(L.candidates),P("explore")}catch(L){$(L.message||"방향 탐색에 실패했어요")}finally{b(!1)}}}async function Z(L){const F=await z.selectDesignSystem(r.id,L);v(F.record),P("result")}const H=h==null?void 0:h.guide;return s.jsx(xt,{crumb:s.jsxs(s.Fragment,{children:[s.jsx("b",{className:"name",children:(a==null?void 0:a.name)??"프로젝트"}),s.jsx("span",{className:"sep",children:"/"}),s.jsx("span",{children:"디자인 시스템"})]}),nav:a?s.jsx(ys,{projectId:i,projectName:a.name,documents:a.documents,active:"DS"}):void 0,tagline:"인터뷰로 디자인 시스템을 설계 · 수락하면 와이어프레임·시안이 이 시스템으로 렌더",children:S==="interview"?s.jsx("main",{className:"interview-screen",children:s.jsxs("div",{className:"interview-inner",children:[s.jsx("div",{className:"eyebrow",children:"디자인 시스템 · 인터뷰"}),s.jsx("h1",{className:"struct-h1",children:"디자인 시스템 설계"}),s.jsx("div",{className:"dmeta",children:"색·타이포·간격·형태·컴포넌트·톤을 인터뷰로. 답 후 AI 가 시스템을 제안합니다."}),w&&s.jsx("div",{className:"genwarn",children:w}),d&&g?s.jsx(Jd,{template:g,session:d,streaming:k,onSaveAnswer:async L=>{const F=await z.answer(d.id,L);f(F)},onGenerate:A}):s.jsxs("div",{className:"empty",style:{marginTop:18},children:[s.jsx(Ke,{pose:"think",size:56})," 불러오는 중…"]}),s.jsx("div",{className:"ds-explore-cta",children:s.jsx("button",{className:"btn ghost sm",disabled:k,onClick:M,children:k?"탐색 중…":"또는 3가지 방향으로 탐색"})})]})}):S==="explore"?s.jsxs("main",{className:"ed wfwrap",children:[s.jsx("div",{className:"eyebrow",children:"디자인 시스템 · 방향 탐색"}),s.jsx("h1",{className:"struct-h1",children:"3가지 방향"}),s.jsx("div",{className:"dmeta",children:"강조색은 유지하고 성격만 다르게. 하나를 고르면 제안으로 확정됩니다."}),w&&s.jsx("div",{className:"genwarn",children:w}),s.jsx("div",{className:"ds-cands",children:(x??[]).map((L,F)=>s.jsxs("div",{className:"ds-cand",children:[s.jsx("div",{className:"ds-cand-tile",children:s.jsx("iframe",{srcDoc:L.styleTileHtml,sandbox:"",title:`방향 ${F+1}`,scrolling:"no"})}),s.jsx("p",{className:"ds-cand-r",children:L.rationale}),s.jsx("button",{className:"btn ok",onClick:()=>Z(F),children:"이 방향 선택"})]},F))}),s.jsx("div",{className:"ds-explore-cta",children:s.jsx("button",{className:"btn ghost sm",onClick:()=>P("interview"),children:"인터뷰로 돌아가기"})})]}):s.jsxs("main",{className:"ed wfwrap",children:[s.jsxs("div",{className:"eyebrow",children:["디자인 시스템 · ",(h==null?void 0:h.status)==="accepted"?"수락됨":"제안됨"]}),s.jsx("h1",{className:"struct-h1",children:"디자인 시스템"}),s.jsx("div",{className:"dmeta",children:(h==null?void 0:h.status)==="accepted"?"이 시스템이 와이어프레임·시안을 구동합니다.":"제안된 시스템입니다. 수락하면 와이어프레임·시안에 반영됩니다."}),w&&s.jsx("div",{className:"genwarn",children:w}),s.jsxs("div",{className:"ds-stage",children:[s.jsx("div",{className:"ds-tile",children:h&&s.jsx("iframe",{className:"ds-frame",srcDoc:h.styleTileHtml,sandbox:"",title:"디자인 시스템 스타일 타일"})}),s.jsxs("aside",{className:"ds-side",children:[s.jsxs("div",{className:"ds-rationale",children:[s.jsx("span",{className:"k",children:"설계 근거"}),s.jsx("p",{children:h==null?void 0:h.rationale})]}),H&&(h==null?void 0:h.system)&&s.jsxs("div",{className:"ds-tokens",children:[s.jsx("span",{className:"k",children:"토큰"}),s.jsxs("ul",{children:[s.jsxs("li",{children:["강조 ",s.jsx("code",{children:H.accent})," · 모드 ",s.jsx("b",{children:h.system.color.dark?h.system.color.primary==="dark"?"다크+라이트":"라이트+다크":H.mode})]}),s.jsxs("li",{children:["상태색 ",s.jsx("span",{className:"stdot",style:{background:h.system.color.state.success}}),s.jsx("span",{className:"stdot",style:{background:h.system.color.state.warning}}),s.jsx("span",{className:"stdot",style:{background:h.system.color.state.danger}}),s.jsx("span",{className:"stdot",style:{background:h.system.color.state.info}})]}),s.jsxs("li",{children:["타입 ",s.jsxs("b",{children:[h.system.type.scale.display,"/",h.system.type.scale.title,"/",h.system.type.scale.body,"/",h.system.type.scale.caption]}),"px"]}),s.jsxs("li",{children:["여백 4px 그리드 · 밀도 ",s.jsx("b",{children:H.density})," · 서체 ",s.jsx("b",{children:H.font})]}),s.jsxs("li",{children:["모서리 ",s.jsxs("b",{children:[H.radius,"px"]})," · 그림자 ",s.jsx("b",{children:h.system.shape.shadow})]}),(h.system.a11y.highContrast||h.system.a11y.colorblindSafe||h.system.a11y.notes)&&s.jsxs("li",{children:["접근성 ",s.jsx("b",{children:[h.system.a11y.highContrast&&"고대비",h.system.a11y.colorblindSafe&&"색맹안전"].filter(Boolean).join("·")||"지정"})]})]})]}),s.jsxs("div",{className:"ds-acts",children:[(h==null?void 0:h.status)!=="accepted"&&s.jsx("button",{className:"btn ok",onClick:Y,children:"수락 · 시스템으로 채택"}),s.jsx("button",{className:"btn",disabled:k,onClick:A,children:k?"생성 중…":"재생성"}),s.jsx("button",{className:"btn",disabled:k,onClick:M,children:"다른 방향 보기 (3안)"}),s.jsx("button",{className:"btn ghost",onClick:()=>P("interview"),children:"인터뷰 다시"})]})]})]})]})})}const ev=new Set(["feature-spec","ia","user-flow"]);function tv(){const{pid:r,did:i}=Sn(),[a,u]=y.useState(null),[d,f]=y.useState("");return y.useEffect(()=>{let g=!0;return u(null),f(""),z.getDocument(i).then(m=>g&&u(m.document)).catch(m=>g&&f(m.message)),()=>{g=!1}},[i]),d?s.jsx(xt,{crumb:s.jsx("span",{children:"오류"}),children:s.jsx("main",{className:"editor",children:s.jsx("div",{className:"center-empty err",children:d})})}):a?a.type==="handoff"?s.jsx(um,{to:`/projects/${r}/handoff`,replace:!0}):a.type==="design-system"?s.jsx(Xg,{doc:a},a.id):ev.has(a.type)?s.jsx(Jg,{doc:a},a.id):s.jsx(Bg,{}):s.jsx(xt,{crumb:s.jsx("span",{children:"불러오는 중…"}),children:s.jsx("main",{className:"editor",children:s.jsx("div",{className:"center-empty",children:"불러오는 중…"})})})}const nv={clean:"Clean",warm:"Warm",mono:"Mono",vivid:"Vivid",dark:"Dark"},sv={compact:"조밀",cozy:"보통",spacious:"여유"};function rv(){const{pid:r}=Sn(),[i]=Sm(),[a,u]=y.useState(null),[d,f]=y.useState([]),[g,m]=y.useState(!1),[h,v]=y.useState(null),[x,j]=y.useState(null),[S,P]=y.useState([]),[k,b]=y.useState({}),w=y.useCallback(async()=>{if(!r)return;const[M,Z,H,L]=await Promise.all([z.getProject(r),z.wireframes(r),z.styleGuide(r),z.mockups(r)]);u(M),f(Z.wireframes),v(H.guide),j(H.render),P(H.presets);const F={};for(const O of L.mockups)F[O.pageRef]=O.status;b(F)},[r]);y.useEffect(()=>{w().catch(()=>{})},[w]),y.useEffect(()=>{const M=i.get("focus");M&&$(M)},[i,d.length]);function $(M){const Z=document.getElementById(`wf-${M}`);Z&&(Z.scrollIntoView({behavior:"smooth",block:"center"}),Z.classList.add("wf-flash"),window.setTimeout(()=>Z.classList.remove("wf-flash"),900))}async function W(M){if(!r)return;const Z=await z.saveStyleGuide(r,M);v(Z.guide),j(Z.render)}const A=(M,Z)=>b(H=>{const L={...H};return Z?L[M]=Z:delete L[M],L}),Y=h&&x?{"--wf-accent":h.accent,"--wf-bg":h.bg,"--wf-surface":h.surface,"--wf-ink":h.ink,"--wf-sub":h.sub,"--wf-line":h.line,"--wf-radius":`${h.radius}px`,"--wf-font":x.fontStack,"--wf-gap":`${x.gap}px`}:{};return s.jsx(xt,{crumb:s.jsxs(s.Fragment,{children:[s.jsx("b",{className:"name",children:(a==null?void 0:a.name)??"프로젝트"}),s.jsx("span",{className:"sep",children:"/"}),s.jsx("span",{children:"와이어프레임"})]}),tbarRight:s.jsxs(s.Fragment,{children:[s.jsx("button",{className:`btn ${g?"ok":""}`,onClick:()=>m(M=>!M),children:g?"인터랙티브 켜짐":"인터랙티브 열기"}),s.jsx("span",{className:"cmdk",children:"⌘K"})]}),nav:a?s.jsx(ys,{projectId:r,projectName:a.name,documents:a.documents,active:"WF"}):void 0,tagline:"테마는 와이어프레임·시안 공용 · 시안(AI)은 옵트인 · 결정적 와이어프레임은 무료",children:s.jsxs("main",{className:"ed wfwrap",style:Y,children:[s.jsx("div",{className:"eyebrow",children:"WF · Wireframes → 시안"}),s.jsx("h1",{className:"struct-h1",children:"와이어프레임"}),s.jsxs("div",{className:"dmeta",children:["IA 수락분 ",d.length,"화면 · 결정적 와이어프레임(무료) + 테마 적용 · AI 시안은 화면별 옵트인"]}),h&&s.jsxs("div",{className:"wf-theme",children:[s.jsx("span",{className:"tk",children:"테마"}),s.jsx("div",{className:"tpresets",children:S.map(M=>s.jsx("button",{className:`tchip ${h.preset===M?"on":""}`,onClick:()=>W({preset:M}),children:nv[M]??M},M))}),s.jsx("label",{className:"tacc",title:"강조색",children:s.jsx("input",{type:"color",value:h.accent,onChange:M=>W({accent:M.target.value})})}),s.jsx("div",{className:"tseg",children:["compact","cozy","spacious"].map(M=>s.jsx("button",{className:h.density===M?"on":"",onClick:()=>W({density:M}),children:sv[M]},M))})]}),d.length===0?s.jsxs("div",{className:"empty",style:{marginTop:18},children:[s.jsx(Ke,{pose:"think",size:64}),s.jsxs("div",{style:{marginTop:10},children:["IA 화면을 수락하면 여기에 ",s.jsx("b",{children:"자동으로 렌더"}),"됩니다."]})]}):s.jsx("div",{className:"pgrid",children:d.map(M=>s.jsx(lv,{pid:r,wf:M,interactive:g,onHotspot:$,mockStatus:k[M.ref],onStatus:A},M.ref))})]})})}function lv({pid:r,wf:i,interactive:a,onHotspot:u,mockStatus:d,onStatus:f}){const[g,m]=y.useState(d?"mock":"wire"),[h,v]=y.useState(null),[x,j]=y.useState(!1),[S,P]=y.useState(null);y.useEffect(()=>{g==="mock"&&d&&h===null&&z.mockup(r,i.ref).then(W=>v(W.html)).catch(()=>{})},[g,d,h,r,i.ref]);async function k(){j(!0),P(null),m("mock");try{const W=await z.generateMockup(i.itemId);v(W.html),f(i.ref,"proposed")}catch(W){P(W.message||"시안 생성에 실패했어요")}finally{j(!1)}}async function b(){await z.acceptMockup(i.itemId),f(i.ref,"accepted")}async function w(){await z.rejectMockup(i.itemId),v(null),f(i.ref,void 0),m("wire")}const $=i.hotspot?s.jsx("span",{className:"hot",style:{cursor:a?"pointer":"default"},onClick:W=>{W.stopPropagation(),a&&i.hotspot&&u(i.hotspot.toPage)},children:i.hotspot.label}):null;return s.jsxs("div",{className:"proto",id:`wf-${i.ref}`,children:[s.jsxs("div",{className:"phead",children:[s.jsx("b",{children:i.ref})," ",i.title," ",s.jsx("span",{className:"typechip",children:i.pageType}),s.jsx("span",{className:"sp",style:{flex:1}}),s.jsxs("div",{className:"wf-toggle",children:[s.jsx("button",{className:g==="wire"?"on":"",onClick:()=>m("wire"),children:"와이어"}),s.jsxs("button",{className:g==="mock"?"on":"",onClick:()=>m("mock"),children:["시안",d==="accepted"?" ✓":""]})]})]}),g==="wire"?s.jsxs("div",{className:"papp themed",children:[s.jsx(iv,{wf:i,hot:$}),s.jsx("div",{className:`pstate ${i.lintWarning?"warn":""}`,children:i.lintWarning?`검사 위반 · ${i.lintWarning}`:`근거 ${i.featureRefs.join("·")||"—"}${i.flowRefs.length?" · 진입 "+i.flowRefs.join("·"):""}`})]}):x?s.jsxs("div",{className:"mockgen",children:[s.jsx(Ke,{pose:"fetch",size:44}),s.jsx("p",{children:s.jsx("b",{children:"시안 생성 중…"})}),s.jsx("span",{className:"mnote",children:"AI 가 이 화면을 테마에 맞춰 디자인합니다 · 최대 1분 정도 걸릴 수 있어요"})]}):S?s.jsxs("div",{className:"mockgen",children:[s.jsx("p",{className:"mockerr",children:"시안 생성에 실패했어요"}),s.jsx("span",{className:"mnote",children:S}),s.jsx("button",{className:"btn ok",onClick:k,children:"다시 시도"}),s.jsx("span",{className:"mnote",children:"설정(⌘,)의 AI 엔진에서 CLI 로그인 또는 API 키 상태를 확인하세요"})]}):h?s.jsxs("div",{className:"mockwrap",children:[s.jsx("iframe",{className:"mockframe",srcDoc:h,sandbox:"",title:`${i.ref} 시안`,loading:"lazy"}),s.jsxs("div",{className:"mockacts",children:[s.jsx("span",{className:`mstat ${d==="accepted"?"ok":""}`,children:d==="accepted"?"시안 수락됨":"제안된 시안"}),s.jsx("span",{className:"sp",style:{flex:1}}),d!=="accepted"&&s.jsx("button",{className:"btn ok sm",disabled:x,onClick:b,children:"수락"}),s.jsx("button",{className:"btn sm",disabled:x,onClick:k,children:"재생성"}),s.jsx("button",{className:"btn sm",disabled:x,onClick:w,children:"삭제"})]})]}):s.jsxs("div",{className:"mockgen",children:[s.jsx(Ke,{pose:"fetch",size:40,animate:!1}),s.jsxs("p",{children:["이 화면의 ",s.jsx("b",{children:"고해상도 시안"}),"을 테마에 맞춰 생성합니다."]}),s.jsx("button",{className:"btn ok",onClick:k,children:"시안 생성"}),s.jsx("span",{className:"mnote",children:"AI 사용 · 구조는 와이어프레임 탭에서 무료로 확인"})]})]})}function iv({wf:r,hot:i}){const a=r.seed;switch(r.pageType){case"LIST":return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"pnav",children:[r.title,s.jsx("span",{className:"navr",children:"목록"})]}),s.jsxs("div",{className:"pbody",children:[s.jsx("div",{className:"pinput",children:a.search??"검색"}),s.jsx("div",{className:"plist",children:(a.rows??[]).map((u,d)=>s.jsxs("div",{className:"plirow",children:[s.jsx("b",{children:u.title}),s.jsx("span",{className:"m",children:u.meta}),s.jsx("span",{className:"sp"}),s.jsxs("span",{className:"pbtn sm",children:[u.action,u.hot&&i]})]},d))})]})]});case"DETAIL":return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"pnav",children:[s.jsx("span",{className:"back",children:"‹"}),a.detailTitle??r.title]}),s.jsxs("div",{className:"pbody",children:[s.jsx("div",{className:"slotwrap",children:(a.slots??[]).map((u,d)=>s.jsx("span",{className:`slot ${u.state==="idle"?"":u.state}`,children:u.label},d))}),(a.blocks??[]).map((u,d)=>s.jsx("div",{className:"pinput",children:u},d)),s.jsxs("div",{className:"pbtn",children:[a.cta??"확인",i]})]})]});case"FORM":return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"pnav",children:[s.jsx("span",{className:"back",children:"‹"}),r.title]}),s.jsxs("div",{className:"pbody",children:[(a.fields??[]).map((u,d)=>s.jsxs("div",{className:"ffield",children:[s.jsx("span",{className:"lb2",children:u.label}),s.jsx("div",{className:"pinput",children:u.value})]},d)),s.jsxs("div",{className:"pbtn",children:[a.cta??"저장",i]})]})]});case"DASH":return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"pnav",children:[r.title,s.jsx("span",{className:"navr",children:"이번 주"})]}),s.jsxs("div",{className:"pbody",children:[s.jsx("div",{className:"statrow",children:(a.stats??[]).map((u,d)=>s.jsxs("div",{className:"stat",children:[s.jsx("div",{className:"sv",children:u.value}),s.jsx("div",{className:"sl",children:u.label})]},d))}),s.jsx("div",{className:"chart",children:(a.bars??[]).map((u,d)=>s.jsx("i",{style:{height:`${u}%`}},d))})]})]});case"SETTINGS":return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"pnav",children:[s.jsx("span",{className:"back",children:"‹"}),r.title]}),s.jsx("div",{className:"pbody",children:(a.toggles??[]).map((u,d)=>s.jsxs("div",{className:"tgl",children:[u.label,s.jsx("span",{className:"sp"}),s.jsx("span",{className:`sw ${u.on?"":"off"}`})]},d))})]});default:return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"pnav",children:r.title}),s.jsxs("div",{className:"pbody",children:[(a.blocks??[r.title]).map((u,d)=>s.jsx("div",{className:"sk block",children:s.jsx("span",{style:{fontSize:10,color:"var(--sub)",padding:"4px 8px",display:"block"},children:u})},d)),s.jsxs("div",{className:"pbtn",children:["열기",i]})]})]})}}const av=[["E-BROKEN-REF","참조 무결성 (기능→요구, 스텝→화면)"],["E-DUP-REF","중복 번호 없음"],["W-ORPHAN-SPEC","고아 기능 없음"],["W-UNREACHED-PAGE","미도달 화면 없음"],["W-EMPTY-PAGE","빈 화면 없음"],["W-NO-FLOW","P0 기능 플로우 연결"]];function ov(){const{pid:r}=Sn(),[i,a]=y.useState(null),[u,d]=y.useState(null),[f,g]=y.useState(null),[m,h]=y.useState([]),[v,x]=y.useState([]),[j,S]=y.useState(!1),[P,k]=y.useState(""),[b,w]=y.useState(""),$=y.useCallback(async()=>{if(!r)return;const[L,F]=await Promise.all([z.getProject(r),z.hub(r)]);a(L),d(F.lint);const O=F.derived.handoff.documentId;if(g(O),O){const J=await z.getDocument(O);h(J.sections);const te=await z.suggestions(O,"open").then(oe=>Array.isArray(oe)?oe:oe.suggestions).catch(()=>[]);x(te)}else h([]),x([])},[r]);y.useEffect(()=>{$().catch(L=>k(L.message))},[$]);async function W(){if(!(!r||j)){S(!0),k("");try{await z.compileHandoff(r),await $()}catch(L){k(L.message||"검사 위반이 남아 있어요.")}finally{S(!1)}}}async function A(L){await z.acceptSuggestion(L),await $()}async function Y(){if(!f)return;const L=await z.createShare(f,null);w(L.url)}const M=(u==null?void 0:u.gatePasses)??!1;function Z(L){const F=(u==null?void 0:u.violations.filter(J=>J.code===L&&!J.waived).length)??0,O=(u==null?void 0:u.violations.filter(J=>J.code===L&&J.waived).length)??0;return F>0?{ok:!1,text:`위반 ${F}`}:O>0?{ok:!0,text:`통과 · 무시 ${O}`}:{ok:!0,text:"통과"}}const H=s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"ph",children:["제안 ",v.length]}),v.length===0?s.jsxs("div",{className:"panel-empty",children:[s.jsx(Ke,{pose:"wait",size:72}),f?"지시서가 확정되었어요.":"검사를 통과하면 지시서를 컴파일할 수 있어요."]}):v.map(L=>s.jsxs("div",{className:"scard",children:[s.jsxs("div",{className:"sh",children:[s.jsx(Ke,{pose:"fetch",size:20,animate:!1}),s.jsx("b",{children:L.title}),s.jsx("span",{className:"ssrc",children:L.source})]}),s.jsx("p",{children:L.body}),s.jsx("div",{className:"scard-acts",children:s.jsx("button",{className:"a",onClick:()=>A(L.id),children:"수락"})})]},L.id))]});return s.jsx(xt,{crumb:s.jsxs(s.Fragment,{children:[s.jsx("b",{className:"name",children:(i==null?void 0:i.name)??"프로젝트"}),s.jsx("span",{className:"sep",children:"/"}),s.jsx("span",{children:"개발 지시서"})]}),tbarRight:s.jsxs(s.Fragment,{children:[s.jsx("a",{className:"btn",href:`/api/projects/${r}/handoff/tickets.md`,title:"수락된 기능을 GitHub 체크리스트(개발 티켓)로 내보내기",children:"개발 티켓"}),f&&s.jsxs(s.Fragment,{children:[s.jsx("a",{className:"btn",href:`/api/documents/${f}/export.html?print=1`,target:"_blank",rel:"noreferrer",title:"브라우저 인쇄 대화상자에서 'PDF로 저장'",children:"PDF"}),s.jsx("a",{className:"btn pri",href:z.promptPackHref(r),children:"프롬프트 팩 내보내기"})]}),s.jsx("span",{className:"cmdk",children:"⌘K"})]}),nav:i?s.jsx(ys,{projectId:r,projectName:i.name,documents:i.documents,active:"DEV"}):void 0,panel:f?H:void 0,tagline:"수락하지 않은 항목은 지시서에 없습니다",children:s.jsx("main",{className:"ed",children:s.jsxs("div",{className:"editor-inner",children:[s.jsx("div",{className:"eyebrow",children:"DEV · Handoff — Compiled"}),s.jsx("h1",{className:"struct-h1",children:"개발 지시서"}),s.jsx("div",{className:"dmeta",children:"수락분 전체에서 컴파일 · 검사 통과가 생성 조건"}),av.map(([L,F])=>{const O=Z(L);return s.jsxs("div",{className:"check",children:[s.jsx("span",{className:"cid",children:L}),s.jsx("span",{className:"rt",children:F}),s.jsx("span",{className:O.ok?"cok":"cwarn",children:O.text})]},L)}),P&&s.jsx("div",{className:"err",style:{marginTop:12},children:P}),!f&&s.jsxs("div",{className:"hoact",style:{marginTop:18},children:[s.jsx("button",{className:"btn pri lg",disabled:!M||j,onClick:W,children:M?"지시서 생성":"검사 위반 해소 필요"}),!M&&s.jsx("span",{className:"hint",children:"위반을 수정하거나 무시(waive)하면 생성됩니다"})]}),f&&m.map(L=>s.jsxs("div",{className:`hosec ${L.status==="proposed"?"proposed":""}`,children:[s.jsx("div",{className:"hohead",children:L.heading}),s.jsx("div",{className:"hobody",children:L.body})]},L.id)),f&&s.jsxs("div",{className:"hoact",style:{marginTop:16},children:[s.jsx("a",{className:"btn pri",href:z.promptPackHref(r),children:"Claude Code로 발주"}),s.jsx("a",{className:"btn",href:`/api/documents/${f}/export.md`,children:"Markdown"}),s.jsx("button",{className:"btn",onClick:Y,children:"공유 링크"}),s.jsx("button",{className:"btn",onClick:W,disabled:j,children:"재컴파일"}),s.jsx("span",{className:"hint",children:"수락하지 않은 항목은 지시서에 없습니다"})]}),b&&s.jsxs("div",{className:"mini-card",style:{marginTop:10},children:[s.jsx("span",{className:"mono",children:"공유 링크: "}),s.jsx("a",{className:"mono",href:b,target:"_blank",rel:"noreferrer",children:b})]})]})})})}function Rl(r){const i=(r||"").toLowerCase();return/찾지 못|not found|미감지|no such|실행 실패|enoent/.test(i)?{cause:"claude CLI 를 못 찾았습니다",action:"claude 를 설치·로그인하거나, 설정에서 claude 전체 경로를 지정하세요. 안 되면 API 키(BYOK)로 전환하는 게 빠릅니다."}:/oauth|session expired|not logged|log ?in|authenticat|credential|invalid api key|unauthorized/.test(i)?{cause:"로그인 세션을 읽지 못했습니다 (만료 또는 앱이 키체인 접근 불가)",action:"터미널에서 claude 로그인 상태를 확인하세요. 앱을 파일 복사로 설치했다면 정식(공증) 인스톨러로 재설치가 확실합니다. 급하면 API 키(BYOK)로 전환."}:/disabled|subscription access|organization|blocked|api key instead|403|401/.test(i)?{cause:"조직이 Claude Code 구독 접근을 막았을 수 있습니다",action:"API 키(BYOK)로 전환해 Anthropic/OpenRouter 키를 등록하세요."}:/시간 초과|timeout|timed out/.test(i)?{cause:"응답이 지연됐습니다",action:"네트워크·로그인 상태를 확인하고 다시 시도하세요."}:{cause:"구독 엔진을 쓸 수 없습니다",action:"API 키(BYOK)로 전환하거나 claude 설치·로그인 상태를 확인하세요."}}const Pd=["anthropic","openai","openrouter"],cv=["prd","feature-spec","ia","user-flow"],uv={prd:"PRD","feature-spec":"기능명세",ia:"IA","user-flow":"유저플로우","design-system":"디자인 시스템",handoff:"지시서"};function dv(){const{reload:r,meta:i}=zl(),[a,u]=y.useState([]),[d,f]=y.useState({}),[g,m]=y.useState({}),[h,v]=y.useState({}),[x,j]=y.useState(""),[S,P]=y.useState(Kd()),[k,b]=y.useState(""),[w,$]=y.useState(""),[W,A]=y.useState(""),[Y,M]=y.useState(""),[Z,H]=y.useState(""),[L,F]=y.useState(""),[O,J]=y.useState(""),[te,oe]=y.useState([]),[ue,ge]=y.useState([]),[Ee,xe]=y.useState(""),q=Array.from(new Set([...te,...ue]));async function le(){u(await z.keys())}y.useEffect(()=>{le().catch(()=>{}),z.settings().then(B=>v(B.providerModels??{})).catch(()=>{})},[]),y.useEffect(()=>{A((i==null?void 0:i.agentBinPath)??"")},[i==null?void 0:i.agentBinPath]),y.useEffect(()=>{H((i==null?void 0:i.openaiBaseUrl)??""),i!=null&&i.openaiBaseUrl&&z.openaiModels().then(B=>oe(B.models??[])).catch(()=>{})},[i==null?void 0:i.openaiBaseUrl]),y.useEffect(()=>{a.some(B=>B.provider==="openrouter")&&z.openrouterModels().then(B=>ge(B.models??[])).catch(()=>{})},[a]);function X(B){const ie={};for(const pe of B.split(`
|
|
125
|
+
`)){const Ue=pe.indexOf(":");if(Ue<=0)continue;const nt=pe.slice(0,Ue).trim(),he=pe.slice(Ue+1).trim();nt&&he&&(ie[nt]=he)}return ie}async function _(){var B;J("저장·감지 중…");try{const ie=X(L),pe=await z.saveOpenaiEndpoint(Z.trim(),ie);await r(),pe.baseUrl&&H(pe.baseUrl),oe(pe.models??[]),Z.trim()?pe.detected==="no-key"?J("저장됨 · openai 키를 먼저 등록하면 경로 자동 감지·모델 목록을 불러옵니다"):(B=pe.models)!=null&&B.length?J(`저장됨 · 경로 자동 감지(${pe.detected}) · 모델 ${pe.models.length}개 불러옴`):J("저장됨 · 모델 목록을 못 불러왔습니다(키·주소 확인)"):J("게이트웨이 해제됨 · 표준 OpenAI 사용")}catch(ie){J(`실패 · ${ie.message}`)}setTimeout(()=>J(""),4e3)}async function D(B){const ie=(d[B]??"").trim();if(!ie)return;m(Ue=>({...Ue,[B]:"저장 중…"})),await z.saveKey(B,ie),f(Ue=>({...Ue,[B]:""})),await le(),await r();const pe=await z.testKey(B);m(Ue=>({...Ue,[B]:pe.ok?"연결 성공":`실패 · ${pe.detail??""}`}))}async function ye(B){m(pe=>({...pe,[B]:"테스트 중…"}));const ie=await z.testKey(B);m(pe=>({...pe,[B]:ie.ok?"연결 성공":`실패 · ${ie.detail??""}`}))}async function ke(B){await z.deleteKey(B),await le(),await r()}function we(B,ie,pe){v(Ue=>({...Ue,[B]:{...Ue[B],[ie]:ie==="maxTokens"?Number(pe)||void 0:pe||void 0}}))}async function Se(){await z.saveModels(h),j("저장됨"),setTimeout(()=>j(""),1500)}const Pe=B=>B==="연결 성공";async function Ne(B){if(confirm("복원하면 현재 워크스페이스가 이 백업으로 완전히 교체됩니다. 계속할까요?")){xe("복원 중…");try{const ie=await new Promise((pe,Ue)=>{const nt=new FileReader;nt.onload=()=>pe(String(nt.result).split(",")[1]??""),nt.onerror=()=>Ue(new Error("파일을 읽지 못했습니다")),nt.readAsDataURL(B)});await z.restore(ie),xe("복원 완료 · 새로고침합니다…"),setTimeout(()=>window.location.assign("/"),900)}catch(ie){xe(`실패 · ${ie.message}`)}}}return s.jsx(xt,{crumb:s.jsxs(s.Fragment,{children:[s.jsx(Dn,{to:"/",children:s.jsx($l,{})}),s.jsx("span",{className:"sep",children:"/"}),s.jsx("b",{children:"설정"})]}),tbarRight:s.jsx("span",{className:"cmdk",children:"⌘K"}),tagline:"키는 서버에 암호화되어 저장됩니다 · 평문은 저장되지 않습니다",statusRight:s.jsxs("span",{children:["v",(i==null?void 0:i.version)??"…"]}),children:s.jsx("main",{className:"settings",children:s.jsxs("div",{className:"settings-inner",children:[s.jsx("div",{className:"eyebrow",style:{fontFamily:"var(--mono)",fontSize:10,letterSpacing:"0.16em",color:"var(--sub)",marginBottom:8,textTransform:"uppercase"},children:"설정"}),s.jsx("h1",{children:"설정"}),s.jsx("div",{className:"rows",style:{marginBottom:14},children:s.jsxs("div",{className:"row",children:[s.jsx(Dn,{className:"btn",to:"/templates",children:"템플릿 라이브러리 편집"}),s.jsx("span",{className:"muted",style:{fontSize:12},children:"인터뷰 질문·섹션·지침을 문서 유형별로 커스터마이즈"})]})}),s.jsx("h3",{children:"AI 엔진"}),s.jsx("p",{className:"subtle",children:"Claude Code(구독)는 API 키 없이 로컬 CLI 로 생성합니다. docker 등 CLI 가 없는 환경에서는 API 키(BYOK)를 사용하세요."}),s.jsxs("div",{className:"rows",children:[s.jsxs("div",{className:"row",style:{flexWrap:"wrap"},children:[s.jsxs("label",{className:"opt",children:[s.jsx("input",{type:"radio",name:"aiMode",checked:(i==null?void 0:i.aiMode)==="cli",disabled:!(i!=null&&i.cliAvailable),onChange:async()=>{await z.setAiMode("cli"),await r()}}),"Claude Code (구독",i!=null&&i.cliAvailable?"":" · CLI 미감지",")"]}),s.jsxs("label",{className:"opt",children:[s.jsx("input",{type:"radio",name:"aiMode",checked:(i==null?void 0:i.aiMode)==="byok",onChange:async()=>{await z.setAiMode("byok"),await r()}}),"API 키 (BYOK)"]}),s.jsx("button",{className:"btn",onClick:async()=>{b("테스트 중…"),$("");try{const B=await z.testCli();B.ok?b("연결 성공 · 구독 엔진 사용 가능"):(b(""),$(B.detail||"연결 실패"))}catch(B){b(""),$(B.message||"연결 실패")}},children:"CLI 테스트"}),k&&s.jsx("span",{className:"muted",style:{fontSize:12},children:k})]}),w&&s.jsxs("div",{className:"cli-help",role:"alert",children:[s.jsxs("b",{children:["구독(CLI) 연결 실패 — ",Rl(w).cause]}),s.jsx("p",{children:Rl(w).action}),s.jsxs("div",{className:"cli-help-acts",children:[s.jsx("button",{className:"btn ok sm",onClick:async()=>{await z.setAiMode("byok"),$(""),await r()},children:"API 키(BYOK)로 전환"}),s.jsxs("details",{children:[s.jsx("summary",{children:"원문 보기"}),s.jsx("code",{children:w})]})]})]}),s.jsxs("div",{className:"row",style:{flexWrap:"wrap",gap:8},children:[s.jsx("span",{className:"muted",style:{fontSize:12,width:"100%"},children:i!=null&&i.cliBin?`감지된 CLI: ${i.cliBin}`:"CLI 미감지 · nvm/fnm 등 비표준 경로면 아래에 claude 전체 경로를 직접 지정하세요"}),s.jsx("input",{className:"input",style:{flex:1,minWidth:260,fontFamily:"var(--mono, monospace)",fontSize:12},placeholder:"예: /Users/you/.nvm/versions/node/v22.14.0/bin/claude",value:W,onChange:B=>A(B.target.value)}),s.jsx("button",{className:"btn",onClick:async()=>{M("저장 중…");const B=await z.setAgentBin(W.trim());await r(),M(B.cliAvailable?`적용됨 · ${B.cliBin??""}`:"경로에서 claude 를 찾지 못했습니다")},children:"경로 적용"}),W&&s.jsx("button",{className:"btn ghost",onClick:async()=>{A(""),await z.setAgentBin(""),await r(),M("해제됨 · 자동 탐색으로 복귀")},children:"해제"}),Y&&s.jsx("span",{className:"muted",style:{fontSize:12,width:"100%"},children:Y})]})]}),s.jsx("h3",{children:"실행 시 착지"}),s.jsx("p",{className:"subtle",children:"앱을 열 때 어디에 착지할지 정합니다."}),s.jsx("div",{className:"rows",children:s.jsxs("div",{className:"row",children:[s.jsxs("label",{className:"opt",children:[s.jsx("input",{type:"radio",name:"openMode",checked:S==="start",onChange:()=>{xd("start"),P("start")}}),"시작 화면 (기본)"]}),s.jsxs("label",{className:"opt",children:[s.jsx("input",{type:"radio",name:"openMode",checked:S==="resume",onChange:()=>{xd("resume"),P("resume")}}),"마지막 문서로 이어서"]})]})}),s.jsx("h3",{children:"AI 제공자 키 (BYOK)"}),s.jsx("p",{className:"subtle",children:"키는 서버에 AES-256-GCM으로 암호화되어 저장됩니다. 평문은 저장되지 않습니다."}),s.jsx("div",{className:"rows",children:Pd.map(B=>{const ie=a.find(pe=>pe.provider===B);return s.jsxs("div",{className:"row",style:{flexWrap:"wrap"},children:[s.jsx("b",{style:{width:100},children:B}),ie!=null&&ie.configured?s.jsxs("span",{className:"ok",children:["등록됨 ····",ie.last4]}):s.jsx("span",{className:"muted",children:"미등록"}),s.jsx("input",{className:"field grow",type:"password",placeholder:"새 키 입력 (교체 시)",value:d[B]??"",onChange:pe=>f(Ue=>({...Ue,[B]:pe.target.value}))}),s.jsx("button",{className:"btn",disabled:!(d[B]??"").trim(),onClick:()=>D(B),children:"저장"}),s.jsx("button",{className:"btn",disabled:!(ie!=null&&ie.configured),onClick:()=>ye(B),children:"테스트"}),s.jsx("button",{className:"btn danger",disabled:!(ie!=null&&ie.configured),onClick:()=>ke(B),children:"삭제"}),g[B]&&s.jsx("span",{className:Pe(g[B])?"ok":"err",style:{width:"100%"},children:g[B]})]},B)})}),s.jsx("div",{className:"divider"}),s.jsx("h3",{children:"OpenAI 호환 게이트웨이 (선택)"}),s.jsxs("p",{className:"subtle",children:["LiteLLM·Azure·사내 프록시 등 OpenAI 호환 엔드포인트를 쓰려면 base URL 을 넣으세요. 비워두면 표준 OpenAI 를 사용합니다. 키는 위 ",s.jsx("b",{children:"openai"})," 칸에 게이트웨이 키를 등록하고, 아래 모델 칸에 게이트웨이가 제공하는 모델 id 를 지정하세요."]}),s.jsxs("div",{className:"rows",children:[s.jsxs("div",{className:"row",style:{flexWrap:"wrap"},children:[s.jsx("b",{style:{width:100},children:"base URL"}),s.jsx("input",{className:"field grow",placeholder:"예: https://gateway.example.com/v1 (비우면 표준 OpenAI)",value:Z,onChange:B=>H(B.target.value)}),s.jsx("button",{className:"btn pri",onClick:_,children:"저장"}),O&&s.jsx("span",{className:O.startsWith("실패")?"err":"ok",style:{width:"100%"},children:O})]}),s.jsxs("div",{className:"row",style:{flexWrap:"wrap"},children:[s.jsx("b",{style:{width:100},children:"추가 헤더"}),s.jsx("textarea",{className:"field grow",rows:2,style:{resize:"vertical",fontFamily:"var(--mono)",fontSize:12},placeholder:"선택 · 한 줄에 하나: 예) X-My-Header: value (표준 Bearer 는 자동 전송)",value:L,onChange:B=>F(B.target.value)})]}),te.length>0&&s.jsx("div",{className:"row",children:s.jsxs("span",{className:"muted",style:{fontSize:12},children:["이 게이트웨이 모델 ",te.length,"개: ",te.join(", ")," · 아래 모델 칸에서 드롭다운으로 고르세요."]})})]}),ue.length>0&&s.jsx("div",{className:"row",children:s.jsxs("span",{className:"muted",style:{fontSize:12},children:["OpenRouter 사용 가능 모델 ",ue.length,"개 · 아래 모델 칸에서 드롭다운으로 고르세요."]})}),q.length>0&&s.jsx("datalist",{id:"gw-models",children:q.map(B=>s.jsx("option",{value:B},B))}),s.jsx("div",{className:"divider"}),s.jsx("h3",{children:"문서 유형별 모델 · 토큰 예산 (SPEC-19)"}),s.jsx("p",{className:"subtle",children:"비워두면 기본값을 사용합니다. 다음 AI 호출부터 적용됩니다."}),s.jsx("div",{className:"rows",children:["default",...cv].map(B=>{const ie=h[B]??{};return s.jsxs("div",{className:"row",style:{flexWrap:"wrap"},children:[s.jsx("b",{style:{width:100},children:B==="default"?"기본값":uv[B]}),s.jsxs("select",{className:"field",style:{maxWidth:150},value:ie.provider??"",onChange:pe=>we(B,"provider",pe.target.value),children:[s.jsx("option",{value:"",children:"(기본 제공자)"}),Pd.map(pe=>s.jsx("option",{value:pe,children:pe},pe))]}),s.jsx("input",{className:"field grow",list:q.length?"gw-models":void 0,placeholder:q.length?"목록에서 선택하거나 직접 입력":"모델 id (예: anthropic/claude-sonnet-4.6)",value:ie.model??"",onChange:pe=>we(B,"model",pe.target.value)}),s.jsx("input",{className:"field",style:{maxWidth:130},type:"number",placeholder:"max tokens",value:ie.maxTokens??"",onChange:pe=>we(B,"maxTokens",pe.target.value)})]},B)})}),s.jsxs("div",{className:"new-row",style:{marginTop:12,maxWidth:300},children:[s.jsx("button",{className:"btn pri",onClick:Se,children:"모델 설정 저장"}),x&&s.jsx("span",{className:"ok",style:{alignSelf:"center"},children:x})]}),s.jsx("div",{className:"divider"}),s.jsx("h3",{children:"워크스페이스 백업 · 복원"}),s.jsxs("p",{className:"subtle",children:["전체 데이터(프로젝트·문서·제안·설정)를 한 파일로 내려받고, 다른 기기로 옮기거나 위험한 작업 전에 대비하세요. ",s.jsx("b",{children:"복원은 현재 워크스페이스를 통째로 교체"}),"합니다."]}),s.jsx("div",{className:"rows",children:s.jsxs("div",{className:"row",style:{flexWrap:"wrap"},children:[s.jsx("a",{className:"btn",href:z.backupHref,download:!0,children:"백업 내려받기"}),s.jsxs("label",{className:"btn",style:{cursor:"pointer"},children:["복원(파일 선택)",s.jsx("input",{type:"file",accept:".sqlite,application/octet-stream",style:{display:"none"},onChange:B=>{var pe;const ie=(pe=B.target.files)==null?void 0:pe[0];ie&&Ne(ie),B.target.value=""}})]}),Ee&&s.jsx("span",{className:Ee.startsWith("실패")?"err":"ok",style:{width:"100%"},children:Ee})]})})]})})})}const fv=["prd","feature-spec","ia","user-flow"],pv={file:"기본",custom:"커스텀",override:"수정됨"};function hv(){return{id:"",docType:"prd",name:"",description:"",questions:[{id:"q1",prompt:"",hint:"",example:""}],sections:["개요"],draftGuidance:"명확한 기획 문서를 작성한다. 한국어로 작성한다.",source:"custom"}}function mv(){const[r,i]=y.useState([]),[a,u]=y.useState(null),[d,f]=y.useState(!1),[g,m]=y.useState("");async function h(){i(await z.templates())}y.useEffect(()=>{h().catch(()=>{})},[]);function v(k){u(JSON.parse(JSON.stringify(k))),f(!1),m("")}function x(){u(hv()),f(!0),m("")}function j(k){u(b=>b&&{...b,...k})}async function S(){if(a){m("저장 중…");try{const k=await z.saveTemplate(a);m("저장됨 · 다음 인터뷰부터 적용됩니다"),await h(),u(k),f(!1)}catch(k){m(`실패 · ${k.message}`)}}}async function P(){if(a&&confirm("이 템플릿의 커스텀 내용을 지웁니다. (기본 템플릿이 있으면 기본으로 복귀)"))try{const k=await z.deleteTemplate(a.id);await h(),u(k.reverted??null),m("되돌렸습니다")}catch(k){m(`실패 · ${k.message}`)}}return s.jsx(xt,{crumb:s.jsxs(s.Fragment,{children:[s.jsx(Dn,{to:"/",children:s.jsx($l,{})}),s.jsx("span",{className:"sep",children:"/"}),s.jsx("b",{children:"템플릿 라이브러리"})]}),tbarRight:s.jsx("span",{className:"cmdk",children:"⌘K"}),tagline:"인터뷰 질문·섹션·지침을 문서 유형별로 커스터마이즈 — 파일은 건드리지 않고 앱에 저장됩니다",children:s.jsx("main",{className:"settings",children:s.jsxs("div",{className:"tpl-wrap",children:[s.jsxs("aside",{className:"tpl-list",children:[s.jsxs("div",{className:"tpl-list-head",children:[s.jsx("b",{children:"템플릿"}),s.jsx("button",{className:"btn sm",onClick:x,children:"+ 새로"})]}),r.map(k=>s.jsxs("button",{className:`tpl-row ${(a==null?void 0:a.id)===k.id&&!d?"active":""}`,onClick:()=>v(k),children:[s.jsx("span",{className:"tpl-name",children:k.name}),s.jsxs("span",{className:"tpl-meta",children:[k.docType," · 질문 ",k.questions.length]}),k.source&&k.source!=="file"&&s.jsx("span",{className:"tpl-src",children:pv[k.source]})]},k.id))]}),s.jsx("section",{className:"tpl-edit",children:a?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"tpl-form-head",children:[s.jsx("h3",{children:d?"새 템플릿":a.name||a.id}),a.source&&a.source!=="file"&&!d&&s.jsx("button",{className:"btn sm danger",onClick:P,children:"기본으로 되돌리기"})]}),s.jsxs("label",{className:"lbl",children:["ID ",d?"(소문자·숫자·하이픈)":""]}),s.jsx("input",{className:"field",value:a.id,disabled:!d,placeholder:"예: prd-lean",onChange:k=>j({id:k.target.value})}),s.jsxs("div",{className:"tpl-2col",children:[s.jsxs("div",{children:[s.jsx("label",{className:"lbl",children:"이름"}),s.jsx("input",{className:"field",value:a.name,onChange:k=>j({name:k.target.value})})]}),s.jsxs("div",{children:[s.jsx("label",{className:"lbl",children:"문서 유형"}),s.jsx("select",{className:"field",value:a.docType,onChange:k=>j({docType:k.target.value}),children:fv.map(k=>s.jsx("option",{value:k,children:k},k))})]})]}),s.jsx("label",{className:"lbl",children:"설명"}),s.jsx("input",{className:"field",value:a.description,onChange:k=>j({description:k.target.value})}),s.jsx("label",{className:"lbl",children:"생성 지침 (system prompt)"}),s.jsx("textarea",{className:"field",rows:3,style:{resize:"vertical"},value:a.draftGuidance,onChange:k=>j({draftGuidance:k.target.value})}),s.jsx("label",{className:"lbl",children:"섹션 (초안이 만들 순서)"}),a.sections.map((k,b)=>s.jsxs("div",{className:"tpl-inline",children:[s.jsx("input",{className:"field",value:k,onChange:w=>{const $=[...a.sections];$[b]=w.target.value,j({sections:$})}}),s.jsx("button",{className:"btn sm",onClick:()=>j({sections:a.sections.filter((w,$)=>$!==b)}),children:"×"})]},b)),s.jsx("button",{className:"btn sm",onClick:()=>j({sections:[...a.sections,"새 섹션"]}),children:"+ 섹션"}),s.jsx("label",{className:"lbl",style:{marginTop:14},children:"인터뷰 질문"}),a.questions.map((k,b)=>s.jsxs("div",{className:"tpl-q",children:[s.jsxs("div",{className:"tpl-inline",children:[s.jsx("input",{className:"field",style:{maxWidth:90},placeholder:"id",value:k.id,onChange:w=>{const $=[...a.questions];$[b]={...k,id:w.target.value},j({questions:$})}}),s.jsx("input",{className:"field",placeholder:"질문",value:k.prompt,onChange:w=>{const $=[...a.questions];$[b]={...k,prompt:w.target.value},j({questions:$})}}),s.jsx("button",{className:"btn sm",onClick:()=>j({questions:a.questions.filter((w,$)=>$!==b)}),children:"×"})]}),s.jsxs("div",{className:"tpl-inline",children:[s.jsx("input",{className:"field",placeholder:"힌트(선택)",value:k.hint??"",onChange:w=>{const $=[...a.questions];$[b]={...k,hint:w.target.value},j({questions:$})}}),s.jsx("input",{className:"field",placeholder:"예시(선택)",value:k.example??"",onChange:w=>{const $=[...a.questions];$[b]={...k,example:w.target.value},j({questions:$})}})]})]},b)),s.jsx("button",{className:"btn sm",onClick:()=>j({questions:[...a.questions,{id:`q${a.questions.length+1}`,prompt:""}]}),children:"+ 질문"}),s.jsxs("div",{className:"tpl-save",children:[s.jsx("button",{className:"btn pri",onClick:S,children:"저장"}),g&&s.jsx("span",{className:g.startsWith("실패")?"err":"ok",children:g})]})]}):s.jsxs("div",{className:"muted",style:{padding:24},children:["왼쪽에서 템플릿을 고르거나 ",s.jsx("b",{children:"+ 새로"})," 를 눌러 만드세요."]})})]})})})}const gv=[{id:"anthropic",name:"Anthropic",placeholder:"sk-ant-…",hint:"console.anthropic.com"},{id:"openai",name:"OpenAI",placeholder:"sk-…",hint:"platform.openai.com"},{id:"openrouter",name:"OpenRouter",placeholder:"sk-or-…",hint:"openrouter.ai/keys"}];function vv({onDone:r}){const{meta:i}=zl(),[a,u]=y.useState(0),[d,f]=y.useState([]),[g,m]=y.useState({}),[h,v]=y.useState({}),[x,j]=y.useState(!1),[S,P]=y.useState(""),[k,b]=y.useState(""),[w,$]=y.useState("");async function W(){var H;$("저장·감지 중…");try{const L=await z.saveOpenaiEndpoint(k.trim());L.baseUrl&&b(L.baseUrl),$((H=L.models)!=null&&H.length?`연결됨 · 모델 ${L.models.length}개 (openai 칸에 게이트웨이 키를 등록하세요)`:"저장됨 · openai 칸에 게이트웨이 키를 먼저 등록하면 모델을 불러옵니다")}catch(L){$(`실패 · ${L.message}`)}}y.useEffect(()=>{z.keys().then(f).catch(()=>{})},[]);const A=d.some(H=>H.configured)||!!(i!=null&&i.aiStub);async function Y(H){const L=(g[H]??"").trim();if(L){j(!0),v(F=>({...F,[H]:"저장 중…"}));try{await z.saveKey(H,L);const F=await z.testKey(H);v(O=>({...O,[H]:F.ok?"연결 성공":`실패 · ${F.detail??""}`})),f(await z.keys()),m(O=>({...O,[H]:""}))}catch(F){v(O=>({...O,[H]:`실패 · ${F.message}`}))}finally{j(!1)}}}async function M(){j(!0),await z.completeOnboarding(),await r()}async function Z(){j(!0),P("Claude Code 생성 권한 확인 중…");try{const H=await z.testCli();if(!H.ok){P(""),u(1);const L=Rl(H.detail??"");v(F=>({...F,_cli:`${L.cause} — ${L.action}`}));return}await z.setAiMode("cli"),await z.completeOnboarding(),await r()}catch(H){P(""),u(1);const L=Rl(H.message);v(F=>({...F,_cli:`${L.cause} — ${L.action}`}))}finally{j(!1)}}return s.jsx("div",{className:"overlay",children:s.jsxs("div",{className:"dialog",children:[s.jsxs("div",{className:"wizard-step",children:[s.jsx("span",{className:`wizard-dot ${a===0?"active":""}`}),s.jsx("span",{className:`wizard-dot ${a===1?"active":""}`})]}),a===0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{textAlign:"center",marginBottom:6},children:s.jsx(Ke,{pose:"greet",size:72})}),s.jsxs("h2",{children:[s.jsx($l,{}),"에 오신 것을 환영합니다"]}),s.jsxs("p",{className:"subtle",children:["AI가 쓴 모든 것은 ",s.jsx("b",{style:{color:"var(--sug)"},children:"제안"}),"으로 들어오고, 수락해야만 문서가 됩니다. 당신이 편집장입니다."]}),i!=null&&i.cliAvailable?s.jsx("div",{className:"mini-card",children:s.jsxs("p",{className:"subtle",style:{margin:0},children:[s.jsx("b",{children:"Claude Code 를 찾았어요."})," 구독 로그인으로 생성하니 API 키가 필요 없습니다.",i.cliBin&&s.jsxs("span",{className:"muted",children:[" (",i.cliBin,")"]})]})}):s.jsx("div",{className:"mini-card",children:s.jsxs("p",{className:"subtle",style:{margin:0},children:[s.jsx("b",{children:"BYOK(Bring Your Own Key)"})," 방식으로 시작합니다. 키는 이 서버에"," ",s.jsx("b",{children:"암호화되어 저장"}),"되며 평문으로 노출되지 않습니다. (Claude Code CLI 가 있는 환경에서는 키 없이 시작할 수 있어요.)"]})}),(i==null?void 0:i.aiStub)&&s.jsx("p",{className:"ok",children:"STUB 모드가 켜져 있어 키 없이도 진행할 수 있습니다(오프라인 데모용)."}),s.jsxs("div",{className:"foot-actions",children:[i!=null&&i.cliAvailable?s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"btn",disabled:x,onClick:()=>u(1),children:"API 키로 쓸래요"}),s.jsx("button",{className:"btn pri lg",disabled:x,onClick:Z,children:"키 없이 시작하기"})]}):s.jsx("button",{className:"btn pri lg",onClick:()=>u(1),children:"시작하기"}),S&&s.jsx("p",{className:"subtle",style:{width:"100%",marginTop:8},children:S})]})]}),a===1&&s.jsxs(s.Fragment,{children:[s.jsx("h2",{children:"AI 키 등록"}),s.jsx("p",{className:"subtle",children:"등록 후 각 키의 연결을 테스트합니다. 건너뛸 수 없습니다."}),h._cli&&s.jsx("div",{className:"err",style:{marginBottom:4},children:h._cli}),s.jsxs("div",{className:"mini-card",style:{marginBottom:4},children:[s.jsx("label",{className:"lbl",style:{marginTop:0},children:"OpenAI 호환 게이트웨이 (선택 · LiteLLM·Azure·사내 프록시)"}),s.jsxs("div",{className:"h-row",children:[s.jsx("input",{className:"field",placeholder:"예: https://gateway.example.com (비우면 표준 provider)",value:k,onChange:H=>b(H.target.value)}),s.jsx("button",{className:"btn",disabled:x||!k.trim(),onClick:W,children:"연결"})]}),w&&s.jsx("div",{className:w.startsWith("실패")?"err":"ok",style:{marginTop:4},children:w}),s.jsxs("p",{className:"muted",style:{fontSize:11,marginTop:4},children:["게이트웨이를 쓰면 아래 ",s.jsx("b",{children:"openai"})," 칸에 게이트웨이 키를 등록하세요. (/v1 은 자동 감지)"]})]}),gv.map(H=>{var F;const L=(F=d.find(O=>O.provider===H.id))==null?void 0:F.configured;return s.jsxs("div",{style:{marginTop:"1rem"},children:[s.jsxs("label",{className:"lbl",children:[H.name," ",L&&s.jsx("span",{className:"ok",children:"· 등록됨"}),s.jsxs("span",{className:"muted",children:[" · ",H.hint]})]}),s.jsxs("div",{className:"h-row",children:[s.jsx("input",{className:"field",type:"password",placeholder:H.placeholder,value:g[H.id]??"",onChange:O=>m(J=>({...J,[H.id]:O.target.value}))}),s.jsx("button",{className:"btn",disabled:x||!(g[H.id]??"").trim(),onClick:()=>Y(H.id),children:"저장·테스트"})]}),h[H.id]&&s.jsx("div",{className:h[H.id]==="연결 성공"?"ok":"err",children:h[H.id]})]},H.id)}),s.jsx("div",{className:"divider"}),s.jsxs("div",{className:"h-row",style:{justifyContent:"space-between"},children:[s.jsx("button",{className:"btn ghost",onClick:()=>u(0),children:"뒤로"}),s.jsx("button",{className:"btn pri lg",disabled:!A||x,onClick:M,children:A?"완료하고 시작":"키를 1개 이상 등록하세요"})]})]})]})})}function xv({onClose:r}){const i=Ut(),[a,u]=y.useState(""),[d,f]=y.useState(!1),[g,m]=y.useState(""),h=y.useRef(null);y.useEffect(()=>{var j;(j=h.current)==null||j.focus();const x=S=>{S.key==="Escape"&&r()};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[r]);async function v(){if(!(!a.trim()||d)){f(!0),m("");try{const x=await Wd(a);r(),i(x)}catch(x){m((x==null?void 0:x.message)??"생성에 실패했습니다"),f(!1)}}}return s.jsx("div",{className:"sheet-veil",onClick:r,children:s.jsxs("div",{className:"plan-sheet",onClick:x=>x.stopPropagation(),children:[s.jsx("div",{className:"eyebrow",children:"New Plan · ⌘N"}),s.jsx("h2",{children:"무엇을 만들까요?"}),s.jsx("input",{ref:h,className:"field",placeholder:"아이디어 한 줄. 이름과 범위는 인터뷰에서 정리됩니다.",value:a,onChange:x=>u(x.target.value),onKeyDown:x=>x.key==="Enter"&&v()}),g&&s.jsx("div",{className:"form-error",children:g}),s.jsxs("div",{className:"plan-sheet-row",children:[s.jsx("button",{className:"btn pri",disabled:!a.trim()||d,onClick:v,children:d?"만드는 중…":"인터뷰 시작"}),s.jsx("button",{className:"btn",onClick:r,children:"닫기"}),s.jsx("span",{className:"hint mono",children:"답이 곧 제안의 근거가 됩니다"})]})]})})}function yv({onClose:r}){const i=Ut(),[a,u]=y.useState(""),[d,f]=y.useState(0),[g,m]=y.useState([]),h=y.useRef(null),v=y.useRef(null);y.useEffect(()=>{var k;(k=h.current)==null||k.focus();let P=!0;return(async()=>{const b=[{key:"a:new",kind:"action",label:"새 기획",detail:"⌘N",go:()=>{r(),ff()}},{key:"a:start",kind:"action",label:"시작 화면",go:()=>{r(),i("/")}},{key:"a:settings",kind:"action",label:"설정",go:()=>{r(),i("/settings")}},{key:"a:templates",kind:"action",label:"템플릿 라이브러리",go:()=>{r(),i("/templates")}}];P&&m(b);try{const w=await z.listProjects(),$=[...b];for(const A of w)$.push({key:`p:${A.id}`,kind:"project",label:A.name,count:Fn(A),go:()=>{r(),i(`/projects/${A.id}`)}});const W=await Promise.all(w.map(A=>z.getProject(A.id).then(Y=>({p:A,docs:Y.documents})).catch(()=>({p:A,docs:[]}))));for(const{p:A,docs:Y}of W)for(const M of Y)$.push({key:`d:${M.id}`,kind:"document",label:M.title,detail:A.name,count:Fn(M),go:()=>{r(),i(`/projects/${A.id}/documents/${M.id}`)}});P&&m($)}catch{}})(),()=>{P=!1}},[i,r]);const x=y.useMemo(()=>{const P=a.trim().toLowerCase();return P?g.filter(k=>k.label.toLowerCase().includes(P)||(k.detail??"").toLowerCase().includes(P)):g},[g,a]);y.useEffect(()=>f(0),[a]),y.useEffect(()=>{var P,k;(k=(P=v.current)==null?void 0:P.querySelector(".pal-item.on"))==null||k.scrollIntoView({block:"nearest"})},[d]);function j(P){var k;P.key==="ArrowDown"?(P.preventDefault(),f(b=>Math.min(b+1,x.length-1))):P.key==="ArrowUp"?(P.preventDefault(),f(b=>Math.max(b-1,0))):P.key==="Enter"?(P.preventDefault(),(k=x[d])==null||k.go()):P.key==="Escape"&&r()}const S={action:"GO",project:"PROJ",document:"DOC"};return s.jsx("div",{className:"sheet-veil pal-veil",onClick:r,children:s.jsxs("div",{className:"palette",onClick:P=>P.stopPropagation(),children:[s.jsx("input",{ref:h,className:"pal-input",placeholder:"프로젝트·문서로 점프, 또는 명령…",value:a,onChange:P=>u(P.target.value),onKeyDown:j}),s.jsx("div",{className:"pal-list",ref:v,children:x.length===0?s.jsx("div",{className:"pal-empty",children:"일치하는 항목이 없습니다"}):x.map((P,k)=>s.jsxs("button",{className:`pal-item ${k===d?"on":""}`,onMouseEnter:()=>f(k),onClick:P.go,children:[s.jsx("span",{className:"t mono",children:S[P.kind]}),s.jsx("span",{className:"nm",children:P.label}),P.detail&&s.jsx("span",{className:"dt",children:P.detail}),(P.count??0)>0&&s.jsxs("span",{className:"gd mono",children:[s.jsx("i",{}),P.count]})]},P.key))}),s.jsx("div",{className:"pal-foot mono",children:"↑↓ 이동 · Enter 열기 · Esc 닫기"})]})})}const df=y.createContext({meta:null,reload:async()=>{}}),zl=()=>y.useContext(df),Qa="drafting:new-plan";function ff(){window.dispatchEvent(new CustomEvent(Qa))}function jv(){const[r,i]=y.useState(null),[a,u]=y.useState(!1),[d,f]=y.useState(!1),g=y.useCallback(async()=>{i(await z.meta())},[]);y.useEffect(()=>{g().catch(()=>i(null))},[g]),y.useEffect(()=>{const h=x=>{(x.metaKey||x.ctrlKey)&&!x.shiftKey&&!x.altKey&&x.key.toLowerCase()==="n"&&(x.preventDefault(),u(!0)),(x.metaKey||x.ctrlKey)&&!x.shiftKey&&!x.altKey&&x.key.toLowerCase()==="k"&&(x.preventDefault(),f(j=>!j))},v=()=>u(!0);return window.addEventListener("keydown",h),window.addEventListener(Qa,v),()=>{window.removeEventListener("keydown",h),window.removeEventListener(Qa,v)}},[]);const m=r!==null&&!r.onboardingComplete;return s.jsxs(df.Provider,{value:{meta:r,reload:g},children:[s.jsxs(fm,{children:[s.jsx(jn,{path:"/",element:s.jsx(Om,{})}),s.jsx(jn,{path:"/projects/:pid",element:s.jsx(Wm,{})}),s.jsx(jn,{path:"/projects/:pid/documents/:did",element:s.jsx(tv,{})}),s.jsx(jn,{path:"/projects/:pid/wireframes",element:s.jsx(rv,{})}),s.jsx(jn,{path:"/projects/:pid/handoff",element:s.jsx(ov,{})}),s.jsx(jn,{path:"/settings",element:s.jsx(dv,{})}),s.jsx(jn,{path:"/templates",element:s.jsx(mv,{})})]}),a&&s.jsx(xv,{onClose:()=>u(!1)}),d&&s.jsx(yv,{onClose:()=>f(!1)}),m&&s.jsx(vv,{onDone:g})]})}kh.createRoot(document.getElementById("root")).render(s.jsx(bd.StrictMode,{children:s.jsx(jm,{children:s.jsx(jv,{})})}));
|