Files
Gnuboard7/public/build/core/template-engine.min.js
T
HeuJung 6bde24bc75 fix(ecommerce): 숫자 설정 문자열 영속으로 인한 주문 생성 실패 해소
관리자 환경설정에서 미입금 자동취소 기한을 저장하면 HTML number 입력의
문자열이 그대로 영속되고, Carbon 3.13 의 strict 타입 경계에서 TypeError 가
발생해 무통장입금·가상계좌 주문이 전면 실패했다(공개 제보). 한 곳만 막으면
다른 저장 경로가 남으므로 저장·조회·소비·모델 네 계층에 각각 방어를 두고,
저장소 전역에서 같은 형태가 더 없음을 audit 룰로 확정했다.

같은 계획서 수행 중 드러난 인접 결함도 함께 해소했다.
- 쿠폰 수정 경로로 (발급일 기준, 일수 NULL) 조합이 저장되어 발급 즉시
 만료된 쿠폰이 조용히 나가던 문제 — 저장·발급 양쪽에서 차단
- 리뷰 작성 기한을 화면과 저장 판정이 서로 다른 기준으로 계산하던 문제
- 결제 플러그인이 PaymentMethodEnum 과 다른 어휘로 지원 결제수단을 선언해
 가상계좌·계좌이체·휴대폰결제에 PG사를 지정할 수 없던 문제

엔진에서는 `_localInit` 적용 여부를 전역 해시로만 판정해 인스턴스별 저장소가
리셋되지 않던 결함(engine-v1.54.5)과, 제거 대상이 없어도 상태 갱신·캐시
무효화가 상시 발생하던 판정 결함(engine-v1.54.6)을 고쳤다.

Playwright MCP 정밀 점검(T1~T11)에서 설정이 빈 문자열로 남은 사이트의
주문서 입금기한 안내가 미치환 플레이스홀더를 노출하는 것을 실측해, 화면
폴백을 서버와 같은 규칙으로 맞췄다.
2026-08-02 18:35:28 +09:00

245 lines
748 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
var mT=Object.defineProperty;var yT=(Yt,Wr,Yr)=>Wr in Yt?mT(Yt,Wr,{enumerable:!0,configurable:!0,writable:!0,value:Yr}):Yt[Wr]=Yr;var $=(Yt,Wr,Yr)=>yT(Yt,typeof Wr!="symbol"?Wr+"":Wr,Yr);(function(Yt){"use strict";function Wr(o,e){for(var n=0;n<e.length;n++){const a=e[n];if(typeof a!="string"&&!Array.isArray(a)){for(const i in a)if(i!=="default"&&!(i in o)){const l=Object.getOwnPropertyDescriptor(a,i);l&&Object.defineProperty(o,i,l.get?l:{enumerable:!0,get:()=>a[i]})}}}return Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}function Yr(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var Xu={exports:{}},Ye={};var zg;function jS(){if(zg)return Ye;zg=1;var o=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),v=Symbol.iterator;function S(N){return N===null||typeof N!="object"?null:(N=v&&N[v]||N["@@iterator"],typeof N=="function"?N:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,k={};function O(N,T,fe){this.props=N,this.context=T,this.refs=k,this.updater=fe||_}O.prototype.isReactComponent={},O.prototype.setState=function(N,T){if(typeof N!="object"&&typeof N!="function"&&N!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,N,T,"setState")},O.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function M(){}M.prototype=O.prototype;function x(N,T,fe){this.props=N,this.context=T,this.refs=k,this.updater=fe||_}var D=x.prototype=new M;D.constructor=x,A(D,O.prototype),D.isPureReactComponent=!0;var U=Array.isArray;function z(){}var q={H:null,A:null,T:null,S:null},X=Object.prototype.hasOwnProperty;function pe(N,T,fe){var he=fe.ref;return{$$typeof:o,type:N,key:T,ref:he!==void 0?he:null,props:fe}}function Ce(N,T){return pe(N.type,T,N.props)}function ve(N){return typeof N=="object"&&N!==null&&N.$$typeof===o}function Le(N){var T={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(fe){return T[fe]})}var Ve=/\/+/g;function Fe(N,T){return typeof N=="object"&&N!==null&&N.key!=null?Le(""+N.key):T.toString(36)}function Tt(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(z,z):(N.status="pending",N.then(function(T){N.status==="pending"&&(N.status="fulfilled",N.value=T)},function(T){N.status==="pending"&&(N.status="rejected",N.reason=T)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function J(N,T,fe,he,Ae){var te=typeof N;(te==="undefined"||te==="boolean")&&(N=null);var we=!1;if(N===null)we=!0;else switch(te){case"bigint":case"string":case"number":we=!0;break;case"object":switch(N.$$typeof){case o:case e:we=!0;break;case m:return we=N._init,J(we(N._payload),T,fe,he,Ae)}}if(we)return Ae=Ae(N),we=he===""?"."+Fe(N,0):he,U(Ae)?(fe="",we!=null&&(fe=we.replace(Ve,"$&/")+"/"),J(Ae,T,fe,"",function(ze){return ze})):Ae!=null&&(ve(Ae)&&(Ae=Ce(Ae,fe+(Ae.key==null||N&&N.key===Ae.key?"":(""+Ae.key).replace(Ve,"$&/")+"/")+we)),T.push(Ae)),1;we=0;var qe=he===""?".":he+":";if(U(N))for(var ke=0;ke<N.length;ke++)he=N[ke],te=qe+Fe(he,ke),we+=J(he,T,fe,te,Ae);else if(ke=S(N),typeof ke=="function")for(N=ke.call(N),ke=0;!(he=N.next()).done;)he=he.value,te=qe+Fe(he,ke++),we+=J(he,T,fe,te,Ae);else if(te==="object"){if(typeof N.then=="function")return J(Tt(N),T,fe,he,Ae);throw T=String(N),Error("Objects are not valid as a React child (found: "+(T==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":T)+"). If you meant to render a collection of children, use an array instead.")}return we}function de(N,T,fe){if(N==null)return N;var he=[],Ae=0;return J(N,he,"","",function(te){return T.call(fe,te,Ae++)}),he}function Ne(N){if(N._status===-1){var T=N._result;T=T(),T.then(function(fe){(N._status===0||N._status===-1)&&(N._status=1,N._result=fe)},function(fe){(N._status===0||N._status===-1)&&(N._status=2,N._result=fe)}),N._status===-1&&(N._status=0,N._result=T)}if(N._status===1)return N._result.default;throw N._result}var ee=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var T=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(T))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},ge={map:de,forEach:function(N,T,fe){de(N,function(){T.apply(this,arguments)},fe)},count:function(N){var T=0;return de(N,function(){T++}),T},toArray:function(N){return de(N,function(T){return T})||[]},only:function(N){if(!ve(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return Ye.Activity=b,Ye.Children=ge,Ye.Component=O,Ye.Fragment=n,Ye.Profiler=i,Ye.PureComponent=x,Ye.StrictMode=a,Ye.Suspense=f,Ye.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=q,Ye.__COMPILER_RUNTIME={__proto__:null,c:function(N){return q.H.useMemoCache(N)}},Ye.cache=function(N){return function(){return N.apply(null,arguments)}},Ye.cacheSignal=function(){return null},Ye.cloneElement=function(N,T,fe){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var he=A({},N.props),Ae=N.key;if(T!=null)for(te in T.key!==void 0&&(Ae=""+T.key),T)!X.call(T,te)||te==="key"||te==="__self"||te==="__source"||te==="ref"&&T.ref===void 0||(he[te]=T[te]);var te=arguments.length-2;if(te===1)he.children=fe;else if(1<te){for(var we=Array(te),qe=0;qe<te;qe++)we[qe]=arguments[qe+2];he.children=we}return pe(N.type,Ae,he)},Ye.createContext=function(N){return N={$$typeof:u,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:l,_context:N},N},Ye.createElement=function(N,T,fe){var he,Ae={},te=null;if(T!=null)for(he in T.key!==void 0&&(te=""+T.key),T)X.call(T,he)&&he!=="key"&&he!=="__self"&&he!=="__source"&&(Ae[he]=T[he]);var we=arguments.length-2;if(we===1)Ae.children=fe;else if(1<we){for(var qe=Array(we),ke=0;ke<we;ke++)qe[ke]=arguments[ke+2];Ae.children=qe}if(N&&N.defaultProps)for(he in we=N.defaultProps,we)Ae[he]===void 0&&(Ae[he]=we[he]);return pe(N,te,Ae)},Ye.createRef=function(){return{current:null}},Ye.forwardRef=function(N){return{$$typeof:d,render:N}},Ye.isValidElement=ve,Ye.lazy=function(N){return{$$typeof:m,_payload:{_status:-1,_result:N},_init:Ne}},Ye.memo=function(N,T){return{$$typeof:g,type:N,compare:T===void 0?null:T}},Ye.startTransition=function(N){var T=q.T,fe={};q.T=fe;try{var he=N(),Ae=q.S;Ae!==null&&Ae(fe,he),typeof he=="object"&&he!==null&&typeof he.then=="function"&&he.then(z,ee)}catch(te){ee(te)}finally{T!==null&&fe.types!==null&&(T.types=fe.types),q.T=T}},Ye.unstable_useCacheRefresh=function(){return q.H.useCacheRefresh()},Ye.use=function(N){return q.H.use(N)},Ye.useActionState=function(N,T,fe){return q.H.useActionState(N,T,fe)},Ye.useCallback=function(N,T){return q.H.useCallback(N,T)},Ye.useContext=function(N){return q.H.useContext(N)},Ye.useDebugValue=function(){},Ye.useDeferredValue=function(N,T){return q.H.useDeferredValue(N,T)},Ye.useEffect=function(N,T){return q.H.useEffect(N,T)},Ye.useEffectEvent=function(N){return q.H.useEffectEvent(N)},Ye.useId=function(){return q.H.useId()},Ye.useImperativeHandle=function(N,T,fe){return q.H.useImperativeHandle(N,T,fe)},Ye.useInsertionEffect=function(N,T){return q.H.useInsertionEffect(N,T)},Ye.useLayoutEffect=function(N,T){return q.H.useLayoutEffect(N,T)},Ye.useMemo=function(N,T){return q.H.useMemo(N,T)},Ye.useOptimistic=function(N,T){return q.H.useOptimistic(N,T)},Ye.useReducer=function(N,T,fe){return q.H.useReducer(N,T,fe)},Ye.useRef=function(N){return q.H.useRef(N)},Ye.useState=function(N){return q.H.useState(N)},Ye.useSyncExternalStore=function(N,T,fe){return q.H.useSyncExternalStore(N,T,fe)},Ye.useTransition=function(){return q.H.useTransition()},Ye.version="19.2.8",Ye}var jg;function Ju(){return jg||(jg=1,Xu.exports=jS()),Xu.exports}var H=Ju();const Xe=Yr(H);var Qu={exports:{}},Ys={},Zu={exports:{}},ed={};var Ug;function US(){return Ug||(Ug=1,(function(o){function e(J,de){var Ne=J.length;J.push(de);e:for(;0<Ne;){var ee=Ne-1>>>1,ge=J[ee];if(0<i(ge,de))J[ee]=de,J[Ne]=ge,Ne=ee;else break e}}function n(J){return J.length===0?null:J[0]}function a(J){if(J.length===0)return null;var de=J[0],Ne=J.pop();if(Ne!==de){J[0]=Ne;e:for(var ee=0,ge=J.length,N=ge>>>1;ee<N;){var T=2*(ee+1)-1,fe=J[T],he=T+1,Ae=J[he];if(0>i(fe,Ne))he<ge&&0>i(Ae,fe)?(J[ee]=Ae,J[he]=Ne,ee=he):(J[ee]=fe,J[T]=Ne,ee=T);else if(he<ge&&0>i(Ae,Ne))J[ee]=Ae,J[he]=Ne,ee=he;else break e}}return de}function i(J,de){var Ne=J.sortIndex-de.sortIndex;return Ne!==0?Ne:J.id-de.id}if(o.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;o.unstable_now=function(){return l.now()}}else{var u=Date,d=u.now();o.unstable_now=function(){return u.now()-d}}var f=[],g=[],m=1,b=null,v=3,S=!1,_=!1,A=!1,k=!1,O=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function D(J){for(var de=n(g);de!==null;){if(de.callback===null)a(g);else if(de.startTime<=J)a(g),de.sortIndex=de.expirationTime,e(f,de);else break;de=n(g)}}function U(J){if(A=!1,D(J),!_)if(n(f)!==null)_=!0,z||(z=!0,Le());else{var de=n(g);de!==null&&Tt(U,de.startTime-J)}}var z=!1,q=-1,X=5,pe=-1;function Ce(){return k?!0:!(o.unstable_now()-pe<X)}function ve(){if(k=!1,z){var J=o.unstable_now();pe=J;var de=!0;try{e:{_=!1,A&&(A=!1,M(q),q=-1),S=!0;var Ne=v;try{t:{for(D(J),b=n(f);b!==null&&!(b.expirationTime>J&&Ce());){var ee=b.callback;if(typeof ee=="function"){b.callback=null,v=b.priorityLevel;var ge=ee(b.expirationTime<=J);if(J=o.unstable_now(),typeof ge=="function"){b.callback=ge,D(J),de=!0;break t}b===n(f)&&a(f),D(J)}else a(f);b=n(f)}if(b!==null)de=!0;else{var N=n(g);N!==null&&Tt(U,N.startTime-J),de=!1}}break e}finally{b=null,v=Ne,S=!1}de=void 0}}finally{de?Le():z=!1}}}var Le;if(typeof x=="function")Le=function(){x(ve)};else if(typeof MessageChannel<"u"){var Ve=new MessageChannel,Fe=Ve.port2;Ve.port1.onmessage=ve,Le=function(){Fe.postMessage(null)}}else Le=function(){O(ve,0)};function Tt(J,de){q=O(function(){J(o.unstable_now())},de)}o.unstable_IdlePriority=5,o.unstable_ImmediatePriority=1,o.unstable_LowPriority=4,o.unstable_NormalPriority=3,o.unstable_Profiling=null,o.unstable_UserBlockingPriority=2,o.unstable_cancelCallback=function(J){J.callback=null},o.unstable_forceFrameRate=function(J){0>J||125<J?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):X=0<J?Math.floor(1e3/J):5},o.unstable_getCurrentPriorityLevel=function(){return v},o.unstable_next=function(J){switch(v){case 1:case 2:case 3:var de=3;break;default:de=v}var Ne=v;v=de;try{return J()}finally{v=Ne}},o.unstable_requestPaint=function(){k=!0},o.unstable_runWithPriority=function(J,de){switch(J){case 1:case 2:case 3:case 4:case 5:break;default:J=3}var Ne=v;v=J;try{return de()}finally{v=Ne}},o.unstable_scheduleCallback=function(J,de,Ne){var ee=o.unstable_now();switch(typeof Ne=="object"&&Ne!==null?(Ne=Ne.delay,Ne=typeof Ne=="number"&&0<Ne?ee+Ne:ee):Ne=ee,J){case 1:var ge=-1;break;case 2:ge=250;break;case 5:ge=1073741823;break;case 4:ge=1e4;break;default:ge=5e3}return ge=Ne+ge,J={id:m++,callback:de,priorityLevel:J,startTime:Ne,expirationTime:ge,sortIndex:-1},Ne>ee?(J.sortIndex=Ne,e(g,J),n(f)===null&&J===n(g)&&(A?(M(q),q=-1):A=!0,Tt(U,Ne-ee))):(J.sortIndex=ge,e(f,J),_||S||(_=!0,z||(z=!0,Le()))),J},o.unstable_shouldYield=Ce,o.unstable_wrapCallback=function(J){var de=v;return function(){var Ne=v;v=de;try{return J.apply(this,arguments)}finally{v=Ne}}}})(ed)),ed}var Bg;function BS(){return Bg||(Bg=1,Zu.exports=US()),Zu.exports}var td={exports:{}},_n={};var Pg;function PS(){if(Pg)return _n;Pg=1;var o=Ju();function e(f){var g="https://react.dev/errors/"+f;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)g+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+f+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var a={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function l(f,g,m){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:b==null?null:""+b,children:f,containerInfo:g,implementation:m}}var u=o.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(f,g){if(f==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return _n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,_n.createPortal=function(f,g){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(e(299));return l(f,g,null,m)},_n.flushSync=function(f){var g=u.T,m=a.p;try{if(u.T=null,a.p=2,f)return f()}finally{u.T=g,a.p=m,a.d.f()}},_n.preconnect=function(f,g){typeof f=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,a.d.C(f,g))},_n.prefetchDNS=function(f){typeof f=="string"&&a.d.D(f)},_n.preinit=function(f,g){if(typeof f=="string"&&g&&typeof g.as=="string"){var m=g.as,b=d(m,g.crossOrigin),v=typeof g.integrity=="string"?g.integrity:void 0,S=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;m==="style"?a.d.S(f,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:b,integrity:v,fetchPriority:S}):m==="script"&&a.d.X(f,{crossOrigin:b,integrity:v,fetchPriority:S,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},_n.preinitModule=function(f,g){if(typeof f=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var m=d(g.as,g.crossOrigin);a.d.M(f,{crossOrigin:m,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&a.d.M(f)},_n.preload=function(f,g){if(typeof f=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var m=g.as,b=d(m,g.crossOrigin);a.d.L(f,m,{crossOrigin:b,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},_n.preloadModule=function(f,g){if(typeof f=="string")if(g){var m=d(g.as,g.crossOrigin);a.d.m(f,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:m,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else a.d.m(f)},_n.requestFormReset=function(f){a.d.r(f)},_n.unstable_batchedUpdates=function(f,g){return f(g)},_n.useFormState=function(f,g,m){return u.H.useFormState(f,g,m)},_n.useFormStatus=function(){return u.H.useHostTransitionStatus()},_n.version="19.2.8",_n}var qg;function Gg(){if(qg)return td.exports;qg=1;function o(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(o)}catch(e){console.error(e)}}return o(),td.exports=PS(),td.exports}var Vg;function qS(){if(Vg)return Ys;Vg=1;var o=BS(),e=Ju(),n=Gg();function a(t){var r="https://react.dev/errors/"+t;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)r+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function l(t){var r=t,s=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,(r.flags&4098)!==0&&(s=r.return),t=r.return;while(t)}return r.tag===3?s:null}function u(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function d(t){if(t.tag===31){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function f(t){if(l(t)!==t)throw Error(a(188))}function g(t){var r=t.alternate;if(!r){if(r=l(t),r===null)throw Error(a(188));return r!==t?null:t}for(var s=t,c=r;;){var h=s.return;if(h===null)break;var p=h.alternate;if(p===null){if(c=h.return,c!==null){s=c;continue}break}if(h.child===p.child){for(p=h.child;p;){if(p===s)return f(h),t;if(p===c)return f(h),r;p=p.sibling}throw Error(a(188))}if(s.return!==c.return)s=h,c=p;else{for(var C=!1,R=h.child;R;){if(R===s){C=!0,s=h,c=p;break}if(R===c){C=!0,c=h,s=p;break}R=R.sibling}if(!C){for(R=p.child;R;){if(R===s){C=!0,s=p,c=h;break}if(R===c){C=!0,c=p,s=h;break}R=R.sibling}if(!C)throw Error(a(189))}}if(s.alternate!==c)throw Error(a(190))}if(s.tag!==3)throw Error(a(188));return s.stateNode.current===s?t:r}function m(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t;for(t=t.child;t!==null;){if(r=m(t),r!==null)return r;t=t.sibling}return null}var b=Object.assign,v=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),x=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),pe=Symbol.for("react.activity"),Ce=Symbol.for("react.memo_cache_sentinel"),ve=Symbol.iterator;function Le(t){return t===null||typeof t!="object"?null:(t=ve&&t[ve]||t["@@iterator"],typeof t=="function"?t:null)}var Ve=Symbol.for("react.client.reference");function Fe(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Ve?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case A:return"Fragment";case O:return"Profiler";case k:return"StrictMode";case U:return"Suspense";case z:return"SuspenseList";case pe:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case _:return"Portal";case x:return t.displayName||"Context";case M:return(t._context.displayName||"Context")+".Consumer";case D:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case q:return r=t.displayName||null,r!==null?r:Fe(t.type)||"Memo";case X:r=t._payload,t=t._init;try{return Fe(t(r))}catch{}}return null}var Tt=Array.isArray,J=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,de=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ne={pending:!1,data:null,method:null,action:null},ee=[],ge=-1;function N(t){return{current:t}}function T(t){0>ge||(t.current=ee[ge],ee[ge]=null,ge--)}function fe(t,r){ge++,ee[ge]=t.current,t.current=r}var he=N(null),Ae=N(null),te=N(null),we=N(null);function qe(t,r){switch(fe(te,r),fe(Ae,t),fe(he,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?sS(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=sS(r),t=oS(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}T(he),fe(he,t)}function ke(){T(he),T(Ae),T(te)}function ze(t){t.memoizedState!==null&&fe(we,t);var r=he.current,s=oS(r,t.type);r!==s&&(fe(Ae,t),fe(he,s))}function Ct(t){Ae.current===t&&(T(he),T(Ae)),we.current===t&&(T(we),Al._currentValue=Ne)}var it,Ot;function vt(t){if(it===void 0)try{throw Error()}catch(s){var r=s.stack.trim().match(/\n( *(at )?)/);it=r&&r[1]||"",Ot=-1<s.stack.indexOf(`
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
`+it+t+Ot}var _t=!1;function Me(t,r){if(!t||_t)return"";_t=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(r){var ce=function(){throw Error()};if(Object.defineProperty(ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ce,[])}catch(ne){var Q=ne}Reflect.construct(t,[],ce)}else{try{ce.call()}catch(ne){Q=ne}t.call(ce.prototype)}}else{try{throw Error()}catch(ne){Q=ne}(ce=t())&&typeof ce.catch=="function"&&ce.catch(function(){})}}catch(ne){if(ne&&Q&&typeof ne.stack=="string")return[ne.stack,Q.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var p=c.DetermineComponentFrameRoot(),C=p[0],R=p[1];if(C&&R){var B=C.split(`
`),Y=R.split(`
`);for(h=c=0;c<B.length&&!B[c].includes("DetermineComponentFrameRoot");)c++;for(;h<Y.length&&!Y[h].includes("DetermineComponentFrameRoot");)h++;if(c===B.length||h===Y.length)for(c=B.length-1,h=Y.length-1;1<=c&&0<=h&&B[c]!==Y[h];)h--;for(;1<=c&&0<=h;c--,h--)if(B[c]!==Y[h]){if(c!==1||h!==1)do if(c--,h--,0>h||B[c]!==Y[h]){var ae=`
`+B[c].replace(" at new "," at ");return t.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",t.displayName)),ae}while(1<=c&&0<=h);break}}}finally{_t=!1,Error.prepareStackTrace=s}return(s=t?t.displayName||t.name:"")?vt(s):""}function tt(t,r){switch(t.tag){case 26:case 27:case 5:return vt(t.type);case 16:return vt("Lazy");case 13:return t.child!==r&&r!==null?vt("Suspense Fallback"):vt("Suspense");case 19:return vt("SuspenseList");case 0:case 15:return Me(t.type,!1);case 11:return Me(t.type.render,!1);case 1:return Me(t.type,!0);case 31:return vt("Activity");default:return""}}function nn(t){try{var r="",s=null;do r+=tt(t,s),s=t,t=t.return;while(t);return r}catch(c){return`
Error generating stack: `+c.message+`
`+c.stack}}var Mt=Object.prototype.hasOwnProperty,Pt=o.unstable_scheduleCallback,rn=o.unstable_cancelCallback,an=o.unstable_shouldYield,ea=o.unstable_requestPaint,qt=o.unstable_now,bi=o.unstable_getCurrentPriorityLevel,ta=o.unstable_ImmediatePriority,yn=o.unstable_UserBlockingPriority,Ln=o.unstable_NormalPriority,nt=o.unstable_LowPriority,Hn=o.unstable_IdlePriority,bn=o.log,na=o.unstable_setDisableYieldValue,rr=null,sn=null;function Tn(t){if(typeof bn=="function"&&na(t),sn&&typeof sn.setStrictMode=="function")try{sn.setStrictMode(rr,t)}catch{}}var on=Math.clz32?Math.clz32:le,V=Math.log,se=Math.LN2;function le(t){return t>>>=0,t===0?32:31-(V(t)/se|0)|0}var Z=256,ye=262144,ue=4194304;function Ee(t){var r=t&42;if(r!==0)return r;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function _e(t,r,s){var c=t.pendingLanes;if(c===0)return 0;var h=0,p=t.suspendedLanes,C=t.pingedLanes;t=t.warmLanes;var R=c&134217727;return R!==0?(c=R&~p,c!==0?h=Ee(c):(C&=R,C!==0?h=Ee(C):s||(s=R&~t,s!==0&&(h=Ee(s))))):(R=c&~p,R!==0?h=Ee(R):C!==0?h=Ee(C):s||(s=c&~t,s!==0&&(h=Ee(s)))),h===0?0:r!==0&&r!==h&&(r&p)===0&&(p=h&-h,s=r&-r,p>=s||p===32&&(s&4194048)!==0)?r:h}function Ke(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function xe(t,r){switch(t){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ie(){var t=ue;return ue<<=1,(ue&62914560)===0&&(ue=4194304),t}function Re(t){for(var r=[],s=0;31>s;s++)r.push(t);return r}function et(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function je(t,r,s,c,h,p){var C=t.pendingLanes;t.pendingLanes=s,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=s,t.entangledLanes&=s,t.errorRecoveryDisabledLanes&=s,t.shellSuspendCounter=0;var R=t.entanglements,B=t.expirationTimes,Y=t.hiddenUpdates;for(s=C&~s;0<s;){var ae=31-on(s),ce=1<<ae;R[ae]=0,B[ae]=-1;var Q=Y[ae];if(Q!==null)for(Y[ae]=null,ae=0;ae<Q.length;ae++){var ne=Q[ae];ne!==null&&(ne.lane&=-536870913)}s&=~ce}c!==0&&De(t,c,0),p!==0&&h===0&&t.tag!==0&&(t.suspendedLanes|=p&~(C&~r))}function De(t,r,s){t.pendingLanes|=r,t.suspendedLanes&=~r;var c=31-on(r);t.entangledLanes|=r,t.entanglements[c]=t.entanglements[c]|1073741824|s&261930}function Te(t,r){var s=t.entangledLanes|=r;for(t=t.entanglements;s;){var c=31-on(s),h=1<<c;h&r|t[c]&r&&(t[c]|=r),s&=~h}}function Ue(t,r){var s=r&-r;return s=(s&42)!==0?1:gt(s),(s&(t.suspendedLanes|r))!==0?0:s}function gt(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function St(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function ln(){var t=de.p;return t!==0?t:(t=window.event,t===void 0?32:DS(t.type))}function cn(t,r){var s=de.p;try{return de.p=t,r()}finally{de.p=s}}var Rn=Math.random().toString(36).slice(2),un="__reactFiber$"+Rn,kn="__reactProps$"+Rn,Da="__reactContainer$"+Rn,Lo="__reactEvents$"+Rn,Sf="__reactListeners$"+Rn,_c="__reactHandles$"+Rn,Br="__reactResources$"+Rn,vi="__reactMarker$"+Rn;function Mo(t){delete t[un],delete t[kn],delete t[Lo],delete t[Sf],delete t[_c]}function Oa(t){var r=t[un];if(r)return r;for(var s=t.parentNode;s;){if(r=s[Da]||s[un]){if(s=r.alternate,r.child!==null||s!==null&&s.child!==null)for(t=gS(t);t!==null;){if(s=t[un])return s;t=gS(t)}return r}t=s,s=t.parentNode}return null}function Pr(t){if(t=t[un]||t[Da]){var r=t.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return t}return null}function ra(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t.stateNode;throw Error(a(33))}function La(t){var r=t[Br];return r||(r=t[Br]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Xt(t){t[vi]=!0}var Ac=new Set,xc={};function Ar(t,r){Ma(t,r),Ma(t+"Capture",r)}function Ma(t,r){for(xc[t]=r,t=0;t<r.length;t++)Ac.add(r[t])}var wf=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Tc={},Rc={};function Cf(t){return Mt.call(Rc,t)?!0:Mt.call(Tc,t)?!1:wf.test(t)?Rc[t]=!0:(Tc[t]=!0,!1)}function zn(t,r,s){if(Cf(r))if(s===null)t.removeAttribute(r);else{switch(typeof s){case"undefined":case"function":case"symbol":t.removeAttribute(r);return;case"boolean":var c=r.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){t.removeAttribute(r);return}}t.setAttribute(r,""+s)}}function Si(t,r,s){if(s===null)t.removeAttribute(r);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttribute(r,""+s)}}function vn(t,r,s,c){if(c===null)t.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(s);return}t.setAttributeNS(r,s,""+c)}}function Dn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function kc(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Ef(t,r,s){var c=Object.getOwnPropertyDescriptor(t.constructor.prototype,r);if(!t.hasOwnProperty(r)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var h=c.get,p=c.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return h.call(this)},set:function(C){s=""+C,p.call(this,C)}}),Object.defineProperty(t,r,{enumerable:c.enumerable}),{getValue:function(){return s},setValue:function(C){s=""+C},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function $o(t){if(!t._valueTracker){var r=kc(t)?"checked":"value";t._valueTracker=Ef(t,r,""+t[r])}}function Dc(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var s=r.getValue(),c="";return t&&(c=kc(t)?t.checked?"true":"false":t.value),t=c,t!==s?(r.setValue(t),!0):!1}function $a(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var _f=/[\n"\\]/g;function jn(t){return t.replace(_f,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function ps(t,r,s,c,h,p,C,R){t.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?t.type=C:t.removeAttribute("type"),r!=null?C==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+Dn(r)):t.value!==""+Dn(r)&&(t.value=""+Dn(r)):C!=="submit"&&C!=="reset"||t.removeAttribute("value"),r!=null?aa(t,C,Dn(r)):s!=null?aa(t,C,Dn(s)):c!=null&&t.removeAttribute("value"),h==null&&p!=null&&(t.defaultChecked=!!p),h!=null&&(t.checked=h&&typeof h!="function"&&typeof h!="symbol"),R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?t.name=""+Dn(R):t.removeAttribute("name")}function wi(t,r,s,c,h,p,C,R){if(p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(t.type=p),r!=null||s!=null){if(!(p!=="submit"&&p!=="reset"||r!=null)){$o(t);return}s=s!=null?""+Dn(s):"",r=r!=null?""+Dn(r):s,R||r===t.value||(t.value=r),t.defaultValue=r}c=c??h,c=typeof c!="function"&&typeof c!="symbol"&&!!c,t.checked=R?t.checked:!!c,t.defaultChecked=!!c,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(t.name=C),$o(t)}function aa(t,r,s){r==="number"&&$a(t.ownerDocument)===t||t.defaultValue===""+s||(t.defaultValue=""+s)}function Na(t,r,s,c){if(t=t.options,r){r={};for(var h=0;h<s.length;h++)r["$"+s[h]]=!0;for(s=0;s<t.length;s++)h=r.hasOwnProperty("$"+t[s].value),t[s].selected!==h&&(t[s].selected=h),h&&c&&(t[s].defaultSelected=!0)}else{for(s=""+Dn(s),r=null,h=0;h<t.length;h++){if(t[h].value===s){t[h].selected=!0,c&&(t[h].defaultSelected=!0);return}r!==null||t[h].disabled||(r=t[h])}r!==null&&(r.selected=!0)}}function Ia(t,r,s){if(r!=null&&(r=""+Dn(r),r!==t.value&&(t.value=r),s==null)){t.defaultValue!==r&&(t.defaultValue=r);return}t.defaultValue=s!=null?""+Dn(s):""}function Oc(t,r,s,c){if(r==null){if(c!=null){if(s!=null)throw Error(a(92));if(Tt(c)){if(1<c.length)throw Error(a(93));c=c[0]}s=c}s==null&&(s=""),r=s}s=Dn(r),t.defaultValue=s,c=t.textContent,c===s&&c!==""&&c!==null&&(t.value=c),$o(t)}function Ha(t,r){if(r){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=r;return}}t.textContent=r}var Af=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Lc(t,r,s){var c=r.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?c?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="":c?t.setProperty(r,s):typeof s!="number"||s===0||Af.has(r)?r==="float"?t.cssFloat=s:t[r]=(""+s).trim():t[r]=s+"px"}function Mc(t,r,s){if(r!=null&&typeof r!="object")throw Error(a(62));if(t=t.style,s!=null){for(var c in s)!s.hasOwnProperty(c)||r!=null&&r.hasOwnProperty(c)||(c.indexOf("--")===0?t.setProperty(c,""):c==="float"?t.cssFloat="":t[c]="");for(var h in r)c=r[h],r.hasOwnProperty(h)&&s[h]!==c&&Lc(t,h,c)}else for(var p in r)r.hasOwnProperty(p)&&Lc(t,p,r[p])}function No(t){if(t.indexOf("-")===-1)return!1;switch(t){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 xf=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Io=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function ar(t){return Io.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function xr(){}var Ho=null;function zo(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var za=null,ia=null;function $c(t){var r=Pr(t);if(r&&(t=r.stateNode)){var s=t[kn]||null;e:switch(t=r.stateNode,r.type){case"input":if(ps(t,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),r=s.name,s.type==="radio"&&r!=null){for(s=t;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+jn(""+r)+'"][type="radio"]'),r=0;r<s.length;r++){var c=s[r];if(c!==t&&c.form===t.form){var h=c[kn]||null;if(!h)throw Error(a(90));ps(c,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(r=0;r<s.length;r++)c=s[r],c.form===t.form&&Dc(c)}break e;case"textarea":Ia(t,s.value,s.defaultValue);break e;case"select":r=s.value,r!=null&&Na(t,!!s.multiple,r,!1)}}}var ms=!1;function Nc(t,r,s){if(ms)return t(r,s);ms=!0;try{var c=t(r);return c}finally{if(ms=!1,(za!==null||ia!==null)&&(Ru(),za&&(r=za,t=ia,ia=za=null,$c(r),t)))for(r=0;r<t.length;r++)$c(t[r])}}function Ci(t,r){var s=t.stateNode;if(s===null)return null;var c=s[kn]||null;if(c===null)return null;s=c[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(t=t.type,c=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!c;break e;default:t=!1}if(t)return null;if(s&&typeof s!="function")throw Error(a(231,r,typeof s));return s}var Tr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),jo=!1;if(Tr)try{var Ei={};Object.defineProperty(Ei,"passive",{get:function(){jo=!0}}),window.addEventListener("test",Ei,Ei),window.removeEventListener("test",Ei,Ei)}catch{jo=!1}var qr=null,Uo=null,ys=null;function Ic(){if(ys)return ys;var t,r=Uo,s=r.length,c,h="value"in qr?qr.value:qr.textContent,p=h.length;for(t=0;t<s&&r[t]===h[t];t++);var C=s-t;for(c=1;c<=C&&r[s-c]===h[p-c];c++);return ys=h.slice(t,1<c?1-c:void 0)}function _i(t){var r=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&r===13&&(t=13)):t=r,t===10&&(t=13),32<=t||t===13?t:0}function Bo(){return!0}function Hc(){return!1}function Be(t){function r(s,c,h,p,C){this._reactName=s,this._targetInst=h,this.type=c,this.nativeEvent=p,this.target=C,this.currentTarget=null;for(var R in t)t.hasOwnProperty(R)&&(s=t[R],this[R]=s?s(p):p[R]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?Bo:Hc,this.isPropagationStopped=Hc,this}return b(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Bo)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Bo)},persist:function(){},isPersistent:Bo}),r}var Rr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},sa=Be(Rr),Ai=b({},Rr,{view:0,detail:0}),Tf=Be(Ai),bs,Po,xi,vs=b({},Ai,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Go,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==xi&&(xi&&t.type==="mousemove"?(bs=t.screenX-xi.screenX,Po=t.screenY-xi.screenY):Po=bs=0,xi=t),bs)},movementY:function(t){return"movementY"in t?t.movementY:Po}}),zc=Be(vs),Rf=b({},vs,{dataTransfer:0}),Cy=Be(Rf),kf=b({},Ai,{relatedTarget:0}),qo=Be(kf),Ey=b({},Rr,{animationName:0,elapsedTime:0,pseudoElement:0}),Df=Be(Ey),Of=b({},Rr,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),jc=Be(Of),Lf=b({},Rr,{data:0}),Uc=Be(Lf),Mf={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$f={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"},Nf={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Bc(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=Nf[t])?!!r[t]:!1}function Go(){return Bc}var If=b({},Ai,{key:function(t){if(t.key){var r=Mf[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=_i(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?$f[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Go,charCode:function(t){return t.type==="keypress"?_i(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?_i(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Hf=Be(If),zf=b({},vs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Pc=Be(zf),jf=b({},Ai,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Go}),Uf=Be(jf),dn=b({},Rr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ss=Be(dn),Bf=b({},vs,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),E=Be(Bf),y=b({},Rr,{newState:0,oldState:0}),w=Be(y),L=[9,13,27,32],I=Tr&&"CompositionEvent"in window,re=null;Tr&&"documentMode"in document&&(re=document.documentMode);var me=Tr&&"TextEvent"in window&&!re,$e=Tr&&(!I||re&&8<re&&11>=re),We=" ",ct=!1;function pt(t,r){switch(t){case"keyup":return L.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zt(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var kr=!1;function Pf(t,r){switch(t){case"compositionend":return zt(r);case"keypress":return r.which!==32?null:(ct=!0,We);case"textInput":return t=r.data,t===We&&ct?null:t;default:return null}}function qc(t,r){if(kr)return t==="compositionend"||!I&&pt(t,r)?(t=Ic(),ys=Uo=qr=null,kr=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return $e&&r.locale!=="ko"?null:r.data;default:return null}}var qf={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 Vo(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!qf[t.type]:r==="textarea"}function Gc(t,r,s,c){za?ia?ia.push(c):ia=[c]:za=c,r=Nu(r,"onChange"),0<r.length&&(s=new sa("onChange","change",null,s,c),t.push({event:s,listeners:r}))}var ja=null,Ti=null;function Gf(t){eS(t,0)}function Ri(t){var r=ra(t);if(Dc(r))return t}function Fo(t,r){if(t==="change")return r}var Ko=!1;if(Tr){var ki;if(Tr){var Di="oninput"in document;if(!Di){var Wo=document.createElement("div");Wo.setAttribute("oninput","return;"),Di=typeof Wo.oninput=="function"}ki=Di}else ki=!1;Ko=ki&&(!document.documentMode||9<document.documentMode)}function Vc(){ja&&(ja.detachEvent("onpropertychange",Fc),Ti=ja=null)}function Fc(t){if(t.propertyName==="value"&&Ri(Ti)){var r=[];Gc(r,Ti,t,zo(t)),Nc(Gf,r)}}function Vf(t,r,s){t==="focusin"?(Vc(),ja=r,Ti=s,ja.attachEvent("onpropertychange",Fc)):t==="focusout"&&Vc()}function Ff(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Ri(Ti)}function Kc(t,r){if(t==="click")return Ri(r)}function KA(t,r){if(t==="input"||t==="change")return Ri(r)}function WA(t,r){return t===r&&(t!==0||1/t===1/r)||t!==t&&r!==r}var Wn=typeof Object.is=="function"?Object.is:WA;function Yo(t,r){if(Wn(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;var s=Object.keys(t),c=Object.keys(r);if(s.length!==c.length)return!1;for(c=0;c<s.length;c++){var h=s[c];if(!Mt.call(r,h)||!Wn(t[h],r[h]))return!1}return!0}function _y(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Ay(t,r){var s=_y(t);t=0;for(var c;s;){if(s.nodeType===3){if(c=t+s.textContent.length,t<=r&&c>=r)return{node:s,offset:r-t};t=c}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=_y(s)}}function xy(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?xy(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function Ty(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var r=$a(t.document);r instanceof t.HTMLIFrameElement;){try{var s=typeof r.contentWindow.location.href=="string"}catch{s=!1}if(s)t=r.contentWindow;else break;r=$a(t.document)}return r}function Kf(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}var YA=Tr&&"documentMode"in document&&11>=document.documentMode,ws=null,Wf=null,Xo=null,Yf=!1;function Ry(t,r,s){var c=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Yf||ws==null||ws!==$a(c)||(c=ws,"selectionStart"in c&&Kf(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Xo&&Yo(Xo,c)||(Xo=c,c=Nu(Wf,"onSelect"),0<c.length&&(r=new sa("onSelect","select",null,r,s),t.push({event:r,listeners:c}),r.target=ws)))}function Oi(t,r){var s={};return s[t.toLowerCase()]=r.toLowerCase(),s["Webkit"+t]="webkit"+r,s["Moz"+t]="moz"+r,s}var Cs={animationend:Oi("Animation","AnimationEnd"),animationiteration:Oi("Animation","AnimationIteration"),animationstart:Oi("Animation","AnimationStart"),transitionrun:Oi("Transition","TransitionRun"),transitionstart:Oi("Transition","TransitionStart"),transitioncancel:Oi("Transition","TransitionCancel"),transitionend:Oi("Transition","TransitionEnd")},Xf={},ky={};Tr&&(ky=document.createElement("div").style,"AnimationEvent"in window||(delete Cs.animationend.animation,delete Cs.animationiteration.animation,delete Cs.animationstart.animation),"TransitionEvent"in window||delete Cs.transitionend.transition);function Li(t){if(Xf[t])return Xf[t];if(!Cs[t])return t;var r=Cs[t],s;for(s in r)if(r.hasOwnProperty(s)&&s in ky)return Xf[t]=r[s];return t}var Dy=Li("animationend"),Oy=Li("animationiteration"),Ly=Li("animationstart"),XA=Li("transitionrun"),JA=Li("transitionstart"),QA=Li("transitioncancel"),My=Li("transitionend"),$y=new Map,Jf="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Jf.push("scrollEnd");function Dr(t,r){$y.set(t,r),Ar(r,[t])}var Wc=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},ir=[],Es=0,Qf=0;function Yc(){for(var t=Es,r=Qf=Es=0;r<t;){var s=ir[r];ir[r++]=null;var c=ir[r];ir[r++]=null;var h=ir[r];ir[r++]=null;var p=ir[r];if(ir[r++]=null,c!==null&&h!==null){var C=c.pending;C===null?h.next=h:(h.next=C.next,C.next=h),c.pending=h}p!==0&&Ny(s,h,p)}}function Xc(t,r,s,c){ir[Es++]=t,ir[Es++]=r,ir[Es++]=s,ir[Es++]=c,Qf|=c,t.lanes|=c,t=t.alternate,t!==null&&(t.lanes|=c)}function Zf(t,r,s,c){return Xc(t,r,s,c),Jc(t)}function Mi(t,r){return Xc(t,null,null,r),Jc(t)}function Ny(t,r,s){t.lanes|=s;var c=t.alternate;c!==null&&(c.lanes|=s);for(var h=!1,p=t.return;p!==null;)p.childLanes|=s,c=p.alternate,c!==null&&(c.childLanes|=s),p.tag===22&&(t=p.stateNode,t===null||t._visibility&1||(h=!0)),t=p,p=p.return;return t.tag===3?(p=t.stateNode,h&&r!==null&&(h=31-on(s),t=p.hiddenUpdates,c=t[h],c===null?t[h]=[r]:c.push(r),r.lane=s|536870912),p):null}function Jc(t){if(50<bl)throw bl=0,lg=null,Error(a(185));for(var r=t.return;r!==null;)t=r,r=t.return;return t.tag===3?t.stateNode:null}var _s={};function ZA(t,r,s,c){this.tag=t,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Yn(t,r,s,c){return new ZA(t,r,s,c)}function eh(t){return t=t.prototype,!(!t||!t.isReactComponent)}function oa(t,r){var s=t.alternate;return s===null?(s=Yn(t.tag,r,t.key,t.mode),s.elementType=t.elementType,s.type=t.type,s.stateNode=t.stateNode,s.alternate=t,t.alternate=s):(s.pendingProps=r,s.type=t.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=t.flags&65011712,s.childLanes=t.childLanes,s.lanes=t.lanes,s.child=t.child,s.memoizedProps=t.memoizedProps,s.memoizedState=t.memoizedState,s.updateQueue=t.updateQueue,r=t.dependencies,s.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},s.sibling=t.sibling,s.index=t.index,s.ref=t.ref,s.refCleanup=t.refCleanup,s}function Iy(t,r){t.flags&=65011714;var s=t.alternate;return s===null?(t.childLanes=0,t.lanes=r,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=s.childLanes,t.lanes=s.lanes,t.child=s.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=s.memoizedProps,t.memoizedState=s.memoizedState,t.updateQueue=s.updateQueue,t.type=s.type,r=s.dependencies,t.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),t}function Qc(t,r,s,c,h,p){var C=0;if(c=t,typeof t=="function")eh(t)&&(C=1);else if(typeof t=="string")C=aT(t,s,he.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case pe:return t=Yn(31,s,r,h),t.elementType=pe,t.lanes=p,t;case A:return $i(s.children,h,p,r);case k:C=8,h|=24;break;case O:return t=Yn(12,s,r,h|2),t.elementType=O,t.lanes=p,t;case U:return t=Yn(13,s,r,h),t.elementType=U,t.lanes=p,t;case z:return t=Yn(19,s,r,h),t.elementType=z,t.lanes=p,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case x:C=10;break e;case M:C=9;break e;case D:C=11;break e;case q:C=14;break e;case X:C=16,c=null;break e}C=29,s=Error(a(130,t===null?"null":typeof t,"")),c=null}return r=Yn(C,s,r,h),r.elementType=t,r.type=c,r.lanes=p,r}function $i(t,r,s,c){return t=Yn(7,t,c,r),t.lanes=s,t}function th(t,r,s){return t=Yn(6,t,null,r),t.lanes=s,t}function Hy(t){var r=Yn(18,null,null,0);return r.stateNode=t,r}function nh(t,r,s){return r=Yn(4,t.children!==null?t.children:[],t.key,r),r.lanes=s,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}var zy=new WeakMap;function sr(t,r){if(typeof t=="object"&&t!==null){var s=zy.get(t);return s!==void 0?s:(r={value:t,source:r,stack:nn(r)},zy.set(t,r),r)}return{value:t,source:r,stack:nn(r)}}var As=[],xs=0,Zc=null,Jo=0,or=[],lr=0,Ua=null,Gr=1,Vr="";function la(t,r){As[xs++]=Jo,As[xs++]=Zc,Zc=t,Jo=r}function jy(t,r,s){or[lr++]=Gr,or[lr++]=Vr,or[lr++]=Ua,Ua=t;var c=Gr;t=Vr;var h=32-on(c)-1;c&=~(1<<h),s+=1;var p=32-on(r)+h;if(30<p){var C=h-h%5;p=(c&(1<<C)-1).toString(32),c>>=C,h-=C,Gr=1<<32-on(r)+h|s<<h|c,Vr=p+t}else Gr=1<<p|s<<h|c,Vr=t}function rh(t){t.return!==null&&(la(t,1),jy(t,1,0))}function ah(t){for(;t===Zc;)Zc=As[--xs],As[xs]=null,Jo=As[--xs],As[xs]=null;for(;t===Ua;)Ua=or[--lr],or[lr]=null,Vr=or[--lr],or[lr]=null,Gr=or[--lr],or[lr]=null}function Uy(t,r){or[lr++]=Gr,or[lr++]=Vr,or[lr++]=Ua,Gr=r.id,Vr=r.overflow,Ua=t}var Sn=null,$t=null,ut=!1,Ba=null,cr=!1,ih=Error(a(519));function Pa(t){var r=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Qo(sr(r,t)),ih}function By(t){var r=t.stateNode,s=t.type,c=t.memoizedProps;switch(r[un]=t,r[kn]=c,s){case"dialog":at("cancel",r),at("close",r);break;case"iframe":case"object":case"embed":at("load",r);break;case"video":case"audio":for(s=0;s<Sl.length;s++)at(Sl[s],r);break;case"source":at("error",r);break;case"img":case"image":case"link":at("error",r),at("load",r);break;case"details":at("toggle",r);break;case"input":at("invalid",r),wi(r,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":at("invalid",r);break;case"textarea":at("invalid",r),Oc(r,c.value,c.defaultValue,c.children)}s=c.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||r.textContent===""+s||c.suppressHydrationWarning===!0||aS(r.textContent,s)?(c.popover!=null&&(at("beforetoggle",r),at("toggle",r)),c.onScroll!=null&&at("scroll",r),c.onScrollEnd!=null&&at("scrollend",r),c.onClick!=null&&(r.onclick=xr),r=!0):r=!1,r||Pa(t,!0)}function Py(t){for(Sn=t.return;Sn;)switch(Sn.tag){case 5:case 31:case 13:cr=!1;return;case 27:case 3:cr=!0;return;default:Sn=Sn.return}}function Ts(t){if(t!==Sn)return!1;if(!ut)return Py(t),ut=!0,!1;var r=t.tag,s;if((s=r!==3&&r!==27)&&((s=r===5)&&(s=t.type,s=!(s!=="form"&&s!=="button")||Eg(t.type,t.memoizedProps)),s=!s),s&&$t&&Pa(t),Py(t),r===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));$t=hS(t)}else if(r===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));$t=hS(t)}else r===27?(r=$t,ni(t.type)?(t=Rg,Rg=null,$t=t):$t=r):$t=Sn?dr(t.stateNode.nextSibling):null;return!0}function Ni(){$t=Sn=null,ut=!1}function sh(){var t=Ba;return t!==null&&(qn===null?qn=t:qn.push.apply(qn,t),Ba=null),t}function Qo(t){Ba===null?Ba=[t]:Ba.push(t)}var oh=N(null),Ii=null,ca=null;function qa(t,r,s){fe(oh,r._currentValue),r._currentValue=s}function ua(t){t._currentValue=oh.current,T(oh)}function lh(t,r,s){for(;t!==null;){var c=t.alternate;if((t.childLanes&r)!==r?(t.childLanes|=r,c!==null&&(c.childLanes|=r)):c!==null&&(c.childLanes&r)!==r&&(c.childLanes|=r),t===s)break;t=t.return}}function ch(t,r,s,c){var h=t.child;for(h!==null&&(h.return=t);h!==null;){var p=h.dependencies;if(p!==null){var C=h.child;p=p.firstContext;e:for(;p!==null;){var R=p;p=h;for(var B=0;B<r.length;B++)if(R.context===r[B]){p.lanes|=s,R=p.alternate,R!==null&&(R.lanes|=s),lh(p.return,s,t),c||(C=null);break e}p=R.next}}else if(h.tag===18){if(C=h.return,C===null)throw Error(a(341));C.lanes|=s,p=C.alternate,p!==null&&(p.lanes|=s),lh(C,s,t),C=null}else C=h.child;if(C!==null)C.return=h;else for(C=h;C!==null;){if(C===t){C=null;break}if(h=C.sibling,h!==null){h.return=C.return,C=h;break}C=C.return}h=C}}function Rs(t,r,s,c){t=null;for(var h=r,p=!1;h!==null;){if(!p){if((h.flags&524288)!==0)p=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var C=h.alternate;if(C===null)throw Error(a(387));if(C=C.memoizedProps,C!==null){var R=h.type;Wn(h.pendingProps.value,C.value)||(t!==null?t.push(R):t=[R])}}else if(h===we.current){if(C=h.alternate,C===null)throw Error(a(387));C.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(t!==null?t.push(Al):t=[Al])}h=h.return}t!==null&&ch(r,t,s,c),r.flags|=262144}function eu(t){for(t=t.firstContext;t!==null;){if(!Wn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Hi(t){Ii=t,ca=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function wn(t){return qy(Ii,t)}function tu(t,r){return Ii===null&&Hi(t),qy(t,r)}function qy(t,r){var s=r._currentValue;if(r={context:r,memoizedValue:s,next:null},ca===null){if(t===null)throw Error(a(308));ca=r,t.dependencies={lanes:0,firstContext:r},t.flags|=524288}else ca=ca.next=r;return s}var ex=typeof AbortController<"u"?AbortController:function(){var t=[],r=this.signal={aborted:!1,addEventListener:function(s,c){t.push(c)}};this.abort=function(){r.aborted=!0,t.forEach(function(s){return s()})}},tx=o.unstable_scheduleCallback,nx=o.unstable_NormalPriority,Jt={$$typeof:x,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function uh(){return{controller:new ex,data:new Map,refCount:0}}function Zo(t){t.refCount--,t.refCount===0&&tx(nx,function(){t.controller.abort()})}var el=null,dh=0,ks=0,Ds=null;function rx(t,r){if(el===null){var s=el=[];dh=0,ks=gg(),Ds={status:"pending",value:void 0,then:function(c){s.push(c)}}}return dh++,r.then(Gy,Gy),r}function Gy(){if(--dh===0&&el!==null){Ds!==null&&(Ds.status="fulfilled");var t=el;el=null,ks=0,Ds=null;for(var r=0;r<t.length;r++)(0,t[r])()}}function ax(t,r){var s=[],c={status:"pending",value:null,reason:null,then:function(h){s.push(h)}};return t.then(function(){c.status="fulfilled",c.value=r;for(var h=0;h<s.length;h++)(0,s[h])(r)},function(h){for(c.status="rejected",c.reason=h,h=0;h<s.length;h++)(0,s[h])(void 0)}),c}var Vy=J.S;J.S=function(t,r){Rv=qt(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&rx(t,r),Vy!==null&&Vy(t,r)};var zi=N(null);function fh(){var t=zi.current;return t!==null?t:Lt.pooledCache}function nu(t,r){r===null?fe(zi,zi.current):fe(zi,r.pool)}function Fy(){var t=fh();return t===null?null:{parent:Jt._currentValue,pool:t}}var Os=Error(a(460)),hh=Error(a(474)),ru=Error(a(542)),au={then:function(){}};function Ky(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Wy(t,r,s){switch(s=t[s],s===void 0?t.push(r):s!==r&&(r.then(xr,xr),r=s),r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Xy(t),t;default:if(typeof r.status=="string")r.then(xr,xr);else{if(t=Lt,t!==null&&100<t.shellSuspendCounter)throw Error(a(482));t=r,t.status="pending",t.then(function(c){if(r.status==="pending"){var h=r;h.status="fulfilled",h.value=c}},function(c){if(r.status==="pending"){var h=r;h.status="rejected",h.reason=c}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Xy(t),t}throw Ui=r,Os}}function ji(t){try{var r=t._init;return r(t._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Ui=s,Os):s}}var Ui=null;function Yy(){if(Ui===null)throw Error(a(459));var t=Ui;return Ui=null,t}function Xy(t){if(t===Os||t===ru)throw Error(a(483))}var Ls=null,tl=0;function iu(t){var r=tl;return tl+=1,Ls===null&&(Ls=[]),Wy(Ls,t,r)}function nl(t,r){r=r.props.ref,t.ref=r!==void 0?r:null}function su(t,r){throw r.$$typeof===v?Error(a(525)):(t=Object.prototype.toString.call(r),Error(a(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t)))}function Jy(t){function r(K,G){if(t){var W=K.deletions;W===null?(K.deletions=[G],K.flags|=16):W.push(G)}}function s(K,G){if(!t)return null;for(;G!==null;)r(K,G),G=G.sibling;return null}function c(K){for(var G=new Map;K!==null;)K.key!==null?G.set(K.key,K):G.set(K.index,K),K=K.sibling;return G}function h(K,G){return K=oa(K,G),K.index=0,K.sibling=null,K}function p(K,G,W){return K.index=W,t?(W=K.alternate,W!==null?(W=W.index,W<G?(K.flags|=67108866,G):W):(K.flags|=67108866,G)):(K.flags|=1048576,G)}function C(K){return t&&K.alternate===null&&(K.flags|=67108866),K}function R(K,G,W,oe){return G===null||G.tag!==6?(G=th(W,K.mode,oe),G.return=K,G):(G=h(G,W),G.return=K,G)}function B(K,G,W,oe){var Pe=W.type;return Pe===A?ae(K,G,W.props.children,oe,W.key):G!==null&&(G.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===X&&ji(Pe)===G.type)?(G=h(G,W.props),nl(G,W),G.return=K,G):(G=Qc(W.type,W.key,W.props,null,K.mode,oe),nl(G,W),G.return=K,G)}function Y(K,G,W,oe){return G===null||G.tag!==4||G.stateNode.containerInfo!==W.containerInfo||G.stateNode.implementation!==W.implementation?(G=nh(W,K.mode,oe),G.return=K,G):(G=h(G,W.children||[]),G.return=K,G)}function ae(K,G,W,oe,Pe){return G===null||G.tag!==7?(G=$i(W,K.mode,oe,Pe),G.return=K,G):(G=h(G,W),G.return=K,G)}function ce(K,G,W){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return G=th(""+G,K.mode,W),G.return=K,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case S:return W=Qc(G.type,G.key,G.props,null,K.mode,W),nl(W,G),W.return=K,W;case _:return G=nh(G,K.mode,W),G.return=K,G;case X:return G=ji(G),ce(K,G,W)}if(Tt(G)||Le(G))return G=$i(G,K.mode,W,null),G.return=K,G;if(typeof G.then=="function")return ce(K,iu(G),W);if(G.$$typeof===x)return ce(K,tu(K,G),W);su(K,G)}return null}function Q(K,G,W,oe){var Pe=G!==null?G.key:null;if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return Pe!==null?null:R(K,G,""+W,oe);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case S:return W.key===Pe?B(K,G,W,oe):null;case _:return W.key===Pe?Y(K,G,W,oe):null;case X:return W=ji(W),Q(K,G,W,oe)}if(Tt(W)||Le(W))return Pe!==null?null:ae(K,G,W,oe,null);if(typeof W.then=="function")return Q(K,G,iu(W),oe);if(W.$$typeof===x)return Q(K,G,tu(K,W),oe);su(K,W)}return null}function ne(K,G,W,oe,Pe){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return K=K.get(W)||null,R(G,K,""+oe,Pe);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case S:return K=K.get(oe.key===null?W:oe.key)||null,B(G,K,oe,Pe);case _:return K=K.get(oe.key===null?W:oe.key)||null,Y(G,K,oe,Pe);case X:return oe=ji(oe),ne(K,G,W,oe,Pe)}if(Tt(oe)||Le(oe))return K=K.get(W)||null,ae(G,K,oe,Pe,null);if(typeof oe.then=="function")return ne(K,G,W,iu(oe),Pe);if(oe.$$typeof===x)return ne(K,G,W,tu(G,oe),Pe);su(G,oe)}return null}function Oe(K,G,W,oe){for(var Pe=null,mt=null,He=G,Qe=G=0,ot=null;He!==null&&Qe<W.length;Qe++){He.index>Qe?(ot=He,He=null):ot=He.sibling;var yt=Q(K,He,W[Qe],oe);if(yt===null){He===null&&(He=ot);break}t&&He&&yt.alternate===null&&r(K,He),G=p(yt,G,Qe),mt===null?Pe=yt:mt.sibling=yt,mt=yt,He=ot}if(Qe===W.length)return s(K,He),ut&&la(K,Qe),Pe;if(He===null){for(;Qe<W.length;Qe++)He=ce(K,W[Qe],oe),He!==null&&(G=p(He,G,Qe),mt===null?Pe=He:mt.sibling=He,mt=He);return ut&&la(K,Qe),Pe}for(He=c(He);Qe<W.length;Qe++)ot=ne(He,K,Qe,W[Qe],oe),ot!==null&&(t&&ot.alternate!==null&&He.delete(ot.key===null?Qe:ot.key),G=p(ot,G,Qe),mt===null?Pe=ot:mt.sibling=ot,mt=ot);return t&&He.forEach(function(oi){return r(K,oi)}),ut&&la(K,Qe),Pe}function Ge(K,G,W,oe){if(W==null)throw Error(a(151));for(var Pe=null,mt=null,He=G,Qe=G=0,ot=null,yt=W.next();He!==null&&!yt.done;Qe++,yt=W.next()){He.index>Qe?(ot=He,He=null):ot=He.sibling;var oi=Q(K,He,yt.value,oe);if(oi===null){He===null&&(He=ot);break}t&&He&&oi.alternate===null&&r(K,He),G=p(oi,G,Qe),mt===null?Pe=oi:mt.sibling=oi,mt=oi,He=ot}if(yt.done)return s(K,He),ut&&la(K,Qe),Pe;if(He===null){for(;!yt.done;Qe++,yt=W.next())yt=ce(K,yt.value,oe),yt!==null&&(G=p(yt,G,Qe),mt===null?Pe=yt:mt.sibling=yt,mt=yt);return ut&&la(K,Qe),Pe}for(He=c(He);!yt.done;Qe++,yt=W.next())yt=ne(He,K,Qe,yt.value,oe),yt!==null&&(t&&yt.alternate!==null&&He.delete(yt.key===null?Qe:yt.key),G=p(yt,G,Qe),mt===null?Pe=yt:mt.sibling=yt,mt=yt);return t&&He.forEach(function(pT){return r(K,pT)}),ut&&la(K,Qe),Pe}function Dt(K,G,W,oe){if(typeof W=="object"&&W!==null&&W.type===A&&W.key===null&&(W=W.props.children),typeof W=="object"&&W!==null){switch(W.$$typeof){case S:e:{for(var Pe=W.key;G!==null;){if(G.key===Pe){if(Pe=W.type,Pe===A){if(G.tag===7){s(K,G.sibling),oe=h(G,W.props.children),oe.return=K,K=oe;break e}}else if(G.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===X&&ji(Pe)===G.type){s(K,G.sibling),oe=h(G,W.props),nl(oe,W),oe.return=K,K=oe;break e}s(K,G);break}else r(K,G);G=G.sibling}W.type===A?(oe=$i(W.props.children,K.mode,oe,W.key),oe.return=K,K=oe):(oe=Qc(W.type,W.key,W.props,null,K.mode,oe),nl(oe,W),oe.return=K,K=oe)}return C(K);case _:e:{for(Pe=W.key;G!==null;){if(G.key===Pe)if(G.tag===4&&G.stateNode.containerInfo===W.containerInfo&&G.stateNode.implementation===W.implementation){s(K,G.sibling),oe=h(G,W.children||[]),oe.return=K,K=oe;break e}else{s(K,G);break}else r(K,G);G=G.sibling}oe=nh(W,K.mode,oe),oe.return=K,K=oe}return C(K);case X:return W=ji(W),Dt(K,G,W,oe)}if(Tt(W))return Oe(K,G,W,oe);if(Le(W)){if(Pe=Le(W),typeof Pe!="function")throw Error(a(150));return W=Pe.call(W),Ge(K,G,W,oe)}if(typeof W.then=="function")return Dt(K,G,iu(W),oe);if(W.$$typeof===x)return Dt(K,G,tu(K,W),oe);su(K,W)}return typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint"?(W=""+W,G!==null&&G.tag===6?(s(K,G.sibling),oe=h(G,W),oe.return=K,K=oe):(s(K,G),oe=th(W,K.mode,oe),oe.return=K,K=oe),C(K)):s(K,G)}return function(K,G,W,oe){try{tl=0;var Pe=Dt(K,G,W,oe);return Ls=null,Pe}catch(He){if(He===Os||He===ru)throw He;var mt=Yn(29,He,null,K.mode);return mt.lanes=oe,mt.return=K,mt}}}var Bi=Jy(!0),Qy=Jy(!1),Ga=!1;function gh(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ph(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Va(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Fa(t,r,s){var c=t.updateQueue;if(c===null)return null;if(c=c.shared,(wt&2)!==0){var h=c.pending;return h===null?r.next=r:(r.next=h.next,h.next=r),c.pending=r,r=Jc(t),Ny(t,null,s),r}return Xc(t,c,r,s),Jc(t)}function rl(t,r,s){if(r=r.updateQueue,r!==null&&(r=r.shared,(s&4194048)!==0)){var c=r.lanes;c&=t.pendingLanes,s|=c,r.lanes=s,Te(t,s)}}function mh(t,r){var s=t.updateQueue,c=t.alternate;if(c!==null&&(c=c.updateQueue,s===c)){var h=null,p=null;if(s=s.firstBaseUpdate,s!==null){do{var C={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};p===null?h=p=C:p=p.next=C,s=s.next}while(s!==null);p===null?h=p=r:p=p.next=r}else h=p=r;s={baseState:c.baseState,firstBaseUpdate:h,lastBaseUpdate:p,shared:c.shared,callbacks:c.callbacks},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=r:t.next=r,s.lastBaseUpdate=r}var yh=!1;function al(){if(yh){var t=Ds;if(t!==null)throw t}}function il(t,r,s,c){yh=!1;var h=t.updateQueue;Ga=!1;var p=h.firstBaseUpdate,C=h.lastBaseUpdate,R=h.shared.pending;if(R!==null){h.shared.pending=null;var B=R,Y=B.next;B.next=null,C===null?p=Y:C.next=Y,C=B;var ae=t.alternate;ae!==null&&(ae=ae.updateQueue,R=ae.lastBaseUpdate,R!==C&&(R===null?ae.firstBaseUpdate=Y:R.next=Y,ae.lastBaseUpdate=B))}if(p!==null){var ce=h.baseState;C=0,ae=Y=B=null,R=p;do{var Q=R.lane&-536870913,ne=Q!==R.lane;if(ne?(st&Q)===Q:(c&Q)===Q){Q!==0&&Q===ks&&(yh=!0),ae!==null&&(ae=ae.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});e:{var Oe=t,Ge=R;Q=r;var Dt=s;switch(Ge.tag){case 1:if(Oe=Ge.payload,typeof Oe=="function"){ce=Oe.call(Dt,ce,Q);break e}ce=Oe;break e;case 3:Oe.flags=Oe.flags&-65537|128;case 0:if(Oe=Ge.payload,Q=typeof Oe=="function"?Oe.call(Dt,ce,Q):Oe,Q==null)break e;ce=b({},ce,Q);break e;case 2:Ga=!0}}Q=R.callback,Q!==null&&(t.flags|=64,ne&&(t.flags|=8192),ne=h.callbacks,ne===null?h.callbacks=[Q]:ne.push(Q))}else ne={lane:Q,tag:R.tag,payload:R.payload,callback:R.callback,next:null},ae===null?(Y=ae=ne,B=ce):ae=ae.next=ne,C|=Q;if(R=R.next,R===null){if(R=h.shared.pending,R===null)break;ne=R,R=ne.next,ne.next=null,h.lastBaseUpdate=ne,h.shared.pending=null}}while(!0);ae===null&&(B=ce),h.baseState=B,h.firstBaseUpdate=Y,h.lastBaseUpdate=ae,p===null&&(h.shared.lanes=0),Ja|=C,t.lanes=C,t.memoizedState=ce}}function Zy(t,r){if(typeof t!="function")throw Error(a(191,t));t.call(r)}function eb(t,r){var s=t.callbacks;if(s!==null)for(t.callbacks=null,t=0;t<s.length;t++)Zy(s[t],r)}var Ms=N(null),ou=N(0);function tb(t,r){t=va,fe(ou,t),fe(Ms,r),va=t|r.baseLanes}function bh(){fe(ou,va),fe(Ms,Ms.current)}function vh(){va=ou.current,T(Ms),T(ou)}var Xn=N(null),ur=null;function Ka(t){var r=t.alternate;fe(Kt,Kt.current&1),fe(Xn,t),ur===null&&(r===null||Ms.current!==null||r.memoizedState!==null)&&(ur=t)}function Sh(t){fe(Kt,Kt.current),fe(Xn,t),ur===null&&(ur=t)}function nb(t){t.tag===22?(fe(Kt,Kt.current),fe(Xn,t),ur===null&&(ur=t)):Wa()}function Wa(){fe(Kt,Kt.current),fe(Xn,Xn.current)}function Jn(t){T(Xn),ur===t&&(ur=null),T(Kt)}var Kt=N(0);function lu(t){for(var r=t;r!==null;){if(r.tag===13){var s=r.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||xg(s)||Tg(s)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var da=0,Je=null,Rt=null,Qt=null,cu=!1,$s=!1,Pi=!1,uu=0,sl=0,Ns=null,ix=0;function Gt(){throw Error(a(321))}function wh(t,r){if(r===null)return!1;for(var s=0;s<r.length&&s<t.length;s++)if(!Wn(t[s],r[s]))return!1;return!0}function Ch(t,r,s,c,h,p){return da=p,Je=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,J.H=t===null||t.memoizedState===null?jb:Hh,Pi=!1,p=s(c,h),Pi=!1,$s&&(p=ab(r,s,c,h)),rb(t),p}function rb(t){J.H=cl;var r=Rt!==null&&Rt.next!==null;if(da=0,Qt=Rt=Je=null,cu=!1,sl=0,Ns=null,r)throw Error(a(300));t===null||Zt||(t=t.dependencies,t!==null&&eu(t)&&(Zt=!0))}function ab(t,r,s,c){Je=t;var h=0;do{if($s&&(Ns=null),sl=0,$s=!1,25<=h)throw Error(a(301));if(h+=1,Qt=Rt=null,t.updateQueue!=null){var p=t.updateQueue;p.lastEffect=null,p.events=null,p.stores=null,p.memoCache!=null&&(p.memoCache.index=0)}J.H=Ub,p=r(s,c)}while($s);return p}function sx(){var t=J.H,r=t.useState()[0];return r=typeof r.then=="function"?ol(r):r,t=t.useState()[0],(Rt!==null?Rt.memoizedState:null)!==t&&(Je.flags|=1024),r}function Eh(){var t=uu!==0;return uu=0,t}function _h(t,r,s){r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~s}function Ah(t){if(cu){for(t=t.memoizedState;t!==null;){var r=t.queue;r!==null&&(r.pending=null),t=t.next}cu=!1}da=0,Qt=Rt=Je=null,$s=!1,sl=uu=0,Ns=null}function Mn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qt===null?Je.memoizedState=Qt=t:Qt=Qt.next=t,Qt}function Wt(){if(Rt===null){var t=Je.alternate;t=t!==null?t.memoizedState:null}else t=Rt.next;var r=Qt===null?Je.memoizedState:Qt.next;if(r!==null)Qt=r,Rt=t;else{if(t===null)throw Je.alternate===null?Error(a(467)):Error(a(310));Rt=t,t={memoizedState:Rt.memoizedState,baseState:Rt.baseState,baseQueue:Rt.baseQueue,queue:Rt.queue,next:null},Qt===null?Je.memoizedState=Qt=t:Qt=Qt.next=t}return Qt}function du(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ol(t){var r=sl;return sl+=1,Ns===null&&(Ns=[]),t=Wy(Ns,t,r),r=Je,(Qt===null?r.memoizedState:Qt.next)===null&&(r=r.alternate,J.H=r===null||r.memoizedState===null?jb:Hh),t}function fu(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return ol(t);if(t.$$typeof===x)return wn(t)}throw Error(a(438,String(t)))}function xh(t){var r=null,s=Je.updateQueue;if(s!==null&&(r=s.memoCache),r==null){var c=Je.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(r={data:c.data.map(function(h){return h.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),s===null&&(s=du(),Je.updateQueue=s),s.memoCache=r,s=r.data[r.index],s===void 0)for(s=r.data[r.index]=Array(t),c=0;c<t;c++)s[c]=Ce;return r.index++,s}function fa(t,r){return typeof r=="function"?r(t):r}function hu(t){var r=Wt();return Th(r,Rt,t)}function Th(t,r,s){var c=t.queue;if(c===null)throw Error(a(311));c.lastRenderedReducer=s;var h=t.baseQueue,p=c.pending;if(p!==null){if(h!==null){var C=h.next;h.next=p.next,p.next=C}r.baseQueue=h=p,c.pending=null}if(p=t.baseState,h===null)t.memoizedState=p;else{r=h.next;var R=C=null,B=null,Y=r,ae=!1;do{var ce=Y.lane&-536870913;if(ce!==Y.lane?(st&ce)===ce:(da&ce)===ce){var Q=Y.revertLane;if(Q===0)B!==null&&(B=B.next={lane:0,revertLane:0,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),ce===ks&&(ae=!0);else if((da&Q)===Q){Y=Y.next,Q===ks&&(ae=!0);continue}else ce={lane:0,revertLane:Y.revertLane,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},B===null?(R=B=ce,C=p):B=B.next=ce,Je.lanes|=Q,Ja|=Q;ce=Y.action,Pi&&s(p,ce),p=Y.hasEagerState?Y.eagerState:s(p,ce)}else Q={lane:ce,revertLane:Y.revertLane,gesture:Y.gesture,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},B===null?(R=B=Q,C=p):B=B.next=Q,Je.lanes|=ce,Ja|=ce;Y=Y.next}while(Y!==null&&Y!==r);if(B===null?C=p:B.next=R,!Wn(p,t.memoizedState)&&(Zt=!0,ae&&(s=Ds,s!==null)))throw s;t.memoizedState=p,t.baseState=C,t.baseQueue=B,c.lastRenderedState=p}return h===null&&(c.lanes=0),[t.memoizedState,c.dispatch]}function Rh(t){var r=Wt(),s=r.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=t;var c=s.dispatch,h=s.pending,p=r.memoizedState;if(h!==null){s.pending=null;var C=h=h.next;do p=t(p,C.action),C=C.next;while(C!==h);Wn(p,r.memoizedState)||(Zt=!0),r.memoizedState=p,r.baseQueue===null&&(r.baseState=p),s.lastRenderedState=p}return[p,c]}function ib(t,r,s){var c=Je,h=Wt(),p=ut;if(p){if(s===void 0)throw Error(a(407));s=s()}else s=r();var C=!Wn((Rt||h).memoizedState,s);if(C&&(h.memoizedState=s,Zt=!0),h=h.queue,Oh(lb.bind(null,c,h,t),[t]),h.getSnapshot!==r||C||Qt!==null&&Qt.memoizedState.tag&1){if(c.flags|=2048,Is(9,{destroy:void 0},ob.bind(null,c,h,s,r),null),Lt===null)throw Error(a(349));p||(da&127)!==0||sb(c,r,s)}return s}function sb(t,r,s){t.flags|=16384,t={getSnapshot:r,value:s},r=Je.updateQueue,r===null?(r=du(),Je.updateQueue=r,r.stores=[t]):(s=r.stores,s===null?r.stores=[t]:s.push(t))}function ob(t,r,s,c){r.value=s,r.getSnapshot=c,cb(r)&&ub(t)}function lb(t,r,s){return s(function(){cb(r)&&ub(t)})}function cb(t){var r=t.getSnapshot;t=t.value;try{var s=r();return!Wn(t,s)}catch{return!0}}function ub(t){var r=Mi(t,2);r!==null&&Gn(r,t,2)}function kh(t){var r=Mn();if(typeof t=="function"){var s=t;if(t=s(),Pi){Tn(!0);try{s()}finally{Tn(!1)}}}return r.memoizedState=r.baseState=t,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fa,lastRenderedState:t},r}function db(t,r,s,c){return t.baseState=s,Th(t,Rt,typeof c=="function"?c:fa)}function ox(t,r,s,c,h){if(mu(t))throw Error(a(485));if(t=r.action,t!==null){var p={payload:h,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(C){p.listeners.push(C)}};J.T!==null?s(!0):p.isTransition=!1,c(p),s=r.pending,s===null?(p.next=r.pending=p,fb(r,p)):(p.next=s.next,r.pending=s.next=p)}}function fb(t,r){var s=r.action,c=r.payload,h=t.state;if(r.isTransition){var p=J.T,C={};J.T=C;try{var R=s(h,c),B=J.S;B!==null&&B(C,R),hb(t,r,R)}catch(Y){Dh(t,r,Y)}finally{p!==null&&C.types!==null&&(p.types=C.types),J.T=p}}else try{p=s(h,c),hb(t,r,p)}catch(Y){Dh(t,r,Y)}}function hb(t,r,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(c){gb(t,r,c)},function(c){return Dh(t,r,c)}):gb(t,r,s)}function gb(t,r,s){r.status="fulfilled",r.value=s,pb(r),t.state=s,r=t.pending,r!==null&&(s=r.next,s===r?t.pending=null:(s=s.next,r.next=s,fb(t,s)))}function Dh(t,r,s){var c=t.pending;if(t.pending=null,c!==null){c=c.next;do r.status="rejected",r.reason=s,pb(r),r=r.next;while(r!==c)}t.action=null}function pb(t){t=t.listeners;for(var r=0;r<t.length;r++)(0,t[r])()}function mb(t,r){return r}function yb(t,r){if(ut){var s=Lt.formState;if(s!==null){e:{var c=Je;if(ut){if($t){t:{for(var h=$t,p=cr;h.nodeType!==8;){if(!p){h=null;break t}if(h=dr(h.nextSibling),h===null){h=null;break t}}p=h.data,h=p==="F!"||p==="F"?h:null}if(h){$t=dr(h.nextSibling),c=h.data==="F!";break e}}Pa(c)}c=!1}c&&(r=s[0])}}return s=Mn(),s.memoizedState=s.baseState=r,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:mb,lastRenderedState:r},s.queue=c,s=Ib.bind(null,Je,c),c.dispatch=s,c=kh(!1),p=Ih.bind(null,Je,!1,c.queue),c=Mn(),h={state:r,dispatch:null,action:t,pending:null},c.queue=h,s=ox.bind(null,Je,h,p,s),h.dispatch=s,c.memoizedState=t,[r,s,!1]}function bb(t){var r=Wt();return vb(r,Rt,t)}function vb(t,r,s){if(r=Th(t,r,mb)[0],t=hu(fa)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var c=ol(r)}catch(C){throw C===Os?ru:C}else c=r;r=Wt();var h=r.queue,p=h.dispatch;return s!==r.memoizedState&&(Je.flags|=2048,Is(9,{destroy:void 0},lx.bind(null,h,s),null)),[c,p,t]}function lx(t,r){t.action=r}function Sb(t){var r=Wt(),s=Rt;if(s!==null)return vb(r,s,t);Wt(),r=r.memoizedState,s=Wt();var c=s.queue.dispatch;return s.memoizedState=t,[r,c,!1]}function Is(t,r,s,c){return t={tag:t,create:s,deps:c,inst:r,next:null},r=Je.updateQueue,r===null&&(r=du(),Je.updateQueue=r),s=r.lastEffect,s===null?r.lastEffect=t.next=t:(c=s.next,s.next=t,t.next=c,r.lastEffect=t),t}function wb(){return Wt().memoizedState}function gu(t,r,s,c){var h=Mn();Je.flags|=t,h.memoizedState=Is(1|r,{destroy:void 0},s,c===void 0?null:c)}function pu(t,r,s,c){var h=Wt();c=c===void 0?null:c;var p=h.memoizedState.inst;Rt!==null&&c!==null&&wh(c,Rt.memoizedState.deps)?h.memoizedState=Is(r,p,s,c):(Je.flags|=t,h.memoizedState=Is(1|r,p,s,c))}function Cb(t,r){gu(8390656,8,t,r)}function Oh(t,r){pu(2048,8,t,r)}function cx(t){Je.flags|=4;var r=Je.updateQueue;if(r===null)r=du(),Je.updateQueue=r,r.events=[t];else{var s=r.events;s===null?r.events=[t]:s.push(t)}}function Eb(t){var r=Wt().memoizedState;return cx({ref:r,nextImpl:t}),function(){if((wt&2)!==0)throw Error(a(440));return r.impl.apply(void 0,arguments)}}function _b(t,r){return pu(4,2,t,r)}function Ab(t,r){return pu(4,4,t,r)}function xb(t,r){if(typeof r=="function"){t=t();var s=r(t);return function(){typeof s=="function"?s():r(null)}}if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function Tb(t,r,s){s=s!=null?s.concat([t]):null,pu(4,4,xb.bind(null,r,t),s)}function Lh(){}function Rb(t,r){var s=Wt();r=r===void 0?null:r;var c=s.memoizedState;return r!==null&&wh(r,c[1])?c[0]:(s.memoizedState=[t,r],t)}function kb(t,r){var s=Wt();r=r===void 0?null:r;var c=s.memoizedState;if(r!==null&&wh(r,c[1]))return c[0];if(c=t(),Pi){Tn(!0);try{t()}finally{Tn(!1)}}return s.memoizedState=[c,r],c}function Mh(t,r,s){return s===void 0||(da&1073741824)!==0&&(st&261930)===0?t.memoizedState=r:(t.memoizedState=s,t=Dv(),Je.lanes|=t,Ja|=t,s)}function Db(t,r,s,c){return Wn(s,r)?s:Ms.current!==null?(t=Mh(t,s,c),Wn(t,r)||(Zt=!0),t):(da&42)===0||(da&1073741824)!==0&&(st&261930)===0?(Zt=!0,t.memoizedState=s):(t=Dv(),Je.lanes|=t,Ja|=t,r)}function Ob(t,r,s,c,h){var p=de.p;de.p=p!==0&&8>p?p:8;var C=J.T,R={};J.T=R,Ih(t,!1,r,s);try{var B=h(),Y=J.S;if(Y!==null&&Y(R,B),B!==null&&typeof B=="object"&&typeof B.then=="function"){var ae=ax(B,c);ll(t,r,ae,er(t))}else ll(t,r,c,er(t))}catch(ce){ll(t,r,{then:function(){},status:"rejected",reason:ce},er())}finally{de.p=p,C!==null&&R.types!==null&&(C.types=R.types),J.T=C}}function ux(){}function $h(t,r,s,c){if(t.tag!==5)throw Error(a(476));var h=Lb(t).queue;Ob(t,h,r,Ne,s===null?ux:function(){return Mb(t),s(c)})}function Lb(t){var r=t.memoizedState;if(r!==null)return r;r={memoizedState:Ne,baseState:Ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fa,lastRenderedState:Ne},next:null};var s={};return r.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fa,lastRenderedState:s},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function Mb(t){var r=Lb(t);r.next===null&&(r=t.alternate.memoizedState),ll(t,r.next.queue,{},er())}function Nh(){return wn(Al)}function $b(){return Wt().memoizedState}function Nb(){return Wt().memoizedState}function dx(t){for(var r=t.return;r!==null;){switch(r.tag){case 24:case 3:var s=er();t=Va(s);var c=Fa(r,t,s);c!==null&&(Gn(c,r,s),rl(c,r,s)),r={cache:uh()},t.payload=r;return}r=r.return}}function fx(t,r,s){var c=er();s={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},mu(t)?Hb(r,s):(s=Zf(t,r,s,c),s!==null&&(Gn(s,t,c),zb(s,r,c)))}function Ib(t,r,s){var c=er();ll(t,r,s,c)}function ll(t,r,s,c){var h={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(mu(t))Hb(r,h);else{var p=t.alternate;if(t.lanes===0&&(p===null||p.lanes===0)&&(p=r.lastRenderedReducer,p!==null))try{var C=r.lastRenderedState,R=p(C,s);if(h.hasEagerState=!0,h.eagerState=R,Wn(R,C))return Xc(t,r,h,0),Lt===null&&Yc(),!1}catch{}if(s=Zf(t,r,h,c),s!==null)return Gn(s,t,c),zb(s,r,c),!0}return!1}function Ih(t,r,s,c){if(c={lane:2,revertLane:gg(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},mu(t)){if(r)throw Error(a(479))}else r=Zf(t,s,c,2),r!==null&&Gn(r,t,2)}function mu(t){var r=t.alternate;return t===Je||r!==null&&r===Je}function Hb(t,r){$s=cu=!0;var s=t.pending;s===null?r.next=r:(r.next=s.next,s.next=r),t.pending=r}function zb(t,r,s){if((s&4194048)!==0){var c=r.lanes;c&=t.pendingLanes,s|=c,r.lanes=s,Te(t,s)}}var cl={readContext:wn,use:fu,useCallback:Gt,useContext:Gt,useEffect:Gt,useImperativeHandle:Gt,useLayoutEffect:Gt,useInsertionEffect:Gt,useMemo:Gt,useReducer:Gt,useRef:Gt,useState:Gt,useDebugValue:Gt,useDeferredValue:Gt,useTransition:Gt,useSyncExternalStore:Gt,useId:Gt,useHostTransitionStatus:Gt,useFormState:Gt,useActionState:Gt,useOptimistic:Gt,useMemoCache:Gt,useCacheRefresh:Gt};cl.useEffectEvent=Gt;var jb={readContext:wn,use:fu,useCallback:function(t,r){return Mn().memoizedState=[t,r===void 0?null:r],t},useContext:wn,useEffect:Cb,useImperativeHandle:function(t,r,s){s=s!=null?s.concat([t]):null,gu(4194308,4,xb.bind(null,r,t),s)},useLayoutEffect:function(t,r){return gu(4194308,4,t,r)},useInsertionEffect:function(t,r){gu(4,2,t,r)},useMemo:function(t,r){var s=Mn();r=r===void 0?null:r;var c=t();if(Pi){Tn(!0);try{t()}finally{Tn(!1)}}return s.memoizedState=[c,r],c},useReducer:function(t,r,s){var c=Mn();if(s!==void 0){var h=s(r);if(Pi){Tn(!0);try{s(r)}finally{Tn(!1)}}}else h=r;return c.memoizedState=c.baseState=h,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:h},c.queue=t,t=t.dispatch=fx.bind(null,Je,t),[c.memoizedState,t]},useRef:function(t){var r=Mn();return t={current:t},r.memoizedState=t},useState:function(t){t=kh(t);var r=t.queue,s=Ib.bind(null,Je,r);return r.dispatch=s,[t.memoizedState,s]},useDebugValue:Lh,useDeferredValue:function(t,r){var s=Mn();return Mh(s,t,r)},useTransition:function(){var t=kh(!1);return t=Ob.bind(null,Je,t.queue,!0,!1),Mn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,s){var c=Je,h=Mn();if(ut){if(s===void 0)throw Error(a(407));s=s()}else{if(s=r(),Lt===null)throw Error(a(349));(st&127)!==0||sb(c,r,s)}h.memoizedState=s;var p={value:s,getSnapshot:r};return h.queue=p,Cb(lb.bind(null,c,p,t),[t]),c.flags|=2048,Is(9,{destroy:void 0},ob.bind(null,c,p,s,r),null),s},useId:function(){var t=Mn(),r=Lt.identifierPrefix;if(ut){var s=Vr,c=Gr;s=(c&~(1<<32-on(c)-1)).toString(32)+s,r="_"+r+"R_"+s,s=uu++,0<s&&(r+="H"+s.toString(32)),r+="_"}else s=ix++,r="_"+r+"r_"+s.toString(32)+"_";return t.memoizedState=r},useHostTransitionStatus:Nh,useFormState:yb,useActionState:yb,useOptimistic:function(t){var r=Mn();r.memoizedState=r.baseState=t;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=s,r=Ih.bind(null,Je,!0,s),s.dispatch=r,[t,r]},useMemoCache:xh,useCacheRefresh:function(){return Mn().memoizedState=dx.bind(null,Je)},useEffectEvent:function(t){var r=Mn(),s={impl:t};return r.memoizedState=s,function(){if((wt&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},Hh={readContext:wn,use:fu,useCallback:Rb,useContext:wn,useEffect:Oh,useImperativeHandle:Tb,useInsertionEffect:_b,useLayoutEffect:Ab,useMemo:kb,useReducer:hu,useRef:wb,useState:function(){return hu(fa)},useDebugValue:Lh,useDeferredValue:function(t,r){var s=Wt();return Db(s,Rt.memoizedState,t,r)},useTransition:function(){var t=hu(fa)[0],r=Wt().memoizedState;return[typeof t=="boolean"?t:ol(t),r]},useSyncExternalStore:ib,useId:$b,useHostTransitionStatus:Nh,useFormState:bb,useActionState:bb,useOptimistic:function(t,r){var s=Wt();return db(s,Rt,t,r)},useMemoCache:xh,useCacheRefresh:Nb};Hh.useEffectEvent=Eb;var Ub={readContext:wn,use:fu,useCallback:Rb,useContext:wn,useEffect:Oh,useImperativeHandle:Tb,useInsertionEffect:_b,useLayoutEffect:Ab,useMemo:kb,useReducer:Rh,useRef:wb,useState:function(){return Rh(fa)},useDebugValue:Lh,useDeferredValue:function(t,r){var s=Wt();return Rt===null?Mh(s,t,r):Db(s,Rt.memoizedState,t,r)},useTransition:function(){var t=Rh(fa)[0],r=Wt().memoizedState;return[typeof t=="boolean"?t:ol(t),r]},useSyncExternalStore:ib,useId:$b,useHostTransitionStatus:Nh,useFormState:Sb,useActionState:Sb,useOptimistic:function(t,r){var s=Wt();return Rt!==null?db(s,Rt,t,r):(s.baseState=t,[t,s.queue.dispatch])},useMemoCache:xh,useCacheRefresh:Nb};Ub.useEffectEvent=Eb;function zh(t,r,s,c){r=t.memoizedState,s=s(c,r),s=s==null?r:b({},r,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var jh={enqueueSetState:function(t,r,s){t=t._reactInternals;var c=er(),h=Va(c);h.payload=r,s!=null&&(h.callback=s),r=Fa(t,h,c),r!==null&&(Gn(r,t,c),rl(r,t,c))},enqueueReplaceState:function(t,r,s){t=t._reactInternals;var c=er(),h=Va(c);h.tag=1,h.payload=r,s!=null&&(h.callback=s),r=Fa(t,h,c),r!==null&&(Gn(r,t,c),rl(r,t,c))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var s=er(),c=Va(s);c.tag=2,r!=null&&(c.callback=r),r=Fa(t,c,s),r!==null&&(Gn(r,t,s),rl(r,t,s))}};function Bb(t,r,s,c,h,p,C){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(c,p,C):r.prototype&&r.prototype.isPureReactComponent?!Yo(s,c)||!Yo(h,p):!0}function Pb(t,r,s,c){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(s,c),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(s,c),r.state!==t&&jh.enqueueReplaceState(r,r.state,null)}function qi(t,r){var s=r;if("ref"in r){s={};for(var c in r)c!=="ref"&&(s[c]=r[c])}if(t=t.defaultProps){s===r&&(s=b({},s));for(var h in t)s[h]===void 0&&(s[h]=t[h])}return s}function qb(t){Wc(t)}function Gb(t){console.error(t)}function Vb(t){Wc(t)}function yu(t,r){try{var s=t.onUncaughtError;s(r.value,{componentStack:r.stack})}catch(c){setTimeout(function(){throw c})}}function Fb(t,r,s){try{var c=t.onCaughtError;c(s.value,{componentStack:s.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function Uh(t,r,s){return s=Va(s),s.tag=3,s.payload={element:null},s.callback=function(){yu(t,r)},s}function Kb(t){return t=Va(t),t.tag=3,t}function Wb(t,r,s,c){var h=s.type.getDerivedStateFromError;if(typeof h=="function"){var p=c.value;t.payload=function(){return h(p)},t.callback=function(){Fb(r,s,c)}}var C=s.stateNode;C!==null&&typeof C.componentDidCatch=="function"&&(t.callback=function(){Fb(r,s,c),typeof h!="function"&&(Qa===null?Qa=new Set([this]):Qa.add(this));var R=c.stack;this.componentDidCatch(c.value,{componentStack:R!==null?R:""})})}function hx(t,r,s,c,h){if(s.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(r=s.alternate,r!==null&&Rs(r,s,h,!0),s=Xn.current,s!==null){switch(s.tag){case 31:case 13:return ur===null?ku():s.alternate===null&&Vt===0&&(Vt=3),s.flags&=-257,s.flags|=65536,s.lanes=h,c===au?s.flags|=16384:(r=s.updateQueue,r===null?s.updateQueue=new Set([c]):r.add(c),dg(t,c,h)),!1;case 22:return s.flags|=65536,c===au?s.flags|=16384:(r=s.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([c])},s.updateQueue=r):(s=r.retryQueue,s===null?r.retryQueue=new Set([c]):s.add(c)),dg(t,c,h)),!1}throw Error(a(435,s.tag))}return dg(t,c,h),ku(),!1}if(ut)return r=Xn.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=h,c!==ih&&(t=Error(a(422),{cause:c}),Qo(sr(t,s)))):(c!==ih&&(r=Error(a(423),{cause:c}),Qo(sr(r,s))),t=t.current.alternate,t.flags|=65536,h&=-h,t.lanes|=h,c=sr(c,s),h=Uh(t.stateNode,c,h),mh(t,h),Vt!==4&&(Vt=2)),!1;var p=Error(a(520),{cause:c});if(p=sr(p,s),yl===null?yl=[p]:yl.push(p),Vt!==4&&(Vt=2),r===null)return!0;c=sr(c,s),s=r;do{switch(s.tag){case 3:return s.flags|=65536,t=h&-h,s.lanes|=t,t=Uh(s.stateNode,c,t),mh(s,t),!1;case 1:if(r=s.type,p=s.stateNode,(s.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(Qa===null||!Qa.has(p))))return s.flags|=65536,h&=-h,s.lanes|=h,h=Kb(h),Wb(h,t,s,c),mh(s,h),!1}s=s.return}while(s!==null);return!1}var Bh=Error(a(461)),Zt=!1;function Cn(t,r,s,c){r.child=t===null?Qy(r,null,s,c):Bi(r,t.child,s,c)}function Yb(t,r,s,c,h){s=s.render;var p=r.ref;if("ref"in c){var C={};for(var R in c)R!=="ref"&&(C[R]=c[R])}else C=c;return Hi(r),c=Ch(t,r,s,C,p,h),R=Eh(),t!==null&&!Zt?(_h(t,r,h),ha(t,r,h)):(ut&&R&&rh(r),r.flags|=1,Cn(t,r,c,h),r.child)}function Xb(t,r,s,c,h){if(t===null){var p=s.type;return typeof p=="function"&&!eh(p)&&p.defaultProps===void 0&&s.compare===null?(r.tag=15,r.type=p,Jb(t,r,p,c,h)):(t=Qc(s.type,null,c,r,r.mode,h),t.ref=r.ref,t.return=r,r.child=t)}if(p=t.child,!Yh(t,h)){var C=p.memoizedProps;if(s=s.compare,s=s!==null?s:Yo,s(C,c)&&t.ref===r.ref)return ha(t,r,h)}return r.flags|=1,t=oa(p,c),t.ref=r.ref,t.return=r,r.child=t}function Jb(t,r,s,c,h){if(t!==null){var p=t.memoizedProps;if(Yo(p,c)&&t.ref===r.ref)if(Zt=!1,r.pendingProps=c=p,Yh(t,h))(t.flags&131072)!==0&&(Zt=!0);else return r.lanes=t.lanes,ha(t,r,h)}return Ph(t,r,s,c,h)}function Qb(t,r,s,c){var h=c.children,p=t!==null?t.memoizedState:null;if(t===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((r.flags&128)!==0){if(p=p!==null?p.baseLanes|s:s,t!==null){for(c=r.child=t.child,h=0;c!==null;)h=h|c.lanes|c.childLanes,c=c.sibling;c=h&~p}else c=0,r.child=null;return Zb(t,r,p,s,c)}if((s&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},t!==null&&nu(r,p!==null?p.cachePool:null),p!==null?tb(r,p):bh(),nb(r);else return c=r.lanes=536870912,Zb(t,r,p!==null?p.baseLanes|s:s,s,c)}else p!==null?(nu(r,p.cachePool),tb(r,p),Wa(),r.memoizedState=null):(t!==null&&nu(r,null),bh(),Wa());return Cn(t,r,h,s),r.child}function ul(t,r){return t!==null&&t.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function Zb(t,r,s,c,h){var p=fh();return p=p===null?null:{parent:Jt._currentValue,pool:p},r.memoizedState={baseLanes:s,cachePool:p},t!==null&&nu(r,null),bh(),nb(r),t!==null&&Rs(t,r,c,!0),r.childLanes=h,null}function bu(t,r){return r=Su({mode:r.mode,children:r.children},t.mode),r.ref=t.ref,t.child=r,r.return=t,r}function ev(t,r,s){return Bi(r,t.child,null,s),t=bu(r,r.pendingProps),t.flags|=2,Jn(r),r.memoizedState=null,t}function gx(t,r,s){var c=r.pendingProps,h=(r.flags&128)!==0;if(r.flags&=-129,t===null){if(ut){if(c.mode==="hidden")return t=bu(r,c),r.lanes=536870912,ul(null,t);if(Sh(r),(t=$t)?(t=fS(t,cr),t=t!==null&&t.data==="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:Ua!==null?{id:Gr,overflow:Vr}:null,retryLane:536870912,hydrationErrors:null},s=Hy(t),s.return=r,r.child=s,Sn=r,$t=null)):t=null,t===null)throw Pa(r);return r.lanes=536870912,null}return bu(r,c)}var p=t.memoizedState;if(p!==null){var C=p.dehydrated;if(Sh(r),h)if(r.flags&256)r.flags&=-257,r=ev(t,r,s);else if(r.memoizedState!==null)r.child=t.child,r.flags|=128,r=null;else throw Error(a(558));else if(Zt||Rs(t,r,s,!1),h=(s&t.childLanes)!==0,Zt||h){if(c=Lt,c!==null&&(C=Ue(c,s),C!==0&&C!==p.retryLane))throw p.retryLane=C,Mi(t,C),Gn(c,t,C),Bh;ku(),r=ev(t,r,s)}else t=p.treeContext,$t=dr(C.nextSibling),Sn=r,ut=!0,Ba=null,cr=!1,t!==null&&Uy(r,t),r=bu(r,c),r.flags|=4096;return r}return t=oa(t.child,{mode:c.mode,children:c.children}),t.ref=r.ref,r.child=t,t.return=r,t}function vu(t,r){var s=r.ref;if(s===null)t!==null&&t.ref!==null&&(r.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(a(284));(t===null||t.ref!==s)&&(r.flags|=4194816)}}function Ph(t,r,s,c,h){return Hi(r),s=Ch(t,r,s,c,void 0,h),c=Eh(),t!==null&&!Zt?(_h(t,r,h),ha(t,r,h)):(ut&&c&&rh(r),r.flags|=1,Cn(t,r,s,h),r.child)}function tv(t,r,s,c,h,p){return Hi(r),r.updateQueue=null,s=ab(r,c,s,h),rb(t),c=Eh(),t!==null&&!Zt?(_h(t,r,p),ha(t,r,p)):(ut&&c&&rh(r),r.flags|=1,Cn(t,r,s,p),r.child)}function nv(t,r,s,c,h){if(Hi(r),r.stateNode===null){var p=_s,C=s.contextType;typeof C=="object"&&C!==null&&(p=wn(C)),p=new s(c,p),r.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=jh,r.stateNode=p,p._reactInternals=r,p=r.stateNode,p.props=c,p.state=r.memoizedState,p.refs={},gh(r),C=s.contextType,p.context=typeof C=="object"&&C!==null?wn(C):_s,p.state=r.memoizedState,C=s.getDerivedStateFromProps,typeof C=="function"&&(zh(r,s,C,c),p.state=r.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(C=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),C!==p.state&&jh.enqueueReplaceState(p,p.state,null),il(r,c,p,h),al(),p.state=r.memoizedState),typeof p.componentDidMount=="function"&&(r.flags|=4194308),c=!0}else if(t===null){p=r.stateNode;var R=r.memoizedProps,B=qi(s,R);p.props=B;var Y=p.context,ae=s.contextType;C=_s,typeof ae=="object"&&ae!==null&&(C=wn(ae));var ce=s.getDerivedStateFromProps;ae=typeof ce=="function"||typeof p.getSnapshotBeforeUpdate=="function",R=r.pendingProps!==R,ae||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(R||Y!==C)&&Pb(r,p,c,C),Ga=!1;var Q=r.memoizedState;p.state=Q,il(r,c,p,h),al(),Y=r.memoizedState,R||Q!==Y||Ga?(typeof ce=="function"&&(zh(r,s,ce,c),Y=r.memoizedState),(B=Ga||Bb(r,s,B,c,Q,Y,C))?(ae||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"&&(r.flags|=4194308)):(typeof p.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=c,r.memoizedState=Y),p.props=c,p.state=Y,p.context=C,c=B):(typeof p.componentDidMount=="function"&&(r.flags|=4194308),c=!1)}else{p=r.stateNode,ph(t,r),C=r.memoizedProps,ae=qi(s,C),p.props=ae,ce=r.pendingProps,Q=p.context,Y=s.contextType,B=_s,typeof Y=="object"&&Y!==null&&(B=wn(Y)),R=s.getDerivedStateFromProps,(Y=typeof R=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(C!==ce||Q!==B)&&Pb(r,p,c,B),Ga=!1,Q=r.memoizedState,p.state=Q,il(r,c,p,h),al();var ne=r.memoizedState;C!==ce||Q!==ne||Ga||t!==null&&t.dependencies!==null&&eu(t.dependencies)?(typeof R=="function"&&(zh(r,s,R,c),ne=r.memoizedState),(ae=Ga||Bb(r,s,ae,c,Q,ne,B)||t!==null&&t.dependencies!==null&&eu(t.dependencies))?(Y||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(c,ne,B),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(c,ne,B)),typeof p.componentDidUpdate=="function"&&(r.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof p.componentDidUpdate!="function"||C===t.memoizedProps&&Q===t.memoizedState||(r.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||C===t.memoizedProps&&Q===t.memoizedState||(r.flags|=1024),r.memoizedProps=c,r.memoizedState=ne),p.props=c,p.state=ne,p.context=B,c=ae):(typeof p.componentDidUpdate!="function"||C===t.memoizedProps&&Q===t.memoizedState||(r.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||C===t.memoizedProps&&Q===t.memoizedState||(r.flags|=1024),c=!1)}return p=c,vu(t,r),c=(r.flags&128)!==0,p||c?(p=r.stateNode,s=c&&typeof s.getDerivedStateFromError!="function"?null:p.render(),r.flags|=1,t!==null&&c?(r.child=Bi(r,t.child,null,h),r.child=Bi(r,null,s,h)):Cn(t,r,s,h),r.memoizedState=p.state,t=r.child):t=ha(t,r,h),t}function rv(t,r,s,c){return Ni(),r.flags|=256,Cn(t,r,s,c),r.child}var qh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Gh(t){return{baseLanes:t,cachePool:Fy()}}function Vh(t,r,s){return t=t!==null?t.childLanes&~s:0,r&&(t|=Zn),t}function av(t,r,s){var c=r.pendingProps,h=!1,p=(r.flags&128)!==0,C;if((C=p)||(C=t!==null&&t.memoizedState===null?!1:(Kt.current&2)!==0),C&&(h=!0,r.flags&=-129),C=(r.flags&32)!==0,r.flags&=-33,t===null){if(ut){if(h?Ka(r):Wa(),(t=$t)?(t=fS(t,cr),t=t!==null&&t.data!=="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:Ua!==null?{id:Gr,overflow:Vr}:null,retryLane:536870912,hydrationErrors:null},s=Hy(t),s.return=r,r.child=s,Sn=r,$t=null)):t=null,t===null)throw Pa(r);return Tg(t)?r.lanes=32:r.lanes=536870912,null}var R=c.children;return c=c.fallback,h?(Wa(),h=r.mode,R=Su({mode:"hidden",children:R},h),c=$i(c,h,s,null),R.return=r,c.return=r,R.sibling=c,r.child=R,c=r.child,c.memoizedState=Gh(s),c.childLanes=Vh(t,C,s),r.memoizedState=qh,ul(null,c)):(Ka(r),Fh(r,R))}var B=t.memoizedState;if(B!==null&&(R=B.dehydrated,R!==null)){if(p)r.flags&256?(Ka(r),r.flags&=-257,r=Kh(t,r,s)):r.memoizedState!==null?(Wa(),r.child=t.child,r.flags|=128,r=null):(Wa(),R=c.fallback,h=r.mode,c=Su({mode:"visible",children:c.children},h),R=$i(R,h,s,null),R.flags|=2,c.return=r,R.return=r,c.sibling=R,r.child=c,Bi(r,t.child,null,s),c=r.child,c.memoizedState=Gh(s),c.childLanes=Vh(t,C,s),r.memoizedState=qh,r=ul(null,c));else if(Ka(r),Tg(R)){if(C=R.nextSibling&&R.nextSibling.dataset,C)var Y=C.dgst;C=Y,c=Error(a(419)),c.stack="",c.digest=C,Qo({value:c,source:null,stack:null}),r=Kh(t,r,s)}else if(Zt||Rs(t,r,s,!1),C=(s&t.childLanes)!==0,Zt||C){if(C=Lt,C!==null&&(c=Ue(C,s),c!==0&&c!==B.retryLane))throw B.retryLane=c,Mi(t,c),Gn(C,t,c),Bh;xg(R)||ku(),r=Kh(t,r,s)}else xg(R)?(r.flags|=192,r.child=t.child,r=null):(t=B.treeContext,$t=dr(R.nextSibling),Sn=r,ut=!0,Ba=null,cr=!1,t!==null&&Uy(r,t),r=Fh(r,c.children),r.flags|=4096);return r}return h?(Wa(),R=c.fallback,h=r.mode,B=t.child,Y=B.sibling,c=oa(B,{mode:"hidden",children:c.children}),c.subtreeFlags=B.subtreeFlags&65011712,Y!==null?R=oa(Y,R):(R=$i(R,h,s,null),R.flags|=2),R.return=r,c.return=r,c.sibling=R,r.child=c,ul(null,c),c=r.child,R=t.child.memoizedState,R===null?R=Gh(s):(h=R.cachePool,h!==null?(B=Jt._currentValue,h=h.parent!==B?{parent:B,pool:B}:h):h=Fy(),R={baseLanes:R.baseLanes|s,cachePool:h}),c.memoizedState=R,c.childLanes=Vh(t,C,s),r.memoizedState=qh,ul(t.child,c)):(Ka(r),s=t.child,t=s.sibling,s=oa(s,{mode:"visible",children:c.children}),s.return=r,s.sibling=null,t!==null&&(C=r.deletions,C===null?(r.deletions=[t],r.flags|=16):C.push(t)),r.child=s,r.memoizedState=null,s)}function Fh(t,r){return r=Su({mode:"visible",children:r},t.mode),r.return=t,t.child=r}function Su(t,r){return t=Yn(22,t,null,r),t.lanes=0,t}function Kh(t,r,s){return Bi(r,t.child,null,s),t=Fh(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function iv(t,r,s){t.lanes|=r;var c=t.alternate;c!==null&&(c.lanes|=r),lh(t.return,r,s)}function Wh(t,r,s,c,h,p){var C=t.memoizedState;C===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:c,tail:s,tailMode:h,treeForkCount:p}:(C.isBackwards=r,C.rendering=null,C.renderingStartTime=0,C.last=c,C.tail=s,C.tailMode=h,C.treeForkCount=p)}function sv(t,r,s){var c=r.pendingProps,h=c.revealOrder,p=c.tail;c=c.children;var C=Kt.current,R=(C&2)!==0;if(R?(C=C&1|2,r.flags|=128):C&=1,fe(Kt,C),Cn(t,r,c,s),c=ut?Jo:0,!R&&t!==null&&(t.flags&128)!==0)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&iv(t,s,r);else if(t.tag===19)iv(t,s,r);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===r)break e;for(;t.sibling===null;){if(t.return===null||t.return===r)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(h){case"forwards":for(s=r.child,h=null;s!==null;)t=s.alternate,t!==null&&lu(t)===null&&(h=s),s=s.sibling;s=h,s===null?(h=r.child,r.child=null):(h=s.sibling,s.sibling=null),Wh(r,!1,h,s,p,c);break;case"backwards":case"unstable_legacy-backwards":for(s=null,h=r.child,r.child=null;h!==null;){if(t=h.alternate,t!==null&&lu(t)===null){r.child=h;break}t=h.sibling,h.sibling=s,s=h,h=t}Wh(r,!0,s,null,p,c);break;case"together":Wh(r,!1,null,null,void 0,c);break;default:r.memoizedState=null}return r.child}function ha(t,r,s){if(t!==null&&(r.dependencies=t.dependencies),Ja|=r.lanes,(s&r.childLanes)===0)if(t!==null){if(Rs(t,r,s,!1),(s&r.childLanes)===0)return null}else return null;if(t!==null&&r.child!==t.child)throw Error(a(153));if(r.child!==null){for(t=r.child,s=oa(t,t.pendingProps),r.child=s,s.return=r;t.sibling!==null;)t=t.sibling,s=s.sibling=oa(t,t.pendingProps),s.return=r;s.sibling=null}return r.child}function Yh(t,r){return(t.lanes&r)!==0?!0:(t=t.dependencies,!!(t!==null&&eu(t)))}function px(t,r,s){switch(r.tag){case 3:qe(r,r.stateNode.containerInfo),qa(r,Jt,t.memoizedState.cache),Ni();break;case 27:case 5:ze(r);break;case 4:qe(r,r.stateNode.containerInfo);break;case 10:qa(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Sh(r),null;break;case 13:var c=r.memoizedState;if(c!==null)return c.dehydrated!==null?(Ka(r),r.flags|=128,null):(s&r.child.childLanes)!==0?av(t,r,s):(Ka(r),t=ha(t,r,s),t!==null?t.sibling:null);Ka(r);break;case 19:var h=(t.flags&128)!==0;if(c=(s&r.childLanes)!==0,c||(Rs(t,r,s,!1),c=(s&r.childLanes)!==0),h){if(c)return sv(t,r,s);r.flags|=128}if(h=r.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),fe(Kt,Kt.current),c)break;return null;case 22:return r.lanes=0,Qb(t,r,s,r.pendingProps);case 24:qa(r,Jt,t.memoizedState.cache)}return ha(t,r,s)}function ov(t,r,s){if(t!==null)if(t.memoizedProps!==r.pendingProps)Zt=!0;else{if(!Yh(t,s)&&(r.flags&128)===0)return Zt=!1,px(t,r,s);Zt=(t.flags&131072)!==0}else Zt=!1,ut&&(r.flags&1048576)!==0&&jy(r,Jo,r.index);switch(r.lanes=0,r.tag){case 16:e:{var c=r.pendingProps;if(t=ji(r.elementType),r.type=t,typeof t=="function")eh(t)?(c=qi(t,c),r.tag=1,r=nv(null,r,t,c,s)):(r.tag=0,r=Ph(null,r,t,c,s));else{if(t!=null){var h=t.$$typeof;if(h===D){r.tag=11,r=Yb(null,r,t,c,s);break e}else if(h===q){r.tag=14,r=Xb(null,r,t,c,s);break e}}throw r=Fe(t)||t,Error(a(306,r,""))}}return r;case 0:return Ph(t,r,r.type,r.pendingProps,s);case 1:return c=r.type,h=qi(c,r.pendingProps),nv(t,r,c,h,s);case 3:e:{if(qe(r,r.stateNode.containerInfo),t===null)throw Error(a(387));c=r.pendingProps;var p=r.memoizedState;h=p.element,ph(t,r),il(r,c,null,s);var C=r.memoizedState;if(c=C.cache,qa(r,Jt,c),c!==p.cache&&ch(r,[Jt],s,!0),al(),c=C.element,p.isDehydrated)if(p={element:c,isDehydrated:!1,cache:C.cache},r.updateQueue.baseState=p,r.memoizedState=p,r.flags&256){r=rv(t,r,c,s);break e}else if(c!==h){h=sr(Error(a(424)),r),Qo(h),r=rv(t,r,c,s);break e}else for(t=r.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,$t=dr(t.firstChild),Sn=r,ut=!0,Ba=null,cr=!0,s=Qy(r,null,c,s),r.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(Ni(),c===h){r=ha(t,r,s);break e}Cn(t,r,c,s)}r=r.child}return r;case 26:return vu(t,r),t===null?(s=bS(r.type,null,r.pendingProps,null))?r.memoizedState=s:ut||(s=r.type,t=r.pendingProps,c=Iu(te.current).createElement(s),c[un]=r,c[kn]=t,En(c,s,t),Xt(c),r.stateNode=c):r.memoizedState=bS(r.type,t.memoizedProps,r.pendingProps,t.memoizedState),null;case 27:return ze(r),t===null&&ut&&(c=r.stateNode=pS(r.type,r.pendingProps,te.current),Sn=r,cr=!0,h=$t,ni(r.type)?(Rg=h,$t=dr(c.firstChild)):$t=h),Cn(t,r,r.pendingProps.children,s),vu(t,r),t===null&&(r.flags|=4194304),r.child;case 5:return t===null&&ut&&((h=c=$t)&&(c=Vx(c,r.type,r.pendingProps,cr),c!==null?(r.stateNode=c,Sn=r,$t=dr(c.firstChild),cr=!1,h=!0):h=!1),h||Pa(r)),ze(r),h=r.type,p=r.pendingProps,C=t!==null?t.memoizedProps:null,c=p.children,Eg(h,p)?c=null:C!==null&&Eg(h,C)&&(r.flags|=32),r.memoizedState!==null&&(h=Ch(t,r,sx,null,null,s),Al._currentValue=h),vu(t,r),Cn(t,r,c,s),r.child;case 6:return t===null&&ut&&((t=s=$t)&&(s=Fx(s,r.pendingProps,cr),s!==null?(r.stateNode=s,Sn=r,$t=null,t=!0):t=!1),t||Pa(r)),null;case 13:return av(t,r,s);case 4:return qe(r,r.stateNode.containerInfo),c=r.pendingProps,t===null?r.child=Bi(r,null,c,s):Cn(t,r,c,s),r.child;case 11:return Yb(t,r,r.type,r.pendingProps,s);case 7:return Cn(t,r,r.pendingProps,s),r.child;case 8:return Cn(t,r,r.pendingProps.children,s),r.child;case 12:return Cn(t,r,r.pendingProps.children,s),r.child;case 10:return c=r.pendingProps,qa(r,r.type,c.value),Cn(t,r,c.children,s),r.child;case 9:return h=r.type._context,c=r.pendingProps.children,Hi(r),h=wn(h),c=c(h),r.flags|=1,Cn(t,r,c,s),r.child;case 14:return Xb(t,r,r.type,r.pendingProps,s);case 15:return Jb(t,r,r.type,r.pendingProps,s);case 19:return sv(t,r,s);case 31:return gx(t,r,s);case 22:return Qb(t,r,s,r.pendingProps);case 24:return Hi(r),c=wn(Jt),t===null?(h=fh(),h===null&&(h=Lt,p=uh(),h.pooledCache=p,p.refCount++,p!==null&&(h.pooledCacheLanes|=s),h=p),r.memoizedState={parent:c,cache:h},gh(r),qa(r,Jt,h)):((t.lanes&s)!==0&&(ph(t,r),il(r,null,null,s),al()),h=t.memoizedState,p=r.memoizedState,h.parent!==c?(h={parent:c,cache:c},r.memoizedState=h,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=h),qa(r,Jt,c)):(c=p.cache,qa(r,Jt,c),c!==h.cache&&ch(r,[Jt],s,!0))),Cn(t,r,r.pendingProps.children,s),r.child;case 29:throw r.pendingProps}throw Error(a(156,r.tag))}function ga(t){t.flags|=4}function Xh(t,r,s,c,h){if((r=(t.mode&32)!==0)&&(r=!1),r){if(t.flags|=16777216,(h&335544128)===h)if(t.stateNode.complete)t.flags|=8192;else if($v())t.flags|=8192;else throw Ui=au,hh}else t.flags&=-16777217}function lv(t,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!ES(r))if($v())t.flags|=8192;else throw Ui=au,hh}function wu(t,r){r!==null&&(t.flags|=4),t.flags&16384&&(r=t.tag!==22?Ie():536870912,t.lanes|=r,Us|=r)}function dl(t,r){if(!ut)switch(t.tailMode){case"hidden":r=t.tail;for(var s=null;r!==null;)r.alternate!==null&&(s=r),r=r.sibling;s===null?t.tail=null:s.sibling=null;break;case"collapsed":s=t.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:c.sibling=null}}function Nt(t){var r=t.alternate!==null&&t.alternate.child===t.child,s=0,c=0;if(r)for(var h=t.child;h!==null;)s|=h.lanes|h.childLanes,c|=h.subtreeFlags&65011712,c|=h.flags&65011712,h.return=t,h=h.sibling;else for(h=t.child;h!==null;)s|=h.lanes|h.childLanes,c|=h.subtreeFlags,c|=h.flags,h.return=t,h=h.sibling;return t.subtreeFlags|=c,t.childLanes=s,r}function mx(t,r,s){var c=r.pendingProps;switch(ah(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Nt(r),null;case 1:return Nt(r),null;case 3:return s=r.stateNode,c=null,t!==null&&(c=t.memoizedState.cache),r.memoizedState.cache!==c&&(r.flags|=2048),ua(Jt),ke(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(Ts(r)?ga(r):t===null||t.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,sh())),Nt(r),null;case 26:var h=r.type,p=r.memoizedState;return t===null?(ga(r),p!==null?(Nt(r),lv(r,p)):(Nt(r),Xh(r,h,null,c,s))):p?p!==t.memoizedState?(ga(r),Nt(r),lv(r,p)):(Nt(r),r.flags&=-16777217):(t=t.memoizedProps,t!==c&&ga(r),Nt(r),Xh(r,h,t,c,s)),null;case 27:if(Ct(r),s=te.current,h=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==c&&ga(r);else{if(!c){if(r.stateNode===null)throw Error(a(166));return Nt(r),null}t=he.current,Ts(r)?By(r):(t=pS(h,c,s),r.stateNode=t,ga(r))}return Nt(r),null;case 5:if(Ct(r),h=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==c&&ga(r);else{if(!c){if(r.stateNode===null)throw Error(a(166));return Nt(r),null}if(p=he.current,Ts(r))By(r);else{var C=Iu(te.current);switch(p){case 1:p=C.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:p=C.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":p=C.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":p=C.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":p=C.createElement("div"),p.innerHTML="<script><\/script>",p=p.removeChild(p.firstChild);break;case"select":p=typeof c.is=="string"?C.createElement("select",{is:c.is}):C.createElement("select"),c.multiple?p.multiple=!0:c.size&&(p.size=c.size);break;default:p=typeof c.is=="string"?C.createElement(h,{is:c.is}):C.createElement(h)}}p[un]=r,p[kn]=c;e:for(C=r.child;C!==null;){if(C.tag===5||C.tag===6)p.appendChild(C.stateNode);else if(C.tag!==4&&C.tag!==27&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===r)break e;for(;C.sibling===null;){if(C.return===null||C.return===r)break e;C=C.return}C.sibling.return=C.return,C=C.sibling}r.stateNode=p;e:switch(En(p,h,c),h){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&ga(r)}}return Nt(r),Xh(r,r.type,t===null?null:t.memoizedProps,r.pendingProps,s),null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==c&&ga(r);else{if(typeof c!="string"&&r.stateNode===null)throw Error(a(166));if(t=te.current,Ts(r)){if(t=r.stateNode,s=r.memoizedProps,c=null,h=Sn,h!==null)switch(h.tag){case 27:case 5:c=h.memoizedProps}t[un]=r,t=!!(t.nodeValue===s||c!==null&&c.suppressHydrationWarning===!0||aS(t.nodeValue,s)),t||Pa(r,!0)}else t=Iu(t).createTextNode(c),t[un]=r,r.stateNode=t}return Nt(r),null;case 31:if(s=r.memoizedState,t===null||t.memoizedState!==null){if(c=Ts(r),s!==null){if(t===null){if(!c)throw Error(a(318));if(t=r.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(557));t[un]=r}else Ni(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Nt(r),t=!1}else s=sh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=s),t=!0;if(!t)return r.flags&256?(Jn(r),r):(Jn(r),null);if((r.flags&128)!==0)throw Error(a(558))}return Nt(r),null;case 13:if(c=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(h=Ts(r),c!==null&&c.dehydrated!==null){if(t===null){if(!h)throw Error(a(318));if(h=r.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(a(317));h[un]=r}else Ni(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Nt(r),h=!1}else h=sh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=h),h=!0;if(!h)return r.flags&256?(Jn(r),r):(Jn(r),null)}return Jn(r),(r.flags&128)!==0?(r.lanes=s,r):(s=c!==null,t=t!==null&&t.memoizedState!==null,s&&(c=r.child,h=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(h=c.alternate.memoizedState.cachePool.pool),p=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(p=c.memoizedState.cachePool.pool),p!==h&&(c.flags|=2048)),s!==t&&s&&(r.child.flags|=8192),wu(r,r.updateQueue),Nt(r),null);case 4:return ke(),t===null&&bg(r.stateNode.containerInfo),Nt(r),null;case 10:return ua(r.type),Nt(r),null;case 19:if(T(Kt),c=r.memoizedState,c===null)return Nt(r),null;if(h=(r.flags&128)!==0,p=c.rendering,p===null)if(h)dl(c,!1);else{if(Vt!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(p=lu(t),p!==null){for(r.flags|=128,dl(c,!1),t=p.updateQueue,r.updateQueue=t,wu(r,t),r.subtreeFlags=0,t=s,s=r.child;s!==null;)Iy(s,t),s=s.sibling;return fe(Kt,Kt.current&1|2),ut&&la(r,c.treeForkCount),r.child}t=t.sibling}c.tail!==null&&qt()>xu&&(r.flags|=128,h=!0,dl(c,!1),r.lanes=4194304)}else{if(!h)if(t=lu(p),t!==null){if(r.flags|=128,h=!0,t=t.updateQueue,r.updateQueue=t,wu(r,t),dl(c,!0),c.tail===null&&c.tailMode==="hidden"&&!p.alternate&&!ut)return Nt(r),null}else 2*qt()-c.renderingStartTime>xu&&s!==536870912&&(r.flags|=128,h=!0,dl(c,!1),r.lanes=4194304);c.isBackwards?(p.sibling=r.child,r.child=p):(t=c.last,t!==null?t.sibling=p:r.child=p,c.last=p)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=qt(),t.sibling=null,s=Kt.current,fe(Kt,h?s&1|2:s&1),ut&&la(r,c.treeForkCount),t):(Nt(r),null);case 22:case 23:return Jn(r),vh(),c=r.memoizedState!==null,t!==null?t.memoizedState!==null!==c&&(r.flags|=8192):c&&(r.flags|=8192),c?(s&536870912)!==0&&(r.flags&128)===0&&(Nt(r),r.subtreeFlags&6&&(r.flags|=8192)):Nt(r),s=r.updateQueue,s!==null&&wu(r,s.retryQueue),s=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),c=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),c!==s&&(r.flags|=2048),t!==null&&T(zi),null;case 24:return s=null,t!==null&&(s=t.memoizedState.cache),r.memoizedState.cache!==s&&(r.flags|=2048),ua(Jt),Nt(r),null;case 25:return null;case 30:return null}throw Error(a(156,r.tag))}function yx(t,r){switch(ah(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return ua(Jt),ke(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 26:case 27:case 5:return Ct(r),null;case 31:if(r.memoizedState!==null){if(Jn(r),r.alternate===null)throw Error(a(340));Ni()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 13:if(Jn(r),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(a(340));Ni()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return T(Kt),null;case 4:return ke(),null;case 10:return ua(r.type),null;case 22:case 23:return Jn(r),vh(),t!==null&&T(zi),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return ua(Jt),null;case 25:return null;default:return null}}function cv(t,r){switch(ah(r),r.tag){case 3:ua(Jt),ke();break;case 26:case 27:case 5:Ct(r);break;case 4:ke();break;case 31:r.memoizedState!==null&&Jn(r);break;case 13:Jn(r);break;case 19:T(Kt);break;case 10:ua(r.type);break;case 22:case 23:Jn(r),vh(),t!==null&&T(zi);break;case 24:ua(Jt)}}function fl(t,r){try{var s=r.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var h=c.next;s=h;do{if((s.tag&t)===t){c=void 0;var p=s.create,C=s.inst;c=p(),C.destroy=c}s=s.next}while(s!==h)}}catch(R){xt(r,r.return,R)}}function Ya(t,r,s){try{var c=r.updateQueue,h=c!==null?c.lastEffect:null;if(h!==null){var p=h.next;c=p;do{if((c.tag&t)===t){var C=c.inst,R=C.destroy;if(R!==void 0){C.destroy=void 0,h=r;var B=s,Y=R;try{Y()}catch(ae){xt(h,B,ae)}}}c=c.next}while(c!==p)}}catch(ae){xt(r,r.return,ae)}}function uv(t){var r=t.updateQueue;if(r!==null){var s=t.stateNode;try{eb(r,s)}catch(c){xt(t,t.return,c)}}}function dv(t,r,s){s.props=qi(t.type,t.memoizedProps),s.state=t.memoizedState;try{s.componentWillUnmount()}catch(c){xt(t,r,c)}}function hl(t,r){try{var s=t.ref;if(s!==null){switch(t.tag){case 26:case 27:case 5:var c=t.stateNode;break;case 30:c=t.stateNode;break;default:c=t.stateNode}typeof s=="function"?t.refCleanup=s(c):s.current=c}}catch(h){xt(t,r,h)}}function Fr(t,r){var s=t.ref,c=t.refCleanup;if(s!==null)if(typeof c=="function")try{c()}catch(h){xt(t,r,h)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(h){xt(t,r,h)}else s.current=null}function fv(t){var r=t.type,s=t.memoizedProps,c=t.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":s.autoFocus&&c.focus();break e;case"img":s.src?c.src=s.src:s.srcSet&&(c.srcset=s.srcSet)}}catch(h){xt(t,t.return,h)}}function Jh(t,r,s){try{var c=t.stateNode;jx(c,t.type,s,r),c[kn]=r}catch(h){xt(t,t.return,h)}}function hv(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ni(t.type)||t.tag===4}function Qh(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||hv(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&ni(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Zh(t,r,s){var c=t.tag;if(c===5||c===6)t=t.stateNode,r?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(t,r):(r=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,r.appendChild(t),s=s._reactRootContainer,s!=null||r.onclick!==null||(r.onclick=xr));else if(c!==4&&(c===27&&ni(t.type)&&(s=t.stateNode,r=null),t=t.child,t!==null))for(Zh(t,r,s),t=t.sibling;t!==null;)Zh(t,r,s),t=t.sibling}function Cu(t,r,s){var c=t.tag;if(c===5||c===6)t=t.stateNode,r?s.insertBefore(t,r):s.appendChild(t);else if(c!==4&&(c===27&&ni(t.type)&&(s=t.stateNode),t=t.child,t!==null))for(Cu(t,r,s),t=t.sibling;t!==null;)Cu(t,r,s),t=t.sibling}function gv(t){var r=t.stateNode,s=t.memoizedProps;try{for(var c=t.type,h=r.attributes;h.length;)r.removeAttributeNode(h[0]);En(r,c,s),r[un]=t,r[kn]=s}catch(p){xt(t,t.return,p)}}var pa=!1,en=!1,eg=!1,pv=typeof WeakSet=="function"?WeakSet:Set,pn=null;function bx(t,r){if(t=t.containerInfo,wg=qu,t=Ty(t),Kf(t)){if("selectionStart"in t)var s={start:t.selectionStart,end:t.selectionEnd};else e:{s=(s=t.ownerDocument)&&s.defaultView||window;var c=s.getSelection&&s.getSelection();if(c&&c.rangeCount!==0){s=c.anchorNode;var h=c.anchorOffset,p=c.focusNode;c=c.focusOffset;try{s.nodeType,p.nodeType}catch{s=null;break e}var C=0,R=-1,B=-1,Y=0,ae=0,ce=t,Q=null;t:for(;;){for(var ne;ce!==s||h!==0&&ce.nodeType!==3||(R=C+h),ce!==p||c!==0&&ce.nodeType!==3||(B=C+c),ce.nodeType===3&&(C+=ce.nodeValue.length),(ne=ce.firstChild)!==null;)Q=ce,ce=ne;for(;;){if(ce===t)break t;if(Q===s&&++Y===h&&(R=C),Q===p&&++ae===c&&(B=C),(ne=ce.nextSibling)!==null)break;ce=Q,Q=ce.parentNode}ce=ne}s=R===-1||B===-1?null:{start:R,end:B}}else s=null}s=s||{start:0,end:0}}else s=null;for(Cg={focusedElem:t,selectionRange:s},qu=!1,pn=r;pn!==null;)if(r=pn,t=r.child,(r.subtreeFlags&1028)!==0&&t!==null)t.return=r,pn=t;else for(;pn!==null;){switch(r=pn,p=r.alternate,t=r.flags,r.tag){case 0:if((t&4)!==0&&(t=r.updateQueue,t=t!==null?t.events:null,t!==null))for(s=0;s<t.length;s++)h=t[s],h.ref.impl=h.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&p!==null){t=void 0,s=r,h=p.memoizedProps,p=p.memoizedState,c=s.stateNode;try{var Oe=qi(s.type,h);t=c.getSnapshotBeforeUpdate(Oe,p),c.__reactInternalSnapshotBeforeUpdate=t}catch(Ge){xt(s,s.return,Ge)}}break;case 3:if((t&1024)!==0){if(t=r.stateNode.containerInfo,s=t.nodeType,s===9)Ag(t);else if(s===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Ag(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(a(163))}if(t=r.sibling,t!==null){t.return=r.return,pn=t;break}pn=r.return}}function mv(t,r,s){var c=s.flags;switch(s.tag){case 0:case 11:case 15:ya(t,s),c&4&&fl(5,s);break;case 1:if(ya(t,s),c&4)if(t=s.stateNode,r===null)try{t.componentDidMount()}catch(C){xt(s,s.return,C)}else{var h=qi(s.type,r.memoizedProps);r=r.memoizedState;try{t.componentDidUpdate(h,r,t.__reactInternalSnapshotBeforeUpdate)}catch(C){xt(s,s.return,C)}}c&64&&uv(s),c&512&&hl(s,s.return);break;case 3:if(ya(t,s),c&64&&(t=s.updateQueue,t!==null)){if(r=null,s.child!==null)switch(s.child.tag){case 27:case 5:r=s.child.stateNode;break;case 1:r=s.child.stateNode}try{eb(t,r)}catch(C){xt(s,s.return,C)}}break;case 27:r===null&&c&4&&gv(s);case 26:case 5:ya(t,s),r===null&&c&4&&fv(s),c&512&&hl(s,s.return);break;case 12:ya(t,s);break;case 31:ya(t,s),c&4&&vv(t,s);break;case 13:ya(t,s),c&4&&Sv(t,s),c&64&&(t=s.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(s=Tx.bind(null,s),Kx(t,s))));break;case 22:if(c=s.memoizedState!==null||pa,!c){r=r!==null&&r.memoizedState!==null||en,h=pa;var p=en;pa=c,(en=r)&&!p?ba(t,s,(s.subtreeFlags&8772)!==0):ya(t,s),pa=h,en=p}break;case 30:break;default:ya(t,s)}}function yv(t){var r=t.alternate;r!==null&&(t.alternate=null,yv(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&Mo(r)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var It=null,Un=!1;function ma(t,r,s){for(s=s.child;s!==null;)bv(t,r,s),s=s.sibling}function bv(t,r,s){if(sn&&typeof sn.onCommitFiberUnmount=="function")try{sn.onCommitFiberUnmount(rr,s)}catch{}switch(s.tag){case 26:en||Fr(s,r),ma(t,r,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:en||Fr(s,r);var c=It,h=Un;ni(s.type)&&(It=s.stateNode,Un=!1),ma(t,r,s),Cl(s.stateNode),It=c,Un=h;break;case 5:en||Fr(s,r);case 6:if(c=It,h=Un,It=null,ma(t,r,s),It=c,Un=h,It!==null)if(Un)try{(It.nodeType===9?It.body:It.nodeName==="HTML"?It.ownerDocument.body:It).removeChild(s.stateNode)}catch(p){xt(s,r,p)}else try{It.removeChild(s.stateNode)}catch(p){xt(s,r,p)}break;case 18:It!==null&&(Un?(t=It,uS(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,s.stateNode),Ws(t)):uS(It,s.stateNode));break;case 4:c=It,h=Un,It=s.stateNode.containerInfo,Un=!0,ma(t,r,s),It=c,Un=h;break;case 0:case 11:case 14:case 15:Ya(2,s,r),en||Ya(4,s,r),ma(t,r,s);break;case 1:en||(Fr(s,r),c=s.stateNode,typeof c.componentWillUnmount=="function"&&dv(s,r,c)),ma(t,r,s);break;case 21:ma(t,r,s);break;case 22:en=(c=en)||s.memoizedState!==null,ma(t,r,s),en=c;break;default:ma(t,r,s)}}function vv(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Ws(t)}catch(s){xt(r,r.return,s)}}}function Sv(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Ws(t)}catch(s){xt(r,r.return,s)}}function vx(t){switch(t.tag){case 31:case 13:case 19:var r=t.stateNode;return r===null&&(r=t.stateNode=new pv),r;case 22:return t=t.stateNode,r=t._retryCache,r===null&&(r=t._retryCache=new pv),r;default:throw Error(a(435,t.tag))}}function Eu(t,r){var s=vx(t);r.forEach(function(c){if(!s.has(c)){s.add(c);var h=Rx.bind(null,t,c);c.then(h,h)}})}function Bn(t,r){var s=r.deletions;if(s!==null)for(var c=0;c<s.length;c++){var h=s[c],p=t,C=r,R=C;e:for(;R!==null;){switch(R.tag){case 27:if(ni(R.type)){It=R.stateNode,Un=!1;break e}break;case 5:It=R.stateNode,Un=!1;break e;case 3:case 4:It=R.stateNode.containerInfo,Un=!0;break e}R=R.return}if(It===null)throw Error(a(160));bv(p,C,h),It=null,Un=!1,p=h.alternate,p!==null&&(p.return=null),h.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)wv(r,t),r=r.sibling}var Or=null;function wv(t,r){var s=t.alternate,c=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Bn(r,t),Pn(t),c&4&&(Ya(3,t,t.return),fl(3,t),Ya(5,t,t.return));break;case 1:Bn(r,t),Pn(t),c&512&&(en||s===null||Fr(s,s.return)),c&64&&pa&&(t=t.updateQueue,t!==null&&(c=t.callbacks,c!==null&&(s=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=s===null?c:s.concat(c))));break;case 26:var h=Or;if(Bn(r,t),Pn(t),c&512&&(en||s===null||Fr(s,s.return)),c&4){var p=s!==null?s.memoizedState:null;if(c=t.memoizedState,s===null)if(c===null)if(t.stateNode===null){e:{c=t.type,s=t.memoizedProps,h=h.ownerDocument||h;t:switch(c){case"title":p=h.getElementsByTagName("title")[0],(!p||p[vi]||p[un]||p.namespaceURI==="http://www.w3.org/2000/svg"||p.hasAttribute("itemprop"))&&(p=h.createElement(c),h.head.insertBefore(p,h.querySelector("head > title"))),En(p,c,s),p[un]=t,Xt(p),c=p;break e;case"link":var C=wS("link","href",h).get(c+(s.href||""));if(C){for(var R=0;R<C.length;R++)if(p=C[R],p.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&p.getAttribute("rel")===(s.rel==null?null:s.rel)&&p.getAttribute("title")===(s.title==null?null:s.title)&&p.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){C.splice(R,1);break t}}p=h.createElement(c),En(p,c,s),h.head.appendChild(p);break;case"meta":if(C=wS("meta","content",h).get(c+(s.content||""))){for(R=0;R<C.length;R++)if(p=C[R],p.getAttribute("content")===(s.content==null?null:""+s.content)&&p.getAttribute("name")===(s.name==null?null:s.name)&&p.getAttribute("property")===(s.property==null?null:s.property)&&p.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&p.getAttribute("charset")===(s.charSet==null?null:s.charSet)){C.splice(R,1);break t}}p=h.createElement(c),En(p,c,s),h.head.appendChild(p);break;default:throw Error(a(468,c))}p[un]=t,Xt(p),c=p}t.stateNode=c}else CS(h,t.type,t.stateNode);else t.stateNode=SS(h,c,t.memoizedProps);else p!==c?(p===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):p.count--,c===null?CS(h,t.type,t.stateNode):SS(h,c,t.memoizedProps)):c===null&&t.stateNode!==null&&Jh(t,t.memoizedProps,s.memoizedProps)}break;case 27:Bn(r,t),Pn(t),c&512&&(en||s===null||Fr(s,s.return)),s!==null&&c&4&&Jh(t,t.memoizedProps,s.memoizedProps);break;case 5:if(Bn(r,t),Pn(t),c&512&&(en||s===null||Fr(s,s.return)),t.flags&32){h=t.stateNode;try{Ha(h,"")}catch(Oe){xt(t,t.return,Oe)}}c&4&&t.stateNode!=null&&(h=t.memoizedProps,Jh(t,h,s!==null?s.memoizedProps:h)),c&1024&&(eg=!0);break;case 6:if(Bn(r,t),Pn(t),c&4){if(t.stateNode===null)throw Error(a(162));c=t.memoizedProps,s=t.stateNode;try{s.nodeValue=c}catch(Oe){xt(t,t.return,Oe)}}break;case 3:if(ju=null,h=Or,Or=Hu(r.containerInfo),Bn(r,t),Or=h,Pn(t),c&4&&s!==null&&s.memoizedState.isDehydrated)try{Ws(r.containerInfo)}catch(Oe){xt(t,t.return,Oe)}eg&&(eg=!1,Cv(t));break;case 4:c=Or,Or=Hu(t.stateNode.containerInfo),Bn(r,t),Pn(t),Or=c;break;case 12:Bn(r,t),Pn(t);break;case 31:Bn(r,t),Pn(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,Eu(t,c)));break;case 13:Bn(r,t),Pn(t),t.child.flags&8192&&t.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Au=qt()),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,Eu(t,c)));break;case 22:h=t.memoizedState!==null;var B=s!==null&&s.memoizedState!==null,Y=pa,ae=en;if(pa=Y||h,en=ae||B,Bn(r,t),en=ae,pa=Y,Pn(t),c&8192)e:for(r=t.stateNode,r._visibility=h?r._visibility&-2:r._visibility|1,h&&(s===null||B||pa||en||Gi(t)),s=null,r=t;;){if(r.tag===5||r.tag===26){if(s===null){B=s=r;try{if(p=B.stateNode,h)C=p.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none";else{R=B.stateNode;var ce=B.memoizedProps.style,Q=ce!=null&&ce.hasOwnProperty("display")?ce.display:null;R.style.display=Q==null||typeof Q=="boolean"?"":(""+Q).trim()}}catch(Oe){xt(B,B.return,Oe)}}}else if(r.tag===6){if(s===null){B=r;try{B.stateNode.nodeValue=h?"":B.memoizedProps}catch(Oe){xt(B,B.return,Oe)}}}else if(r.tag===18){if(s===null){B=r;try{var ne=B.stateNode;h?dS(ne,!0):dS(B.stateNode,!1)}catch(Oe){xt(B,B.return,Oe)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===t)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;s===r&&(s=null),r=r.return}s===r&&(s=null),r.sibling.return=r.return,r=r.sibling}c&4&&(c=t.updateQueue,c!==null&&(s=c.retryQueue,s!==null&&(c.retryQueue=null,Eu(t,s))));break;case 19:Bn(r,t),Pn(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,Eu(t,c)));break;case 30:break;case 21:break;default:Bn(r,t),Pn(t)}}function Pn(t){var r=t.flags;if(r&2){try{for(var s,c=t.return;c!==null;){if(hv(c)){s=c;break}c=c.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var h=s.stateNode,p=Qh(t);Cu(t,p,h);break;case 5:var C=s.stateNode;s.flags&32&&(Ha(C,""),s.flags&=-33);var R=Qh(t);Cu(t,R,C);break;case 3:case 4:var B=s.stateNode.containerInfo,Y=Qh(t);Zh(t,Y,B);break;default:throw Error(a(161))}}catch(ae){xt(t,t.return,ae)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function Cv(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var r=t;Cv(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),t=t.sibling}}function ya(t,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)mv(t,r.alternate,r),r=r.sibling}function Gi(t){for(t=t.child;t!==null;){var r=t;switch(r.tag){case 0:case 11:case 14:case 15:Ya(4,r,r.return),Gi(r);break;case 1:Fr(r,r.return);var s=r.stateNode;typeof s.componentWillUnmount=="function"&&dv(r,r.return,s),Gi(r);break;case 27:Cl(r.stateNode);case 26:case 5:Fr(r,r.return),Gi(r);break;case 22:r.memoizedState===null&&Gi(r);break;case 30:Gi(r);break;default:Gi(r)}t=t.sibling}}function ba(t,r,s){for(s=s&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var c=r.alternate,h=t,p=r,C=p.flags;switch(p.tag){case 0:case 11:case 15:ba(h,p,s),fl(4,p);break;case 1:if(ba(h,p,s),c=p,h=c.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(Y){xt(c,c.return,Y)}if(c=p,h=c.updateQueue,h!==null){var R=c.stateNode;try{var B=h.shared.hiddenCallbacks;if(B!==null)for(h.shared.hiddenCallbacks=null,h=0;h<B.length;h++)Zy(B[h],R)}catch(Y){xt(c,c.return,Y)}}s&&C&64&&uv(p),hl(p,p.return);break;case 27:gv(p);case 26:case 5:ba(h,p,s),s&&c===null&&C&4&&fv(p),hl(p,p.return);break;case 12:ba(h,p,s);break;case 31:ba(h,p,s),s&&C&4&&vv(h,p);break;case 13:ba(h,p,s),s&&C&4&&Sv(h,p);break;case 22:p.memoizedState===null&&ba(h,p,s),hl(p,p.return);break;case 30:break;default:ba(h,p,s)}r=r.sibling}}function tg(t,r){var s=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),t=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(t=r.memoizedState.cachePool.pool),t!==s&&(t!=null&&t.refCount++,s!=null&&Zo(s))}function ng(t,r){t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Zo(t))}function Lr(t,r,s,c){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Ev(t,r,s,c),r=r.sibling}function Ev(t,r,s,c){var h=r.flags;switch(r.tag){case 0:case 11:case 15:Lr(t,r,s,c),h&2048&&fl(9,r);break;case 1:Lr(t,r,s,c);break;case 3:Lr(t,r,s,c),h&2048&&(t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Zo(t)));break;case 12:if(h&2048){Lr(t,r,s,c),t=r.stateNode;try{var p=r.memoizedProps,C=p.id,R=p.onPostCommit;typeof R=="function"&&R(C,r.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(B){xt(r,r.return,B)}}else Lr(t,r,s,c);break;case 31:Lr(t,r,s,c);break;case 13:Lr(t,r,s,c);break;case 23:break;case 22:p=r.stateNode,C=r.alternate,r.memoizedState!==null?p._visibility&2?Lr(t,r,s,c):gl(t,r):p._visibility&2?Lr(t,r,s,c):(p._visibility|=2,Hs(t,r,s,c,(r.subtreeFlags&10256)!==0||!1)),h&2048&&tg(C,r);break;case 24:Lr(t,r,s,c),h&2048&&ng(r.alternate,r);break;default:Lr(t,r,s,c)}}function Hs(t,r,s,c,h){for(h=h&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var p=t,C=r,R=s,B=c,Y=C.flags;switch(C.tag){case 0:case 11:case 15:Hs(p,C,R,B,h),fl(8,C);break;case 23:break;case 22:var ae=C.stateNode;C.memoizedState!==null?ae._visibility&2?Hs(p,C,R,B,h):gl(p,C):(ae._visibility|=2,Hs(p,C,R,B,h)),h&&Y&2048&&tg(C.alternate,C);break;case 24:Hs(p,C,R,B,h),h&&Y&2048&&ng(C.alternate,C);break;default:Hs(p,C,R,B,h)}r=r.sibling}}function gl(t,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var s=t,c=r,h=c.flags;switch(c.tag){case 22:gl(s,c),h&2048&&tg(c.alternate,c);break;case 24:gl(s,c),h&2048&&ng(c.alternate,c);break;default:gl(s,c)}r=r.sibling}}var pl=8192;function zs(t,r,s){if(t.subtreeFlags&pl)for(t=t.child;t!==null;)_v(t,r,s),t=t.sibling}function _v(t,r,s){switch(t.tag){case 26:zs(t,r,s),t.flags&pl&&t.memoizedState!==null&&iT(s,Or,t.memoizedState,t.memoizedProps);break;case 5:zs(t,r,s);break;case 3:case 4:var c=Or;Or=Hu(t.stateNode.containerInfo),zs(t,r,s),Or=c;break;case 22:t.memoizedState===null&&(c=t.alternate,c!==null&&c.memoizedState!==null?(c=pl,pl=16777216,zs(t,r,s),pl=c):zs(t,r,s));break;default:zs(t,r,s)}}function Av(t){var r=t.alternate;if(r!==null&&(t=r.child,t!==null)){r.child=null;do r=t.sibling,t.sibling=null,t=r;while(t!==null)}}function ml(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var s=0;s<r.length;s++){var c=r[s];pn=c,Tv(c,t)}Av(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)xv(t),t=t.sibling}function xv(t){switch(t.tag){case 0:case 11:case 15:ml(t),t.flags&2048&&Ya(9,t,t.return);break;case 3:ml(t);break;case 12:ml(t);break;case 22:var r=t.stateNode;t.memoizedState!==null&&r._visibility&2&&(t.return===null||t.return.tag!==13)?(r._visibility&=-3,_u(t)):ml(t);break;default:ml(t)}}function _u(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var s=0;s<r.length;s++){var c=r[s];pn=c,Tv(c,t)}Av(t)}for(t=t.child;t!==null;){switch(r=t,r.tag){case 0:case 11:case 15:Ya(8,r,r.return),_u(r);break;case 22:s=r.stateNode,s._visibility&2&&(s._visibility&=-3,_u(r));break;default:_u(r)}t=t.sibling}}function Tv(t,r){for(;pn!==null;){var s=pn;switch(s.tag){case 0:case 11:case 15:Ya(8,s,r);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var c=s.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Zo(s.memoizedState.cache)}if(c=s.child,c!==null)c.return=s,pn=c;else e:for(s=t;pn!==null;){c=pn;var h=c.sibling,p=c.return;if(yv(c),c===s){pn=null;break e}if(h!==null){h.return=p,pn=h;break e}pn=p}}}var Sx={getCacheForType:function(t){var r=wn(Jt),s=r.data.get(t);return s===void 0&&(s=t(),r.data.set(t,s)),s},cacheSignal:function(){return wn(Jt).controller.signal}},wx=typeof WeakMap=="function"?WeakMap:Map,wt=0,Lt=null,rt=null,st=0,At=0,Qn=null,Xa=!1,js=!1,rg=!1,va=0,Vt=0,Ja=0,Vi=0,ag=0,Zn=0,Us=0,yl=null,qn=null,ig=!1,Au=0,Rv=0,xu=1/0,Tu=null,Qa=null,fn=0,Za=null,Bs=null,Sa=0,sg=0,og=null,kv=null,bl=0,lg=null;function er(){return(wt&2)!==0&&st!==0?st&-st:J.T!==null?gg():ln()}function Dv(){if(Zn===0)if((st&536870912)===0||ut){var t=ye;ye<<=1,(ye&3932160)===0&&(ye=262144),Zn=t}else Zn=536870912;return t=Xn.current,t!==null&&(t.flags|=32),Zn}function Gn(t,r,s){(t===Lt&&(At===2||At===9)||t.cancelPendingCommit!==null)&&(Ps(t,0),ei(t,st,Zn,!1)),et(t,s),((wt&2)===0||t!==Lt)&&(t===Lt&&((wt&2)===0&&(Vi|=s),Vt===4&&ei(t,st,Zn,!1)),Kr(t))}function Ov(t,r,s){if((wt&6)!==0)throw Error(a(327));var c=!s&&(r&127)===0&&(r&t.expiredLanes)===0||Ke(t,r),h=c?_x(t,r):ug(t,r,!0),p=c;do{if(h===0){js&&!c&&ei(t,r,0,!1);break}else{if(s=t.current.alternate,p&&!Cx(s)){h=ug(t,r,!1),p=!1;continue}if(h===2){if(p=r,t.errorRecoveryDisabledLanes&p)var C=0;else C=t.pendingLanes&-536870913,C=C!==0?C:C&536870912?536870912:0;if(C!==0){r=C;e:{var R=t;h=yl;var B=R.current.memoizedState.isDehydrated;if(B&&(Ps(R,C).flags|=256),C=ug(R,C,!1),C!==2){if(rg&&!B){R.errorRecoveryDisabledLanes|=p,Vi|=p,h=4;break e}p=qn,qn=h,p!==null&&(qn===null?qn=p:qn.push.apply(qn,p))}h=C}if(p=!1,h!==2)continue}}if(h===1){Ps(t,0),ei(t,r,0,!0);break}e:{switch(c=t,p=h,p){case 0:case 1:throw Error(a(345));case 4:if((r&4194048)!==r)break;case 6:ei(c,r,Zn,!Xa);break e;case 2:qn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((r&62914560)===r&&(h=Au+300-qt(),10<h)){if(ei(c,r,Zn,!Xa),_e(c,0,!0)!==0)break e;Sa=r,c.timeoutHandle=lS(Lv.bind(null,c,s,qn,Tu,ig,r,Zn,Vi,Us,Xa,p,"Throttled",-0,0),h);break e}Lv(c,s,qn,Tu,ig,r,Zn,Vi,Us,Xa,p,null,-0,0)}}break}while(!0);Kr(t)}function Lv(t,r,s,c,h,p,C,R,B,Y,ae,ce,Q,ne){if(t.timeoutHandle=-1,ce=r.subtreeFlags,ce&8192||(ce&16785408)===16785408){ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:xr},_v(r,p,ce);var Oe=(p&62914560)===p?Au-qt():(p&4194048)===p?Rv-qt():0;if(Oe=sT(ce,Oe),Oe!==null){Sa=p,t.cancelPendingCommit=Oe(Uv.bind(null,t,r,p,s,c,h,C,R,B,ae,ce,null,Q,ne)),ei(t,p,C,!Y);return}}Uv(t,r,p,s,c,h,C,R,B)}function Cx(t){for(var r=t;;){var s=r.tag;if((s===0||s===11||s===15)&&r.flags&16384&&(s=r.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var c=0;c<s.length;c++){var h=s[c],p=h.getSnapshot;h=h.value;try{if(!Wn(p(),h))return!1}catch{return!1}}if(s=r.child,r.subtreeFlags&16384&&s!==null)s.return=r,r=s;else{if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function ei(t,r,s,c){r&=~ag,r&=~Vi,t.suspendedLanes|=r,t.pingedLanes&=~r,c&&(t.warmLanes|=r),c=t.expirationTimes;for(var h=r;0<h;){var p=31-on(h),C=1<<p;c[p]=-1,h&=~C}s!==0&&De(t,s,r)}function Ru(){return(wt&6)===0?(vl(0),!1):!0}function cg(){if(rt!==null){if(At===0)var t=rt.return;else t=rt,ca=Ii=null,Ah(t),Ls=null,tl=0,t=rt;for(;t!==null;)cv(t.alternate,t),t=t.return;rt=null}}function Ps(t,r){var s=t.timeoutHandle;s!==-1&&(t.timeoutHandle=-1,Px(s)),s=t.cancelPendingCommit,s!==null&&(t.cancelPendingCommit=null,s()),Sa=0,cg(),Lt=t,rt=s=oa(t.current,null),st=r,At=0,Qn=null,Xa=!1,js=Ke(t,r),rg=!1,Us=Zn=ag=Vi=Ja=Vt=0,qn=yl=null,ig=!1,(r&8)!==0&&(r|=r&32);var c=t.entangledLanes;if(c!==0)for(t=t.entanglements,c&=r;0<c;){var h=31-on(c),p=1<<h;r|=t[h],c&=~p}return va=r,Yc(),s}function Mv(t,r){Je=null,J.H=cl,r===Os||r===ru?(r=Yy(),At=3):r===hh?(r=Yy(),At=4):At=r===Bh?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,Qn=r,rt===null&&(Vt=1,yu(t,sr(r,t.current)))}function $v(){var t=Xn.current;return t===null?!0:(st&4194048)===st?ur===null:(st&62914560)===st||(st&536870912)!==0?t===ur:!1}function Nv(){var t=J.H;return J.H=cl,t===null?cl:t}function Iv(){var t=J.A;return J.A=Sx,t}function ku(){Vt=4,Xa||(st&4194048)!==st&&Xn.current!==null||(js=!0),(Ja&134217727)===0&&(Vi&134217727)===0||Lt===null||ei(Lt,st,Zn,!1)}function ug(t,r,s){var c=wt;wt|=2;var h=Nv(),p=Iv();(Lt!==t||st!==r)&&(Tu=null,Ps(t,r)),r=!1;var C=Vt;e:do try{if(At!==0&&rt!==null){var R=rt,B=Qn;switch(At){case 8:cg(),C=6;break e;case 3:case 2:case 9:case 6:Xn.current===null&&(r=!0);var Y=At;if(At=0,Qn=null,qs(t,R,B,Y),s&&js){C=0;break e}break;default:Y=At,At=0,Qn=null,qs(t,R,B,Y)}}Ex(),C=Vt;break}catch(ae){Mv(t,ae)}while(!0);return r&&t.shellSuspendCounter++,ca=Ii=null,wt=c,J.H=h,J.A=p,rt===null&&(Lt=null,st=0,Yc()),C}function Ex(){for(;rt!==null;)Hv(rt)}function _x(t,r){var s=wt;wt|=2;var c=Nv(),h=Iv();Lt!==t||st!==r?(Tu=null,xu=qt()+500,Ps(t,r)):js=Ke(t,r);e:do try{if(At!==0&&rt!==null){r=rt;var p=Qn;t:switch(At){case 1:At=0,Qn=null,qs(t,r,p,1);break;case 2:case 9:if(Ky(p)){At=0,Qn=null,zv(r);break}r=function(){At!==2&&At!==9||Lt!==t||(At=7),Kr(t)},p.then(r,r);break e;case 3:At=7;break e;case 4:At=5;break e;case 7:Ky(p)?(At=0,Qn=null,zv(r)):(At=0,Qn=null,qs(t,r,p,7));break;case 5:var C=null;switch(rt.tag){case 26:C=rt.memoizedState;case 5:case 27:var R=rt;if(C?ES(C):R.stateNode.complete){At=0,Qn=null;var B=R.sibling;if(B!==null)rt=B;else{var Y=R.return;Y!==null?(rt=Y,Du(Y)):rt=null}break t}}At=0,Qn=null,qs(t,r,p,5);break;case 6:At=0,Qn=null,qs(t,r,p,6);break;case 8:cg(),Vt=6;break e;default:throw Error(a(462))}}Ax();break}catch(ae){Mv(t,ae)}while(!0);return ca=Ii=null,J.H=c,J.A=h,wt=s,rt!==null?0:(Lt=null,st=0,Yc(),Vt)}function Ax(){for(;rt!==null&&!an();)Hv(rt)}function Hv(t){var r=ov(t.alternate,t,va);t.memoizedProps=t.pendingProps,r===null?Du(t):rt=r}function zv(t){var r=t,s=r.alternate;switch(r.tag){case 15:case 0:r=tv(s,r,r.pendingProps,r.type,void 0,st);break;case 11:r=tv(s,r,r.pendingProps,r.type.render,r.ref,st);break;case 5:Ah(r);default:cv(s,r),r=rt=Iy(r,va),r=ov(s,r,va)}t.memoizedProps=t.pendingProps,r===null?Du(t):rt=r}function qs(t,r,s,c){ca=Ii=null,Ah(r),Ls=null,tl=0;var h=r.return;try{if(hx(t,h,r,s,st)){Vt=1,yu(t,sr(s,t.current)),rt=null;return}}catch(p){if(h!==null)throw rt=h,p;Vt=1,yu(t,sr(s,t.current)),rt=null;return}r.flags&32768?(ut||c===1?t=!0:js||(st&536870912)!==0?t=!1:(Xa=t=!0,(c===2||c===9||c===3||c===6)&&(c=Xn.current,c!==null&&c.tag===13&&(c.flags|=16384))),jv(r,t)):Du(r)}function Du(t){var r=t;do{if((r.flags&32768)!==0){jv(r,Xa);return}t=r.return;var s=mx(r.alternate,r,va);if(s!==null){rt=s;return}if(r=r.sibling,r!==null){rt=r;return}rt=r=t}while(r!==null);Vt===0&&(Vt=5)}function jv(t,r){do{var s=yx(t.alternate,t);if(s!==null){s.flags&=32767,rt=s;return}if(s=t.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!r&&(t=t.sibling,t!==null)){rt=t;return}rt=t=s}while(t!==null);Vt=6,rt=null}function Uv(t,r,s,c,h,p,C,R,B){t.cancelPendingCommit=null;do Ou();while(fn!==0);if((wt&6)!==0)throw Error(a(327));if(r!==null){if(r===t.current)throw Error(a(177));if(p=r.lanes|r.childLanes,p|=Qf,je(t,s,p,C,R,B),t===Lt&&(rt=Lt=null,st=0),Bs=r,Za=t,Sa=s,sg=p,og=h,kv=c,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,kx(Ln,function(){return Vv(),null})):(t.callbackNode=null,t.callbackPriority=0),c=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||c){c=J.T,J.T=null,h=de.p,de.p=2,C=wt,wt|=4;try{bx(t,r,s)}finally{wt=C,de.p=h,J.T=c}}fn=1,Bv(),Pv(),qv()}}function Bv(){if(fn===1){fn=0;var t=Za,r=Bs,s=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||s){s=J.T,J.T=null;var c=de.p;de.p=2;var h=wt;wt|=4;try{wv(r,t);var p=Cg,C=Ty(t.containerInfo),R=p.focusedElem,B=p.selectionRange;if(C!==R&&R&&R.ownerDocument&&xy(R.ownerDocument.documentElement,R)){if(B!==null&&Kf(R)){var Y=B.start,ae=B.end;if(ae===void 0&&(ae=Y),"selectionStart"in R)R.selectionStart=Y,R.selectionEnd=Math.min(ae,R.value.length);else{var ce=R.ownerDocument||document,Q=ce&&ce.defaultView||window;if(Q.getSelection){var ne=Q.getSelection(),Oe=R.textContent.length,Ge=Math.min(B.start,Oe),Dt=B.end===void 0?Ge:Math.min(B.end,Oe);!ne.extend&&Ge>Dt&&(C=Dt,Dt=Ge,Ge=C);var K=Ay(R,Ge),G=Ay(R,Dt);if(K&&G&&(ne.rangeCount!==1||ne.anchorNode!==K.node||ne.anchorOffset!==K.offset||ne.focusNode!==G.node||ne.focusOffset!==G.offset)){var W=ce.createRange();W.setStart(K.node,K.offset),ne.removeAllRanges(),Ge>Dt?(ne.addRange(W),ne.extend(G.node,G.offset)):(W.setEnd(G.node,G.offset),ne.addRange(W))}}}}for(ce=[],ne=R;ne=ne.parentNode;)ne.nodeType===1&&ce.push({element:ne,left:ne.scrollLeft,top:ne.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R<ce.length;R++){var oe=ce[R];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}qu=!!wg,Cg=wg=null}finally{wt=h,de.p=c,J.T=s}}t.current=r,fn=2}}function Pv(){if(fn===2){fn=0;var t=Za,r=Bs,s=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||s){s=J.T,J.T=null;var c=de.p;de.p=2;var h=wt;wt|=4;try{mv(t,r.alternate,r)}finally{wt=h,de.p=c,J.T=s}}fn=3}}function qv(){if(fn===4||fn===3){fn=0,ea();var t=Za,r=Bs,s=Sa,c=kv;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?fn=5:(fn=0,Bs=Za=null,Gv(t,t.pendingLanes));var h=t.pendingLanes;if(h===0&&(Qa=null),St(s),r=r.stateNode,sn&&typeof sn.onCommitFiberRoot=="function")try{sn.onCommitFiberRoot(rr,r,void 0,(r.current.flags&128)===128)}catch{}if(c!==null){r=J.T,h=de.p,de.p=2,J.T=null;try{for(var p=t.onRecoverableError,C=0;C<c.length;C++){var R=c[C];p(R.value,{componentStack:R.stack})}}finally{J.T=r,de.p=h}}(Sa&3)!==0&&Ou(),Kr(t),h=t.pendingLanes,(s&261930)!==0&&(h&42)!==0?t===lg?bl++:(bl=0,lg=t):bl=0,vl(0)}}function Gv(t,r){(t.pooledCacheLanes&=r)===0&&(r=t.pooledCache,r!=null&&(t.pooledCache=null,Zo(r)))}function Ou(){return Bv(),Pv(),qv(),Vv()}function Vv(){if(fn!==5)return!1;var t=Za,r=sg;sg=0;var s=St(Sa),c=J.T,h=de.p;try{de.p=32>s?32:s,J.T=null,s=og,og=null;var p=Za,C=Sa;if(fn=0,Bs=Za=null,Sa=0,(wt&6)!==0)throw Error(a(331));var R=wt;if(wt|=4,xv(p.current),Ev(p,p.current,C,s),wt=R,vl(0,!1),sn&&typeof sn.onPostCommitFiberRoot=="function")try{sn.onPostCommitFiberRoot(rr,p)}catch{}return!0}finally{de.p=h,J.T=c,Gv(t,r)}}function Fv(t,r,s){r=sr(s,r),r=Uh(t.stateNode,r,2),t=Fa(t,r,2),t!==null&&(et(t,2),Kr(t))}function xt(t,r,s){if(t.tag===3)Fv(t,t,s);else for(;r!==null;){if(r.tag===3){Fv(r,t,s);break}else if(r.tag===1){var c=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Qa===null||!Qa.has(c))){t=sr(s,t),s=Kb(2),c=Fa(r,s,2),c!==null&&(Wb(s,c,r,t),et(c,2),Kr(c));break}}r=r.return}}function dg(t,r,s){var c=t.pingCache;if(c===null){c=t.pingCache=new wx;var h=new Set;c.set(r,h)}else h=c.get(r),h===void 0&&(h=new Set,c.set(r,h));h.has(s)||(rg=!0,h.add(s),t=xx.bind(null,t,r,s),r.then(t,t))}function xx(t,r,s){var c=t.pingCache;c!==null&&c.delete(r),t.pingedLanes|=t.suspendedLanes&s,t.warmLanes&=~s,Lt===t&&(st&s)===s&&(Vt===4||Vt===3&&(st&62914560)===st&&300>qt()-Au?(wt&2)===0&&Ps(t,0):ag|=s,Us===st&&(Us=0)),Kr(t)}function Kv(t,r){r===0&&(r=Ie()),t=Mi(t,r),t!==null&&(et(t,r),Kr(t))}function Tx(t){var r=t.memoizedState,s=0;r!==null&&(s=r.retryLane),Kv(t,s)}function Rx(t,r){var s=0;switch(t.tag){case 31:case 13:var c=t.stateNode,h=t.memoizedState;h!==null&&(s=h.retryLane);break;case 19:c=t.stateNode;break;case 22:c=t.stateNode._retryCache;break;default:throw Error(a(314))}c!==null&&c.delete(r),Kv(t,s)}function kx(t,r){return Pt(t,r)}var Lu=null,Gs=null,fg=!1,Mu=!1,hg=!1,ti=0;function Kr(t){t!==Gs&&t.next===null&&(Gs===null?Lu=Gs=t:Gs=Gs.next=t),Mu=!0,fg||(fg=!0,Ox())}function vl(t,r){if(!hg&&Mu){hg=!0;do for(var s=!1,c=Lu;c!==null;){if(t!==0){var h=c.pendingLanes;if(h===0)var p=0;else{var C=c.suspendedLanes,R=c.pingedLanes;p=(1<<31-on(42|t)+1)-1,p&=h&~(C&~R),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(s=!0,Jv(c,p))}else p=st,p=_e(c,c===Lt?p:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(p&3)===0||Ke(c,p)||(s=!0,Jv(c,p));c=c.next}while(s);hg=!1}}function Dx(){Wv()}function Wv(){Mu=fg=!1;var t=0;ti!==0&&Bx()&&(t=ti);for(var r=qt(),s=null,c=Lu;c!==null;){var h=c.next,p=Yv(c,r);p===0?(c.next=null,s===null?Lu=h:s.next=h,h===null&&(Gs=s)):(s=c,(t!==0||(p&3)!==0)&&(Mu=!0)),c=h}fn!==0&&fn!==5||vl(t),ti!==0&&(ti=0)}function Yv(t,r){for(var s=t.suspendedLanes,c=t.pingedLanes,h=t.expirationTimes,p=t.pendingLanes&-62914561;0<p;){var C=31-on(p),R=1<<C,B=h[C];B===-1?((R&s)===0||(R&c)!==0)&&(h[C]=xe(R,r)):B<=r&&(t.expiredLanes|=R),p&=~R}if(r=Lt,s=st,s=_e(t,t===r?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c=t.callbackNode,s===0||t===r&&(At===2||At===9)||t.cancelPendingCommit!==null)return c!==null&&c!==null&&rn(c),t.callbackNode=null,t.callbackPriority=0;if((s&3)===0||Ke(t,s)){if(r=s&-s,r===t.callbackPriority)return r;switch(c!==null&&rn(c),St(s)){case 2:case 8:s=yn;break;case 32:s=Ln;break;case 268435456:s=Hn;break;default:s=Ln}return c=Xv.bind(null,t),s=Pt(s,c),t.callbackPriority=r,t.callbackNode=s,r}return c!==null&&c!==null&&rn(c),t.callbackPriority=2,t.callbackNode=null,2}function Xv(t,r){if(fn!==0&&fn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var s=t.callbackNode;if(Ou()&&t.callbackNode!==s)return null;var c=st;return c=_e(t,t===Lt?c:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c===0?null:(Ov(t,c,r),Yv(t,qt()),t.callbackNode!=null&&t.callbackNode===s?Xv.bind(null,t):null)}function Jv(t,r){if(Ou())return null;Ov(t,r,!0)}function Ox(){qx(function(){(wt&6)!==0?Pt(ta,Dx):Wv()})}function gg(){if(ti===0){var t=ks;t===0&&(t=Z,Z<<=1,(Z&261888)===0&&(Z=256)),ti=t}return ti}function Qv(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:ar(""+t)}function Zv(t,r){var s=r.ownerDocument.createElement("input");return s.name=r.name,s.value=r.value,t.id&&s.setAttribute("form",t.id),r.parentNode.insertBefore(s,r),t=new FormData(t),s.parentNode.removeChild(s),t}function Lx(t,r,s,c,h){if(r==="submit"&&s&&s.stateNode===h){var p=Qv((h[kn]||null).action),C=c.submitter;C&&(r=(r=C[kn]||null)?Qv(r.formAction):C.getAttribute("formAction"),r!==null&&(p=r,C=null));var R=new sa("action","action",null,c,h);t.push({event:R,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(ti!==0){var B=C?Zv(h,C):new FormData(h);$h(s,{pending:!0,data:B,method:h.method,action:p},null,B)}}else typeof p=="function"&&(R.preventDefault(),B=C?Zv(h,C):new FormData(h),$h(s,{pending:!0,data:B,method:h.method,action:p},p,B))},currentTarget:h}]})}}for(var pg=0;pg<Jf.length;pg++){var mg=Jf[pg],Mx=mg.toLowerCase(),$x=mg[0].toUpperCase()+mg.slice(1);Dr(Mx,"on"+$x)}Dr(Dy,"onAnimationEnd"),Dr(Oy,"onAnimationIteration"),Dr(Ly,"onAnimationStart"),Dr("dblclick","onDoubleClick"),Dr("focusin","onFocus"),Dr("focusout","onBlur"),Dr(XA,"onTransitionRun"),Dr(JA,"onTransitionStart"),Dr(QA,"onTransitionCancel"),Dr(My,"onTransitionEnd"),Ma("onMouseEnter",["mouseout","mouseover"]),Ma("onMouseLeave",["mouseout","mouseover"]),Ma("onPointerEnter",["pointerout","pointerover"]),Ma("onPointerLeave",["pointerout","pointerover"]),Ar("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ar("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ar("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ar("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ar("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ar("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Sl="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(" "),Nx=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Sl));function eS(t,r){r=(r&4)!==0;for(var s=0;s<t.length;s++){var c=t[s],h=c.event;c=c.listeners;e:{var p=void 0;if(r)for(var C=c.length-1;0<=C;C--){var R=c[C],B=R.instance,Y=R.currentTarget;if(R=R.listener,B!==p&&h.isPropagationStopped())break e;p=R,h.currentTarget=Y;try{p(h)}catch(ae){Wc(ae)}h.currentTarget=null,p=B}else for(C=0;C<c.length;C++){if(R=c[C],B=R.instance,Y=R.currentTarget,R=R.listener,B!==p&&h.isPropagationStopped())break e;p=R,h.currentTarget=Y;try{p(h)}catch(ae){Wc(ae)}h.currentTarget=null,p=B}}}}function at(t,r){var s=r[Lo];s===void 0&&(s=r[Lo]=new Set);var c=t+"__bubble";s.has(c)||(tS(r,t,2,!1),s.add(c))}function yg(t,r,s){var c=0;r&&(c|=4),tS(s,t,c,r)}var $u="_reactListening"+Math.random().toString(36).slice(2);function bg(t){if(!t[$u]){t[$u]=!0,Ac.forEach(function(s){s!=="selectionchange"&&(Nx.has(s)||yg(s,!1,t),yg(s,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[$u]||(r[$u]=!0,yg("selectionchange",!1,r))}}function tS(t,r,s,c){switch(DS(r)){case 2:var h=cT;break;case 8:h=uT;break;default:h=Mg}s=h.bind(null,r,s,t),h=void 0,!jo||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(h=!0),c?h!==void 0?t.addEventListener(r,s,{capture:!0,passive:h}):t.addEventListener(r,s,!0):h!==void 0?t.addEventListener(r,s,{passive:h}):t.addEventListener(r,s,!1)}function vg(t,r,s,c,h){var p=c;if((r&1)===0&&(r&2)===0&&c!==null)e:for(;;){if(c===null)return;var C=c.tag;if(C===3||C===4){var R=c.stateNode.containerInfo;if(R===h)break;if(C===4)for(C=c.return;C!==null;){var B=C.tag;if((B===3||B===4)&&C.stateNode.containerInfo===h)return;C=C.return}for(;R!==null;){if(C=Oa(R),C===null)return;if(B=C.tag,B===5||B===6||B===26||B===27){c=p=C;continue e}R=R.parentNode}}c=c.return}Nc(function(){var Y=p,ae=zo(s),ce=[];e:{var Q=$y.get(t);if(Q!==void 0){var ne=sa,Oe=t;switch(t){case"keypress":if(_i(s)===0)break e;case"keydown":case"keyup":ne=Hf;break;case"focusin":Oe="focus",ne=qo;break;case"focusout":Oe="blur",ne=qo;break;case"beforeblur":case"afterblur":ne=qo;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ne=zc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ne=Cy;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=Uf;break;case Dy:case Oy:case Ly:ne=Df;break;case My:ne=Ss;break;case"scroll":case"scrollend":ne=Tf;break;case"wheel":ne=E;break;case"copy":case"cut":case"paste":ne=jc;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ne=Pc;break;case"toggle":case"beforetoggle":ne=w}var Ge=(r&4)!==0,Dt=!Ge&&(t==="scroll"||t==="scrollend"),K=Ge?Q!==null?Q+"Capture":null:Q;Ge=[];for(var G=Y,W;G!==null;){var oe=G;if(W=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||W===null||K===null||(oe=Ci(G,K),oe!=null&&Ge.push(wl(G,oe,W))),Dt)break;G=G.return}0<Ge.length&&(Q=new ne(Q,Oe,null,s,ae),ce.push({event:Q,listeners:Ge}))}}if((r&7)===0){e:{if(Q=t==="mouseover"||t==="pointerover",ne=t==="mouseout"||t==="pointerout",Q&&s!==Ho&&(Oe=s.relatedTarget||s.fromElement)&&(Oa(Oe)||Oe[Da]))break e;if((ne||Q)&&(Q=ae.window===ae?ae:(Q=ae.ownerDocument)?Q.defaultView||Q.parentWindow:window,ne?(Oe=s.relatedTarget||s.toElement,ne=Y,Oe=Oe?Oa(Oe):null,Oe!==null&&(Dt=l(Oe),Ge=Oe.tag,Oe!==Dt||Ge!==5&&Ge!==27&&Ge!==6)&&(Oe=null)):(ne=null,Oe=Y),ne!==Oe)){if(Ge=zc,oe="onMouseLeave",K="onMouseEnter",G="mouse",(t==="pointerout"||t==="pointerover")&&(Ge=Pc,oe="onPointerLeave",K="onPointerEnter",G="pointer"),Dt=ne==null?Q:ra(ne),W=Oe==null?Q:ra(Oe),Q=new Ge(oe,G+"leave",ne,s,ae),Q.target=Dt,Q.relatedTarget=W,oe=null,Oa(ae)===Y&&(Ge=new Ge(K,G+"enter",Oe,s,ae),Ge.target=W,Ge.relatedTarget=Dt,oe=Ge),Dt=oe,ne&&Oe)t:{for(Ge=Ix,K=ne,G=Oe,W=0,oe=K;oe;oe=Ge(oe))W++;oe=0;for(var Pe=G;Pe;Pe=Ge(Pe))oe++;for(;0<W-oe;)K=Ge(K),W--;for(;0<oe-W;)G=Ge(G),oe--;for(;W--;){if(K===G||G!==null&&K===G.alternate){Ge=K;break t}K=Ge(K),G=Ge(G)}Ge=null}else Ge=null;ne!==null&&nS(ce,Q,ne,Ge,!1),Oe!==null&&Dt!==null&&nS(ce,Dt,Oe,Ge,!0)}}e:{if(Q=Y?ra(Y):window,ne=Q.nodeName&&Q.nodeName.toLowerCase(),ne==="select"||ne==="input"&&Q.type==="file")var mt=Fo;else if(Vo(Q))if(Ko)mt=KA;else{mt=Ff;var He=Vf}else ne=Q.nodeName,!ne||ne.toLowerCase()!=="input"||Q.type!=="checkbox"&&Q.type!=="radio"?Y&&No(Y.elementType)&&(mt=Fo):mt=Kc;if(mt&&(mt=mt(t,Y))){Gc(ce,mt,s,ae);break e}He&&He(t,Q,Y),t==="focusout"&&Y&&Q.type==="number"&&Y.memoizedProps.value!=null&&aa(Q,"number",Q.value)}switch(He=Y?ra(Y):window,t){case"focusin":(Vo(He)||He.contentEditable==="true")&&(ws=He,Wf=Y,Xo=null);break;case"focusout":Xo=Wf=ws=null;break;case"mousedown":Yf=!0;break;case"contextmenu":case"mouseup":case"dragend":Yf=!1,Ry(ce,s,ae);break;case"selectionchange":if(YA)break;case"keydown":case"keyup":Ry(ce,s,ae)}var Qe;if(I)e:{switch(t){case"compositionstart":var ot="onCompositionStart";break e;case"compositionend":ot="onCompositionEnd";break e;case"compositionupdate":ot="onCompositionUpdate";break e}ot=void 0}else kr?pt(t,s)&&(ot="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(ot="onCompositionStart");ot&&($e&&s.locale!=="ko"&&(kr||ot!=="onCompositionStart"?ot==="onCompositionEnd"&&kr&&(Qe=Ic()):(qr=ae,Uo="value"in qr?qr.value:qr.textContent,kr=!0)),He=Nu(Y,ot),0<He.length&&(ot=new Uc(ot,t,null,s,ae),ce.push({event:ot,listeners:He}),Qe?ot.data=Qe:(Qe=zt(s),Qe!==null&&(ot.data=Qe)))),(Qe=me?Pf(t,s):qc(t,s))&&(ot=Nu(Y,"onBeforeInput"),0<ot.length&&(He=new Uc("onBeforeInput","beforeinput",null,s,ae),ce.push({event:He,listeners:ot}),He.data=Qe)),Lx(ce,t,Y,s,ae)}eS(ce,r)})}function wl(t,r,s){return{instance:t,listener:r,currentTarget:s}}function Nu(t,r){for(var s=r+"Capture",c=[];t!==null;){var h=t,p=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||p===null||(h=Ci(t,s),h!=null&&c.unshift(wl(t,h,p)),h=Ci(t,r),h!=null&&c.push(wl(t,h,p))),t.tag===3)return c;t=t.return}return[]}function Ix(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function nS(t,r,s,c,h){for(var p=r._reactName,C=[];s!==null&&s!==c;){var R=s,B=R.alternate,Y=R.stateNode;if(R=R.tag,B!==null&&B===c)break;R!==5&&R!==26&&R!==27||Y===null||(B=Y,h?(Y=Ci(s,p),Y!=null&&C.unshift(wl(s,Y,B))):h||(Y=Ci(s,p),Y!=null&&C.push(wl(s,Y,B)))),s=s.return}C.length!==0&&t.push({event:r,listeners:C})}var Hx=/\r\n?/g,zx=/\u0000|\uFFFD/g;function rS(t){return(typeof t=="string"?t:""+t).replace(Hx,`
`).replace(zx,"")}function aS(t,r){return r=rS(r),rS(t)===r}function kt(t,r,s,c,h,p){switch(s){case"children":typeof c=="string"?r==="body"||r==="textarea"&&c===""||Ha(t,c):(typeof c=="number"||typeof c=="bigint")&&r!=="body"&&Ha(t,""+c);break;case"className":Si(t,"class",c);break;case"tabIndex":Si(t,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":Si(t,s,c);break;case"style":Mc(t,c,p);break;case"data":if(r!=="object"){Si(t,"data",c);break}case"src":case"href":if(c===""&&(r!=="a"||s!=="href")){t.removeAttribute(s);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(s);break}c=ar(""+c),t.setAttribute(s,c);break;case"action":case"formAction":if(typeof c=="function"){t.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof p=="function"&&(s==="formAction"?(r!=="input"&&kt(t,r,"name",h.name,h,null),kt(t,r,"formEncType",h.formEncType,h,null),kt(t,r,"formMethod",h.formMethod,h,null),kt(t,r,"formTarget",h.formTarget,h,null)):(kt(t,r,"encType",h.encType,h,null),kt(t,r,"method",h.method,h,null),kt(t,r,"target",h.target,h,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(s);break}c=ar(""+c),t.setAttribute(s,c);break;case"onClick":c!=null&&(t.onclick=xr);break;case"onScroll":c!=null&&at("scroll",t);break;case"onScrollEnd":c!=null&&at("scrollend",t);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(a(61));if(s=c.__html,s!=null){if(h.children!=null)throw Error(a(60));t.innerHTML=s}}break;case"multiple":t.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":t.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){t.removeAttribute("xlink:href");break}s=ar(""+c),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(s,""+c):t.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(s,""):t.removeAttribute(s);break;case"capture":case"download":c===!0?t.setAttribute(s,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(s,c):t.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?t.setAttribute(s,c):t.removeAttribute(s);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?t.removeAttribute(s):t.setAttribute(s,c);break;case"popover":at("beforetoggle",t),at("toggle",t),zn(t,"popover",c);break;case"xlinkActuate":vn(t,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":vn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":vn(t,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":vn(t,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":vn(t,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":vn(t,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":vn(t,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":vn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":vn(t,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":zn(t,"is",c);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=xf.get(s)||s,zn(t,s,c))}}function Sg(t,r,s,c,h,p){switch(s){case"style":Mc(t,c,p);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(a(61));if(s=c.__html,s!=null){if(h.children!=null)throw Error(a(60));t.innerHTML=s}}break;case"children":typeof c=="string"?Ha(t,c):(typeof c=="number"||typeof c=="bigint")&&Ha(t,""+c);break;case"onScroll":c!=null&&at("scroll",t);break;case"onScrollEnd":c!=null&&at("scrollend",t);break;case"onClick":c!=null&&(t.onclick=xr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!xc.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(h=s.endsWith("Capture"),r=s.slice(2,h?s.length-7:void 0),p=t[kn]||null,p=p!=null?p[s]:null,typeof p=="function"&&t.removeEventListener(r,p,h),typeof c=="function")){typeof p!="function"&&p!==null&&(s in t?t[s]=null:t.hasAttribute(s)&&t.removeAttribute(s)),t.addEventListener(r,c,h);break e}s in t?t[s]=c:c===!0?t.setAttribute(s,""):zn(t,s,c)}}}function En(t,r,s){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":at("error",t),at("load",t);var c=!1,h=!1,p;for(p in s)if(s.hasOwnProperty(p)){var C=s[p];if(C!=null)switch(p){case"src":c=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,r));default:kt(t,r,p,C,s,null)}}h&&kt(t,r,"srcSet",s.srcSet,s,null),c&&kt(t,r,"src",s.src,s,null);return;case"input":at("invalid",t);var R=p=C=h=null,B=null,Y=null;for(c in s)if(s.hasOwnProperty(c)){var ae=s[c];if(ae!=null)switch(c){case"name":h=ae;break;case"type":C=ae;break;case"checked":B=ae;break;case"defaultChecked":Y=ae;break;case"value":p=ae;break;case"defaultValue":R=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(a(137,r));break;default:kt(t,r,c,ae,s,null)}}wi(t,p,R,B,Y,C,h,!1);return;case"select":at("invalid",t),c=C=p=null;for(h in s)if(s.hasOwnProperty(h)&&(R=s[h],R!=null))switch(h){case"value":p=R;break;case"defaultValue":C=R;break;case"multiple":c=R;default:kt(t,r,h,R,s,null)}r=p,s=C,t.multiple=!!c,r!=null?Na(t,!!c,r,!1):s!=null&&Na(t,!!c,s,!0);return;case"textarea":at("invalid",t),p=h=c=null;for(C in s)if(s.hasOwnProperty(C)&&(R=s[C],R!=null))switch(C){case"value":c=R;break;case"defaultValue":h=R;break;case"children":p=R;break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(a(91));break;default:kt(t,r,C,R,s,null)}Oc(t,c,h,p);return;case"option":for(B in s)s.hasOwnProperty(B)&&(c=s[B],c!=null)&&(B==="selected"?t.selected=c&&typeof c!="function"&&typeof c!="symbol":kt(t,r,B,c,s,null));return;case"dialog":at("beforetoggle",t),at("toggle",t),at("cancel",t),at("close",t);break;case"iframe":case"object":at("load",t);break;case"video":case"audio":for(c=0;c<Sl.length;c++)at(Sl[c],t);break;case"image":at("error",t),at("load",t);break;case"details":at("toggle",t);break;case"embed":case"source":case"link":at("error",t),at("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Y in s)if(s.hasOwnProperty(Y)&&(c=s[Y],c!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,r));default:kt(t,r,Y,c,s,null)}return;default:if(No(r)){for(ae in s)s.hasOwnProperty(ae)&&(c=s[ae],c!==void 0&&Sg(t,r,ae,c,s,void 0));return}}for(R in s)s.hasOwnProperty(R)&&(c=s[R],c!=null&&kt(t,r,R,c,s,null))}function jx(t,r,s,c){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,p=null,C=null,R=null,B=null,Y=null,ae=null;for(ne in s){var ce=s[ne];if(s.hasOwnProperty(ne)&&ce!=null)switch(ne){case"checked":break;case"value":break;case"defaultValue":B=ce;default:c.hasOwnProperty(ne)||kt(t,r,ne,null,c,ce)}}for(var Q in c){var ne=c[Q];if(ce=s[Q],c.hasOwnProperty(Q)&&(ne!=null||ce!=null))switch(Q){case"type":p=ne;break;case"name":h=ne;break;case"checked":Y=ne;break;case"defaultChecked":ae=ne;break;case"value":C=ne;break;case"defaultValue":R=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(a(137,r));break;default:ne!==ce&&kt(t,r,Q,ne,c,ce)}}ps(t,C,R,B,Y,ae,p,h);return;case"select":ne=C=R=Q=null;for(p in s)if(B=s[p],s.hasOwnProperty(p)&&B!=null)switch(p){case"value":break;case"multiple":ne=B;default:c.hasOwnProperty(p)||kt(t,r,p,null,c,B)}for(h in c)if(p=c[h],B=s[h],c.hasOwnProperty(h)&&(p!=null||B!=null))switch(h){case"value":Q=p;break;case"defaultValue":R=p;break;case"multiple":C=p;default:p!==B&&kt(t,r,h,p,c,B)}r=R,s=C,c=ne,Q!=null?Na(t,!!s,Q,!1):!!c!=!!s&&(r!=null?Na(t,!!s,r,!0):Na(t,!!s,s?[]:"",!1));return;case"textarea":ne=Q=null;for(R in s)if(h=s[R],s.hasOwnProperty(R)&&h!=null&&!c.hasOwnProperty(R))switch(R){case"value":break;case"children":break;default:kt(t,r,R,null,c,h)}for(C in c)if(h=c[C],p=s[C],c.hasOwnProperty(C)&&(h!=null||p!=null))switch(C){case"value":Q=h;break;case"defaultValue":ne=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(a(91));break;default:h!==p&&kt(t,r,C,h,c,p)}Ia(t,Q,ne);return;case"option":for(var Oe in s)Q=s[Oe],s.hasOwnProperty(Oe)&&Q!=null&&!c.hasOwnProperty(Oe)&&(Oe==="selected"?t.selected=!1:kt(t,r,Oe,null,c,Q));for(B in c)Q=c[B],ne=s[B],c.hasOwnProperty(B)&&Q!==ne&&(Q!=null||ne!=null)&&(B==="selected"?t.selected=Q&&typeof Q!="function"&&typeof Q!="symbol":kt(t,r,B,Q,c,ne));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ge in s)Q=s[Ge],s.hasOwnProperty(Ge)&&Q!=null&&!c.hasOwnProperty(Ge)&&kt(t,r,Ge,null,c,Q);for(Y in c)if(Q=c[Y],ne=s[Y],c.hasOwnProperty(Y)&&Q!==ne&&(Q!=null||ne!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(a(137,r));break;default:kt(t,r,Y,Q,c,ne)}return;default:if(No(r)){for(var Dt in s)Q=s[Dt],s.hasOwnProperty(Dt)&&Q!==void 0&&!c.hasOwnProperty(Dt)&&Sg(t,r,Dt,void 0,c,Q);for(ae in c)Q=c[ae],ne=s[ae],!c.hasOwnProperty(ae)||Q===ne||Q===void 0&&ne===void 0||Sg(t,r,ae,Q,c,ne);return}}for(var K in s)Q=s[K],s.hasOwnProperty(K)&&Q!=null&&!c.hasOwnProperty(K)&&kt(t,r,K,null,c,Q);for(ce in c)Q=c[ce],ne=s[ce],!c.hasOwnProperty(ce)||Q===ne||Q==null&&ne==null||kt(t,r,ce,Q,c,ne)}function iS(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Ux(){if(typeof performance.getEntriesByType=="function"){for(var t=0,r=0,s=performance.getEntriesByType("resource"),c=0;c<s.length;c++){var h=s[c],p=h.transferSize,C=h.initiatorType,R=h.duration;if(p&&R&&iS(C)){for(C=0,R=h.responseEnd,c+=1;c<s.length;c++){var B=s[c],Y=B.startTime;if(Y>R)break;var ae=B.transferSize,ce=B.initiatorType;ae&&iS(ce)&&(B=B.responseEnd,C+=ae*(B<R?1:(R-Y)/(B-Y)))}if(--c,r+=8*(p+C)/(h.duration/1e3),t++,10<t)break}}if(0<t)return r/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var wg=null,Cg=null;function Iu(t){return t.nodeType===9?t:t.ownerDocument}function sS(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function oS(t,r){if(t===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&r==="foreignObject"?0:t}function Eg(t,r){return t==="textarea"||t==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var _g=null;function Bx(){var t=window.event;return t&&t.type==="popstate"?t===_g?!1:(_g=t,!0):(_g=null,!1)}var lS=typeof setTimeout=="function"?setTimeout:void 0,Px=typeof clearTimeout=="function"?clearTimeout:void 0,cS=typeof Promise=="function"?Promise:void 0,qx=typeof queueMicrotask=="function"?queueMicrotask:typeof cS<"u"?function(t){return cS.resolve(null).then(t).catch(Gx)}:lS;function Gx(t){setTimeout(function(){throw t})}function ni(t){return t==="head"}function uS(t,r){var s=r,c=0;do{var h=s.nextSibling;if(t.removeChild(s),h&&h.nodeType===8)if(s=h.data,s==="/$"||s==="/&"){if(c===0){t.removeChild(h),Ws(r);return}c--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")c++;else if(s==="html")Cl(t.ownerDocument.documentElement);else if(s==="head"){s=t.ownerDocument.head,Cl(s);for(var p=s.firstChild;p;){var C=p.nextSibling,R=p.nodeName;p[vi]||R==="SCRIPT"||R==="STYLE"||R==="LINK"&&p.rel.toLowerCase()==="stylesheet"||s.removeChild(p),p=C}}else s==="body"&&Cl(t.ownerDocument.body);s=h}while(s);Ws(r)}function dS(t,r){var s=t;t=0;do{var c=s.nextSibling;if(s.nodeType===1?r?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(r?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),c&&c.nodeType===8)if(s=c.data,s==="/$"){if(t===0)break;t--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||t++;s=c}while(s)}function Ag(t){var r=t.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var s=r;switch(r=r.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Ag(s),Mo(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}t.removeChild(s)}}function Vx(t,r,s,c){for(;t.nodeType===1;){var h=s;if(t.nodeName.toLowerCase()!==r.toLowerCase()){if(!c&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(c){if(!t[vi])switch(r){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(p=t.getAttribute("rel"),p==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(p!==h.rel||t.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||t.getAttribute("title")!==(h.title==null?null:h.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(p=t.getAttribute("src"),(p!==(h.src==null?null:h.src)||t.getAttribute("type")!==(h.type==null?null:h.type)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&p&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(r==="input"&&t.type==="hidden"){var p=h.name==null?null:""+h.name;if(h.type==="hidden"&&t.getAttribute("name")===p)return t}else return t;if(t=dr(t.nextSibling),t===null)break}return null}function Fx(t,r,s){if(r==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=dr(t.nextSibling),t===null))return null;return t}function fS(t,r){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=dr(t.nextSibling),t===null))return null;return t}function xg(t){return t.data==="$?"||t.data==="$~"}function Tg(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function Kx(t,r){var s=t.ownerDocument;if(t.data==="$~")t._reactRetry=r;else if(t.data!=="$?"||s.readyState!=="loading")r();else{var c=function(){r(),s.removeEventListener("DOMContentLoaded",c)};s.addEventListener("DOMContentLoaded",c),t._reactRetry=c}}function dr(t){for(;t!=null;t=t.nextSibling){var r=t.nodeType;if(r===1||r===3)break;if(r===8){if(r=t.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return t}var Rg=null;function hS(t){t=t.nextSibling;for(var r=0;t;){if(t.nodeType===8){var s=t.data;if(s==="/$"||s==="/&"){if(r===0)return dr(t.nextSibling);r--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||r++}t=t.nextSibling}return null}function gS(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var s=t.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(r===0)return t;r--}else s!=="/$"&&s!=="/&"||r++}t=t.previousSibling}return null}function pS(t,r,s){switch(r=Iu(s),t){case"html":if(t=r.documentElement,!t)throw Error(a(452));return t;case"head":if(t=r.head,!t)throw Error(a(453));return t;case"body":if(t=r.body,!t)throw Error(a(454));return t;default:throw Error(a(451))}}function Cl(t){for(var r=t.attributes;r.length;)t.removeAttributeNode(r[0]);Mo(t)}var fr=new Map,mS=new Set;function Hu(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var wa=de.d;de.d={f:Wx,r:Yx,D:Xx,C:Jx,L:Qx,m:Zx,X:tT,S:eT,M:nT};function Wx(){var t=wa.f(),r=Ru();return t||r}function Yx(t){var r=Pr(t);r!==null&&r.tag===5&&r.type==="form"?Mb(r):wa.r(t)}var Vs=typeof document>"u"?null:document;function yS(t,r,s){var c=Vs;if(c&&typeof r=="string"&&r){var h=jn(r);h='link[rel="'+t+'"][href="'+h+'"]',typeof s=="string"&&(h+='[crossorigin="'+s+'"]'),mS.has(h)||(mS.add(h),t={rel:t,crossOrigin:s,href:r},c.querySelector(h)===null&&(r=c.createElement("link"),En(r,"link",t),Xt(r),c.head.appendChild(r)))}}function Xx(t){wa.D(t),yS("dns-prefetch",t,null)}function Jx(t,r){wa.C(t,r),yS("preconnect",t,r)}function Qx(t,r,s){wa.L(t,r,s);var c=Vs;if(c&&t&&r){var h='link[rel="preload"][as="'+jn(r)+'"]';r==="image"&&s&&s.imageSrcSet?(h+='[imagesrcset="'+jn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(h+='[imagesizes="'+jn(s.imageSizes)+'"]')):h+='[href="'+jn(t)+'"]';var p=h;switch(r){case"style":p=Fs(t);break;case"script":p=Ks(t)}fr.has(p)||(t=b({rel:"preload",href:r==="image"&&s&&s.imageSrcSet?void 0:t,as:r},s),fr.set(p,t),c.querySelector(h)!==null||r==="style"&&c.querySelector(El(p))||r==="script"&&c.querySelector(_l(p))||(r=c.createElement("link"),En(r,"link",t),Xt(r),c.head.appendChild(r)))}}function Zx(t,r){wa.m(t,r);var s=Vs;if(s&&t){var c=r&&typeof r.as=="string"?r.as:"script",h='link[rel="modulepreload"][as="'+jn(c)+'"][href="'+jn(t)+'"]',p=h;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=Ks(t)}if(!fr.has(p)&&(t=b({rel:"modulepreload",href:t},r),fr.set(p,t),s.querySelector(h)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(_l(p)))return}c=s.createElement("link"),En(c,"link",t),Xt(c),s.head.appendChild(c)}}}function eT(t,r,s){wa.S(t,r,s);var c=Vs;if(c&&t){var h=La(c).hoistableStyles,p=Fs(t);r=r||"default";var C=h.get(p);if(!C){var R={loading:0,preload:null};if(C=c.querySelector(El(p)))R.loading=5;else{t=b({rel:"stylesheet",href:t,"data-precedence":r},s),(s=fr.get(p))&&kg(t,s);var B=C=c.createElement("link");Xt(B),En(B,"link",t),B._p=new Promise(function(Y,ae){B.onload=Y,B.onerror=ae}),B.addEventListener("load",function(){R.loading|=1}),B.addEventListener("error",function(){R.loading|=2}),R.loading|=4,zu(C,r,c)}C={type:"stylesheet",instance:C,count:1,state:R},h.set(p,C)}}}function tT(t,r){wa.X(t,r);var s=Vs;if(s&&t){var c=La(s).hoistableScripts,h=Ks(t),p=c.get(h);p||(p=s.querySelector(_l(h)),p||(t=b({src:t,async:!0},r),(r=fr.get(h))&&Dg(t,r),p=s.createElement("script"),Xt(p),En(p,"link",t),s.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},c.set(h,p))}}function nT(t,r){wa.M(t,r);var s=Vs;if(s&&t){var c=La(s).hoistableScripts,h=Ks(t),p=c.get(h);p||(p=s.querySelector(_l(h)),p||(t=b({src:t,async:!0,type:"module"},r),(r=fr.get(h))&&Dg(t,r),p=s.createElement("script"),Xt(p),En(p,"link",t),s.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},c.set(h,p))}}function bS(t,r,s,c){var h=(h=te.current)?Hu(h):null;if(!h)throw Error(a(446));switch(t){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(r=Fs(s.href),s=La(h).hoistableStyles,c=s.get(r),c||(c={type:"style",instance:null,count:0,state:null},s.set(r,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){t=Fs(s.href);var p=La(h).hoistableStyles,C=p.get(t);if(C||(h=h.ownerDocument||h,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},p.set(t,C),(p=h.querySelector(El(t)))&&!p._p&&(C.instance=p,C.state.loading=5),fr.has(t)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},fr.set(t,s),p||rT(h,t,s,C.state))),r&&c===null)throw Error(a(528,""));return C}if(r&&c!==null)throw Error(a(529,""));return null;case"script":return r=s.async,s=s.src,typeof s=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Ks(s),s=La(h).hoistableScripts,c=s.get(r),c||(c={type:"script",instance:null,count:0,state:null},s.set(r,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,t))}}function Fs(t){return'href="'+jn(t)+'"'}function El(t){return'link[rel="stylesheet"]['+t+"]"}function vS(t){return b({},t,{"data-precedence":t.precedence,precedence:null})}function rT(t,r,s,c){t.querySelector('link[rel="preload"][as="style"]['+r+"]")?c.loading=1:(r=t.createElement("link"),c.preload=r,r.addEventListener("load",function(){return c.loading|=1}),r.addEventListener("error",function(){return c.loading|=2}),En(r,"link",s),Xt(r),t.head.appendChild(r))}function Ks(t){return'[src="'+jn(t)+'"]'}function _l(t){return"script[async]"+t}function SS(t,r,s){if(r.count++,r.instance===null)switch(r.type){case"style":var c=t.querySelector('style[data-href~="'+jn(s.href)+'"]');if(c)return r.instance=c,Xt(c),c;var h=b({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return c=(t.ownerDocument||t).createElement("style"),Xt(c),En(c,"style",h),zu(c,s.precedence,t),r.instance=c;case"stylesheet":h=Fs(s.href);var p=t.querySelector(El(h));if(p)return r.state.loading|=4,r.instance=p,Xt(p),p;c=vS(s),(h=fr.get(h))&&kg(c,h),p=(t.ownerDocument||t).createElement("link"),Xt(p);var C=p;return C._p=new Promise(function(R,B){C.onload=R,C.onerror=B}),En(p,"link",c),r.state.loading|=4,zu(p,s.precedence,t),r.instance=p;case"script":return p=Ks(s.src),(h=t.querySelector(_l(p)))?(r.instance=h,Xt(h),h):(c=s,(h=fr.get(p))&&(c=b({},s),Dg(c,h)),t=t.ownerDocument||t,h=t.createElement("script"),Xt(h),En(h,"link",c),t.head.appendChild(h),r.instance=h);case"void":return null;default:throw Error(a(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(c=r.instance,r.state.loading|=4,zu(c,s.precedence,t));return r.instance}function zu(t,r,s){for(var c=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=c.length?c[c.length-1]:null,p=h,C=0;C<c.length;C++){var R=c[C];if(R.dataset.precedence===r)p=R;else if(p!==h)break}p?p.parentNode.insertBefore(t,p.nextSibling):(r=s.nodeType===9?s.head:s,r.insertBefore(t,r.firstChild))}function kg(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.title==null&&(t.title=r.title)}function Dg(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.integrity==null&&(t.integrity=r.integrity)}var ju=null;function wS(t,r,s){if(ju===null){var c=new Map,h=ju=new Map;h.set(s,c)}else h=ju,c=h.get(s),c||(c=new Map,h.set(s,c));if(c.has(t))return c;for(c.set(t,null),s=s.getElementsByTagName(t),h=0;h<s.length;h++){var p=s[h];if(!(p[vi]||p[un]||t==="link"&&p.getAttribute("rel")==="stylesheet")&&p.namespaceURI!=="http://www.w3.org/2000/svg"){var C=p.getAttribute(r)||"";C=t+C;var R=c.get(C);R?R.push(p):c.set(C,[p])}}return c}function CS(t,r,s){t=t.ownerDocument||t,t.head.insertBefore(s,r==="title"?t.querySelector("head > title"):null)}function aT(t,r,s){if(s===1||r.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;return r.rel==="stylesheet"?(t=r.disabled,typeof r.precedence=="string"&&t==null):!0;case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function ES(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function iT(t,r,s,c){if(s.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var h=Fs(c.href),p=r.querySelector(El(h));if(p){r=p._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(t.count++,t=Uu.bind(t),r.then(t,t)),s.state.loading|=4,s.instance=p,Xt(p);return}p=r.ownerDocument||r,c=vS(c),(h=fr.get(h))&&kg(c,h),p=p.createElement("link"),Xt(p);var C=p;C._p=new Promise(function(R,B){C.onload=R,C.onerror=B}),En(p,"link",c),s.instance=p}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(s,r),(r=s.state.preload)&&(s.state.loading&3)===0&&(t.count++,s=Uu.bind(t),r.addEventListener("load",s),r.addEventListener("error",s))}}var Og=0;function sT(t,r){return t.stylesheets&&t.count===0&&Pu(t,t.stylesheets),0<t.count||0<t.imgCount?function(s){var c=setTimeout(function(){if(t.stylesheets&&Pu(t,t.stylesheets),t.unsuspend){var p=t.unsuspend;t.unsuspend=null,p()}},6e4+r);0<t.imgBytes&&Og===0&&(Og=62500*Ux());var h=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Pu(t,t.stylesheets),t.unsuspend)){var p=t.unsuspend;t.unsuspend=null,p()}},(t.imgBytes>Og?50:800)+r);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(c),clearTimeout(h)}}:null}function Uu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Pu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Bu=null;function Pu(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Bu=new Map,r.forEach(oT,t),Bu=null,Uu.call(t))}function oT(t,r){if(!(r.state.loading&4)){var s=Bu.get(t);if(s)var c=s.get(null);else{s=new Map,Bu.set(t,s);for(var h=t.querySelectorAll("link[data-precedence],style[data-precedence]"),p=0;p<h.length;p++){var C=h[p];(C.nodeName==="LINK"||C.getAttribute("media")!=="not all")&&(s.set(C.dataset.precedence,C),c=C)}c&&s.set(null,c)}h=r.instance,C=h.getAttribute("data-precedence"),p=s.get(C)||c,p===c&&s.set(null,h),s.set(C,h),this.count++,c=Uu.bind(this),h.addEventListener("load",c),h.addEventListener("error",c),p?p.parentNode.insertBefore(h,p.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(h,t.firstChild)),r.state.loading|=4}}var Al={$$typeof:x,Provider:null,Consumer:null,_currentValue:Ne,_currentValue2:Ne,_threadCount:0};function lT(t,r,s,c,h,p,C,R,B){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Re(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Re(0),this.hiddenUpdates=Re(null),this.identifierPrefix=c,this.onUncaughtError=h,this.onCaughtError=p,this.onRecoverableError=C,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=B,this.incompleteTransitions=new Map}function _S(t,r,s,c,h,p,C,R,B,Y,ae,ce){return t=new lT(t,r,s,C,B,Y,ae,ce,R),r=1,p===!0&&(r|=24),p=Yn(3,null,null,r),t.current=p,p.stateNode=t,r=uh(),r.refCount++,t.pooledCache=r,r.refCount++,p.memoizedState={element:c,isDehydrated:s,cache:r},gh(p),t}function AS(t){return t?(t=_s,t):_s}function xS(t,r,s,c,h,p){h=AS(h),c.context===null?c.context=h:c.pendingContext=h,c=Va(r),c.payload={element:s},p=p===void 0?null:p,p!==null&&(c.callback=p),s=Fa(t,c,r),s!==null&&(Gn(s,t,r),rl(s,t,r))}function TS(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<r?s:r}}function Lg(t,r){TS(t,r),(t=t.alternate)&&TS(t,r)}function RS(t){if(t.tag===13||t.tag===31){var r=Mi(t,67108864);r!==null&&Gn(r,t,67108864),Lg(t,67108864)}}function kS(t){if(t.tag===13||t.tag===31){var r=er();r=gt(r);var s=Mi(t,r);s!==null&&Gn(s,t,r),Lg(t,r)}}var qu=!0;function cT(t,r,s,c){var h=J.T;J.T=null;var p=de.p;try{de.p=2,Mg(t,r,s,c)}finally{de.p=p,J.T=h}}function uT(t,r,s,c){var h=J.T;J.T=null;var p=de.p;try{de.p=8,Mg(t,r,s,c)}finally{de.p=p,J.T=h}}function Mg(t,r,s,c){if(qu){var h=$g(c);if(h===null)vg(t,r,c,Gu,s),OS(t,c);else if(fT(h,t,r,s,c))c.stopPropagation();else if(OS(t,c),r&4&&-1<dT.indexOf(t)){for(;h!==null;){var p=Pr(h);if(p!==null)switch(p.tag){case 3:if(p=p.stateNode,p.current.memoizedState.isDehydrated){var C=Ee(p.pendingLanes);if(C!==0){var R=p;for(R.pendingLanes|=2,R.entangledLanes|=2;C;){var B=1<<31-on(C);R.entanglements[1]|=B,C&=~B}Kr(p),(wt&6)===0&&(xu=qt()+500,vl(0))}}break;case 31:case 13:R=Mi(p,2),R!==null&&Gn(R,p,2),Ru(),Lg(p,2)}if(p=$g(c),p===null&&vg(t,r,c,Gu,s),p===h)break;h=p}h!==null&&c.stopPropagation()}else vg(t,r,c,null,s)}}function $g(t){return t=zo(t),Ng(t)}var Gu=null;function Ng(t){if(Gu=null,t=Oa(t),t!==null){var r=l(t);if(r===null)t=null;else{var s=r.tag;if(s===13){if(t=u(r),t!==null)return t;t=null}else if(s===31){if(t=d(r),t!==null)return t;t=null}else if(s===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null)}}return Gu=t,null}function DS(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(bi()){case ta:return 2;case yn:return 8;case Ln:case nt:return 32;case Hn:return 268435456;default:return 32}default:return 32}}var Ig=!1,ri=null,ai=null,ii=null,xl=new Map,Tl=new Map,si=[],dT="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function OS(t,r){switch(t){case"focusin":case"focusout":ri=null;break;case"dragenter":case"dragleave":ai=null;break;case"mouseover":case"mouseout":ii=null;break;case"pointerover":case"pointerout":xl.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Tl.delete(r.pointerId)}}function Rl(t,r,s,c,h,p){return t===null||t.nativeEvent!==p?(t={blockedOn:r,domEventName:s,eventSystemFlags:c,nativeEvent:p,targetContainers:[h]},r!==null&&(r=Pr(r),r!==null&&RS(r)),t):(t.eventSystemFlags|=c,r=t.targetContainers,h!==null&&r.indexOf(h)===-1&&r.push(h),t)}function fT(t,r,s,c,h){switch(r){case"focusin":return ri=Rl(ri,t,r,s,c,h),!0;case"dragenter":return ai=Rl(ai,t,r,s,c,h),!0;case"mouseover":return ii=Rl(ii,t,r,s,c,h),!0;case"pointerover":var p=h.pointerId;return xl.set(p,Rl(xl.get(p)||null,t,r,s,c,h)),!0;case"gotpointercapture":return p=h.pointerId,Tl.set(p,Rl(Tl.get(p)||null,t,r,s,c,h)),!0}return!1}function LS(t){var r=Oa(t.target);if(r!==null){var s=l(r);if(s!==null){if(r=s.tag,r===13){if(r=u(s),r!==null){t.blockedOn=r,cn(t.priority,function(){kS(s)});return}}else if(r===31){if(r=d(s),r!==null){t.blockedOn=r,cn(t.priority,function(){kS(s)});return}}else if(r===3&&s.stateNode.current.memoizedState.isDehydrated){t.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Vu(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var s=$g(t.nativeEvent);if(s===null){s=t.nativeEvent;var c=new s.constructor(s.type,s);Ho=c,s.target.dispatchEvent(c),Ho=null}else return r=Pr(s),r!==null&&RS(r),t.blockedOn=s,!1;r.shift()}return!0}function MS(t,r,s){Vu(t)&&s.delete(r)}function hT(){Ig=!1,ri!==null&&Vu(ri)&&(ri=null),ai!==null&&Vu(ai)&&(ai=null),ii!==null&&Vu(ii)&&(ii=null),xl.forEach(MS),Tl.forEach(MS)}function Fu(t,r){t.blockedOn===r&&(t.blockedOn=null,Ig||(Ig=!0,o.unstable_scheduleCallback(o.unstable_NormalPriority,hT)))}var Ku=null;function $S(t){Ku!==t&&(Ku=t,o.unstable_scheduleCallback(o.unstable_NormalPriority,function(){Ku===t&&(Ku=null);for(var r=0;r<t.length;r+=3){var s=t[r],c=t[r+1],h=t[r+2];if(typeof c!="function"){if(Ng(c||s)===null)continue;break}var p=Pr(s);p!==null&&(t.splice(r,3),r-=3,$h(p,{pending:!0,data:h,method:s.method,action:c},c,h))}}))}function Ws(t){function r(B){return Fu(B,t)}ri!==null&&Fu(ri,t),ai!==null&&Fu(ai,t),ii!==null&&Fu(ii,t),xl.forEach(r),Tl.forEach(r);for(var s=0;s<si.length;s++){var c=si[s];c.blockedOn===t&&(c.blockedOn=null)}for(;0<si.length&&(s=si[0],s.blockedOn===null);)LS(s),s.blockedOn===null&&si.shift();if(s=(t.ownerDocument||t).$$reactFormReplay,s!=null)for(c=0;c<s.length;c+=3){var h=s[c],p=s[c+1],C=h[kn]||null;if(typeof p=="function")C||$S(s);else if(C){var R=null;if(p&&p.hasAttribute("formAction")){if(h=p,C=p[kn]||null)R=C.formAction;else if(Ng(h)!==null)continue}else R=C.action;typeof R=="function"?s[c+1]=R:(s.splice(c,3),c-=3),$S(s)}}}function NS(){function t(p){p.canIntercept&&p.info==="react-transition"&&p.intercept({handler:function(){return new Promise(function(C){return h=C})},focusReset:"manual",scroll:"manual"})}function r(){h!==null&&(h(),h=null),c||setTimeout(s,20)}function s(){if(!c&&!navigation.transition){var p=navigation.currentEntry;p&&p.url!=null&&navigation.navigate(p.url,{state:p.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,h=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(s,100),function(){c=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),h!==null&&(h(),h=null)}}}function Hg(t){this._internalRoot=t}Wu.prototype.render=Hg.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(a(409));var s=r.current,c=er();xS(s,c,t,r,null,null)},Wu.prototype.unmount=Hg.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;xS(t.current,2,null,t,null,null),Ru(),r[Da]=null}};function Wu(t){this._internalRoot=t}Wu.prototype.unstable_scheduleHydration=function(t){if(t){var r=ln();t={blockedOn:null,target:t,priority:r};for(var s=0;s<si.length&&r!==0&&r<si[s].priority;s++);si.splice(s,0,t),s===0&&LS(t)}};var IS=e.version;if(IS!=="19.2.8")throw Error(a(527,IS,"19.2.8"));de.findDOMNode=function(t){var r=t._reactInternals;if(r===void 0)throw typeof t.render=="function"?Error(a(188)):(t=Object.keys(t).join(","),Error(a(268,t)));return t=g(r),t=t!==null?m(t):null,t=t===null?null:t.stateNode,t};var gT={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:J,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Yu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yu.isDisabled&&Yu.supportsFiber)try{rr=Yu.inject(gT),sn=Yu}catch{}}return Ys.createRoot=function(t,r){if(!i(t))throw Error(a(299));var s=!1,c="",h=qb,p=Gb,C=Vb;return r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(c=r.identifierPrefix),r.onUncaughtError!==void 0&&(h=r.onUncaughtError),r.onCaughtError!==void 0&&(p=r.onCaughtError),r.onRecoverableError!==void 0&&(C=r.onRecoverableError)),r=_S(t,1,!1,null,null,s,c,null,h,p,C,NS),t[Da]=r.current,bg(t),new Hg(r)},Ys.hydrateRoot=function(t,r,s){if(!i(t))throw Error(a(299));var c=!1,h="",p=qb,C=Gb,R=Vb,B=null;return s!=null&&(s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(h=s.identifierPrefix),s.onUncaughtError!==void 0&&(p=s.onUncaughtError),s.onCaughtError!==void 0&&(C=s.onCaughtError),s.onRecoverableError!==void 0&&(R=s.onRecoverableError),s.formState!==void 0&&(B=s.formState)),r=_S(t,1,!0,r,s??null,c,h,B,p,C,R,NS),r.context=AS(null),s=r.current,c=er(),c=gt(c),h=Va(c),h.callback=null,Fa(s,h,c),s=c,r.current.lanes=s,et(r,s),Kr(r),t[Da]=r.current,bg(t),new Wu(r)},Ys.version="19.2.8",Ys}var Fg;function GS(){if(Fg)return Qu.exports;Fg=1;function o(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(o)}catch(e){console.error(e)}}return o(),Qu.exports=qS(),Qu.exports}var nd=GS();const rd=Yr(nd),Xs=[],VS=50;let ad=!1;function Kg(){try{return window.G7Core?.devTools}catch{return}}function Fi(o,e,n){const a=Kg();if(ad&&a?.isEnabled?.()){a.trackLog?.(o,e,n);return}ad||(o==="error"||o==="warn")&&Xs.length<VS&&Xs.push({level:o,prefix:e,args:n,timestamp:Date.now()})}function id(){ad=!0;const o=Kg();if(!o?.isEnabled?.()){Xs.length=0;return}for(const e of Xs)o.trackLog?.(e.level,e.prefix,e.args);Xs.length=0}const pi=class pi{constructor(){$(this,"debug");$(this,"prefix","[TemplateEngine]");this.debug=!1}static getInstance(){return pi.instance||(pi.instance=new pi),pi.instance}setDebug(e){this.debug=e}isDebugEnabled(){return this.debug}log(...e){this.debug&&console.log(this.prefix,...e),Fi("log","TemplateEngine",e)}error(...e){this.debug&&console.error(this.prefix,...e),Fi("error","TemplateEngine",e)}warn(...e){this.debug&&console.warn(this.prefix,...e),Fi("warn","TemplateEngine",e)}};$(pi,"instance");let Js=pi;function ft(o){const e=`[${o}]`,n=Js.getInstance();return{log:(...a)=>{n.isDebugEnabled()&&console.log(e,...a),Fi("log",o,a)},warn:(...a)=>{n.isDebugEnabled()&&console.warn(e,...a),Fi("warn",o,a)},error:(...a)=>{n.isDebugEnabled()&&console.error(e,...a),Fi("error",o,a)}}}Js.getInstance();const Ki=ft("networkResilience"),Wg=2,Yg=300,Xg=2e3,FS=15e3;function sd(o){return o?.name==="AbortError"}function Jg(o){return sd(o)?!1:o instanceof TypeError}let kl=!1,Qg=!1;function od(){return kl}function KS(){typeof window>"u"||Qg||(Qg=!0,window.addEventListener("pagehide",()=>{kl=!0}),window.addEventListener("pageshow",o=>{o.persisted&&(kl=!1)}),window.addEventListener("beforeunload",()=>{kl=!0}))}function Zg(o,e,n){const a=Math.min(e*Math.pow(2,o),n),i=a*.25*(Math.random()*2-1);return Math.max(0,Math.round(a+i))}function ep(o){return new Promise(e=>setTimeout(e,o))}async function Dl(o,e={}){const{retries:n=Wg,baseDelayMs:a=Yg,maxDelayMs:i=Xg,timeoutMs:l=FS,label:u=o,init:d}=e,f=n+1;let g;for(let m=0;m<f;m++){let b=!1,v;const S=l>0?new AbortController:null;try{const _={...d};if(S){const k=d?.signal;k&&(k.aborted?S.abort():k.addEventListener("abort",()=>S.abort(),{once:!0})),_.signal=S.signal,v=setTimeout(()=>{b=!0,S.abort()},l)}return await fetch(o,_)}catch(_){if(g=_,sd(_)&&!b||!(b||Jg(_)))throw _;if(od())throw Ki.warn(`Document unloading, aborting retries: ${u}`),_;if(m===f-1)throw Ki.warn(`All ${f} attempts failed: ${u}`,_),_;const O=Zg(m,a,i);Ki.warn(`Network failure (attempt ${m+1}/${f}), retrying in ${O}ms: ${u}`),await ep(O)}finally{v!==void 0&&clearTimeout(v)}}throw g}async function tp(o,e={},n={}){const{retries:a=Wg,baseDelayMs:i=Yg,maxDelayMs:l=Xg,label:u=o}=n,d=a+1;for(let f=0;f<d;f++)try{await WS(o,e);return}catch(g){if(e.id&&document.getElementById(e.id)?.remove(),od())throw Ki.warn(`Document unloading, aborting script retries: ${u}`),g;if(f===d-1)throw Ki.warn(`All ${d} script attempts failed: ${u}`),g;const b=Zg(f,i,l);Ki.warn(`Script load failed (attempt ${f+1}/${d}), retrying in ${b}ms: ${u}`),await ep(b)}}function WS(o,e){return new Promise((n,a)=>{const i=document.createElement("script");i.src=o,i.async=!1;for(const[l,u]of Object.entries(e))l==="id"?i.id=u:i.setAttribute(l,u);i.onload=()=>n(),i.onerror=()=>a(new Error(`Failed to load script: ${o}`)),document.head.appendChild(i)})}const np="extension",Wi="extensionless",YS="file";function XS(){const o=globalThis?.G7Config;if(globalThis?.__g7AssetUrlMode===Wi)return Wi;const n=o?.assetUrlMode;return n===Wi||n===np?n:o?.settings?.general?.asset_url_mode===Wi?Wi:np}function rp(){return XS()===Wi}function Mr(o,e,n,a){const i=o.replace(/\/+$/,""),l=e.replace(/^\.+/,""),u=rp()?i:`${i}.${l}`,d=[];return a&&d.push(a.replace(/^[?&]+/,"")),n!=null&&n!==""&&d.push(`v=${n}`),d.length>0?`${u}?${d.join("&")}`:u}function Ca(o){if(!o||!rp())return o;const e=globalThis?.location?.origin,n=e&&o.startsWith(e)?o.slice(e.length):o;if(!n.startsWith("/api/"))return o;const[a,i]=JS(n),l=a.match(/^\/api\/(modules|plugins)\/bundle\.(js|css)$/);if(l)return ap(`/api/${l[1]}/bundle/${l[2]}`,i);const u=a.match(/^\/api\/(templates|modules|plugins)\/assets\/([^/]+)\/(.+)$/);if(u){const[,f,g,m]=u,b=`${YS}=${encodeURIComponent(decodeURIComponent(m))}`;return`/api/${f}/assets/${g}?${b}${i?`&${i}`:""}`}const d=a.match(/^(\/api\/.+)\.(json|js|css)$/);return d?ap(d[1],i):o}function JS(o){const e=o.indexOf("?");return e===-1?[o,""]:[o.slice(0,e),o.slice(e+1)]}function ap(o,e){return e?`${o}?${e}`:o}const $r=ft("ComponentRegistry");class hn extends Error{constructor(n,a,i){super(n);$(this,"code");$(this,"details");this.code=a,this.details=i,this.name="ComponentRegistryError"}}const Kn=class Kn{constructor(){$(this,"registry",{});$(this,"manifest",null);$(this,"loadingState","idle");$(this,"error",null);$(this,"templateId",null);$(this,"templateType",null)}static getInstance(){return Kn.instance||(Kn.instance=new Kn),Kn.instance}static createIsolatedInstance(){return new Kn}static resetInstance(){Kn.instance=null}async loadComponents(e,n){if(this.loadingState==="loading")throw new hn("Components are already being loaded","LOADING_IN_PROGRESS");if(this.loadingState==="loaded"&&this.templateId===e&&this.templateType===n){$r.log("Components already loaded for template:",e,n);return}this.loadingState="loading",this.templateId=e,this.templateType=n,this.error=null;try{await this.loadManifest(),await this.loadComponentBundle(),this.loadingState="loaded",$r.log("Successfully loaded components:",Object.keys(this.registry).length)}catch(a){throw this.loadingState="error",this.error=a instanceof Error?a:new Error(String(a)),new hn(`Failed to load components: ${this.error.message}`,"LOAD_FAILED",{originalError:this.error})}}async loadManifest(){try{if(!this.templateId)throw new hn("Template ID not set","TEMPLATE_ID_NOT_SET");const e=`${this.templateId}:${this.templateType}`;if(Kn.manifestCache.has(e)){this.manifest=Kn.manifestCache.get(e),$r.log("Manifest loaded from cache:",this.manifest.templateId);return}const n=Mr(`/api/templates/${this.templateId}/components`,"json"),a=await Dl(n,{label:"components.json"});if(!a.ok)throw new hn(`Failed to fetch manifest: ${a.status} ${a.statusText}`,"MANIFEST_FETCH_FAILED",{status:a.status,statusText:a.statusText});const i=await a.json();this.validateManifest(i),this.manifest=i,Kn.manifestCache.set(e,i),$r.log("Manifest loaded and cached:",i.templateId)}catch(e){throw e instanceof hn?e:new hn("Failed to load component manifest","MANIFEST_LOAD_FAILED",{originalError:e})}}validateManifest(e){if(!e.version)throw new hn("Manifest missing required field: version","MANIFEST_INVALID",{field:"version"});if(!e.templateId)throw new hn("Manifest missing required field: templateId","MANIFEST_INVALID",{field:"templateId"});if(!e.components||typeof e.components!="object")throw new hn("Manifest missing required field: components","MANIFEST_INVALID",{field:"components"});const n=["basic","composite","layout"];for(const a of n){if(!Array.isArray(e.components[a]))throw new hn(`Manifest field 'components.${a}' must be an array`,"MANIFEST_INVALID",{field:`components.${a}`,value:e.components[a]});e.components[a].forEach((i,l)=>{if(!i.name||typeof i.name!="string")throw new hn(`Invalid component metadata at ${a}[${l}]: missing or invalid 'name'`,"MANIFEST_INVALID",{type:a,index:l,metadata:i});if(!i.type||typeof i.type!="string")throw new hn(`Invalid component metadata at ${a}[${l}]: missing or invalid 'type'`,"MANIFEST_INVALID",{type:a,index:l,metadata:i})})}$r.log("Manifest validation passed")}async loadComponentBundle(){try{if(!this.templateId)throw new hn("Template ID not set","TEMPLATE_ID_NOT_SET");const e=this.getGlobalVariableName(),n=window[e];if(!n||typeof n!="object")throw new hn(`Component bundle not loaded. Expected global variable: ${e}. Ensure admin.blade.php includes the IIFE bundle script.`,"BUNDLE_NOT_LOADED",{expectedVariable:e});await this.registerComponentsFromManifest(n),$r.log("Component bundle loaded from global variable:",e)}catch(e){throw e instanceof hn?e:new hn("Failed to load component bundle","BUNDLE_LOAD_FAILED",{originalError:e})}}getGlobalVariableName(){if(!this.templateId)throw new hn("Template ID not set","TEMPLATE_ID_NOT_SET");return this.templateId.split(/[-_]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join("")}async registerComponentsFromManifest(e){if(!this.manifest)throw new hn("Manifest not loaded","MANIFEST_NOT_LOADED");const n=["basic","composite","layout"];for(const a of n){const i=this.manifest.components[a]||[];for(const l of i){const u=l.name,d=e[u];if(!d){$r.warn(`Component '${u}' not found in bundle`);continue}this.registerComponent(u,d,l)}}}registerComponent(e,n,a){this.registry[e]&&$r.warn(`Component '${e}' already registered, overwriting`);const i=Xe.memo(n);this.registry[e]={component:i,metadata:a},$r.log(`[ComponentRegistry] Registered component: ${e} (${a.type})`)}getComponent(e){const n=this.registry[e];return n?n.component:null}getMetadata(e){const n=this.registry[e];return n?n.metadata:null}hasComponent(e){return e in this.registry}getComponentsByType(e){return Object.entries(this.registry).filter(([n,a])=>a.metadata.type===e).map(([n,a])=>n)}getAllComponents(){return Object.keys(this.registry)}getComponentMap(){const e={};for(const[n,a]of Object.entries(this.registry))e[n]=a.component;return e}getLoadingState(){return this.loadingState}getError(){return this.error}getTemplateId(){return this.templateId}getManifest(){return this.manifest}clear(){this.registry={},this.manifest=null,this.loadingState="idle",this.error=null,this.templateId=null,this.templateType=null,$r.log("Registry cleared")}};$(Kn,"instance",null),$(Kn,"manifestCache",new Map);let hr=Kn;const ip=ft("TranslationEngine");class ld extends Error{constructor(n,a,i){super(n);$(this,"key");$(this,"locale");this.key=a,this.locale=i,this.name="TranslationError"}}const In=class In{constructor(e={}){$(this,"cache",new Map);$(this,"translations",new Map);$(this,"options");$(this,"cacheVersion",0);this.options={defaultLocale:e.defaultLocale||"ko",fallbackLocale:e.fallbackLocale||"en",cacheTTL:e.cacheTTL||3e5}}static getInstance(e={}){return In.instance||(In.instance=new In(e)),In.instance}static resetInstance(){In.instance=null}setCacheVersion(e){this.cacheVersion!==e&&(ip.log("Cache version updated:",this.cacheVersion,"->",e),this.cacheVersion=e,this.cache.clear())}getCacheVersion(){return this.cacheVersion}async loadTranslations(e,n,a="/api",i=!1){const l=`${e}:${n}`;if(!i){const u=this.getFromCache(l);if(u)return this.translations.set(l,u),u}try{const u=[];i&&u.push(`_=${Date.now()}`);const d=Mr(`${a}/templates/${e}/lang/${n}`,"json",this.cacheVersion>0?this.cacheVersion:null,u.length>0?u.join("&"):void 0),f=await fetch(d);if(!f.ok)throw new ld(`Failed to load translations: ${f.statusText}`,void 0,n);const m=await f.json();return this.saveToCache(l,m),this.translations.set(l,m),m}catch(u){throw new ld(`Failed to fetch translations for ${n}: ${u instanceof Error?u.message:String(u)}`,void 0,n)}}resolveTranslations(e,n,a){let i=e;const l=5;let u=0;for(;u<l&&i.includes("=$t:");){const d=i;if(i=i.replace(In.NESTED_TRANSLATION_PARAM_PATTERN,(f,g,m)=>"="+this.translate(m,n,void 0,a)),i===d)break;u++}return i.replace(In.TRANSLATION_PATTERN,(d,f,g)=>{const{cleanedParams:m,trailing:b}=this.separateTrailingText(g);return this.translate(f,n,m,a)+b})}translate(e,n,a,i){const l=this.getTranslation(e,n),u=a&&this.cleanParamsStr(a);if(u){const d=this.parseParams(u,i);return this.replaceParams(l,d)}return l}getTranslation(e,n){const{templateId:a,locale:i}=n,l=`${a}:${i}`,u=this.translations.get(l);if(u){const d=this.getNestedValue(u,e);if(d!==null)return d}if(i!==this.options.fallbackLocale){const d=`${a}:${this.options.fallbackLocale}`,f=this.translations.get(d);if(f){const g=this.getNestedValue(f,e);if(g!==null)return g}}return e}getNestedValue(e,n){const a=n.split(".");let i=e;for(const l of a){if(i==null||typeof i!="object")return null;i=i[l]}return typeof i=="string"?i:null}setTranslationValue(e,n,a,i){const l=`${e}:${n}`,u=this.translations.get(l)??{},d=a.split(".");let f=u;for(let g=0;g<d.length-1;g+=1){const m=d[g],b=f[m];(b==null||typeof b!="object"||Array.isArray(b))&&(f[m]={}),f=f[m]}f[d[d.length-1]]=i,this.translations.set(l,u)}parseParams(e,n){const a={},i=e.startsWith("|")?e.slice(1):e,l=[],d=i.replace(/\{\{(?:[^}]|\}(?!\}))*\}\}/g,f=>(l.push(f),`__PLACEHOLDER_${l.length-1}__`)).matchAll(In.PARAM_PATTERN);for(const f of d){const[,g,m]=f,b=m.replace(/__PLACEHOLDER_(\d+)__/g,(v,S)=>l[parseInt(S,10)]);a[g.trim()]=this.resolveParamValue(b.trim(),n)}return a}resolveParamValue(e,n){if(e.startsWith("{{")&&e.endsWith("}}")){const a=e.slice(2,-2).trim();if(/[|&()[\]!?:+\-*/%<>=\s]/.test(a)&&n)try{const u=new Function(...Object.keys(n),`return ${a}`)(...Object.values(n));return String(u??"")}catch(l){return ip.error("Expression evaluation failed:",a,l),""}else{const l=this.getNestedDataValue(n,a);return String(l??"")}}return e}separateTrailingText(e){if(!e)return{cleanedParams:void 0,trailing:""};if(e.trimEnd().endsWith("}}"))return{cleanedParams:e,trailing:""};if(!(e.startsWith("|")?e.slice(1):e).includes("="))return{cleanedParams:void 0,trailing:e};const a=e.match(/(\s+[^\p{L}\w=|&\s][^\p{L}\w=]*\s*)$/u);return a?{cleanedParams:e.slice(0,-a[1].length),trailing:a[1]}:{cleanedParams:e,trailing:""}}cleanParamsStr(e){return this.separateTrailingText(e).cleanedParams||""}getNestedDataValue(e,n){if(!e)return;const a=n.split(".");let i=e;for(const l of a){if(i==null)return;i=i[l]}return i}replaceParams(e,n){let a=e;for(const[i,l]of Object.entries(n)){const u=new RegExp(`\\{\\{${i}\\}\\}`,"g");a=a.replace(u,String(l));const d=new RegExp(`\\{${i}\\}`,"g");a=a.replace(d,String(l))}return a}getFromCache(e){const n=this.cache.get(e);return n?Date.now()-n.timestamp>this.options.cacheTTL?(this.cache.delete(e),null):n.data:null}saveToCache(e,n){this.cache.set(e,{data:n,timestamp:Date.now()})}clearCache(){this.cache.clear(),this.translations.clear()}pruneCache(){const e=Date.now(),n=[];for(const[a,i]of this.cache.entries())e-i.timestamp>this.options.cacheTTL&&n.push(a);for(const a of n)this.cache.delete(a)}getCacheStats(){const e=Date.now();let n=0;for(const a of this.cache.values())e-a.timestamp>this.options.cacheTTL&&n++;return{size:this.cache.size,expired:n}}};$(In,"instance",null),$(In,"TRANSLATION_PATTERN",/\$t:(?:defer:)?([a-zA-Z0-9._-]+)(\|(?:(?!\$t:).)+)?/g),$(In,"NESTED_TRANSLATION_PARAM_PATTERN",/=(\$t:([a-zA-Z0-9._-]+))(?=[|&\s]|$)/g),$(In,"PARAM_PATTERN",/([^=|&]+)=([^|&]+)/g);let Ea=In,cd=null;function QS(o){return cd||(cd=new Ea(o)),cd}const sp=Object.freeze(Object.defineProperty({__proto__:null,TranslationEngine:Ea,TranslationError:ld,getTranslationEngine:QS},Symbol.toStringTag,{value:"Module"})),Yi=ft("PipeRegistry");function op(o,e){const n=o.getFullYear(),a=String(o.getMonth()+1).padStart(2,"0"),i=String(o.getDate()).padStart(2,"0"),l=String(o.getHours()).padStart(2,"0"),u=String(o.getMinutes()).padStart(2,"0"),d=String(o.getSeconds()).padStart(2,"0");return e.replace("YYYY",String(n)).replace("YY",String(n).slice(-2)).replace("MM",a).replace("M",String(o.getMonth()+1)).replace("DD",i).replace("D",String(o.getDate())).replace("HH",l).replace("H",String(o.getHours())).replace("mm",u).replace("m",String(o.getMinutes())).replace("ss",d).replace("s",String(o.getSeconds()))}function ZS(o,e="ko"){const a=new Date().getTime()-o.getTime(),i=Math.floor(a/1e3),l=Math.floor(i/60),u=Math.floor(l/60),d=Math.floor(u/24),f=Math.floor(d/7),g=Math.floor(d/30),m=Math.floor(d/365);return e==="ko"?i<60?"방금 전":l<60?`${l}분 전`:u<24?`${u}시간 전`:d<7?`${d}일 전`:f<4?`${f}주 전`:g<12?`${g}개월 전`:`${m}년 전`:i<60?"just now":l<60?`${l} minute${l===1?"":"s"} ago`:u<24?`${u} hour${u===1?"":"s"} ago`:d<7?`${d} day${d===1?"":"s"} ago`:f<4?`${f} week${f===1?"":"s"} ago`:g<12?`${g} month${g===1?"":"s"} ago`:`${m} year${m===1?"":"s"} ago`}function ud(o){if(o==null)return null;if(o instanceof Date)return o;if(typeof o=="number")return new Date(o);if(typeof o=="string"){const e=new Date(o);return isNaN(e.getTime())?null:e}return null}const Qs={date:{fn:(o,e="YYYY-MM-DD")=>{const n=ud(o);return n?op(n,e):""},description:"날짜 포맷 (기본: YYYY-MM-DD)"},datetime:{fn:(o,e="YYYY-MM-DD HH:mm")=>{const n=ud(o);return n?op(n,e):""},description:"날짜+시간 포맷 (기본: YYYY-MM-DD HH:mm)"},relativeTime:{fn:(o,e="ko")=>{const n=ud(o);return n?ZS(n,e):""},description:'상대 시간 표시 (예: "3분 전")'},number:{fn:(o,e)=>{const n=Number(o);if(isNaN(n))return String(o??"");const a={};return e!==void 0&&(a.minimumFractionDigits=e,a.maximumFractionDigits=e),n.toLocaleString(void 0,a)},description:"숫자 포맷 (천단위 구분, 선택적 소수점)"},truncate:{fn:(o,e=100,n="...")=>typeof o!="string"?String(o??""):o.length<=e?o:o.slice(0,e)+n,description:'문자열 자르기 (기본: 100자, 접미사: "...")'},uppercase:{fn:o=>typeof o!="string"?String(o??""):o.toUpperCase(),description:"대문자 변환"},lowercase:{fn:o=>typeof o!="string"?String(o??""):o.toLowerCase(),description:"소문자 변환"},stripHtml:{fn:o=>typeof o!="string"?String(o??""):o.replace(/<[^>]*>/g,""),description:"HTML 태그 제거"},default:{fn:(o,e="")=>o==null||o===""?e:o,description:"기본값 설정 (null, undefined, 빈문자열 시)"},fallback:{fn:(o,e)=>o??e,description:"폴백 값 설정 (null, undefined 시만)"},first:{fn:o=>{if(Array.isArray(o))return o[0]},description:"배열의 첫 번째 요소"},last:{fn:o=>{if(Array.isArray(o))return o[o.length-1]},description:"배열의 마지막 요소"},join:{fn:(o,e=", ")=>Array.isArray(o)?o.join(e):"",description:'배열을 문자열로 결합 (기본 구분자: ", ")'},length:{fn:o=>Array.isArray(o)||typeof o=="string"?o.length:0,description:"배열/문자열 길이"},filterBy:{fn:(o,e,n)=>Array.isArray(o)?Array.isArray(e)?o.filter(a=>{const i=n?a?.[n]:a;return e.includes(i)}):o:[],description:"배열 필터링 (allowList에 포함된 항목만 반환)"},keys:{fn:o=>o==null||typeof o!="object"?[]:Object.keys(o),description:"객체의 키 배열"},values:{fn:o=>o==null||typeof o!="object"?[]:Object.values(o),description:"객체의 값 배열"},json:{fn:(o,e)=>{try{return JSON.stringify(o,null,e)}catch{return""}},description:"JSON 문자열로 변환"},localized:{fn:(o,e)=>o==null?"":typeof o=="string"?o:typeof o!="object"?String(o):o[e||"ko"]||o.ko||o.en||Object.values(o)[0]||"",description:"다국어 객체에서 로케일에 맞는 값 추출"}},Xi=new Map,mi=class mi{static getInstance(){return mi.instance||(mi.instance=new mi),mi.instance}register(e,n,a){if(Qs[e]){Yi.warn(`[PipeRegistry] 내장 파이프를 덮어쓸 수 없습니다: ${e}`);return}Xi.set(e,{fn:n,description:a}),Yi.log(`[PipeRegistry] 커스텀 파이프 등록됨: ${e}`)}unregister(e){if(Qs[e])return Yi.warn(`[PipeRegistry] 내장 파이프는 해제할 수 없습니다: ${e}`),!1;const n=Xi.delete(e);return n&&Yi.log(`[PipeRegistry] 커스텀 파이프 해제됨: ${e}`),n}get(e){const n=Qs[e];return n?n.fn:Xi.get(e)?.fn}has(e){return!!Qs[e]||Xi.has(e)}execute(e,n,a=[]){const i=this.get(e);if(!i)return Yi.warn(`[PipeRegistry] 알 수 없는 파이프: ${e}`),n;try{return i(n,...a)}catch(l){return Yi.error(`[PipeRegistry] 파이프 실행 오류 (${e}):`,l),n}}list(){const e=[];for(const[n,a]of Object.entries(Qs))e.push({name:n,description:a.description,type:"built-in"});for(const[n,a]of Xi.entries())e.push({name:n,description:a.description,type:"custom"});return e.sort((n,a)=>n.name.localeCompare(a.name))}clearCustomPipes(){Xi.clear()}};$(mi,"instance",null);let Ol=mi;Ol.getInstance();function ew(o){const e=o.trim(),n=e.indexOf("(");if(n===-1)return{name:e,args:[]};const a=e.slice(0,n).trim(),i=e.slice(n+1,-1);if(!i.trim())return{name:a,args:[]};const l=[];let u="",d=null,f=0;for(let g=0;g<i.length;g++){const m=i[g];if((g>0?i[g-1]:"")==="\\"){u+=m;continue}if((m==='"'||m==="'")&&!d){d=m;continue}if(m===d){d=null;continue}if(d){u+=m;continue}if(m==="("||m==="["||m==="{"){f++,u+=m;continue}if(m===")"||m==="]"||m==="}"){f--,u+=m;continue}if(m===","&&f===0){l.push(lp(u.trim())),u="";continue}u+=m}return u.trim()&&l.push(lp(u.trim())),{name:a,args:l}}function lp(o){if(o==="null")return null;if(o==="undefined")return;if(o==="true")return!0;if(o==="false")return!1;const e=Number(o);return!isNaN(e)&&o!==""?e:o}function tw(o){const e=[];let n="",a=null,i=0;for(let l=0;l<o.length;l++){const u=o[l],d=l>0?o[l-1]:"",f=l<o.length-1?o[l+1]:"";if(d==="\\"){n+=u;continue}if((u==='"'||u==="'")&&!a){a=u,n+=u;continue}if(u===a){a=null,n+=u;continue}if(a){n+=u;continue}if(u==="("||u==="["||u==="{"){i++,n+=u;continue}if(u===")"||u==="]"||u==="}"){i--,n+=u;continue}if(u==="|"&&f!=="|"&&d!=="|"&&i===0){e.push(n.trim()),n="";continue}n+=u}return n.trim()&&e.push(n.trim()),e.length===0?[o,[]]:[e[0],e.slice(1)]}function li(o){let e=null,n=0;for(let a=0;a<o.length;a++){const i=o[a],l=a>0?o[a-1]:"",u=a<o.length-1?o[a+1]:"";if(l!=="\\"){if((i==='"'||i==="'")&&!e){e=i;continue}if(i===e){e=null;continue}if(!e){if(i==="("||i==="["||i==="{"){n++;continue}if(i===")"||i==="]"||i==="}"){n--;continue}if(i==="|"&&u!=="|"&&l!=="|"&&n===0)return!0}}}return!1}function nw(o,e){const n=Ol.getInstance();let a=o;for(const i of e){const l=ew(i);a=n.execute(l.name,a,l.args)}return a}const Nr="raw:",Ll="﷐",Zs="﷑",_a="﷒";function eo(o){return Ll+o+Zs}function cp(o){return o.length>=2&&o.charCodeAt(0)===64976&&o.charCodeAt(o.length-1)===64977}function up(o){return o.includes(Ll)}function dp(o){return o.slice(1,-1)}function Ji(o){if(typeof o=="string")return eo(o);if(Array.isArray(o))return o.map(Ji);if(o&&typeof o=="object"){const e={};for(const[n,a]of Object.entries(o))e[n]=Ji(a);return e}return o}const to=ft("DataBindingEngine");function Ml(){try{return window.G7Core?.devTools}catch{return}}class dd extends Error{constructor(n,a,i){super(n);$(this,"path");$(this,"context");this.path=a,this.context=i,this.name="DataBindingError"}}const Cr=class Cr{constructor(e){$(this,"cache",new Map);$(this,"expressionFnCache",new Map);$(this,"renderCycleCache",new Map);$(this,"currentRenderCycleId",0);$(this,"defaultOptions",{defaultValue:void 0,nullSafe:!0,detectCircular:!0,maxDepth:10});e&&(this.defaultOptions={...this.defaultOptions,...e})}startRenderCycle(){this.currentRenderCycleId++,this.renderCycleCache.clear()}isRenderCycleCacheActive(){return this.currentRenderCycleId>0}getFromRenderCycleCache(e){if(this.isRenderCycleCacheActive())return this.renderCycleCache.get(e)}saveToRenderCycleCache(e,n){this.isRenderCycleCacheActive()&&this.renderCycleCache.set(e,n)}resolveBindings(e,n,a,i){const l={...this.defaultOptions,...a},u=Ml(),d=n._computed&&!n.$computed?{...n,$computed:n._computed}:n;return e.replace(Cr.BINDING_PATTERN,(f,g)=>{const m=g.trim();let b=!1,v=m;if(m.startsWith(Nr)&&(b=!0,v=m.slice(Nr.length)),li(v)){const x=u?.isEnabled()?performance.now():0;try{const[D,U]=tw(v);let z,q=!1;const X=/[?:|&!+\-*/<>=()]/.test(D)||/\[['"]/.test(D),pe=D.startsWith("_global")||D.startsWith("_local")||D.startsWith("_isolated")||D.startsWith("$parent");if(l.skipCache)X?z=this.evaluateExpression(D,d):z=this.resolvePath(D,d,l);else if(X){const Le=this.getFromRenderCycleCache(`expr:${D}`);Le!==void 0?(z=Le,q=!0):(z=this.evaluateExpression(D,d),this.saveToRenderCycleCache(`expr:${D}`,z))}else if(pe){const Le=this.getFromRenderCycleCache(D);Le!==void 0?(z=Le,q=!0):(z=this.resolvePath(D,d,l),this.saveToRenderCycleCache(D,z))}else{const Le=this.getFromCache(D);Le!==void 0?(z=Le,q=!0):(z=this.resolvePath(D,d,l),this.saveToCache(D,z))}const Ce=nw(z,U);if(u?.isEnabled()){const Le=performance.now()-x;u.trackExpressionEval({expression:`{{${m}}}`,result:this.sanitizeResultForTracking(Ce),resultType:this.getResultType(Ce),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:q,duration:Le,method:"resolveBindings",skipCache:l.skipCache})}const ve=this.formatValue(Ce);return b?eo(ve):ve}catch(D){return to.error("Pipe expression evaluation failed:",v,D),f}}if(/[?:&!+\-*/<>=()]/.test(v)||/\|\|/.test(v)||/\[['"]/.test(v)){const x=u?.isEnabled()?performance.now():0;try{let D,U=!1;if(l.skipCache)D=this.evaluateExpression(v,d);else{const q=`expr:${v}`,X=this.getFromRenderCycleCache(q);X!==void 0?(D=X,U=!0):(D=this.evaluateExpression(v,d),this.saveToRenderCycleCache(q,D))}if(u?.isEnabled()){const q=performance.now()-x;u.trackExpressionEval({expression:`{{${m}}}`,result:this.sanitizeResultForTracking(D),resultType:this.getResultType(D),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:U,duration:q,method:"resolveBindings",skipCache:l.skipCache})}const z=this.formatValue(D);return b?eo(z):z}catch(D){return to.error("Expression evaluation failed:",v,D),f}}if(l.skipCache){const x=u?.isEnabled()?performance.now():0,D=this.resolvePath(v,d,l);if(u?.isEnabled()){const z=performance.now()-x;u.trackExpressionEval({expression:`{{${m}}}`,result:this.sanitizeResultForTracking(D),resultType:this.getResultType(D),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:!1,duration:z,method:"resolveBindings",skipCache:!0})}const U=this.formatValue(D);return b?eo(U):U}const _=v.startsWith("_global")||v.startsWith("_local")||v.startsWith("_isolated")||v.startsWith("$parent"),A=u?.isEnabled()?performance.now():0;let k,O=!1;if(_){const x=this.getFromRenderCycleCache(v);x!==void 0?(k=x,O=!0):(k=this.resolvePath(v,d,l),this.saveToRenderCycleCache(v,k))}else{const x=this.getFromCache(v);x!==void 0?(k=x,O=!0):(k=this.resolvePath(v,d,l),this.saveToCache(v,k))}if(u?.isEnabled()){const x=performance.now()-A;u.trackExpressionEval({expression:`{{${m}}}`,result:this.sanitizeResultForTracking(k),resultType:this.getResultType(k),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:O,duration:x,method:"resolveBindings",skipCache:l.skipCache})}const M=this.formatValue(k);return b?eo(M):M})}resolve(e,n,a,i){const l={...this.defaultOptions,...a},u=Ml(),d=u?.isEnabled()?performance.now():0;if(l.skipCache){const b=this.resolvePath(e,n,l);return u?.isEnabled()&&u.trackExpressionEval({expression:e,result:this.sanitizeResultForTracking(b),resultType:this.getResultType(b),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:!1,duration:performance.now()-d,method:"resolve",skipCache:!0}),b}const f=e.startsWith("_global")||e.startsWith("_local")||e.startsWith("_isolated")||e.startsWith("$parent");let g=!1;if(f){const b=this.getFromRenderCycleCache(e);if(b!==void 0)return g=!0,u?.isEnabled()&&u.trackExpressionEval({expression:e,result:this.sanitizeResultForTracking(b),resultType:this.getResultType(b),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:!0,duration:performance.now()-d,method:"resolve",skipCache:l.skipCache}),b}else{const b=this.getFromCache(e);if(b!==void 0)return g=!0,u?.isEnabled()&&u.trackExpressionEval({expression:e,result:this.sanitizeResultForTracking(b),resultType:this.getResultType(b),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:!0,duration:performance.now()-d,method:"resolve",skipCache:l.skipCache}),b}const m=this.resolvePath(e,n,l);return f?this.saveToRenderCycleCache(e,m):this.saveToCache(e,m),u?.isEnabled()&&u.trackExpressionEval({expression:e,result:this.sanitizeResultForTracking(m),resultType:this.getResultType(m),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:g,duration:performance.now()-d,method:"resolve",skipCache:l.skipCache}),m}resolvePath(e,n,a,i=0,l=new WeakSet){if(a.maxDepth&&i>a.maxDepth){if(a.detectCircular)throw new dd(`Maximum depth exceeded (${a.maxDepth}). Possible circular reference.`,e,n);return a.defaultValue}const u=this.parsePath(e);let d=n;for(let f=0;f<u.length;f++){const g=u[f];if(d==null){if(a.nullSafe)return a.defaultValue;throw new dd(`Cannot read property '${g}' of ${d}`,e,n)}if(a.detectCircular&&typeof d=="object"){if(l.has(d))throw new dd(`Circular reference detected at path: ${u.slice(0,f+1).join(".")}`,e,n);l.add(d)}d=d[g],e==="_global.toasts"&&to.log(`[DataBindingEngine] segment: ${g}, current:`,d)}return d!==void 0?d:a.defaultValue}parsePath(e){const n=[];let a;for(Cr.PATH_SEGMENT_PATTERN.lastIndex=0;(a=Cr.PATH_SEGMENT_PATTERN.exec(e))!==null;){const i=a[1]||a[2];i&&n.push(i)}return n}formatValue(e){if(e==null)return"";if(typeof e=="object")try{return JSON.stringify(e)}catch{return"[Object]"}return String(e)}getFromCache(e){const n=this.cache.get(e),a=Ml();if(!n){a?.isEnabled()&&a.recordCacheMiss();return}if(Date.now()-n.timestamp>Cr.CACHE_EXPIRY){this.cache.delete(e),a?.isEnabled()&&a.recordCacheMiss();return}return a?.isEnabled()&&a.recordCacheHit(),n.value}saveToCache(e,n){this.cache.set(e,{value:n,timestamp:Date.now()})}isActionDefinition(e){return typeof e.handler!="string"?!1:e.params!==void 0||Array.isArray(e.actions)||typeof e.target=="string"||e.onSuccess!==void 0||e.onError!==void 0}extractSingleBinding(e){if(!e.startsWith("{{")||!e.endsWith("}}")||e.length<5)return null;const n=e.slice(2,-2);let a=0;for(let i=0;i<n.length-1;i++){const l=n[i];if(l==="{")a++;else if(l==="}"){if(a>0)a--;else if(n[i+1]==="}")return null}}return n}resolveObject(e,n,a){if(this.isSwitchExpression(e)){const d=e;return this.resolveSwitch(d,n,a)}if(this.isActionDefinition(e))return{...e};if("iteration"in e)return{...e};const i={},u=[...["cellChildren","expandChildren","expandContext","render"],...a?.skipBindingKeys||[]];for(const[d,f]of Object.entries(e)){if(u.includes(d)){i[d]=f;continue}if(typeof f=="string"){const g=this.extractSingleBinding(f);if(g!==null){const m=g.trim();let b=!1,v=m;m.startsWith(Nr)&&(b=!0,v=m.slice(Nr.length));const S=/[?:|&!+\-*/<>=()]/.test(v)||/\[['"]/.test(v),_=li(v)?this.resolveBindings(`{{${v}}}`,n,a):S?this.evaluateExpression(v,n,a):this.resolve(v,n,a);i[d]=b&&_!=null?Ji(_):_}else i[d]=this.resolveBindings(f,n,a)}else Array.isArray(f)?i[d]=f.map(g=>typeof g=="string"?this.resolveBindings(g,n,a):typeof g=="object"&&g!==null?this.resolveObject(g,n,a):g):f&&typeof f=="object"?i[d]=this.resolveObject(f,n,a):i[d]=f}return i}clearCache(){this.cache.clear(),this.expressionFnCache.clear()}invalidateCacheByKeys(e){for(const n of this.cache.keys())for(const a of e)if(n===a||n.startsWith(`${a}.`)||n.startsWith(`${a}[`)){this.cache.delete(n);break}}pruneCache(){const e=Date.now();for(const[n,a]of this.cache.entries())e-a.timestamp>Cr.CACHE_EXPIRY&&this.cache.delete(n)}getCacheStats(){const e=Date.now();let n=0;for(const a of this.cache.values())e-a.timestamp>Cr.CACHE_EXPIRY&&n++;return{size:this.cache.size,expired:n}}evaluateExpression(e,n,a){const i=Ml(),l=i?.isEnabled()?performance.now():0;i?.isEnabled()&&i.trackBindingEval();try{let u=this.preprocessOptionalChaining(e);u=this.preprocessTranslationTokens(u);const d=this.extractVariablesFromExpression(u),f={...n};for(const D of d)D in f||(f[D]=void 0);n._computed&&!f.$computed&&(f.$computed=n._computed);let g=n.$templateId,m=n.$locale;if(typeof window<"u"&&(!g||!m)){const D=window.__templateApp?.getConfig?.();g??(g=D?.templateId),m??(m=D?.locale)}const b=m||"ko";f.$localized=(D,U)=>{if(D==null&&!U)return"";if(typeof D=="string")return D;if(D&&typeof D=="object"&&D[b])return D[b];if(U&&typeof U=="string"){const z=f.$t?f.$t(U):U;if(z&&z!==U)return z}return D&&typeof D=="object"?D.ko||D.en||Object.values(D)[0]||"":D==null?"":String(D)};const v=typeof window<"u"?window.G7Core:void 0;f.$uuid=()=>v?.uuid?v.uuid():typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,D=>{const U=Math.random()*16|0;return(D==="x"?U:U&3|8).toString(16)});const S={templateId:g||"",locale:b};f.$t=D=>{if(!D||typeof D!="string")return"";try{return Ea.getInstance().translate(D,S)}catch(U){return to.warn("$t() translation failed for key:",D,U),D}},f.$get=(D,U,z=void 0)=>{if(D==null)return z;const q=Array.isArray(U)?U:[U];if(q.length===0)return D;let X=D;for(const pe of q){if(X==null||pe==null)return z;X=X[pe]}return X??z};const _=Object.keys(f),A=Object.values(f),k=`${u}|${_.join(",")}`;let O=this.expressionFnCache.get(k);const M=!!O;O||(O=new Function(..._,`return (${u});`),this.expressionFnCache.set(k,O));const x=O(...A);if(i?.isEnabled()){const D=performance.now()-l;i.trackExpressionEval({expression:e,result:this.sanitizeResultForTracking(x),resultType:this.getResultType(x),componentId:a?.componentId,componentName:a?.componentName,propName:a?.propName,fromCache:M,duration:D,method:"evaluateExpression",skipCache:a?.skipCache})}return x}catch(u){throw new Error(`Failed to evaluate expression "${e}": ${u instanceof Error?u.message:String(u)}`)}}getResultType(e){return e===null?"null":e===void 0?"undefined":Array.isArray(e)?"array":typeof e}sanitizeResultForTracking(e){if(e==null||typeof e!="object")return e;try{if(Array.isArray(e))return e.length>10?`[Array(${e.length})]`:e.slice(0,10);const n=Object.keys(e);return n.length>20?`{Object(${n.length} keys)}`:(JSON.stringify(e),e)}catch{return"[Complex Object]"}}preprocessTranslationTokens(e){return e=e.replace(/(['"])(\$t:([a-zA-Z_][a-zA-Z0-9_.\-]*))\1/g,(n,a,i,l)=>`$t('${l}')`),e.replace(/(?<!['"]\s*)(\$t:[a-zA-Z_][a-zA-Z0-9_.\-]*)(?!\s*['"])/g,'"$1"')}preprocessOptionalChaining(e){const n=[];let a=e.replace(/(['"])(?:(?!\1|\\).|\\.)*\1/g,l=>(n.push(l),`__STRING_LITERAL_${n.length-1}__`));const i=[];return a=a.replace(/\$t:[a-zA-Z_][a-zA-Z0-9_.\-]*(?:\|[^'"\s,)]+)?/g,l=>(i.push(l),`__TRANSLATION_TOKEN_${i.length-1}__`)),a=a.replace(/([a-zA-Z_$][a-zA-Z0-9_$]*)\.(?!\?)/g,"$1?."),a=a.replace(/__TRANSLATION_TOKEN_(\d+)__/g,(l,u)=>i[parseInt(u,10)]),a=a.replace(/__STRING_LITERAL_(\d+)__/g,(l,u)=>n[parseInt(u,10)]),a}extractVariablesFromExpression(e){const n=new Set(["true","false","null","undefined","NaN","Infinity","if","else","for","while","do","switch","case","break","continue","return","function","class","const","let","var","new","delete","typeof","instanceof","this","super","import","export","default","try","catch","finally","throw","Math","Date","JSON","Array","Object","String","Number","Boolean","RegExp","Set","Map","WeakSet","WeakMap","Symbol","Promise","BigInt","Error","parseInt","parseFloat","isNaN","isFinite","encodeURI","decodeURI","encodeURIComponent","decodeURIComponent"]),a=/(?<![.\w$])([a-zA-Z_$][a-zA-Z0-9_$]*)/g,i=new Set;let l;for(;(l=a.exec(e))!==null;){const u=l[1];n.has(u)||i.add(u)}return Array.from(i)}isSwitchExpression(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&"$switch"in e&&"$cases"in e}resolveSwitch(e,n,a){const i={...a,skipCache:!0};let l;try{l=this.resolveBindings(e.$switch,n,i)?.toString()?.trim()??""}catch(d){to.warn("resolveSwitch: $switch 키 평가 실패:",e.$switch,d),l=""}let u;if(l&&e.$cases&&l in e.$cases)u=e.$cases[l];else if("$default"in e)u=e.$default;else return;return typeof u=="string"?u.includes("{{")?this.resolveBindings(u,n,i):u:u!==null&&typeof u=="object"?this.resolveObject(u,n,i):u}};$(Cr,"BINDING_PATTERN",/\{\{([^}]+)\}\}/g),$(Cr,"PATH_SEGMENT_PATTERN",/([^.[\]]+)|\[(\d+)\]/g),$(Cr,"CACHE_EXPIRY",3e4);let On=Cr;const rw=new On,$l={mobile:{min:0,max:767},tablet:{min:768,max:1023},desktop:{min:1024,max:1/0},portable:{min:0,max:1023}},Nl=new Map;function aw(o,e){let n=null;return((...a)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{o(...a)},e)})}class iw{constructor(){$(this,"subscribers",new Set);$(this,"currentWidth",1024);$(this,"debouncedHandler",null);$(this,"isInitialized",!1);this.initialize()}initialize(){typeof window>"u"||(this.currentWidth=window.innerWidth,this.isInitialized=!0,this.debouncedHandler=aw(()=>{this.currentWidth=window.innerWidth,this.notifySubscribers()},150),window.addEventListener("resize",this.debouncedHandler))}notifySubscribers(){this.subscribers.forEach(e=>{e(this.currentWidth)})}subscribe(e){return this.subscribers.add(e),e(this.currentWidth),()=>{this.subscribers.delete(e)}}getWidth(){return this.currentWidth}parseRange(e){if(Nl.has(e))return Nl.get(e)??null;let n=null;if($l[e])n={...$l[e]};else{const a=e.match(/^(-?\d*)-(-?\d*)$/);if(a){const[,i,l]=a,u=i===""?0:parseInt(i,10),d=l===""?1/0:parseInt(l,10);!isNaN(u)&&!isNaN(d)&&u<=d&&(n={min:u,max:d})}}return Nl.set(e,n),n}getMatchingKey(e,n){const a=[];for(const i of Object.keys(e)){const l=this.parseRange(i);l&&n>=l.min&&n<=l.max&&a.push({key:i,range:l,isPreset:!!$l[i]})}return a.length===0?null:(a.sort((i,l)=>{if(i.isPreset!==l.isPreset)return i.isPreset?1:-1;const u=i.range.max-i.range.min,d=l.range.max-l.range.min;return u-d}),a[0].key)}matches(e){const n=this.parseRange(e);return n?this.currentWidth>=n.min&&this.currentWidth<=n.max:!1}clearSubscribers(){this.subscribers.clear()}destroy(){this.debouncedHandler&&typeof window<"u"&&window.removeEventListener("resize",this.debouncedHandler),this.clearSubscribers(),Nl.clear()}_setWidthForTesting(e){this.currentWidth=e,this.notifySubscribers()}}const ci=new iw,Il=ft("ConditionEvaluator");function sw(o){switch(o){case"true":return{value:!0};case"false":return{value:!1};case"null":return{value:null};case"undefined":return{value:void 0};default:return}}function ow(o){return/[?:|&!+\-*/<>=()]/.test(o)}function lw(o){if(!o.startsWith("{{")||!o.endsWith("}}"))return null;const e=o.slice(2,-2);let n=null,a=0;for(let i=0;i<e.length;i++){const l=e[i];if((i>0?e[i-1]:"")!=="\\"&&((l==='"'||l==="'")&&!n?n=l:l===n&&(n=null),!n&&(l==="{"&&a++,l==="}"&&a--,a<0)))return null}return a===0?e.trim():null}function cw(o,e,n){if(!o)return!0;try{const a=lw(o);let i;if(a!==null){const l=sw(a);l!==void 0?i=l.value:li(a)?i=n.resolveBindings(`{{${a}}}`,e,{skipCache:!0}):ow(a)?i=n.evaluateExpression(a,e):i=n.resolve(a,e,{skipCache:!0})}else i=n.resolveBindings(o,e,{skipCache:!0});if(typeof i=="string"){const l=i.toLowerCase().trim();if(l==="false"||l==="0"||l===""||l==="null"||l==="undefined")return!1}return!!i}catch(a){return Il.warn(`evaluateStringCondition: 조건 평가 실패: ${o}`,a),!1}}function Hl(o,e,n){if(typeof o=="string")return cw(o,e,n);if("and"in o){if(!Array.isArray(o.and)||o.and.length===0)return Il.warn("evaluateConditionExpression: AND 그룹이 비어있습니다"),!0;for(const a of o.and)if(!Hl(a,e,n))return!1;return!0}if("or"in o){if(!Array.isArray(o.or)||o.or.length===0)return Il.warn("evaluateConditionExpression: OR 그룹이 비어있습니다"),!1;for(const a of o.or)if(Hl(a,e,n))return!0;return!1}return Il.warn("evaluateConditionExpression: 알 수 없는 조건 형식",o),!1}function fp(o,e,n){if(!Array.isArray(o)||o.length===0)return{matched:!1,branchIndex:-1};for(let a=0;a<o.length;a++){const i=o[a];if(i.if===void 0)return{matched:!0,branchIndex:a};if(Hl(i.if,e,n))return{matched:!0,branchIndex:a}}return{matched:!1,branchIndex:-1}}function uw(o){return typeof o=="string"?!0:o&&typeof o=="object"?"and"in o||"or"in o:!1}function dw(o){if(!Array.isArray(o)||o.length===0)return!1;const e=o[0];return!e||typeof e!="object"?!1:"if"in e||"then"in e}const Xr=ft("RenderHelpers"),fw=new Map([["true",!0],["false",!1],["null",null]]);function hp(){try{return window.G7Core?.devTools}catch{return}}const gp=new On;function fd(o){return/[?:|&!+\-*/<>=()[\]{}]/.test(o)}function pp(o){if(!o.startsWith("{{")||!o.endsWith("}}"))return null;const e=o.slice(2,-2);let n=null,a=0;for(let i=0;i<e.length;i++){const l=e[i];if((i>0?e[i-1]:"")!=="\\"&&((l==='"'||l==="'")&&!n?n=l:l===n&&(n=null),!n&&(l==="{"&&a++,l==="}"&&a--,a<0)))return null}return a===0?e.trim():null}function hd(o,e,n){let a=o;if(o.startsWith("{{")&&o.endsWith("}}")&&(a=o.slice(2,-2).trim()),fd(a))try{return n.evaluateExpression(a,e)}catch(i){Xr.warn(`resolveIterationSource: 표현식 평가 실패: ${o}`,i);return}return n.resolve(a,e,{skipCache:!0})}function hw(o,e){const n={...o};if(e?.parentDataContext)for(const[a,i]of Object.entries(e.parentDataContext))a in n||(n[a]=i);if(e?.state){const a=n._local||{};n._local={...a,...e.state}}return e?.isolatedContext?.state&&(n._isolated=e.isolatedContext.state),n}function gd(o,e,n,a){if(!e||!Array.isArray(e)||e.length===0)return o;const i=a?.actionDispatcher??um(),l={...o,actions:e},u=i.bindActionsToProps(l,n,a?.componentContext);return delete u.actions,u}function mp(o,e,n,a){if(typeof o=="boolean")return o;if(!o)return!0;try{const i=pp(o);let l;if(i!==null){const u=fw.get(i);u!==void 0?l=u:li(i)?l=n.resolveBindings(`{{${i}}}`,e,{skipCache:!0}):fd(i)?l=n.evaluateExpression(i,e):l=n.resolve(i,e,{skipCache:!0})}else l=n.resolveBindings(o,e,{skipCache:!0});if(typeof l=="string"){const u=l.toLowerCase().trim();if(u==="false"||u==="0"||u===""||u==="null"||u==="undefined")return!1}return!!l}catch(i){return Xr.warn(`evaluateIfCondition: 조건 평가 실패 (컴포넌트: ${a||"unknown"}):`,i),!1}}function Qi(o,e,n,a){if(o.if!==void 0)return mp(o.if,e,n,a);if(o.condition!==void 0)return mp(o.condition,e,n,a);if(o.conditions===void 0)return!0;const i=o.conditions;try{return uw(i)?Hl(i,e,n):dw(i)?fp(i,e,n).matched:(Xr.warn(`evaluateRenderCondition: 알 수 없는 conditions 형식 (컴포넌트: ${a||"unknown"})`),!0)}catch(l){return Xr.warn(`evaluateRenderCondition: conditions 평가 실패 (컴포넌트: ${a||"unknown"}):`,l),!1}}function yp(o){if(!o.responsive)return o;const e=ci.getWidth(),n=ci.getMatchingKey(o.responsive,e);if(!n)return o;const a=o.responsive[n];return{...o,props:{...o.props,...a.props},children:a.children??o.children,text:a.text??o.text,if:a.if??o.if,iteration:a.iteration??o.iteration}}function no(o,e,n,a,i){if(!o||o.length===0)return[];const l=i?.bindingEngine??new On,u=i?.translationEngine??Ea.getInstance(),d=i?.translationContext??{templateId:"",locale:"ko"},f=hw(e,i?.componentContext),g=(v,S)=>{if(typeof v=="string"){if(cp(v))return dp(v);if(up(v)){const A=[],k=v.replace(new RegExp(`${Ll}([^${Zs}]*)${Zs}`,"g"),(M,x)=>(A.push(x),`${_a}${A.length-1}${_a}`));let O=k;return/\$t:[a-zA-Z0-9._-]+/.test(k)&&(O=u.resolveTranslations(k,d,S)),O.replace(new RegExp(`${_a}(\\d+)${_a}`,"g"),(M,x)=>A[parseInt(x)])}if(v.startsWith("$t:defer:")){const A="$t:"+v.slice(9);return u.resolveTranslations(A,d,S)}if(v.startsWith("$t:"))return u.resolveTranslations(v,d,S);const _=pp(v);if(_!==null){let A=!1,k=_;_.startsWith(Nr)&&(A=!0,k=_.slice(Nr.length));let O;if(li(k))O=l.resolveBindings(`{{${k}}}`,S,{skipCache:!0});else if(fd(k))try{O=l.evaluateExpression(k,S)}catch(M){Xr.warn("renderItemChildren: 표현식 평가 실패:",M);return}else O=l.resolve(k,S,{skipCache:!0});return!A&&typeof O=="string"&&/\$t:[a-zA-Z0-9._-]+/.test(O)&&(O=u.resolveTranslations(O,d,S)),A&&O!=null?Ji(O):O}if(v.includes("{{")){const A=l.resolveBindings(v,S,{skipCache:!0});return typeof A=="string"&&/\$t:[a-zA-Z0-9._-]+/.test(A)?u.resolveTranslations(A,d,S):A}return v}if(Array.isArray(v))return v.map(_=>g(_,S));if(v&&typeof v=="object"){const _={};for(const[A,k]of Object.entries(v))_[A]=g(k,S);return _}return v},m=(v,S)=>{if(!v)return{};const _={};for(const[A,k]of Object.entries(v))_[A]=g(k,S);return _},b=(v,S,_)=>{const A=yp(v),k=A.iteration;if(!k)return[];const O=hd(k.source,_,l);if(!Array.isArray(O))return Xr.warn(`renderItemChildren: iteration.source가 배열이 아닙니다: ${k.source}`),[];const M=hp();if(M?.isEnabled()){const D=`${S}-iteration`;M.trackIteration(D,k.source,k.item_var,k.index_var,O.length)}const x=n[A.name];return x?O.flatMap((D,U)=>{const z={..._,[k.item_var]:D,[`${k.item_var}_index`]:U,...k.index_var?{[k.index_var]:U}:{}},q=Qi({if:A.if,condition:A.condition,conditions:A.conditions},z,l,A.id);if(A.if&&M?.isEnabled()){const Fe=`${S}-iter-${U}-if`;M.trackIfCondition(Fe,A.if,q,A.name)}if(!q)return[];const X=A.id?String(g(A.id,z)):void 0,pe=`${S}-iter-${U}`,Ce=i?.getRemountKey?i.getRemountKey(X,pe):pe,ve=m(A.props,z),Le=gd(ve,A.actions,z,{actionDispatcher:i?.actionDispatcher,componentContext:i?.componentContext});let Ve=null;return A.text!==void 0?Ve=g(A.text,z):A.children&&A.children.length>0&&(Ve=no(A.children,z,n,Ce,i)),M?.isEnabled()&&M.trackRender(A.name),[Xe.createElement(x,{key:Ce,...Le},Ve)]}):(Xr.warn(`renderItemChildren: 컴포넌트를 찾을 수 없습니다: ${A.name}`),[])};return o.flatMap((v,S)=>{const _=yp(v),A=_.id?String(g(_.id,f)):void 0,k=a?`${a}-${A||S}`:A||`child-${S}`,O=i?.getRemountKey?i.getRemountKey(A,k):k;if(_.iteration)return b(_,O,f);const M=Qi({if:_.if,condition:_.condition,conditions:_.conditions},f,l,_.id),x=hp();if(_.if&&x?.isEnabled()){const X=`${O}-if`;x.trackIfCondition(X,_.if,M,_.name)}if(!M)return[];const D=n[_.name];if(!D)return Xr.warn(`renderItemChildren: 컴포넌트를 찾을 수 없습니다: ${_.name}`),[];const U=m(_.props,f),z=gd(U,_.actions,f,{actionDispatcher:i?.actionDispatcher,componentContext:i?.componentContext});let q=null;return _.text!==void 0?q=g(_.text,f):_.children&&_.children.length>0&&(q=no(_.children,f,n,O,i)),x?.isEnabled()&&x.trackRender(_.name),[Xe.createElement(D,{key:O,...z},q)]})}function Zi(o,e,n,a){let i,l;return n instanceof On?(i=n,l=a):(i=gp,l=n),i.resolveBindings(o,e,l)}function gw(o,e,n,a){const i=n??gp,l={skipCache:!0,...a};let u;try{u=i.resolveBindings(o.key,e,{skipCache:l.skipCache})?.toString()?.trim()??""}catch(g){Xr.warn("resolveClassMap: key 평가 실패:",o.key,g),u=""}let d="";u&&o.variants&&u in o.variants?d=o.variants[u]:o.default&&(d=o.default);const f=[];return o.base?.trim()&&f.push(o.base.trim()),d?.trim()&&f.push(d.trim()),f.join(" ")}function bp(o,e){return function(){return o.apply(e,arguments)}}const{toString:pw}=Object.prototype,{getPrototypeOf:es}=Object,{iterator:ro,toStringTag:vp}=Symbol,zl=(({hasOwnProperty:o})=>(e,n)=>o.call(e,n))(Object.prototype),ao=(o,e)=>{let n=o;const a=[];for(;n!=null&&n!==Object.prototype;){if(a.indexOf(n)!==-1)return!1;if(a.push(n),zl(n,e))return!0;n=es(n)}return!1},mw=(o,e)=>o!=null&&ao(o,e)?o[e]:void 0,pd=(o=>e=>{const n=pw.call(e);return o[n]||(o[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),gr=o=>(o=o.toLowerCase(),e=>pd(e)===o),jl=o=>e=>typeof e===o,{isArray:ui}=Array,ts=jl("undefined");function ns(o){return o!==null&&!ts(o)&&o.constructor!==null&&!ts(o.constructor)&&$n(o.constructor.isBuffer)&&o.constructor.isBuffer(o)}const Sp=gr("ArrayBuffer");function yw(o){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(o):e=o&&o.buffer&&Sp(o.buffer),e}const bw=jl("string"),$n=jl("function"),wp=jl("number"),rs=o=>o!==null&&typeof o=="object",vw=o=>o===!0||o===!1,Ul=o=>{if(!rs(o))return!1;const e=es(o);return(e===null||e===Object.prototype||es(e)===null)&&!ao(o,vp)&&!ao(o,ro)},Sw=o=>{if(!rs(o)||ns(o))return!1;try{return Object.keys(o).length===0&&Object.getPrototypeOf(o)===Object.prototype}catch{return!1}},ww=gr("Date"),Cw=gr("File"),Ew=o=>!!(o&&typeof o.uri<"u"),_w=o=>o&&typeof o.getParts<"u",Aw=gr("Blob"),xw=gr("FileList"),Tw=o=>rs(o)&&$n(o.pipe);function Rw(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const Cp=Rw(),Ep=typeof Cp.FormData<"u"?Cp.FormData:void 0,kw=o=>{if(!o)return!1;if(Ep&&o instanceof Ep)return!0;const e=es(o);if(!e||e===Object.prototype||!$n(o.append))return!1;const n=pd(o);return n==="formdata"||n==="object"&&$n(o.toString)&&o.toString()==="[object FormData]"},Dw=gr("URLSearchParams"),[Ow,Lw,Mw,$w]=["ReadableStream","Request","Response","Headers"].map(gr),Nw=o=>o.trim?o.trim():o.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function io(o,e,{allOwnKeys:n=!1}={}){if(o===null||typeof o>"u")return;let a,i;if(typeof o!="object"&&(o=[o]),ui(o))for(a=0,i=o.length;a<i;a++)e.call(null,o[a],a,o);else{if(ns(o))return;const l=n?Object.getOwnPropertyNames(o):Object.keys(o),u=l.length;let d;for(a=0;a<u;a++)d=l[a],e.call(null,o[d],d,o)}}function _p(o,e){if(ns(o))return null;e=e.toLowerCase();const n=Object.keys(o);let a=n.length,i;for(;a-- >0;)if(i=n[a],e===i.toLowerCase())return i;return null}const di=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ap=o=>!ts(o)&&o!==di;function md(...o){const{caseless:e,skipUndefined:n}=Ap(this)&&this||{},a={},i=(l,u)=>{if(u==="__proto__"||u==="constructor"||u==="prototype")return;const d=e&&typeof u=="string"&&_p(a,u)||u,f=zl(a,d)?a[d]:void 0;Ul(f)&&Ul(l)?a[d]=md(f,l):Ul(l)?a[d]=md({},l):ui(l)?a[d]=l.slice():(!n||!ts(l))&&(a[d]=l)};for(let l=0,u=o.length;l<u;l++){const d=o[l];if(!d||ns(d)||(io(d,i),typeof d!="object"||ui(d)))continue;const f=Object.getOwnPropertySymbols(d);for(let g=0;g<f.length;g++){const m=f[g];Kw.call(d,m)&&i(d[m],m)}}return a}const Iw=(o,e,n,{allOwnKeys:a}={})=>(io(e,(i,l)=>{n&&$n(i)?Object.defineProperty(o,l,{__proto__:null,value:bp(i,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(o,l,{__proto__:null,value:i,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:a}),o),Hw=o=>(o.charCodeAt(0)===65279&&(o=o.slice(1)),o),zw=(o,e,n,a)=>{o.prototype=Object.create(e.prototype,a),Object.defineProperty(o.prototype,"constructor",{__proto__:null,value:o,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(o,"super",{__proto__:null,value:e.prototype}),n&&Object.assign(o.prototype,n)},jw=(o,e,n,a)=>{let i,l,u;const d={};if(e=e||{},o==null)return e;do{for(i=Object.getOwnPropertyNames(o),l=i.length;l-- >0;)u=i[l],(!a||a(u,o,e))&&!d[u]&&(e[u]=o[u],d[u]=!0);o=n!==!1&&es(o)}while(o&&(!n||n(o,e))&&o!==Object.prototype);return e},Uw=(o,e,n)=>{o=String(o),(n===void 0||n>o.length)&&(n=o.length),n-=e.length;const a=o.indexOf(e,n);return a!==-1&&a===n},Bw=o=>{if(!o)return null;if(ui(o))return o;let e=o.length;if(!wp(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=o[e];return n},Pw=(o=>e=>o&&e instanceof o)(typeof Uint8Array<"u"&&es(Uint8Array)),qw=(o,e)=>{const a=(o&&o[ro]).call(o);let i;for(;(i=a.next())&&!i.done;){const l=i.value;e.call(o,l[0],l[1])}},Gw=(o,e)=>{let n;const a=[];for(;(n=o.exec(e))!==null;)a.push(n);return a},Vw=gr("HTMLFormElement"),Fw=o=>o.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,a,i){return a.toUpperCase()+i}),{propertyIsEnumerable:Kw}=Object.prototype,Ww=gr("RegExp"),xp=(o,e)=>{const n=Object.getOwnPropertyDescriptors(o),a={};io(n,(i,l)=>{let u;(u=e(i,l,o))!==!1&&(a[l]=u||i)}),Object.defineProperties(o,a)},Yw=o=>{xp(o,(e,n)=>{if($n(o)&&["arguments","caller","callee"].includes(n))return!1;const a=o[n];if($n(a)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Xw=(o,e)=>{const n={},a=i=>{i.forEach(l=>{n[l]=!0})};return ui(o)?a(o):a(String(o).split(e)),n},Jw=()=>{},Qw=(o,e)=>o!=null&&Number.isFinite(o=+o)?o:e;function Zw(o){return!!(o&&$n(o.append)&&o[vp]==="FormData"&&o[ro])}const e0=o=>{const e=new WeakSet,n=a=>{if(rs(a)){if(e.has(a))return;if(ns(a))return a;if(!("toJSON"in a)){e.add(a);const i=ui(a)?[]:{};return io(a,(l,u)=>{const d=n(l);!ts(d)&&(i[u]=d)}),e.delete(a),i}}return a};return n(o)},t0=gr("AsyncFunction"),n0=o=>o&&(rs(o)||$n(o))&&$n(o.then)&&$n(o.catch),Tp=((o,e)=>o?setImmediate:e?((n,a)=>(di.addEventListener("message",({source:i,data:l})=>{i===di&&l===n&&a.length&&a.shift()()},!1),i=>{a.push(i),di.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",$n(di.postMessage)),r0=typeof queueMicrotask<"u"?queueMicrotask.bind(di):typeof process<"u"&&process.nextTick||Tp,Rp=o=>o!=null&&$n(o[ro]),F={isArray:ui,isArrayBuffer:Sp,isBuffer:ns,isFormData:kw,isArrayBufferView:yw,isString:bw,isNumber:wp,isBoolean:vw,isObject:rs,isPlainObject:Ul,isEmptyObject:Sw,isReadableStream:Ow,isRequest:Lw,isResponse:Mw,isHeaders:$w,isUndefined:ts,isDate:ww,isFile:Cw,isReactNativeBlob:Ew,isReactNative:_w,isBlob:Aw,isRegExp:Ww,isFunction:$n,isStream:Tw,isURLSearchParams:Dw,isTypedArray:Pw,isFileList:xw,forEach:io,merge:md,extend:Iw,trim:Nw,stripBOM:Hw,inherits:zw,toFlatObject:jw,kindOf:pd,kindOfTest:gr,endsWith:Uw,toArray:Bw,forEachEntry:qw,matchAll:Gw,isHTMLForm:Vw,hasOwnProperty:zl,hasOwnProp:zl,hasOwnInPrototypeChain:ao,getSafeProp:mw,reduceDescriptors:xp,freezeMethods:Yw,toObjectSet:Xw,toCamelCase:Fw,noop:Jw,toFiniteNumber:Qw,findKey:_p,global:di,isContextDefined:Ap,isSpecCompliantForm:Zw,toJSONObject:e0,isAsyncFn:t0,isThenable:n0,setImmediate:Tp,asap:r0,isIterable:Rp,isSafeIterable:o=>o!=null&&ao(o,ro)&&Rp(o)},a0=F.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),i0=o=>{const e={};let n,a,i;return o&&o.split(`
`).forEach(function(u){i=u.indexOf(":"),n=u.substring(0,i).trim().toLowerCase(),a=u.substring(i+1).trim(),!(!n||e[n]&&a0[n])&&(n==="set-cookie"?e[n]?e[n].push(a):e[n]=[a]:e[n]=e[n]?e[n]+", "+a:a)}),e};function s0(o){let e=0,n=o.length;for(;e<n;){const a=o.charCodeAt(e);if(a!==9&&a!==32)break;e+=1}for(;n>e;){const a=o.charCodeAt(n-1);if(a!==9&&a!==32)break;n-=1}return e===0&&n===o.length?o:o.slice(e,n)}const o0=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),l0=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function yd(o,e){return F.isArray(o)?o.map(n=>yd(n,e)):s0(String(o).replace(e,""))}const c0=o=>yd(o,o0),u0=o=>yd(o,l0);function kp(o){const e=Object.create(null);return F.forEach(o.toJSON(),(n,a)=>{e[a]=u0(n)}),e}const Dp=Symbol("internals");function so(o){return o&&String(o).trim().toLowerCase()}function Bl(o){return o===!1||o==null?o:F.isArray(o)?o.map(Bl):c0(String(o))}function d0(o){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let a;for(;a=n.exec(o);)e[a[1]]=a[2];return e}const f0=o=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(o.trim());function bd(o,e,n,a,i){if(F.isFunction(a))return a.call(this,e,n);if(i&&(e=n),!!F.isString(e)){if(F.isString(a))return e.indexOf(a)!==-1;if(F.isRegExp(a))return a.test(e)}}function h0(o){return o.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,a)=>n.toUpperCase()+a)}function g0(o,e){const n=F.toCamelCase(" "+e);["get","set","has"].forEach(a=>{Object.defineProperty(o,a+n,{__proto__:null,value:function(i,l,u){return this[a].call(this,e,i,l,u)},configurable:!0})})}let An=class{constructor(e){e&&this.set(e)}set(e,n,a){const i=this;function l(d,f,g){const m=so(f);if(!m)return;const b=F.findKey(i,m);(!b||i[b]===void 0||g===!0||g===void 0&&i[b]!==!1)&&(i[b||f]=Bl(d))}const u=(d,f)=>F.forEach(d,(g,m)=>l(g,m,f));if(F.isPlainObject(e)||e instanceof this.constructor)u(e,n);else if(F.isString(e)&&(e=e.trim())&&!f0(e))u(i0(e),n);else if(F.isObject(e)&&F.isSafeIterable(e)){let d=Object.create(null),f,g;for(const m of e){if(!F.isArray(m))throw new TypeError("Object iterator must return a key-value pair");g=m[0],F.hasOwnProp(d,g)?(f=d[g],d[g]=F.isArray(f)?[...f,m[1]]:[f,m[1]]):d[g]=m[1]}u(d,n)}else e!=null&&l(n,e,a);return this}get(e,n){if(e=so(e),e){const a=F.findKey(this,e);if(a){const i=this[a];if(!n)return i;if(n===!0)return d0(i);if(F.isFunction(n))return n.call(this,i,a);if(F.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=so(e),e){const a=F.findKey(this,e);return!!(a&&this[a]!==void 0&&(!n||bd(this,this[a],a,n)))}return!1}delete(e,n){const a=this;let i=!1;function l(u){if(u=so(u),u){const d=F.findKey(a,u);d&&(!n||bd(a,a[d],d,n))&&(delete a[d],i=!0)}}return F.isArray(e)?e.forEach(l):l(e),i}clear(e){const n=Object.keys(this);let a=n.length,i=!1;for(;a--;){const l=n[a];(!e||bd(this,this[l],l,e,!0))&&(delete this[l],i=!0)}return i}normalize(e){const n=this,a={};return F.forEach(this,(i,l)=>{const u=F.findKey(a,l);if(u){n[u]=Bl(i),delete n[l];return}const d=e?h0(l):String(l).trim();d!==l&&delete n[l],n[d]=Bl(i),a[d]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return F.forEach(this,(a,i)=>{a!=null&&a!==!1&&(n[i]=e&&F.isArray(a)?a.join(", "):a)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const a=new this(e);return n.forEach(i=>a.set(i)),a}static accessor(e){const a=(this[Dp]=this[Dp]={accessors:{}}).accessors,i=this.prototype;function l(u){const d=so(u);a[d]||(g0(i,u),a[d]=!0)}return F.isArray(e)?e.forEach(l):l(e),this}};An.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),F.reduceDescriptors(An.prototype,({value:o},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>o,set(a){this[n]=a}}}),F.freezeMethods(An);const p0="[REDACTED ****]";function m0(o){if(F.hasOwnProp(o,"toJSON"))return!0;let e=Object.getPrototypeOf(o);for(;e&&e!==Object.prototype;){if(F.hasOwnProp(e,"toJSON"))return!0;e=Object.getPrototypeOf(e)}return!1}function y0(o,e){const n=new Set(e.map(l=>String(l).toLowerCase())),a=[],i=l=>{if(l===null||typeof l!="object"||F.isBuffer(l))return l;if(a.indexOf(l)!==-1)return;l instanceof An&&(l=l.toJSON()),a.push(l);let u;if(F.isArray(l))u=[],l.forEach((d,f)=>{const g=i(d);F.isUndefined(g)||(u[f]=g)});else{if(!F.isPlainObject(l)&&m0(l))return a.pop(),l;u=Object.create(null);for(const[d,f]of Object.entries(l)){const g=n.has(d.toLowerCase())?p0:i(f);F.isUndefined(g)||(u[d]=g)}}return a.pop(),u};return i(o)}let Se=class HS extends Error{static from(e,n,a,i,l,u){const d=new HS(e.message,n||e.code,a,i,l);return Object.defineProperty(d,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),d.name=e.name,e.status!=null&&d.status==null&&(d.status=e.status),u&&Object.assign(d,u),d}constructor(e,n,a,i,l){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),a&&(this.config=a),i&&(this.request=i),l&&(this.response=l,this.status=l.status)}toJSON(){const e=this.config,n=e&&F.hasOwnProp(e,"redact")?e.redact:void 0,a=F.isArray(n)&&n.length>0?y0(e,n):F.toJSONObject(e);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a,code:this.code,status:this.status}}};Se.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",Se.ERR_BAD_OPTION="ERR_BAD_OPTION",Se.ECONNABORTED="ECONNABORTED",Se.ETIMEDOUT="ETIMEDOUT",Se.ECONNREFUSED="ECONNREFUSED",Se.ERR_NETWORK="ERR_NETWORK",Se.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",Se.ERR_DEPRECATED="ERR_DEPRECATED",Se.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",Se.ERR_BAD_REQUEST="ERR_BAD_REQUEST",Se.ERR_CANCELED="ERR_CANCELED",Se.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",Se.ERR_INVALID_URL="ERR_INVALID_URL",Se.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const b0=null,Op=100;function vd(o){return F.isPlainObject(o)||F.isArray(o)}function Lp(o){return F.endsWith(o,"[]")?o.slice(0,-2):o}function Sd(o,e,n){return o?o.concat(e).map(function(i,l){return i=Lp(i),!n&&l?"["+i+"]":i}).join(n?".":""):e}function v0(o){return F.isArray(o)&&!o.some(vd)}const S0=F.toFlatObject(F,{},null,function(e){return/^is[A-Z]/.test(e)});function Pl(o,e,n){if(!F.isObject(o))throw new TypeError("target must be an object");e=e||new FormData,n=F.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(M,x){return!F.isUndefined(x[M])});const a=n.metaTokens,i=n.visitor||_,l=n.dots,u=n.indexes,d=n.Blob||typeof Blob<"u"&&Blob,f=n.maxDepth===void 0?Op:n.maxDepth,g=d&&F.isSpecCompliantForm(e),m=[];if(!F.isFunction(i))throw new TypeError("visitor must be a function");function b(O){if(O===null)return"";if(F.isDate(O))return O.toISOString();if(F.isBoolean(O))return O.toString();if(!g&&F.isBlob(O))throw new Se("Blob is not supported. Use a Buffer instead.");if(F.isArrayBuffer(O)||F.isTypedArray(O)){if(g&&typeof d=="function")return new d([O]);if(typeof Buffer<"u")return Buffer.from(O);throw new Se("Blob is not supported. Use a Buffer instead.",Se.ERR_NOT_SUPPORT)}return O}function v(O){if(O>f)throw new Se("Object is too deeply nested ("+O+" levels). Max depth: "+f,Se.ERR_FORM_DATA_DEPTH_EXCEEDED)}function S(O,M){if(f===1/0)return JSON.stringify(O);const x=[];return JSON.stringify(O,function(U,z){if(!F.isObject(z))return z;for(;x.length&&x[x.length-1]!==this;)x.pop();return x.push(z),v(M+x.length-1),z})}function _(O,M,x){let D=O;if(F.isReactNative(e)&&F.isReactNativeBlob(O))return e.append(Sd(x,M,l),b(O)),!1;if(O&&!x&&typeof O=="object"){if(F.endsWith(M,"{}"))M=a?M:M.slice(0,-2),O=S(O,1);else if(F.isArray(O)&&v0(O)||(F.isFileList(O)||F.endsWith(M,"[]"))&&(D=F.toArray(O)))return M=Lp(M),D.forEach(function(z,q){!(F.isUndefined(z)||z===null)&&e.append(u===!0?Sd([M],q,l):u===null?M:M+"[]",b(z))}),!1}return vd(O)?!0:(e.append(Sd(x,M,l),b(O)),!1)}const A=Object.assign(S0,{defaultVisitor:_,convertValue:b,isVisitable:vd});function k(O,M,x=0){if(!F.isUndefined(O)){if(v(x),m.indexOf(O)!==-1)throw new Error("Circular reference detected in "+M.join("."));m.push(O),F.forEach(O,function(U,z){(!(F.isUndefined(U)||U===null)&&i.call(e,U,F.isString(z)?z.trim():z,M,A))===!0&&k(U,M?M.concat(z):[z],x+1)}),m.pop()}}if(!F.isObject(o))throw new TypeError("data must be an object");return k(o),e}function Mp(o){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(o).replace(/[!'()~]|%20/g,function(a){return e[a]})}function wd(o,e){this._pairs=[],o&&Pl(o,this,e)}const $p=wd.prototype;$p.append=function(e,n){this._pairs.push([e,n])},$p.toString=function(e){const n=e?a=>e.call(this,a,Mp):Mp;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function w0(o){return encodeURIComponent(o).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Np(o,e,n){if(!e)return o;o=o||"";const a=F.isFunction(n)?{serialize:n}:n,i=F.getSafeProp(a,"encode")||w0,l=F.getSafeProp(a,"serialize");let u;if(l?u=l(e,a):u=F.isURLSearchParams(e)?e.toString():new wd(e,a).toString(i),u){const d=o.indexOf("#");d!==-1&&(o=o.slice(0,d)),o+=(o.indexOf("?")===-1?"?":"&")+u}return o}class Ip{constructor(){this.handlers=[]}use(e,n,a){return this.handlers.push({fulfilled:e,rejected:n,synchronous:a?a.synchronous:!1,runWhen:a?a.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){F.forEach(this.handlers,function(a){a!==null&&e(a)})}}const Cd={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},C0={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:wd,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Ed=typeof window<"u"&&typeof document<"u",_d=typeof navigator=="object"&&navigator||void 0,E0=Ed&&(!_d||["ReactNative","NativeScript","NS"].indexOf(_d.product)<0),_0=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",A0=Ed&&window.location.href||"http://localhost",mn={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ed,hasStandardBrowserEnv:E0,hasStandardBrowserWebWorkerEnv:_0,navigator:_d,origin:A0},Symbol.toStringTag,{value:"Module"})),...C0};function x0(o,e){return Pl(o,new mn.classes.URLSearchParams,{visitor:function(n,a,i,l){return mn.isNode&&F.isBuffer(n)?(this.append(a,n.toString("base64")),!1):l.defaultVisitor.apply(this,arguments)},...e})}const Hp=Op;function zp(o){if(o>Hp)throw new Se("FormData field is too deeply nested ("+o+" levels). Max depth: "+Hp,Se.ERR_FORM_DATA_DEPTH_EXCEEDED)}function T0(o){const e=[],n=/\w+|\[(\w*)]/g;let a;for(;(a=n.exec(o))!==null;)zp(e.length),e.push(a[0]==="[]"?"":a[1]||a[0]);return e}function R0(o){const e={},n=Object.keys(o);let a;const i=n.length;let l;for(a=0;a<i;a++)l=n[a],e[l]=o[l];return e}function jp(o){function e(n,a,i,l){zp(l);let u=n[l++];if(u==="__proto__")return!0;const d=Number.isFinite(+u),f=l>=n.length;return u=!u&&F.isArray(i)?i.length:u,f?(F.hasOwnProp(i,u)?i[u]=F.isArray(i[u])?i[u].concat(a):[i[u],a]:i[u]=a,!d):((!F.hasOwnProp(i,u)||!F.isObject(i[u]))&&(i[u]=[]),e(n,a,i[u],l)&&F.isArray(i[u])&&(i[u]=R0(i[u])),!d)}if(F.isFormData(o)&&F.isFunction(o.entries)){const n={};return F.forEachEntry(o,(a,i)=>{e(T0(a),i,n,0)}),n}return null}const as=(o,e)=>o!=null&&F.hasOwnProp(o,e)?o[e]:void 0;function k0(o,e,n){if(F.isString(o))try{return(e||JSON.parse)(o),F.trim(o)}catch(a){if(a.name!=="SyntaxError")throw a}return(n||JSON.stringify)(o)}const oo={transitional:Cd,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const a=n.getContentType()||"",i=a.indexOf("application/json")>-1,l=F.isObject(e);if(l&&F.isHTMLForm(e)&&(e=new FormData(e)),F.isFormData(e))return i?JSON.stringify(jp(e)):e;if(F.isArrayBuffer(e)||F.isBuffer(e)||F.isStream(e)||F.isFile(e)||F.isBlob(e)||F.isReadableStream(e))return e;if(F.isArrayBufferView(e))return e.buffer;if(F.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let d;if(l){const f=as(this,"formSerializer");if(a.indexOf("application/x-www-form-urlencoded")>-1)return x0(e,f).toString();if((d=F.isFileList(e))||a.indexOf("multipart/form-data")>-1){const g=as(this,"env"),m=g&&g.FormData;return Pl(d?{"files[]":e}:e,m&&new m,f)}}return l||i?(n.setContentType("application/json",!1),k0(e)):e}],transformResponse:[function(e){const n=as(this,"transitional")||oo.transitional,a=n&&n.forcedJSONParsing,i=as(this,"responseType"),l=i==="json";if(F.isResponse(e)||F.isReadableStream(e))return e;if(e&&F.isString(e)&&(a&&!i||l)){const d=!(n&&n.silentJSONParsing)&&l;try{return JSON.parse(e,as(this,"parseReviver"))}catch(f){if(d)throw f.name==="SyntaxError"?Se.from(f,Se.ERR_BAD_RESPONSE,this,null,as(this,"response")):f}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:mn.classes.FormData,Blob:mn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};F.forEach(["delete","get","head","post","put","patch","query"],o=>{oo.headers[o]={}});function Ad(o,e){const n=this||oo,a=e||n,i=An.from(a.headers);let l=a.data;return F.forEach(o,function(d){l=d.call(n,l,i.normalize(),e?e.status:void 0)}),i.normalize(),l}function Up(o){return!!(o&&o.__CANCEL__)}let lo=class extends Se{constructor(e,n,a){super(e??"canceled",Se.ERR_CANCELED,n,a),this.name="CanceledError",this.__CANCEL__=!0}};function Bp(o,e,n){const a=n.config.validateStatus;!n.status||!a||a(n.status)?o(n):e(new Se("Request failed with status code "+n.status,n.status>=400&&n.status<500?Se.ERR_BAD_REQUEST:Se.ERR_BAD_RESPONSE,n.config,n.request,n))}function D0(o){const e=/^([-+\w]{1,25}):(?:\/\/)?/.exec(o);return e&&e[1]||""}function O0(o,e){o=o||10;const n=new Array(o),a=new Array(o);let i=0,l=0,u;return e=e!==void 0?e:1e3,function(f){const g=Date.now(),m=a[l];u||(u=g),n[i]=f,a[i]=g;let b=l,v=0;for(;b!==i;)v+=n[b++],b=b%o;if(i=(i+1)%o,i===l&&(l=(l+1)%o),g-u<e)return;const S=m&&g-m;return S?Math.round(v*1e3/S):void 0}}function L0(o,e){let n=0,a=1e3/e,i,l;const u=(g,m=Date.now())=>{n=m,i=null,l&&(clearTimeout(l),l=null),o(...g)};return[(...g)=>{const m=Date.now(),b=m-n;b>=a?u(g,m):(i=g,l||(l=setTimeout(()=>{l=null,u(i)},a-b)))},()=>i&&u(i)]}const ql=(o,e,n=3)=>{let a=0;const i=O0(50,250);return L0(l=>{if(!l||typeof l.loaded!="number")return;const u=l.loaded,d=l.lengthComputable?l.total:void 0,f=d!=null?Math.min(u,d):u,g=Math.max(0,f-a),m=i(g);a=Math.max(a,f);const b={loaded:f,total:d,progress:d?f/d:void 0,bytes:g,rate:m||void 0,estimated:m&&d?(d-f)/m:void 0,event:l,lengthComputable:d!=null,[e?"download":"upload"]:!0};o(b)},n)},Pp=(o,e)=>{const n=o!=null;return[a=>e[0]({lengthComputable:n,total:o,loaded:a}),e[1]]},qp=o=>(...e)=>F.asap(()=>o(...e)),M0=mn.hasStandardBrowserEnv?((o,e)=>n=>(n=new URL(n,mn.origin),o.protocol===n.protocol&&o.host===n.host&&(e||o.port===n.port)))(new URL(mn.origin),mn.navigator&&/(msie|trident)/i.test(mn.navigator.userAgent)):()=>!0,$0=mn.hasStandardBrowserEnv?{write(o,e,n,a,i,l,u){if(typeof document>"u")return;const d=[`${o}=${encodeURIComponent(e)}`];F.isNumber(n)&&d.push(`expires=${new Date(n).toUTCString()}`),F.isString(a)&&d.push(`path=${a}`),F.isString(i)&&d.push(`domain=${i}`),l===!0&&d.push("secure"),F.isString(u)&&d.push(`SameSite=${u}`),document.cookie=d.join("; ")},read(o){if(typeof document>"u")return null;const e=document.cookie.split(";");for(let n=0;n<e.length;n++){const a=e[n].replace(/^\s+/,""),i=a.indexOf("=");if(i!==-1&&a.slice(0,i)===o)try{return decodeURIComponent(a.slice(i+1))}catch{return a.slice(i+1)}}return null},remove(o){this.write(o,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function N0(o){return typeof o!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o)}function I0(o,e){return e?o.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):o}const H0=/^https?:(?!\/\/)/i,z0=/[\t\n\r]/g;function j0(o){let e=0;for(;e<o.length&&o.charCodeAt(e)<=32;)e++;return o.slice(e)}function U0(o){return j0(o).replace(z0,"")}function Gp(o,e){if(typeof o=="string"&&H0.test(U0(o)))throw new Se('Invalid URL: missing "//" after protocol',Se.ERR_INVALID_URL,e)}function Vp(o,e,n,a){Gp(e,a);let i=!N0(e);return o&&(i||n===!1)?(Gp(o,a),I0(o,e)):e}const Fp=o=>o instanceof An?{...o}:o;function fi(o,e){o=o||{},e=e||{};const n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function a(m,b,v,S){return F.isPlainObject(m)&&F.isPlainObject(b)?F.merge.call({caseless:S},m,b):F.isPlainObject(b)?F.merge({},b):F.isArray(b)?b.slice():b}function i(m,b,v,S){if(F.isUndefined(b)){if(!F.isUndefined(m))return a(void 0,m,v,S)}else return a(m,b,v,S)}function l(m,b){if(!F.isUndefined(b))return a(void 0,b)}function u(m,b){if(F.isUndefined(b)){if(!F.isUndefined(m))return a(void 0,m)}else return a(void 0,b)}function d(m){const b=F.hasOwnProp(e,"transitional")?e.transitional:void 0;if(!F.isUndefined(b))if(F.isPlainObject(b)){if(F.hasOwnProp(b,m))return b[m]}else return;const v=F.hasOwnProp(o,"transitional")?o.transitional:void 0;if(F.isPlainObject(v)&&F.hasOwnProp(v,m))return v[m]}function f(m,b,v){if(F.hasOwnProp(e,v))return a(m,b);if(F.hasOwnProp(o,v))return a(void 0,m)}const g={url:l,method:l,data:l,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,withXSRFToken:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,allowedSocketPaths:u,responseEncoding:u,validateStatus:f,headers:(m,b,v)=>i(Fp(m),Fp(b),v,!0)};return F.forEach(Object.keys({...o,...e}),function(b){if(b==="__proto__"||b==="constructor"||b==="prototype")return;const v=F.hasOwnProp(g,b)?g[b]:i,S=F.hasOwnProp(o,b)?o[b]:void 0,_=F.hasOwnProp(e,b)?e[b]:void 0,A=v(S,_,b);F.isUndefined(A)&&v!==f||(n[b]=A)}),F.hasOwnProp(e,"validateStatus")&&F.isUndefined(e.validateStatus)&&d("validateStatusUndefinedResolves")===!1&&(F.hasOwnProp(o,"validateStatus")?n.validateStatus=a(void 0,o.validateStatus):delete n.validateStatus),n}const B0=["content-type","content-length"];function P0(o,e,n){if(n!=="content-only"){o.set(e);return}Object.entries(e||{}).forEach(([a,i])=>{B0.includes(a.toLowerCase())&&o.set(a,i)})}const q0=o=>encodeURIComponent(o).replace(/%([0-9A-F]{2})/gi,(e,n)=>String.fromCharCode(parseInt(n,16)));function Kp(o){const e=fi({},o),n=v=>F.hasOwnProp(e,v)?e[v]:void 0,a=n("data");let i=n("withXSRFToken");const l=n("xsrfHeaderName"),u=n("xsrfCookieName");let d=n("headers");const f=n("auth"),g=n("baseURL"),m=n("allowAbsoluteUrls"),b=n("url");if(e.headers=d=An.from(d),e.url=Np(Vp(g,b,m,e),n("params"),n("paramsSerializer")),f){const v=F.getSafeProp(f,"username")||"",S=F.getSafeProp(f,"password")||"";try{d.set("Authorization","Basic "+btoa(v+":"+(S?q0(S):"")))}catch(_){throw Se.from(_,Se.ERR_BAD_OPTION_VALUE,o)}}if(F.isFormData(a)&&(mn.hasStandardBrowserEnv||mn.hasStandardBrowserWebWorkerEnv||F.isReactNative(a)?d.setContentType(void 0):F.isFunction(a.getHeaders)&&P0(d,a.getHeaders(),n("formDataHeaderPolicy"))),mn.hasStandardBrowserEnv&&(F.isFunction(i)&&(i=i(e)),i===!0||i==null&&M0(e.url))){const S=l&&u&&$0.read(u);S&&d.set(l,S)}return e}const G0=typeof XMLHttpRequest<"u"&&function(o){return new Promise(function(n,a){const i=Kp(o);let l=i.data;const u=An.from(i.headers).normalize();let{responseType:d,onUploadProgress:f,onDownloadProgress:g}=i,m,b,v,S,_;function A(){S&&S(),_&&_(),i.cancelToken&&i.cancelToken.unsubscribe(m),i.signal&&i.signal.removeEventListener("abort",m)}let k=new XMLHttpRequest;k.open(i.method.toUpperCase(),i.url,!0),k.timeout=i.timeout;function O(){if(!k)return;const x=An.from("getAllResponseHeaders"in k&&k.getAllResponseHeaders()),U={data:!d||d==="text"||d==="json"?k.responseText:k.response,status:k.status,statusText:k.statusText,headers:x,config:o,request:k};Bp(function(q){n(q),A()},function(q){a(q),A()},U),k=null}"onloadend"in k?k.onloadend=O:k.onreadystatechange=function(){!k||k.readyState!==4||k.status===0&&!(k.responseURL&&k.responseURL.startsWith("file:"))||setTimeout(O)},k.onabort=function(){k&&(a(new Se("Request aborted",Se.ECONNABORTED,o,k)),A(),k=null)},k.onerror=function(D){const U=D&&D.message?D.message:"Network Error",z=new Se(U,Se.ERR_NETWORK,o,k);z.event=D||null,a(z),A(),k=null},k.ontimeout=function(){let D=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const U=i.transitional||Cd;i.timeoutErrorMessage&&(D=i.timeoutErrorMessage),a(new Se(D,U.clarifyTimeoutError?Se.ETIMEDOUT:Se.ECONNABORTED,o,k)),A(),k=null},l===void 0&&u.setContentType(null),"setRequestHeader"in k&&F.forEach(kp(u),function(D,U){k.setRequestHeader(U,D)}),F.isUndefined(i.withCredentials)||(k.withCredentials=!!i.withCredentials),d&&d!=="json"&&(k.responseType=i.responseType),g&&([v,_]=ql(g,!0),k.addEventListener("progress",v)),f&&k.upload&&([b,S]=ql(f),k.upload.addEventListener("progress",b),k.upload.addEventListener("loadend",S)),(i.cancelToken||i.signal)&&(m=x=>{k&&(a(!x||x.type?new lo(null,o,k):x),k.abort(),A(),k=null)},i.cancelToken&&i.cancelToken.subscribe(m),i.signal&&(i.signal.aborted?m():i.signal.addEventListener("abort",m)));const M=D0(i.url);if(M&&!mn.protocols.includes(M)){a(new Se("Unsupported protocol "+M+":",Se.ERR_BAD_REQUEST,o)),A();return}k.send(l||null)})},V0=(o,e)=>{if(o=o?o.filter(Boolean):[],!e&&!o.length)return;const n=new AbortController;let a=!1;const i=function(f){if(!a){a=!0,u();const g=f instanceof Error?f:this.reason;n.abort(g instanceof Se?g:new lo(g instanceof Error?g.message:g))}};let l=e&&setTimeout(()=>{l=null,i(new Se(`timeout of ${e}ms exceeded`,Se.ETIMEDOUT))},e);const u=()=>{o&&(l&&clearTimeout(l),l=null,o.forEach(f=>{f.unsubscribe?f.unsubscribe(i):f.removeEventListener("abort",i)}),o=null)};o.forEach(f=>f.addEventListener("abort",i,{once:!0}));const{signal:d}=n;return d.unsubscribe=()=>F.asap(u),d},F0=function*(o,e){let n=o.byteLength;if(n<e){yield o;return}let a=0,i;for(;a<n;)i=a+e,yield o.slice(a,i),a=i},K0=async function*(o,e){for await(const n of W0(o))yield*F0(n,e)},W0=async function*(o){if(o[Symbol.asyncIterator]){yield*o;return}const e=o.getReader();try{for(;;){const{done:n,value:a}=await e.read();if(n)break;yield a}}finally{await e.cancel()}},Wp=(o,e,n,a)=>{const i=K0(o,e);let l=0,u,d=f=>{u||(u=!0,a&&a(f))};return new ReadableStream({async pull(f){try{const{done:g,value:m}=await i.next();if(g){d(),f.close();return}let b=m.byteLength;if(n){let v=l+=b;n(v)}f.enqueue(new Uint8Array(m))}catch(g){throw d(g),g}},cancel(f){return d(f),i.return()}},{highWaterMark:2})},Gl=o=>o>=48&&o<=57||o>=65&&o<=70||o>=97&&o<=102,Y0=(o,e,n)=>e+2<n&&Gl(o.charCodeAt(e+1))&&Gl(o.charCodeAt(e+2));function X0(o){if(!o||typeof o!="string"||!o.startsWith("data:"))return 0;const e=o.indexOf(",");if(e<0)return 0;const n=o.slice(5,e),a=o.slice(e+1);if(/;base64/i.test(n)){let u=a.length;const d=a.length;for(let S=0;S<d;S++)if(a.charCodeAt(S)===37&&S+2<d){const _=a.charCodeAt(S+1),A=a.charCodeAt(S+2);Gl(_)&&Gl(A)&&(u-=2,S+=2)}let f=0,g=d-1;const m=S=>S>=2&&a.charCodeAt(S-2)===37&&a.charCodeAt(S-1)===51&&(a.charCodeAt(S)===68||a.charCodeAt(S)===100);g>=0&&(a.charCodeAt(g)===61?(f++,g--):m(g)&&(f++,g-=3)),f===1&&g>=0&&(a.charCodeAt(g)===61||m(g))&&f++;const v=Math.floor(u/4)*3-(f||0);return v>0?v:0}let l=0;for(let u=0,d=a.length;u<d;u++){const f=a.charCodeAt(u);if(f===37&&Y0(a,u,d))l+=1,u+=2;else if(f<128)l+=1;else if(f<2048)l+=2;else if(f>=55296&&f<=56319&&u+1<d){const g=a.charCodeAt(u+1);g>=56320&&g<=57343?(l+=4,u++):l+=3}else l+=3}return l}const xd="1.18.1",Yp=64*1024,{isFunction:Vl}=F,J0=o=>encodeURIComponent(o).replace(/%([0-9A-F]{2})/gi,(e,n)=>String.fromCharCode(parseInt(n,16))),Xp=o=>{if(!F.isString(o))return o;try{return decodeURIComponent(o)}catch{return o}},Jp=(o,...e)=>{try{return!!o(...e)}catch{return!1}},Q0=o=>{const e=o.indexOf("://");let n=o;return e!==-1&&(n=n.slice(e+3)),n.includes("@")||n.includes(":")},Z0=o=>{const e=F.global!==void 0&&F.global!==null?F.global:globalThis,{ReadableStream:n,TextEncoder:a}=e;o=F.merge.call({skipUndefined:!0},{Request:e.Request,Response:e.Response},o);const{fetch:i,Request:l,Response:u}=o,d=i?Vl(i):typeof fetch=="function",f=Vl(l),g=Vl(u);if(!d)return!1;const m=d&&Vl(n),b=d&&(typeof a=="function"?(O=>M=>O.encode(M))(new a):async O=>new Uint8Array(await new l(O).arrayBuffer())),v=f&&m&&Jp(()=>{let O=!1;const M=new l(mn.origin,{body:new n,method:"POST",get duplex(){return O=!0,"half"}}),x=M.headers.has("Content-Type");return M.body!=null&&M.body.cancel(),O&&!x}),S=g&&m&&Jp(()=>F.isReadableStream(new u("").body)),_={stream:S&&(O=>O.body)};d&&["text","arrayBuffer","blob","formData","stream"].forEach(O=>{!_[O]&&(_[O]=(M,x)=>{let D=M&&M[O];if(D)return D.call(M);throw new Se(`Response type '${O}' is not supported`,Se.ERR_NOT_SUPPORT,x)})});const A=async O=>{if(O==null)return 0;if(F.isBlob(O))return O.size;if(F.isSpecCompliantForm(O))return(await new l(mn.origin,{method:"POST",body:O}).arrayBuffer()).byteLength;if(F.isArrayBufferView(O)||F.isArrayBuffer(O))return O.byteLength;if(F.isURLSearchParams(O)&&(O=O+""),F.isString(O))return(await b(O)).byteLength},k=async(O,M)=>{const x=F.toFiniteNumber(O.getContentLength());return x??A(M)};return async O=>{let{url:M,method:x,data:D,signal:U,cancelToken:z,timeout:q,onDownloadProgress:X,onUploadProgress:pe,responseType:Ce,headers:ve,withCredentials:Le="same-origin",fetchOptions:Ve,maxContentLength:Fe,maxBodyLength:Tt}=Kp(O);const J=F.isNumber(Fe)&&Fe>-1,de=F.isNumber(Tt)&&Tt>-1,Ne=te=>F.hasOwnProp(O,te)?O[te]:void 0;let ee=i||fetch;Ce=Ce?(Ce+"").toLowerCase():"text";let ge=V0([U,z&&z.toAbortSignal()],q),N=null;const T=ge&&ge.unsubscribe&&(()=>{ge.unsubscribe()});let fe,he=null;const Ae=()=>new Se("Request body larger than maxBodyLength limit",Se.ERR_BAD_REQUEST,O,N);try{let te;const we=Ne("auth");if(we){const Me=F.getSafeProp(we,"username")||"",tt=F.getSafeProp(we,"password")||"";te={username:Me,password:tt}}if(Q0(M)){const Me=new URL(M,mn.origin);if(!te&&(Me.username||Me.password)){const tt=Xp(Me.username),nn=Xp(Me.password);te={username:tt,password:nn}}(Me.username||Me.password)&&(Me.username="",Me.password="",M=Me.href)}if(te&&(ve.delete("authorization"),ve.set("Authorization","Basic "+btoa(J0((te.username||"")+":"+(te.password||""))))),J&&typeof M=="string"&&M.startsWith("data:")&&X0(M)>Fe)throw new Se("maxContentLength size of "+Fe+" exceeded",Se.ERR_BAD_RESPONSE,O,N);if(de&&x!=="get"&&x!=="head"){const Me=await A(D);if(typeof Me=="number"&&isFinite(Me)&&(fe=Me,Me>Tt))throw Ae()}const qe=de&&(F.isReadableStream(D)||F.isStream(D)),ke=(Me,tt,nn)=>Wp(Me,Yp,Mt=>{if(de&&Mt>Tt)throw he=Ae();tt&&tt(Mt)},nn);if(v&&x!=="get"&&x!=="head"&&(pe||qe)){if(fe=fe??await k(ve,D),fe!==0||qe){let Me=new l(M,{method:"POST",body:D,duplex:"half"}),tt;if(F.isFormData(D)&&(tt=Me.headers.get("content-type"))&&ve.setContentType(tt),Me.body){const[nn,Mt]=pe&&Pp(fe,ql(qp(pe)))||[];D=ke(Me.body,nn,Mt)}}}else if(qe&&!f&&m&&x!=="get"&&x!=="head")D=ke(D);else if(qe&&f&&!v&&x!=="get"&&x!=="head")throw new Se("Stream request bodies are not supported by the current fetch implementation",Se.ERR_NOT_SUPPORT,O,N);F.isString(Le)||(Le=Le?"include":"omit");const ze=f&&"credentials"in l.prototype;if(F.isFormData(D)){const Me=ve.getContentType();Me&&/^multipart\/form-data/i.test(Me)&&!/boundary=/i.test(Me)&&ve.delete("content-type")}ve.set("User-Agent","axios/"+xd,!1);const Ct={...Ve,signal:ge,method:x.toUpperCase(),headers:kp(ve.normalize()),body:D,duplex:"half",credentials:ze?Le:void 0};N=f&&new l(M,Ct);let it=await(f?ee(N,Ve):ee(M,Ct));const Ot=An.from(it.headers);if(J){const Me=F.toFiniteNumber(Ot.getContentLength());if(Me!=null&&Me>Fe)throw new Se("maxContentLength size of "+Fe+" exceeded",Se.ERR_BAD_RESPONSE,O,N)}const vt=S&&(Ce==="stream"||Ce==="response");if(S&&it.body&&(X||J||vt&&T)){const Me={};["status","statusText","headers"].forEach(an=>{Me[an]=it[an]});const tt=F.toFiniteNumber(Ot.getContentLength()),[nn,Mt]=X&&Pp(tt,ql(qp(X),!0))||[];let Pt=0;const rn=an=>{if(J&&(Pt=an,Pt>Fe))throw new Se("maxContentLength size of "+Fe+" exceeded",Se.ERR_BAD_RESPONSE,O,N);nn&&nn(an)};it=new u(Wp(it.body,Yp,rn,()=>{Mt&&Mt(),T&&T()}),Me)}Ce=Ce||"text";let _t=await _[F.findKey(_,Ce)||"text"](it,O);if(J&&!S&&!vt){let Me;if(_t!=null&&(typeof _t.byteLength=="number"?Me=_t.byteLength:typeof _t.size=="number"?Me=_t.size:typeof _t=="string"&&(Me=typeof a=="function"?new a().encode(_t).byteLength:_t.length)),typeof Me=="number"&&Me>Fe)throw new Se("maxContentLength size of "+Fe+" exceeded",Se.ERR_BAD_RESPONSE,O,N)}return!vt&&T&&T(),await new Promise((Me,tt)=>{Bp(Me,tt,{data:_t,headers:An.from(it.headers),status:it.status,statusText:it.statusText,config:O,request:N})})}catch(te){if(T&&T(),ge&&ge.aborted&&ge.reason instanceof Se){const we=ge.reason;throw we.config=O,N&&(we.request=N),te!==we&&Object.defineProperty(we,"cause",{__proto__:null,value:te,writable:!0,enumerable:!1,configurable:!0}),we}if(he)throw N&&!he.request&&(he.request=N),he;if(te instanceof Se)throw N&&!te.request&&(te.request=N),te;if(te&&te.name==="TypeError"&&/Load failed|fetch/i.test(te.message)){const we=new Se("Network Error",Se.ERR_NETWORK,O,N,te&&te.response);throw Object.defineProperty(we,"cause",{__proto__:null,value:te.cause||te,writable:!0,enumerable:!1,configurable:!0}),we}throw Se.from(te,te&&te.code,O,N,te&&te.response)}}},eC=new Map,Qp=o=>{let e=o&&o.env||{};const{fetch:n,Request:a,Response:i}=e,l=[a,i,n];let u=l.length,d=u,f,g,m=eC;for(;d--;)f=l[d],g=m.get(f),g===void 0&&m.set(f,g=d?new Map:Z0(e)),m=g;return g};Qp();const Td={http:b0,xhr:G0,fetch:{get:Qp}};F.forEach(Td,(o,e)=>{if(o){try{Object.defineProperty(o,"name",{__proto__:null,value:e})}catch{}Object.defineProperty(o,"adapterName",{__proto__:null,value:e})}});const Zp=o=>`- ${o}`,tC=o=>F.isFunction(o)||o===null||o===!1;function nC(o,e){o=F.isArray(o)?o:[o];const{length:n}=o;let a,i;const l={};for(let u=0;u<n;u++){a=o[u];let d;if(i=a,!tC(a)&&(i=Td[(d=String(a)).toLowerCase()],i===void 0))throw new Se(`Unknown adapter '${d}'`);if(i&&(F.isFunction(i)||(i=i.get(e))))break;l[d||"#"+u]=i}if(!i){const u=Object.entries(l).map(([f,g])=>`adapter ${f} `+(g===!1?"is not supported by the environment":"is not available in the build"));let d=n?u.length>1?`since :
`+u.map(Zp).join(`
`):" "+Zp(u[0]):"as no adapter specified";throw new Se("There is no suitable adapter to dispatch the request "+d,Se.ERR_NOT_SUPPORT)}return i}const em={getAdapter:nC,adapters:Td};function Rd(o){if(o.cancelToken&&o.cancelToken.throwIfRequested(),o.signal&&o.signal.aborted)throw new lo(null,o)}function tm(o){return Rd(o),o.headers=An.from(o.headers),o.data=Ad.call(o,o.transformRequest),["post","put","patch"].indexOf(o.method)!==-1&&o.headers.setContentType("application/x-www-form-urlencoded",!1),em.getAdapter(o.adapter||oo.adapter,o)(o).then(function(a){Rd(o),o.response=a;try{a.data=Ad.call(o,o.transformResponse,a)}finally{delete o.response}return a.headers=An.from(a.headers),a},function(a){if(!Up(a)&&(Rd(o),a&&a.response)){o.response=a.response;try{a.response.data=Ad.call(o,o.transformResponse,a.response)}finally{delete o.response}a.response.headers=An.from(a.response.headers)}return Promise.reject(a)})}const Fl={};["object","boolean","number","function","string","symbol"].forEach((o,e)=>{Fl[o]=function(a){return typeof a===o||"a"+(e<1?"n ":" ")+o}});const nm={};Fl.transitional=function(e,n,a){function i(l,u){return"[Axios v"+xd+"] Transitional option '"+l+"'"+u+(a?". "+a:"")}return(l,u,d)=>{if(e===!1)throw new Se(i(u," has been removed"+(n?" in "+n:"")),Se.ERR_DEPRECATED);return n&&!nm[u]&&(nm[u]=!0,console.warn(i(u," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(l,u,d):!0}},Fl.spelling=function(e){return(n,a)=>(console.warn(`${a} is likely a misspelling of ${e}`),!0)};function rC(o,e,n){if(typeof o!="object"||o===null)throw new Se("options must be an object",Se.ERR_BAD_OPTION_VALUE);const a=Object.keys(o);let i=a.length;for(;i-- >0;){const l=a[i],u=Object.prototype.hasOwnProperty.call(e,l)?e[l]:void 0;if(u){const d=o[l],f=d===void 0||u(d,l,o);if(f!==!0)throw new Se("option "+l+" must be "+f,Se.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Se("Unknown option "+l,Se.ERR_BAD_OPTION)}}const Kl={assertOptions:rC,validators:Fl},xn=Kl.validators;let hi=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Ip,response:new Ip}}async request(e,n){try{return await this._request(e,n)}catch(a){if(a instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const l=(()=>{if(!i.stack)return"";const u=i.stack.indexOf(`
`);return u===-1?"":i.stack.slice(u+1)})();try{if(!a.stack)a.stack=l;else if(l){const u=l.indexOf(`
`),d=u===-1?-1:l.indexOf(`
`,u+1),f=d===-1?"":l.slice(d+1);String(a.stack).endsWith(f)||(a.stack+=`
`+l)}}catch{}}throw a}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=fi(this.defaults,n);const{transitional:a,paramsSerializer:i,headers:l}=n;a!==void 0&&Kl.assertOptions(a,{silentJSONParsing:xn.transitional(xn.boolean),forcedJSONParsing:xn.transitional(xn.boolean),clarifyTimeoutError:xn.transitional(xn.boolean),legacyInterceptorReqResOrdering:xn.transitional(xn.boolean),advertiseZstdAcceptEncoding:xn.transitional(xn.boolean),validateStatusUndefinedResolves:xn.transitional(xn.boolean)},!1),i!=null&&(F.isFunction(i)?n.paramsSerializer={serialize:i}:Kl.assertOptions(i,{encode:xn.function,serialize:xn.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Kl.assertOptions(n,{baseUrl:xn.spelling("baseURL"),withXsrfToken:xn.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let u=l&&F.merge(l.common,l[n.method]);l&&F.forEach(["delete","get","head","post","put","patch","query","common"],_=>{delete l[_]}),n.headers=An.concat(u,l);const d=[];let f=!0;this.interceptors.request.forEach(function(A){if(typeof A.runWhen=="function"&&A.runWhen(n)===!1)return;f=f&&A.synchronous;const k=n.transitional||Cd;k&&k.legacyInterceptorReqResOrdering?d.unshift(A.fulfilled,A.rejected):d.push(A.fulfilled,A.rejected)});const g=[];this.interceptors.response.forEach(function(A){g.push(A.fulfilled,A.rejected)});let m,b=0,v;if(!f){const _=[tm.bind(this),void 0];for(_.unshift(...d),_.push(...g),v=_.length,m=Promise.resolve(n);b<v;)m=m.then(_[b++],_[b++]);return m}v=d.length;let S=n;for(;b<v;){const _=d[b++],A=d[b++];try{S=_(S)}catch(k){A.call(this,k);break}}try{m=tm.call(this,S)}catch(_){return Promise.reject(_)}for(b=0,v=g.length;b<v;)m=m.then(g[b++],g[b++]);return m}getUri(e){e=fi(this.defaults,e);const n=Vp(e.baseURL,e.url,e.allowAbsoluteUrls,e);return Np(n,e.params,e.paramsSerializer)}};F.forEach(["delete","get","head","options"],function(e){hi.prototype[e]=function(n,a){return this.request(fi(a||{},{method:e,url:n,data:a&&F.hasOwnProp(a,"data")?a.data:void 0}))}}),F.forEach(["post","put","patch","query"],function(e){function n(a){return function(l,u,d){return this.request(fi(d||{},{method:e,headers:a?{"Content-Type":"multipart/form-data"}:{},url:l,data:u}))}}hi.prototype[e]=n(),e!=="query"&&(hi.prototype[e+"Form"]=n(!0))});let aC=class zS{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(l){n=l});const a=this;this.promise.then(i=>{if(!a._listeners)return;let l=a._listeners.length;for(;l-- >0;)a._listeners[l](i);a._listeners=null}),this.promise.then=i=>{let l;const u=new Promise(d=>{a.subscribe(d),l=d}).then(i);return u.cancel=function(){a.unsubscribe(l)},u},e(function(l,u,d){a.reason||(a.reason=new lo(l,u,d),n(a.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=a=>{e.abort(a)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new zS(function(i){e=i}),cancel:e}}};function iC(o){return function(n){return o.apply(null,n)}}function sC(o){return F.isObject(o)&&o.isAxiosError===!0}const kd={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(kd).forEach(([o,e])=>{kd[e]=o});function rm(o){const e=new hi(o),n=bp(hi.prototype.request,e);return F.extend(n,hi.prototype,e,{allOwnKeys:!0}),F.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return rm(fi(o,i))},n}const Ft=rm(oo);Ft.Axios=hi,Ft.CanceledError=lo,Ft.CancelToken=aC,Ft.isCancel=Up,Ft.VERSION=xd,Ft.toFormData=Pl,Ft.AxiosError=Se,Ft.Cancel=Ft.CanceledError,Ft.all=function(e){return Promise.all(e)},Ft.spread=iC,Ft.isAxiosError=sC,Ft.mergeConfig=fi,Ft.AxiosHeaders=An,Ft.formToJSON=o=>jp(F.isHTMLForm(o)?new FormData(o):o),Ft.getAdapter=em.getAdapter,Ft.HttpStatusCode=kd,Ft.default=Ft;const{Axios:_T,AxiosError:AT,CanceledError:xT,isCancel:TT,CancelToken:RT,VERSION:kT,all:DT,Cancel:OT,isAxiosError:LT,spread:MT,toFormData:$T,AxiosHeaders:NT,HttpStatusCode:IT,formToJSON:HT,getAdapter:zT,mergeConfig:jT,create:UT}=Ft,Dd="g7.identity.redirectStash",Wl=ft("IdentityGuardInterceptor");class Et{static setLauncher(e){this.launcher=e}static hasLauncher(){return this.launcher!==null}static markDomainNoticeShown(){this.domainNoticeShown=!0}static consumeDomainNoticeShown(){const e=this.domainNoticeShown;return this.domainNoticeShown=!1,e}static resolveDeferred(e){const n=this.deferredResolver;if(!n){Wl.warn("IdentityGuardInterceptor.resolveDeferred 호출됐지만 대기 중인 launcher 가 없습니다. 모달이 launcher 외부에서 열렸는지 확인하세요.");return}this.deferredResolver=null,n(e)}static createDeferred(){if(this.deferredResolver){const e=this.deferredResolver;this.deferredResolver=null,e({status:"cancelled"})}return new Promise(e=>{this.deferredResolver=e})}static isIdentityRequired(e,n){return e===428&&typeof n=="object"&&n!==null&&n.error_code==="identity_verification_required"}static async handle(e,n,a){this.domainNoticeShown=!1;const i=this.launcher??lC,u=!!(a&&(a.email||a.phone))?{...e.verification,target:a}:e.verification,d=await i(u);if(d.status!=="verified")return null;const f=u.return_request;if(!f)return null;const g=oC(f.url,d.token);return fetch(g,{method:f.method,headers:n?.headers??{Accept:"application/json","Content-Type":"application/json"},body:n?.body,credentials:n?.credentials??"same-origin"})}static redirectExternally(e){const n=e.redirect_url;if(!n)return Wl.error("redirectExternally 호출 시 verification.redirect_url 이 없습니다. payload:",e),Promise.resolve({status:"failed",failureCode:"MISSING_REDIRECT_URL",reason:"verification.redirect_url is required for external_redirect flow"});if(typeof window<"u"){const a={return_url:window.location.href,payload:e,stashed_at:Date.now()};try{window.sessionStorage?.setItem(Dd,JSON.stringify(a))}catch(i){Wl.warn("sessionStorage 접근 실패 — stash 없이 redirect 합니다.",i)}window.location.href=n}return new Promise(()=>{})}static reset(){if(this.deferredResolver){const e=this.deferredResolver;this.deferredResolver=null;try{e({status:"cancelled"})}catch{}}this.launcher=null,this.domainNoticeShown=!1}}$(Et,"launcher",null),$(Et,"deferredResolver",null),$(Et,"domainNoticeShown",!1);function oC(o,e){if(!e)return o;try{const n=typeof window<"u"?window.location.origin:"http://localhost",a=new URL(o,n);return a.searchParams.set("verification_token",e),/^https?:\/\//i.test(o)?a.toString():`${a.pathname}${a.search}${a.hash}`}catch{const n=o.includes("?")?"&":"?";return`${o}${n}verification_token=${encodeURIComponent(e)}`}}const lC=async o=>{if(typeof window>"u")return{status:"cancelled"};if(o.render_hint==="external_redirect"||o.redirect_url)return Et.redirectExternally(o);const e=window.G7Core;if(!e?.dispatch)return console.error("[IdentityGuardInterceptor] defaultLauncher: G7Core 가 초기화되지 않아 본인인증 흐름을 시작할 수 없습니다."),{status:"failed",failureCode:"G7_NOT_READY"};try{await e.dispatch({handler:"toast",params:{message:"본인 확인이 필요합니다.",variant:"warning"}})}catch{}const n=window.location.href,a={return_url:n,payload:o,stashed_at:Date.now()};try{window.sessionStorage?.setItem(Dd,JSON.stringify(a))}catch{}const i=`/identity/challenge?return=${encodeURIComponent(n)}`;try{await e.dispatch({handler:"navigate",params:{path:i}})}catch(l){Wl.warn("navigate 실패 — window.location 으로 폴백",l),window.location.href=i}return new Promise(()=>{})},cC=ft("ApiClient");function Od(){return typeof window<"u"&&window.__G7_DEVTOOLS__?window.__G7_DEVTOOLS__:null}class uC{constructor(e={}){$(this,"client");$(this,"config");$(this,"TOKEN_KEY","auth_token");this.config={baseURL:e.baseURL||"/api",timeout:e.timeout||3e4,onTokenExpired:e.onTokenExpired,onUnauthorized:e.onUnauthorized,onError:e.onError},this.client=Ft.create({baseURL:this.config.baseURL,timeout:this.config.timeout,headers:{"Content-Type":"application/json",Accept:"application/json"},paramsSerializer:{serialize:n=>{const a=[];for(const[i,l]of Object.entries(n))if(l!=null)if(Array.isArray(l)){const u=i.endsWith("[]")?i:`${i}[]`;for(const d of l)a.push(`${encodeURIComponent(u)}=${encodeURIComponent(String(d))}`)}else a.push(`${encodeURIComponent(i)}=${encodeURIComponent(String(l))}`);return a.join("&")}}}),this.setupInterceptors()}setToken(e){typeof window<"u"&&localStorage.setItem(this.TOKEN_KEY,e)}getToken(){return typeof window<"u"?localStorage.getItem(this.TOKEN_KEY):null}removeToken(){typeof window<"u"&&localStorage.removeItem(this.TOKEN_KEY)}setupInterceptors(){this.client.interceptors.request.use(e=>{e.url?.startsWith("/api")&&e.baseURL==="/api"&&(e.baseURL="");const n=this.getToken();if(n&&e.headers&&(e.headers.Authorization=`Bearer ${n}`),typeof window<"u"&&e.headers){const i=localStorage.getItem("g7_locale");i&&(e.headers["Accept-Language"]=i)}const a=Od();if(a?.isEnabled()){const i=this.buildFullUrl(e),l=(e.method||"GET").toUpperCase(),u=a.trackRequest(i,l,{requestBody:e.data});e._devToolsRequestId=u}return e},e=>Promise.reject(e)),this.client.interceptors.response.use(e=>{const n=e.config,a=n._devToolsRequestId;if(a){const i=Od();i?.isEnabled()&&i.completeRequest(a,e.status,e.data),n._devToolsRequestId=null}return e},async e=>{const n=e.config,a=n?.url||"",l=["/auth/","/layouts/"].some(u=>a.includes(u));if(e.response?.status===401&&!n?._retry&&!l){if(n._retry=!0,await pr.getInstance().refreshToken()){const f=this.getToken();return f&&(n.headers.Authorization=`Bearer ${f}`),n._devToolsRequestId=null,this.client(n)}return this.completeDevToolsRequest(n,e),this.removeToken(),this.config.onUnauthorized&&this.config.onUnauthorized(),Promise.reject(e)}if(e.response?.status===401&&l)return this.completeDevToolsRequest(n,e),Promise.reject(e);if(Et.isIdentityRequired(e.response?.status,e.response?.data)){this.completeDevToolsRequest(n,e);const u={},d=n?.headers??{};for(const[v,S]of Object.entries(d))typeof S=="string"&&(u[v]=S);let f;n?.data!==void 0&&n?.data!==null&&(f=typeof n.data=="string"?n.data:JSON.stringify(n.data),u["Content-Type"]=u["Content-Type"]??"application/json");const g=n?.identity_target,m=await Et.handle(e.response.data,{headers:u,body:f,credentials:"same-origin"},g);if(!m)return Promise.reject(e);let b=null;try{b=await m.json()}catch{b=null}return m.ok?{...e.response,status:m.status,data:b}:Promise.reject(Object.assign(new Error("replay failed"),{response:{status:m.status,data:b}}))}return e.response?.status===403?(this.completeDevToolsRequest(n,e),this.callOnError(e),Promise.reject(e)):(this.completeDevToolsRequest(n,e),e.response&&this.callOnError(e),Promise.reject(e))})}async get(e,n){return(await this.client.get(e,n)).data}async post(e,n,a){return(await this.client.post(e,n,a)).data}async put(e,n,a){return(await this.client.put(e,n,a)).data}async patch(e,n,a){return(await this.client.patch(e,n,a)).data}async delete(e,n){return(await this.client.delete(e,n)).data}getInstance(){return this.client}setOnUnauthorized(e){this.config.onUnauthorized=e}setOnError(e){this.config.onError=e}completeDevToolsRequest(e,n){if(!e?._devToolsRequestId)return;const a=Od();if(!a?.isEnabled())return;const i=e._devToolsRequestId;e._devToolsRequestId=null,n.response?a.completeRequest(i,n.response.status,n.response.data):n.request?a.failRequest(i,n.message||"Network error"):a.failRequest(i,n.message||"Request error")}buildFullUrl(e){let n=e.url||"";if(e.baseURL&&!n.startsWith("http")&&(n=`${e.baseURL}${n.startsWith("/")?"":"/"}${n}`),e.params&&typeof e.params=="object"){const a=e.params,i=[];for(const[l,u]of Object.entries(a))if(u!=null)if(Array.isArray(u)){const d=l.endsWith("[]")?l:`${l}[]`;for(const f of u)i.push(`${encodeURIComponent(d)}=${encodeURIComponent(String(f))}`)}else i.push(`${encodeURIComponent(l)}=${encodeURIComponent(String(u))}`);i.length>0&&(n+=(n.includes("?")?"&":"?")+i.join("&"))}return n}callOnError(e){if(!this.config.onError)return;const n={status:e.response?.status||0,message:e.response?.data?.message||e.message||"Unknown error",data:e.response?.data,statusText:e.response?.statusText};try{this.config.onError(n)}catch(a){cC.error("Error in onError handler:",a)}}}let Ld=null;function Ir(){return Ld||(Ld=new uC),Ld}const co=ft("AuthManager");function is(o,e,n,a){try{window.G7Core?.devTools?.trackAuthEvent?.(o,e,n,a)}catch{}}const Yl={admin:{type:"admin",loginPath:"/admin/login",defaultPath:"/admin",userEndpoint:"/admin/auth/user",loginEndpoint:"/auth/admin/login",logoutEndpoint:"/admin/auth/logout",refreshEndpoint:"/admin/auth/refresh"},user:{type:"user",loginPath:"/login",defaultPath:"/",userEndpoint:"/auth/user",loginEndpoint:"/auth/login",logoutEndpoint:"/auth/logout",refreshEndpoint:"/auth/refresh"}},Er=class Er{constructor(){$(this,"state");$(this,"config");$(this,"isRefreshing",!1);$(this,"refreshPromise",null);$(this,"eventHandlers",new Map);this.state={isAuthenticated:!1,user:null,type:null},this.config=new Map,this.config.set("admin",Yl.admin),this.config.set("user",Yl.user)}static getInstance(){return Er.instance||(Er.instance=new Er),Er.instance}on(e,n){this.eventHandlers.has(e)||this.eventHandlers.set(e,[]),this.eventHandlers.get(e).push(n)}emit(e,...n){const a=this.eventHandlers.get(e);a&&a.forEach(i=>i(...n))}isAuthenticated(){return this.state.isAuthenticated}getUser(){return this.state.user}getAuthType(){return this.state.type}async checkAuth(e){const n=Ir();if(!n.getToken())return this.clearState(),!1;const i=this.config.get(e);if(!i)return co.error(`Unknown auth type: ${e}`),!1;try{const l=await n.get(i.userEndpoint);return l.success&&l.data?(this.state={isAuthenticated:!0,user:l.data,type:e},this.emit("authStateChange",this.state),!0):(this.clearState(),!1)}catch(l){return l.response?.status===401&&await this.refreshToken()?this.checkAuth(e):(this.clearState(),!1)}}async preloadAuth(e){try{return await this.checkAuth(e)}catch(n){return co.warn(`Preload auth failed for type ${e}:`,n),!1}}async login(e,n,a){const i=Ir();if(!this.config.get(e))throw new Error(`Unknown auth type: ${e}`);const u=e==="admin"?Yl.admin.loginEndpoint:Yl.user.loginEndpoint;try{const d=a?.headers?{headers:a.headers}:void 0,f=await i.post(u,n,d);if(f.success&&f.data){i.setToken(f.data.token);const g=f.data.user.language,m=localStorage.getItem(Er.LOCALE_STORAGE_KEY),b=g&&g!==m;if(g)try{localStorage.setItem(Er.LOCALE_STORAGE_KEY,g)}catch(v){co.warn("Failed to save user language to localStorage:",v)}return this.state={isAuthenticated:!0,user:f.data.user,type:e},this.emit("login",this.state),this.emit("authStateChange",this.state),is("login",!0,void 0,{userId:f.data.user.uuid,email:f.data.user.email,type:e}),b&&window.__templateApp&&window.__templateApp.changeLocale(g),f.data.user}throw new Error("Login failed")}catch(d){this.clearState();const f=d.response?.data?.message,g=new Error(f||d.message||"Login failed");throw g.response=d.response,g.status=d.response?.status,is("login",!1,g.message,{type:e,status:d.response?.status}),g}}async logout(){const e=Ir(),n=this.state.type?this.config.get(this.state.type):null;try{n&&await e.post(n.logoutEndpoint)}catch(a){co.warn("Logout API call failed:",a)}finally{e.removeToken();const a={...this.state};if(this.clearState(),this.emit("logout",a),this.emit("authStateChange",this.state),is("logout",!0,void 0,{previousType:a.type}),n&&a.type){const i=window.location.pathname+window.location.search;window.location.href=this.getLoginRedirectUrl(a.type,i)}}}async refreshToken(){if(this.isRefreshing&&this.refreshPromise)return this.refreshPromise;this.isRefreshing=!0,this.refreshPromise=this.doRefreshToken();try{return await this.refreshPromise}finally{this.isRefreshing=!1,this.refreshPromise=null}}async doRefreshToken(){const e=this.state.type;if(!e)return!1;const n=this.config.get(e);if(!n)return!1;const a=Ir();try{const i=await a.post(n.refreshEndpoint);return i.success&&i.data?.token?(a.setToken(i.data.token),this.emit("tokenRefreshed"),is("token-refresh",!0,void 0,{type:e}),!0):(is("token-refresh",!1,"No token in response",{type:e}),!1)}catch(i){return co.error("Token refresh failed:",i),is("token-refresh",!1,i instanceof Error?i.message:"Unknown error",{type:e}),!1}}getLoginRedirectUrl(e,n,a){const i=this.config.get(e);if(!i)return"/login";const l=encodeURIComponent(n);let u=`${i.loginPath}?redirect=${l}`;return a&&(u+=`&reason=${encodeURIComponent(a)}`),u}updateConfig(e,n){if(n.loginPath!==void 0){const i=n.loginPath;if(!i.startsWith("/")||i.startsWith("//"))throw new Error(`AuthManager.updateConfig: loginPath must be a same-origin path starting with '/' (got: ${i})`)}const a=this.config.get(e);a&&this.config.set(e,{...a,...n})}getRedirectUrl(e){const a=this.config.get(e)?.defaultPath||"/",l=new URLSearchParams(window.location.search).get("redirect");if(l)try{const u=decodeURIComponent(l);if(u.startsWith("/"))return u}catch{}return a}getConfig(e){return this.config.get(e)}clearState(){this.state={isAuthenticated:!1,user:null,type:null}}static resetInstance(){Er.instance=null}};$(Er,"instance"),$(Er,"LOCALE_STORAGE_KEY","g7_locale");let pr=Er;const am={401:{handler:"navigate",params:{path:"{{auth.loginPath}}"}},403:{handler:"toast",params:{type:"error",message:"{{error.message}}"}},404:{handler:"toast",params:{type:"error",message:"{{error.message}}"}},422:{handler:"toast",params:{type:"error",message:"{{error.message}}"}},default:{handler:"toast",params:{type:"error",message:"{{error.message}}"}}},Jr={findHandler(o,e){if(o){if(o[e])return o[e];if(o[String(e)])return o[String(e)];if(o.default)return o.default}},normalizeOnError(o){return o?Array.isArray(o)?o:[o]:[]},injectErrorCode(o,e,n){if(o.handler!=="showErrorPage"||o.params?.errorCode!==void 0)return o;const a=typeof e=="string"?parseInt(e,10):e,i=isNaN(a)?n:a;return i===void 0?o:{...o,params:{...o.params,errorCode:i}}}},mr=ft("ErrorHandlingResolver"),ka=class ka{constructor(){$(this,"templateErrorHandling",null);$(this,"layoutErrorHandling",null);$(this,"executeAction",null)}static getInstance(){return ka.instance||(ka.instance=new ka),ka.instance}static resetInstance(){ka.instance=null}setTemplateConfig(e){this.templateErrorHandling=e,mr.log("Template config set:",e)}setLayoutConfig(e){this.layoutErrorHandling=e,mr.log("Layout config set:",e)}setActionExecutor(e){this.executeAction=e}resolve(e,n={}){const{errorHandling:a,onError:i}=n;mr.log("Resolving error:",e,{hasActionErrorHandling:!!a,hasActionOnError:!!i,hasLayoutConfig:!!this.layoutErrorHandling,hasTemplateConfig:!!this.templateErrorHandling});let l=Jr.findHandler(a,e);if(l){const u=this.getMatchedKey(a,e);return{handler:Jr.injectErrorCode(l,u,e),level:"action",matchedKey:u}}if(i){const u=Jr.normalizeOnError(i);if(u.length>0)return{handler:u.length===1?u[0]:{handler:"sequence",actions:u},level:"action",matchedKey:"onError"}}if(l=Jr.findHandler(this.layoutErrorHandling||void 0,e),l){const u=this.getMatchedKey(this.layoutErrorHandling,e);return{handler:Jr.injectErrorCode(l,u,e),level:"layout",matchedKey:u}}if(l=Jr.findHandler(this.templateErrorHandling||void 0,e),l){const u=this.getMatchedKey(this.templateErrorHandling,e);return{handler:Jr.injectErrorCode(l,u,e),level:"template",matchedKey:u}}if(l=Jr.findHandler(am,e),l){const u=this.getMatchedKey(am,e);return{handler:Jr.injectErrorCode(l,u,e),level:"system",matchedKey:u}}return{handler:null,level:null,matchedKey:null}}async execute(e,n){if(!this.executeAction){mr.error("Action executor is not set");return}mr.log("Executing handler:",e.handler,{errorContext:n});try{return await this.executeAction(e,{error:n})}catch(a){throw mr.error("Failed to execute handler:",a),a}}async resolveAndExecute(e,n,a={}){const i=this.resolve(e,a);if(mr.log("Resolve result:",{errorCode:e,handler:i.handler?.handler,level:i.level,matchedKey:i.matchedKey}),!i.handler)return mr.warn("No handler found for error:",e),{handled:!1};try{return{handled:!0,result:await this.execute(i.handler,n)}}catch(l){return mr.error("Handler execution failed:",l),{handled:!1}}}getMatchedKey(e,n){return e[n]?n:e[String(n)]?String(n):"default"}clearLayoutConfig(){this.layoutErrorHandling=null,mr.log("Layout config cleared")}clearAllConfig(){this.templateErrorHandling=null,this.layoutErrorHandling=null,mr.log("All config cleared")}getConfigStatus(){return{hasTemplate:this.templateErrorHandling!==null,hasLayout:this.layoutErrorHandling!==null,hasExecutor:this.executeAction!==null}}};$(ka,"instance",null);let Md=ka;function yr(){return Md.getInstance()}var $d={exports:{}},uo={};var im;function dC(){if(im)return uo;im=1;var o=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(a,i,l){var u=null;if(l!==void 0&&(u=""+l),i.key!==void 0&&(u=""+i.key),"key"in i){l={};for(var d in i)d!=="key"&&(l[d]=i[d])}else l=i;return i=l.ref,{$$typeof:o,type:a,key:u,ref:i!==void 0?i:null,props:l}}return uo.Fragment=e,uo.jsx=n,uo.jsxs=n,uo}var sm;function fC(){return sm||(sm=1,$d.exports=dC()),$d.exports}var ht=fC();const hC=Wr({__proto__:null,default:Yr(ht)},[ht]),Nd=ft("ParentContextProvider"),om=H.createContext(null);let Xl=null;function Id(){Xl?(Nd.log("[triggerModalParentUpdate] 모달 부모 컨텍스트 업데이트 트리거"),Xl()):Nd.warn("[triggerModalParentUpdate] Provider가 아직 마운트되지 않음")}const lm=({children:o})=>{const[e,n]=H.useState(0),a=H.useRef(!0),i=H.useCallback(()=>{const u=window.__g7LayoutContextStack||[];return u[u.length-1]?.dataContext},[]);H.useEffect(()=>(a.current=!0,Xl=()=>{a.current&&(n(u=>u+1),Nd.log("[ParentContextProvider] 버전 업데이트됨"))},()=>{a.current=!1,Xl=null}),[]);const l={version:e,getParentDataContext:i};return ht.jsx(om.Provider,{value:l,children:o})};function gC(){return H.useContext(om)}const j=ft("ActionDispatcher");function pC(o,e,n,a){return n||(Jg(o)||sd(o)?"$t:core.errors.network_request_failed":a||`Failed to execute action: ${e}`)}const cm=new Set(["navigate","navigateBack","navigateForward","replaceUrl","refresh","logout"]),mC=new Set(["redirect"]);function Vn(){try{return window.G7Core?.devTools}catch{return}}class jt extends Error{constructor(n,a,i){super(n);$(this,"action");$(this,"originalError");$(this,"unknownHandler",!1);this.action=a,this.originalError=i,this.name="ActionError"}}const gs=class gs{constructor(e={},n,a){$(this,"bindingEngine");$(this,"translationEngine");$(this,"translationContext");$(this,"customHandlers",new Map);$(this,"defaultContext");$(this,"globalStateUpdater");$(this,"errorHandlingSetup",!1);$(this,"debounceTimers",new Map);$(this,"pendingDebounceFlushers",new Map);$(this,"debounceAccumulatedValues",new Map);$(this,"globalHeaders",[]);$(this,"namedActions",{});$(this,"previewMode",!1);$(this,"intervals",new Map);this.bindingEngine=new On,this.translationEngine=n,this.translationContext=a,this.defaultContext=e,this.registerDefaultHandlers(),this.setupErrorHandling()}setGlobalHeaders(e){this.globalHeaders=e||[]}setNamedActions(e){this.namedActions=e||{};const n=Vn();n?.isEnabled?.()&&n.setNamedActionDefinitions?.(this.namedActions),j.log("[setNamedActions] registered:",Object.keys(this.namedActions))}getNamedActions(){return this.namedActions}setPreviewMode(e){this.previewMode=e,j.log("Preview mode:",e?"enabled":"disabled")}isPreviewMode(){return this.previewMode}static getPreviewSuppressedHandlers(){return cm}static getPreviewSuppressedLayoutFeatures(){return mC}resolveActionRef(e){if(!e.actionRef)return e;const n=this.namedActions[e.actionRef];if(!n)return j.warn(`[resolveActionRef] named action not found: "${e.actionRef}"`),e;const a=Vn();a?.isEnabled?.()&&a.trackNamedActionRef?.({actionRefName:e.actionRef,resolvedHandler:n.handler,timestamp:Date.now()});const{actionRef:i,type:l,key:u,event:d,...f}=e,g={...n,...Object.fromEntries(Object.entries(f).filter(([,m])=>m!==void 0)),type:l??n.type};return u!==void 0&&(g.key=u),d!==void 0&&(g.event=d),g}matchesPattern(e,n){if(n==="*")return!0;const a=n.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*");return new RegExp(`^${a}$`).test(e)}getMatchingGlobalHeaders(e,n){const a={};for(const i of this.globalHeaders)this.matchesPattern(e,i.pattern)&&Object.entries(i.headers).forEach(([l,u])=>{const d=Zi(u,n,{skipCache:!0});d!=null&&d!==""&&(a[l]=String(d))});return a}setupErrorHandling(){if(this.errorHandlingSetup)return;yr().setActionExecutor(async(n,a)=>{const i={type:"click",handler:n.handler,target:n.target,params:n.params,actions:n.actions},l={data:{...this.defaultContext.data,error:a.error}};return await this.dispatchAction(i,l)}),this.errorHandlingSetup=!0}registerDefaultHandlers(){this.registerHandler("refetchDataSource",async(n,a)=>{const i=n.params?.dataSourceId,l=n.params?.sync;if(!i){j.warn("refetchDataSource: dataSourceId is required");return}if(typeof window<"u"&&window.G7Core?.dataSource?.refetch){const u=window.G7Core?.state?.get?.()||{},d={...a.state?._global,...u},f=window.G7Core?.state?.getLocal?.()||{},g=a.data?._local||a.state||{},m={...f,...g},b=a.isolatedContext?.state;j.log("[refetchDataSource] localStateOverride:",m),await window.G7Core.dataSource.refetch(i,{...l?{sync:!0}:{},...d?{globalStateOverride:d}:{},...m?{localStateOverride:m}:{},...b?{isolatedStateOverride:b}:{}})}else j.warn("refetchDataSource: G7Core.dataSource.refetch is not available")}),this.registerHandler("appendDataSource",async(n,a)=>{const{dataSourceId:i,dataPath:l,newData:u}=n.params||{};if(!i){j.warn("appendDataSource: dataSourceId is required");return}if(u===void 0){j.warn("appendDataSource: newData is required");return}if(typeof window<"u"&&window.G7Core?.dataSource?.updateData){if(!Array.isArray(u)){j.warn("appendDataSource: newData must be an array, got:",typeof u,u);return}await window.G7Core.dataSource.updateData(i,l||null,u,"append")}else j.warn("appendDataSource: G7Core.dataSource.updateData is not available")}),this.registerHandler("updateDataSource",async(n,a)=>{const{dataSourceId:i,data:l,merge:u=!1}=n.params||{};if(!i){j.warn("updateDataSource: dataSourceId is required");return}if(l===void 0){j.warn("updateDataSource: data is required");return}typeof window<"u"&&window.G7Core?.dataSource?.set?(j.log(`[updateDataSource] Updating dataSource '${i}' with:`,l),window.G7Core.dataSource.set(i,l,{merge:u})):j.warn("updateDataSource: G7Core.dataSource.set is not available")}),this.registerHandler("scrollIntoView",async(n,a)=>{const{selector:i,behavior:l="smooth",block:u="nearest",inline:d="nearest",waitForElement:f=!1,timeout:g=2e3,delay:m=0,retryCount:b=0,retryInterval:v=50,scrollContainer:S}=n.params||{};if(!i){j.warn("scrollIntoView: selector is required");return}if(typeof window>"u"||typeof document>"u"){j.warn("scrollIntoView: window/document is not available");return}let _=null;if(f){if(_=await new Promise(A=>{const k=document.querySelector(i);if(k){A(k);return}const O=setTimeout(()=>{M.disconnect(),A(null)},g),M=new MutationObserver(()=>{const x=document.querySelector(i);x&&(clearTimeout(O),M.disconnect(),A(x))});M.observe(document.body,{childList:!0,subtree:!0})}),!_){j.warn(`scrollIntoView: element not found for selector "${i}" after ${g}ms timeout`);return}}else{m>0&&await new Promise(k=>setTimeout(k,m)),_=document.querySelector(i);let A=0;for(;!_&&A<b;)await new Promise(k=>setTimeout(k,v)),_=document.querySelector(i),A++;if(!_){j.warn(`scrollIntoView: element not found for selector "${i}" after ${A+1} attempts`);return}}if(S){const A=document.querySelector(S);if(!A){j.warn(`scrollIntoView: container not found for selector "${S}"`);return}const k=_.getBoundingClientRect(),O=A.getBoundingClientRect(),M=k.top-O.top+A.scrollTop,x=M+k.height;let D;switch(u){case"start":D=M;break;case"center":D=M-A.clientHeight/2+k.height/2;break;case"end":D=x-A.clientHeight;break;default:const U=k.top<O.top,z=k.bottom>O.bottom;if(U)D=M;else if(z)D=x-A.clientHeight;else return;break}A.scrollTo({top:Math.max(0,D),behavior:l});return}_.scrollIntoView({behavior:l,block:u,inline:d})}),this.registerHandler("reloadExtensions",async(n,a)=>{if(typeof window>"u"){j.warn("reloadExtensions: window is not available");return}const i=window.__templateApp;if(!i){j.warn("reloadExtensions: TemplateApp not initialized");return}if(typeof i.reloadExtensionState=="function")try{await i.reloadExtensionState()}catch(d){throw j.error("reloadExtensions: reloadExtensionState failed",d),d}else j.warn("reloadExtensions: TemplateApp.reloadExtensionState unavailable");const{moduleInfo:l,pluginInfo:u}=n.params||{};if(l)try{await this.executeAction({handler:"reloadModuleHandlers",params:n.params},a)}catch(d){j.error("reloadExtensions: reloadModuleHandlers failed",d)}if(u)try{await this.executeAction({handler:"reloadPluginHandlers",params:n.params},a)}catch(d){j.error("reloadExtensions: reloadPluginHandlers failed",d)}j.log("reloadExtensions: done")}),this.registerHandler("reloadRoutes",async(n,a)=>{if(typeof window>"u"){j.warn("reloadRoutes: window is not available");return}const i=window.__templateApp;if(!i){j.warn("reloadRoutes: TemplateApp not initialized");return}if(typeof i.reloadExtensionState=="function")try{await i.reloadExtensionState(),j.log("reloadRoutes: delegated to reloadExtensionState")}catch(l){throw j.error("reloadRoutes: Failed to reload routes",l),l}else{const l=i.getRouter?.();l&&(await l.loadRoutes(),j.log("reloadRoutes: Routes reloaded (legacy fallback)"))}}),this.registerHandler("refresh",async(n,a)=>{if(typeof window>"u"){j.warn("refresh: window is not available");return}const i=Number(n.params?.delayMs??0);i>0&&await new Promise(l=>setTimeout(l,i)),window.location.reload()}),this.registerHandler("remount",async(n,a)=>{const{componentId:i}=n.params||{};if(!i){j.warn("remount: componentId parameter is required");return}if(!this.globalStateUpdater){j.warn("remount: globalStateUpdater is not set");return}const d=(window.G7Core?.state?.get()||{})._global?._remountKeys||{},f=d[i]||0;this.globalStateUpdater({_remountKeys:{...d,[i]:f+1}}),j.log(`remount: ${i} key incremented to ${f+1}`)}),this.registerHandler("reloadTranslations",async(n,a)=>{if(typeof window>"u"){j.warn("reloadTranslations: window is not available");return}const i=window.__templateApp;if(!i){j.warn("reloadTranslations: TemplateApp not initialized");return}if(typeof i.reloadExtensionState=="function")try{await i.reloadExtensionState(),j.log("reloadTranslations: delegated to reloadExtensionState")}catch(l){throw j.error("reloadTranslations: Failed to reload translations",l),l}}),this.registerHandler("reloadModuleHandlers",async(n,a)=>{if(typeof window>"u"){j.warn("reloadModuleHandlers: window is not available");return}const{moduleInfo:i,action:l}=n.params||{};if(!i){j.warn("reloadModuleHandlers: moduleInfo is required");return}const u=i.data||i;if(!u.identifier){j.warn("reloadModuleHandlers: moduleInfo with identifier is required");return}if(!l||l!=="add"&&l!=="remove"){j.warn('reloadModuleHandlers: action must be "add" or "remove"');return}const d=window.G7Config;if(!d){j.warn("reloadModuleHandlers: G7Config not available");return}const f=u.identifier;try{if(l==="add"){if(u.assets&&(d.moduleAssets=d.moduleAssets||{},d.moduleAssets[f]=u.assets,j.log(`reloadModuleHandlers: Added assets for ${f}`),u.assets.js)){const g=u.assets.js,m=`module-${f}`;if(document.getElementById(m)){j.warn(`reloadModuleHandlers: Script ${m} already loaded`);return}const b=document.createElement("script");if(b.id=m,b.src=g,b.async=!0,await new Promise((v,S)=>{b.onload=()=>{j.log(`reloadModuleHandlers: Script loaded successfully for ${f}`),v()},b.onerror=()=>{j.error(`reloadModuleHandlers: Failed to load script for ${f}`),S(new Error(`Failed to load module script: ${g}`))},document.head.appendChild(b)}),u.assets.css){const v=u.assets.css,S=`module-css-${f}`;if(!document.getElementById(S)){const _=document.createElement("link");_.id=S,_.rel="stylesheet",_.href=v,document.head.appendChild(_),j.log(`reloadModuleHandlers: CSS loaded for ${f}`)}}}}else if(l==="remove"){d.moduleAssets&&d.moduleAssets[f]&&(delete d.moduleAssets[f],j.log(`reloadModuleHandlers: Removed assets for ${f}`));const g=`module-${f}`,m=document.getElementById(g);m&&(m.remove(),j.log(`reloadModuleHandlers: Removed script for ${f}`));const b=`module-css-${f}`,v=document.getElementById(b);v&&(v.remove(),j.log(`reloadModuleHandlers: Removed CSS for ${f}`))}}catch(g){throw j.error(`reloadModuleHandlers: Failed to ${l} module assets`,g),g}}),this.registerHandler("reloadPluginHandlers",async(n,a)=>{if(typeof window>"u"){j.warn("reloadPluginHandlers: window is not available");return}const{pluginInfo:i,action:l}=n.params||{};if(!i){j.warn("reloadPluginHandlers: pluginInfo is required");return}const u=i.data||i;if(!u.identifier){j.warn("reloadPluginHandlers: pluginInfo with identifier is required");return}if(!l||l!=="add"&&l!=="remove"){j.warn('reloadPluginHandlers: action must be "add" or "remove"');return}const d=window.G7Config;if(!d){j.warn("reloadPluginHandlers: G7Config not available");return}const f=u.identifier;try{if(l==="add"){if(u.assets&&(d.pluginAssets=d.pluginAssets||{},d.pluginAssets[f]=u.assets,j.log(`reloadPluginHandlers: Added assets for ${f}`),u.assets.js)){const g=u.assets.js,m=`plugin-${f}`;if(document.getElementById(m)){j.warn(`reloadPluginHandlers: Script ${m} already loaded`);return}const b=document.createElement("script");if(b.id=m,b.src=g,b.async=!0,await new Promise((v,S)=>{b.onload=()=>{j.log(`reloadPluginHandlers: Script loaded successfully for ${f}`),v()},b.onerror=()=>{j.error(`reloadPluginHandlers: Failed to load script for ${f}`),S(new Error(`Failed to load plugin script: ${g}`))},document.head.appendChild(b)}),u.assets.css){const v=u.assets.css,S=`plugin-css-${f}`;if(!document.getElementById(S)){const _=document.createElement("link");_.id=S,_.rel="stylesheet",_.href=v,document.head.appendChild(_),j.log(`reloadPluginHandlers: CSS loaded for ${f}`)}}}}else if(l==="remove"){d.pluginAssets&&d.pluginAssets[f]&&(delete d.pluginAssets[f],j.log(`reloadPluginHandlers: Removed assets for ${f}`));const g=`plugin-${f}`,m=document.getElementById(g);m&&(m.remove(),j.log(`reloadPluginHandlers: Removed script for ${f}`));const b=`plugin-css-${f}`,v=document.getElementById(b);v&&(v.remove(),j.log(`reloadPluginHandlers: Removed CSS for ${f}`))}}catch(g){throw j.error(`reloadPluginHandlers: Failed to ${l} plugin assets`,g),g}});let e=!1;this.registerHandler("showErrorPage",async(n,a)=>{if(e){j.log("showErrorPage: Already active, skipping duplicate call");return}if(e=!0,typeof window>"u"){e=!1,j.warn("showErrorPage: window is not available");return}const i=window.__templateApp;if(!i){e=!1,j.warn("showErrorPage: TemplateApp not initialized");return}const l=i.getErrorPageHandler?.();if(!l){e=!1,j.warn("showErrorPage: ErrorPageHandler not available");return}const u=n.params?.errorCode||500,d=n.params?.target||"content";let f=n.params?.containerId;f||(f=d==="full"?"app":"main_content"),j.log("showErrorPage:",{errorCode:u,target:d,containerId:f});const g=(m,b=6e4)=>new Promise((v,S)=>{const _=document.getElementById(m);if(_){v(_);return}j.log(`showErrorPage: Waiting for container #${m}...`);let A;const k=new MutationObserver((O,M)=>{const x=document.getElementById(m);x&&(j.log(`showErrorPage: Container #${m} found`),M.disconnect(),clearTimeout(A),v(x))});k.observe(document.body,{childList:!0,subtree:!0}),A=setTimeout(()=>{k.disconnect(),S(new Error(`Container #${m} not found within ${b}ms`))},b)});try{await g(f);const m=yr(),b=m.layoutErrorHandling;m.clearLayoutConfig();try{await l.renderError(u,f)||j.warn(`showErrorPage: Failed to render error page for code ${u}`)}finally{m.setLayoutConfig(b)}}catch(m){throw j.error("showErrorPage: Error rendering error page:",m),m}finally{e=!1}}),this.registerHandler("emitEvent",async(n,a)=>{const i=n.params?.event,l=n.params?.data;if(!i){j.warn("emitEvent: event parameter is required");return}if(typeof window>"u"){j.warn("emitEvent: window is not available");return}const u=window.G7Core;if(!u?.componentEvent?.emit){j.warn("emitEvent: G7Core.componentEvent is not available");return}try{j.log(`emitEvent: Emitting "${i}"`,l);const d={...l,_context:{data:a.data,state:a.state}},f=await u.componentEvent.emit(i,d);if(!f||f.length===0?j.warn(`emitEvent: No listeners found for "${i}"`):j.log(`emitEvent: Event "${i}" completed with ${f.length} listener(s)`,f),this.globalStateUpdater){const g=(u?.state?.get()||{})._local||{},m={event:i,success:!0,data:f.length===1?f[0]:f,listeners:f.length};this.globalStateUpdater({_local:{...g,_eventResult:m}});const b=a.state&&typeof a.state=="object"&&!Array.isArray(a.state)?a.state:g;window.__g7SequenceLocalSync={...b,_eventResult:m}}}catch(d){if(j.error(`emitEvent: Event "${i}" failed`,d),this.globalStateUpdater){const f=u?.state?.get()||{};this.globalStateUpdater({_local:{...f._local,_eventResult:{event:i,success:!1,error:d instanceof Error?d.message:String(d)}}})}throw d}}),this.registerHandler("updateProductField",async(n,a)=>{const{productId:i,field:l,value:u}=n.params||{};if(!i||!l){j.warn("updateProductField: productId and field are required");return}if(typeof window>"u"){j.warn("updateProductField: window is not available");return}const d=window.G7Core;if(!d?.state?.get||!this.globalStateUpdater){j.warn("updateProductField: G7Core.state or globalStateUpdater is not available");return}try{const f=d.state.get()||{},m=(f.products?.data?.data||[]).map(v=>v.id===i?{...v,[l]:u,_modified:!0}:v),b=new Set(f._local?.modifiedProductIds||[]);b.add(i),this.globalStateUpdater({products:{...f.products,data:{...f.products?.data,data:m}},_local:{...f._local,modifiedProductIds:Array.from(b)}}),j.log(`updateProductField: Updated product ${i}, field: ${l}, value:`,u)}catch(f){throw j.error("updateProductField: Error updating product field",f),f}}),this.registerHandler("updateOptionField",async(n,a)=>{const{productId:i,optionId:l,field:u,value:d}=n.params||{};if(!i||!l||!u){j.warn("updateOptionField: productId, optionId and field are required");return}if(typeof window>"u"){j.warn("updateOptionField: window is not available");return}const f=window.G7Core;if(!f?.state?.get||!this.globalStateUpdater){j.warn("updateOptionField: G7Core.state or globalStateUpdater is not available");return}try{const g=f.state.get()||{},b=(g.products?.data?.data||[]).map(S=>{if(S.id===i&&S.options){const _=S.options.map(A=>A.id===l?{...A,[u]:d,_modified:!0}:A);return{...S,options:_,_modified:!0}}return S}),v=new Set(g._local?.modifiedProductIds||[]);v.add(i),this.globalStateUpdater({products:{...g.products,data:{...g.products?.data,data:b}},_local:{...g._local,modifiedProductIds:Array.from(v)}}),j.log(`updateOptionField: Updated product ${i} option ${l}, field: ${u}, value:`,d)}catch(g){throw j.error("updateOptionField: Error updating option field",g),g}}),this.registerHandler("setLocale",async(n,a)=>{const i=n.target;if(!i||typeof i!="string"){j.warn("setLocale: Invalid locale:",i);return}const l=window.__templateApp;if(l&&typeof l.changeLocale=="function")try{await l.changeLocale(i),j.log("setLocale: Locale changed to",i)}catch(u){j.error("setLocale: Failed to change locale:",u),window.location.reload()}else{j.warn("setLocale: TemplateApp not found, falling back to page reload");try{localStorage.setItem("g7_locale",i)}catch{}window.location.reload()}}),this.registerHandler("suppress",async()=>{j.log("suppress: Error intentionally suppressed")}),this.registerBuiltInHandlerMetadata()}registerBuiltInHandlerMetadata(){const e=Vn();if(!e?.isEnabled())return;const n=[{name:"refetchDataSource",description:"데이터 소스를 다시 fetch합니다"},{name:"appendDataSource",description:"데이터 소스에 새 데이터를 병합합니다 (무한 스크롤용)"},{name:"updateDataSource",description:"API 응답으로 데이터 소스를 직접 업데이트합니다 (refetch 대체)"},{name:"reloadRoutes",description:"라우트를 다시 로드합니다"},{name:"refresh",description:"현재 페이지를 새로고침합니다"},{name:"remount",description:"컴포넌트를 리마운트합니다"},{name:"reloadTranslations",description:"다국어 파일을 다시 로드합니다"},{name:"showErrorPage",description:"에러 페이지를 표시합니다"},{name:"emitEvent",description:"이벤트를 발생시킵니다"},{name:"updateProductField",description:"상품 필드를 인라인 수정합니다"},{name:"updateOptionField",description:"상품 옵션 필드를 인라인 수정합니다"},{name:"setLocale",description:"언어를 변경합니다 (DB 저장 + UI 리렌더링)"}];for(const a of n)e.trackHandlerRegistration(a.name,"built-in",a.description)}createHandler(e,n,a){j.log("createHandler called for:",e.handler,e.type);const i=window.__g7DevTools,l=Date.now(),u=a?.state?{...a.state}:null,d=`handler_${e.handler}_${l}`;return async f=>{if(j.log("Handler invoked for:",e.handler,"event:",f.type),i?.isEnabled?.()&&u){const m=window.G7Core?.state?.getLocal?.()??a?.state??{},b=Date.now()-l;for(const v of Object.keys(u)){const S=u[v],_=m[v];S!==_&&b>100&&(i.trackStaleClosureWarning?.({type:"event-handler-stale",location:`createHandler(${e.handler})`,capturedPath:`_local.${v}`,capturedValue:S,capturedAt:l,currentValue:_,actionId:d,stackTrace:new Error().stack}),j.warn(`[Stale Closure] _local.${v} changed after handler creation:`,`captured="${S}" → current="${_}" (${b}ms ago)`))}}try{f.type!=="change"&&f.preventDefault();let g={};if(f.type==="submit"&&f.target instanceof HTMLFormElement){const v=f.target;new FormData(v).forEach((_,A)=>{g[A]=_})}const m={...this.defaultContext,data:{...n,form:g,_local:a?.state||{},$event:f},event:f,...a&&{state:a.state,setState:a.setState},isolatedContext:a?.isolatedContext};if(e.confirm){let v=this.resolveValue(e.confirm,m.data);if(this.translationEngine&&this.translationContext&&v.startsWith("$t:")&&(v=this.translationEngine.resolveTranslations(v,this.translationContext,m.data)),!confirm(v))return}const b=window.__g7ActionContext;window.__g7ActionContext={...a,data:m.data};try{await this.executeAction(e,m)}finally{window.__g7ActionContext=b}}catch(g){if(j.error("Action execution failed:",g),e.onError){const m=g instanceof jt&&g.originalError?g.originalError:g,b={...this.defaultContext,data:{...n,error:m,_local:a?.state||{},$event:f},event:f,...a&&{state:a.state,setState:a.setState}},v=Array.isArray(e.onError)?e.onError:[e.onError];for(const S of v)await this.executeAction(S,b)}}}}generateActionId(e,n){const a=e.handler,i=n||"no-target",l=Date.now(),u=Math.random().toString(36).substring(2,9);return`${a}_${i.replace(/[^a-zA-Z0-9]/g,"_")}_${l}_${u}`}async executeAction(e,n){if(e=this.resolveActionRef(e),typeof e.handler=="string"&&e.handler.includes("{{")){const f=this.evaluateExpression(e.handler,n.data);e={...e,handler:f==null?"":String(f)}}const a=Vn(),i=a?.isEnabled()?`action_${Date.now()}_${Math.random().toString(36).substring(2,11)}`:void 0,l=performance.now();let u;if(i&&a&&a.logAction({id:i,type:e.handler,params:this.sanitizeForDevTools(e.params),context:this.sanitizeForDevTools({hasState:!!n.state,hasSetState:!!n.setState,dataKeys:n.data?Object.keys(n.data):[]}),startTime:l,status:"started"}),e.if!==void 0)try{const f=this.resolveValue(e.if,n.data),g=f===!0||f==="true"||f&&f!=="false"&&f!=="0"&&f!==!1;if(j.log("[executeAction] if condition result:",e.handler,g),!g)return i&&a&&a.logAction({id:i,type:e.handler,startTime:l,endTime:performance.now(),duration:performance.now()-l,status:"success",result:{skipped:!0,reason:"if condition false"}}),{success:!0,data:void 0}}catch(f){return j.error("[executeAction] if condition error:",e.handler,f),i&&a&&a.logAction({id:i,type:e.handler,startTime:l,endTime:performance.now(),duration:performance.now()-l,status:"error",error:{name:"ConditionEvaluationError",message:f instanceof Error?f.message:String(f),stack:f instanceof Error?f.stack:void 0}}),{success:!0,data:void 0}}let d;try{const f=this.resolveParams(e.params,n.data);i&&(u=this.sanitizeForDevTools(f));const g=e.target?this.resolveValue(e.target,n.data):void 0;if(e.handler==="apiCall"&&n.setState){d=this.generateActionId(e,g);const b=n.state?.loadingActions||{};n.setState({loadingActions:{...b,[d]:!0}})}if(this.previewMode&&cm.has(e.handler))return j.warn(`Preview mode: "${e.handler}" suppressed`,g||f),i&&a&&a.logAction({id:i,type:e.handler,startTime:l,endTime:performance.now(),duration:performance.now()-l,status:"skipped",metadata:{reason:"preview_mode_suppressed"}}),{success:!0,data:void 0};let m;switch(e.handler){case"ensureIdentityVerified":m=await this.handleEnsureIdentityVerified(f);break;case"resolveIdentityChallenge":m=this.handleResolveIdentityChallenge(f);break;case"navigate":const b=f.path||g;m=await this.handleNavigate(b,f,n);break;case"navigateBack":m=await this.handleNavigateBack();break;case"navigateForward":m=await this.handleNavigateForward();break;case"openWindow":{const _=f.path||g;m=await this.handleOpenWindow(_,f);break}case"replaceUrl":{const _=f.path||g||window.location.pathname;m=await this.handleReplaceUrl(_,f);break}case"apiCall":if(e.onSuccess&&a?.isEnabled()&&i){const _=window.G7Core,A={};if(_?.state?.get){const k=_.state.get();A._global=k}n.state&&(A._local=n.state),a.registerStateCaptureForHandler?.(i,["_global","_local"],A)}const v=e.auth_mode??(e.auth_required?"required":"none"),S=e.identity_target?this.resolveParams(e.identity_target,n.data):void 0;m=await this.handleApiCall(g,f,n,v,S);break;case"login":m=await this.handleLogin(g,f,n);break;case"logout":m=await this.handleLogout(g,n);break;case"setState":j.log("[executeAction] setState resolvedParams:",f),m=await this.handleSetState(e.render!==void 0?{...f,__render:e.render}:f,n);break;case"setError":m=await this.handleSetError(g,f,n);break;case"openModal":m=await this.handleOpenModal(g,n);break;case"closeModal":m=await this.handleCloseModal(n);break;case"showAlert":m=await this.handleShowAlert(g,n);break;case"toast":m=await this.handleToast(f,n);break;case"switch":m=await this.handleSwitch(e,n);break;case"conditions":m=await this.handleConditions(e,n);break;case"sequence":m=await this.handleSequence(e,n);break;case"parallel":m=await this.handleParallel(e,n);break;case"startInterval":m=this.handleStartInterval(f,n);break;case"stopInterval":m=this.handleStopInterval(f);break;case"loadScript":m=await this.handleLoadScript(f,e,n);break;case"callExternal":m=await this.handleCallExternal(f,e,n);break;case"callExternalEmbed":m=await this.handleCallExternalEmbed(f,e,n);break;case"saveToLocalStorage":m=await this.handleSaveToLocalStorage(f,n);break;case"loadFromLocalStorage":m=await this.handleLoadFromLocalStorage(f,n);break;default:m=await this.handleCustomAction({...e,target:g,params:f},n);break}if(e.resultTo&&m!==void 0){const{target:b,key:v,merge:S}=e.resultTo,_=this.resolveValue(v,n.data),A=S==="replace"?"replace":S==="shallow"?"shallow":"deep";if(b==="_local"&&n.setState){const k=this.buildNestedUpdate(_,m),O=A!=="deep"?{...k,__mergeMode:A}:k;n.setState(O),j.log(`[resultTo] Saved to _local.${_} (merge=${A}):`,m)}else if(b==="_local"&&this.globalStateUpdater){const M=(window.G7Core?.state?.get()||{})._local||{},x=this.buildNestedUpdate(_,m);let D;A==="replace"?D=x:A==="shallow"?D={...M,...x}:D=this.deepMergeWithState(x,M),this.globalStateUpdater({_local:D}),j.log(`[resultTo] Saved to _local.${_} via globalStateUpdater (merge=${A}):`,m)}else if(b==="_global"&&this.globalStateUpdater){const k=this.buildNestedUpdate(_,m);this.globalStateUpdater(k),j.log(`[resultTo] Saved to _global.${_}:`,m)}else if(b==="_isolated"&&n.isolatedContext){const k=this.buildNestedUpdate(_,m);n.isolatedContext.mergeState(k,A),j.log(`[resultTo] Saved to _isolated.${_} (merge=${A}):`,m)}else j.warn(`[resultTo] Cannot save result: target=${b}, setState=${!!n.setState}, globalStateUpdater=${!!this.globalStateUpdater}, isolatedContext=${!!n.isolatedContext}`)}if(e.onSuccess){if(a?.isEnabled()&&i&&e.handler==="apiCall"){const S=window.G7Core,_={};S?.state?.get&&(_._global=S.state.get()),n.state&&(_._local=n.state),a.detectStaleClosure?.(i,`${e.handler} → onSuccess`,_,"callback-state-capture",i)}const b={...n,data:{...n.data,result:m,response:m}},v=Array.isArray(e.onSuccess)?e.onSuccess:[e.onSuccess];v.length>1?await this.handleSequence({handler:"sequence",type:"click",actions:v},b):v.length===1&&await this.executeAction(v[0],b)}return i&&a&&a.logAction({id:i,type:e.handler,params:this.sanitizeForDevTools(e.params),resolvedParams:u,startTime:l,endTime:performance.now(),duration:performance.now()-l,status:"success",result:this.sanitizeForDevTools(m)}),{success:!0,data:m}}catch(f){const g=f instanceof jt?f:new jt(`Failed to execute action: ${e.handler}`,e,f instanceof Error?f:void 0),m=g.originalError?.response||{},b=m.data||{},v=g.originalError?.status||m.status||500;let S=pC(g.originalError??f,e.handler,b.message,g.message);this.translationEngine&&this.translationContext&&S.startsWith("$t:")&&(S=this.translationEngine.resolveTranslations(S,this.translationContext));const _={status:v,message:S,errors:b.errors||m.errors,data:b,statusText:g.originalError?.statusText,error_code:b.error_code??m.error_code};if(g.unknownHandler)throw j.warn(`Unknown action handler "${e.handler}" — skipped (extension not loaded?). Not surfaced to the user.`),g;const k=yr().resolve(v,{errorHandling:e.errorHandling,onError:e.onError});if(k.handler){if(a?.isEnabled()&&i&&e.handler==="apiCall"){const M=window.G7Core,x={};M?.state?.get&&(x._global=M.state.get()),n.state&&(x._local=n.state),a.detectStaleClosure?.(i,`${e.handler} → onError`,x,"callback-state-capture",i)}const O={...n,data:{...n.data,error:_}};try{const M={type:"click",handler:k.handler.handler,target:k.handler.target,params:k.handler.params,actions:k.handler.actions};return await this.executeAction(M,O),{success:!1,error:g}}catch(M){return j.error("Error executing error handler:",M),{success:!1,error:g}}}throw i&&a&&a.logAction({id:i,type:e.handler,params:this.sanitizeForDevTools(e.params),resolvedParams:u,startTime:l,endTime:performance.now(),duration:performance.now()-l,status:"error",error:{name:g.name,message:g.message,stack:g.stack}}),g}finally{if(e.handler==="apiCall"&&n.setState&&d){const f=n.state?.loadingActions||{},{[d]:g,...m}=f;n.setState({loadingActions:m})}}}async handleNavigate(e,n,a){let i=e;if(n.query||n.mergeQuery===!0)if(n.mergeQuery===!0)i=this.buildMergedQueryPath(e,n.query??{});else{const u=new URLSearchParams;for(const[f,g]of Object.entries(n.query))if(g!=null&&g!=="")if(Array.isArray(g)){const m=f.endsWith("[]")?f:`${f}[]`;for(const b of g)b!=null&&b!==""&&u.append(m,String(b))}else u.set(f,String(g));const d=u.toString();d&&(i=`${e}?${d}`)}if(j.log("handleNavigate:",{target:e,params:n,finalPath:i,replace:n.replace,windowLocationSearch:window.location.search}),n.replace===!0){const u=window.G7Core;if(u?.updateQueryParams){const d=typeof n.transition_overlay_target=="string"?n.transition_overlay_target:void 0;await u.updateQueryParams(i,d?{transitionOverlayTarget:d}:void 0),j.log("handleNavigate: Used updateQueryParams for replace mode",d?{transitionOverlayTarget:d}:void 0),this.applyScrollOption(n.scroll,n.scrollBehavior,"top");return}j.warn("handleNavigate: G7Core.updateQueryParams not available, falling back to React Router")}const l=this.resolveNavigateFallbackAction(i,n);if(l){j.warn(`handleNavigate: No route matched, falling back to "${l.handler}"`),await this.dispatchAction({type:"click",handler:l.handler,params:l.params},a),this.applyScrollOption(n.scroll,n.scrollBehavior,"top");return}if(!a.navigate)throw new jt("Navigate function is not provided in context");a.navigate(i,{replace:n.replace===!0}),this.applyScrollOption(n.scroll,n.scrollBehavior,"top")}resolveNavigateFallbackAction(e,n){const a=n.fallback;if(a===!1||n.replace===!0)return null;const l=window.__templateApp?.getRouter?.();if(!l||typeof l.match!="function"||typeof l.getRoutes=="function"&&l.getRoutes().length===0)return null;const u=e.split("?")[0];return l.match(u)?null:this.resolveNavigateFallback(a,e,n)}resolveNavigateFallback(e,n,a){return e==null?{handler:"openWindow",params:{path:n,target:"_self"}}:typeof e=="string"?{handler:e,params:{path:n}}:typeof e=="object"&&typeof e.handler=="string"?{handler:e.handler,params:{path:n,...e.params||{}}}:(j.warn("resolveNavigateFallback: unrecognized fallback option, using openWindow",e),{handler:"openWindow",params:{path:n,target:"_blank"}})}applyScrollOption(e,n,a){const i=e===void 0?a:e;if(i==="preserve")return;const l=n==="smooth"?"smooth":"instant",u=b=>{if(typeof b!="object"||b===null)return!1;const v=b;return"container"in v||"to"in v||"block"in v||"offset"in v},d=(b,v,S=0)=>{b===window?window.scrollTo({top:v,left:S,behavior:l}):b.scrollTo({top:v,left:S,behavior:l})},f=(b,v,S,_)=>{if(v===window){b.scrollIntoView({behavior:l,block:S}),_&&window.scrollBy({top:-_,left:0,behavior:l});return}const A=v,k=b.getBoundingClientRect(),O=A.getBoundingClientRect(),M=A.scrollTop+(k.top-O.top);let x;S==="center"?x=M-(A.clientHeight-b.clientHeight)/2:S==="end"?x=M-(A.clientHeight-b.clientHeight):x=M,x-=_,A.scrollTo({top:Math.max(0,x),left:0,behavior:l})},g=()=>{window.scrollTo({top:0,left:0,behavior:l});const b=document.getElementById("app")??document.body;if(!b)return;b.querySelectorAll("*").forEach(S=>{if(S.scrollTop===0&&S.scrollLeft===0)return;const _=window.getComputedStyle(S),A=_.overflowY,k=_.overflowX;(A==="auto"||A==="scroll"||k==="auto"||k==="scroll")&&S.scrollTo({top:0,left:0,behavior:l})})},m=()=>{try{if(u(i)){const b=i,v=b.block??"start",S=typeof b.offset=="number"?b.offset:0;let _=window;if(typeof b.container=="string"&&b.container.length>0){const k=document.querySelector(b.container);if(!k){j.warn(`applyScrollOption: container not found: ${b.container}`);return}_=k}const A=b.to??"top";if(A==="top"){_===window?g():d(_,0);return}if(typeof A=="number"){d(_,A-S);return}if(typeof A=="object"&&A!==null&&("x"in A||"y"in A)){const{x:k=0,y:O=0}=A;d(_,O-S,k);return}if(typeof A=="string"&&(A.startsWith("#")||A.startsWith("."))){const k=document.querySelector(A);k?f(k,_,v,S):j.warn(`applyScrollOption: target element not found: ${A}`);return}j.warn('applyScrollOption: invalid "to" value in extended form',A);return}if(i==="top"){g();return}if(typeof i=="number"){window.scrollTo({top:i,left:0,behavior:l});return}if(typeof i=="object"&&i!==null&&("x"in i||"y"in i)){const{x:b=0,y:v=0}=i;window.scrollTo({top:v,left:b,behavior:l});return}if(typeof i=="string"&&(i.startsWith("#")||i.startsWith("."))){const b=document.querySelector(i);b&&b.scrollIntoView({behavior:l,block:"start"});return}}catch(b){j.warn("applyScrollOption: failed to apply scroll",b)}};typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(m):m()}async handleOpenWindow(e,n){let a=e;if(n.query){const l=new URLSearchParams;for(const[d,f]of Object.entries(n.query))f!=null&&f!==""&&l.set(d,String(f));const u=l.toString();u&&(a=`${e}?${u}`)}const i=n.target==="_self"?"_self":"_blank";j.log("handleOpenWindow:",{target:e,params:n,finalPath:a,windowTarget:i}),i==="_self"?window.location.assign(a):window.open(a,"_blank")}async handleNavigateBack(){j.log("handleNavigateBack"),window.history.back()}async handleNavigateForward(){j.log("handleNavigateForward"),window.history.forward()}async handleReplaceUrl(e,n){let a=e;if(n.query||n.mergeQuery===!0)if(n.mergeQuery===!0)a=this.buildMergedQueryPath(e,n.query??{});else{const i=new URLSearchParams;for(const[u,d]of Object.entries(n.query))if(d!=null&&d!=="")if(Array.isArray(d)){const f=u.endsWith("[]")?u:`${u}[]`;for(const g of d)g!=null&&g!==""&&i.append(f,String(g))}else i.set(u,String(d));const l=i.toString();l&&(a=`${e}?${l}`)}j.log("handleReplaceUrl:",{target:e,params:n,finalPath:a}),window.history.replaceState(null,"",a),this.applyScrollOption(n.scroll,n.scrollBehavior,"preserve")}buildMergedQueryPath(e,n){const a=new URLSearchParams(window.location.search);for(const[u,d]of Object.entries(n))if(d==null||d==="")a.delete(u);else if(Array.isArray(d)){const f=u.endsWith("[]")?u:`${u}[]`;a.delete(u),a.delete(f);for(const g of d)g!=null&&g!==""&&a.append(f,String(g))}else a.set(u,String(d));const i=a.toString(),l=e.split("?")[0];return i?`${l}?${i}`:l}async ensureCsrfToken(){try{await fetch("/sanctum/csrf-cookie",{credentials:"include"})}catch(e){throw new jt("Failed to fetch CSRF token",void 0,e instanceof Error?e:void 0)}}getCsrfTokenFromCookie(){const a=`; ${document.cookie}`.split("; XSRF-TOKEN=");if(a.length===2){const i=a.pop()?.split(";").shift();return i?decodeURIComponent(i):null}return null}buildQueryString(e){const n=new URLSearchParams;for(const[a,i]of Object.entries(e))if(!(i==null||i===""))if(Array.isArray(i))for(const l of i)l!=null&&l!==""&&n.append(`${a}[]`,String(l));else typeof i=="object"?n.append(a,JSON.stringify(i)):n.append(a,String(i));return n.toString()}async handleEnsureIdentityVerified(e){const n=typeof e.purpose=="string"?e.purpose:"sensitive_action",a=e.target&&typeof e.target=="object"?e.target:void 0;return await Et.handle({success:!1,error_code:"identity_verification_required",message:"",verification:{policy_key:e.policy_key??"",purpose:n,provider_id:e.provider_id??null,render_hint:e.render_hint??null,return_request:null}},void 0,a)!==null}handleResolveIdentityChallenge(e){const n=typeof e.result=="string"?e.result:"cancelled";let a;switch(n){case"verified":{const i=typeof e.token=="string"?e.token:"";if(!i){j.warn("resolveIdentityChallenge: result=verified 인데 token 이 비어있습니다. failed 로 강등합니다."),a={status:"failed",failureCode:"MISSING_TOKEN"};break}a={status:"verified",token:i,providerData:e.providerData&&typeof e.providerData=="object"?e.providerData:void 0};break}case"pending":{const i=typeof e.pollUrl=="string"?e.pollUrl:"",l=typeof e.expiresAt=="string"?e.expiresAt:"";if(!i||!l){j.warn("resolveIdentityChallenge: result=pending 인데 pollUrl/expiresAt 누락 — failed 로 강등합니다."),a={status:"failed",failureCode:"MALFORMED_PENDING"};break}a={status:"pending",pollUrl:i,pollIntervalMs:typeof e.pollIntervalMs=="number"?e.pollIntervalMs:void 0,expiresAt:l};break}case"failed":a={status:"failed",failureCode:typeof e.failureCode=="string"?e.failureCode:"UNKNOWN",reason:typeof e.reason=="string"?e.reason:void 0};break;default:a={status:"cancelled"};break}return Et.resolveDeferred(a),!0}async handleApiCall(e,n,a,i="none",l){const{method:u="GET",body:d,headers:f,contentType:g}=n;u!=="GET"&&u!=="HEAD"&&await this.ensureCsrfToken();const m=this.getCsrfTokenFromCookie();let b={};if(i==="required"||i==="optional"){const X=Ir().getToken();X&&(b={Authorization:`Bearer ${X}`})}let v=e;const S=n.query||(u==="GET"?d:null);if(S&&typeof S=="object"){const q=this.buildQueryString(S);if(q){const X=e.includes("?")?"&":"?";v=`${e}${X}${q}`}}const _=window.G7Core?.state?.getGlobal?.()||a.state?._global||{},A=window.G7Core?.state?.getLocal?.()||a.state?._local||{},k={_global:_,_local:A},O=this.getMatchingGlobalHeaders(e,k),M={};if(typeof window<"u"){const q=localStorage.getItem("g7_locale");q&&(M["Accept-Language"]=q)}const x=g==="multipart/form-data",D={method:u,headers:{...x?{}:{"Content-Type":"application/json"},Accept:"application/json",...M,...m&&{"X-XSRF-TOKEN":m},...b,...O,...f},credentials:"include"};if(d&&u!=="GET")if(x){const q=new FormData;for(const[X,pe]of Object.entries(d))pe instanceof File||pe instanceof Blob?q.append(X,pe):pe!=null&&q.append(X,typeof pe=="object"?JSON.stringify(pe):String(pe));D.body=q}else D.body=JSON.stringify(d);const U=Vn();let z=null;U?.isEnabled()&&(z=U.trackRequest(v,u));try{let q=await fetch(v,D),X;try{X=await q.json()}catch{X=null}if(Et.isIdentityRequired(q.status,X)){const pe=await Et.handle(X,{body:D.body,headers:D.headers,credentials:D.credentials},l);if(pe){q=pe;try{X=await q.json()}catch{X=null}}}if(z&&U?.isEnabled()&&(U.completeRequest(z,q.status,X),z=null),!q.ok){const pe=X||{},Ce=new Error(pe.message||`API call failed: ${q.statusText}`);throw Ce.response=pe,Ce.status=q.status,Ce.statusText=q.statusText,new jt(pe.message||`API call failed: ${q.statusText}`,void 0,Ce)}return X}catch(q){throw z&&U?.isEnabled()&&U.failRequest(z,q instanceof Error?q.message:String(q)),q}}async handleLogin(e,n,a){const{body:i}=n;if(!i||!i.email||!i.password)throw new jt("Login requires email and password in body params");const l=e==="user"?"user":"admin",u=l==="admin"?"/api/auth/admin/login":"/api/auth/login",d=window.G7Core?.state?.getGlobal?.()||a.state?._global||{},f=window.G7Core?.state?.getLocal?.()||a.state?._local||{},g={_global:d,_local:f},m=this.getMatchingGlobalHeaders(u,g),b=pr.getInstance();try{const v=Object.keys(m).length>0?{headers:m}:void 0;return{user:await b.login(l,{email:i.email,password:i.password},v)}}catch(v){const S=v.message||"Login failed",_=new Error(S);throw _.response=v.response?.data||{},_.status=v.status||v.response?.status||500,new jt(S,void 0,_)}}async handleLogout(e,n){await pr.getInstance().logout()}async handleSetState(e,n){j.log("[handleSetState] START, params:",e);const{target:a="component",scope:i,merge:l,__render:u,...d}=e,f=Vn(),g=window.G7Core;if(typeof a=="string"&&(a.startsWith("$parent.")||a.startsWith("$root.")))return this.handleParentScopeSetState(a,d,l,n);const m=n.state&&Object.keys(n.state).length>0?n.state:g?.state?.get()||{},b=a==="global"?"_global":a.startsWith("_local.")?a:"_local",v=b==="_global"?m._global:b.startsWith("_local.")?this.getNestedProperty(m._local||{},b.slice(7)):m._local,S=f?.isEnabled()?f.startStateChange(b,v,d,{actionId:n.actionId,handlerType:"setState",source:`target=${a}`}):void 0,_=l==="replace"?"replace":l==="shallow"?"shallow":"deep",A=_!=="deep"?{...d,__mergeMode:_,...S?{__setStateId:S}:{}}:{...d,...S?{__setStateId:S}:{}};if(a==="global"){if(!this.globalStateUpdater){j.warn("Global state updater is not set"),S&&f&&f.completeStateChange(S);return}const k=g?.state?.get()||{},{__setStateId:O,__mergeMode:M,...x}=A,D=_==="deep"?this.deepMergeWithState(x,k):x,U={...D,...S?{__setStateId:S}:{},..._!=="deep"?{__mergeMode:_}:{}};return j.log("setState global:",U),this.globalStateUpdater(U,{render:u}),S&&f&&setTimeout(()=>f.completeStateChange(S),0),{__target:"global",..._!=="deep"?{__mergeMode:_}:{},...D}}else if(a==="isolated"){const k=n.isolatedContext;if(k){const{__mergeMode:O,__setStateId:M,...x}=A;return k.mergeState(x,_),j.log("[handleSetState] isolated state updated:",x,"mergeMode:",_),S&&f&&setTimeout(()=>f.completeStateChange(S),0),{__target:"isolated",...x}}else if(j.warn('[handleSetState] isolated target used but no IsolatedStateContext found. Make sure the component has "isolatedState" attribute. Falling back to local state.'),n.setState){const M=window.__g7PendingLocalState||n.state||{},x=_==="deep"?this.deepMergeWithState(A,M):A;return n.setState(x),S&&f&&setTimeout(()=>f.completeStateChange(S),0),x}else throw S&&f&&f.completeStateChange(S),new jt("isolated target used but no IsolatedStateContext found and no setState function in context")}else if(a==="local"||a==="component"||a==="_local"){if(i==="parent"||i==="root"){const O=window.__g7LayoutContextStack||[];if(O.length>0){const M=i==="parent"?O[O.length-1]:O[0];if(M?.setState){const{__mergeMode:x,__setStateId:D,...U}=A,z=_==="deep"?this.deepMergeWithState(U,M.state||{}):U;return j.log(`[handleSetState] scope=${i}: 타겟 컨텍스트에 상태 업데이트`,z),M.setState(z),S&&f&&setTimeout(()=>f.completeStateChange(S),0),z}}j.warn(`[handleSetState] scope=${i}: 레이아웃 컨텍스트 스택이 비어있습니다. current로 폴백합니다.`)}const k=n.setState&&!n._isDispatchFallbackContext;if(j.log("[handleSetState] isRealComponentContext:",k,"context.setState:",!!n.setState,"_isDispatchFallbackContext:",n._isDispatchFallbackContext),k){j.log("[handleSetState] Using COMPONENT setState path"),j.log("[handleSetState] resolvedPayload:",A),j.log("[handleSetState] context.state:",n.state),j.log("[handleSetState] mergeMode:",_);const M=window.__g7PendingLocalState||n.state||{},x=_==="deep"?this.deepMergeWithState(A,{}):A;j.log("[handleSetState] convertedPayload (변경 필드만, dot notation 변환):",x),n.setState(x);const D=_==="deep"?this.deepMergeWithState(A,M):_==="shallow"?{...n.state||{},...A}:A,{__mergeMode:U,__setStateId:z,...q}=D;window.__g7PendingLocalState=q,j.log("[handleSetState] __g7PendingLocalState updated:",q),this.globalStateUpdater&&(this.globalStateUpdater({_local:q},{render:!1}),j.log("[handleSetState] _global._local synced (render:false):",q));const{__mergeMode:X,__setStateId:pe,...Ce}=A;if(_==="replace")window.__g7ForcedLocalFields=Ce;else{const ve=window.__g7ForcedLocalFields||{};window.__g7ForcedLocalFields=this.deepMergeWithState(Ce,ve)}return j.log("[handleSetState] __g7ForcedLocalFields updated:",Ce),S&&f&&setTimeout(()=>f.completeStateChange(S),0),{__target:"local",...D}}else if(this.globalStateUpdater){j.log("[handleSetState] Using GLOBAL STATE UPDATER path for _local");const M=window.__g7PendingLocalState||m._local||{};j.log("[handleSetState] currentLocal (with pending):",M);const x=_==="deep"?this.deepMergeWithState(A,M):A;return j.log("[handleSetState] finalLocal (merged):",x),this.globalStateUpdater({_local:x},{render:u}),window.__g7PendingLocalState=x,j.log("[handleSetState] __g7PendingLocalState updated for globalStateUpdater path"),S&&f&&setTimeout(()=>f.completeStateChange(S),0),{__target:"local",...x}}else throw S&&f&&f.completeStateChange(S),new jt("setState function is not provided in context and globalStateUpdater is not set")}else if(a.startsWith("_local.")){const k=a.slice(7),{__mergeMode:O,__setStateId:M,...x}=A,D=x.value!==void 0?x.value:Object.values(x)[0];if(n.setState){const z=window.__g7PendingLocalState||n.state||{},q=this.createNestedUpdate(k,D,z),X={...z,...q};return n.setState(q),S&&f&&setTimeout(()=>f.completeStateChange(S),0),X}else throw S&&f&&f.completeStateChange(S),new jt("setState function is not provided in context")}else{if(!n.setState)throw S&&f&&f.completeStateChange(S),new jt("setState function is not provided in context");const O=window.__g7PendingLocalState||n.state||{},M=_==="deep"?this.deepMergeWithState(A,O):A;return n.setState(M),S&&f&&setTimeout(()=>f.completeStateChange(S),0),M}}async handleParentScopeSetState(e,n,a,i){const l=Vn(),u=window.G7Core,d=a==="replace"?"replace":a==="shallow"?"shallow":"deep",f=e.startsWith("$parent."),g=f?"$parent.":"$root.",m=e.slice(g.length);let b,v;if(m==="_local"||m==="_global")b=m,v=void 0;else if(m.startsWith("_local."))b="_local",v=m.slice(7);else if(m.startsWith("_global."))b="_global",v=m.slice(8);else{j.warn(`[handleParentScopeSetState] 지원하지 않는 타겟 형식: ${e}. _local 또는 _global으로 시작해야 합니다.`);return}const S=window.__g7LayoutContextStack||[];if(S.length===0){j.warn(`[handleParentScopeSetState] 레이아웃 컨텍스트 스택이 비어있습니다. target=${e}`);return}const _=f?S[S.length-1]:S[0];if(!_){j.warn(`[handleParentScopeSetState] 타겟 컨텍스트를 찾을 수 없습니다. target=${e}`);return}const A=b==="_global"?_.state?._global:_.state?._local,k=l?.isEnabled()?l.startStateChange(e,A,n,{actionId:i.actionId,handlerType:"setState",source:`target=${e}`}):void 0,{__mergeMode:O,__setStateId:M,...x}=n;if(b==="_global"){if(!this.globalStateUpdater){j.warn("[handleParentScopeSetState] globalStateUpdater가 설정되지 않았습니다."),k&&l&&l.completeStateChange(k);return}const D=u?.state?.get()||{};if(v){const U=x.value!==void 0?x.value:Object.values(x)[0],z=this.createNestedUpdate(v,U,D),q={...D,...z};j.log(`[handleParentScopeSetState] ${e}: 전역 상태 중첩 경로 업데이트`,q),this.globalStateUpdater(q)}else{const U=d==="deep"?this.deepMergeWithState(x,D):x;j.log(`[handleParentScopeSetState] ${e}: 전역 상태 업데이트 (mergeMode=${d})`,U),this.globalStateUpdater(d!=="deep"?{...U,__mergeMode:d}:U)}return k&&l&&setTimeout(()=>l.completeStateChange(k),0),{__target:e,...x}}else{if(!_.setState){j.warn(`[handleParentScopeSetState] 타겟 컨텍스트에 setState가 없습니다. target=${e}`),k&&l&&l.completeStateChange(k);return}const D=_.state||{};if(v){const U=x.value!==void 0?x.value:Object.values(x)[0],z=this.createNestedUpdate(v,U,D),q={...D,...z};return j.log(`[handleParentScopeSetState] ${e}: 로컬 상태 중첩 경로 업데이트`,z),_.setState(z),_.state=q,_.dataContext&&(_.dataContext._local=q),Id(),k&&l&&setTimeout(()=>l.completeStateChange(k),0),q}else{const U=d!=="deep"?{...x,__mergeMode:d}:x,z=d==="replace"?x:d==="shallow"?{...D,...x}:this.deepMergeWithState(x,D);return j.log(`[handleParentScopeSetState] ${e}: 로컬 상태 업데이트 (mergeMode=${d})`,z),_.setState(U),_.state=z,_.dataContext&&(_.dataContext._local=z),Id(),k&&l&&setTimeout(()=>l.completeStateChange(k),0),z}}}deepMergeWithState(e,n){const a=["errors"];let i=e;if("..."in e){const u=e["..."];if(u&&typeof u=="object"&&!Array.isArray(u)){const{"...":d,...f}=e;i={...u,...f}}else{const{"...":d,...f}=e;i=f}}const l={...n};for(const[u,d]of Object.entries(i)){if(a.includes(u)){l[u]=d;continue}if(u.includes(".")&&u!=="..."){const f=this.createNestedUpdate(u,d,l);this.deepMergeInto(l,f,l);continue}if(d!==null&&typeof d=="object"&&!Array.isArray(d)&&Object.getPrototypeOf(d)!==Object.prototype&&Object.getPrototypeOf(d)!==null){l[u]=d;continue}d!==null&&typeof d=="object"&&!Array.isArray(d)&&n[u]!==null&&typeof n[u]=="object"&&!Array.isArray(n[u])?l[u]=this.deepMergeWithState(d,n[u]):l[u]=d}return l}deepMergeInto(e,n,a){for(const[i,l]of Object.entries(n)){if(l===null){e[i]=l;continue}if(e[i]===null){e[i]=l;continue}typeof l=="object"&&!Array.isArray(l)&&e[i]!==void 0&&e[i]!==null&&typeof e[i]=="object"&&!Array.isArray(e[i])?(e[i]===a[i]&&(e[i]={...e[i]}),this.deepMergeInto(e[i],l,a[i]||{})):typeof l=="object"&&!Array.isArray(l)&&e[i]===void 0&&a[i]!==null&&typeof a[i]=="object"&&!Array.isArray(a[i])?e[i]={...a[i],...l}:e[i]=l}}createNestedUpdate(e,n,a){const i=e.split(".");if(i.length===1)return{[i[0]]:n};const l={};let u=l,d=a;for(let f=0;f<i.length-1;f++){const g=i[f],m=d?.[g],b=m!=null&&typeof m=="object"&&!Array.isArray(m);b?u[g]={...m}:u[g]={},u=u[g],d=b?m:{}}return u[i[i.length-1]]=n,l}buildNestedUpdate(e,n){const a=e.split(".");if(a.length===1)return{[a[0]]:n};const i={};let l=i;for(let u=0;u<a.length-1;u++)l[a[u]]={},l=l[a[u]];return l[a[a.length-1]]=n,i}async handleSetError(e,n,a){let i=e;i=this.resolveValue(i,a.data),this.translationEngine&&this.translationContext&&i.startsWith("$t:")&&(i=this.translationEngine.resolveTranslations(i,this.translationContext,a.data));const l=n?.stateTarget||"local";l==="isolated"&&a.isolatedContext?(a.isolatedContext.mergeState({apiError:i}),j.log("[handleSetError] Error set to isolated state:",i)):l==="global"&&this.globalStateUpdater?(this.globalStateUpdater({apiError:i}),j.log("[handleSetError] Error set to global state:",i)):a.setState?(a.setState({apiError:i}),j.log("[handleSetError] Error set to local state:",i)):j.warn("[handleSetError] Cannot set error: no state updater available")}async handleOpenModal(e,n){if(!this.globalStateUpdater){j.warn("Global state updater is not set for openModal");return}const a=n.data?._global?.modalStack||[];if(a.includes(e)){j.warn(`Modal "${e}" is already open`);return}const i=window.G7Core,l=n.setState&&n.state!==void 0,u=l?void 0:i?.state?.getLocal?.()||{},d=!l&&u!==void 0&&this.globalStateUpdater;if(l||d){const m=window.__g7LayoutContextStack||[],b=l?n.state:u,v=l?n.setState:S=>{this.globalStateUpdater({_local:S})};m.push({state:b,setState:v,dataContext:{_local:b||n.data?._local,_global:l?n.data?._global:n.data?._global||i?.state?.get?.(),_computed:n.data?._computed}}),window.__g7LayoutContextStack=m,j.log(`[handleOpenModal] 레이아웃 컨텍스트 스택에 push, 스택 크기: ${m.length}, state:`,b,l?"(direct)":"(fallback via G7Core)")}else j.warn(`[handleOpenModal] 컨텍스트 스택에 push 실패 - setState: ${!!n.setState}, state: ${n.state!==void 0}, G7Core: ${!!i?.state?.getLocal}`);const f=[...a,e];this.globalStateUpdater({modalStack:f,activeModal:e});const g=Vn();if(g?.isEnabled()){const m=a.length>0?a[a.length-1]:void 0;g.trackModalOpen?.({modalId:e,modalName:e,scopeType:"isolated",parentModalId:m,initialState:n.state?{...n.state}:{}})}}async handleCloseModal(e){if(!this.globalStateUpdater){j.warn("Global state updater is not set for closeModal");return}const n=e?.data?._global?.modalStack||[],a=n.length>0?n[n.length-1]:null,i=n.slice(0,-1),l=i.length>0?i[i.length-1]:null,u=window.__g7LayoutContextStack||[];if(u.length>0){const d=u[u.length-1];d&&(d.dataContext=void 0),u.pop(),window.__g7LayoutContextStack=u,j.log(`[handleCloseModal] 레이아웃 컨텍스트 스택에서 pop, 스택 크기: ${u.length}`)}if(a){const d=Vn();d?.isEnabled()&&d.trackModalClose?.(a,e?.state)}this.globalStateUpdater({modalStack:i,activeModal:l})}async handleShowAlert(e,n){let a=e;this.translationEngine&&this.translationContext&&e.startsWith("$t:")&&(a=this.translationEngine.resolveTranslations(e,this.translationContext,n.data)),alert(a)}async handleToast(e,n){const{type:a="info",message:i,icon:l,duration:u}=e;if(a==="error"){const f=n.data?.error;if((f?.error_code==="identity_verification_required"||f?.data?.error_code==="identity_verification_required")&&Et.consumeDomainNoticeShown()){j.log("[Toast] IDV 도메인 안내 표출됨 — 중복 가드 토스트 1건 skip");return}}let d=i;if(this.translationEngine&&this.translationContext&&i?.startsWith("$t:")&&(d=this.translationEngine.resolveTranslations(i,this.translationContext,n.data)),this.globalStateUpdater){const g={id:`toast_${Date.now()}_${Math.random().toString(36).substring(2,9)}`,type:a,message:d,...l&&{icon:l},...u&&{duration:u}},S=[...window.G7Core?.state?.get()?.toasts||[],g];this.globalStateUpdater({toasts:S})}else j.log(`[Toast ${a}] ${d}`)}async handleSwitch(e,n){const{cases:a}=e;if(!a){j.warn("switch handler requires cases property");return}const i=this.resolveParams(e.params,n.data);let l;if(i?.value!==void 0?(l=i.value,j.log("switch handler: using params.value as case key:",l)):(l=n.data?.$args?.[0],j.log("switch handler: using $args[0] as case key:",l)),l==null){if(a.default)return j.log("switch handler: case key is undefined, using default case"),await this.executeAction(a.default,n);j.warn("switch handler: case key is not defined and no default case");return}const u=String(l);let d=a[u];if(!d&&a.default&&(j.log(`switch handler: no case found for key "${u}", using default case`),d=a.default),!d){j.warn(`switch handler: no case found for key "${u}" and no default case`);return}return await this.executeAction(d,n)}async handleConditions(e,n){const{conditions:a}=e;if(!a||!Array.isArray(a)){j.warn("conditions handler requires conditions array");return}const i=n.data||{},l=fp(a,i,this.bindingEngine);if(!l.matched){j.log("conditions handler: no matching branch found");return}const u=a[l.branchIndex];if(j.log(`conditions handler: matched branch ${l.branchIndex}`),!u.then){j.warn('conditions handler: matched branch has no "then" action');return}return Array.isArray(u.then)?await this.handleSequence({...e,actions:u.then},n):await this.executeAction(u.then,n)}handleStartInterval(e,n){const a=typeof e.id=="string"?e.id:"",i=Number(e.intervalMs??1e3),l=Array.isArray(e.actions)?e.actions:[];if(a===""||!l.length||i<=0)return j.warn("startInterval requires non-empty id, positive intervalMs, and actions array"),{success:!1};const u=this.intervals.get(a);u&&(clearInterval(u),this.intervals.delete(a));const d=setInterval(()=>{for(const f of l)this.executeAction(f,n).catch(g=>{j.error(`[startInterval:${a}] tick action failed`,g)})},i);return this.intervals.set(a,d),{success:!0,id:a}}handleStopInterval(e){const n=typeof e.id=="string"?e.id:"";if(n==="")return j.warn("stopInterval requires id parameter"),{success:!1};const a=this.intervals.get(n);return a&&(clearInterval(a),this.intervals.delete(n)),{success:!0,id:n}}stopAllIntervals(){for(const e of this.intervals.values())clearInterval(e);this.intervals.clear()}async handleSequence(e,n){const a=e.actions||e.params?.actions;if(!a||!Array.isArray(a)||a.length===0)return j.warn("sequence handler requires non-empty actions array"),[];const i=Vn(),l=i?.isEnabled()&&i.startSequenceExecution?.({eventType:e.type})||"";window.__g7SequenceLocalSync=void 0;const u=[];let d,f=n.state?{...n.state}:{},g=n.isolatedContext?.state?{...n.isolatedContext.state}:{},m=n.data?._computed||{};const b=window.G7Core,v=()=>({_global:b?.state?.get()||{},_local:{...f},_isolated:Object.keys(g).length>0?{...g}:void 0});for(let S=0;S<a.length;S++){const _=a[S],A=Date.now();l&&i?.isEnabled()&&i.captureSequenceActionBefore?.(l,S,_.handler||"unknown",_.params||{},v());const k={...n,state:f,data:{...n.data,_local:f,_computed:m,$computed:m,$prev:d,$results:[...u],_isolated:g},isolatedContext:n.isolatedContext?{...n.isolatedContext,state:g}:null};try{const O=await this.executeAction(_,k);if(d=O.data,u.push(O.data),_.handler==="setState"&&O.data!==void 0){if(O.data.__target==="global"){const{__target:x,__mergeMode:D,...U}=O.data;D==="replace"?f={...f,_global:U}:f={...f,_global:{...f._global||{},...U}},j.log("[handleSequence] global state synchronized (mergeMode=%s):",D||"deep",f._global)}else if(O.data.__target==="isolated"){const{__target:x,__mergeMode:D,...U}=O.data;D==="replace"?g=U:g={...g,...U},j.log("[handleSequence] isolated state synchronized (mergeMode=%s):",D||"deep",g)}else if(O.data.__target==="local"){const{__target:x,__mergeMode:D,__setStateId:U,...z}=O.data;D==="replace"?f=z:f={...f,...z},j.log("[handleSequence] local state synchronized (mergeMode=%s):",D||"deep",f)}else f=O.data,j.log("[handleSequence] state synchronized (legacy):",f);const M=n.data?._computedDefinitions;if(M&&Object.keys(M).length>0){const x={},D={...n.data,_local:f,_computed:x,$computed:x,_isolated:g};for(const[U,z]of Object.entries(M))if(typeof z=="string"){const q=z.trim();if(q.startsWith("{{")&&q.endsWith("}}"))try{const X=q.slice(2,-2).trim();x[U]=this.bindingEngine.evaluateExpression(X,D,{skipCache:!0})}catch{x[U]=m[U]}}m=x,j.log("[handleSequence] _computed recalculated after setState:",m)}}if(_.handler!=="setState"){const M=window.__g7SequenceLocalSync;if(M&&M!==f){f=M,window.__g7SequenceLocalSync=void 0,j.log("[handleSequence] currentState synchronized from __g7SequenceLocalSync after custom handler:",_.handler);const x=n.data?._computedDefinitions;if(x&&Object.keys(x).length>0){const D={},U={...n.data,_local:f,_computed:D,$computed:D,_isolated:g};for(const[z,q]of Object.entries(x))if(typeof q=="string"){const X=q.trim();if(X.startsWith("{{")&&X.endsWith("}}"))try{const pe=X.slice(2,-2).trim();D[z]=this.bindingEngine.evaluateExpression(pe,U,{skipCache:!0})}catch{D[z]=m[z]}}m=D,j.log("[handleSequence] _computed recalculated after custom handler:",m)}}}l&&i?.isEnabled()&&i.captureSequenceActionAfter?.(l,S,v(),Date.now()-A,O.data)}catch(O){throw l&&i?.isEnabled()&&(i.captureSequenceActionAfter?.(l,S,v(),Date.now()-A,void 0,O),i.endSequenceExecution?.(l,O)),j.error(`sequence handler: action[${S}] failed:`,O),O}}return window.__g7SequenceLocalSync=void 0,l&&i?.isEnabled()&&i.endSequenceExecution?.(l),u}async handleParallel(e,n){const a=e.actions||e.params?.actions;if(!a||!Array.isArray(a)||a.length===0)return j.warn("parallel handler requires non-empty actions array"),[];j.log(`parallel handler: executing ${a.length} actions in parallel`);const i=n.isolatedContext?{...n.isolatedContext,state:{...n.isolatedContext.state}}:null,l=a.map((f,g)=>{const m={...n,isolatedContext:i};return this.executeAction(f,m).catch(b=>{throw j.error(`parallel handler: action[${g}] failed:`,b),b})}),u=await Promise.allSettled(l),d=u.filter(f=>f.status==="rejected").length;return d>0&&j.warn(`parallel handler: ${d}/${a.length} actions failed`),u}async handleLoadScript(e,n,a){const{src:i,id:l,async:u=!0,defer:d=!1}=e;if(!i)throw new jt('loadScript handler requires "src" parameter',n);const f=l||`script_${i.replace(/[^a-zA-Z0-9]/g,"_")}`;return gs.loadedScripts.has(f)?(j.log(`loadScript: script already loaded, skipping: ${f}`),n.onLoad&&await this.executeAction(n.onLoad,a),!0):document.getElementById(f)?(j.log(`loadScript: script element already exists: ${f}`),gs.loadedScripts.add(f),n.onLoad&&await this.executeAction(n.onLoad,a),!0):(j.log(`loadScript: loading script: ${i}`),new Promise((m,b)=>{const v=document.createElement("script");v.id=f,v.src=i,v.async=u,v.defer=d,v.onload=async()=>{if(j.log(`loadScript: script loaded successfully: ${f}`),gs.loadedScripts.add(f),n.onLoad)try{await this.executeAction(n.onLoad,a)}catch(S){j.error("loadScript: onLoad action failed:",S)}m(!0)},v.onerror=S=>{j.error(`loadScript: failed to load script: ${i}`,S),b(new jt(`Failed to load script: ${i}`,n))},document.head.appendChild(v)}))}async handleCallExternal(e,n,a){const i=e.constructor,l=e.args||{},u=e.method,d=e.methodArgs||[],f=e.callbackEvent,g=e.embedTarget,m=e.callbackSetState,b=e.callbackAction;if(!i)throw new jt('callExternal handler requires "constructor" parameter',n);const v=this.getNestedProperty(window,i);if(!v||typeof v!="function")throw new jt(`Constructor not found or not a function: ${i}. Make sure the script is loaded first using loadScript handler.`,n);j.log(`callExternal: calling constructor ${i}`);const S={...l};for(const[A,k]of Object.entries(l))k===!0&&(S[A]=O=>{if(j.log(`callExternal: callback triggered for ${A}`,O),f&&typeof window<"u"&&window.G7Core?.componentEvent&&window.G7Core.componentEvent.emit(f,O),m&&a.setState){const M=U=>{const z={};for(const[q,X]of Object.entries(U))typeof X=="string"?z[q]=this.getNestedProperty(O,X):typeof X=="object"&&X!==null&&(z[q]=M(X));return z},x=M(m);j.log("callExternal: callbackSetState mapping result",x);const D=this.deepMergeWithState(x,a.state||{});j.log("callExternal: merged with existing state",D),a.setState(D)}else f&&a.setState&&a.setState({[`${f.replace(/:/g,"_")}_result`]:O});if(b){const M={...a,data:{...a.data,$event:O}},x=Array.isArray(b)?b:[b];for(const D of x)try{this.executeAction(D,M)}catch(U){j.error("callExternal: callbackAction failed:",U)}}});const _=new v(S);if(u&&typeof _[u]=="function"){if(j.log(`callExternal: calling method ${u}`),u==="embed"&&g){const A=document.querySelector(g);if(A)return _[u](A,...d);throw new jt(`Embed target element not found: ${g}`,n)}return _[u](...d)}return _}async handleCallExternalEmbed(e,n,a){const i=e.constructor,l=e.args||{},u=e.callbackSetState,d=e.callbackEvent,f=e.layerClassName,g=e.callbackAction;if(!i)throw new jt('callExternalEmbed handler requires "constructor" parameter',n);const m=this.getNestedProperty(window,i);if(!m||typeof m!="function")throw new jt(`Constructor not found or not a function: ${i}. Make sure the script is loaded first.`,n);j.log(`callExternalEmbed: creating layer for ${i}`);const{layer:b,closeLayer:v}=this.createEmbedLayer(f),S={...l};for(const[A,k]of Object.entries(l))k===!0&&(S[A]=O=>{if(j.log(`callExternalEmbed: callback triggered for ${A}`,O),v(),d&&typeof window<"u"&&window.G7Core?.componentEvent&&window.G7Core.componentEvent.emit(d,O),u&&a.setState){const M=U=>{const z={};for(const[q,X]of Object.entries(U))typeof X=="string"?z[q]=this.getNestedProperty(O,X):typeof X=="object"&&X!==null&&(z[q]=M(X));return z},x=M(u);j.log("callExternalEmbed: callbackSetState mapping result",x);const D=this.deepMergeWithState(x,a.state||{});j.log("callExternalEmbed: merged with existing state",D),a.setState(D)}if(g){const M={...a,data:{...a.data,$event:O}},x=Array.isArray(g)?g:[g];for(const D of x)try{this.executeAction(D,M)}catch(U){j.error("callExternalEmbed: callbackAction failed:",U)}}});const _=new m(S);if(typeof _.embed=="function")_.embed(b),j.log("callExternalEmbed: embedded in layer");else throw v(),new jt(`Constructor ${i} does not have embed method`,n);return _}isImeComposing(e){return e?.isComposing===!0||e?.keyCode===229}createEmbedLayer(e){const n=document.createElement("div");n.id="g7-embed-overlay",n.style.cssText=`
position: fixed;
inset: 0;
background-color: rgba(0, 0, 0, 0.5);
z-index: 9999;
display: flex;
align-items: center;
justify-content: center;
`;const a=document.createElement("div");a.id="g7-embed-layer",a.style.cssText=`
position: relative;
background: white;
border-radius: 8px;
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
max-width: 90vw;
max-height: 90vh;
overflow: hidden;
`,e&&(a.className=e);const i=document.createElement("button");i.type="button",i.innerHTML="×",i.style.cssText=`
position: absolute;
top: 8px;
right: 8px;
width: 32px;
height: 32px;
border: none;
background: rgba(0, 0, 0, 0.1);
border-radius: 50%;
font-size: 20px;
cursor: pointer;
z-index: 10;
display: flex;
align-items: center;
justify-content: center;
color: #666;
transition: background-color 0.2s;
`,i.onmouseenter=()=>{i.style.backgroundColor="rgba(0, 0, 0, 0.2)"},i.onmouseleave=()=>{i.style.backgroundColor="rgba(0, 0, 0, 0.1)"};const l=()=>{n.parentNode&&n.parentNode.removeChild(n)};i.onclick=l;const u=d=>{this.isImeComposing(d)||d.key==="Escape"&&(l(),document.removeEventListener("keydown",u))};return document.addEventListener("keydown",u),n.onclick=d=>{d.target===n&&l()},a.appendChild(i),n.appendChild(a),document.body.appendChild(n),{overlay:n,layer:a,closeLayer:l}}getNestedProperty(e,n){return n.split(".").reduce((a,i)=>a&&a[i]!==void 0?a[i]:void 0,e)}async handleSaveToLocalStorage(e,n){const{key:a,value:i}=e;if(!a)return j.error("saveToLocalStorage: key parameter is required"),!1;try{const l=typeof i=="string"?i:JSON.stringify(i);return localStorage.setItem(a,l),j.log(`saveToLocalStorage: saved ${a}`,i),!0}catch(l){return j.error("saveToLocalStorage: failed to save",{key:a,error:l}),!1}}async handleLoadFromLocalStorage(e,n){const{key:a,target:i,stateKey:l,defaultValue:u}=e;if(!a)return j.error("loadFromLocalStorage: key parameter is required"),u;try{const d=localStorage.getItem(a);if(d===null)return j.log(`loadFromLocalStorage: no value found for ${a}, using default`),l&&n.setState&&n.setState({[l]:u}),u;let f;try{f=JSON.parse(d)}catch{f=d}return j.log(`loadFromLocalStorage: loaded ${a}`,f),l&&n.setState&&n.setState({[l]:f}),f}catch(d){return j.error("loadFromLocalStorage: failed to load",{key:a,error:d}),u}}async handleCustomAction(e,n){const a=this.customHandlers.get(e.handler);if(!a){if(this.previewMode){j.warn(`[Preview] Unknown action handler "${e.handler}" — skipped (preview mode)`);return}const i=new jt(`Unknown action handler: ${e.handler}`,e);throw i.unknownHandler=!0,i}return await a(e,n)}resolveParams(e,n){if(!e)return{};const a={};for(const[i,l]of Object.entries(e))i.includes("{{")&&j.warn(`[resolveParams] setState params의 키에 표현식이 포함되어 있습니다: "${i}". 키는 해석되지 않습니다. 배열 항목 수정은 .map()/.filter() 패턴을 사용하세요.`),typeof l=="string"&&l.includes("{{")?a[i]=this.evaluateExpression(l,n):typeof l=="string"?a[i]=l:Array.isArray(l)?a[i]=l.map(u=>typeof u=="string"&&u.includes("{{")?this.evaluateExpression(u,n):u):typeof l=="object"&&l!==null&&!Array.isArray(l)&&Object.getPrototypeOf(l)!==Object.prototype&&Object.getPrototypeOf(l)!==null?a[i]=l:typeof l=="object"&&l!==null?a[i]=this.resolveParams(l,n):a[i]=l;return a}resolveValue(e,n){return n?this.bindingEngine.resolveBindings(e,n,{skipCache:!0}):e}evaluateExpressions(e,n){let a={};for(const[i,l]of Object.entries(e))if(i==="..."){let u=l;typeof l=="string"&&l.includes("{{")&&(u=this.evaluateExpression(l,n)),u&&typeof u=="object"&&!Array.isArray(u)&&(a={...a,...u})}else typeof l=="string"&&l.includes("{{")?a[i]=this.evaluateExpression(l,n):typeof l=="object"&&l!==null&&!Array.isArray(l)?a[i]=this.evaluateExpressions(l,n):a[i]=l;return a}evaluateExpressionsIfNeeded(e,n){const a={};for(const[i,l]of Object.entries(e))typeof l=="string"&&l.includes("{{")?a[i]=this.evaluateExpression(l,n):a[i]=l;return a}evaluateExpression(e,n){if(!n)return e;const a=e.match(/^\{\{(.+)\}\}$/);if(!(a&&!a[1].includes("}}")&&!a[1].includes("{{"))){let d=n;if(e.includes("_global")){const g=window.G7Core?.state?.get()?._global;g&&(d={...n,_global:g})}if(e.includes("_computed")||e.includes("$computed")){const g=window.__g7ActionContext?.computedRef?.current;g&&Object.keys(g).length>0&&(d={...d,_computed:g,$computed:g})}return this.bindingEngine.resolveBindings(e,d,{skipCache:!0})}let l=a[1].trim();l=l.replace(/\$args\.(\d+)/g,"$args[$1]");let u=n;if(l.includes("_global")){const f=window.G7Core?.state?.get()?._global;f&&(u={...n,_global:f})}if(l.includes("_computed")||l.includes("$computed")){const f=window.__g7ActionContext?.computedRef?.current;f&&Object.keys(f).length>0&&(u={...u,_computed:f,$computed:f})}l.includes("_global.modules")&&(j.log("[evaluateExpression] expression:",l),j.log("[evaluateExpression] dataContext._global:",u._global),j.log("[evaluateExpression] dataContext._global?.modules:",u._global?.modules));try{const d=this.bindingEngine.evaluateExpression(l,u);return l.includes("_global.modules")&&j.log("[evaluateExpression] result:",d),typeof d=="string"&&d.startsWith("$t:")&&this.translationEngine&&this.translationContext?this.translationEngine.resolveTranslations(d,this.translationContext,n):d}catch(d){return j.error("Expression evaluation failed:",e,d),e}}setDefaultContext(e){this.defaultContext={...this.defaultContext,...e}}setGlobalStateUpdater(e){this.globalStateUpdater=e}getGlobalStateUpdater(){return this.globalStateUpdater}async dispatchAction(e,n){const a={...this.defaultContext,...n,data:{...this.defaultContext.data,...n?.data}};if(e.confirm){let i=this.resolveValue(e.confirm,a.data);if(this.translationEngine&&this.translationContext&&i.startsWith("$t:")&&(i=this.translationEngine.resolveTranslations(i,this.translationContext,a.data)),!confirm(i))return{success:!1}}try{return await this.executeAction(e,a)}catch(i){if(j.error("dispatchAction failed:",i),e.onError){const l=i instanceof jt&&i.originalError?{message:i.originalError.message,response:i.originalError.response}:{message:i instanceof Error?i.message:String(i)},u={...a,data:{...a.data,error:l}},d=Array.isArray(e.onError)?e.onError:[e.onError];for(const f of d)await this.executeAction(f,u)}return{success:!1,error:i instanceof Error?i:new Error(String(i))}}}registerHandler(e,n,a){this.customHandlers.set(e,n);const i=Vn();i?.isEnabled()&&i.trackHandlerRegistration(e,a?.category??"custom",a?.description,a?.source)}unregisterHandler(e){this.customHandlers.delete(e);const n=Vn();n?.isEnabled()&&n.trackHandlerUnregistration(e)}getRegisteredHandlers(){return Array.from(this.customHandlers.keys())}getHandler(e){return this.customHandlers.get(e)}normalizeDebounceConfig(e){return typeof e=="number"?{delay:e,leading:!1,trailing:!0}:{delay:e.delay,leading:e.leading??!1,trailing:e.trailing??!0}}extractEventData(e){const n=e.target;if(n&&!("tagName"in n)){const l={type:e.type??"custom",target:{value:n.value,name:n.name??""}};return e._changedKeys&&(l._changedKeys=e._changedKeys),l}const i=n?{value:n.value,name:n.name??"",checked:n.checked??!1,type:n.type??"",tagName:n.tagName}:{};if(e.type==="scroll"&&n){const l=n;i.scrollHeight=l.scrollHeight??0,i.scrollTop=l.scrollTop??0,i.clientHeight=l.clientHeight??0,i.scrollLeft=l.scrollLeft??0,i.clientWidth=l.clientWidth??0,i.scrollWidth=l.scrollWidth??0}return{type:e.type,target:n?i:null}}executeDebouncedAction(e,n,a,i,l){const u={...a,$event:n,$args:l},d={type:n.type,target:n.target,preventDefault:()=>{},stopPropagation:()=>{}};this.createHandler(e,u,i)(d)}handleDebouncedAction(e,n,a,i,l,u){const d=this.normalizeDebounceConfig(e.debounce),f=l||`default-${e.handler}-${Date.now()}`,g=this.extractEventData(n),m=g._changedKeys;if(m&&Array.isArray(m)&&g?.target?.value&&typeof g.target.value=="object"&&!Array.isArray(g.target.value)){const _=this.debounceAccumulatedValues.get(f);if(_){const A={..._};for(const k of m)A[k]=g.target.value[k];g.target.value=A}this.debounceAccumulatedValues.set(f,g.target.value)}const b=this.debounceTimers.get(f);b&&(clearTimeout(b),this.debounceTimers.delete(f));const v=Vn();v?.isEnabled()&&v.trackAction({handler:typeof e.handler=="string"?e.handler:String(e.handler),type:e.type,status:"pending",params:e.params,debounce:{delay:d.delay,status:"pending",scheduledAt:Date.now()}});const S=!this.debounceTimers.has(f+"_leading");if(d.leading&&S&&(this.debounceTimers.set(f+"_leading",setTimeout(()=>{},0)),this.executeDebouncedAction(e,g,a,i,u),v?.isEnabled()&&v.trackAction({handler:typeof e.handler=="string"?e.handler:String(e.handler),type:e.type,status:"success",params:e.params,debounce:{delay:d.delay,status:"executed",executedAt:Date.now(),mode:"leading"}})),d.trailing){const _=()=>{this.executeDebouncedAction(e,g,a,i,u),v?.isEnabled()&&v.trackAction({handler:typeof e.handler=="string"?e.handler:String(e.handler),type:e.type,status:"success",params:e.params,debounce:{delay:d.delay,status:"executed",executedAt:Date.now(),mode:"trailing"}})},A=setTimeout(()=>{this.debounceTimers.delete(f),this.debounceTimers.delete(f+"_leading"),this.pendingDebounceFlushers.delete(f),this.debounceAccumulatedValues.delete(f),_()},d.delay);this.debounceTimers.set(f,A),this.pendingDebounceFlushers.set(f,_)}}clearDebounceTimers(e){if(e)for(const[n,a]of this.debounceTimers)n.startsWith(e+"-")&&(clearTimeout(a),this.debounceTimers.delete(n),this.pendingDebounceFlushers.delete(n),this.debounceAccumulatedValues.delete(n));else{for(const n of this.debounceTimers.values())clearTimeout(n);this.debounceTimers.clear(),this.pendingDebounceFlushers.clear(),this.debounceAccumulatedValues.clear()}}debouncedCall(e,n,a){const i=this.debounceTimers.get(e);i&&(clearTimeout(i),this.debounceTimers.delete(e));const l=setTimeout(()=>{this.debounceTimers.delete(e),this.pendingDebounceFlushers.delete(e),a()},n);this.debounceTimers.set(e,l),this.pendingDebounceFlushers.set(e,a)}flushPendingDebounceTimers(){if(this.pendingDebounceFlushers.size===0)return;const e=new Map(this.pendingDebounceFlushers);for(const[n,a]of e){const i=this.debounceTimers.get(n);i&&(clearTimeout(i),this.debounceTimers.delete(n)),this.debounceTimers.delete(n+"_leading"),this.pendingDebounceFlushers.delete(n),a()}this.globalStateUpdater&&this.globalStateUpdater({})}bindActionsToProps(e,n,a){const i={...e};if(e.actions&&Array.isArray(e.actions)){const l=new Map;for(const m of e.actions){const b=this.resolveActionRef(m),v=b.event||this.getEventHandlerName(b.type);l.has(v)||l.set(v,[]),l.get(v).push(b)}const u=e.name||e.id||"unknown",d=l.has("onDrop"),f=l.has("onDragOver"),g=l.has("onDragEnter");d&&!f&&(i.onDragOver=m=>{m.preventDefault()}),d&&!g&&(i.onDragEnter=m=>{m.preventDefault()});for(const[m,b]of l)i[m]=(...v)=>{for(const S of b){const _=v[0],A=_&&typeof _=="object"&&"preventDefault"in _;if(A&&(m==="onDragOver"||m==="onDrop")&&_.preventDefault(),A&&S.key&&"key"in _){if(this.isImeComposing(_)){j.log("Key filter skipped (IME composing):",S.key);continue}if(_.key!==S.key){j.log("Key filter not matched:",S.key,"actual:",_.key);continue}j.log("Key filter matched:",S.key)}if(S.debounce){const k=`${u}-${S.handler}-${m}`,O=_&&typeof _=="object"&&!("preventDefault"in _)&&"target"in _&&_.target!==null;let M;if(A)M=_;else if(O){const D={type:"custom",target:_.target,preventDefault:()=>{},stopPropagation:()=>{}};_._changedKeys&&(D._changedKeys=_._changedKeys),M=D}else M=new Event("custom");const x=S.event?{...n,$args:v}:n;this.handleDebouncedAction(S,M,x,a,k,v)}else if(this.flushPendingDebounceTimers(),S.event){const k={...n,$args:v},O=A?_:new Event("custom");this.createHandler(S,k,a)(O)}else if(A)this.createHandler(S,n,a)(_);else if(_&&typeof _=="object"&&!("preventDefault"in _)&&"target"in _&&_.target!==null){const O={type:"custom",target:_.target,preventDefault:()=>{},stopPropagation:()=>{}};this.createHandler(S,n,a)(O)}}}}return i}getEventHandlerName(e){return{click:"onClick",change:"onChange",input:"onInput",submit:"onSubmit",focus:"onFocus",blur:"onBlur",keydown:"onKeyDown",keyup:"onKeyUp",keypress:"onKeyPress",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",scroll:"onScroll",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",dragenter:"onDragEnter",dragover:"onDragOver",dragleave:"onDragLeave",drop:"onDrop"}[e]||`on${e.charAt(0).toUpperCase()}${e.slice(1)}`}sanitizeForDevTools(e,n=5){const a=new WeakSet,i=(l,u)=>{if(l==null||typeof l=="string"||typeof l=="number"||typeof l=="boolean")return l;if(u>n)return"[Max Depth Exceeded]";if(typeof l=="function")return`[Function: ${l.name||"anonymous"}]`;if(l instanceof Element)return`[Element: ${l.tagName}${l.className?"."+l.className.split(" ").join("."):""}]`;if(l instanceof Event)return`[Event: ${l.type}]`;if(Array.isArray(l)){if(a.has(l))return"[Circular Array]";a.add(l);const d=l.slice(0,10).map(f=>i(f,u+1));return l.length>10&&d.push(`... ${l.length-10} more items`),d}if(typeof l=="object"){if(a.has(l))return"[Circular Reference]";a.add(l);const d={},f=Object.keys(l),g=f.slice(0,20);for(const m of g)try{d[m]=i(l[m],u+1)}catch{d[m]="[Error accessing property]"}return f.length>20&&(d["..."]=`${f.length-20} more properties`),d}return String(l)};return i(e,0)}};$(gs,"loadedScripts",new Set);let fo=gs,Jl=null;function um(o){return Jl||(Jl=new fo(o)),Jl}function yC(o){Jl=o}const dm=ft("TransitionManager");class bC{constructor(){$(this,"isPending",!1);$(this,"subscribers",new Set)}setPending(e){this.isPending!==e&&(dm.log("setPending:",{from:this.isPending,to:e,stack:new Error().stack}),this.isPending=e,this.notifySubscribers())}getIsPending(){return this.isPending}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}notifySubscribers(){dm.log("notifySubscribers:",{isPending:this.isPending,subscriberCount:this.subscribers.size}),this.subscribers.forEach(e=>{e(this.isPending)})}clearSubscribers(){this.subscribers.clear()}}const Hr=new bC,Ql=ft("TransitionContext"),fm=H.createContext({isTransitioning:!1}),Hd=({children:o})=>{const[e,n]=H.useState(()=>{const i=Hr.getIsPending();return Ql.log("Initial state:",i),i});H.useEffect(()=>{Ql.log("Subscribing to TransitionManager");const i=Hr.subscribe(l=>{Ql.log("Received isPending update:",l),n(l)});return()=>{Ql.log("Unsubscribing from TransitionManager"),i()}},[]);const a=H.useMemo(()=>({isTransitioning:e}),[e]);return ht.jsx(fm.Provider,{value:a,children:o})},hm=()=>H.useContext(fm),Zl="__g7LocalInitTracking";function zd(){const o=globalThis;return o[Zl]||(o[Zl]={hash:"",timestamp:void 0,consumed:void 0}),o[Zl]}function vC(){const o=globalThis;o[Zl]={hash:"",timestamp:void 0,consumed:void 0}}function SC(o){zd().consumed=o}function wC(o){return zd().consumed===o}function CC(o){return o.globalTrackedKey!==o.trackingKey?"apply":o.instanceHandledKey===o.trackingKey?"skip":"prune"}function EC(o,e){return typeof o=="number"&&typeof e=="number"?Math.max(o,e):e??o}function _C(o,e){if(e===void 0)return o;if(!(o!==null&&typeof o=="object"&&e!==null&&typeof e=="object"&&!wC(o)))return e;const{_forceLocalInit:a,...i}=o,{_forceLocalInit:l,...u}=e,d={...i,...u},f=EC(a,l);return f!==void 0&&(d._forceLocalInit=f),d}function AC(o){return o<768?"mobile":o<1024?"tablet":"desktop"}function gm(o){const e=AC(o);return{width:o,isMobile:e==="mobile",isTablet:e==="tablet",isDesktop:e==="desktop",matchedPreset:e}}const jd=H.createContext(gm(1024)),ec=({children:o,overrideWidth:e})=>{const[n,a]=H.useState(()=>ci.getWidth());H.useEffect(()=>{const u=ci.subscribe(d=>{a(d)});return()=>{u()}},[]);const i=e??n,l=H.useMemo(()=>gm(i),[i]);return ht.jsx(jd.Provider,{value:l,children:o})},Ud=()=>H.useContext(jd);window.G7Core?.createLogger?.("Core:State");function xC(o,e,n,a){const{syncOnControlledChange:i=!0,isEqual:l}=a??{},u=o!==void 0;H.useRef(u);const[d,f]=H.useState(o!==void 0?o:e),g=d,m=H.useRef(o),b=H.useRef(!1);H.useEffect(()=>{if(b.current){m.current=o;return}i&&u&&o!==m.current&&(l?!l(d,o):d!==o)&&f(o),m.current=o},[o,u,i,l,d]);const v=H.useCallback(S=>{const _=typeof S=="function"?S(g):S;(l?l(g,_):g===_)||(b.current=!0,f(_),n?.(_),requestAnimationFrame(()=>{b.current=!1}))},[g,u,n,l]);return[g,v]}function TC(o,e){return o===e?!0:o.length!==e.length?!1:o.every((n,a)=>n===e[a])}function pm(o,e){if(o===e)return!0;const n=Object.keys(o),a=Object.keys(e);return n.length!==a.length?!1:n.every(i=>o[i]===e[i])}const mm=H.createContext({}),RC=({children:o,value:e})=>ht.jsx(mm.Provider,{value:e,children:o}),kC=()=>H.useContext(mm),DC=(o,e)=>{if(!o)return;const n=e.split(".");let a=o;for(const i of n){if(a==null)return;a=a[i]}return a},OC=(o,e,n)=>{const a=e.split(".");if(a.length===1)return{...o,[a[0]]:n};const i={...o};let l=i;for(let u=0;u<a.length-1;u++){const d=a[u],f=a[u+1],g=/^\d+$/.test(f);Array.isArray(l[d])&&!g?l[d]={...l[d]}:Array.isArray(l[d])?l[d]=[...l[d]]:g?l[d]=Array.isArray(l[d])?[...l[d]]:[]:l[d]={...l[d]||{}},l=l[d]}return l[a[a.length-1]]=n,i},ss=ft("IsolatedStateContext"),LC={state:{},setState:()=>{ss.warn("IsolatedStateContext not available: setState called outside IsolatedStateProvider")},getState:()=>{},mergeState:()=>{ss.warn("IsolatedStateContext not available: mergeState called outside IsolatedStateProvider")},stateRef:{current:{}},scopeId:""},ym=H.createContext(LC);let MC=0;function $C(){return`isolated-${++MC}-${Date.now().toString(36)}`}function bm(o,e){if(e==null)return o;if(typeof e!="object"||Array.isArray(e))return e;const n={...o};for(const a of Object.keys(e)){const i=e[a],l=o?.[a];i!==null&&typeof i=="object"&&!Array.isArray(i)&&l!==null&&typeof l=="object"&&!Array.isArray(l)?n[a]=bm(l,i):n[a]=i}return n}function NC(o,e){return e?e.split(".").reduce((n,a)=>n?.[a],o):o}function IC(o,e,n){const a=e.split("."),i={...o};let l=i;for(let u=0;u<a.length-1;u++){const d=a[u];l[d]={...l[d]},l=l[d]}return l[a[a.length-1]]=n,i}const HC=({initialState:o={},scopeId:e,children:n})=>{const i=H.useRef(e||$C()).current,[l,u]=H.useState(o),d=H.useRef(l);d.current=l;const f=H.useCallback(S=>NC(d.current,S),[]),g=H.useCallback((S,_)=>{u(A=>{const k=IC(A,S,_);return ss.log(`[${i}] setState: ${S} =`,_),k})},[i]),m=H.useCallback((S,_="deep")=>{u(A=>{let k;return _==="replace"?k=S:_==="shallow"?k={...A,...S}:k=bm(A,S),ss.log(`[${i}] mergeState (${_}):`,S),k})},[i]),b=H.useMemo(()=>({state:l,setState:g,getState:f,mergeState:m,stateRef:d,scopeId:i}),[l,g,f,m,i]),v=H.useMemo(()=>({state:d.current,setState:g,getState:f,mergeState:m}),[g,f,m]);return H.useEffect(()=>{const S=window.G7Core,_=window.__g7IsolatedStates||{};return window.__g7IsolatedStates||(window.__g7IsolatedStates=_),_[i]=v,S&&(S._isolatedStates||(S._isolatedStates={}),S._isolatedStates[i]=l),S?.devTools?.isEnabled?.()&&S.devTools.emit?.("isolated:created",{id:i,state:l}),ss.log(`[${i}] IsolatedStateProvider mounted with initial state:`,l),()=>{delete _[i],S?._isolatedStates&&delete S._isolatedStates[i],S?.devTools?.isEnabled?.()&&S.devTools.emit?.("isolated:destroyed",{id:i}),ss.log(`[${i}] IsolatedStateProvider unmounted`)}},[i,v]),H.useEffect(()=>{const S=window.G7Core,_=window.__g7IsolatedStates;_?.[i]&&(_[i].state=l),S?._isolatedStates&&(S._isolatedStates[i]=l),S?.devTools?.isEnabled?.()&&S.devTools.emit?.("isolated:updated",{id:i,state:l})},[l,i]),ht.jsx(ym.Provider,{value:b,children:n})},zC=()=>{const o=H.useContext(ym);return o.scopeId?o:null};var Aa=Gg();function jC(){for(var o=arguments.length,e=new Array(o),n=0;n<o;n++)e[n]=arguments[n];return H.useMemo(()=>a=>{e.forEach(i=>i(a))},e)}const tc=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function os(o){const e=Object.prototype.toString.call(o);return e==="[object Window]"||e==="[object global]"}function Bd(o){return"nodeType"in o}function Nn(o){var e,n;return o?os(o)?o:Bd(o)&&(e=(n=o.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function Pd(o){const{Document:e}=Nn(o);return o instanceof e}function ho(o){return os(o)?!1:o instanceof Nn(o).HTMLElement}function vm(o){return o instanceof Nn(o).SVGElement}function ls(o){return o?os(o)?o.document:Bd(o)?Pd(o)?o:ho(o)||vm(o)?o.ownerDocument:document:document:document}const zr=tc?H.useLayoutEffect:H.useEffect;function qd(o){const e=H.useRef(o);return zr(()=>{e.current=o}),H.useCallback(function(){for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return e.current==null?void 0:e.current(...a)},[])}function UC(){const o=H.useRef(null),e=H.useCallback((a,i)=>{o.current=setInterval(a,i)},[]),n=H.useCallback(()=>{o.current!==null&&(clearInterval(o.current),o.current=null)},[]);return[e,n]}function go(o,e){e===void 0&&(e=[o]);const n=H.useRef(o);return zr(()=>{n.current!==o&&(n.current=o)},e),n}function po(o,e){const n=H.useRef();return H.useMemo(()=>{const a=o(n.current);return n.current=a,a},[...e])}function nc(o){const e=qd(o),n=H.useRef(null),a=H.useCallback(i=>{i!==n.current&&e?.(i,n.current),n.current=i},[]);return[n,a]}function Gd(o){const e=H.useRef();return H.useEffect(()=>{e.current=o},[o]),e.current}let Vd={};function mo(o,e){return H.useMemo(()=>{if(e)return e;const n=Vd[o]==null?0:Vd[o]+1;return Vd[o]=n,o+"-"+n},[o,e])}function Sm(o){return function(e){for(var n=arguments.length,a=new Array(n>1?n-1:0),i=1;i<n;i++)a[i-1]=arguments[i];return a.reduce((l,u)=>{const d=Object.entries(u);for(const[f,g]of d){const m=l[f];m!=null&&(l[f]=m+o*g)}return l},{...e})}}const cs=Sm(1),yo=Sm(-1);function BC(o){return"clientX"in o&&"clientY"in o}function Fd(o){if(!o)return!1;const{KeyboardEvent:e}=Nn(o.target);return e&&o instanceof e}function PC(o){if(!o)return!1;const{TouchEvent:e}=Nn(o.target);return e&&o instanceof e}function Kd(o){if(PC(o)){if(o.touches&&o.touches.length){const{clientX:e,clientY:n}=o.touches[0];return{x:e,y:n}}else if(o.changedTouches&&o.changedTouches.length){const{clientX:e,clientY:n}=o.changedTouches[0];return{x:e,y:n}}}return BC(o)?{x:o.clientX,y:o.clientY}:null}const bo=Object.freeze({Translate:{toString(o){if(!o)return;const{x:e,y:n}=o;return"translate3d("+(e?Math.round(e):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(o){if(!o)return;const{scaleX:e,scaleY:n}=o;return"scaleX("+e+") scaleY("+n+")"}},Transform:{toString(o){if(o)return[bo.Translate.toString(o),bo.Scale.toString(o)].join(" ")}},Transition:{toString(o){let{property:e,duration:n,easing:a}=o;return e+" "+n+"ms "+a}}}),wm="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function qC(o){return o.matches(wm)?o:o.querySelector(wm)}const GC={display:"none"};function VC(o){let{id:e,value:n}=o;return Xe.createElement("div",{id:e,style:GC},n)}function FC(o){let{id:e,announcement:n,ariaLiveType:a="assertive"}=o;const i={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Xe.createElement("div",{id:e,style:i,role:"status","aria-live":a,"aria-atomic":!0},n)}function KC(){const[o,e]=H.useState("");return{announce:H.useCallback(a=>{a!=null&&e(a)},[]),announcement:o}}const Cm=H.createContext(null);function WC(o){const e=H.useContext(Cm);H.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(o)},[o,e])}function YC(){const[o]=H.useState(()=>new Set),e=H.useCallback(a=>(o.add(a),()=>o.delete(a)),[o]);return[H.useCallback(a=>{let{type:i,event:l}=a;o.forEach(u=>{var d;return(d=u[i])==null?void 0:d.call(u,l)})},[o]),e]}const XC={draggable:`
To pick up a draggable item, press the space bar.
While dragging, use the arrow keys to move the item.
Press space again to drop the item in its new position, or press escape to cancel.
`},JC={onDragStart(o){let{active:e}=o;return"Picked up draggable item "+e.id+"."},onDragOver(o){let{active:e,over:n}=o;return n?"Draggable item "+e.id+" was moved over droppable area "+n.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(o){let{active:e,over:n}=o;return n?"Draggable item "+e.id+" was dropped over droppable area "+n.id:"Draggable item "+e.id+" was dropped."},onDragCancel(o){let{active:e}=o;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function QC(o){let{announcements:e=JC,container:n,hiddenTextDescribedById:a,screenReaderInstructions:i=XC}=o;const{announce:l,announcement:u}=KC(),d=mo("DndLiveRegion"),[f,g]=H.useState(!1);if(H.useEffect(()=>{g(!0)},[]),WC(H.useMemo(()=>({onDragStart(b){let{active:v}=b;l(e.onDragStart({active:v}))},onDragMove(b){let{active:v,over:S}=b;e.onDragMove&&l(e.onDragMove({active:v,over:S}))},onDragOver(b){let{active:v,over:S}=b;l(e.onDragOver({active:v,over:S}))},onDragEnd(b){let{active:v,over:S}=b;l(e.onDragEnd({active:v,over:S}))},onDragCancel(b){let{active:v,over:S}=b;l(e.onDragCancel({active:v,over:S}))}}),[l,e])),!f)return null;const m=Xe.createElement(Xe.Fragment,null,Xe.createElement(VC,{id:a,value:i.draggable}),Xe.createElement(FC,{id:d,announcement:u}));return n?Aa.createPortal(m,n):m}var tn;(function(o){o.DragStart="dragStart",o.DragMove="dragMove",o.DragEnd="dragEnd",o.DragCancel="dragCancel",o.DragOver="dragOver",o.RegisterDroppable="registerDroppable",o.SetDroppableDisabled="setDroppableDisabled",o.UnregisterDroppable="unregisterDroppable"})(tn||(tn={}));function rc(){}function Em(o,e){return H.useMemo(()=>({sensor:o,options:e??{}}),[o,e])}function ZC(){for(var o=arguments.length,e=new Array(o),n=0;n<o;n++)e[n]=arguments[n];return H.useMemo(()=>[...e].filter(a=>a!=null),[...e])}const br=Object.freeze({x:0,y:0});function _m(o,e){return Math.sqrt(Math.pow(o.x-e.x,2)+Math.pow(o.y-e.y,2))}function Am(o,e){let{data:{value:n}}=o,{data:{value:a}}=e;return n-a}function eE(o,e){let{data:{value:n}}=o,{data:{value:a}}=e;return a-n}function xm(o){let{left:e,top:n,height:a,width:i}=o;return[{x:e,y:n},{x:e+i,y:n},{x:e,y:n+a},{x:e+i,y:n+a}]}function Tm(o,e){if(!o||o.length===0)return null;const[n]=o;return n[e]}function Rm(o,e,n){return e===void 0&&(e=o.left),n===void 0&&(n=o.top),{x:e+o.width*.5,y:n+o.height*.5}}const tE=o=>{let{collisionRect:e,droppableRects:n,droppableContainers:a}=o;const i=Rm(e,e.left,e.top),l=[];for(const u of a){const{id:d}=u,f=n.get(d);if(f){const g=_m(Rm(f),i);l.push({id:d,data:{droppableContainer:u,value:g}})}}return l.sort(Am)},nE=o=>{let{collisionRect:e,droppableRects:n,droppableContainers:a}=o;const i=xm(e),l=[];for(const u of a){const{id:d}=u,f=n.get(d);if(f){const g=xm(f),m=i.reduce((v,S,_)=>v+_m(g[_],S),0),b=Number((m/4).toFixed(4));l.push({id:d,data:{droppableContainer:u,value:b}})}}return l.sort(Am)};function rE(o,e){const n=Math.max(e.top,o.top),a=Math.max(e.left,o.left),i=Math.min(e.left+e.width,o.left+o.width),l=Math.min(e.top+e.height,o.top+o.height),u=i-a,d=l-n;if(a<i&&n<l){const f=e.width*e.height,g=o.width*o.height,m=u*d,b=m/(f+g-m);return Number(b.toFixed(4))}return 0}const aE=o=>{let{collisionRect:e,droppableRects:n,droppableContainers:a}=o;const i=[];for(const l of a){const{id:u}=l,d=n.get(u);if(d){const f=rE(d,e);f>0&&i.push({id:u,data:{droppableContainer:l,value:f}})}}return i.sort(eE)};function iE(o,e,n){return{...o,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function km(o,e){return o&&e?{x:o.left-e.left,y:o.top-e.top}:br}function sE(o){return function(n){for(var a=arguments.length,i=new Array(a>1?a-1:0),l=1;l<a;l++)i[l-1]=arguments[l];return i.reduce((u,d)=>({...u,top:u.top+o*d.y,bottom:u.bottom+o*d.y,left:u.left+o*d.x,right:u.right+o*d.x}),{...n})}}const oE=sE(1);function lE(o){if(o.startsWith("matrix3d(")){const e=o.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(o.startsWith("matrix(")){const e=o.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function cE(o,e,n){const a=lE(e);if(!a)return o;const{scaleX:i,scaleY:l,x:u,y:d}=a,f=o.left-u-(1-i)*parseFloat(n),g=o.top-d-(1-l)*parseFloat(n.slice(n.indexOf(" ")+1)),m=i?o.width/i:o.width,b=l?o.height/l:o.height;return{width:m,height:b,top:g,right:f+m,bottom:g+b,left:f}}const uE={ignoreTransform:!1};function us(o,e){e===void 0&&(e=uE);let n=o.getBoundingClientRect();if(e.ignoreTransform){const{transform:g,transformOrigin:m}=Nn(o).getComputedStyle(o);g&&(n=cE(n,g,m))}const{top:a,left:i,width:l,height:u,bottom:d,right:f}=n;return{top:a,left:i,width:l,height:u,bottom:d,right:f}}function Dm(o){return us(o,{ignoreTransform:!0})}function dE(o){const e=o.innerWidth,n=o.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function fE(o,e){return e===void 0&&(e=Nn(o).getComputedStyle(o)),e.position==="fixed"}function hE(o,e){e===void 0&&(e=Nn(o).getComputedStyle(o));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const l=e[i];return typeof l=="string"?n.test(l):!1})}function ac(o,e){const n=[];function a(i){if(e!=null&&n.length>=e||!i)return n;if(Pd(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!ho(i)||vm(i)||n.includes(i))return n;const l=Nn(o).getComputedStyle(i);return i!==o&&hE(i,l)&&n.push(i),fE(i,l)?n:a(i.parentNode)}return o?a(o):n}function Om(o){const[e]=ac(o,1);return e??null}function Wd(o){return!tc||!o?null:os(o)?o:Bd(o)?Pd(o)||o===ls(o).scrollingElement?window:ho(o)?o:null:null}function Lm(o){return os(o)?o.scrollX:o.scrollLeft}function Mm(o){return os(o)?o.scrollY:o.scrollTop}function Yd(o){return{x:Lm(o),y:Mm(o)}}var gn;(function(o){o[o.Forward=1]="Forward",o[o.Backward=-1]="Backward"})(gn||(gn={}));function $m(o){return!tc||!o?!1:o===document.scrollingElement}function Nm(o){const e={x:0,y:0},n=$m(o)?{height:window.innerHeight,width:window.innerWidth}:{height:o.clientHeight,width:o.clientWidth},a={x:o.scrollWidth-n.width,y:o.scrollHeight-n.height},i=o.scrollTop<=e.y,l=o.scrollLeft<=e.x,u=o.scrollTop>=a.y,d=o.scrollLeft>=a.x;return{isTop:i,isLeft:l,isBottom:u,isRight:d,maxScroll:a,minScroll:e}}const gE={x:.2,y:.2};function pE(o,e,n,a,i){let{top:l,left:u,right:d,bottom:f}=n;a===void 0&&(a=10),i===void 0&&(i=gE);const{isTop:g,isBottom:m,isLeft:b,isRight:v}=Nm(o),S={x:0,y:0},_={x:0,y:0},A={height:e.height*i.y,width:e.width*i.x};return!g&&l<=e.top+A.height?(S.y=gn.Backward,_.y=a*Math.abs((e.top+A.height-l)/A.height)):!m&&f>=e.bottom-A.height&&(S.y=gn.Forward,_.y=a*Math.abs((e.bottom-A.height-f)/A.height)),!v&&d>=e.right-A.width?(S.x=gn.Forward,_.x=a*Math.abs((e.right-A.width-d)/A.width)):!b&&u<=e.left+A.width&&(S.x=gn.Backward,_.x=a*Math.abs((e.left+A.width-u)/A.width)),{direction:S,speed:_}}function mE(o){if(o===document.scrollingElement){const{innerWidth:l,innerHeight:u}=window;return{top:0,left:0,right:l,bottom:u,width:l,height:u}}const{top:e,left:n,right:a,bottom:i}=o.getBoundingClientRect();return{top:e,left:n,right:a,bottom:i,width:o.clientWidth,height:o.clientHeight}}function Im(o){return o.reduce((e,n)=>cs(e,Yd(n)),br)}function yE(o){return o.reduce((e,n)=>e+Lm(n),0)}function bE(o){return o.reduce((e,n)=>e+Mm(n),0)}function vE(o,e){if(e===void 0&&(e=us),!o)return;const{top:n,left:a,bottom:i,right:l}=e(o);Om(o)&&(i<=0||l<=0||n>=window.innerHeight||a>=window.innerWidth)&&o.scrollIntoView({block:"center",inline:"center"})}const SE=[["x",["left","right"],yE],["y",["top","bottom"],bE]];class Xd{constructor(e,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const a=ac(n),i=Im(a);this.rect={...e},this.width=e.width,this.height=e.height;for(const[l,u,d]of SE)for(const f of u)Object.defineProperty(this,f,{get:()=>{const g=d(a),m=i[l]-g;return this.rect[f]+m},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class vo{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var a;return(a=this.target)==null?void 0:a.removeEventListener(...n)})},this.target=e}add(e,n,a){var i;(i=this.target)==null||i.addEventListener(e,n,a),this.listeners.push([e,n,a])}}function wE(o){const{EventTarget:e}=Nn(o);return o instanceof e?o:ls(o)}function Jd(o,e){const n=Math.abs(o.x),a=Math.abs(o.y);return typeof e=="number"?Math.sqrt(n**2+a**2)>e:"x"in e&&"y"in e?n>e.x&&a>e.y:"x"in e?n>e.x:"y"in e?a>e.y:!1}var tr;(function(o){o.Click="click",o.DragStart="dragstart",o.Keydown="keydown",o.ContextMenu="contextmenu",o.Resize="resize",o.SelectionChange="selectionchange",o.VisibilityChange="visibilitychange"})(tr||(tr={}));function Hm(o){o.preventDefault()}function CE(o){o.stopPropagation()}var lt;(function(o){o.Space="Space",o.Down="ArrowDown",o.Right="ArrowRight",o.Left="ArrowLeft",o.Up="ArrowUp",o.Esc="Escape",o.Enter="Enter",o.Tab="Tab"})(lt||(lt={}));const zm={start:[lt.Space,lt.Enter],cancel:[lt.Esc],end:[lt.Space,lt.Enter,lt.Tab]},EE=(o,e)=>{let{currentCoordinates:n}=e;switch(o.code){case lt.Right:return{...n,x:n.x+25};case lt.Left:return{...n,x:n.x-25};case lt.Down:return{...n,y:n.y+25};case lt.Up:return{...n,y:n.y-25}}};class Qd{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:n}}=e;this.props=e,this.listeners=new vo(ls(n)),this.windowListeners=new vo(Nn(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(tr.Resize,this.handleCancel),this.windowListeners.add(tr.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(tr.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,a=e.node.current;a&&vE(a),n(br)}handleKeyDown(e){if(Fd(e)){const{active:n,context:a,options:i}=this.props,{keyboardCodes:l=zm,coordinateGetter:u=EE,scrollBehavior:d="smooth"}=i,{code:f}=e;if(l.end.includes(f)){this.handleEnd(e);return}if(l.cancel.includes(f)){this.handleCancel(e);return}const{collisionRect:g}=a.current,m=g?{x:g.left,y:g.top}:br;this.referenceCoordinates||(this.referenceCoordinates=m);const b=u(e,{active:n,context:a.current,currentCoordinates:m});if(b){const v=yo(b,m),S={x:0,y:0},{scrollableAncestors:_}=a.current;for(const A of _){const k=e.code,{isTop:O,isRight:M,isLeft:x,isBottom:D,maxScroll:U,minScroll:z}=Nm(A),q=mE(A),X={x:Math.min(k===lt.Right?q.right-q.width/2:q.right,Math.max(k===lt.Right?q.left:q.left+q.width/2,b.x)),y:Math.min(k===lt.Down?q.bottom-q.height/2:q.bottom,Math.max(k===lt.Down?q.top:q.top+q.height/2,b.y))},pe=k===lt.Right&&!M||k===lt.Left&&!x,Ce=k===lt.Down&&!D||k===lt.Up&&!O;if(pe&&X.x!==b.x){const ve=A.scrollLeft+v.x,Le=k===lt.Right&&ve<=U.x||k===lt.Left&&ve>=z.x;if(Le&&!v.y){A.scrollTo({left:ve,behavior:d});return}Le?S.x=A.scrollLeft-ve:S.x=k===lt.Right?A.scrollLeft-U.x:A.scrollLeft-z.x,S.x&&A.scrollBy({left:-S.x,behavior:d});break}else if(Ce&&X.y!==b.y){const ve=A.scrollTop+v.y,Le=k===lt.Down&&ve<=U.y||k===lt.Up&&ve>=z.y;if(Le&&!v.x){A.scrollTo({top:ve,behavior:d});return}Le?S.y=A.scrollTop-ve:S.y=k===lt.Down?A.scrollTop-U.y:A.scrollTop-z.y,S.y&&A.scrollBy({top:-S.y,behavior:d});break}}this.handleMove(e,cs(yo(b,this.referenceCoordinates),S))}}}handleMove(e,n){const{onMove:a}=this.props;e.preventDefault(),a(n)}handleEnd(e){const{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){const{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Qd.activators=[{eventName:"onKeyDown",handler:(o,e,n)=>{let{keyboardCodes:a=zm,onActivation:i}=e,{active:l}=n;const{code:u}=o.nativeEvent;if(a.start.includes(u)){const d=l.activatorNode.current;return d&&o.target!==d?!1:(o.preventDefault(),i?.({event:o.nativeEvent}),!0)}return!1}}];function jm(o){return!!(o&&"distance"in o)}function Um(o){return!!(o&&"delay"in o)}class Zd{constructor(e,n,a){var i;a===void 0&&(a=wE(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=n;const{event:l}=e,{target:u}=l;this.props=e,this.events=n,this.document=ls(u),this.documentListeners=new vo(this.document),this.listeners=new vo(a),this.windowListeners=new vo(Nn(u)),this.initialCoordinates=(i=Kd(l))!=null?i:br,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:n,bypassActivationConstraint:a}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(tr.Resize,this.handleCancel),this.windowListeners.add(tr.DragStart,Hm),this.windowListeners.add(tr.VisibilityChange,this.handleCancel),this.windowListeners.add(tr.ContextMenu,Hm),this.documentListeners.add(tr.Keydown,this.handleKeydown),n){if(a!=null&&a({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Um(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(jm(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,n){const{active:a,onPending:i}=this.props;i(a,e,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(tr.Click,CE,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(tr.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:a,initialCoordinates:i,props:l}=this,{onMove:u,options:{activationConstraint:d}}=l;if(!i)return;const f=(n=Kd(e))!=null?n:br,g=yo(i,f);if(!a&&d){if(jm(d)){if(d.tolerance!=null&&Jd(g,d.tolerance))return this.handleCancel();if(Jd(g,d.distance))return this.handleStart()}if(Um(d)&&Jd(g,d.tolerance))return this.handleCancel();this.handlePending(d,g);return}e.cancelable&&e.preventDefault(),u(f)}handleEnd(){const{onAbort:e,onEnd:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleCancel(){const{onAbort:e,onCancel:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleKeydown(e){e.code===lt.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const _E={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ef extends Zd{constructor(e){const{event:n}=e,a=ls(n.target);super(e,_E,a)}}ef.activators=[{eventName:"onPointerDown",handler:(o,e)=>{let{nativeEvent:n}=o,{onActivation:a}=e;return!n.isPrimary||n.button!==0?!1:(a?.({event:n}),!0)}}];const AE={move:{name:"mousemove"},end:{name:"mouseup"}};var tf;(function(o){o[o.RightClick=2]="RightClick"})(tf||(tf={}));class xE extends Zd{constructor(e){super(e,AE,ls(e.event.target))}}xE.activators=[{eventName:"onMouseDown",handler:(o,e)=>{let{nativeEvent:n}=o,{onActivation:a}=e;return n.button===tf.RightClick?!1:(a?.({event:n}),!0)}}];const nf={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class TE extends Zd{constructor(e){super(e,nf)}static setup(){return window.addEventListener(nf.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(nf.move.name,e)};function e(){}}}TE.activators=[{eventName:"onTouchStart",handler:(o,e)=>{let{nativeEvent:n}=o,{onActivation:a}=e;const{touches:i}=n;return i.length>1?!1:(a?.({event:n}),!0)}}];var So;(function(o){o[o.Pointer=0]="Pointer",o[o.DraggableRect=1]="DraggableRect"})(So||(So={}));var ic;(function(o){o[o.TreeOrder=0]="TreeOrder",o[o.ReversedTreeOrder=1]="ReversedTreeOrder"})(ic||(ic={}));function RE(o){let{acceleration:e,activator:n=So.Pointer,canScroll:a,draggingRect:i,enabled:l,interval:u=5,order:d=ic.TreeOrder,pointerCoordinates:f,scrollableAncestors:g,scrollableAncestorRects:m,delta:b,threshold:v}=o;const S=DE({delta:b,disabled:!l}),[_,A]=UC(),k=H.useRef({x:0,y:0}),O=H.useRef({x:0,y:0}),M=H.useMemo(()=>{switch(n){case So.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case So.DraggableRect:return i}},[n,i,f]),x=H.useRef(null),D=H.useCallback(()=>{const z=x.current;if(!z)return;const q=k.current.x*O.current.x,X=k.current.y*O.current.y;z.scrollBy(q,X)},[]),U=H.useMemo(()=>d===ic.TreeOrder?[...g].reverse():g,[d,g]);H.useEffect(()=>{if(!l||!g.length||!M){A();return}for(const z of U){if(a?.(z)===!1)continue;const q=g.indexOf(z),X=m[q];if(!X)continue;const{direction:pe,speed:Ce}=pE(z,X,M,e,v);for(const ve of["x","y"])S[ve][pe[ve]]||(Ce[ve]=0,pe[ve]=0);if(Ce.x>0||Ce.y>0){A(),x.current=z,_(D,u),k.current=Ce,O.current=pe;return}}k.current={x:0,y:0},O.current={x:0,y:0},A()},[e,D,a,A,l,u,JSON.stringify(M),JSON.stringify(S),_,g,U,m,JSON.stringify(v)])}const kE={x:{[gn.Backward]:!1,[gn.Forward]:!1},y:{[gn.Backward]:!1,[gn.Forward]:!1}};function DE(o){let{delta:e,disabled:n}=o;const a=Gd(e);return po(i=>{if(n||!a||!i)return kE;const l={x:Math.sign(e.x-a.x),y:Math.sign(e.y-a.y)};return{x:{[gn.Backward]:i.x[gn.Backward]||l.x===-1,[gn.Forward]:i.x[gn.Forward]||l.x===1},y:{[gn.Backward]:i.y[gn.Backward]||l.y===-1,[gn.Forward]:i.y[gn.Forward]||l.y===1}}},[n,e,a])}function OE(o,e){const n=e!=null?o.get(e):void 0,a=n?n.node.current:null;return po(i=>{var l;return e==null?null:(l=a??i)!=null?l:null},[a,e])}function LE(o,e){return H.useMemo(()=>o.reduce((n,a)=>{const{sensor:i}=a,l=i.activators.map(u=>({eventName:u.eventName,handler:e(u.handler,a)}));return[...n,...l]},[]),[o,e])}var wo;(function(o){o[o.Always=0]="Always",o[o.BeforeDragging=1]="BeforeDragging",o[o.WhileDragging=2]="WhileDragging"})(wo||(wo={}));var rf;(function(o){o.Optimized="optimized"})(rf||(rf={}));const Bm=new Map;function ME(o,e){let{dragging:n,dependencies:a,config:i}=e;const[l,u]=H.useState(null),{frequency:d,measure:f,strategy:g}=i,m=H.useRef(o),b=k(),v=go(b),S=H.useCallback(function(O){O===void 0&&(O=[]),!v.current&&u(M=>M===null?O:M.concat(O.filter(x=>!M.includes(x))))},[v]),_=H.useRef(null),A=po(O=>{if(b&&!n)return Bm;if(!O||O===Bm||m.current!==o||l!=null){const M=new Map;for(let x of o){if(!x)continue;if(l&&l.length>0&&!l.includes(x.id)&&x.rect.current){M.set(x.id,x.rect.current);continue}const D=x.node.current,U=D?new Xd(f(D),D):null;x.rect.current=U,U&&M.set(x.id,U)}return M}return O},[o,l,n,b,f]);return H.useEffect(()=>{m.current=o},[o]),H.useEffect(()=>{b||S()},[n,b]),H.useEffect(()=>{l&&l.length>0&&u(null)},[JSON.stringify(l)]),H.useEffect(()=>{b||typeof d!="number"||_.current!==null||(_.current=setTimeout(()=>{S(),_.current=null},d))},[d,b,S,...a]),{droppableRects:A,measureDroppableContainers:S,measuringScheduled:l!=null};function k(){switch(g){case wo.Always:return!1;case wo.BeforeDragging:return n;default:return!n}}}function Pm(o,e){return po(n=>o?n||(typeof e=="function"?e(o):o):null,[e,o])}function $E(o,e){return Pm(o,e)}function NE(o){let{callback:e,disabled:n}=o;const a=qd(e),i=H.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:l}=window;return new l(a)},[a,n]);return H.useEffect(()=>()=>i?.disconnect(),[i]),i}function sc(o){let{callback:e,disabled:n}=o;const a=qd(e),i=H.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:l}=window;return new l(a)},[n]);return H.useEffect(()=>()=>i?.disconnect(),[i]),i}function IE(o){return new Xd(us(o),o)}function qm(o,e,n){e===void 0&&(e=IE);const[a,i]=H.useState(null);function l(){i(f=>{if(!o)return null;if(o.isConnected===!1){var g;return(g=f??n)!=null?g:null}const m=e(o);return JSON.stringify(f)===JSON.stringify(m)?f:m})}const u=NE({callback(f){if(o)for(const g of f){const{type:m,target:b}=g;if(m==="childList"&&b instanceof HTMLElement&&b.contains(o)){l();break}}}}),d=sc({callback:l});return zr(()=>{l(),o?(d?.observe(o),u?.observe(document.body,{childList:!0,subtree:!0})):(d?.disconnect(),u?.disconnect())},[o]),a}function HE(o){const e=Pm(o);return km(o,e)}const Gm=[];function zE(o){const e=H.useRef(o),n=po(a=>o?a&&a!==Gm&&o&&e.current&&o.parentNode===e.current.parentNode?a:ac(o):Gm,[o]);return H.useEffect(()=>{e.current=o},[o]),n}function jE(o){const[e,n]=H.useState(null),a=H.useRef(o),i=H.useCallback(l=>{const u=Wd(l.target);u&&n(d=>d?(d.set(u,Yd(u)),new Map(d)):null)},[]);return H.useEffect(()=>{const l=a.current;if(o!==l){u(l);const d=o.map(f=>{const g=Wd(f);return g?(g.addEventListener("scroll",i,{passive:!0}),[g,Yd(g)]):null}).filter(f=>f!=null);n(d.length?new Map(d):null),a.current=o}return()=>{u(o),u(l)};function u(d){d.forEach(f=>{const g=Wd(f);g?.removeEventListener("scroll",i)})}},[i,o]),H.useMemo(()=>o.length?e?Array.from(e.values()).reduce((l,u)=>cs(l,u),br):Im(o):br,[o,e])}function Vm(o,e){e===void 0&&(e=[]);const n=H.useRef(null);return H.useEffect(()=>{n.current=null},e),H.useEffect(()=>{const a=o!==br;a&&!n.current&&(n.current=o),!a&&n.current&&(n.current=null)},[o]),n.current?yo(o,n.current):br}function UE(o){H.useEffect(()=>{if(!tc)return;const e=o.map(n=>{let{sensor:a}=n;return a.setup==null?void 0:a.setup()});return()=>{for(const n of e)n?.()}},o.map(e=>{let{sensor:n}=e;return n}))}function BE(o,e){return H.useMemo(()=>o.reduce((n,a)=>{let{eventName:i,handler:l}=a;return n[i]=u=>{l(u,e)},n},{}),[o,e])}function Fm(o){return H.useMemo(()=>o?dE(o):null,[o])}const Km=[];function PE(o,e){e===void 0&&(e=us);const[n]=o,a=Fm(n?Nn(n):null),[i,l]=H.useState(Km);function u(){l(()=>o.length?o.map(f=>$m(f)?a:new Xd(e(f),f)):Km)}const d=sc({callback:u});return zr(()=>{d?.disconnect(),u(),o.forEach(f=>d?.observe(f))},[o]),i}function qE(o){if(!o)return null;if(o.children.length>1)return o;const e=o.children[0];return ho(e)?e:o}function GE(o){let{measure:e}=o;const[n,a]=H.useState(null),i=H.useCallback(g=>{for(const{target:m}of g)if(ho(m)){a(b=>{const v=e(m);return b?{...b,width:v.width,height:v.height}:v});break}},[e]),l=sc({callback:i}),u=H.useCallback(g=>{const m=qE(g);l?.disconnect(),m&&l?.observe(m),a(m?e(m):null)},[e,l]),[d,f]=nc(u);return H.useMemo(()=>({nodeRef:d,rect:n,setRef:f}),[n,d,f])}const VE=[{sensor:ef,options:{}},{sensor:Qd,options:{}}],FE={current:{}},oc={draggable:{measure:Dm},droppable:{measure:Dm,strategy:wo.WhileDragging,frequency:rf.Optimized},dragOverlay:{measure:us}};class Co extends Map{get(e){var n;return e!=null&&(n=super.get(e))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:n}=e;return!n})}getNodeFor(e){var n,a;return(n=(a=this.get(e))==null?void 0:a.node.current)!=null?n:void 0}}const KE={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Co,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:rc},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:oc,measureDroppableContainers:rc,windowRect:null,measuringScheduled:!1},WE={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:rc,draggableNodes:new Map,over:null,measureDroppableContainers:rc},lc=H.createContext(WE),Wm=H.createContext(KE);function YE(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Co}}}function XE(o,e){switch(e.type){case tn.DragStart:return{...o,draggable:{...o.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case tn.DragMove:return o.draggable.active==null?o:{...o,draggable:{...o.draggable,translate:{x:e.coordinates.x-o.draggable.initialCoordinates.x,y:e.coordinates.y-o.draggable.initialCoordinates.y}}};case tn.DragEnd:case tn.DragCancel:return{...o,draggable:{...o.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case tn.RegisterDroppable:{const{element:n}=e,{id:a}=n,i=new Co(o.droppable.containers);return i.set(a,n),{...o,droppable:{...o.droppable,containers:i}}}case tn.SetDroppableDisabled:{const{id:n,key:a,disabled:i}=e,l=o.droppable.containers.get(n);if(!l||a!==l.key)return o;const u=new Co(o.droppable.containers);return u.set(n,{...l,disabled:i}),{...o,droppable:{...o.droppable,containers:u}}}case tn.UnregisterDroppable:{const{id:n,key:a}=e,i=o.droppable.containers.get(n);if(!i||a!==i.key)return o;const l=new Co(o.droppable.containers);return l.delete(n),{...o,droppable:{...o.droppable,containers:l}}}default:return o}}function JE(o){let{disabled:e}=o;const{active:n,activatorEvent:a,draggableNodes:i}=H.useContext(lc),l=Gd(a),u=Gd(n?.id);return H.useEffect(()=>{if(!e&&!a&&l&&u!=null){if(!Fd(l)||document.activeElement===l.target)return;const d=i.get(u);if(!d)return;const{activatorNode:f,node:g}=d;if(!f.current&&!g.current)return;requestAnimationFrame(()=>{for(const m of[f.current,g.current]){if(!m)continue;const b=qC(m);if(b){b.focus();break}}})}},[a,e,i,u,l]),null}function QE(o,e){let{transform:n,...a}=e;return o!=null&&o.length?o.reduce((i,l)=>l({transform:i,...a}),n):n}function ZE(o){return H.useMemo(()=>({draggable:{...oc.draggable,...o?.draggable},droppable:{...oc.droppable,...o?.droppable},dragOverlay:{...oc.dragOverlay,...o?.dragOverlay}}),[o?.draggable,o?.droppable,o?.dragOverlay])}function e_(o){let{activeNode:e,measure:n,initialRect:a,config:i=!0}=o;const l=H.useRef(!1),{x:u,y:d}=typeof i=="boolean"?{x:i,y:i}:i;zr(()=>{if(!u&&!d||!e){l.current=!1;return}if(l.current||!a)return;const g=e?.node.current;if(!g||g.isConnected===!1)return;const m=n(g),b=km(m,a);if(u||(b.x=0),d||(b.y=0),l.current=!0,Math.abs(b.x)>0||Math.abs(b.y)>0){const v=Om(g);v&&v.scrollBy({top:b.y,left:b.x})}},[e,u,d,a,n])}const Ym=H.createContext({...br,scaleX:1,scaleY:1});var xa;(function(o){o[o.Uninitialized=0]="Uninitialized",o[o.Initializing=1]="Initializing",o[o.Initialized=2]="Initialized"})(xa||(xa={}));const t_=H.memo(function(e){var n,a,i,l;let{id:u,accessibility:d,autoScroll:f=!0,children:g,sensors:m=VE,collisionDetection:b=aE,measuring:v,modifiers:S,..._}=e;const A=H.useReducer(XE,void 0,YE),[k,O]=A,[M,x]=YC(),[D,U]=H.useState(xa.Uninitialized),z=D===xa.Initialized,{draggable:{active:q,nodes:X,translate:pe},droppable:{containers:Ce}}=k,ve=q!=null?X.get(q):null,Le=H.useRef({initial:null,translated:null}),Ve=H.useMemo(()=>{var ue;return q!=null?{id:q,data:(ue=ve?.data)!=null?ue:FE,rect:Le}:null},[q,ve]),Fe=H.useRef(null),[Tt,J]=H.useState(null),[de,Ne]=H.useState(null),ee=go(_,Object.values(_)),ge=mo("DndDescribedBy",u),N=H.useMemo(()=>Ce.getEnabled(),[Ce]),T=ZE(v),{droppableRects:fe,measureDroppableContainers:he,measuringScheduled:Ae}=ME(N,{dragging:z,dependencies:[pe.x,pe.y],config:T.droppable}),te=OE(X,q),we=H.useMemo(()=>de?Kd(de):null,[de]),qe=ye(),ke=$E(te,T.draggable.measure);e_({activeNode:q!=null?X.get(q):null,config:qe.layoutShiftCompensation,initialRect:ke,measure:T.draggable.measure});const ze=qm(te,T.draggable.measure,ke),Ct=qm(te?te.parentElement:null),it=H.useRef({activatorEvent:null,active:null,activeNode:te,collisionRect:null,collisions:null,droppableRects:fe,draggableNodes:X,draggingNode:null,draggingNodeRect:null,droppableContainers:Ce,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ot=Ce.getNodeFor((n=it.current.over)==null?void 0:n.id),vt=GE({measure:T.dragOverlay.measure}),_t=(a=vt.nodeRef.current)!=null?a:te,Me=z?(i=vt.rect)!=null?i:ze:null,tt=!!(vt.nodeRef.current&&vt.rect),nn=HE(tt?null:ze),Mt=Fm(_t?Nn(_t):null),Pt=zE(z?Ot??te:null),rn=PE(Pt),an=QE(S,{transform:{x:pe.x-nn.x,y:pe.y-nn.y,scaleX:1,scaleY:1},activatorEvent:de,active:Ve,activeNodeRect:ze,containerNodeRect:Ct,draggingNodeRect:Me,over:it.current.over,overlayNodeRect:vt.rect,scrollableAncestors:Pt,scrollableAncestorRects:rn,windowRect:Mt}),ea=we?cs(we,pe):null,qt=jE(Pt),bi=Vm(qt),ta=Vm(qt,[ze]),yn=cs(an,bi),Ln=Me?oE(Me,an):null,nt=Ve&&Ln?b({active:Ve,collisionRect:Ln,droppableRects:fe,droppableContainers:N,pointerCoordinates:ea}):null,Hn=Tm(nt,"id"),[bn,na]=H.useState(null),rr=tt?an:cs(an,ta),sn=iE(rr,(l=bn?.rect)!=null?l:null,ze),Tn=H.useRef(null),on=H.useCallback((ue,Ee)=>{let{sensor:_e,options:Ke}=Ee;if(Fe.current==null)return;const xe=X.get(Fe.current);if(!xe)return;const Ie=ue.nativeEvent,Re=new _e({active:Fe.current,activeNode:xe,event:Ie,options:Ke,context:it,onAbort(je){if(!X.get(je))return;const{onDragAbort:Te}=ee.current,Ue={id:je};Te?.(Ue),M({type:"onDragAbort",event:Ue})},onPending(je,De,Te,Ue){if(!X.get(je))return;const{onDragPending:St}=ee.current,ln={id:je,constraint:De,initialCoordinates:Te,offset:Ue};St?.(ln),M({type:"onDragPending",event:ln})},onStart(je){const De=Fe.current;if(De==null)return;const Te=X.get(De);if(!Te)return;const{onDragStart:Ue}=ee.current,gt={activatorEvent:Ie,active:{id:De,data:Te.data,rect:Le}};Aa.unstable_batchedUpdates(()=>{Ue?.(gt),U(xa.Initializing),O({type:tn.DragStart,initialCoordinates:je,active:De}),M({type:"onDragStart",event:gt}),J(Tn.current),Ne(Ie)})},onMove(je){O({type:tn.DragMove,coordinates:je})},onEnd:et(tn.DragEnd),onCancel:et(tn.DragCancel)});Tn.current=Re;function et(je){return async function(){const{active:Te,collisions:Ue,over:gt,scrollAdjustedTranslate:St}=it.current;let ln=null;if(Te&&St){const{cancelDrop:cn}=ee.current;ln={activatorEvent:Ie,active:Te,collisions:Ue,delta:St,over:gt},je===tn.DragEnd&&typeof cn=="function"&&await Promise.resolve(cn(ln))&&(je=tn.DragCancel)}Fe.current=null,Aa.unstable_batchedUpdates(()=>{O({type:je}),U(xa.Uninitialized),na(null),J(null),Ne(null),Tn.current=null;const cn=je===tn.DragEnd?"onDragEnd":"onDragCancel";if(ln){const Rn=ee.current[cn];Rn?.(ln),M({type:cn,event:ln})}})}}},[X]),V=H.useCallback((ue,Ee)=>(_e,Ke)=>{const xe=_e.nativeEvent,Ie=X.get(Ke);if(Fe.current!==null||!Ie||xe.dndKit||xe.defaultPrevented)return;const Re={active:Ie};ue(_e,Ee.options,Re)===!0&&(xe.dndKit={capturedBy:Ee.sensor},Fe.current=Ke,on(_e,Ee))},[X,on]),se=LE(m,V);UE(m),zr(()=>{ze&&D===xa.Initializing&&U(xa.Initialized)},[ze,D]),H.useEffect(()=>{const{onDragMove:ue}=ee.current,{active:Ee,activatorEvent:_e,collisions:Ke,over:xe}=it.current;if(!Ee||!_e)return;const Ie={active:Ee,activatorEvent:_e,collisions:Ke,delta:{x:yn.x,y:yn.y},over:xe};Aa.unstable_batchedUpdates(()=>{ue?.(Ie),M({type:"onDragMove",event:Ie})})},[yn.x,yn.y]),H.useEffect(()=>{const{active:ue,activatorEvent:Ee,collisions:_e,droppableContainers:Ke,scrollAdjustedTranslate:xe}=it.current;if(!ue||Fe.current==null||!Ee||!xe)return;const{onDragOver:Ie}=ee.current,Re=Ke.get(Hn),et=Re&&Re.rect.current?{id:Re.id,rect:Re.rect.current,data:Re.data,disabled:Re.disabled}:null,je={active:ue,activatorEvent:Ee,collisions:_e,delta:{x:xe.x,y:xe.y},over:et};Aa.unstable_batchedUpdates(()=>{na(et),Ie?.(je),M({type:"onDragOver",event:je})})},[Hn]),zr(()=>{it.current={activatorEvent:de,active:Ve,activeNode:te,collisionRect:Ln,collisions:nt,droppableRects:fe,draggableNodes:X,draggingNode:_t,draggingNodeRect:Me,droppableContainers:Ce,over:bn,scrollableAncestors:Pt,scrollAdjustedTranslate:yn},Le.current={initial:Me,translated:Ln}},[Ve,te,nt,Ln,X,_t,Me,fe,Ce,bn,Pt,yn]),RE({...qe,delta:pe,draggingRect:Ln,pointerCoordinates:ea,scrollableAncestors:Pt,scrollableAncestorRects:rn});const le=H.useMemo(()=>({active:Ve,activeNode:te,activeNodeRect:ze,activatorEvent:de,collisions:nt,containerNodeRect:Ct,dragOverlay:vt,draggableNodes:X,droppableContainers:Ce,droppableRects:fe,over:bn,measureDroppableContainers:he,scrollableAncestors:Pt,scrollableAncestorRects:rn,measuringConfiguration:T,measuringScheduled:Ae,windowRect:Mt}),[Ve,te,ze,de,nt,Ct,vt,X,Ce,fe,bn,he,Pt,rn,T,Ae,Mt]),Z=H.useMemo(()=>({activatorEvent:de,activators:se,active:Ve,activeNodeRect:ze,ariaDescribedById:{draggable:ge},dispatch:O,draggableNodes:X,over:bn,measureDroppableContainers:he}),[de,se,Ve,ze,O,ge,X,bn,he]);return Xe.createElement(Cm.Provider,{value:x},Xe.createElement(lc.Provider,{value:Z},Xe.createElement(Wm.Provider,{value:le},Xe.createElement(Ym.Provider,{value:sn},g)),Xe.createElement(JE,{disabled:d?.restoreFocus===!1})),Xe.createElement(QC,{...d,hiddenTextDescribedById:ge}));function ye(){const ue=Tt?.autoScrollEnabled===!1,Ee=typeof f=="object"?f.enabled===!1:f===!1,_e=z&&!ue&&!Ee;return typeof f=="object"?{...f,enabled:_e}:{enabled:_e}}}),n_=H.createContext(null),Xm="button",r_="Draggable";function a_(o){let{id:e,data:n,disabled:a=!1,attributes:i}=o;const l=mo(r_),{activators:u,activatorEvent:d,active:f,activeNodeRect:g,ariaDescribedById:m,draggableNodes:b,over:v}=H.useContext(lc),{role:S=Xm,roleDescription:_="draggable",tabIndex:A=0}=i??{},k=f?.id===e,O=H.useContext(k?Ym:n_),[M,x]=nc(),[D,U]=nc(),z=BE(u,e),q=go(n);zr(()=>(b.set(e,{id:e,key:l,node:M,activatorNode:D,data:q}),()=>{const pe=b.get(e);pe&&pe.key===l&&b.delete(e)}),[b,e]);const X=H.useMemo(()=>({role:S,tabIndex:A,"aria-disabled":a,"aria-pressed":k&&S===Xm?!0:void 0,"aria-roledescription":_,"aria-describedby":m.draggable}),[a,S,A,k,_,m.draggable]);return{active:f,activatorEvent:d,activeNodeRect:g,attributes:X,isDragging:k,listeners:a?void 0:z,node:M,over:v,setNodeRef:x,setActivatorNodeRef:U,transform:O}}function i_(){return H.useContext(Wm)}const s_="Droppable",o_={timeout:25};function l_(o){let{data:e,disabled:n=!1,id:a,resizeObserverConfig:i}=o;const l=mo(s_),{active:u,dispatch:d,over:f,measureDroppableContainers:g}=H.useContext(lc),m=H.useRef({disabled:n}),b=H.useRef(!1),v=H.useRef(null),S=H.useRef(null),{disabled:_,updateMeasurementsFor:A,timeout:k}={...o_,...i},O=go(A??a),M=H.useCallback(()=>{if(!b.current){b.current=!0;return}S.current!=null&&clearTimeout(S.current),S.current=setTimeout(()=>{g(Array.isArray(O.current)?O.current:[O.current]),S.current=null},k)},[k]),x=sc({callback:M,disabled:_||!u}),D=H.useCallback((X,pe)=>{x&&(pe&&(x.unobserve(pe),b.current=!1),X&&x.observe(X))},[x]),[U,z]=nc(D),q=go(e);return H.useEffect(()=>{!x||!U.current||(x.disconnect(),b.current=!1,x.observe(U.current))},[U,x]),H.useEffect(()=>(d({type:tn.RegisterDroppable,element:{id:a,key:l,disabled:n,node:U,rect:v,data:q}}),()=>d({type:tn.UnregisterDroppable,key:l,id:a})),[a]),H.useEffect(()=>{n!==m.current.disabled&&(d({type:tn.SetDroppableDisabled,id:a,key:l,disabled:n}),m.current.disabled=n)},[a,l,n,d]),{active:u,rect:v,isOver:f?.id===a,node:U,over:f,setNodeRef:z}}function af(o,e,n){const a=o.slice();return a.splice(n<0?a.length+n:n,0,a.splice(e,1)[0]),a}function c_(o,e){return o.reduce((n,a,i)=>{const l=e.get(a);return l&&(n[i]=l),n},Array(o.length))}function cc(o){return o!==null&&o>=0}function u_(o,e){if(o===e)return!0;if(o.length!==e.length)return!1;for(let n=0;n<o.length;n++)if(o[n]!==e[n])return!1;return!0}function d_(o){return typeof o=="boolean"?{draggable:o,droppable:o}:o}const uc={scaleX:1,scaleY:1},f_=o=>{var e;let{rects:n,activeNodeRect:a,activeIndex:i,overIndex:l,index:u}=o;const d=(e=n[i])!=null?e:a;if(!d)return null;const f=h_(n,u,i);if(u===i){const g=n[l];return g?{x:i<l?g.left+g.width-(d.left+d.width):g.left-d.left,y:0,...uc}:null}return u>i&&u<=l?{x:-d.width-f,y:0,...uc}:u<i&&u>=l?{x:d.width+f,y:0,...uc}:{x:0,y:0,...uc}};function h_(o,e,n){const a=o[e],i=o[e-1],l=o[e+1];return!a||!i&&!l?0:n<e?i?a.left-(i.left+i.width):l.left-(a.left+a.width):l?l.left-(a.left+a.width):a.left-(i.left+i.width)}const sf=o=>{let{rects:e,activeIndex:n,overIndex:a,index:i}=o;const l=af(e,a,n),u=e[i],d=l[i];return!d||!u?null:{x:d.left-u.left,y:d.top-u.top,scaleX:d.width/u.width,scaleY:d.height/u.height}},dc={scaleX:1,scaleY:1},g_=o=>{var e;let{activeIndex:n,activeNodeRect:a,index:i,rects:l,overIndex:u}=o;const d=(e=l[n])!=null?e:a;if(!d)return null;if(i===n){const g=l[u];return g?{x:0,y:n<u?g.top+g.height-(d.top+d.height):g.top-d.top,...dc}:null}const f=p_(l,i,n);return i>n&&i<=u?{x:0,y:-d.height-f,...dc}:i<n&&i>=u?{x:0,y:d.height+f,...dc}:{x:0,y:0,...dc}};function p_(o,e,n){const a=o[e],i=o[e-1],l=o[e+1];return a?n<e?i?a.top-(i.top+i.height):l?l.top-(a.top+a.height):0:l?l.top-(a.top+a.height):i?a.top-(i.top+i.height):0:0}const Jm="Sortable",Qm=Xe.createContext({activeIndex:-1,containerId:Jm,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:sf,disabled:{draggable:!1,droppable:!1}});function m_(o){let{children:e,id:n,items:a,strategy:i=sf,disabled:l=!1}=o;const{active:u,dragOverlay:d,droppableRects:f,over:g,measureDroppableContainers:m}=i_(),b=mo(Jm,n),v=d.rect!==null,S=H.useMemo(()=>a.map(z=>typeof z=="object"&&"id"in z?z.id:z),[a]),_=u!=null,A=u?S.indexOf(u.id):-1,k=g?S.indexOf(g.id):-1,O=H.useRef(S),M=!u_(S,O.current),x=k!==-1&&A===-1||M,D=d_(l);zr(()=>{M&&_&&m(S)},[M,S,_,m]),H.useEffect(()=>{O.current=S},[S]);const U=H.useMemo(()=>({activeIndex:A,containerId:b,disabled:D,disableTransforms:x,items:S,overIndex:k,useDragOverlay:v,sortedRects:c_(S,f),strategy:i}),[A,b,D.draggable,D.droppable,x,S,k,f,v,i]);return Xe.createElement(Qm.Provider,{value:U},e)}const y_=o=>{let{id:e,items:n,activeIndex:a,overIndex:i}=o;return af(n,a,i).indexOf(e)},b_=o=>{let{containerId:e,isSorting:n,wasDragging:a,index:i,items:l,newIndex:u,previousItems:d,previousContainerId:f,transition:g}=o;return!g||!a||d!==l&&i===u?!1:n?!0:u!==i&&e===f},v_={duration:200,easing:"ease"},Zm="transform",S_=bo.Transition.toString({property:Zm,duration:0,easing:"linear"}),w_={roleDescription:"sortable"};function C_(o){let{disabled:e,index:n,node:a,rect:i}=o;const[l,u]=H.useState(null),d=H.useRef(n);return zr(()=>{if(!e&&n!==d.current&&a.current){const f=i.current;if(f){const g=us(a.current,{ignoreTransform:!0}),m={x:f.left-g.left,y:f.top-g.top,scaleX:f.width/g.width,scaleY:f.height/g.height};(m.x||m.y)&&u(m)}}n!==d.current&&(d.current=n)},[e,n,a,i]),H.useEffect(()=>{l&&u(null)},[l]),l}function E_(o){let{animateLayoutChanges:e=b_,attributes:n,disabled:a,data:i,getNewIndex:l=y_,id:u,strategy:d,resizeObserverConfig:f,transition:g=v_}=o;const{items:m,containerId:b,activeIndex:v,disabled:S,disableTransforms:_,sortedRects:A,overIndex:k,useDragOverlay:O,strategy:M}=H.useContext(Qm),x=__(a,S),D=m.indexOf(u),U=H.useMemo(()=>({sortable:{containerId:b,index:D,items:m},...i}),[b,i,D,m]),z=H.useMemo(()=>m.slice(m.indexOf(u)),[m,u]),{rect:q,node:X,isOver:pe,setNodeRef:Ce}=l_({id:u,data:U,disabled:x.droppable,resizeObserverConfig:{updateMeasurementsFor:z,...f}}),{active:ve,activatorEvent:Le,activeNodeRect:Ve,attributes:Fe,setNodeRef:Tt,listeners:J,isDragging:de,over:Ne,setActivatorNodeRef:ee,transform:ge}=a_({id:u,data:U,attributes:{...w_,...n},disabled:x.draggable}),N=jC(Ce,Tt),T=!!ve,fe=T&&!_&&cc(v)&&cc(k),he=!O&&de,Ae=he&&fe?ge:null,we=fe?Ae??(d??M)({rects:A,activeNodeRect:Ve,activeIndex:v,overIndex:k,index:D}):null,qe=cc(v)&&cc(k)?l({id:u,items:m,activeIndex:v,overIndex:k}):D,ke=ve?.id,ze=H.useRef({activeId:ke,items:m,newIndex:qe,containerId:b}),Ct=m!==ze.current.items,it=e({active:ve,containerId:b,isDragging:de,isSorting:T,id:u,index:D,items:m,newIndex:ze.current.newIndex,previousItems:ze.current.items,previousContainerId:ze.current.containerId,transition:g,wasDragging:ze.current.activeId!=null}),Ot=C_({disabled:!it,index:D,node:X,rect:q});return H.useEffect(()=>{T&&ze.current.newIndex!==qe&&(ze.current.newIndex=qe),b!==ze.current.containerId&&(ze.current.containerId=b),m!==ze.current.items&&(ze.current.items=m)},[T,qe,b,m]),H.useEffect(()=>{if(ke===ze.current.activeId)return;if(ke!=null&&ze.current.activeId==null){ze.current.activeId=ke;return}const _t=setTimeout(()=>{ze.current.activeId=ke},50);return()=>clearTimeout(_t)},[ke]),{active:ve,activeIndex:v,attributes:Fe,data:U,rect:q,index:D,newIndex:qe,items:m,isOver:pe,isSorting:T,isDragging:de,listeners:J,node:X,overIndex:k,over:Ne,setNodeRef:N,setActivatorNodeRef:ee,setDroppableNodeRef:Ce,setDraggableNodeRef:Tt,transform:Ot??we,transition:vt()};function vt(){if(Ot||Ct&&ze.current.newIndex===D)return S_;if(!(he&&!Fd(Le)||!g)&&(T||it))return bo.Transition.toString({...g,property:Zm})}}function __(o,e){var n,a;return typeof o=="boolean"?{draggable:o,droppable:!1}:{draggable:(n=o?.draggable)!=null?n:e.draggable,droppable:(a=o?.droppable)!=null?a:e.droppable}}function fc(o){if(!o)return!1;const e=o.data.current;return!!(e&&"sortable"in e&&typeof e.sortable=="object"&&"containerId"in e.sortable&&"items"in e.sortable&&"index"in e.sortable)}const A_=[lt.Down,lt.Right,lt.Up,lt.Left],x_=(o,e)=>{let{context:{active:n,collisionRect:a,droppableRects:i,droppableContainers:l,over:u,scrollableAncestors:d}}=e;if(A_.includes(o.code)){if(o.preventDefault(),!n||!a)return;const f=[];l.getEnabled().forEach(b=>{if(!b||b!=null&&b.disabled)return;const v=i.get(b.id);if(v)switch(o.code){case lt.Down:a.top<v.top&&f.push(b);break;case lt.Up:a.top>v.top&&f.push(b);break;case lt.Left:a.left>v.left&&f.push(b);break;case lt.Right:a.left<v.left&&f.push(b);break}});const g=nE({collisionRect:a,droppableRects:i,droppableContainers:f});let m=Tm(g,"id");if(m===u?.id&&g.length>1&&(m=g[1].id),m!=null){const b=l.get(n.id),v=l.get(m),S=v?i.get(v.id):null,_=v?.node.current;if(_&&S&&b&&v){const k=ac(_).some((z,q)=>d[q]!==z),O=ey(b,v),M=T_(b,v),x=k||!O?{x:0,y:0}:{x:M?a.width-S.width:0,y:M?a.height-S.height:0},D={x:S.left,y:S.top};return x.x&&x.y?D:yo(D,x)}}}};function ey(o,e){return!fc(o)||!fc(e)?!1:o.data.current.sortable.containerId===e.data.current.sortable.containerId}function T_(o,e){return!fc(o)||!fc(e)||!ey(o,e)?!1:o.data.current.sortable.index<e.data.current.sortable.index}const R_={verticalList:g_,horizontalList:f_,rectSorting:sf},k_=({items:o,itemKey:e,strategy:n,children:a,onSortEnd:i,onSortStart:l,sortVersion:u})=>{const d=H.useId(),f=H.useRef({inProgress:!1,lastSortTime:0,lastActiveId:null}),g=ZC(Em(ef,{activationConstraint:{distance:5}}),Em(Qd,{coordinateGetter:x_})),m=H.useCallback(S=>{f.current={inProgress:!0,lastSortTime:Date.now(),lastActiveId:S.active.id},l?.({activeId:S.active.id})},[l]),b=H.useCallback(S=>{const{active:_,over:A}=S,k=Date.now();if(!A||_.id===A.id){f.current.inProgress=!1;return}const{lastSortTime:O,lastActiveId:M,inProgress:x}=f.current;if(M===_.id&&k-O<500&&!x)return;f.current={inProgress:!1,lastSortTime:k,lastActiveId:_.id};const D=o.findIndex(z=>String(z[e])===String(_.id)),U=o.findIndex(z=>String(z[e])===String(A.id));if(D!==-1&&U!==-1&&D!==U){const z=af(o,D,U);i?.(z,{oldIndex:D,newIndex:U})}},[o,e,i]),v=o.map(S=>String(S[e]));return ht.jsx(t_,{id:d,sensors:g,collisionDetection:tE,onDragStart:m,onDragEnd:b,children:ht.jsx(m_,{items:v,strategy:R_[n],children:a})},u!==void 0?`${d}-v${u}`:d)},ty=H.createContext(null),D_=({value:o,children:e})=>ht.jsx(ty.Provider,{value:o,children:e}),O_=()=>H.useContext(ty),L_=({id:o,handle:e,as:n="div",children:a})=>{const{attributes:i,listeners:l,setNodeRef:u,transform:d,transition:f,isDragging:g}=E_({id:o}),m={transform:bo.Transform.toString(d),transition:f,opacity:g?.5:1,position:"relative"};return ht.jsx(n,{ref:u,style:m,...i,...e?{}:l,"data-sortable-item":!0,"data-sortable-id":String(o),"data-dragging":g,children:ht.jsx(D_,{value:{listeners:l,handle:e,isDragging:g},children:a})})},dt=ft("DynamicRenderer");function Qr(){try{return window.G7Core?.devTools}catch{return}}function of(o,e,n,a){if(typeof o=="string"){if(/\$t:[a-zA-Z_][a-zA-Z0-9_.\-]*/.test(o))try{return e.resolveTranslations(o,n,a)}catch{return o}return o}if(Array.isArray(o))return o.map(i=>of(i,e,n,a));if(o&&typeof o=="object"){const i={};for(const[l,u]of Object.entries(o))i[l]=of(u,e,n,a);return i}return o}function M_(o){const e=Object.keys(o);return e.length>0&&e.every(n=>/^\d+$/.test(n))}const vr=(o,e)=>{const n=["errors"],a={...o};for(const i of Object.keys(e)){const l=e[i],u=o[i];if(l===null){a[i]=null;continue}if(n.includes(i)){a[i]=l;continue}if(Array.isArray(l)){a[i]=l;continue}if(Array.isArray(u)&&l!==null&&typeof l=="object"&&!Array.isArray(l)&&M_(l)){const d=Object.keys(l).map(g=>parseInt(g,10));if((d.length>0?Math.max(...d):0)>=u.length+d.length+10)a[i]={...l};else{const g=[...u];for(const[m,b]of Object.entries(l)){const v=parseInt(m,10);v>=0&&v<g.length?b!==null&&typeof b=="object"&&!Array.isArray(b)&&g[v]!==null&&typeof g[v]=="object"?g[v]=vr(g[v],b):g[v]=b:v>=g.length&&(g[v]=b)}a[i]=g}}else l!==null&&typeof l=="object"&&u!==null&&typeof u=="object"&&!Array.isArray(u)?a[i]=vr(u,l):a[i]=l}return a},hc=(o,e)=>{let n=null;const a=()=>(n===null&&(n={...o}),n);for(const i of Object.keys(e)){if(!(i in o))continue;const l=e[i],u=o[i];if(l!==null&&typeof l=="object"&&!Array.isArray(l)&&u!==null&&typeof u=="object"&&!Array.isArray(u)){const d=hc(u,l);if(d===u)continue;Object.keys(d).length===0?delete a()[i]:a()[i]=d}else delete a()[i]}return n??o},$_=o=>{const e={},n=o.split(";").filter(a=>a.trim());for(const a of n){const i=a.indexOf(":");if(i===-1)continue;const l=a.substring(0,i).trim(),u=a.substring(i+1).trim();if(l&&u){const d=l.replace(/-([a-z])/g,(f,g)=>g.toUpperCase());e[d]=u}}return e};class N_ extends H.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,n){dt.error(`컴포넌트 렌더링 에러 (ID: ${this.props.componentId}, Name: ${this.props.componentName}):`,e,n)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:ht.jsxs("div",{className:"p-4 my-2 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg text-red-800 dark:text-red-400",children:[ht.jsx("div",{className:"font-semibold mb-1",children:"컴포넌트 로드 실패"}),ht.jsxs("div",{className:"text-xs opacity-80",children:[this.props.componentName&&`[${this.props.componentName}] `,"데이터를 표시할 수 없습니다."]}),this.state.error&&ht.jsxs("details",{className:"mt-2",children:[ht.jsx("summary",{className:"cursor-pointer text-xs opacity-70 hover:opacity-100",children:"상세 정보"}),ht.jsx("div",{className:"mt-1 p-2 bg-red-100 dark:bg-red-900/30 rounded text-xs font-mono whitespace-pre-wrap break-all",children:this.state.error.message})]})]}):this.props.children}}const jr=H.memo(({componentDef:o,dataContext:e,translationContext:n,registry:a,bindingEngine:i,translationEngine:l,actionDispatcher:u,parentComponentContext:d,parentFormContextProp:f,parentDataContext:g,isRootRenderer:m=!1,isInsideIteration:b=!1,isEditMode:v=!1,onComponentSelect:S,onComponentHover:_,onDragStart:A,onDragEnd:k,componentPath:O,layoutKey:M})=>{const[x,D]=H.useState({loadingActions:{}});H.useLayoutEffect(()=>{d||(i.startRenderCycle(),window.__g7SetLocalOverrideKeys||(window.__g7ForcedLocalFields=void 0),window.__g7PendingLocalState=null)});const U=H.useRef(null);H.useLayoutEffect(()=>{if(!d&&e._localInit&&typeof e._localInit=="object"){const{_forceLocalInit:V,_merge:se,...le}=e._localInit,Z=`${JSON.stringify(le)}:${V||"no-force"}`;if(U.current!==Z){U.current=Z;const ye=se||"shallow",Ee=window.G7Core?.state?.get?.()?._local||{},_e=window.__g7PendingLocalState||{},Ke={...Ee,..._e};ye==="replace"?window.__g7PendingLocalState={loadingActions:Ke.loadingActions||{},...le,hasChanges:!1}:ye==="deep"?window.__g7PendingLocalState=vr(Ke,{...le,hasChanges:!1}):window.__g7PendingLocalState={...Ke,...le,hasChanges:!1};const xe=window.__g7SetLocalOverrideKeys;xe&&typeof xe=="object"&&(ye==="replace"?window.__g7SetLocalOverrideKeys={...le,hasChanges:!1}:window.__g7SetLocalOverrideKeys=vr(xe,{...le,hasChanges:!1}))}}}),H.useLayoutEffect(()=>{if(!d){const V=window.__g7SetLocalOverrideKeys;if(V){D(ye=>hc(ye,V));const se=V,le=window.__g7ForcedLocalFields,Z=window.__g7LastSetLocalSnapshot;queueMicrotask(()=>{window.__g7SetLocalOverrideKeys===se&&(window.__g7SetLocalOverrideKeys=void 0),window.__g7ForcedLocalFields===le&&(window.__g7ForcedLocalFields=void 0),window.__g7LastSetLocalSnapshot===Z&&(window.__g7LastSetLocalSnapshot=void 0)})}}},[e._local]);const z=H.useRef(M);H.useEffect(()=>{o._fromBase&&M&&z.current!==M&&(z.current=M,D({loadingActions:{}}))},[M,o._fromBase]);const q=H.useRef(""),X=H.useRef(!1),pe=H.useRef(null),Ce=H.useRef(null),ve=H.useRef({}),Le=H.useRef({}),Ve=H.useRef(g),Fe=zC(),Tt=gC(),J=Tt?.getParentDataContext()??g;H.useEffect(()=>{if(e._localInit&&typeof e._localInit=="object"){const{_forceLocalInit:V,...se}=e._localInit,le=JSON.stringify(se),Z=V!==void 0,ye=zd(),ue=`${le}:${V||"no-force"}`,Ee=CC({globalTrackedKey:ye.hash,instanceHandledKey:Ce.current,trackingKey:ue});if(Ee==="apply"){Ce.current=ue,ye.hash=ue,ye.timestamp=V,q.current=le,Z&&(X.current=!0);const{_merge:Ke,...xe}=se,Ie=Ke||"shallow";D(Re=>Ie==="replace"?{loadingActions:Re.loadingActions||{},...xe,hasChanges:!1}:Ie==="deep"?vr(Re,{...xe,hasChanges:!1}):{...Re,...xe,hasChanges:!1}),e._globalSetState&&e._globalSetState(Re=>{const et=Re?._local||{};let je;return Ie==="replace"?je={...xe,hasChanges:!1}:Ie==="deep"?je=vr(et,{...xe,hasChanges:!1}):je={...et,...xe,hasChanges:!1},{...Re,_local:je}}),i.invalidateCacheByKeys(["_local"]),dt.log("_localInit applied (data changed):",Object.keys(se))}else if(Ee==="prune"){Ce.current=ue;const{_merge:Ke,...xe}=se;D(Re=>hc(Re,xe)),hc(x,xe)!==x&&(i.invalidateCacheByKeys(["_local"]),dt.log("_localInit pruned (applied by another renderer):",Object.keys(xe)))}pe.current=e._localInit,SC(e._localInit)}},[e._localInit,g,i]);const{isTransitioning:de}=hm(),Ne=kC(),ee=f??Ne,{width:ge}=Ud(),N=O_(),T=H.useMemo(()=>{let V=o;if(o.type==="iterator"&&o.data){const{data:Z,itemName:ye,indexName:ue,...Ee}=o;V={...Ee,iteration:{source:Z,item_var:ye||"item",index_var:ue}}}if(!V.responsive)return V;const se=ci.getMatchingKey(V.responsive,ge);if(!se)return V;const le=V.responsive[se];return{...V,props:{...V.props,...le.props},children:le.children??V.children,text:le.text??V.text,if:le.if??V.if,iteration:le.iteration??V.iteration,__responsiveChildrenKey:le.children!==void 0?se:void 0}},[o,ge]),fe=H.useCallback(V=>{const se=V?.__setStateId;if(D(le=>{const Z=window.__g7PendingLocalState,ue=window.__g7SetLocalOverrideKeys||Z,Ee=ue?vr(le,ue):le;if(typeof V=="function"){const Re=V(Ee);return vr(Ee,Re)}const{__mergeMode:_e,__setStateId:Ke,...xe}=V;let Ie;if(_e==="replace"?Ie=xe:_e==="shallow"?Ie={...Ee,...xe}:Ie=vr(Ee,xe),_e!==void 0){const Re=window.__g7ForcedLocalFields;Re&&(window.__g7ForcedLocalFields={...Re,...xe})}return Ie}),se){const le=Qr();if(le?.isEnabled()){const Z=T.id||"unknown",ye=T.name||"Unknown";setTimeout(()=>{le.trackComponentRender?.(Z,ye,0,["_local"],[]),le.completeStateChange?.(se)},0)}}},[T.id,T.name]),he=d?.state??x,Ae=d?.setState??fe,te=H.useMemo(()=>{const V=e._localInit&&e._localInit!==pe.current;let se;V&&e._local?se=e._local:se=e._local?vr(e._local,he):he;const le=window.__g7ForcedLocalFields;le&&(se=vr(se,le));const Z={...e,_local:se},ye=e._computedDefinitions;if(ye&&Object.keys(ye).length>0){const ue=new On,Ee={...Z,...Fe?{_isolated:Fe.state}:{}},_e={},Ke=Qr(),xe=Ke?.isEnabled()??!1;for(const[Ie,Re]of Object.entries(ye)){const et=xe?Date.now():0,je=xe?e._computed?.[Ie]:void 0;let De;try{if(typeof Re=="string")if(Re.startsWith("{{")&&Re.endsWith("}}")){const Te=Re.slice(2,-2).trim(),Ue=ue.evaluateExpression(Te,Ee,{skipCache:!0});_e[Ie]=Ue}else _e[Ie]=Re;else if(Re&&typeof Re=="object"&&"$switch"in Re){const Te=ue.resolveSwitch(Re,Ee,{skipCache:!0});_e[Ie]=Te}}catch(Te){dt.warn(`Failed to recalculate computed value: ${Ie}`,Te),_e[Ie]=e._computed?.[Ie],De=Te instanceof Error?Te.message:String(Te)}if(xe&&(De||je!==_e[Ie])){const Ue=Date.now()-et;Ke.trackComputedProperty?.(Ie,typeof Re=="string"?Re:JSON.stringify(Re),[{type:"_local",path:"_local",value:Z._local}],_e[Ie],Ue,T.id,De),je!==_e[Ie]&&Ke.trackComputedRecalc?.(Ie,"dependency-change",je,_e[Ie],Ue,{type:"_local",path:"_local"},T.id)}}Z._computed=_e}if(Fe&&(Z._isolated=Fe.state),J&&(Z.$parent=J),o.extensionPointProps){const ue=i.resolveObject(o.extensionPointProps,Z,b?{skipCache:!0}:void 0);Z.extensionPointProps=v&&l?of(ue,l,n,Z):ue}return o.extensionPointCallbacks&&(Z.extensionPointCallbacks=o.extensionPointCallbacks),v&&(Z.$templateId===void 0&&n?.templateId&&(Z.$templateId=n.templateId),Z.$locale===void 0&&n?.locale&&(Z.$locale=n.locale)),Z},[e,he,Fe?.state,J,Tt?.version,o.extensionPointProps,o.extensionPointCallbacks]);ve.current=te._local,Le.current=te._computed||{},Ve.current=J,H.useEffect(()=>{const V=Qr();if(!V?.isEnabled())return;const se=te._local;se&&V.updateLocalState(se);const le=te._computed;le&&V.updateComputedState(le),J&&V.updateParentContext?.(J);const Z=T.id||`comp-${Date.now()}`,ye=T.name||"Unknown",ue={global:Object.keys(e._global||{}),local:Object.keys(se||{}),context:d?Object.keys(d.state||{}):[]},Ee={type:d?"componentContext":"dynamicState",hasComponentContext:!!d,parentId:d?"parent":void 0};V.trackComponentStateSource?.(Z,ye,ue,Ee),he&&Object.keys(he).length>0&&V.trackDynamicState?.(Z,he);const _e=!!(T.expandChildren||T.props?.expandChildren);V.trackContextFlow?.(Z,ye,!!d,_e,!0)},[te._local,e,T.id,T.name,d,he,T.expandChildren,T.props?.expandChildren,J]);const we=H.useMemo(()=>({state:{...te._local},setState:Ae,stateRef:ve,computedRef:Le,isolatedContext:Fe,parentDataContext:te}),[te._local,Ae,x,Fe,te]),qe=H.useMemo(()=>{const V=Qi({if:T.if,condition:T.condition,conditions:T.conditions},te,i,T.id);if(T.if||T.condition!==void 0||T.conditions){const le=Qr();le?.isEnabled()&&T.if&&le.trackIfCondition(T.id||`if-${Date.now()}`,T.if,V)}return V},[T.if,T.conditions,te,i,T.id]),ke=H.useMemo(()=>{if(!T.slot)return null;const V=T.slot;if(V.startsWith("{{")&&V.endsWith("}}")){const se=V.slice(2,-2).trim();try{const le={componentId:T.id,componentName:T.name,propName:"slot"},Z=i.evaluateExpression(se,te,le);return dt.log(`[Slot] 표현식 평가: "${se}" => "${Z}" (컴포넌트: ${T.id})`),typeof Z=="string"?Z:null}catch(le){return dt.warn(`slot 표현식 평가 실패 (컴포넌트: ${T.id}):`,le),null}}return dt.log(`[Slot] 정적 슬롯 ID: "${V}" (컴포넌트: ${T.id})`),V},[T.slot,T.id,te,i]),ze=H.useMemo(()=>!ke||!T.id?"":`${T.id}-${ke}-${JSON.stringify(T.slotOrder??0)}`,[ke,T.id,T.slotOrder]),Ct=H.useRef(null);H.useEffect(()=>{const V=window.__slotContextValue,se=V?.isEnabled??!1;if(T.slot&&dt.log(`[Slot Registration] 컴포넌트: ${T.id}, isSlotEnabled: ${se}, shouldRender: ${qe}, resolvedSlotId: ${ke}`),!se||!qe){T.slot&&dt.log(`[Slot Registration] 등록 스킵 - isSlotEnabled: ${se}, shouldRender: ${qe}`),Ct.current&&T.id&&V&&(V.unregisterFromSlot(Ct.current,T.id),Ct.current=null);return}if(!ke||!T.id){T.slot&&dt.log(`[Slot Registration] 등록 스킵 - resolvedSlotId: ${ke}, id: ${T.id}`),Ct.current&&T.id&&V&&(V.unregisterFromSlot(Ct.current,T.id),Ct.current=null);return}Ct.current&&Ct.current!==ke&&V.unregisterFromSlot(Ct.current,T.id);const le={...T,slot:void 0,slotOrder:void 0};return V.registerToSlot(ke,T.id,{componentDef:le,dataContext:e,order:T.slotOrder??0,parentFormContext:f??null,getParentComponentContext:()=>we,translationContext:n,registrationKey:ze}),Ct.current=ke,()=>{const Z=window.__slotContextValue;ke&&T.id&&Z&&Z.unregisterFromSlot(ke,T.id)}},[qe,ke,T,e,f,we,n,ze]);const it=H.useCallback(V=>{if(typeof V=="string"){if(cp(V))return dp(V);if(up(V)){const se=[],le=V.replace(new RegExp(`${Ll}([^${Zs}]*)${Zs}`,"g"),(ye,ue)=>(se.push(ue),`${_a}${se.length-1}${_a}`));let Z=le;return/\$t:[a-zA-Z0-9._-]+/.test(le)&&(Z=l.resolveTranslations(le,n,te)),Z.replace(new RegExp(`${_a}(\\d+)${_a}`,"g"),(ye,ue)=>se[parseInt(ue)])}if(V.startsWith("$t:defer:"))return V;if(/\$t:[a-zA-Z0-9._-]+/.test(V)){const se=V.trim();return se.startsWith("{")&&se.endsWith("}")||se.startsWith("[")&&se.endsWith("]")?V:l.resolveTranslations(V,n,te)}return V}if(Array.isArray(V))return V.map(se=>it(se));if(V&&typeof V=="object"){const se={};for(const[le,Z]of Object.entries(V))se[le]=it(Z);return se}return V},[l,n,te]),Ot=H.useCallback(V=>/[?:|&!+\-*/<>=()]/.test(V),[]),vt=H.useCallback(V=>{if(!V.startsWith("{{")||!V.endsWith("}}"))return null;const se=V.slice(2,-2);let le=null,Z=0;for(let ye=0;ye<se.length;ye++){const ue=se[ye];if((ye>0?se[ye-1]:"")!=="\\"&&((ue==='"'||ue==="'")&&!le?le=ue:ue===le&&(le=null),!le&&(ue==="{"&&Z++,ue==="}"&&Z--,Z<0)))return null}return Z===0?se.trim():null},[]),_t=H.useMemo(()=>{let V={...T.props||{}};const se=["cellChildren","expandChildren","expandContext","render"],Z=a.getMetadata(T.name)?.skipBindingKeys||[],ye=[...new Set([...se,...Z])],ue=b?{skipCache:!0}:void 0,Ee=De=>{if(ue)return ue;if(De.startsWith("_computed")||De.startsWith("$computed"))return{skipCache:!0}};for(const[De,Te]of Object.entries(V))if(!ye.includes(De))if(typeof Te=="string"){const Ue=vt(Te);if(Ue!==null){let gt=!1,St=Ue;Ue.startsWith(Nr)&&(gt=!0,St=Ue.slice(Nr.length));const ln={componentId:T.id,componentName:T.name,propName:De};let cn;if(li(St))cn=i.resolveBindings(`{{${St}}}`,te,ue,ln);else if(Ot(St))try{cn=i.evaluateExpression(St,te,ln)}catch(Rn){dt.warn(`표현식 평가 실패 (컴포넌트: ${T.id}, prop: ${De}):`,Rn),cn=void 0}else cn=i.resolve(St,te,Ee(St),ln);V[De]=gt&&cn!=null?Ji(cn):cn}else{const gt={componentId:T.id,componentName:T.name,propName:De};V[De]=i.resolveBindings(Te,te,ue,gt)}}else Array.isArray(Te)?V[De]=Te.map(Ue=>typeof Ue=="string"?i.resolveBindings(Ue,te,ue):typeof Ue=="object"&&Ue!==null?i.resolveObject(Ue,te,ue):Ue):Te&&typeof Te=="object"&&(V[De]=i.resolveObject(Te,te,ue));for(const[De,Te]of Object.entries(V))V[De]=it(Te);if(typeof V.style=="string"&&(V.style=$_(V.style)),V=gd(V,v?void 0:T.actions,te,{componentContext:we,actionDispatcher:u}),T.classMap){const De=gw(T.classMap,te,i,{skipCache:!0});if(De){const Te=V.className||"";V.className=Te?`${Te} ${De}`:De}}T.style&&(V.style=T.style),T.actions&&T.actions.length>0&&T.type==="composite"&&Object.assign(V,he),T.component_layout&&(V.__componentLayoutDefs=T.component_layout);const _e=T.expandChildren||T.props?.expandChildren,Ke=T.props?.cellChildren,xe=T.children&&T.children.length>0,Ie=T.component_layout,Re=T.slot,et=T.props?.modalId,je=T.type==="composite";return(_e||Ke||xe||Ie||Re||et||je)&&(V.__componentContext=we),V},[T.props,T.actions,T.style,T.classMap,T.id,te,n,i,l,we,he,it,Ot,vt,b]),Me=H.useRef(null),tt=H.useMemo(()=>Me.current&&pm(Me.current,_t)?Me.current:(Me.current=_t,_t),[_t]),nn=H.useMemo(()=>{const V=T.id;if(typeof V!="string"||!V.includes("{{"))return V;const se=i.resolveBindings(V,te,{skipCache:!0});return typeof se=="string"?se:V},[T.id,te,i]),Mt=H.useMemo(()=>{const V=T.dataKey,se=T.trackChanges,le=T.debounce;if(V){const Z=V.startsWith("_global."),ye=Z?V.slice(8):V,ue=Z?e._global:te._local;return{dataKey:ye,trackChanges:se??!1,debounce:le,setState:Z?_e=>{e._globalSetState?e._globalSetState(_e):dt.warn("_global.formData 사용 시 _globalSetState가 필요합니다.")}:Ae,state:ue??{},_isGlobal:Z}}if(ee.dataKey)return ee},[T.dataKey,T.trackChanges,T.debounce,T.id,Ae,te._local,e._global,e._globalSetState,ee]),Pt=H.useRef(new Set);H.useEffect(()=>{Pt.current.clear()},[e._global?._remountKeys]);const rn=H.useCallback((V,se)=>{const le=e._global?._remountKeys;return V&&le?.[V]&&!Pt.current.has(V)?(Pt.current.add(V),`${V}-remount-${le[V]}`):V||se},[e._global?._remountKeys]),an=H.useMemo(()=>{if(T.text!==void 0){if(typeof T.text=="string"){const V=T.text;let se=V;const le={componentId:T.id,componentName:T.name,propName:"text",skipCache:!0},Z=vt(V);if(Z!==null){let ye=!1,ue=Z;if(Z.startsWith(Nr)&&(ye=!0,ue=Z.slice(Nr.length)),li(ue))se=i.resolveBindings(`{{${ue}}}`,te,{skipCache:!0},le);else if(Ot(ue))try{se=i.evaluateExpression(ue,te,le)}catch(Ee){dt.warn(`text 표현식 평가 실패 (컴포넌트: ${T.id}):`,Ee),se=""}else se=i.resolve(ue,te,{skipCache:!0},le);ye&&se!=null&&(se=Ji(se))}else V.includes("{{")&&(se=i.resolveBindings(V,te,{skipCache:!0},le));return se=it(se),se??""}return T.text}return!T.children||T.children.length===0?null:T.children.map((V,se)=>{if(typeof V=="string")return V;const le=T.__responsiveChildrenKey,Z=le?`responsive.${le}.children`:"children",ye=O?`${O}.${Z}.${se}`:`${se}`,ue=V._fromBase?V.id||`child-${se}`:rn(V.id,`child-${se}`),Ee=!V._fromBase&&M?`${ue}_${M}`:ue;return ht.jsx(jr,{componentDef:V,dataContext:te,translationContext:n,registry:a,bindingEngine:i,translationEngine:l,actionDispatcher:u,parentComponentContext:we,parentFormContextProp:Mt,isInsideIteration:b,isEditMode:v,onComponentSelect:S,onComponentHover:_,componentPath:ye,onDragStart:A,onDragEnd:k,layoutKey:M},Ee)})},[T.text,T.children,T.id,e,te,n,a,i,l,u,we,Mt,vt,Ot,it,rn,b,v,S,_,O,A,k,M]),ea=H.useMemo(()=>{if(!T.iteration)return null;try{const V=hd(T.iteration.source,te,i);if(!Array.isArray(V))return dt.warn(`iteration source가 배열이 아닙니다 (컴포넌트: ${T.id}):`,V),null;const se=Qr();return se?.isEnabled()&&se.trackIteration(T.id||`iteration-${Date.now()}`,T.iteration.source,T.iteration.item_var,T.iteration.index_var,V.length),V.map((le,Z)=>{const ye={...te,[T.iteration.item_var]:le};T.iteration.index_var&&(ye[T.iteration.index_var]=Z);const ue=Z===0||Z===V.length-1;se?.isEnabled()&&ue&&se.trackNestedContext?.({componentId:`${T.id||"unknown"}-iter-${Z}`,componentType:"iteration",parentContext:{available:Object.keys(te),values:{}},ownContext:{added:[T.iteration.item_var,...T.iteration.index_var?[T.iteration.index_var]:[]],values:{[T.iteration.item_var]:le,...T.iteration.index_var?{[T.iteration.index_var]:Z}:{}}},depth:1});const Ee={...T,iteration:void 0,responsive:void 0},_e=O?`${O}.iteration.${Z}`:`iteration.${Z}`,Ke=`${rn(T.id,"item")}-${Z}`;return ht.jsx(jr,{componentDef:Ee,dataContext:ye,translationContext:n,registry:a,bindingEngine:i,translationEngine:l,actionDispatcher:u,parentComponentContext:we,parentFormContextProp:Mt,isInsideIteration:!0,isEditMode:v,onComponentSelect:S,onComponentHover:_,componentPath:_e,onDragStart:A,onDragEnd:k,layoutKey:M},Ke)})}catch(V){return dt.error(`iteration 렌더링 실패 (컴포넌트: ${T.id}):`,V),null}},[T.iteration,T.children,T.id,e,te,n,a,i,l,u,we,Mt,rn,v,S,_,O,A,k,M]),[qt,bi]=H.useState(0),ta=H.useMemo(()=>{if(!T.sortable||!T.itemTemplate)return null;const{sortable:V,itemTemplate:se}=T;try{const le=hd(V.source,te,i);if(!Array.isArray(le))return dt.warn(`sortable source가 배열이 아닙니다 (컴포넌트: ${T.id}):`,le),null;if(le.length===0)return null;const Z=V.itemKey||"id",ye=V.strategy||"verticalList",ue=V.itemVar||"$item",Ee=V.indexVar||"$index",_e=V.handle,Ke=V.wrapperElement,xe=(et,je)=>{const De=T.actions?.filter(Te=>Te.event==="onSortEnd"||Te.type==="onSortEnd");if(bi(Te=>Te+1),De&&De.length>0&&u){const Te={...te,$sortedItems:et,$sortEvent:je};De.forEach(Ue=>{try{const gt=u.createHandler(Ue,Te,we),St=new Event("sortend");gt(St)}catch(gt){dt.error(`onSortEnd action failed: ${Ue.handler}`,gt)}})}},Ie=et=>{const je=T.actions?.filter(De=>De.event==="onSortStart"||De.type==="onSortStart");if(je&&je.length>0&&u){const De={...te,$activeId:et.activeId};je.forEach(Te=>{try{const Ue=u.createHandler(Te,De,we),gt=new Event("sortstart");Ue(gt)}catch(Ue){dt.error(`onSortStart action failed: ${Te.handler}`,Ue)}})}},Re=le.map((et,je)=>{const De=String(et[Z]),Te={...te,[ue]:et,[Ee]:je},Ue=O?`${O}.sortable.${je}`:`sortable.${je}`,gt=`${rn(T.id,"sortable-item")}-v${qt}-${De}`;return ht.jsx(L_,{id:De,handle:_e,...Ke?{as:Ke}:{},children:(Ke&&se.children?se.children:[se]).map((St,ln)=>ht.jsx(jr,{componentDef:St,dataContext:Te,translationContext:n,registry:a,bindingEngine:i,translationEngine:l,actionDispatcher:u,parentComponentContext:we,parentFormContextProp:void 0,isInsideIteration:!0,isEditMode:v,onComponentSelect:S,onComponentHover:_,componentPath:Ue,onDragStart:A,onDragEnd:k,layoutKey:M},`${gt}-child-${ln}`))},gt)});return ht.jsx(k_,{items:le,itemKey:Z,strategy:ye,onSortEnd:xe,onSortStart:Ie,sortVersion:qt,children:Re})}catch(le){return dt.error(`sortable 렌더링 실패 (컴포넌트: ${T.id}):`,le),null}},[T.sortable,T.itemTemplate,T.actions,T.id,e,te,n,a,i,l,u,we,rn,v,S,_,O,A,k,qt,M]),yn=H.useRef(!1);H.useEffect(()=>{if(yn.current)return;yn.current=!0;const V=Qr();if(V?.isEnabled()&&V.trackMount(o.id,{name:o.name,type:o.type||"component",props:tt}),o.lifecycle?.onMount&&o.lifecycle.onMount.length>0)for(const le of o.lifecycle.onMount)try{const Z=u.createHandler(le,te,we),ye=new Event("mount");Z(ye),dt.log(`Lifecycle onMount executed: ${le.handler} (Component: ${o.id})`)}catch(Z){dt.error(`Lifecycle onMount failed: ${le.handler} (Component: ${o.id})`,Z)}const se=[];if(o.onComponentEvent&&o.onComponentEvent.length>0){const le=window.G7Core;if(le?.componentEvent?.on)for(const Z of o.onComponentEvent){if(!Z.event){dt.warn(`onComponentEvent: event name is required (Component: ${o.id})`);continue}const ye=async Ee=>{try{const _e={...te,_eventData:Ee},xe=await u.createHandler({handler:Z.handler,params:Z.params,onSuccess:Z.onSuccess,onError:Z.onError},_e,we)(new CustomEvent(Z.event,{detail:Ee}));return dt.log(`onComponentEvent "${Z.event}" handled: ${Z.handler} (Component: ${o.id})`,{eventData:Ee,result:xe}),xe}catch(_e){throw dt.error(`onComponentEvent "${Z.event}" failed: ${Z.handler} (Component: ${o.id})`,_e),_e}},ue=le.componentEvent.on(Z.event,ye);se.push(ue),dt.log(`onComponentEvent: Subscribed to "${Z.event}" (Component: ${o.id})`)}else dt.warn(`onComponentEvent: G7Core.componentEvent is not available (Component: ${o.id})`)}return()=>{const le=Qr();le?.isEnabled()&&le.trackUnmount(o.id);for(const Z of se)try{Z()}catch(ye){dt.error(`onComponentEvent: Failed to unsubscribe (Component: ${o.id})`,ye)}if(se.length>0&&dt.log(`onComponentEvent: Unsubscribed ${se.length} event(s) (Component: ${o.id})`),o.lifecycle?.onUnmount&&o.lifecycle.onUnmount.length>0)for(const Z of o.lifecycle.onUnmount)try{const ye=u.createHandler(Z,te,we),ue=new Event("unmount");ye(ue),dt.log(`Lifecycle onUnmount executed: ${Z.handler} (Component: ${o.id})`)}catch(ye){dt.error(`Lifecycle onUnmount failed: ${Z.handler} (Component: ${o.id})`,ye)}}},[]);const Ln=H.useMemo(()=>{const V=tt.dataKey,se=tt.trackChanges,le=tt.debounce;return V?{dataKey:V,trackChanges:se??!1,debounce:le,setState:Ae,state:he}:null},[tt.dataKey,tt.trackChanges,tt.debounce,Ae,he]);H.useEffect(()=>{const V=T.dataKey||tt.dataKey;if(!V)return;const se=Qr();if(!se?.isEnabled())return;const le=[],Z=ue=>{if(ue)for(const Ee of ue){const _e=Ee?.props?.name;if(_e&&le.push({name:_e,type:Ee.name||Ee.type||"unknown"}),Ee?.children&&Z(Ee.children),Ee?.slots)for(const Ke of Object.values(Ee.slots))Array.isArray(Ke)&&Z(Ke)}};if(o.children&&Z(o.children),o.slots)for(const ue of Object.values(o.slots))Array.isArray(ue)&&Z(ue);const ye=o.id||`form-${V}`;return se.trackForm(ye,V,le),()=>{se.untrackForm(ye)}},[T,tt.dataKey,o.id,o.children]);const nt=H.useRef(null),Hn=H.useRef(void 0);H.useEffect(()=>{const V=tt?.name;if(!V||!ee.dataKey||!ee.setState||tt?.autoBinding===!1)return;const se=`${ee.dataKey}.${V}`,le=window.__g7AutoBindingPaths??new Map;return window.__g7AutoBindingPaths=le,le.set(se,(le.get(se)??0)+1),()=>{const Z=le.get(se)??0;Z<=1?le.delete(se):le.set(se,Z-1)}},[tt?.name,tt?.autoBinding,ee.dataKey,ee.setState]);const bn=H.useMemo(()=>{const{dataKey:V,trackChanges:se,debounce:le,...Z}=tt,ye=Z.name;if(!ye||!ee.dataKey||!ee.setState)return Z;if(Z.autoBinding===!1){const{autoBinding:De,...Te}=Z;return Te}const ue=`${ee.dataKey}.${ye}`,Ee=DC(ee.state,ue),_e=Ee!==void 0?Ee:Z.value,xe=a.getMetadata(o.name)?.bindingType,Ie=typeof _e=="boolean"&&(xe==="checked"||xe==="checkable"&&["checkbox","radio"].includes(Z?.type)),Re=ee.debounce,et=De=>{const Te=ee.state||{},Ue=OC(Te,ue,De);if(ee.trackChanges&&(Ue.hasChanges=!0),window.__g7PendingLocalState=Ue,ee.setState(Ue),ee._isGlobal)return;const gt=window.G7Core,St={[ue]:De};ee.trackChanges&&(St.hasChanges=!0),gt?.state?.setLocal?.(St,{render:!1})},je=(De,Te)=>{Re&&Re>0?(nt.current&&clearTimeout(nt.current),nt.current=setTimeout(()=>{et(De),nt.current=null,Te&&(Te(),window.__g7PendingLocalState=null)},Re)):(et(De),Te&&(Te(),window.__g7PendingLocalState=null))};if(Ie)return{...Z,checked:_e,onChange:Te=>{const Ue=Te.target.checked;et(Ue),Z.onChange&&Z.onChange(Te)}};{const De=Ue=>{const gt=Ue?.target?.value!==void 0?Ue.target.value:Ue;Re&&Re>0&&(Hn.current=gt);const St=Ue?.target?{target:{value:gt,name:Ue.target.name,type:Ue.target.type,checked:Ue.target.checked},currentTarget:Ue.currentTarget?{value:gt,name:Ue.currentTarget.name}:void 0}:Ue;je(gt,()=>{Z.onChange&&Z.onChange(St)})};let Te;return Hn.current!==void 0?nt.current!==null?Te=Hn.current:String(_e??"")===String(Hn.current)?(Hn.current=void 0,Te=_e??""):Te=Hn.current:Te=_e??"",{...Z,value:Te,onChange:De}}},[tt,ee,ee.state,ee.debounce]),na=H.useMemo(()=>{const V=Qr();if(V?.isEnabled()&&V.trackRender(o.name),!qe)return null;if(T.sortable&&T.itemTemplate)return ta;if(T.iteration)return ea;if(T.type==="extension_point"){const{layout:xe,columns:Ie,gap:Re,className:et,...je}=T.props||{};let De=et||"";return xe==="grid"&&Ie?De=`${De} grid grid-cols-${Ie} gap-${Re||4}`.trim():xe==="flex"&&(De=`${De} flex flex-col gap-${Re||4}`.trim()),ht.jsx("div",{id:nn,className:De||void 0,...je,children:an})}const se=a.getComponent(T.name);if(!se)return dt.error(`컴포넌트를 찾을 수 없습니다: ${T.name} (ID: ${T.id})`,"componentDef:",JSON.stringify(T,null,2)),null;const le=e._global?._remountKeys,Z={...bn,id:bn.id??nn,...le&&Object.keys(le).length>0&&{__remountTrigger:JSON.stringify(le)}};if(N?.listeners&&N.handle&&bn["data-drag-handle"]!==void 0&&(Object.assign(Z,N.listeners),Z.style={...Z.style,cursor:N.isDragging?"grabbing":"grab"}),v){const xe=T.id||`auto_${T.name||T.type||"unknown"}_${Math.random().toString(36).substring(2,8)}`,Ie=je=>{typeof je.preventDefault=="function"&&je.preventDefault(),S&&(je.stopPropagation(),S(xe,je))},Re={"data-editor-id":xe,"data-editor-name":T.name,"data-editor-type":T.type,onClick:Ie};O&&(Re["data-editor-path"]=O);const et=T.__editorSlotName??T.slot;typeof et=="string"&&(Re["data-editor-slot"]=et),_&&(Re.onMouseMove=je=>{je.stopPropagation(),_(xe,je)},Re.onMouseLeave=je=>{_(null,je)}),Object.assign(Z,Re),Z.editorAttrs=Re}const ye=T.type==="basic",ue=T.type==="layout",_e=ye||ue?(()=>{const xe={};for(const[Ie,Re]of Object.entries(Z))Ie.startsWith("__")||Ie==="editorAttrs"&&ye||(xe[Ie]=Re);return xe})():Z;let Ke=ht.jsx(se,{..._e,children:an});if(Mt&&(Ke=ht.jsx(RC,{value:Mt,children:Ke})),T.isolatedState){const xe=typeof T.isolatedState=="object"?T.isolatedState:{},Ie=e?._isolatedInit,Re=Ie?{...xe,...Ie}:xe;Ke=ht.jsx(HC,{initialState:Re,scopeId:T.isolatedScopeId,children:Ke})}return Ke},[qe,T.iteration,T.sortable,T.itemTemplate,T.type,T.name,T.id,T.props,T.isolatedState,T.isolatedScopeId,a,bn,an,ea,ta,N,Ln,v,S,_,A,k,O,e._global?._remountKeys]),rr=H.useMemo(()=>{const V=T.blur_until_loaded;if(!V||e?._global?.__isPreview)return!1;if(typeof V=="string"){const Z=vt(V);if(Z!==null)try{const ye={componentId:T.id,componentName:T.name,propName:"blur_until_loaded"};return!!i.evaluateExpression(Z,te,ye)}catch(ye){return dt.warn(`blur_until_loaded 표현식 평가 실패 (컴포넌트: ${T.id}):`,ye),!1}return!1}if(typeof V=="object"&&V!==null){if(!V.enabled)return!1;if(V.data_sources)return(Array.isArray(V.data_sources)?V.data_sources:[V.data_sources]).some(Ee=>e[Ee]===void 0);if(de)return!0;const Z=["route","query","_global","_local","_dataSourceErrors"];return Object.keys(e).filter(ue=>!Z.includes(ue)&&!ue.startsWith("_")).some(ue=>e[ue]===void 0)}if(de)return!0;const se=["route","query","_global","_local","_dataSourceErrors"];return Object.keys(e).filter(Z=>!se.includes(Z)&&!Z.startsWith("_")).some(Z=>e[Z]===void 0)},[T.blur_until_loaded,T.id,de,e,te,i,vt]);if(rr){const V=T.blur_until_loaded;if(typeof V=="object"&&V?.data_sources){const le=(Array.isArray(V.data_sources)?V.data_sources:[V.data_sources]).reduce((ye,ue)=>(ye[ue]=e[ue]===void 0?"UNDEFINED":"LOADED",ye),{}),Z=Object.keys(e).filter(ye=>!ye.startsWith("_"));dt.log(`[BLUR APPLIED] Component: ${T.id}, data_sources status:`,le,"Available keys:",Z)}else dt.log(`[BLUR APPLIED] Component: ${T.id}, blur_until_loaded:`,V)}const sn=H.useMemo(()=>{if(!T.blur_until_loaded)return{wrapperClasses:"",innerClasses:""};const V=_t?.className||"";if(!V)return{wrapperClasses:"",innerClasses:""};const se=[/^(sm:|md:|lg:|xl:|2xl:)?(col-span-|row-span-|col-start-|col-end-|row-start-|row-end-)/,/^(sm:|md:|lg:|xl:|2xl:)?(self-|place-self-|order-)/,/^(sm:|md:|lg:|xl:|2xl:)?(flex-shrink|flex-grow|flex-\d|basis-)/],le=V.split(/\s+/).filter(Boolean),Z=[],ye=[];for(const ue of le)se.some(_e=>_e.test(ue))?Z.push(ue):ye.push(ue);return{wrapperClasses:Z.join(" "),innerClasses:ye.join(" ")}},[T.blur_until_loaded,_t?.className]),Tn=window.__slotContextValue;return ke&&Tn?.isEnabled?null:ht.jsx(N_,{componentId:o.id,componentName:o.name,children:T.blur_until_loaded?ht.jsx("div",{className:[sn.wrapperClasses,rr?"opacity-50 blur-sm transition-all duration-300 pointer-events-none":void 0].filter(Boolean).join(" ")||void 0,children:na}):na})});jr.displayName="DynamicRenderer",typeof window<"u"&&(window.__DynamicRenderer=jr);function I_(o){const e={};try{const a=new URL(o,typeof window<"u"?window.location.origin:"http://localhost").searchParams,i=new Set;for(const l of a.keys()){if(i.has(l))continue;i.add(l);const u=a.getAll(l);u.length>1||l.endsWith("[]")?e[l]=u:e[l]=u[0]}}catch{}return e}function H_(o){try{return new URL(o,typeof window<"u"?window.location.origin:"http://localhost").pathname}catch{return o.split("?")[0]}}const yi=class yi{constructor(){$(this,"config",{enabled:!1,maxHistorySize:100,logLevel:"info",serverEndpoint:"/_boost/g7-debug/dump-state",autoCapture:!0});$(this,"stateHistory",[]);$(this,"snapshotIdCounter",0);$(this,"stateWatchers",new Map);$(this,"currentLocalState",{});$(this,"currentComputedState",{});$(this,"currentParentContext");$(this,"actionHistory",[]);$(this,"actionWatchers",new Set);$(this,"cacheStats",{hits:0,misses:0,entries:0});$(this,"cacheDecisions",[]);$(this,"cacheDecisionIdCounter",0);$(this,"maxCacheDecisions",200);$(this,"currentRenderCycleId",null);$(this,"isInActionExecution",!1);$(this,"isInIteration",!1);$(this,"mountedComponents",new Map);$(this,"eventListeners",new Map);$(this,"mountWatchers",new Set);$(this,"unmountWatchers",new Set);$(this,"renderCounts",new Map);$(this,"bindingEvalCount",0);$(this,"profilingData",[]);$(this,"isProfiling",!1);$(this,"profilingStartTime",0);$(this,"activeRequests",new Map);$(this,"requestHistory",[]);$(this,"pendingDataSources",new Set);$(this,"requestWatchers",new Set);$(this,"wsConnections",new Map);$(this,"wsMessageHistory",[]);$(this,"wsMessageWatchers",new Set);$(this,"ifConditions",new Map);$(this,"iterations",new Map);$(this,"conditionWatchers",new Set);$(this,"forms",new Map);$(this,"formWatchers",new Set);$(this,"expressionHistory",[]);$(this,"expressionWatchers",new Set);$(this,"expressionIdCounter",0);$(this,"dataSources",new Map);$(this,"dataPathTransforms",[]);$(this,"maxDataPathTransforms",100);$(this,"nestedContexts",[]);$(this,"nestedContextIdCounter",0);$(this,"maxNestedContexts",100);$(this,"formBindingIssues",[]);$(this,"formBindingValidations",[]);$(this,"formBindingIssueIdCounter",0);$(this,"maxFormBindingIssues",100);$(this,"computedProperties",new Map);$(this,"computedRecalcLogs",[]);$(this,"computedRecalcIdCounter",0);$(this,"maxComputedRecalcLogs",100);$(this,"handlers",new Map);$(this,"componentEventSubscriptions",new Map);$(this,"componentEventEmitHistory",[]);$(this,"componentEventIdCounter",0);$(this,"maxComponentEventHistory",100);$(this,"stateRenderingLogs",[]);$(this,"currentStateChangeContext",null);$(this,"stateRenderingIdCounter",0);$(this,"componentRenderCounts",new Map);$(this,"stateToComponentMap",new Map);$(this,"maxStateRenderingLogs",100);$(this,"componentStateSources",new Map);$(this,"contextFlowNodes",new Map);$(this,"dynamicStates",new Map);$(this,"styleIssues",[]);$(this,"componentStyles",new Map);$(this,"authEvents",[]);$(this,"authHeaderHistory",[]);$(this,"authEventIdCounter",0);$(this,"maxAuthEventHistory",50);$(this,"logHistory",[]);$(this,"logIdCounter",0);$(this,"maxLogHistory",500);$(this,"currentLayout",null);$(this,"layoutHistory",[]);$(this,"layoutIdCounter",0);$(this,"layoutStats",{totalLoads:0,cacheHits:0,apiLoads:0});$(this,"maxLayoutHistory",50);$(this,"executionDetails",new Map);$(this,"stateChangeHistory",[]);$(this,"dataSourceChangeHistory",[]);$(this,"changeAlerts",[]);$(this,"changeExpectations",new Map);$(this,"executionIdCounter",0);$(this,"stateChangeIdCounter",0);$(this,"alertIdCounter",0);$(this,"maxExecutionDetails",100);$(this,"maxStateChangeHistory",200);$(this,"maxChangeAlerts",100);$(this,"sequenceExecutions",[]);$(this,"sequenceExecutionStack",[]);$(this,"sequenceIdCounter",0);$(this,"maxSequenceExecutions",50);$(this,"staleClosureWarnings",[]);$(this,"staleClosureIdCounter",0);$(this,"maxStaleClosureWarnings",100);$(this,"stateCaptureRegistry",new Map);$(this,"modalStates",new Map);$(this,"modalStateIssues",[]);$(this,"modalStateRelations",[]);$(this,"modalStateChangeLogs",[]);$(this,"modalStateIssueIdCounter",0);$(this,"modalStateChangeLogIdCounter",0);$(this,"maxModalStateIssues",100);$(this,"maxModalStateChangeLogs",200);$(this,"namedActionDefinitions",{});$(this,"namedActionRefLogs",[]);$(this,"namedActionRefIdCounter",0);$(this,"maxNamedActionRefLogs",200);$(this,"debounceActionHistory",[]);$(this,"dataSourceUpdateHistory",[]);$(this,"debounceActionIdCounter",0);$(this,"dataSourceUpdateIdCounter",0)}static getInstance(){return yi.instance||(yi.instance=new yi),yi.instance}initialize(){if(this.config.enabled=this.checkDebugMode(),!this.config.enabled){console.log("[G7DevTools] 비활성화됨 (환경설정 > 고급 설정 > 디버그 모드를 켜세요)");return}console.log("[G7DevTools] 활성화됨"),this.setupGlobalErrorHandler()}checkDebugMode(){try{if(window.G7Config?.debug===!0)return!0;const a=window.G7Core?.state?.get?.();return a?.settings?.advanced?.debug_mode===!0||a?._global?.settings?.advanced?.debug_mode===!0}catch{return!1}}isEnabled(){return this.config.enabled}setupGlobalErrorHandler(){window.addEventListener("error",e=>{this.config.enabled&&this.logAction({id:this.generateId(),type:"globalError",startTime:Date.now(),status:"error",error:{name:"Error",message:e.message,stack:e.error?.stack}})}),window.addEventListener("unhandledrejection",e=>{this.config.enabled&&this.logAction({id:this.generateId(),type:"unhandledRejection",startTime:Date.now(),status:"error",error:{name:"UnhandledRejection",message:String(e.reason)}})})}captureStateSnapshot(e){if(!this.config.enabled)return;const n={id:++this.snapshotIdCounter,timestamp:Date.now(),source:e.source,prev:this.sanitizeObject(e.prev),next:this.sanitizeObject(e.next),diff:e.diff};this.stateHistory.push(n),this.stateHistory.length>this.config.maxHistorySize&&this.stateHistory.shift(),this.notifyStateWatchers(n)}getState(){try{const e=window.G7Core,n=e?.state?.get?.()||{},a={};if(e?._isolatedStates&&typeof e._isolatedStates=="object")for(const[i,l]of Object.entries(e._isolatedStates))a[i]=this.sanitizeObject(l);return{_global:n._global||n,_local:this.currentLocalState,_computed:this.currentComputedState,_isolated:Object.keys(a).length>0?a:void 0,$parent:this.currentParentContext}}catch{return{_global:{},_local:this.currentLocalState,_computed:this.currentComputedState}}}updateLocalState(e){this.config.enabled&&(this.currentLocalState=this.sanitizeObject(e))}updateComputedState(e){this.config.enabled&&(this.currentComputedState=this.sanitizeObject(e))}updateParentContext(e){this.config.enabled&&(this.currentParentContext=e?this.sanitizeObject(e):void 0)}getStateHistory(){return[...this.stateHistory]}getDualStorageMismatch(){const e=this.currentLocalState||{};let n={};try{n=(window.G7Core?.state?.get?.()||{})._local||{}}catch{n={}}const a=this.findMismatchedLeafPaths(e,n);return{hasMismatch:a.length>0,mismatchedPaths:a,storageA:e,storageB:n}}findMismatchedLeafPaths(e,n,a=""){const i=[],l=new Set([...Object.keys(e||{}),...Object.keys(n||{})]);for(const u of l){const d=a?`${a}.${u}`:u,f=e?.[u],g=n?.[u],m=f&&typeof f=="object"&&!Array.isArray(f),b=g&&typeof g=="object"&&!Array.isArray(g);if(m&&b)i.push(...this.findMismatchedLeafPaths(f,g,d));else{const v=f===void 0?"__undefined__":JSON.stringify(f),S=g===void 0?"__undefined__":JSON.stringify(g);v!==S&&i.push(d)}}return i}watchState(e,n){return this.stateWatchers.has(e)||this.stateWatchers.set(e,new Set),this.stateWatchers.get(e).add(n),()=>{this.stateWatchers.get(e)?.delete(n)}}notifyStateWatchers(e){if(this.stateWatchers.get("*")?.forEach(n=>{try{n(e.next,e.prev,"*")}catch(a){console.error("[G7DevTools] State watcher error:",a)}}),e.diff)for(const n of e.diff.changed)this.stateWatchers.get(n.path)?.forEach(a=>{try{a(n.newValue,n.oldValue,n.path)}catch(i){console.error("[G7DevTools] State watcher error:",i)}})}diffSnapshots(e,n){const a=this.stateHistory.find(l=>l.id===e),i=this.stateHistory.find(l=>l.id===n);return!a||!i?null:this.calculateDiff(a.next,i.next)}calculateDiff(e,n,a=""){const i={added:[],removed:[],changed:[]},l=new Set(Object.keys(e)),u=new Set(Object.keys(n));for(const d of u){const f=a?`${a}.${d}`:d;l.has(d)?JSON.stringify(e[d])!==JSON.stringify(n[d])&&i.changed.push({path:f,oldValue:e[d],newValue:n[d]}):i.added.push(f)}for(const d of l){const f=a?`${a}.${d}`:d;u.has(d)||i.removed.push(f)}return i}logAction(e){if(!this.config.enabled)return;const n=this.actionHistory.findIndex(a=>a.id===e.id);n>=0?this.actionHistory[n]={...this.actionHistory[n],...e}:(this.actionHistory.push(e),this.actionHistory.length>this.config.maxHistorySize&&this.actionHistory.shift()),this.isProfiling&&this.profilingData.push({type:"action",action:e.type,timestamp:performance.now(),duration:e.duration}),this.notifyActionWatchers(e)}getActionHistory(){return[...this.actionHistory]}watchActions(e){return this.actionWatchers.add(e),()=>{this.actionWatchers.delete(e)}}notifyActionWatchers(e){this.actionWatchers.forEach(n=>{try{n(e)}catch(a){console.error("[G7DevTools] Action watcher error:",a)}})}getActionMetrics(){const e=this.actionHistory.filter(l=>l.status==="success"),n=this.actionHistory.filter(l=>l.status==="error"),a={};for(const l of this.actionHistory)a[l.type]=(a[l.type]||0)+1;const i=e.reduce((l,u)=>l+(u.duration||0),0);return{totalActions:this.actionHistory.length,successCount:e.length,errorCount:n.length,averageDuration:e.length>0?i/e.length:0,actionsByType:a}}recordCacheHit(){this.config.enabled&&this.cacheStats.hits++}recordCacheMiss(){this.config.enabled&&this.cacheStats.misses++}updateCacheEntries(e){this.config.enabled&&(this.cacheStats.entries=e)}getCacheStats(){const e=this.cacheStats.hits+this.cacheStats.misses;return{...this.cacheStats,hitRate:e>0?this.cacheStats.hits/e:0}}resetCacheStats(){this.cacheStats={hits:0,misses:0,entries:0}}trackCacheDecision(e){if(!this.config.enabled)return;const n={id:`cache-${++this.cacheDecisionIdCounter}`,timestamp:Date.now(),expression:e.expression,decision:e.decision,reason:e.reason,context:{isInIteration:this.isInIteration,isInAction:this.isInActionExecution,renderCycleId:this.currentRenderCycleId||void 0,componentId:e.componentId,skipCacheOption:e.skipCacheOption},cachedValue:e.cachedValue!==void 0?this.safeClone(e.cachedValue):void 0,freshValue:e.freshValue!==void 0?this.safeClone(e.freshValue):void 0,valueMatch:e.cachedValue!==void 0&&e.freshValue!==void 0?JSON.stringify(e.cachedValue)===JSON.stringify(e.freshValue):void 0,duration:e.duration};this.cacheDecisions.push(n),this.cacheDecisions.length>this.maxCacheDecisions&&this.cacheDecisions.shift(),e.decision==="cache_hit"?this.cacheStats.hits++:(e.decision==="cache_miss"||e.decision==="skip_cache")&&this.cacheStats.misses++}startRenderCycle(e){return this.currentRenderCycleId=`render-${Date.now()}-${e||"root"}`,this.currentRenderCycleId}endRenderCycle(){this.currentRenderCycleId=null}startActionContext(){this.isInActionExecution=!0}endActionContext(){this.isInActionExecution=!1}startIterationContext(){this.isInIteration=!0}endIterationContext(){this.isInIteration=!1}getCacheDecisionTrackingInfo(){const e=this.getCacheDecisionStats();return{decisions:[...this.cacheDecisions],stats:e,timestamp:Date.now()}}getCacheDecisionStats(){const e=this.cacheDecisions;let n=0,a=0,i=0,l=0;const u={},d={};for(const g of e)g.decision==="cache_hit"?n++:g.decision==="cache_miss"?a++:g.decision==="skip_cache"?i++:g.decision==="invalidate"&&l++,u[g.reason]=(u[g.reason]||0)+1,g.context.componentId&&(d[g.context.componentId]=(d[g.context.componentId]||0)+1);const f=n+a+i;return{totalDecisions:e.length,cacheHits:n,cacheMisses:a,skipCacheCount:i,invalidateCount:l,byReason:u,byComponent:d,avgHitRate:f>0?n/f:0}}getRecentCacheDecisions(e=20,n){let a=[...this.cacheDecisions];return n&&(a=a.filter(i=>i.decision===n)),a.slice(-e)}clearCacheDecisionData(){this.cacheDecisions=[],this.cacheDecisionIdCounter=0}summarizePropsForLifecycle(e){if(!e||typeof e!="object")return e;const n={},a=["children","ref","key"];for(const[i,l]of Object.entries(e))if(!a.includes(i))if(l==null)n[i]=l;else if(Array.isArray(l))n[i]=`[Array(${l.length})]`;else if(typeof l=="object"){const u=Object.keys(l);u.length<=3?n[i]=`{${u.join(", ")}}`:n[i]=`{${u.slice(0,3).join(", ")}, ... +${u.length-3}}`}else typeof l=="string"&&l.length>50?n[i]=l.substring(0,50)+"...":typeof l=="function"?n[i]="[Function]":n[i]=l;return n}trackMount(e,n){if(!this.config.enabled)return;const a=this.summarizePropsForLifecycle(n.props),i={...n,props:a,id:e,mountTime:Date.now()};this.mountedComponents.set(e,i),this.mountWatchers.forEach(l=>{try{l({componentId:e,componentName:n.name,timestamp:i.mountTime})}catch(u){console.error("[G7DevTools] Mount watcher error:",u)}})}trackUnmount(e){if(!this.config.enabled)return;const n=this.mountedComponents.get(e),a=this.eventListeners.get(e)||[];a.length>0&&console.warn(`[G7DevTools] 컴포넌트 ${e} 언마운트 시 ${a.length}개 리스너 미정리`),n&&this.unmountWatchers.forEach(i=>{try{i({componentId:e,componentName:n.name,timestamp:Date.now(),orphanedListeners:a.length})}catch(l){console.error("[G7DevTools] Unmount watcher error:",l)}}),this.mountedComponents.delete(e)}trackListener(e,n,a){if(!this.config.enabled)return;const i=this.eventListeners.get(e)||[];i.push({type:n,target:a,addedAt:Date.now()}),this.eventListeners.set(e,i)}removeListener(e,n){if(!this.config.enabled)return;const a=this.eventListeners.get(e)||[],i=a.findIndex(l=>l.type===n);i>=0&&a.splice(i,1)}getMountedComponents(){return Array.from(this.mountedComponents.values())}getOrphanedListeners(){const e=[];for(const[n,a]of this.eventListeners)this.mountedComponents.has(n)||e.push(...a.map(i=>({...i,componentId:n})));return e}watchMount(e){return this.mountWatchers.add(e),()=>{this.mountWatchers.delete(e)}}watchUnmount(e){return this.unmountWatchers.add(e),()=>{this.unmountWatchers.delete(e)}}trackRender(e){if(!this.config.enabled)return;const n=this.renderCounts.get(e)||0;this.renderCounts.set(e,n+1),this.isProfiling&&this.profilingData.push({type:"render",component:e,timestamp:performance.now()})}trackBindingEval(e){this.config.enabled&&(this.bindingEvalCount++,this.isProfiling&&e&&this.profilingData.push({type:"binding",expression:e,timestamp:performance.now()}))}getRenderCount(){return new Map(this.renderCounts)}getBindingEvalCount(){return this.bindingEvalCount}getMemoryWarnings(){const e=[];try{const i=this.getState(),l=JSON.stringify(i).length;l>1e6&&e.push({type:"large-state",message:`상태 크기가 ${(l/1024/1024).toFixed(2)}MB입니다`,suggestion:"불필요한 데이터 정리 필요",severity:l>5e6?"error":"warning"})}catch{}this.stateHistory.length>this.config.maxHistorySize*.8&&e.push({type:"large-history",message:`상태 이력이 ${this.stateHistory.length}개입니다`,suggestion:"maxHistory 설정 조정 필요",severity:"warning"});const n=this.getOrphanedListeners().length;n>0&&e.push({type:"orphaned-listeners",message:`${n}개의 정리되지 않은 이벤트 리스너`,suggestion:"useEffect cleanup 또는 removeEventListener 확인",severity:n>10?"error":"warning"});const a=Array.from(this.renderCounts.entries()).filter(([,i])=>i>50);return a.length>0&&e.push({type:"excessive-renders",message:`${a.length}개 컴포넌트가 50회 이상 렌더링`,suggestion:"React.memo, useMemo, useCallback 사용 고려",severity:"warning"}),e}startProfiling(){this.config.enabled&&(this.isProfiling=!0,this.profilingData=[],this.profilingStartTime=performance.now(),console.log("[G7DevTools] 프로파일링 시작"))}stopProfiling(){this.isProfiling=!1;const e=performance.now()-this.profilingStartTime,n=this.analyzeProfile(e);return console.log("[G7DevTools] 프로파일링 완료",n),n}analyzeProfile(e){const n=this.profilingData.filter(g=>g.type==="render"),a=this.profilingData.filter(g=>g.type==="binding"),i=this.profilingData.filter(g=>g.type==="action"),l={};for(const g of n)g.component&&(l[g.component]||(l[g.component]={count:0,durations:[]}),l[g.component].count++,g.duration&&l[g.component].durations.push(g.duration));const u=Object.entries(l).map(([g,m])=>({name:g,renderCount:m.count,avgDuration:m.durations.length>0?m.durations.reduce((b,v)=>b+v,0)/m.durations.length:0})).sort((g,m)=>m.renderCount-g.renderCount).slice(0,10),d={};for(const g of a)g.expression&&(d[g.expression]=(d[g.expression]||0)+1);const f=Object.entries(d).sort(([,g],[,m])=>m-g).slice(0,10).map(([g])=>g);return{duration:e,entries:this.profilingData,summary:{totalRenders:n.length,totalBindings:a.length,totalActions:i.length,slowestComponents:u,hotPaths:f}}}resetPerformanceStats(){this.renderCounts.clear(),this.bindingEvalCount=0,this.profilingData=[]}trackRequest(e,n,a){if(!this.config.enabled)return"";const i=this.generateId(),l=H_(e),u=I_(e);return this.activeRequests.set(i,{id:i,url:l,fullUrl:e,queryParams:u,method:n,startTime:Date.now(),status:"pending",requestBody:a?.requestBody?this.sanitizeObject(a.requestBody):void 0,dataSourceId:a?.dataSourceId}),this.isProfiling&&this.profilingData.push({type:"network",timestamp:performance.now()}),i}completeRequest(e,n,a){if(!this.config.enabled)return;const i=this.activeRequests.get(e);if(!i)return;const l={...i,status:n>=200&&n<300?"success":"error",statusCode:n,duration:Date.now()-i.startTime,endTime:Date.now(),response:this.sanitizeObject(a)};this.requestHistory.push(l),this.activeRequests.delete(e),this.requestHistory.length>this.config.maxHistorySize&&this.requestHistory.shift(),this.notifyRequestWatchers(l)}failRequest(e,n){if(!this.config.enabled)return;const a=this.activeRequests.get(e);if(!a)return;const i={...a,status:"error",error:n,duration:Date.now()-a.startTime,endTime:Date.now()};this.requestHistory.push(i),this.activeRequests.delete(e),this.notifyRequestWatchers(i)}trackDataSource(e){this.config.enabled&&this.pendingDataSources.add(e)}completeDataSource(e){this.config.enabled&&this.pendingDataSources.delete(e)}getActiveRequests(){return Array.from(this.activeRequests.values())}getRequestHistory(){return[...this.requestHistory]}getPendingDataSources(){return Array.from(this.pendingDataSources)}watchRequest(e){return this.requestWatchers.add(e),()=>{this.requestWatchers.delete(e)}}notifyRequestWatchers(e){this.requestWatchers.forEach(n=>{try{n(e)}catch(a){console.error("[G7DevTools] Request watcher error:",a)}})}trackWebSocketConnection(e,n,a){this.config.enabled&&this.wsConnections.set(e,{id:e,url:n,state:a,connectedAt:a==="open"?Date.now():void 0})}trackWebSocketMessage(e,n,a,i){if(!this.config.enabled)return;const l={id:this.generateId(),connectionId:e,direction:n,type:a,payload:this.sanitizeObject(i),timestamp:Date.now(),sequence:this.wsMessageHistory.length};this.wsMessageHistory.push(l),this.wsMessageHistory.length>this.config.maxHistorySize&&this.wsMessageHistory.shift(),this.notifyWebSocketWatchers(l)}getWebSocketConnections(){return Array.from(this.wsConnections.values())}getWebSocketMessageHistory(){return[...this.wsMessageHistory]}getWebSocketConnectionState(){const e=Array.from(this.wsConnections.values());return e.some(n=>n.state==="open")?"connected":e.some(n=>n.state==="connecting")?"reconnecting":"disconnected"}watchWebSocketMessage(e){return this.wsMessageWatchers.add(e),()=>{this.wsMessageWatchers.delete(e)}}notifyWebSocketWatchers(e){this.wsMessageWatchers.forEach(n=>{try{n(e)}catch(a){console.error("[G7DevTools] WebSocket watcher error:",a)}})}trackIfCondition(e,n,a){if(!this.config.enabled)return;const i=this.ifConditions.get(e),l=i?.evaluatedValue;this.ifConditions.set(e,{id:e,expression:n,evaluatedValue:a,evaluationCount:(i?.evaluationCount||0)+1,lastEvaluated:Date.now()}),i&&l!==a&&this.notifyConditionWatchers({id:e,expression:n,oldValue:l,newValue:a,timestamp:Date.now()})}trackIteration(e,n){this.config.enabled&&this.iterations.set(e,{id:e,...n,lastRendered:Date.now()})}getIfConditions(){return Array.from(this.ifConditions.values())}getIterations(){return Array.from(this.iterations.values())}getScopeChain(e){const n=[],a=this.getState();return n.push({name:"_global",value:a._global,source:"global"}),n.push({name:"_local",value:a._local,source:"local"}),n.push({name:"_computed",value:a._computed,source:"computed"}),n}watchConditionChange(e){return this.conditionWatchers.add(e),()=>{this.conditionWatchers.delete(e)}}notifyConditionWatchers(e){this.conditionWatchers.forEach(n=>{try{n(e)}catch(a){console.error("[G7DevTools] Condition watcher error:",a)}})}trackForm(e,n,a){this.config.enabled&&this.forms.set(e,{id:e,dataKey:n,inputs:a,trackedAt:Date.now()})}trackFormChange(e,n,a){if(!this.config.enabled)return;const i={formId:e,inputName:n,value:a,timestamp:Date.now()};this.notifyFormWatchers(i)}untrackForm(e){this.forms.delete(e)}getForms(){return Array.from(this.forms.values())}getFormState(e){const n=this.getState();return this.getNestedValue(n,e)||{}}getBindingPath(e,n){return`${e}.${n}`}watchFormChange(e){return this.formWatchers.add(e),()=>{this.formWatchers.delete(e)}}notifyFormWatchers(e){this.formWatchers.forEach(n=>{try{n(e)}catch(a){console.error("[G7DevTools] Form watcher error:",a)}})}trackFormBindingIssue(e,n,a){if(!this.config.enabled)return;const i={id:`form-issue-${++this.formBindingIssueIdCounter}`,timestamp:Date.now(),type:e,severity:n,formId:a.formId,formDataKey:a.formDataKey,inputInfo:a.inputInfo,contextInfo:a.contextInfo,description:a.description,suggestion:a.suggestion,docLink:a.docLink};this.formBindingIssues.push(i),this.formBindingIssues.length>this.maxFormBindingIssues&&this.formBindingIssues.shift()}validateFormBinding(e,n,a,i){const l=a.map(f=>{const g=[];let m=!0;return f.name||(g.push("Input에 name 속성이 없습니다"),m=!1,this.trackFormBindingIssue("missing-input-name","error",{formId:e,formDataKey:n,inputInfo:{name:f.name,type:f.type},description:"Input에 name 속성이 없어 자동 바인딩이 동작하지 않습니다",suggestion:"Input에 name 속성을 추가하세요",docLink:"troubleshooting-components-form.md"})),n||(g.push("Form에 dataKey가 없습니다"),m=!1),{inputName:f.name||"(unnamed)",inputType:f.type,bindingPath:n&&f.name?`${n}.${f.name}`:"-",isValid:m,currentValue:f.value,issues:g}});if(n||this.trackFormBindingIssue("missing-datakey","error",{formId:e,description:"Form에 dataKey가 설정되지 않아 자동 바인딩이 동작하지 않습니다",suggestion:"Form 컴포넌트에 dataKey props를 설정하세요",docLink:"troubleshooting-components-form.md"}),i.isContextBroken){const f=i.breakReason?.includes("sortable")?"sortable-context-break":i.breakReason?.includes("modal")?"modal-context-isolation":"context-not-propagated";this.trackFormBindingIssue(f,"warning",{formId:e,formDataKey:n,contextInfo:{hasParentFormContext:i.hasParentContext,parentFormContextProp:i.parentContextProp,isInsideSortable:i.breakReason?.includes("sortable")||!1,isInsideModal:i.breakReason?.includes("modal")||!1,depth:0},description:i.breakReason||"Form 컨텍스트가 제대로 전파되지 않았습니다",suggestion:"parentFormContextProp={undefined}를 확인하거나 중첩 구조를 검토하세요",docLink:"troubleshooting-components-form.md"})}const u={formId:e,dataKey:n,timestamp:Date.now(),contextPropagation:i,inputBindings:l,isValid:l.every(f=>f.isValid)&&!!n&&!i.isContextBroken,issueCount:l.filter(f=>!f.isValid).length+(n?0:1)+(i.isContextBroken?1:0)},d=this.formBindingValidations.findIndex(f=>f.formId===e);return d>=0?this.formBindingValidations[d]=u:this.formBindingValidations.push(u),u}getFormBindingValidationTrackingInfo(){const e=this.getFormBindingValidationStats();return{issues:[...this.formBindingIssues],validations:[...this.formBindingValidations],stats:e,timestamp:Date.now()}}getFormBindingValidationStats(){const e={"missing-datakey":0,"missing-input-name":0,"context-not-propagated":0,"sortable-context-break":0,"modal-context-isolation":0,"duplicate-input-name":0,"value-type-mismatch":0,"binding-path-invalid":0},n={info:0,warning:0,error:0};for(const i of this.formBindingIssues)e[i.type]++,n[i.severity]++;const a=Object.entries(e).filter(([,i])=>i>0).sort((i,l)=>l[1]-i[1]).slice(0,5).map(([i,l])=>({type:i,count:l,description:this.getIssueTypeDescription(i)}));return{totalFormsValidated:this.formBindingValidations.length,validForms:this.formBindingValidations.filter(i=>i.isValid).length,formsWithIssues:this.formBindingValidations.filter(i=>!i.isValid).length,totalIssues:this.formBindingIssues.length,byIssueType:e,bySeverity:n,topIssues:a}}getIssueTypeDescription(e){return{"missing-datakey":"Form에 dataKey 누락","missing-input-name":"Input에 name 속성 누락","context-not-propagated":"Form 컨텍스트 전파 실패","sortable-context-break":"Sortable 컨테이너에서 컨텍스트 단절","modal-context-isolation":"모달에서 부모 Form 컨텍스트 격리","duplicate-input-name":"동일 Form 내 중복 Input name","value-type-mismatch":"값 타입과 Input 타입 불일치","binding-path-invalid":"바인딩 경로 유효하지 않음"}[e]||e}clearFormBindingIssues(){this.formBindingIssues=[],this.formBindingValidations=[],this.formBindingIssueIdCounter=0}trackComputedProperty(e,n,a,i,l,u,d){if(!this.config.enabled)return;const f=`computed-${e}-${u||"global"}`,g={id:f,name:e,expression:n,componentId:u,dependencies:a,currentValue:this.safeClone(i),lastComputedAt:Date.now(),computationTime:l,error:d};this.computedProperties.set(f,g)}trackComputedRecalc(e,n,a,i,l,u,d){if(!this.config.enabled)return;const f=`computed-${e}-${d||"global"}`,g=JSON.stringify(a)!==JSON.stringify(i),m={id:`recalc-${++this.computedRecalcIdCounter}`,computedId:f,computedName:e,timestamp:Date.now(),trigger:n,triggeredBy:u,previousValue:this.safeClone(a),newValue:this.safeClone(i),valueChanged:g,computationTime:l,cascadeCount:0};this.computedRecalcLogs.push(m),this.computedRecalcLogs.length>this.maxComputedRecalcLogs&&this.computedRecalcLogs.shift();const b=this.computedProperties.get(f);b&&(b.currentValue=this.safeClone(i),b.lastComputedAt=Date.now(),b.computationTime=l)}analyzeComputedDependencyChain(e,n){const a=new Set,i=[];let l=!1,u,d=0;const f=(m,b)=>{if(d=Math.max(d,b),a.has(m))return l=!0,u=[...i,m],{name:m,type:"computed",children:[],depth:b};a.add(m),i.push(m);const v=this.computedProperties.get(`computed-${m}-${n||"global"}`),S=[];if(v)for(const _ of v.dependencies)_.type==="computed"?S.push(f(_.path,b+1)):S.push({name:_.path,type:_.type,children:[],depth:b+1});return i.pop(),a.delete(m),{name:m,type:"computed",children:S,depth:b}},g=f(e,0);return{root:e,tree:g,hasCycle:l,cyclePath:u,maxDepth:d}}getComputedDependencyTrackingInfo(){const e=Array.from(this.computedProperties.values()),n=this.getComputedDependencyStats(),a=[];for(const i of e){const l=this.analyzeComputedDependencyChain(i.name,i.componentId);a.push(l)}return{properties:e,recalcLogs:[...this.computedRecalcLogs],dependencyChains:a,stats:n,timestamp:Date.now()}}getComputedDependencyStats(){const e={"state-change":0,"datasource-update":0,"dependency-change":0,manual:0,initial:0},n={},a={};let i=0,l=0;for(const g of this.computedRecalcLogs)e[g.trigger]++,g.valueChanged||l++,n[g.computedName]=(n[g.computedName]||0)+1,a[g.computedName]||(a[g.computedName]=[]),a[g.computedName].push(g.computationTime),i+=g.computationTime;const u=Object.entries(n).sort((g,m)=>m[1]-g[1]).slice(0,5).map(([g,m])=>({name:g,count:m})),d=Object.entries(a).map(([g,m])=>({name:g,avgTime:m.reduce((b,v)=>b+v,0)/m.length})).sort((g,m)=>m.avgTime-g.avgTime).slice(0,5);let f=0;for(const g of this.computedProperties.values())this.analyzeComputedDependencyChain(g.name,g.componentId).hasCycle&&f++;return{totalComputed:this.computedProperties.size,totalRecalculations:this.computedRecalcLogs.length,unnecessaryRecalculations:l,avgComputationTime:this.computedRecalcLogs.length>0?i/this.computedRecalcLogs.length:0,topRecalculated:u,slowestComputed:d,cycleDetectionCount:f,byTrigger:e}}clearComputedTracking(){this.computedProperties.clear(),this.computedRecalcLogs=[],this.computedRecalcIdCounter=0}trackModalOpen(e){if(!this.config.enabled)return;const n={modalId:e.modalId,modalName:e.modalName,openedAt:Date.now(),closedAt:null,scopeType:e.scopeType||"isolated",parentModalId:e.parentModalId,componentId:e.componentId,initialState:e.initialState?{...e.initialState}:{},currentState:e.initialState?{...e.initialState}:{},stateChangeCount:0,isolatedStateKeys:e.isolatedStateKeys||[],sharedStateKeys:e.sharedStateKeys||[]};this.modalStates.set(e.modalId,n),this.validateModalDefinitionExists(e.modalId,e.modalName),e.parentModalId&&(this.modalStateRelations.find(i=>i.parentModalId===e.parentModalId&&i.childModalId===e.modalId)||this.modalStateRelations.push({parentModalId:e.parentModalId,childModalId:e.modalId,sharedKeys:e.sharedStateKeys||[],isolatedKeys:e.isolatedStateKeys||[],relationType:"parent-child"}))}trackModalClose(e,n){if(!this.config.enabled)return;const a=this.modalStates.get(e);a&&(a.closedAt=Date.now(),n&&(a.currentState={...n}),this.detectStateLeakage(a))}validateModalDefinitionExists(e,n){const a=this.currentLayout;if(!a?.layoutJson)return;const i=a.layoutJson.modals;if(!i){this.recordModalStateIssue({type:"missing-definition",modalId:e,modalName:n,severity:"error",description:`모달 "${e}"이(가) modalStack에 추가되었으나, 현재 레이아웃에 modals 섹션이 없습니다. 레이아웃 경로: ${a.layoutPath}`,affectedStateKeys:[],expectedValue:`modals 섹션에 id="${e}" 정의 존재`,actualValue:"modals 섹션 없음"});return}const l=Array.isArray(i)?i:Object.values(i);l.some(d=>d?.id===e||d?.props?.id===e)||this.recordModalStateIssue({type:"missing-definition",modalId:e,modalName:n,severity:"error",description:`모달 "${e}"이(가) modalStack에 추가되었으나, 렌더링된 레이아웃의 modals 섹션에 해당 ID의 정의가 없습니다. partial 로딩 실패, 레이아웃 병합 문제, extends 상속 누락 등을 확인하세요. 레이아웃 경로: ${a.layoutPath}`,affectedStateKeys:[],expectedValue:`modals 배열에 id="${e}" 항목 존재`,actualValue:`modals 배열에 ${l.length}개 모달 정의 (${l.map(d=>d?.id||"unknown").join(", ")})`})}trackModalStateChange(e){if(!this.config.enabled)return;const n=this.modalStates.get(e.modalId);if(!n)return;n.stateChangeCount++,n.currentState[e.stateKey]=e.newValue;const a=this.checkIsolationViolation(n,e.stateKey),i={id:`modal-change-${++this.modalStateChangeLogIdCounter}`,modalId:e.modalId,modalName:n.modalName,timestamp:Date.now(),stateKey:e.stateKey,previousValue:e.previousValue,newValue:e.newValue,changeSource:e.changeSource||"user-action",violatesIsolation:a};this.modalStateChangeLogs.push(i),this.modalStateChangeLogs.length>this.maxModalStateChangeLogs&&this.modalStateChangeLogs.shift(),a&&this.recordModalStateIssue({type:"isolation-violation",modalId:e.modalId,modalName:n.modalName,severity:"warning",description:`모달 '${n.modalName}'에서 격리된 상태 키 '${e.stateKey}'가 변경됨`,affectedStateKeys:[e.stateKey]})}detectStateLeakage(e){if(e.scopeType==="isolated")for(const n of e.isolatedStateKeys){const a=e.initialState[n],i=e.currentState[n];if(a!==i&&e.parentModalId){const l=this.modalStates.get(e.parentModalId);l&&l.currentState.hasOwnProperty(n)&&this.recordModalStateIssue({type:"state-leakage",modalId:e.modalId,modalName:e.modalName,severity:"error",description:`모달 닫힘 후 상태 '${n}'가 부모 모달로 유출될 수 있음`,affectedStateKeys:[n],leakedValue:i,expectedValue:a})}}}checkIsolationViolation(e,n){return e.scopeType==="isolated",!1}recordModalStateIssue(e){const n={id:`modal-issue-${++this.modalStateIssueIdCounter}`,type:e.type,modalId:e.modalId,modalName:e.modalName,timestamp:Date.now(),severity:e.severity,description:e.description,affectedStateKeys:e.affectedStateKeys,leakedValue:e.leakedValue,expectedValue:e.expectedValue,actualValue:e.actualValue,stackInfo:e.stackInfo};this.modalStateIssues.push(n),this.modalStateIssues.length>this.maxModalStateIssues&&this.modalStateIssues.shift()}getModalStateScopeTrackingInfo(){const e=Array.from(this.modalStates.values()),n=this.getModalStateScopeStats();return{modals:e,issues:[...this.modalStateIssues],relations:[...this.modalStateRelations],changeLogs:[...this.modalStateChangeLogs],stats:n,timestamp:Date.now()}}getModalStateScopeStats(){const e=Array.from(this.modalStates.values()),n={warning:0,error:0},a={"state-leakage":0,"isolation-violation":0,"parent-mutation":0,"orphaned-state":0,"scope-mismatch":0,"cleanup-failure":0,"missing-definition":0};for(const l of this.modalStateIssues)n[l.severity]++,a[l.type]++;const i={isolated:0,shared:0,inherited:0};for(const l of e)i[l.scopeType]++;return{totalModals:e.length,openModals:e.filter(l=>l.closedAt===null).length,nestedModals:e.filter(l=>l.parentModalId!==void 0).length,totalIssues:this.modalStateIssues.length,issuesBySeverity:n,issuesByType:a,byScope:i,leakageDetectionCount:a["state-leakage"],cleanupFailureCount:a["cleanup-failure"]}}clearModalStateScopeTracking(){this.modalStates.clear(),this.modalStateIssues=[],this.modalStateRelations=[],this.modalStateChangeLogs=[],this.modalStateIssueIdCounter=0,this.modalStateChangeLogIdCounter=0}setNamedActionDefinitions(e){this.config.enabled&&(this.namedActionDefinitions=e||{})}trackNamedActionRef(e){if(!this.config.enabled)return;const n={...e,id:`named_action_ref_${++this.namedActionRefIdCounter}`};this.namedActionRefLogs.push(n),this.namedActionRefLogs.length>this.maxNamedActionRefLogs&&(this.namedActionRefLogs=this.namedActionRefLogs.slice(-this.maxNamedActionRefLogs))}getNamedActionTrackingInfo(){const e={};for(const a of this.namedActionRefLogs)e[a.actionRefName]=(e[a.actionRefName]||0)+1;const n=Object.keys(this.namedActionDefinitions).filter(a=>!e[a]);return{definitions:this.namedActionDefinitions,refLogs:[...this.namedActionRefLogs],stats:{totalDefinitions:Object.keys(this.namedActionDefinitions).length,totalRefs:this.namedActionRefLogs.length,refCountByName:e,unusedDefinitions:n},timestamp:Date.now()}}clearNamedActionTracking(){this.namedActionDefinitions={},this.namedActionRefLogs=[],this.namedActionRefIdCounter=0}trackExpressionEval(e){if(!this.config.enabled)return;const n={...e,id:`expr-${++this.expressionIdCounter}`,timestamp:Date.now(),warning:this.detectExpressionWarning(e)};this.expressionHistory.push(n),this.expressionHistory.length>500&&this.expressionHistory.shift(),this.isProfiling&&this.profilingData.push({type:"binding",expression:e.expression,timestamp:performance.now(),duration:e.duration}),this.notifyExpressionWatchers(n)}detectExpressionWarning(e){const{expression:n,result:a,resultType:i,method:l,duration:u}=e;if(i==="undefined"&&!n.includes("??")&&!n.includes("||")&&/^[a-zA-Z_$][a-zA-Z0-9_$.]*$/.test(n.replace(/{{|}}/g,"").trim()))return{type:"undefined-result",message:"표현식 결과가 undefined입니다",suggestion:`데이터가 로드되었는지 확인하거나 fallback 값을 추가하세요: ${n} ?? ''`};if(i==="null")return{type:"null-result",message:"표현식 결과가 null입니다",suggestion:`nullish coalescing 연산자를 사용하세요: ${n} ?? ''`};if(l==="resolveBindings"&&i==="string"){const d=String(a);if(d.includes("[object Object]")||/^\[.*\]$/.test(d))return{type:"array-to-string",message:"배열/객체가 문자열로 변환되었습니다",suggestion:"evaluateExpression()을 사용하여 원본 타입을 유지하세요"}}if(l==="resolveBindings"&&i==="string"&&String(a).includes("[object Object]"))return{type:"object-to-string",message:"객체가 [object Object]로 변환되었습니다",suggestion:"evaluateExpression()을 사용하거나 특정 속성에 접근하세요"};if(i==="undefined"&&n.includes(".")&&!n.includes("?.")){const d=n.replace(/{{|}}/g,"").trim().split(".");if(d.length>=2)return{type:"missing-optional-chain",message:"Optional chaining(?.) 누락 가능성",suggestion:`안전한 접근을 위해 ?. 사용을 고려하세요: ${d.join("?.")}`}}if((n.includes("{{item.")||n.includes("{{index}}"))&&Array.from(this.iterations.values()).some(g=>g.itemVar!=="item"))return{type:"wrong-iteration-var",message:"'item'/'index' 대신 iteration에서 정의한 변수명을 사용해야 합니다",suggestion:"iteration의 item_var/index_var에 정의된 변수명을 확인하세요"};if(u&&u>10)return{type:"slow-evaluation",message:`표현식 평가에 ${u.toFixed(2)}ms 소요됨`,suggestion:"복잡한 표현식을 단순화하거나 computed 값으로 분리하세요"}}getExpressions(){return[...this.expressionHistory]}getExpressionWarnings(){return this.expressionHistory.filter(e=>e.warning!=null)}searchExpressions(e){const n=e.toLowerCase();return this.expressionHistory.filter(a=>a.expression.toLowerCase().includes(n)||a.componentName?.toLowerCase().includes(n)||a.propName?.toLowerCase().includes(n))}getExpressionStats(){const e=this.expressionHistory,n=new Set(e.map(f=>f.expression)),a=e.filter(f=>f.warning!=null),i=e.filter(f=>f.fromCache),l=e.filter(f=>f.duration!=null).map(f=>f.duration),u={};for(const f of e)u[f.resultType]=(u[f.resultType]||0)+1;const d={};for(const f of a)f.warning&&(d[f.warning.type]=(d[f.warning.type]||0)+1);return{totalEvaluations:e.length,uniqueExpressions:n.size,warningCount:a.length,cacheHitRate:e.length>0?i.length/e.length:0,averageDuration:l.length>0?l.reduce((f,g)=>f+g,0)/l.length:0,byType:u,byWarning:d}}clearExpressions(){this.expressionHistory=[],this.expressionIdCounter=0}watchExpressions(e){return this.expressionWatchers.add(e),()=>{this.expressionWatchers.delete(e)}}notifyExpressionWatchers(e){this.expressionWatchers.forEach(n=>{try{n(e)}catch(a){console.error("[G7DevTools] Expression watcher error:",a)}})}setLogLevel(e){this.config.logLevel=e}setMaxHistory(e){this.config.maxHistorySize=Math.max(10,Math.min(1e3,e))}setServerEndpoint(e){this.config.serverEndpoint=e}getConfig(){return{...this.config}}generateId(){return`${Date.now()}-${Math.random().toString(36).substr(2,9)}`}sanitizeObject(e,n=new WeakSet){if(e===null||typeof e!="object")return e;if(n.has(e))return"[Circular]";if(n.add(e),Array.isArray(e))return e.map(i=>this.sanitizeObject(i,n));const a={};for(const i of Object.keys(e))try{a[i]=this.sanitizeObject(e[i],n)}catch{a[i]="[Unable to serialize]"}return a}getNestedValue(e,n){if(!n)return e;const a=n.split(".");let i=e;for(const l of a){if(i==null)return;i=i[l]}return i}getLifecycleInfo(){return{mountedComponents:Array.from(this.mountedComponents.values()),orphanedListeners:this.getOrphanedListeners()}}getPerformanceInfo(){return{renderCounts:this.renderCounts,bindingEvalCount:this.bindingEvalCount,memoryWarnings:this.getMemoryWarnings()}}getNetworkInfo(){return{activeRequests:Array.from(this.activeRequests.values()),requestHistory:[...this.requestHistory],pendingDataSources:Array.from(this.pendingDataSources)}}getConditionalInfo(){return{ifConditions:Array.from(this.ifConditions.values()),iterations:Array.from(this.iterations.values())}}getFormInfo(){return Array.from(this.forms.values())}getWebSocketInfo(){return{connections:Array.from(this.wsConnections.values()),messageHistory:[...this.wsMessageHistory],connectionState:this.getWebSocketConnectionState()}}getStateAtTime(e){const n=[...this.stateHistory].reverse().find(a=>a.timestamp<=e);if(n)return{_global:n.next,_local:{}}}reset(){this.stateHistory=[],this.actionHistory=[],this.cacheStats={hits:0,misses:0,entries:0},this.cacheDecisions=[],this.cacheDecisionIdCounter=0,this.currentRenderCycleId=null,this.isInActionExecution=!1,this.isInIteration=!1,this.mountedComponents.clear(),this.eventListeners.clear(),this.renderCounts.clear(),this.bindingEvalCount=0,this.profilingData=[],this.activeRequests.clear(),this.requestHistory=[],this.pendingDataSources.clear(),this.wsConnections.clear(),this.wsMessageHistory=[],this.ifConditions.clear(),this.iterations.clear(),this.forms.clear(),this.expressionHistory=[],this.expressionIdCounter=0,this.dataSources.clear(),this.dataPathTransforms=[],this.nestedContexts=[],this.nestedContextIdCounter=0,this.formBindingIssues=[],this.formBindingValidations=[],this.formBindingIssueIdCounter=0,this.computedProperties.clear(),this.computedRecalcLogs=[],this.computedRecalcIdCounter=0,this.modalStates.clear(),this.modalStateIssues=[],this.modalStateRelations=[],this.modalStateChangeLogs=[],this.modalStateIssueIdCounter=0,this.modalStateChangeLogIdCounter=0,this.logHistory=[],this.logIdCounter=0}getExpressionInfo(){return{expressions:this.getExpressions(),stats:this.getExpressionStats()}}trackLog(e,n,a){if(!this.config.enabled)return;const i=a.map(u=>{if(typeof u=="string")return u;try{return JSON.stringify(u)}catch{return String(u)}}).join(" "),l={id:`log-${++this.logIdCounter}`,level:e,prefix:n,message:i,args:this.sanitizeObject(a),timestamp:Date.now(),stack:e==="error"?new Error().stack:void 0};this.logHistory.push(l),this.logHistory.length>this.maxLogHistory&&this.logHistory.shift()}trackAction(e){if(!this.config.enabled)return;const n={id:`debounce-action-${++this.debounceActionIdCounter}`,...e,timestamp:Date.now()};this.debounceActionHistory.push(n),this.debounceActionHistory.length>100&&this.debounceActionHistory.shift()}trackDataSourceUpdate(e){if(!this.config.enabled)return;const n={id:`ds-update-${++this.dataSourceUpdateIdCounter}`,...e};this.dataSourceUpdateHistory.push(n),this.dataSourceUpdateHistory.length>100&&this.dataSourceUpdateHistory.shift()}getDebounceActionHistory(e){let n=[...this.debounceActionHistory];return e?.handler&&(n=n.filter(a=>a.handler.includes(e.handler))),e?.status&&(n=n.filter(a=>a.status===e.status)),e?.limit&&(n=n.slice(-e.limit)),n}getDataSourceUpdateHistory(e){let n=[...this.dataSourceUpdateHistory];return e?.dataSourceId&&(n=n.filter(a=>a.dataSourceId===e.dataSourceId)),e?.updateType&&(n=n.filter(a=>a.updateType===e.updateType)),e?.limit&&(n=n.slice(-e.limit)),n}getLogs(e){let n=[...this.logHistory];if(e?.level){const a=Array.isArray(e.level)?e.level:[e.level];n=n.filter(i=>a.includes(i.level))}if(e?.prefix){const a=e.prefix.toLowerCase();n=n.filter(i=>i.prefix.toLowerCase().includes(a))}if(e?.search){const a=e.search.toLowerCase();n=n.filter(i=>i.message.toLowerCase().includes(a))}return e?.since&&(n=n.filter(a=>a.timestamp>=e.since)),e?.limit&&(n=n.slice(-e.limit)),n}getLogStats(){const n=Date.now()-6e4,a={log:0,warn:0,error:0,debug:0,info:0},i={};let l=0,u=0;for(const d of this.logHistory)a[d.level]++,i[d.prefix]=(i[d.prefix]||0)+1,d.timestamp>=n&&(d.level==="error"&&l++,d.level==="warn"&&u++);return{totalLogs:this.logHistory.length,byLevel:a,byPrefix:i,recentErrors:l,recentWarnings:u}}clearLogs(){this.logHistory=[],this.logIdCounter=0}getLogInfo(){return{entries:this.getLogs(),stats:this.getLogStats()}}trackDataSourceDefinition(e){this.config.enabled&&this.dataSources.set(e.id,{...e,status:"idle"})}trackDataSourceLoading(e){if(!this.config.enabled)return;const n=this.dataSources.get(e);n&&this.dataSources.set(e,{...n,status:"loading"})}trackDataSourceLoaded(e,n,a){if(!this.config.enabled)return;const i=this.dataSources.get(e);if(!i)return;let l,u,d=a;n&&(Array.isArray(n)?(l=n.length,u=n.length>0&&typeof n[0]=="object"?Object.keys(n[0]):void 0):typeof n=="object"&&(Array.isArray(n.data)?(d=d||"data",l=n.data.length,u=n.data.length>0&&typeof n.data[0]=="object"?Object.keys(n.data[0]):void 0):Array.isArray(n.items)?(d=d||"items",l=n.items.length,u=n.items.length>0&&typeof n.items[0]=="object"?Object.keys(n.items[0]):void 0):u=Object.keys(n))),this.dataSources.set(e,{...i,status:"loaded",dataPath:d,itemCount:l,keys:u,lastLoadedAt:Date.now(),error:void 0})}trackDataSourceError(e,n){if(!this.config.enabled)return;const a=this.dataSources.get(e);a&&this.dataSources.set(e,{...a,status:"error",error:n,lastLoadedAt:Date.now()})}untrackDataSource(e){this.dataSources.delete(e)}getDataSources(){return Array.from(this.dataSources.values())}getDataSource(e){return this.dataSources.get(e)}clearDataSources(){this.dataSources.clear()}trackDataPathTransform(e){if(!this.config.enabled)return;let n=this.dataPathTransforms.find(a=>a.dataSourceId===e.dataSourceId);n||(n={dataSourceId:e.dataSourceId,timestamp:Date.now(),transformSteps:[],warnings:[]},this.dataPathTransforms.push(n),this.dataPathTransforms.length>this.maxDataPathTransforms&&this.dataPathTransforms.shift()),n.transformSteps.push({step:e.step,inputPath:e.inputPath,inputValue:this.safeClone(e.inputValue),outputPath:e.outputPath,outputValue:this.safeClone(e.outputValue),config:e.config}),e.warning&&n.warnings.push(e.warning)}setDataPathFinalBinding(e,n){if(!this.config.enabled)return;const a=this.dataPathTransforms.find(i=>i.dataSourceId===e);a&&(a.finalBinding={expression:n.expression,resolvedPath:n.resolvedPath,value:this.safeClone(n.value)})}getDataPathTransformTrackingInfo(){const e=this.getDataPathTransformStats();return{transforms:[...this.dataPathTransforms],stats:e,timestamp:Date.now()}}getDataPathTransformStats(){const e=this.dataPathTransforms,n={};let a=0;const i={};for(const u of e){n[u.dataSourceId]=(n[u.dataSourceId]||0)+1,a+=u.warnings.length;for(const d of u.warnings)i[d]=(i[d]||0)+1}const l=Object.entries(i).map(([u,d])=>({warning:u,count:d})).sort((u,d)=>d.count-u.count).slice(0,10);return{totalTransforms:e.length,byDataSource:n,warningsCount:a,commonWarnings:l}}getDataPathTransformForDataSource(e){return this.dataPathTransforms.find(n=>n.dataSourceId===e)}clearDataPathTransforms(){this.dataPathTransforms=[]}trackNestedContext(e){if(!this.config.enabled)return"";const n=`nested-${++this.nestedContextIdCounter}`,a=[...new Set([...e.parentContext.available,...e.ownContext.added])],i={...e.parentContext.values,...e.ownContext.values},l={id:n,timestamp:Date.now(),componentId:e.componentId,componentType:e.componentType,parentContext:{available:e.parentContext.available,values:this.safeClone(e.parentContext.values)},ownContext:{added:e.ownContext.added,values:this.safeClone(e.ownContext.values)},mergedContext:{all:a,values:this.safeClone(i)},accessAttempts:[],depth:e.depth,parentId:e.parentId};return this.nestedContexts.push(l),this.nestedContexts.length>this.maxNestedContexts&&this.nestedContexts.shift(),n}trackNestedContextAccess(e,n){if(!this.config.enabled)return;const a=this.nestedContexts.find(i=>i.id===e);a&&a.accessAttempts.push({path:n.path,found:n.found,value:n.found?this.safeClone(n.value):void 0,error:n.error})}getNestedContextTrackingInfo(){const e=this.getNestedContextStats();return{contexts:[...this.nestedContexts],stats:e,timestamp:Date.now()}}getNestedContextStats(){const e=this.nestedContexts,n={expandChildren:0,cellChildren:0,iteration:0,modal:0,slot:0};let a=0,i=0;const l={};for(const d of e){n[d.componentType]++,d.depth>a&&(a=d.depth);for(const f of d.accessAttempts)f.found||(i++,l[f.path]=(l[f.path]||0)+1)}const u=Object.entries(l).map(([d,f])=>({path:d,count:f})).sort((d,f)=>f.count-d.count).slice(0,10);return{totalContexts:e.length,byType:n,maxDepth:a,failedAccessCount:i,commonFailedPaths:u}}getNestedContextForComponent(e){return this.nestedContexts.find(n=>n.componentId===e)}clearNestedContexts(){this.nestedContexts=[],this.nestedContextIdCounter=0}trackHandlerRegistration(e,n="custom",a,i){this.isEnabled&&this.handlers.set(e,{name:e,category:n,description:a,registeredAt:Date.now(),source:i})}trackHandlerUnregistration(e){this.isEnabled&&this.handlers.delete(e)}getHandlers(){return Array.from(this.handlers.values())}getHandler(e){return this.handlers.get(e)}getHandlersByCategory(e){return Array.from(this.handlers.values()).filter(n=>n.category===e)}clearHandlers(){this.handlers.clear()}trackEventSubscribe(e){if(!this.isEnabled)return;const n=this.componentEventSubscriptions.get(e),a=Date.now();n?(n.subscriberCount++,n.lastSubscribedAt=a):this.componentEventSubscriptions.set(e,{eventName:e,subscriberCount:1,firstSubscribedAt:a,lastSubscribedAt:a})}trackEventUnsubscribe(e){if(!this.isEnabled)return;const n=this.componentEventSubscriptions.get(e);n&&(n.subscriberCount--,n.subscriberCount<=0&&this.componentEventSubscriptions.delete(e))}trackEventEmit(e,n,a,i,l){if(!this.isEnabled)return;const u={id:`evt_${++this.componentEventIdCounter}`,eventName:e,data:this.sanitizeForLogging(n),timestamp:Date.now(),listenerCount:a,results:i?this.sanitizeForLogging(i):void 0,hasError:!!l,errorMessage:l?.message};this.componentEventEmitHistory.push(u),this.componentEventEmitHistory.length>this.maxComponentEventHistory&&(this.componentEventEmitHistory=this.componentEventEmitHistory.slice(-this.maxComponentEventHistory))}trackEventOff(e){this.isEnabled&&this.componentEventSubscriptions.delete(e)}trackEventClear(){this.isEnabled&&this.componentEventSubscriptions.clear()}getComponentEventInfo(){const e=Array.from(this.componentEventSubscriptions.values());return{subscriptions:e,emitHistory:[...this.componentEventEmitHistory],totalSubscribers:e.reduce((n,a)=>n+a.subscriberCount,0),totalEmits:this.componentEventEmitHistory.length}}getEventEmitHistory(){return[...this.componentEventEmitHistory]}getEventSubscriptions(){return Array.from(this.componentEventSubscriptions.values())}clearComponentEvents(){this.componentEventSubscriptions.clear(),this.componentEventEmitHistory=[],this.componentEventIdCounter=0}sanitizeForLogging(e){if(e==null||typeof e!="object")return e;try{return JSON.parse(JSON.stringify(e))}catch{return"[Circular or Non-serializable]"}}startStateChange(e,n,a,i){if(!this.config.enabled)return"";const l=`setState_${++this.stateRenderingIdCounter}`;this.currentStateChangeContext={setStateId:l,startTime:performance.now(),changedPath:e,trigger:i||{},renderedComponents:[]};const u={id:`sr_${this.stateRenderingIdCounter}`,setStateId:l,statePath:e,oldValue:this.sanitizeForLogging(n),newValue:this.sanitizeForLogging(a),timestamp:Date.now(),triggeredBy:i||{},renderedComponents:[],totalRenderDuration:0,affectedBindingsCount:0};return this.stateRenderingLogs.push(u),this.stateRenderingLogs.length>this.maxStateRenderingLogs&&this.stateRenderingLogs.shift(),l}trackComponentRender(e,n,a,i=[],l=[],u){if(!this.config.enabled)return;const d=this.componentRenderCounts.get(n)||0;this.componentRenderCounts.set(n,d+1);for(const f of i)this.stateToComponentMap.has(f)||this.stateToComponentMap.set(f,new Set),this.stateToComponentMap.get(f).add(n);if(this.currentStateChangeContext){const f={componentId:e,componentName:n,renderDuration:a,accessedStatePaths:i,evaluatedBindings:l,renderOrder:this.currentStateChangeContext.renderedComponents.length,parentId:u};this.currentStateChangeContext.renderedComponents.push(f)}this.trackRender(n)}completeStateChange(e){if(!this.config.enabled||!this.currentStateChangeContext||this.currentStateChangeContext.setStateId!==e)return;const n=this.currentStateChangeContext,i=performance.now()-n.startTime,l=this.stateRenderingLogs.findIndex(u=>u.setStateId===e);if(l>=0){const u=this.stateRenderingLogs[l];u.renderedComponents=n.renderedComponents,u.totalRenderDuration=i,u.affectedBindingsCount=n.renderedComponents.reduce((d,f)=>d+f.evaluatedBindings.length,0)}this.currentStateChangeContext=null}getCurrentStateChangeContext(){return this.currentStateChangeContext}getStateRenderingLogs(){return[...this.stateRenderingLogs]}getStateRenderingInfo(){const e=this.stateRenderingLogs,n=Object.fromEntries(this.componentRenderCounts),a={};for(const[i,l]of this.stateToComponentMap)a[i]=Array.from(l);return{logs:e,componentRenderCounts:n,stateToComponentMap:a,stats:this.calculateStateRenderingStats()}}calculateStateRenderingStats(){const e=this.stateRenderingLogs;if(e.length===0)return{totalStateChanges:0,totalRenders:0,avgRenderDuration:0,avgComponentsPerChange:0,topRenderedComponents:[],topInfluentialPaths:[]};const n=e.reduce((d,f)=>d+f.renderedComponents.length,0),a=e.reduce((d,f)=>d+f.totalRenderDuration,0)/e.length,i=n/e.length,l=Array.from(this.componentRenderCounts.entries()).sort((d,f)=>f[1]-d[1]).slice(0,5).map(([d,f])=>({name:d,count:f})),u=Array.from(this.stateToComponentMap.entries()).sort((d,f)=>f[1].size-d[1].size).slice(0,5).map(([d,f])=>({path:d,affectedComponents:f.size}));return{totalStateChanges:e.length,totalRenders:n,avgRenderDuration:a,avgComponentsPerChange:i,topRenderedComponents:l,topInfluentialPaths:u}}getComponentsAffectedByState(e){const n=this.stateToComponentMap.get(e);return n?Array.from(n):[]}getComponentRenderHistory(e){return this.stateRenderingLogs.filter(n=>n.renderedComponents.some(a=>a.componentName===e))}clearStateRenderingLogs(){this.stateRenderingLogs=[],this.componentRenderCounts.clear(),this.stateToComponentMap.clear(),this.currentStateChangeContext=null,this.stateRenderingIdCounter=0}trackComponentStateSource(e,n,a,i){this.config.enabled&&this.componentStateSources.set(e,{componentId:e,componentName:n,stateSource:a,stateProvider:i})}trackDynamicState(e,n){this.config.enabled&&this.dynamicStates.set(e,n)}trackContextFlow(e,n,a,i,l,u){if(!this.config.enabled)return;const d={component:n,componentId:e,contextReceived:a,passedToChildren:i,usedInRender:l};if(this.contextFlowNodes.set(e,d),u){const f=this.contextFlowNodes.get(u);f&&(f.children||(f.children=[]),f.children.push(d))}}getStateHierarchyInfo(e=!0){const n=this.buildStateHierarchyLayers(),a=this.detectStateConflicts(n),i=Array.from(this.componentStateSources.values());return{layers:e?n.map(u=>({...u,values:this.summarizeValues(u.values,2)})):n,conflicts:a,componentStateSources:i,timestamp:Date.now()}}summarizeValues(e,n,a=0){if(e==null)return e;if(typeof e!="object")return typeof e=="string"&&e.length>100?e.substring(0,100)+`... (${e.length}자)`:e;if(a>=n){if(Array.isArray(e))return`[Array(${e.length})]`;const u=Object.keys(e);return`{${u.slice(0,5).join(", ")}${u.length>5?`, ... +${u.length-5}`:""}}`}if(Array.isArray(e))return e.length<=3?e.map(u=>this.summarizeValues(u,n,a+1)):{__type:"array",__length:e.length,__preview:e.slice(0,3).map(u=>this.summarizeValues(u,n,a+1))};const i={},l=Object.keys(e);for(const u of l)i[u]=this.summarizeValues(e[u],n,a+1);return i}buildStateHierarchyLayers(){const e=[];try{const a=window.G7Core?.state?.get?.();if(!a)return e;a._local&&e.push({name:"Global _local",type:"global",path:"_local",values:a._local,priority:1}),a._global&&e.push({name:"Global _global",type:"global",path:"_global",values:a._global,priority:1});for(const[l,u]of this.dynamicStates)u&&Object.keys(u).length>0&&e.push({name:`DynamicState (${l})`,type:"dynamicState",componentId:l,values:u,priority:2});const i=this.computeEffectiveState(a._local||{});e.push({name:"Effective _local (merged)",type:"effective",values:i,priority:3})}catch(n){console.warn("[G7DevTools] 상태 계층 빌드 실패:",n)}return e}computeEffectiveState(e){const n={...e};for(const[,a]of this.dynamicStates)a._local&&Object.assign(n,a._local);return n}detectStateConflicts(e){const n=[],a=e.find(l=>l.type==="global"&&l.path==="_local");if(!a)return n;const i=e.filter(l=>l.type==="dynamicState");for(const l of i){const u=l.values._local||l.values;for(const[d,f]of Object.entries(u)){const g=a.values[d];if(JSON.stringify(g)!==JSON.stringify(f)){const m=[],b=[];for(const v of this.componentStateSources.values())v.stateSource.local.some(_=>_===`_local.${d}`||_===d)&&(v.stateProvider.type==="dynamicState"?m.push(v.componentName):v.stateProvider.type==="globalState"&&b.push(v.componentName));n.push({path:`_local.${d}`,globalValue:g,dynamicStateValue:f,effectiveValue:f,usedBy:m,notUsedBy:b,severity:b.length>0?"warning":"info",description:b.length>0?`${b.join(", ")}은(는) globalState._local을 읽어 dynamicState 값을 사용하지 못함`:"dynamicState 값이 globalState와 다르지만 모든 컴포넌트가 dynamicState를 사용"})}}}return n}getContextFlowInfo(){const e=[],n=new Set(this.contextFlowNodes.keys());for(const a of this.contextFlowNodes.values())if(a.children)for(const i of a.children)n.delete(i.componentId);for(const a of n){const i=this.contextFlowNodes.get(a);i&&e.push(i)}return{rootComponent:e.length>0?e[0].component:"Unknown",contextFlow:e,timestamp:Date.now()}}clearStateHierarchyData(){this.componentStateSources.clear(),this.contextFlowNodes.clear(),this.dynamicStates.clear()}trackComponentStyle(e,n,a,i){if(!this.config.enabled)return;const l=this.analyzeTailwindClasses(a),u={componentId:e,componentName:n,classes:a,computedStyles:i,tailwindAnalysis:l};this.componentStyles.set(e,u),this.detectStyleIssues(u)}analyzeTailwindClasses(e){const n=[],a=[],i=[],l=[],u=["sm:","md:","lg:","xl:","2xl:"],d=[/bg-\w+-\d+/,/text-\w+-\d+/,/border-\w+-\d+/];for(const f of e){l.push(f),f.startsWith("dark:")&&n.push(f);for(const g of u)if(f.startsWith(g)){a.push(f);break}for(const g of d)if(g.test(f)){i.push(f);break}}return{usedClasses:l,darkClasses:n,responsiveClasses:a,dynamicClasses:i}}detectStyleIssues(e){const{componentId:n,componentName:a,computedStyles:i,tailwindAnalysis:l}=e;(i.opacity==="0"||i.visibility==="hidden"||i.display==="none"||i.width==="0px"&&i.height==="0px")&&this.addStyleIssue({id:this.generateId(),type:"invisible-element",componentId:n,componentName:a,property:i.opacity==="0"?"opacity":i.visibility==="hidden"?"visibility":i.display==="none"?"display":"width/height",currentValue:i.opacity==="0"?"0":i.visibility==="hidden"?"hidden":i.display==="none"?"none":"0px",severity:"warning",description:"요소가 화면에 보이지 않습니다.",suggestion:"opacity, visibility, display, width/height 값을 확인하세요."});const u=l.usedClasses.filter(f=>f.startsWith("bg-")&&!f.startsWith("dark:")),d=l.darkClasses.filter(f=>f.includes("bg-"));u.length>0&&d.length===0&&this.addStyleIssue({id:this.generateId(),type:"dark-mode-missing",componentId:n,componentName:a,property:"background-color",currentValue:u.join(", "),expectedValue:"dark:bg-* 클래스 필요",severity:"info",description:"다크 모드 배경색 클래스가 누락되었습니다.",suggestion:`${u[0]}에 대응하는 dark: 클래스를 추가하세요.`}),l.dynamicClasses.length>0&&this.addStyleIssue({id:this.generateId(),type:"tailwind-purging",componentId:n,componentName:a,property:"class",currentValue:l.dynamicClasses.join(", "),severity:"info",description:"동적으로 생성된 Tailwind 클래스가 있습니다.",suggestion:"tailwind.config.js의 safelist에 추가하거나 전체 클래스명을 상수로 정의하세요."})}addStyleIssue(e){this.styleIssues.some(a=>a.componentId===e.componentId&&a.type===e.type&&a.property===e.property)||this.styleIssues.push(e)}getStyleValidationInfo(){const e=Array.from(this.componentStyles.values());return{issues:[...this.styleIssues],componentStyles:e,stats:{totalComponents:e.length,invisibleCount:this.styleIssues.filter(n=>n.type==="invisible-element").length,tailwindIssueCount:this.styleIssues.filter(n=>n.type==="tailwind-purging").length,darkModeIssueCount:this.styleIssues.filter(n=>n.type==="dark-mode-missing").length},timestamp:Date.now()}}clearStyleValidationData(){this.styleIssues=[],this.componentStyles.clear()}trackAuthEvent(e,n,a,i){if(!this.config.enabled)return;const l={id:`auth_${++this.authEventIdCounter}`,type:e,timestamp:Date.now(),success:n,error:a,details:i};this.authEvents.push(l),this.authEvents.length>this.maxAuthEventHistory&&(this.authEvents=this.authEvents.slice(-this.maxAuthEventHistory))}trackAuthHeader(e,n,a,i,l){if(!this.config.enabled)return;const u={url:e,hasAuthHeader:n,headerType:a,tokenValid:i??!1,responseStatus:l,timestamp:Date.now()};this.authHeaderHistory.push(u),this.authHeaderHistory.length>this.maxAuthEventHistory&&(this.authHeaderHistory=this.authHeaderHistory.slice(-this.maxAuthEventHistory)),l===401&&this.trackAuthEvent("api-unauthorized",!1,`401 Unauthorized: ${e}`,{url:e})}getAuthState(){try{const e=window.G7Core,n=e?.api;let a=e?.auth;!a&&e?.AuthManager?.getInstance&&(a=e.AuthManager.getInstance());const i=n?.getToken?.()||a?.getAccessToken?.()||localStorage.getItem("auth_token")||localStorage.getItem("access_token"),l=a?.getRefreshToken?.()||localStorage.getItem("refresh_token");let u="unknown",d=a?.getUser?.();if(d&&(u="AuthManager"),!d){const S=e?.state?.get?.();d=S?._global?.user||S?._global?.currentUser||S?.user||S?.currentUser,d&&(u="G7Core.state")}const f=a?.isAuthenticated?.()??!1;let g="memory";localStorage.getItem("auth_token")||localStorage.getItem("access_token")?g="localStorage":(sessionStorage.getItem("auth_token")||sessionStorage.getItem("access_token"))&&(g="sessionStorage");const m=!!i&&(!!d||f);let b;i&&typeof i=="string"&&i.length>20?b=`${i.substring(0,10)}...${i.substring(i.length-6)}`:i&&(b="***");const v=d?{id:d.id,email:d.email,name:d.name,roles:d.roles?.map(S=>typeof S=="string"?{name:S}:{id:S.id,name:S.name,guard_name:S.guard_name}),permissions:d.permissions?.map(S=>typeof S=="string"?{name:S}:{id:S.id,name:S.name,guard_name:S.guard_name}),avatar:d.avatar||d.profile_photo_url||d.profile_image,created_at:d.created_at,updated_at:d.updated_at,last_login_at:d.last_login_at,email_verified_at:d.email_verified_at,...d.phone&&{phone:d.phone},...d.nickname&&{nickname:d.nickname},...d.status&&{status:d.status},...d.locale&&{locale:d.locale}}:void 0;return{isAuthenticated:m,user:v,tokens:{hasAccessToken:!!i,hasRefreshToken:!!l,storage:g,accessTokenPreview:b},lastActivity:Date.now(),source:u}}catch{return{isAuthenticated:!1,tokens:{hasAccessToken:!1,hasRefreshToken:!1,storage:"memory"},source:"unknown"}}}getAuthDebugInfo(){const e=[...this.authEvents];return{state:this.getAuthState(),events:e,headerAnalysis:[...this.authHeaderHistory],stats:{loginAttempts:e.filter(n=>n.type==="login").length,successfulLogins:e.filter(n=>n.type==="login"&&n.success).length,failedLogins:e.filter(n=>n.type==="login"&&!n.success).length,tokenRefreshes:e.filter(n=>n.type==="token-refresh").length,unauthorizedResponses:e.filter(n=>n.type==="api-unauthorized").length},timestamp:Date.now()}}clearAuthData(){this.authEvents=[],this.authHeaderHistory=[],this.authEventIdCounter=0}trackLayoutLoad(e,n,a,i="api"){if(!this.config.enabled)return;const l=Date.now();this.currentLayout={layoutPath:e,templateId:n,layoutJson:this.sanitizeObject(a),loadedAt:l,version:a.version,layoutName:a.layout_name,source:i};const u={id:`layout-${++this.layoutIdCounter}`,layoutPath:e,templateId:n,loadedAt:l,source:i,version:a.version};this.layoutHistory.push(u),this.layoutHistory.length>this.maxLayoutHistory&&this.layoutHistory.shift(),this.layoutStats.totalLoads++,i==="cache"?this.layoutStats.cacheHits++:this.layoutStats.apiLoads++}getCurrentLayout(){return this.currentLayout}getLayoutHistory(){return[...this.layoutHistory]}getLayoutDebugInfo(){return{current:this.currentLayout,history:[...this.layoutHistory],stats:{...this.layoutStats}}}clearLayoutData(){this.currentLayout=null,this.layoutHistory=[],this.layoutIdCounter=0,this.layoutStats={totalLoads:0,cacheHits:0,apiLoads:0}}startHandlerExecution(e){if(!this.config.enabled)return"";const n=`exec_${++this.executionIdCounter}_${Date.now()}`,a={handlerName:e,executionId:n,startTime:Date.now(),stateChanges:[],dataSourceChanges:[],alerts:[]};if(this.executionDetails.set(n,a),this.executionDetails.size>this.maxExecutionDetails){const i=Array.from(this.executionDetails.keys());i.slice(0,i.length-this.maxExecutionDetails).forEach(u=>this.executionDetails.delete(u))}return n}endHandlerExecution(e,n,a,i){if(!this.config.enabled||!e)return;const l=this.executionDetails.get(e);if(!l)return;l.endTime=Date.now(),l.duration=l.endTime-l.startTime,l.exitReason=n,l.exitLocation=a,l.exitDescription=i;const u=this.changeExpectations.get(e);u&&(l.expectedChanges=u,this.checkExpectations(e,l,u),this.changeExpectations.delete(e)),n==="normal"&&l.stateChanges.length===0&&l.dataSourceChanges.length===0&&this.addChangeAlert(e,{type:"no-state-change",severity:"warning",message:`핸들러 "${l.handlerName}"이(가) 상태 변경 없이 완료됨`,description:"핸들러가 성공적으로 완료되었지만 상태나 데이터소스 변경이 없습니다. 의도한 동작인지 확인하세요.",handlerName:l.handlerName,suggestion:'핸들러 내부 조건문을 확인하거나 DevTools의 "변경감지" 탭에서 exitLocation을 확인하세요.',docLink:"troubleshooting-state.md"}),(n==="early-return-condition"||n==="early-return-validation")&&this.addChangeAlert(e,{type:"early-return-detected",severity:"info",message:`핸들러 "${l.handlerName}"이(가) early return으로 종료됨`,description:i||`종료 위치: ${a||"알 수 없음"}`,handlerName:l.handlerName,suggestion:n==="early-return-validation"?"검증 실패로 인한 early return입니다. 입력 데이터를 확인하세요.":"조건부 early return입니다. 조건문의 평가 결과를 확인하세요."})}recordExitReason(e,n,a,i){if(!this.config.enabled||!e)return;const l=this.executionDetails.get(e);l&&(l.exitReason=n,l.exitLocation=a,l.exitDescription=i)}recordStateChange(e,n,a,i,l){if(!this.config.enabled)return;const u={id:`sc_${++this.stateChangeIdCounter}`,path:n,changeType:a,oldValue:this.safeClone(i),newValue:this.safeClone(l),timestamp:Date.now(),comparison:this.compareValues(i,l),executionId:e};if(this.stateChangeHistory.push(u),e){const d=this.executionDetails.get(e);d&&d.stateChanges.push(u)}this.stateChangeHistory.length>this.maxStateChangeHistory&&this.stateChangeHistory.splice(0,this.stateChangeHistory.length-this.maxStateChangeHistory),u.comparison.isDeepEqual&&typeof i=="object"&&i!==null&&this.addChangeAlert(e||"",{type:"object-reference-same",severity:"warning",message:`상태 "${n}"가 변경되었으나 값이 동일함`,description:"객체 참조가 동일하거나 깊은 비교 결과 변경이 없습니다. 변경 감지가 실패할 수 있습니다.",handlerName:e&&this.executionDetails.get(e)?.handlerName||"unknown",statePath:n,suggestion:"불변성을 유지하여 새 객체를 생성하세요. 예: { ...oldObject, newField: value }",docLink:"troubleshooting-state.md#object-mutation"})}recordDataSourceChange(e,n,a,i,l){if(!this.config.enabled)return;const u={dataSourceId:n,changeType:a,timestamp:Date.now(),previousStatus:i,newStatus:l,executionId:e};if(this.dataSourceChangeHistory.push(u),e){const d=this.executionDetails.get(e);d&&d.dataSourceChanges.push(u)}this.dataSourceChangeHistory.length>this.maxStateChangeHistory&&this.dataSourceChangeHistory.splice(0,this.dataSourceChangeHistory.length-this.maxStateChangeHistory)}expectChange(e,n,a){if(!this.config.enabled||!e)return;const i=this.executionDetails.get(e);if(!i)return;const l={expectedStatePaths:n,expectedDataSources:a,setAt:Date.now(),source:i.handlerName};this.changeExpectations.set(e,l)}checkExpectations(e,n,a){const i=new Set(n.stateChanges.map(u=>u.path)),l=new Set(n.dataSourceChanges.map(u=>u.dataSourceId));for(const u of a.expectedStatePaths)i.has(u)||this.addChangeAlert(e,{type:"expected-not-fulfilled",severity:"error",message:`기대한 상태 변경 "${u}"가 발생하지 않음`,description:`핸들러 "${n.handlerName}"이(가) "${u}" 변경을 예고했지만 실제로 변경되지 않았습니다.`,handlerName:n.handlerName,statePath:u,suggestion:"핸들러 내부 로직을 확인하세요. early return이나 조건부 분기로 인해 변경이 생략되었을 수 있습니다.",docLink:"troubleshooting-state.md"});for(const u of a.expectedDataSources)l.has(u)||this.addChangeAlert(e,{type:"expected-not-fulfilled",severity:"error",message:`기대한 데이터소스 갱신 "${u}"가 발생하지 않음`,description:`핸들러 "${n.handlerName}"이(가) "${u}" 갱신을 예고했지만 실제로 갱신되지 않았습니다.`,handlerName:n.handlerName,dataSourceId:u,suggestion:"refetchDataSource 호출이 실행되었는지 확인하세요.",docLink:"data-sources.md"})}addChangeAlert(e,n){const a={...n,id:`alert_${++this.alertIdCounter}`,timestamp:Date.now()};if(this.changeAlerts.push(a),e){const i=this.executionDetails.get(e);i&&i.alerts.push(a)}this.changeAlerts.length>this.maxChangeAlerts&&this.changeAlerts.splice(0,this.changeAlerts.length-this.maxChangeAlerts)}compareValues(e,n){const a=this.getValueType(e),i=this.getValueType(n),l=a!==i;let u=!1,d;return!l&&(a==="object"||a==="array")?(u=this.deepEqual(e,n),!u&&a==="object"&&(d=this.getChangedKeys(e,n))):u=e===n,{typeChanged:l,oldType:a,newType:i,isDeepEqual:u,changedKeys:d}}getValueType(e){return e===null?"null":e===void 0?"undefined":Array.isArray(e)?"array":typeof e}deepEqual(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(e===null||n===null||typeof e!="object")return e===n;if(Array.isArray(e)!==Array.isArray(n))return!1;const a=Object.keys(e),i=Object.keys(n);if(a.length!==i.length)return!1;for(const l of a)if(!i.includes(l)||!this.deepEqual(e[l],n[l]))return!1;return!0}getChangedKeys(e,n){const a=[],i=new Set([...Object.keys(e),...Object.keys(n)]);for(const l of i)this.deepEqual(e[l],n[l])||a.push(l);return a}getChangeDetectionInfo(){const e=Array.from(this.executionDetails.values()),n={totalExecutions:e.length,executionsWithStateChange:e.filter(a=>a.stateChanges.length>0).length,executionsWithoutStateChange:e.filter(a=>a.stateChanges.length===0&&a.exitReason==="normal").length,earlyReturnCount:e.filter(a=>a.exitReason==="early-return-condition"||a.exitReason==="early-return-validation").length,alertCount:this.changeAlerts.length,alertsByType:this.getAlertsByType()};return{executionDetails:e,stateChangeHistory:[...this.stateChangeHistory],dataSourceChangeHistory:[...this.dataSourceChangeHistory],alerts:[...this.changeAlerts],stats:n,timestamp:Date.now()}}getAlertsByType(){const e={"no-state-change":0,"no-datasource-change":0,"expected-not-fulfilled":0,"object-reference-same":0,"early-return-detected":0,"async-timing-issue":0};for(const n of this.changeAlerts)e[n.type]++;return e}clearChangeDetectionData(){this.executionDetails.clear(),this.stateChangeHistory=[],this.dataSourceChangeHistory=[],this.changeAlerts=[],this.changeExpectations.clear(),this.executionIdCounter=0,this.stateChangeIdCounter=0,this.alertIdCounter=0}getRecentAlerts(e=10,n){let a=[...this.changeAlerts];return n&&(a=a.filter(i=>i.severity===n)),a.slice(-e)}getHandlerExecutions(e,n=10){return Array.from(this.executionDetails.values()).filter(i=>i.handlerName===e).slice(-n)}findExecutionInStack(e){return this.sequenceExecutionStack.find(n=>n.sequenceId===e)}startSequenceExecution(e){if(!this.config.enabled)return"";const n=`seq_${++this.sequenceIdCounter}_${Date.now()}`,a={sequenceId:n,startTime:Date.now(),totalDuration:0,trigger:e,actions:[],status:"running"};return this.sequenceExecutionStack.push(a),n}captureSequenceActionBefore(e,n,a,i,l){if(!this.config.enabled)return;const u=this.findExecutionInStack(e);if(!u)return;const d={index:n,handler:a,params:this.safeClone(i),stateBeforeAction:{_global:this.safeClone(l._global),_local:this.safeClone(l._local),_isolated:l._isolated?this.safeClone(l._isolated):void 0},stateAfterAction:{_global:{},_local:{}},duration:0,status:"success"};u.actions.push(d)}captureSequenceActionAfter(e,n,a,i,l,u){if(!this.config.enabled)return;const d=this.findExecutionInStack(e);if(!d)return;const f=d.actions.find(m=>m.index===n);if(!f)return;f.stateAfterAction={_global:this.safeClone(a._global),_local:this.safeClone(a._local),_isolated:a._isolated?this.safeClone(a._isolated):void 0},f.duration=i,f.result=this.safeClone(l),f.stateDiff={global:this.computeStateDiff(f.stateBeforeAction._global,f.stateAfterAction._global),local:this.computeStateDiff(f.stateBeforeAction._local,f.stateAfterAction._local)},f.stateBeforeAction._isolated&&f.stateAfterAction._isolated&&(f.stateDiff.isolated=this.computeStateDiff(f.stateBeforeAction._isolated,f.stateAfterAction._isolated));const g=window.__g7PendingLocalState;g&&(f.pendingState=this.safeClone(g)),u&&(f.status="error",f.error={name:u.name,message:u.message,stack:u.stack})}endSequenceExecution(e,n){if(!this.config.enabled)return;const a=this.sequenceExecutionStack.findIndex(l=>l.sequenceId===e);if(a===-1)return;const i=this.sequenceExecutionStack[a];if(i.endTime=Date.now(),i.totalDuration=i.endTime-i.startTime,n){i.status="error",i.error={name:n.name,message:n.message,stack:n.stack};const l=i.actions.find(u=>u.status==="error");l&&(i.failedAtIndex=l.index)}else i.status="success";this.sequenceExecutions.push(i),this.sequenceExecutions.length>this.maxSequenceExecutions&&this.sequenceExecutions.shift(),this.sequenceExecutionStack.splice(a,1)}computeStateDiff(e,n){const a=[],i=[],l=[],u=new Set(Object.keys(e)),d=new Set(Object.keys(n));for(const f of d)u.has(f)||a.push(f);for(const f of u)d.has(f)||i.push(f);for(const f of u)if(d.has(f)){const g=e[f],m=n[f];JSON.stringify(g)!==JSON.stringify(m)&&l.push({path:f,oldValue:g,newValue:m})}return{added:a,removed:i,changed:l}}getSequenceTrackingInfo(){const e=this.getSequenceStats(),n=this.sequenceExecutionStack.length>0?this.sequenceExecutionStack[this.sequenceExecutionStack.length-1]:void 0;return{executions:[...this.sequenceExecutions],currentExecution:n,stats:e}}getSequenceStats(){const e=this.sequenceExecutions,n=e.length,a=e.filter(g=>g.status==="success").length,i=e.filter(g=>g.status==="error").length,l=e.reduce((g,m)=>g+m.actions.length,0),u=n>0?e.reduce((g,m)=>g+m.totalDuration,0)/n:0,d={};for(const g of e)for(const m of g.actions)d[m.handler]=(d[m.handler]||0)+1;const f=Object.entries(d).sort(([,g],[,m])=>m-g).slice(0,5).map(([g,m])=>({handler:g,count:m}));return{totalExecutions:n,successCount:a,errorCount:i,totalActions:l,avgDuration:u,topHandlers:f}}clearSequenceData(){this.sequenceExecutions=[],this.sequenceExecutionStack=[],this.sequenceIdCounter=0}getSequenceExecution(e){const n=this.findExecutionInStack(e);return n||this.sequenceExecutions.find(a=>a.sequenceId===e)}getRecentSequences(e=10){return this.sequenceExecutions.slice(-e)}registerStateCaptureForHandler(e,n,a){if(!this.config.enabled)return;const i=new Map,l=Date.now();for(const u of n)i.set(u,{value:this.safeClone(a[u]),capturedAt:l});this.stateCaptureRegistry.set(e,i)}detectStaleClosure(e,n,a,i,l){if(!this.config.enabled)return[];const u=this.stateCaptureRegistry.get(e);if(!u)return[];const d=Date.now(),f=[];for(const[g,m]of u){const b=this.getValueByPath(a,g),v=d-m.capturedAt;if(!this.isDeepEqual(m.value,b)&&v>0){const S=this.createStaleClosureWarning(i,n,g,m.value,m.capturedAt,b,d,v,l);f.push(S),this.addStaleClosureWarning(S)}}return this.stateCaptureRegistry.delete(e),f}trackStaleClosureWarning(e){if(!this.config.enabled)return;const n=Date.now(),a=this.createStaleClosureWarning(e.type,e.location,e.capturedPath,e.capturedValue,e.capturedAt,e.currentValue,n,n-e.capturedAt,e.actionId,e.stackTrace);this.addStaleClosureWarning(a)}createStaleClosureWarning(e,n,a,i,l,u,d,f,g,m){const b=this.getStaleClosureSeverity(e,f),{description:v,suggestion:S,docLink:_}=this.getStaleClosureMessages(e,a,f);return{id:`stale_${++this.staleClosureIdCounter}_${Date.now()}`,timestamp:Date.now(),type:e,location:n,capturedState:{path:a,capturedValue:this.safeClone(i),capturedAt:l},currentState:{path:a,currentValue:this.safeClone(u),retrievedAt:d},timeDiff:f,severity:b,description:v,suggestion:S,docLink:_,actionId:g,stackTrace:m}}getStaleClosureSeverity(e,n){if(n>5e3)return"error";if(n>1e3)return"warning";switch(e){case"async-state-capture":case"sequence-state-mismatch":return"warning";case"callback-state-capture":case"timeout-state-capture":return"info";case"event-handler-stale":return"warning";default:return"info"}}getStaleClosureMessages(e,n,a){const i=a<1e3?`${a}ms`:`${(a/1e3).toFixed(1)}s`;switch(e){case"async-state-capture":return{description:`await 후 ${i} 경과 시점에 '${n}' 상태가 변경됨. 캡처된 상태 대신 최신 상태를 사용해야 함`,suggestion:"await 이후에는 G7Core.state.get()으로 최신 상태를 다시 조회하거나, useRef + getter 패턴을 사용하세요",docLink:"troubleshooting-state-closure.md"};case"callback-state-capture":return{description:`콜백에서 ${i} 전에 캡처된 '${n}' 상태를 사용 중. 최신 상태와 다름`,suggestion:"콜백에서 상태를 참조할 때는 stateRef.current 패턴 또는 G7Core.state.get()를 사용하세요",docLink:"troubleshooting-state-closure.md"};case"timeout-state-capture":return{description:`setTimeout/setInterval 콜백에서 '${n}' 상태가 ${i} 전 값 사용 중`,suggestion:"타이머 콜백 내에서는 G7Core.state.get()으로 최신 상태를 조회하세요",docLink:"troubleshooting-state-closure.md"};case"sequence-state-mismatch":return{description:`sequence 내 '${n}' 상태가 이전 액션 결과와 불일치. context.state 대신 캡처된 값 사용 의심`,suggestion:"sequence 내에서는 context.state 또는 $prev를 사용하여 최신 상태를 참조하세요",docLink:"troubleshooting-state-setstate.md"};case"event-handler-stale":return{description:`이벤트 핸들러에서 ${i} 전에 바인딩된 '${n}' 상태 사용 중`,suggestion:"이벤트 핸들러에서 상태를 참조할 때는 useRef 패턴 또는 G7Core.state.get()를 사용하세요",docLink:"troubleshooting-state-closure.md"};default:return{description:`'${n}' 상태에서 stale closure 감지됨 (${i} 경과)`,suggestion:"상태 참조 시 최신 값을 사용하는지 확인하세요"}}}addStaleClosureWarning(e){this.staleClosureWarnings.push(e),this.staleClosureWarnings.length>this.maxStaleClosureWarnings&&this.staleClosureWarnings.shift()}getValueByPath(e,n){const a=n.split(".");let i=e;for(const l of a){if(i==null)return;i=i[l]}return i}isDeepEqual(e,n){if(e===n)return!0;if(e===null||n===null)return e===n;if(typeof e!=typeof n)return!1;if(typeof e!="object")return e===n;try{return JSON.stringify(e)===JSON.stringify(n)}catch{return!1}}getStaleClosureTrackingInfo(){const e=this.getStaleClosureStats();return{warnings:[...this.staleClosureWarnings],stats:e,timestamp:Date.now()}}getStaleClosureStats(){const e=this.staleClosureWarnings,n={"async-state-capture":0,"callback-state-capture":0,"timeout-state-capture":0,"sequence-state-mismatch":0,"event-handler-stale":0};for(const f of e)n[f.type]++;const a={info:0,warning:0,error:0};for(const f of e)a[f.severity]++;const i={};for(const f of e)i[f.location]=(i[f.location]||0)+1;const l=Object.entries(i).sort(([,f],[,g])=>g-f).slice(0,5).map(([f,g])=>({location:f,count:g})),u={};for(const f of e)u[f.capturedState.path]=(u[f.capturedState.path]||0)+1;const d=Object.entries(u).sort(([,f],[,g])=>g-f).slice(0,5).map(([f,g])=>({path:f,count:g}));return{totalWarnings:e.length,warningsByType:n,warningsBySeverity:a,topLocations:l,topAffectedPaths:d}}clearStaleClosureData(){this.staleClosureWarnings=[],this.staleClosureIdCounter=0,this.stateCaptureRegistry.clear()}getRecentStaleClosureWarnings(e=10,n){let a=[...this.staleClosureWarnings];return n&&(a=a.filter(i=>i.severity===n)),a.slice(-e)}safeClone(e){if(e==null||typeof e!="object")return e;try{return JSON.parse(JSON.stringify(e))}catch{if(Array.isArray(e))return e.map(a=>{try{return JSON.parse(JSON.stringify(a))}catch{return"[Unserializable]"}});const n={};for(const a of Object.keys(e))try{n[a]=JSON.parse(JSON.stringify(e[a]))}catch{n[a]="[Unserializable]"}return n}}};$(yi,"instance");let Ta=yi;const Fn=ft("LayoutLoader");class Sr extends Error{constructor(n,a,i){super(n);$(this,"code");$(this,"details");this.code=a,this.details=i,this.name="LayoutLoaderError"}}class lf{constructor(e){$(this,"componentRegistry");$(this,"currentLayout",null);$(this,"layoutCache",new Map);$(this,"cacheVersion",0);this.componentRegistry=e}setCacheVersion(e){this.cacheVersion!==e&&(Fn.log("Cache version updated:",this.cacheVersion,"->",e),this.cacheVersion=e,this.layoutCache.clear())}getCacheVersion(){return this.cacheVersion}async loadLayout(e,n){const a=`${e}:${n}`;if(this.layoutCache.has(a)){Fn.log("Loading layout from cache:",n);const l=await this.layoutCache.get(a),u=JSON.parse(JSON.stringify(l));return this.currentLayout=u,Ta.getInstance().trackLayoutLoad(n,e,u,"cache"),u}const i=this.fetchLayout(e,n);return this.layoutCache.set(a,i),i.catch(()=>{this.layoutCache.get(a)===i&&this.layoutCache.delete(a)}),i}async fetchLayout(e,n,a=!1){try{const i=this.cacheVersion>0?this.cacheVersion:null;let l;if(n.startsWith("__preview__/")){const v=n.replace("__preview__/","");l=Mr(`/api/layouts/preview/${v}`,"json",i)}else l=Mr(`/api/layouts/${e}/${n}`,"json",i);Fn.log("Fetching layout from API:",l);const u=Ir(),d=a?null:u.getToken(),f={Accept:"application/json"};d&&(f.Authorization=`Bearer ${d}`);const g=await Dl(l,{init:{headers:f},label:`layout: ${n}`});let m;try{m=await g.json()}catch{m=null}if(!g.ok){if(g.status===401&&!a&&d){Fn.log("Token invalid, removing and retrying without token"),u.removeToken();try{return await this.fetchLayout(e,n,!0)}catch(S){throw S instanceof Sr&&S.details?.status===401?new Sr(S.message,S.code,{...S.details,hadToken:!0}):S}}const v=m?.message||m?.error;throw new Sr(`Failed to fetch layout: ${g.status} ${g.statusText}`,"FETCH_FAILED",{status:g.status,statusText:g.statusText,url:l,apiMessage:v})}const b=m.data||m;return this.validateLayoutData(b),this.currentLayout=b,Ta.getInstance().trackLayoutLoad(n,e,b,"api"),Fn.log("Layout fetched and cached successfully:",b.layout_name),b}catch(i){const l=`${e}:${n}`;throw this.layoutCache.delete(l),i instanceof Sr?i:new Sr("Failed to load layout","LOAD_FAILED",{originalError:i})}}prefetchLayout(e,n){return this.loadLayout(e,n)}validateLayoutData(e){if(!e.version)throw new Sr("Layout data missing required field: version","VALIDATION_FAILED",{field:"version"});if(!e.layout_name)throw new Sr("Layout data missing required field: layout_name","VALIDATION_FAILED",{field:"layout_name"});if(!Array.isArray(e.components))throw new Sr('Layout data field "components" must be an array',"VALIDATION_FAILED",{field:"components",value:e.components});Fn.log("Layout data validation passed")}renderLayout(e,n){try{const a=n||this.currentLayout;if(!a)throw new Sr("No layout data to render","NO_LAYOUT_DATA");Fn.log("Rendering layout:",a.layout_name),e.innerHTML="",this.renderComponents(e,a.components),Fn.log("Layout rendered successfully")}catch(a){Fn.error("Render error:",a),this.renderErrorState(e,a)}}renderComponents(e,n){for(const a of n){const i=this.renderComponent(a);i&&e.appendChild(i)}}renderComponent(e){try{if(!this.componentRegistry.getComponent(e.type))return Fn.warn(`Component not found: ${e.type}`),this.createPlaceholderElement(e.type);const a=document.createElement("div");return a.setAttribute("data-component",e.type),e.props&&Object.entries(e.props).forEach(([i,l])=>{a.setAttribute(`data-prop-${i}`,JSON.stringify(l))}),e.children&&e.children.length>0?this.renderComponents(a,e.children):e.text&&(a.textContent=e.text),a}catch(n){return Fn.error(`Error rendering component ${e.type}:`,n),this.createErrorElement(e.type,n)}}createPlaceholderElement(e){const n=document.createElement("div");return n.className="component-placeholder",n.setAttribute("data-component-type",e),n.innerHTML=`
<div style="padding: 1rem; border: 2px dashed #ccc; background: #f9f9f9; text-align: center;">
<p style="margin: 0; color: #666;">Component not found: <strong>${e}</strong></p>
</div>
`,n}createErrorElement(e,n){const a=document.createElement("div");return a.className="component-error",a.setAttribute("data-component-type",e),a.innerHTML=`
<div style="padding: 1rem; border: 2px solid #f44336; background: #ffebee; border-radius: 4px;">
<p style="margin: 0 0 0.5rem 0; color: #c62828; font-weight: bold;">Component Error: ${e}</p>
<p style="margin: 0; color: #666; font-size: 0.875rem;">${n?.message||"Unknown error"}</p>
</div>
`,a}renderErrorState(e,n){const a=n instanceof Error?n.message:String(n),i=n instanceof Sr?n.code:"UNKNOWN_ERROR";e.innerHTML=`
<div class="layout-error" data-error-code="${i}" style="
padding: 2rem;
text-align: center;
background: #ffebee;
border: 2px solid #f44336;
border-radius: 8px;
margin: 2rem auto;
max-width: 600px;
">
<h2 style="
margin: 0 0 1rem 0;
color: #c62828;
font-size: 1.5rem;
">레이아웃 로드 실패</h2>
<p style="
margin: 0 0 1rem 0;
color: #666;
font-size: 1rem;
">${a}</p>
<p style="
margin: 0;
color: #999;
font-size: 0.875rem;
">오류 코드: ${i}</p>
<button
onclick="window.location.reload()"
style="
margin-top: 1.5rem;
padding: 0.75rem 1.5rem;
background: #f44336;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 1rem;
"
>페이지 새로고침</button>
</div>
`,Fn.error("Error state rendered:",i,a)}getCurrentLayout(){return this.currentLayout}clear(){this.currentLayout=null,this.layoutCache.clear(),Fn.log("Layout data and cache cleared")}}const z_=ft("TranslationContext"),cf=H.createContext(null),gc=({children:o,translationEngine:e,translationContext:n})=>{const a=H.useMemo(()=>(l,u)=>{if(u){const d="|"+Object.entries(u).map(([f,g])=>`${f}=${g}`).join("|");return e.translate(l,n,d)}return e.translate(l,n)},[e,n]),i=H.useMemo(()=>({translationEngine:e,translationContext:n,t:a}),[e,n,a]);return ht.jsx(cf.Provider,{value:i,children:o})},ny=()=>{const o=H.useContext(cf);return o||(z_.warn("TranslationProvider 외부에서 호출되었습니다. 키를 그대로 반환합니다."),{t:e=>e,translationEngine:null,translationContext:null})},Ra=ft("SlotContext"),j_={registerToSlot:()=>{Ra.warn("SlotContext not available: registerToSlot called outside SlotProvider")},unregisterFromSlot:()=>{Ra.warn("SlotContext not available: unregisterFromSlot called outside SlotProvider")},getSlotComponents:()=>[],subscribeToSlot:()=>()=>{},clearAllSlots:()=>{},isEnabled:!1},U_=H.createContext(j_),uf=({children:o})=>{const e=H.useRef(new Map),n=H.useRef(new Map),a=H.useCallback(m=>{const b=n.current.get(m);b&&b.forEach(v=>{try{v()}catch(S){Ra.error(`Slot subscriber error (slotId: ${m}):`,S)}})},[]),i=H.useCallback((m,b,v)=>{if(!m||!b){Ra.warn("registerToSlot: slotId and componentId are required");return}e.current.has(m)||e.current.set(m,new Map);const S=e.current.get(m),_=S.get(b);_&&_.registrationKey===v.registrationKey||(S.set(b,v),Ra.log(`Component registered to slot: ${b} -> ${m} (order: ${v.order})`),a(m))},[a]),l=H.useCallback((m,b)=>{const v=e.current.get(m);v&&v.has(b)&&(v.delete(b),Ra.log(`Component unregistered from slot: ${b} <- ${m}`),v.size===0&&e.current.delete(m),a(m))},[a]),u=H.useCallback(m=>{const b=e.current.get(m);return b?Array.from(b.values()).sort((v,S)=>v.order-S.order):[]},[]),d=H.useCallback((m,b)=>{n.current.has(m)||n.current.set(m,new Set);const v=n.current.get(m);return v.add(b),()=>{v.delete(b),v.size===0&&n.current.delete(m)}},[]),f=H.useCallback(()=>{e.current.forEach((m,b)=>{a(b)}),e.current.clear(),n.current.clear(),Ra.log("All slots cleared")},[a]),g=H.useMemo(()=>({registerToSlot:i,unregisterFromSlot:l,getSlotComponents:u,subscribeToSlot:d,clearAllSlots:f,isEnabled:!0}),[i,l,u,d,f]);return H.useLayoutEffect(()=>{typeof window<"u"&&(window.__slotContextValue=g,Ra.log("SlotContext exposed to window.__slotContextValue"))},[g]),ht.jsx(U_.Provider,{value:g,children:o})};class df{constructor(){this.notificationCreatedEvent=".Illuminate\\Notifications\\Events\\BroadcastNotificationCreated"}listenForWhisper(e,n){return this.listen(".client-"+e,n)}notification(e){return this.listen(this.notificationCreatedEvent,e)}stopListeningForNotification(e){return this.stopListening(this.notificationCreatedEvent,e)}stopListeningForWhisper(e,n){return this.stopListening(".client-"+e,n)}}class ry{constructor(e){this.namespace=e}format(e){return[".","\\"].includes(e.charAt(0))?e.substring(1):(this.namespace&&(e=this.namespace+"."+e),e.replace(/\./g,"\\"))}setNamespace(e){this.namespace=e}}function B_(o){try{return Reflect.construct(String,[],o),!0}catch{return!1}}class ff extends df{constructor(e,n,a){super(),this.name=n,this.pusher=e,this.options=a,this.eventFormatter=new ry(this.options.namespace),this.subscribe()}subscribe(){this.subscription=this.pusher.subscribe(this.name)}unsubscribe(){this.pusher.unsubscribe(this.name)}listen(e,n){return this.on(this.eventFormatter.format(e),n),this}listenToAll(e){return this.subscription.bind_global((n,a)=>{if(n.startsWith("pusher:"))return;let i=String(this.options.namespace??"").replace(/\./g,"\\"),l=n.startsWith(i)?n.substring(i.length+1):"."+n;e(l,a)}),this}stopListening(e,n){return n?this.subscription.unbind(this.eventFormatter.format(e),n):this.subscription.unbind(this.eventFormatter.format(e)),this}stopListeningToAll(e){return e?this.subscription.unbind_global(e):this.subscription.unbind_global(),this}subscribed(e){return this.on("pusher:subscription_succeeded",()=>{e()}),this}error(e){return this.on("pusher:subscription_error",n=>{e(n)}),this}on(e,n){return this.subscription.bind(e,n),this}}class ay extends ff{whisper(e,n){return this.pusher.channels.channels[this.name].trigger(`client-${e}`,n),this}}class P_ extends ff{whisper(e,n){return this.pusher.channels.channels[this.name].trigger(`client-${e}`,n),this}}class q_ extends ay{here(e){return this.on("pusher:subscription_succeeded",n=>{e(Object.keys(n.members).map(a=>n.members[a]))}),this}joining(e){return this.on("pusher:member_added",n=>{e(n.info)}),this}whisper(e,n){return this.pusher.channels.channels[this.name].trigger(`client-${e}`,n),this}leaving(e){return this.on("pusher:member_removed",n=>{e(n.info)}),this}}class iy extends df{constructor(e,n,a){super(),this.events={},this.listeners={},this.name=n,this.socket=e,this.options=a,this.eventFormatter=new ry(this.options.namespace),this.subscribe()}subscribe(){this.socket.emit("subscribe",{channel:this.name,auth:this.options.auth||{}})}unsubscribe(){this.unbind(),this.socket.emit("unsubscribe",{channel:this.name,auth:this.options.auth||{}})}listen(e,n){return this.on(this.eventFormatter.format(e),n),this}stopListening(e,n){return this.unbindEvent(this.eventFormatter.format(e),n),this}subscribed(e){return this.on("connect",n=>{e(n)}),this}error(e){return this}on(e,n){return this.listeners[e]=this.listeners[e]||[],this.events[e]||(this.events[e]=(a,i)=>{this.name===a&&this.listeners[e]&&this.listeners[e].forEach(l=>l(i))},this.socket.on(e,this.events[e])),this.listeners[e].push(n),this}unbind(){Object.keys(this.events).forEach(e=>{this.unbindEvent(e)})}unbindEvent(e,n){this.listeners[e]=this.listeners[e]||[],n&&(this.listeners[e]=this.listeners[e].filter(a=>a!==n)),(!n||this.listeners[e].length===0)&&(this.events[e]&&(this.socket.removeListener(e,this.events[e]),delete this.events[e]),delete this.listeners[e])}}class sy extends iy{whisper(e,n){return this.socket.emit("client event",{channel:this.name,event:`client-${e}`,data:n}),this}}class G_ extends sy{here(e){return this.on("presence:subscribed",n=>{e(n.map(a=>a.user_info))}),this}joining(e){return this.on("presence:joining",n=>e(n.user_info)),this}whisper(e,n){return this.socket.emit("client event",{channel:this.name,event:`client-${e}`,data:n}),this}leaving(e){return this.on("presence:leaving",n=>e(n.user_info)),this}}class pc extends df{subscribe(){}unsubscribe(){}listen(e,n){return this}listenToAll(e){return this}stopListening(e,n){return this}subscribed(e){return this}error(e){return this}on(e,n){return this}}class oy extends pc{whisper(e,n){return this}}class V_ extends pc{whisper(e,n){return this}}class F_ extends oy{here(e){return this}joining(e){return this}whisper(e,n){return this}leaving(e){return this}}const Cc=class Cc{constructor(e){this.setOptions(e),this.connect()}setOptions(e){this.options={...Cc._defaultOptions,...e,broadcaster:e.broadcaster};let n=this.csrfToken();n&&(this.options.auth.headers["X-CSRF-TOKEN"]=n,this.options.userAuthentication.headers["X-CSRF-TOKEN"]=n),n=this.options.bearerToken,n&&(this.options.auth.headers.Authorization="Bearer "+n,this.options.userAuthentication.headers.Authorization="Bearer "+n)}csrfToken(){return typeof window<"u"&&window.Laravel?.csrfToken?window.Laravel.csrfToken:this.options.csrfToken?this.options.csrfToken:typeof document<"u"&&typeof document.querySelector=="function"?document.querySelector('meta[name="csrf-token"]')?.getAttribute("content")??null:null}};Cc._defaultOptions={auth:{headers:{}},authEndpoint:"/broadcasting/auth",userAuthentication:{endpoint:"/broadcasting/user-auth",headers:{}},csrfToken:null,bearerToken:null,host:null,key:null,namespace:"App.Events"};let Eo=Cc;class mc extends Eo{constructor(){super(...arguments),this.channels={}}connect(){if(typeof this.options.client<"u")this.pusher=this.options.client;else if(this.options.Pusher)this.pusher=new this.options.Pusher(this.options.key,this.options);else if(typeof window<"u"&&typeof window.Pusher<"u")this.pusher=new window.Pusher(this.options.key,this.options);else throw new Error("Pusher client not found. Should be globally available or passed via options.client")}signin(){this.pusher.signin()}listen(e,n,a){return this.channel(e).listen(n,a)}channel(e){return this.channels[e]||(this.channels[e]=new ff(this.pusher,e,this.options)),this.channels[e]}privateChannel(e){return this.channels["private-"+e]||(this.channels["private-"+e]=new ay(this.pusher,"private-"+e,this.options)),this.channels["private-"+e]}encryptedPrivateChannel(e){return this.channels["private-encrypted-"+e]||(this.channels["private-encrypted-"+e]=new P_(this.pusher,"private-encrypted-"+e,this.options)),this.channels["private-encrypted-"+e]}presenceChannel(e){return this.channels["presence-"+e]||(this.channels["presence-"+e]=new q_(this.pusher,"presence-"+e,this.options)),this.channels["presence-"+e]}leave(e){[e,"private-"+e,"private-encrypted-"+e,"presence-"+e].forEach(n=>{this.leaveChannel(n)})}leaveChannel(e){this.channels[e]&&(this.channels[e].unsubscribe(),delete this.channels[e])}socketId(){return this.pusher.connection.socket_id}connectionStatus(){const e=this.pusher.connection.state;switch(e){case"connected":case"connecting":return e;case"failed":case"unavailable":return"failed";default:return"disconnected"}}onConnectionChange(e){const n=()=>{e(this.connectionStatus())},a=["state_change","connected","disconnected"];return a.forEach(i=>{this.pusher.connection.bind(i,n)}),()=>{a.forEach(i=>{this.pusher.connection.unbind(i,n)})}}disconnect(){this.pusher.disconnect()}}class K_ extends Eo{constructor(){super(...arguments),this.channels={}}connect(){const e=this.getSocketIO();this.socket=e(this.options.host??void 0,this.options),this.socket.io.on("reconnect",()=>{Object.values(this.channels).forEach(n=>{n.subscribe()})})}getSocketIO(){if(typeof this.options.client<"u")return this.options.client;if(typeof window<"u"&&typeof window.io<"u")return window.io;throw new Error("Socket.io client not found. Should be globally available or passed via options.client")}listen(e,n,a){return this.channel(e).listen(n,a)}channel(e){return this.channels[e]||(this.channels[e]=new iy(this.socket,e,this.options)),this.channels[e]}privateChannel(e){return this.channels["private-"+e]||(this.channels["private-"+e]=new sy(this.socket,"private-"+e,this.options)),this.channels["private-"+e]}presenceChannel(e){return this.channels["presence-"+e]||(this.channels["presence-"+e]=new G_(this.socket,"presence-"+e,this.options)),this.channels["presence-"+e]}leave(e){[e,"private-"+e,"presence-"+e].forEach(n=>{this.leaveChannel(n)})}leaveChannel(e){this.channels[e]&&(this.channels[e].unsubscribe(),delete this.channels[e])}socketId(){return this.socket.id}connectionStatus(){return this.socket.connected?"connected":this.socket.io._reconnecting?"reconnecting":this.socket.id!==void 0?"disconnected":"connecting"}onConnectionChange(e){const n=()=>{e(this.connectionStatus())},a=["connect","disconnect","connect_error","reconnect_attempt","reconnect","reconnect_error","reconnect_failed"];return a.forEach(i=>{this.socket.on(i,n)}),()=>{a.forEach(i=>{this.socket.off(i,n)})}}disconnect(){this.socket.disconnect()}}class ly extends Eo{constructor(){super(...arguments),this.channels={}}connect(){}listen(e,n,a){return new pc}channel(e){return new pc}privateChannel(e){return new oy}encryptedPrivateChannel(e){return new V_}presenceChannel(e){return new F_}leave(e){}leaveChannel(e){}socketId(){return"fake-socket-id"}connectionStatus(){return"connected"}onConnectionChange(e){return()=>{}}disconnect(){}}class W_{constructor(e){this.options=e,this.connect(),this.options.withoutInterceptors||this.registerInterceptors()}channel(e){return this.connector.channel(e)}connect(){if(this.options.broadcaster==="reverb")this.connector=new mc({...this.options,cluster:""});else if(this.options.broadcaster==="pusher")this.connector=new mc(this.options);else if(this.options.broadcaster==="ably")this.connector=new mc({...this.options,cluster:"",broadcaster:"pusher"});else if(this.options.broadcaster==="socket.io")this.connector=new K_(this.options);else if(this.options.broadcaster==="null")this.connector=new ly(this.options);else if(typeof this.options.broadcaster=="function"&&B_(this.options.broadcaster))this.connector=new this.options.broadcaster(this.options);else throw new Error(`Broadcaster ${typeof this.options.broadcaster} ${String(this.options.broadcaster)} is not supported.`)}disconnect(){this.connector.disconnect()}join(e){return this.connector.presenceChannel(e)}leave(e){this.connector.leave(e)}leaveChannel(e){this.connector.leaveChannel(e)}leaveAllChannels(){for(const e in this.connector.channels)this.leaveChannel(e)}listen(e,n,a){return this.connector.listen(e,n,a)}private(e){return this.connector.privateChannel(e)}encryptedPrivate(e){if(this.connectorSupportsEncryptedPrivateChannels(this.connector))return this.connector.encryptedPrivateChannel(e);throw new Error(`Broadcaster ${typeof this.options.broadcaster} ${String(this.options.broadcaster)} does not support encrypted private channels.`)}connectorSupportsEncryptedPrivateChannels(e){return e instanceof mc||e instanceof ly}socketId(){return this.connector.socketId()}connectionStatus(){return this.connector.connectionStatus()}registerInterceptors(){typeof Vue<"u"&&Vue?.http&&this.registerVueRequestInterceptor(),typeof axios=="function"&&this.registerAxiosRequestInterceptor(),typeof jQuery=="function"&&this.registerjQueryAjaxSetup(),typeof Turbo=="object"&&this.registerTurboRequestInterceptor()}registerVueRequestInterceptor(){Vue.http.interceptors.push((e,n)=>{this.socketId()&&e.headers.set("X-Socket-ID",this.socketId()),n()})}registerAxiosRequestInterceptor(){axios.interceptors.request.use(e=>(this.socketId()&&(e.headers["X-Socket-Id"]=this.socketId()),e))}registerjQueryAjaxSetup(){typeof jQuery.ajax<"u"&&jQuery.ajaxPrefilter((e,n,a)=>{this.socketId()&&a.setRequestHeader("X-Socket-Id",this.socketId())})}registerTurboRequestInterceptor(){document.addEventListener("turbo:before-fetch-request",e=>{e.detail.fetchOptions.headers["X-Socket-Id"]=this.socketId()})}}var hf={exports:{}};var cy;function Y_(){return cy||(cy=1,(function(o,e){(function(a,i){o.exports=i()})(self,()=>(()=>{var n={594(u,d){var f=this&&this.__extends||(function(){var M=function(x,D){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(U,z){U.__proto__=z}||function(U,z){for(var q in z)z.hasOwnProperty(q)&&(U[q]=z[q])},M(x,D)};return function(x,D){M(x,D);function U(){this.constructor=x}x.prototype=D===null?Object.create(D):(U.prototype=D.prototype,new U)}})();Object.defineProperty(d,"__esModule",{value:!0});var g=256,m=(function(){function M(x){x===void 0&&(x="="),this._paddingCharacter=x}return M.prototype.encodedLength=function(x){return this._paddingCharacter?(x+2)/3*4|0:(x*8+5)/6|0},M.prototype.encode=function(x){for(var D="",U=0;U<x.length-2;U+=3){var z=x[U]<<16|x[U+1]<<8|x[U+2];D+=this._encodeByte(z>>>18&63),D+=this._encodeByte(z>>>12&63),D+=this._encodeByte(z>>>6&63),D+=this._encodeByte(z>>>0&63)}var q=x.length-U;if(q>0){var z=x[U]<<16|(q===2?x[U+1]<<8:0);D+=this._encodeByte(z>>>18&63),D+=this._encodeByte(z>>>12&63),q===2?D+=this._encodeByte(z>>>6&63):D+=this._paddingCharacter||"",D+=this._paddingCharacter||""}return D},M.prototype.maxDecodedLength=function(x){return this._paddingCharacter?x/4*3|0:(x*6+7)/8|0},M.prototype.decodedLength=function(x){return this.maxDecodedLength(x.length-this._getPaddingLength(x))},M.prototype.decode=function(x){if(x.length===0)return new Uint8Array(0);for(var D=this._getPaddingLength(x),U=x.length-D,z=new Uint8Array(this.maxDecodedLength(U)),q=0,X=0,pe=0,Ce=0,ve=0,Le=0,Ve=0;X<U-4;X+=4)Ce=this._decodeChar(x.charCodeAt(X+0)),ve=this._decodeChar(x.charCodeAt(X+1)),Le=this._decodeChar(x.charCodeAt(X+2)),Ve=this._decodeChar(x.charCodeAt(X+3)),z[q++]=Ce<<2|ve>>>4,z[q++]=ve<<4|Le>>>2,z[q++]=Le<<6|Ve,pe|=Ce&g,pe|=ve&g,pe|=Le&g,pe|=Ve&g;if(X<U-1&&(Ce=this._decodeChar(x.charCodeAt(X)),ve=this._decodeChar(x.charCodeAt(X+1)),z[q++]=Ce<<2|ve>>>4,pe|=Ce&g,pe|=ve&g),X<U-2&&(Le=this._decodeChar(x.charCodeAt(X+2)),z[q++]=ve<<4|Le>>>2,pe|=Le&g),X<U-3&&(Ve=this._decodeChar(x.charCodeAt(X+3)),z[q++]=Le<<6|Ve,pe|=Ve&g),pe!==0)throw new Error("Base64Coder: incorrect characters for decoding");return z},M.prototype._encodeByte=function(x){var D=x;return D+=65,D+=25-x>>>8&6,D+=51-x>>>8&-75,D+=61-x>>>8&-15,D+=62-x>>>8&3,String.fromCharCode(D)},M.prototype._decodeChar=function(x){var D=g;return D+=(42-x&x-44)>>>8&-g+x-43+62,D+=(46-x&x-48)>>>8&-g+x-47+63,D+=(47-x&x-58)>>>8&-g+x-48+52,D+=(64-x&x-91)>>>8&-g+x-65+0,D+=(96-x&x-123)>>>8&-g+x-97+26,D},M.prototype._getPaddingLength=function(x){var D=0;if(this._paddingCharacter){for(var U=x.length-1;U>=0&&x[U]===this._paddingCharacter;U--)D++;if(x.length<4||D>2)throw new Error("Base64Coder: incorrect padding")}return D},M})();d.Coder=m;var b=new m;function v(M){return b.encode(M)}d.encode=v;function S(M){return b.decode(M)}d.decode=S;var _=(function(M){f(x,M);function x(){return M!==null&&M.apply(this,arguments)||this}return x.prototype._encodeByte=function(D){var U=D;return U+=65,U+=25-D>>>8&6,U+=51-D>>>8&-75,U+=61-D>>>8&-13,U+=62-D>>>8&49,String.fromCharCode(U)},x.prototype._decodeChar=function(D){var U=g;return U+=(44-D&D-46)>>>8&-g+D-45+62,U+=(94-D&D-96)>>>8&-g+D-95+63,U+=(47-D&D-58)>>>8&-g+D-48+52,U+=(64-D&D-91)>>>8&-g+D-65+0,U+=(96-D&D-123)>>>8&-g+D-97+26,U},x})(m);d.URLSafeCoder=_;var A=new _;function k(M){return A.encode(M)}d.encodeURLSafe=k;function O(M){return A.decode(M)}d.decodeURLSafe=O,d.encodedLength=function(M){return b.encodedLength(M)},d.maxDecodedLength=function(M){return b.maxDecodedLength(M)},d.decodedLength=function(M){return b.decodedLength(M)}},978(u,d){var f="utf8: invalid source encoding";function g(m){for(var b=[],v=0;v<m.length;v++){var S=m[v];if(S&128){var _=void 0;if(S<224){if(v>=m.length)throw new Error(f);var A=m[++v];if((A&192)!==128)throw new Error(f);S=(S&31)<<6|A&63,_=128}else if(S<240){if(v>=m.length-1)throw new Error(f);var A=m[++v],k=m[++v];if((A&192)!==128||(k&192)!==128)throw new Error(f);S=(S&15)<<12|(A&63)<<6|k&63,_=2048}else if(S<248){if(v>=m.length-2)throw new Error(f);var A=m[++v],k=m[++v],O=m[++v];if((A&192)!==128||(k&192)!==128||(O&192)!==128)throw new Error(f);S=(S&15)<<18|(A&63)<<12|(k&63)<<6|O&63,_=65536}else throw new Error(f);if(S<_||S>=55296&&S<=57343)throw new Error(f);if(S>=65536){if(S>1114111)throw new Error(f);S-=65536,b.push(String.fromCharCode(55296|S>>10)),S=56320|S&1023}}b.push(String.fromCharCode(S))}return b.join("")}d.D4=g},721(u,d,f){u.exports=f(207).default},207(u,d,f){f.d(d,{default:()=>Ss});class g{constructor(y,w){this.lastId=0,this.prefix=y,this.name=w}create(y){this.lastId++;var w=this.lastId,L=this.prefix+w,I=this.name+"["+w+"]",re=!1,me=function(){re||(y.apply(null,arguments),re=!0)};return this[w]=me,{number:w,id:L,name:I,callback:me}}remove(y){delete this[y.number]}}var m=new g("_pusher_script_","Pusher.ScriptReceivers"),b={VERSION:"8.6.0",PROTOCOL:7,wsPort:80,wssPort:443,wsPath:"",httpHost:"sockjs.pusher.com",httpPort:80,httpsPort:443,httpPath:"/pusher",stats_host:"stats.pusher.com",authEndpoint:"/pusher/auth",authTransport:"ajax",activityTimeout:12e4,pongTimeout:3e4,unavailableTimeout:1e4,userAuthentication:{endpoint:"/pusher/user-auth",transport:"ajax"},channelAuthorization:{endpoint:"/pusher/auth",transport:"ajax"},cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""};const v=b;class S{constructor(y){this.options=y,this.receivers=y.receivers||m,this.loading={}}load(y,w,L){var I=this;if(I.loading[y]&&I.loading[y].length>0)I.loading[y].push(L);else{I.loading[y]=[L];var re=Be.createScriptRequest(I.getPath(y,w)),me=I.receivers.create(function($e){if(I.receivers.remove(me),I.loading[y]){var We=I.loading[y];delete I.loading[y];for(var ct=function(zt){zt||re.cleanup()},pt=0;pt<We.length;pt++)We[pt]($e,ct)}});re.send(me)}}getRoot(y){var w,L=Be.getDocument().location.protocol;return y&&y.useTLS||L==="https:"?w=this.options.cdn_https:w=this.options.cdn_http,w.replace(/\/*$/,"")+"/"+this.options.version}getPath(y,w){return this.getRoot(w)+"/"+y+this.options.suffix+".js"}}var _=new g("_pusher_dependencies","Pusher.DependenciesReceivers"),A=new S({cdn_http:v.cdn_http,cdn_https:v.cdn_https,version:v.VERSION,suffix:v.dependency_suffix,receivers:_});const k={baseUrl:"https://pusher.com",urls:{authenticationEndpoint:{path:"/docs/channels/server_api/authenticating_users"},authorizationEndpoint:{path:"/docs/channels/server_api/authorizing-users/"},javascriptQuickStart:{path:"/docs/javascript_quick_start"},triggeringClientEvents:{path:"/docs/client_api_guide/client_events#trigger-events"},encryptedChannelSupport:{fullUrl:"https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"}}},M={buildLogSuffix:function(E){const y="See:",w=k.urls[E];if(!w)return"";let L;return w.fullUrl?L=w.fullUrl:w.path&&(L=k.baseUrl+w.path),L?`${y} ${L}`:""}};var x;(function(E){E.UserAuthentication="user-authentication",E.ChannelAuthorization="channel-authorization"})(x||(x={}));class D extends Error{constructor(y){super(y),Object.setPrototypeOf(this,new.target.prototype)}}class U extends Error{constructor(y){super(y),Object.setPrototypeOf(this,new.target.prototype)}}class z extends Error{constructor(y){super(y),Object.setPrototypeOf(this,new.target.prototype)}}class q extends Error{constructor(y){super(y),Object.setPrototypeOf(this,new.target.prototype)}}class X extends Error{constructor(y){super(y),Object.setPrototypeOf(this,new.target.prototype)}}class pe extends Error{constructor(y){super(y),Object.setPrototypeOf(this,new.target.prototype)}}class Ce extends Error{constructor(y){super(y),Object.setPrototypeOf(this,new.target.prototype)}}class ve extends Error{constructor(y){super(y),Object.setPrototypeOf(this,new.target.prototype)}}class Le extends Error{constructor(y,w){super(w),this.status=y,Object.setPrototypeOf(this,new.target.prototype)}}const Fe=function(E,y,w,L,I){const re=Be.createXHR();re.open("POST",w.endpoint,!0),re.setRequestHeader("Content-Type","application/x-www-form-urlencoded");for(var me in w.headers)re.setRequestHeader(me,w.headers[me]);if(w.headersProvider!=null){let $e=w.headersProvider();for(var me in $e)re.setRequestHeader(me,$e[me])}return re.onreadystatechange=function(){if(re.readyState===4)if(re.status===200){let $e,We=!1;try{$e=JSON.parse(re.responseText),We=!0}catch{I(new Le(200,`JSON returned from ${L.toString()} endpoint was invalid, yet status code was 200. Data was: ${re.responseText}`),null)}We&&I(null,$e)}else{let $e="";switch(L){case x.UserAuthentication:$e=M.buildLogSuffix("authenticationEndpoint");break;case x.ChannelAuthorization:$e=`Clients must be authorized to join private or presence channels. ${M.buildLogSuffix("authorizationEndpoint")}`;break}I(new Le(re.status,`Unable to retrieve auth string from ${L.toString()} endpoint - received status: ${re.status} from ${w.endpoint}. ${$e}`),null)}},re.send(y),re};function Tt(E){return N(ee(E))}var J=String.fromCharCode,de="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ne=function(E){var y=E.charCodeAt(0);return y<128?E:y<2048?J(192|y>>>6)+J(128|y&63):J(224|y>>>12&15)+J(128|y>>>6&63)+J(128|y&63)},ee=function(E){return E.replace(/[^\x00-\x7F]/g,Ne)},ge=function(E){var y=[0,2,1][E.length%3],w=E.charCodeAt(0)<<16|(E.length>1?E.charCodeAt(1):0)<<8|(E.length>2?E.charCodeAt(2):0),L=[de.charAt(w>>>18),de.charAt(w>>>12&63),y>=2?"=":de.charAt(w>>>6&63),y>=1?"=":de.charAt(w&63)];return L.join("")},N=typeof window<"u"&&window.btoa||function(E){return E.replace(/[\s\S]{1,3}/g,ge)};class T{constructor(y,w,L,I){this.clear=w,this.timer=y(()=>{this.timer&&(this.timer=I(this.timer))},L)}isRunning(){return this.timer!==null}ensureAborted(){this.timer&&(this.clear(this.timer),this.timer=null)}}const fe=T;function he(E){window.clearTimeout(E)}function Ae(E){window.clearInterval(E)}class te extends fe{constructor(y,w){super(setTimeout,he,y,function(L){return w(),null})}}class we extends fe{constructor(y,w){super(setInterval,Ae,y,function(L){return w(),L})}}var qe={now(){return Date.now?Date.now():new Date().valueOf()},defer(E){return new te(0,E)},method(E,...y){var w=Array.prototype.slice.call(arguments,1);return function(L){return L[E].apply(L,w.concat(arguments))}}};const ke=qe;function ze(E,...y){for(var w=0;w<y.length;w++){var L=y[w];for(var I in L)I==="__proto__"||I==="constructor"||I==="prototype"||(L[I]&&L[I].constructor&&L[I].constructor===Object?E[I]=ze(E[I]||{},L[I]):E[I]=L[I])}return E}function Ct(){for(var E=["Pusher"],y=0;y<arguments.length;y++)typeof arguments[y]=="string"?E.push(arguments[y]):E.push(yn(arguments[y]));return E.join(" : ")}function it(E,y){var w=Array.prototype.indexOf;if(E===null)return-1;if(w&&E.indexOf===w)return E.indexOf(y);for(var L=0,I=E.length;L<I;L++)if(E[L]===y)return L;return-1}function Ot(E,y){for(var w in E)Object.prototype.hasOwnProperty.call(E,w)&&y(E[w],w,E)}function vt(E){var y=[];return Ot(E,function(w,L){y.push(L)}),y}function _t(E){var y=[];return Ot(E,function(w){y.push(w)}),y}function Me(E,y,w){for(var L=0;L<E.length;L++)y.call(w||window,E[L],L,E)}function tt(E,y){for(var w=[],L=0;L<E.length;L++)w.push(y(E[L],L,E,w));return w}function nn(E,y){var w={};return Ot(E,function(L,I){w[I]=y(L)}),w}function Mt(E,y){y=y||function(I){return!!I};for(var w=[],L=0;L<E.length;L++)y(E[L],L,E,w)&&w.push(E[L]);return w}function Pt(E,y){var w={};return Ot(E,function(L,I){(y&&y(L,I,E,w)||L)&&(w[I]=L)}),w}function rn(E){var y=[];return Ot(E,function(w,L){y.push([L,w])}),y}function an(E,y){for(var w=0;w<E.length;w++)if(y(E[w],w,E))return!0;return!1}function ea(E,y){for(var w=0;w<E.length;w++)if(!y(E[w],w,E))return!1;return!0}function qt(E){return nn(E,function(y){return y===null?"":(typeof y=="object"&&(y=yn(y)),encodeURIComponent(Tt(y.toString())))})}function bi(E){var y=Pt(E,function(L){return L!==void 0}),w=tt(rn(qt(y)),ke.method("join","=")).join("&");return w}function ta(E){var y=[],w=[];return(function L(I,re){var me,$e,We;switch(typeof I){case"object":if(!I)return null;for(me=0;me<y.length;me+=1)if(y[me]===I)return{$ref:w[me]};if(y.push(I),w.push(re),Object.prototype.toString.apply(I)==="[object Array]")for(We=[],me=0;me<I.length;me+=1)We[me]=L(I[me],re+"["+me+"]");else{We={};for($e in I)Object.prototype.hasOwnProperty.call(I,$e)&&(We[$e]=L(I[$e],re+"["+JSON.stringify($e)+"]"))}return We;case"number":case"string":case"boolean":return I}})(E,"$")}function yn(E){try{return JSON.stringify(E)}catch{return JSON.stringify(ta(E))}}class Ln{constructor(){this.globalLog=y=>{window.console&&window.console.log&&window.console.log(y)}}debug(...y){this.log(this.globalLog,y)}warn(...y){this.log(this.globalLogWarn,y)}error(...y){this.log(this.globalLogError,y)}globalLogWarn(y){window.console&&window.console.warn?window.console.warn(y):this.globalLog(y)}globalLogError(y){window.console&&window.console.error?window.console.error(y):this.globalLogWarn(y)}log(y,...w){var L=Ct.apply(this,arguments);Ss.log?Ss.log(L):Ss.logToConsole&&y.bind(this)(L)}}const nt=new Ln;var Hn=function(E,y,w,L,I){(w.headers!==void 0||w.headersProvider!=null)&&nt.warn(`To send headers with the ${L.toString()} request, you must use AJAX, rather than JSONP.`);var re=E.nextAuthCallbackID.toString();E.nextAuthCallbackID++;var me=E.getDocument(),$e=me.createElement("script");E.auth_callbacks[re]=function(pt){I(null,pt)};var We="Pusher.auth_callbacks['"+re+"']";$e.src=w.endpoint+"?callback="+encodeURIComponent(We)+"&"+y;var ct=me.getElementsByTagName("head")[0]||me.documentElement;ct.insertBefore($e,ct.firstChild)};const bn=Hn;class na{constructor(y){this.src=y}send(y){var w=this,L="Error loading "+w.src;w.script=document.createElement("script"),w.script.id=y.id,w.script.src=w.src,w.script.type="text/javascript",w.script.charset="UTF-8",w.script.addEventListener?(w.script.onerror=function(){y.callback(L)},w.script.onload=function(){y.callback(null)}):w.script.onreadystatechange=function(){(w.script.readyState==="loaded"||w.script.readyState==="complete")&&y.callback(null)},w.script.async===void 0&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(w.errorScript=document.createElement("script"),w.errorScript.id=y.id+"_error",w.errorScript.text=y.name+"('"+L+"');",w.script.async=w.errorScript.async=!1):w.script.async=!0;var I=document.getElementsByTagName("head")[0];I.insertBefore(w.script,I.firstChild),w.errorScript&&I.insertBefore(w.errorScript,w.script.nextSibling)}cleanup(){this.script&&(this.script.onload=this.script.onerror=null,this.script.onreadystatechange=null),this.script&&this.script.parentNode&&this.script.parentNode.removeChild(this.script),this.errorScript&&this.errorScript.parentNode&&this.errorScript.parentNode.removeChild(this.errorScript),this.script=null,this.errorScript=null}}class rr{constructor(y,w){this.url=y,this.data=w}send(y){if(!this.request){var w=bi(this.data),L=this.url+"/"+y.number+"?"+w;this.request=Be.createScriptRequest(L),this.request.send(y)}}cleanup(){this.request&&this.request.cleanup()}}var sn=function(E,y){return function(w,L){var I="http"+(y?"s":"")+"://",re=I+(E.host||E.options.host)+E.options.path,me=Be.createJSONPRequest(re,w),$e=Be.ScriptReceivers.create(function(We,ct){m.remove($e),me.cleanup(),ct&&ct.host&&(E.host=ct.host),L&&L(We,ct)});me.send($e)}},Tn={name:"jsonp",getAgent:sn};const on=Tn;function V(E,y,w){var L=E+(y.useTLS?"s":""),I=y.useTLS?y.hostTLS:y.hostNonTLS;return L+"://"+I+w}function se(E,y){var w="/app/"+E,L="?protocol="+v.PROTOCOL+"&client=js&version="+v.VERSION+(y?"&"+y:"");return w+L}var le={getInitial:function(E,y){var w=(y.httpPath||"")+se(E,"flash=false");return V("ws",y,w)}},Z={getInitial:function(E,y){var w=(y.httpPath||"/pusher")+se(E);return V("http",y,w)}},ye={getInitial:function(E,y){return V("http",y,y.httpPath||"/pusher")},getPath:function(E,y){return se(E)}};class ue{constructor(){this._callbacks={}}get(y){return this._callbacks[Ee(y)]}add(y,w,L){var I=Ee(y);this._callbacks[I]=this._callbacks[I]||[],this._callbacks[I].push({fn:w,context:L})}remove(y,w,L){if(!y&&!w&&!L){this._callbacks={};return}var I=y?[Ee(y)]:vt(this._callbacks);w||L?this.removeCallback(I,w,L):this.removeAllCallbacks(I)}removeCallback(y,w,L){Me(y,function(I){this._callbacks[I]=Mt(this._callbacks[I]||[],function(re){return w&&w!==re.fn||L&&L!==re.context}),this._callbacks[I].length===0&&delete this._callbacks[I]},this)}removeAllCallbacks(y){Me(y,function(w){delete this._callbacks[w]},this)}}function Ee(E){return"_"+E}class _e{constructor(y){this.callbacks=new ue,this.global_callbacks=[],this.failThrough=y}bind(y,w,L){return this.callbacks.add(y,w,L),this}bind_global(y){return this.global_callbacks.push(y),this}unbind(y,w,L){return this.callbacks.remove(y,w,L),this}unbind_global(y){return y?(this.global_callbacks=Mt(this.global_callbacks||[],w=>w!==y),this):(this.global_callbacks=[],this)}unbind_all(){return this.unbind(),this.unbind_global(),this}emit(y,w,L){for(var I=0;I<this.global_callbacks.length;I++)this.global_callbacks[I](y,w);var re=this.callbacks.get(y),me=[];if(L?me.push(w,L):w&&me.push(w),re&&re.length>0)for(var I=0;I<re.length;I++)re[I].fn.apply(re[I].context||window,me);else this.failThrough&&this.failThrough(y,w);return this}}class Ke extends _e{constructor(y,w,L,I,re){super(),this.initialize=Be.transportConnectionInitializer,this.hooks=y,this.name=w,this.priority=L,this.key=I,this.options=re,this.state="new",this.timeline=re.timeline,this.activityTimeout=re.activityTimeout,this.id=this.timeline.generateUniqueID()}handlesActivityChecks(){return!!this.hooks.handlesActivityChecks}supportsPing(){return!!this.hooks.supportsPing}connect(){if(this.socket||this.state!=="initialized")return!1;var y=this.hooks.urls.getInitial(this.key,this.options);try{this.socket=this.hooks.getSocket(y,this.options)}catch(w){return ke.defer(()=>{this.onError(w),this.changeState("closed")}),!1}return this.bindListeners(),nt.debug("Connecting",{transport:this.name,url:y}),this.changeState("connecting"),!0}close(){return this.socket?(this.socket.close(),!0):!1}send(y){return this.state==="open"?(ke.defer(()=>{this.socket&&this.socket.send(y)}),!0):!1}ping(){this.state==="open"&&this.supportsPing()&&this.socket.ping()}onOpen(){this.hooks.beforeOpen&&this.hooks.beforeOpen(this.socket,this.hooks.urls.getPath(this.key,this.options)),this.changeState("open"),this.socket.onopen=void 0}onError(y){this.emit("error",{type:"WebSocketError",error:y}),this.timeline.error(this.buildTimelineMessage({error:y.toString()}))}onClose(y){y?this.changeState("closed",{code:y.code,reason:y.reason,wasClean:y.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0}onMessage(y){this.emit("message",y)}onActivity(){this.emit("activity")}bindListeners(){this.socket.onopen=()=>{this.onOpen()},this.socket.onerror=y=>{this.onError(y)},this.socket.onclose=y=>{this.onClose(y)},this.socket.onmessage=y=>{this.onMessage(y)},this.supportsPing()&&(this.socket.onactivity=()=>{this.onActivity()})}unbindListeners(){this.socket&&(this.socket.onopen=void 0,this.socket.onerror=void 0,this.socket.onclose=void 0,this.socket.onmessage=void 0,this.supportsPing()&&(this.socket.onactivity=void 0))}changeState(y,w){this.state=y,this.timeline.info(this.buildTimelineMessage({state:y,params:w})),this.emit(y,w)}buildTimelineMessage(y){return ze({cid:this.id},y)}}class xe{constructor(y){this.hooks=y}isSupported(y){return this.hooks.isSupported(y)}createConnection(y,w,L,I){return new Ke(this.hooks,y,w,L,I)}}var Ie=new xe({urls:le,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!Be.getWebSocketAPI()},isSupported:function(){return!!Be.getWebSocketAPI()},getSocket:function(E){return Be.createWebSocket(E)}}),Re={urls:Z,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},et=ze({getSocket:function(E){return Be.HTTPFactory.createStreamingSocket(E)}},Re),je=ze({getSocket:function(E){return Be.HTTPFactory.createPollingSocket(E)}},Re),De={isSupported:function(){return Be.isXHRSupported()}},Te=new xe(ze({},et,De)),Ue=new xe(ze({},je,De)),gt={ws:Ie,xhr_streaming:Te,xhr_polling:Ue};const St=gt;var ln=new xe({file:"sockjs",urls:ye,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return window.SockJS!==void 0},getSocket:function(E,y){return new window.SockJS(E,null,{js_path:A.getPath("sockjs",{useTLS:y.useTLS}),ignore_null_origin:y.ignoreNullOrigin})},beforeOpen:function(E,y){E.send(JSON.stringify({path:y}))}}),cn={isSupported:function(E){var y=Be.isXDRSupported(E.useTLS);return y}},Rn=new xe(ze({},et,cn)),un=new xe(ze({},je,cn));St.xdr_streaming=Rn,St.xdr_polling=un,St.sockjs=ln;const kn=St;class Da extends _e{constructor(){super();var y=this;typeof window<"u"&&window.addEventListener!==void 0&&(window.addEventListener("online",function(){y.emit("online")},!1),window.addEventListener("offline",function(){y.emit("offline")},!1))}isOnline(){return window.navigator.onLine===void 0?!0:window.navigator.onLine}}var Lo=new Da;class Sf{constructor(y,w,L){this.manager=y,this.transport=w,this.minPingDelay=L.minPingDelay,this.maxPingDelay=L.maxPingDelay,this.pingDelay=void 0}createConnection(y,w,L,I){I=ze({},I,{activityTimeout:this.pingDelay});var re=this.transport.createConnection(y,w,L,I),me=null,$e=function(){re.unbind("open",$e),re.bind("closed",We),me=ke.now()},We=ct=>{if(re.unbind("closed",We),ct.code===1002||ct.code===1003)this.manager.reportDeath();else if(!ct.wasClean&&me){var pt=ke.now()-me;pt<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(pt/2,this.minPingDelay))}};return re.bind("open",$e),re}isSupported(y){return this.manager.isAlive()&&this.transport.isSupported(y)}}const _c={decodeMessage:function(E){try{var y=JSON.parse(E.data),w=y.data;if(typeof w=="string")try{w=JSON.parse(y.data)}catch{}var L={event:y.event,channel:y.channel,data:w};return y.user_id&&(L.user_id=y.user_id),L}catch(I){throw{type:"MessageParseError",error:I,data:E.data}}},encodeMessage:function(E){return JSON.stringify(E)},processHandshake:function(E){var y=_c.decodeMessage(E);if(y.event==="pusher:connection_established"){if(!y.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",id:y.data.socket_id,activityTimeout:y.data.activity_timeout*1e3}}else{if(y.event==="pusher:error")return{action:this.getCloseAction(y.data),error:this.getCloseError(y.data)};throw"Invalid handshake"}},getCloseAction:function(E){return E.code<4e3?E.code>=1002&&E.code<=1004?"backoff":null:E.code===4e3?"tls_only":E.code<4100?"refused":E.code<4200?"backoff":E.code<4300?"retry":"refused"},getCloseError:function(E){return E.code!==1e3&&E.code!==1001?{type:"PusherError",data:{code:E.code,message:E.reason||E.message}}:null}},Br=_c;class vi extends _e{constructor(y,w){super(),this.id=y,this.transport=w,this.activityTimeout=w.activityTimeout,this.bindListeners()}handlesActivityChecks(){return this.transport.handlesActivityChecks()}send(y){return this.transport.send(y)}send_event(y,w,L){var I={event:y,data:w};return L&&(I.channel=L),nt.debug("Event sent",I),this.send(Br.encodeMessage(I))}ping(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})}close(){this.transport.close()}bindListeners(){var y={message:L=>{var I;try{I=Br.decodeMessage(L)}catch(re){this.emit("error",{type:"MessageParseError",error:re,data:L.data})}if(I!==void 0){switch(nt.debug("Event recd",I),I.event){case"pusher:error":this.emit("error",{type:"PusherError",data:I.data});break;case"pusher:ping":this.emit("ping");break;case"pusher:pong":this.emit("pong");break}this.emit("message",I)}},activity:()=>{this.emit("activity")},error:L=>{this.emit("error",L)},closed:L=>{w(),L&&L.code&&this.handleCloseEvent(L),this.transport=null,this.emit("closed")}},w=()=>{Ot(y,(L,I)=>{this.transport.unbind(I,L)})};Ot(y,(L,I)=>{this.transport.bind(I,L)})}handleCloseEvent(y){var w=Br.getCloseAction(y),L=Br.getCloseError(y);L&&this.emit("error",L),w&&this.emit(w,{action:w,error:L})}}class Mo{constructor(y,w){this.transport=y,this.callback=w,this.bindListeners()}close(){this.unbindListeners(),this.transport.close()}bindListeners(){this.onMessage=y=>{this.unbindListeners();var w;try{w=Br.processHandshake(y)}catch(L){this.finish("error",{error:L}),this.transport.close();return}w.action==="connected"?this.finish("connected",{connection:new vi(w.id,this.transport),activityTimeout:w.activityTimeout}):(this.finish(w.action,{error:w.error}),this.transport.close())},this.onClosed=y=>{this.unbindListeners();var w=Br.getCloseAction(y)||"backoff",L=Br.getCloseError(y);this.finish(w,{error:L})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)}unbindListeners(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)}finish(y,w){this.callback(ze({transport:this.transport,action:y},w))}}class Oa{constructor(y,w){this.timeline=y,this.options=w||{}}send(y,w){this.timeline.isEmpty()||this.timeline.send(Be.TimelineTransport.getAgent(this,y),w)}}class Pr extends _e{constructor(y,w){super(function(L,I){nt.debug("No callbacks on "+y+" for "+L)}),this.name=y,this.pusher=w,this.subscribed=!1,this.subscriptionPending=!1,this.subscriptionCancelled=!1}authorize(y,w){return w(null,{auth:""})}trigger(y,w){if(y.indexOf("client-")!==0)throw new D("Event '"+y+"' does not start with 'client-'");if(!this.subscribed){var L=M.buildLogSuffix("triggeringClientEvents");nt.warn(`Client event triggered before channel 'subscription_succeeded' event . ${L}`)}return this.pusher.send_event(y,w,this.name)}disconnect(){this.subscribed=!1,this.subscriptionPending=!1}handleEvent(y){var w=y.event,L=y.data;if(w==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(y);else if(w==="pusher_internal:subscription_count")this.handleSubscriptionCountEvent(y);else if(w.indexOf("pusher_internal:")!==0){var I={};this.emit(w,L,I)}}handleSubscriptionSucceededEvent(y){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",y.data)}handleSubscriptionCountEvent(y){y.data.subscription_count&&(this.subscriptionCount=y.data.subscription_count),this.emit("pusher:subscription_count",y.data)}subscribe(){this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(y,w)=>{y?(this.subscriptionPending=!1,nt.error(y.toString()),this.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:y.message},y instanceof Le?{status:y.status}:{}))):this.pusher.send_event("pusher:subscribe",{auth:w.auth,channel_data:w.channel_data,channel:this.name})}))}unsubscribe(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})}cancelSubscription(){this.subscriptionCancelled=!0}reinstateSubscription(){this.subscriptionCancelled=!1}}class ra extends Pr{authorize(y,w){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:y},w)}}class La{constructor(){this.reset()}get(y){return Object.prototype.hasOwnProperty.call(this.members,y)?{id:y,info:this.members[y]}:null}each(y){Ot(this.members,(w,L)=>{y(this.get(L))})}setMyID(y){this.myID=y}onSubscription(y){this.members=y.presence.hash,this.count=y.presence.count,this.me=this.get(this.myID)}addMember(y){return this.get(y.user_id)===null&&this.count++,this.members[y.user_id]=y.user_info,this.get(y.user_id)}removeMember(y){var w=this.get(y.user_id);return w&&(delete this.members[y.user_id],this.count--),w}reset(){this.members={},this.count=0,this.myID=null,this.me=null}}var Xt=function(E,y,w,L){function I(re){return re instanceof w?re:new w(function(me){me(re)})}return new(w||(w=Promise))(function(re,me){function $e(pt){try{ct(L.next(pt))}catch(zt){me(zt)}}function We(pt){try{ct(L.throw(pt))}catch(zt){me(zt)}}function ct(pt){pt.done?re(pt.value):I(pt.value).then($e,We)}ct((L=L.apply(E,y||[])).next())})};class Ac extends ra{constructor(y,w){super(y,w),this.members=new La}authorize(y,w){super.authorize(y,(L,I)=>Xt(this,void 0,void 0,function*(){if(!L)if(I=I,I.channel_data!=null){var re=JSON.parse(I.channel_data);this.members.setMyID(re.user_id)}else if(yield this.pusher.user.signinDonePromise,this.pusher.user.user_data!=null)this.members.setMyID(this.pusher.user.user_data.id);else{let me=M.buildLogSuffix("authorizationEndpoint");nt.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${me}, or the user should be signed in.`),w("Invalid auth response");return}w(L,I)}))}handleEvent(y){var w=y.event;if(w.indexOf("pusher_internal:")===0)this.handleInternalEvent(y);else{var L=y.data,I={};y.user_id&&(I.user_id=y.user_id),this.emit(w,L,I)}}handleInternalEvent(y){var w=y.event,L=y.data;switch(w){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(y);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(y);break;case"pusher_internal:member_added":var I=this.members.addMember(L);this.emit("pusher:member_added",I);break;case"pusher_internal:member_removed":var re=this.members.removeMember(L);re&&this.emit("pusher:member_removed",re);break}}handleSubscriptionSucceededEvent(y){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(y.data),this.emit("pusher:subscription_succeeded",this.members))}disconnect(){this.members.reset(),super.disconnect()}}var xc=f(978),Ar=f(594);class Ma extends ra{constructor(y,w,L){super(y,w),this.key=null,this.nacl=L}authorize(y,w){super.authorize(y,(L,I)=>{if(L){w(L,I);return}let re=I.shared_secret;if(!re){w(new Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`),null);return}this.key=(0,Ar.decode)(re),delete I.shared_secret,w(null,I)})}trigger(y,w){throw new pe("Client events are not currently supported for encrypted channels")}handleEvent(y){var w=y.event,L=y.data;if(w.indexOf("pusher_internal:")===0||w.indexOf("pusher:")===0){super.handleEvent(y);return}this.handleEncryptedEvent(w,L)}handleEncryptedEvent(y,w){if(!this.key){nt.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!w.ciphertext||!w.nonce){nt.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+w);return}let L=(0,Ar.decode)(w.ciphertext);if(L.length<this.nacl.secretbox.overheadLength){nt.error(`Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${L.length}`);return}let I=(0,Ar.decode)(w.nonce);if(I.length<this.nacl.secretbox.nonceLength){nt.error(`Expected encrypted event nonce length to be ${this.nacl.secretbox.nonceLength}, got: ${I.length}`);return}let re=this.nacl.secretbox.open(L,I,this.key);if(re===null){nt.debug("Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint..."),this.authorize(this.pusher.connection.socket_id,(me,$e)=>{if(me){nt.error(`Failed to make a request to the authEndpoint: ${$e}. Unable to fetch new key, so dropping encrypted event`);return}if(re=this.nacl.secretbox.open(L,I,this.key),re===null){nt.error("Failed to decrypt event with new key. Dropping encrypted event");return}this.emit(y,this.getDataToEmit(re))});return}this.emit(y,this.getDataToEmit(re))}getDataToEmit(y){let w=(0,xc.D4)(y);try{return JSON.parse(w)}catch{return w}}}class wf extends _e{constructor(y,w){super(),this.state="initialized",this.connection=null,this.key=y,this.options=w,this.timeline=this.options.timeline,this.usingTLS=this.options.useTLS,this.errorCallbacks=this.buildErrorCallbacks(),this.connectionCallbacks=this.buildConnectionCallbacks(this.errorCallbacks),this.handshakeCallbacks=this.buildHandshakeCallbacks(this.errorCallbacks);var L=Be.getNetwork();L.bind("online",()=>{this.timeline.info({netinfo:"online"}),(this.state==="connecting"||this.state==="unavailable")&&this.retryIn(0)}),L.bind("offline",()=>{this.timeline.info({netinfo:"offline"}),this.connection&&this.sendActivityCheck()}),this.updateStrategy()}switchCluster(y){this.key=y,this.updateStrategy(),this.retryIn(0)}connect(){if(!(this.connection||this.runner)){if(!this.strategy.isSupported()){this.updateState("failed");return}this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()}}send(y){return this.connection?this.connection.send(y):!1}send_event(y,w,L){return this.connection?this.connection.send_event(y,w,L):!1}disconnect(){this.disconnectInternally(),this.updateState("disconnected")}isUsingTLS(){return this.usingTLS}startConnecting(){var y=(w,L)=>{w?this.runner=this.strategy.connect(0,y):L.action==="error"?(this.emit("error",{type:"HandshakeError",error:L.error}),this.timeline.error({handshakeError:L.error})):(this.abortConnecting(),this.handshakeCallbacks[L.action](L))};this.runner=this.strategy.connect(0,y)}abortConnecting(){this.runner&&(this.runner.abort(),this.runner=null)}disconnectInternally(){if(this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection){var y=this.abandonConnection();y.close()}}updateStrategy(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})}retryIn(y){this.timeline.info({action:"retry",delay:y}),y>0&&this.emit("connecting_in",Math.round(y/1e3)),this.retryTimer=new te(y||0,()=>{this.disconnectInternally(),this.connect()})}clearRetryTimer(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)}setUnavailableTimer(){this.unavailableTimer=new te(this.options.unavailableTimeout,()=>{this.updateState("unavailable")})}clearUnavailableTimer(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()}sendActivityCheck(){this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new te(this.options.pongTimeout,()=>{this.timeline.error({pong_timed_out:this.options.pongTimeout}),this.retryIn(0)})}resetActivityCheck(){this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new te(this.activityTimeout,()=>{this.sendActivityCheck()}))}stopActivityCheck(){this.activityTimer&&this.activityTimer.ensureAborted()}buildConnectionCallbacks(y){return ze({},y,{message:w=>{this.resetActivityCheck(),this.emit("message",w)},ping:()=>{this.send_event("pusher:pong",{})},activity:()=>{this.resetActivityCheck()},error:w=>{this.emit("error",w)},closed:()=>{this.abandonConnection(),this.shouldRetry()&&this.retryIn(1e3)}})}buildHandshakeCallbacks(y){return ze({},y,{connected:w=>{this.activityTimeout=Math.min(this.options.activityTimeout,w.activityTimeout,w.connection.activityTimeout||1/0),this.clearUnavailableTimer(),this.setConnection(w.connection),this.socket_id=this.connection.id,this.updateState("connected",{socket_id:this.socket_id})}})}buildErrorCallbacks(){let y=w=>L=>{L.error&&this.emit("error",{type:"WebSocketError",error:L.error}),w(L)};return{tls_only:y(()=>{this.usingTLS=!0,this.updateStrategy(),this.retryIn(0)}),refused:y(()=>{this.disconnect()}),backoff:y(()=>{this.retryIn(1e3)}),retry:y(()=>{this.retryIn(0)})}}setConnection(y){this.connection=y;for(var w in this.connectionCallbacks)this.connection.bind(w,this.connectionCallbacks[w]);this.resetActivityCheck()}abandonConnection(){if(this.connection){this.stopActivityCheck();for(var y in this.connectionCallbacks)this.connection.unbind(y,this.connectionCallbacks[y]);var w=this.connection;return this.connection=null,w}}updateState(y,w){var L=this.state;if(this.state=y,L!==y){var I=y;I==="connected"&&(I+=" with new socket ID "+w.socket_id),nt.debug("State changed",L+" -> "+I),this.timeline.info({state:y,params:w}),this.emit("state_change",{previous:L,current:y}),this.emit(y,w)}}shouldRetry(){return this.state==="connecting"||this.state==="connected"}}class Tc{constructor(){this.channels={}}add(y,w){return this.channels[y]||(this.channels[y]=Rc(y,w)),this.channels[y]}all(){return _t(this.channels)}find(y){return this.channels[y]}remove(y){var w=this.channels[y];return delete this.channels[y],w}disconnect(){Ot(this.channels,function(y){y.disconnect()})}}function Rc(E,y){if(E.indexOf("private-encrypted-")===0){if(y.config.nacl)return zn.createEncryptedChannel(E,y,y.config.nacl);let w="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",L=M.buildLogSuffix("encryptedChannelSupport");throw new pe(`${w}. ${L}`)}else{if(E.indexOf("private-")===0)return zn.createPrivateChannel(E,y);if(E.indexOf("presence-")===0)return zn.createPresenceChannel(E,y);if(E.indexOf("#")===0)throw new U('Cannot create a channel with name "'+E+'".');return zn.createChannel(E,y)}}var Cf={createChannels(){return new Tc},createConnectionManager(E,y){return new wf(E,y)},createChannel(E,y){return new Pr(E,y)},createPrivateChannel(E,y){return new ra(E,y)},createPresenceChannel(E,y){return new Ac(E,y)},createEncryptedChannel(E,y,w){return new Ma(E,y,w)},createTimelineSender(E,y){return new Oa(E,y)},createHandshake(E,y){return new Mo(E,y)},createAssistantToTheTransportManager(E,y,w){return new Sf(E,y,w)}};const zn=Cf;class Si{constructor(y){this.options=y||{},this.livesLeft=this.options.lives||1/0}getAssistant(y){return zn.createAssistantToTheTransportManager(this,y,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}isAlive(){return this.livesLeft>0}reportDeath(){this.livesLeft-=1}}class vn{constructor(y,w){this.strategies=y,this.loop=!!w.loop,this.failFast=!!w.failFast,this.timeout=w.timeout,this.timeoutLimit=w.timeoutLimit}isSupported(){return an(this.strategies,ke.method("isSupported"))}connect(y,w){var L=this.strategies,I=0,re=this.timeout,me=null,$e=(We,ct)=>{ct?w(null,ct):(I=I+1,this.loop&&(I=I%L.length),I<L.length?(re&&(re=re*2,this.timeoutLimit&&(re=Math.min(re,this.timeoutLimit))),me=this.tryStrategy(L[I],y,{timeout:re,failFast:this.failFast},$e)):w(!0))};return me=this.tryStrategy(L[I],y,{timeout:re,failFast:this.failFast},$e),{abort:function(){me.abort()},forceMinPriority:function(We){y=We,me&&me.forceMinPriority(We)}}}tryStrategy(y,w,L,I){var re=null,me=null;return L.timeout>0&&(re=new te(L.timeout,function(){me.abort(),I(!0)})),me=y.connect(w,function($e,We){$e&&re&&re.isRunning()&&!L.failFast||(re&&re.ensureAborted(),I($e,We))}),{abort:function(){re&&re.ensureAborted(),me.abort()},forceMinPriority:function($e){me.forceMinPriority($e)}}}}class Dn{constructor(y){this.strategies=y}isSupported(){return an(this.strategies,ke.method("isSupported"))}connect(y,w){return kc(this.strategies,y,function(L,I){return function(re,me){if(I[L].error=re,re){Ef(I)&&w(!0);return}Me(I,function($e){$e.forceMinPriority(me.transport.priority)}),w(null,me)}})}}function kc(E,y,w){var L=tt(E,function(I,re,me,$e){return I.connect(y,w(re,$e))});return{abort:function(){Me(L,$o)},forceMinPriority:function(I){Me(L,function(re){re.forceMinPriority(I)})}}}function Ef(E){return ea(E,function(y){return!!y.error})}function $o(E){!E.error&&!E.aborted&&(E.abort(),E.aborted=!0)}class Dc{constructor(y,w,L){this.strategy=y,this.transports=w,this.ttl=L.ttl||18e5,this.usingTLS=L.useTLS,this.timeline=L.timeline}isSupported(){return this.strategy.isSupported()}connect(y,w){var L=this.usingTLS,I=_f(L),re=I&&I.cacheSkipCount?I.cacheSkipCount:0,me=[this.strategy];if(I&&I.timestamp+this.ttl>=ke.now()){var $e=this.transports[I.transport];$e&&(["ws","wss"].includes(I.transport)||re>3?(this.timeline.info({cached:!0,transport:I.transport,latency:I.latency}),me.push(new vn([$e],{timeout:I.latency*2+1e3,failFast:!0}))):re++)}var We=ke.now(),ct=me.pop().connect(y,function pt(zt,kr){zt?(ps(L),me.length>0?(We=ke.now(),ct=me.pop().connect(y,pt)):w(zt)):(jn(L,kr.transport.name,ke.now()-We,re),w(null,kr))});return{abort:function(){ct.abort()},forceMinPriority:function(pt){y=pt,ct&&ct.forceMinPriority(pt)}}}}function $a(E){return"pusherTransport"+(E?"TLS":"NonTLS")}function _f(E){var y=Be.getLocalStorage();if(y)try{var w=y[$a(E)];if(w)return JSON.parse(w)}catch{ps(E)}return null}function jn(E,y,w,L){var I=Be.getLocalStorage();if(I)try{I[$a(E)]=yn({timestamp:ke.now(),transport:y,latency:w,cacheSkipCount:L})}catch{}}function ps(E){var y=Be.getLocalStorage();if(y)try{delete y[$a(E)]}catch{}}class wi{constructor(y,{delay:w}){this.strategy=y,this.options={delay:w}}isSupported(){return this.strategy.isSupported()}connect(y,w){var L=this.strategy,I,re=new te(this.options.delay,function(){I=L.connect(y,w)});return{abort:function(){re.ensureAborted(),I&&I.abort()},forceMinPriority:function(me){y=me,I&&I.forceMinPriority(me)}}}}class aa{constructor(y,w,L){this.test=y,this.trueBranch=w,this.falseBranch=L}isSupported(){var y=this.test()?this.trueBranch:this.falseBranch;return y.isSupported()}connect(y,w){var L=this.test()?this.trueBranch:this.falseBranch;return L.connect(y,w)}}class Na{constructor(y){this.strategy=y}isSupported(){return this.strategy.isSupported()}connect(y,w){var L=this.strategy.connect(y,function(I,re){re&&L.abort(),w(I,re)});return L}}function Ia(E){return function(){return E.isSupported()}}var Oc=function(E,y,w){var L={};function I(Wo,Vc,Fc,Vf,Ff){var Kc=w(E,Wo,Vc,Fc,Vf,Ff);return L[Wo]=Kc,Kc}var re=Object.assign({},y,{hostNonTLS:E.wsHost+":"+E.wsPort,hostTLS:E.wsHost+":"+E.wssPort,httpPath:E.wsPath}),me=Object.assign({},re,{useTLS:!0}),$e=Object.assign({},y,{hostNonTLS:E.httpHost+":"+E.httpPort,hostTLS:E.httpHost+":"+E.httpsPort,httpPath:E.httpPath}),We={loop:!0,timeout:15e3,timeoutLimit:6e4},ct=new Si({minPingDelay:1e4,maxPingDelay:E.activityTimeout}),pt=new Si({lives:2,minPingDelay:1e4,maxPingDelay:E.activityTimeout}),zt=I("ws","ws",3,re,ct),kr=I("wss","ws",3,me,ct),Pf=I("sockjs","sockjs",1,$e),qc=I("xhr_streaming","xhr_streaming",1,$e,pt),qf=I("xdr_streaming","xdr_streaming",1,$e,pt),Vo=I("xhr_polling","xhr_polling",1,$e),Gc=I("xdr_polling","xdr_polling",1,$e),ja=new vn([zt],We),Ti=new vn([kr],We),Gf=new vn([Pf],We),Ri=new vn([new aa(Ia(qc),qc,qf)],We),Fo=new vn([new aa(Ia(Vo),Vo,Gc)],We),Ko=new vn([new aa(Ia(Ri),new Dn([Ri,new wi(Fo,{delay:4e3})]),Fo)],We),ki=new aa(Ia(Ko),Ko,Gf),Di;return y.useTLS?Di=new Dn([ja,new wi(ki,{delay:2e3})]):Di=new Dn([ja,new wi(Ti,{delay:2e3}),new wi(ki,{delay:5e3})]),new Dc(new Na(new aa(Ia(zt),Di,ki)),L,{ttl:18e5,timeline:y.timeline,useTLS:y.useTLS})};const Ha=Oc;function Af(){var E=this;E.timeline.info(E.buildTimelineMessage({transport:E.name+(E.options.useTLS?"s":"")})),E.hooks.isInitialized()?E.changeState("initialized"):E.hooks.file?(E.changeState("initializing"),A.load(E.hooks.file,{useTLS:E.options.useTLS},function(y,w){E.hooks.isInitialized()?(E.changeState("initialized"),w(!0)):(y&&E.onError(y),E.onClose(),w(!1))})):E.onClose()}var Lc={getRequest:function(E){var y=new window.XDomainRequest;return y.ontimeout=function(){E.emit("error",new z),E.close()},y.onerror=function(w){E.emit("error",w),E.close()},y.onprogress=function(){y.responseText&&y.responseText.length>0&&E.onChunk(200,y.responseText)},y.onload=function(){y.responseText&&y.responseText.length>0&&E.onChunk(200,y.responseText),E.emit("finished",200),E.close()},y},abortRequest:function(E){E.ontimeout=E.onerror=E.onprogress=E.onload=null,E.abort()}};const Mc=Lc,No=256*1024;class xf extends _e{constructor(y,w,L){super(),this.hooks=y,this.method=w,this.url=L}start(y){this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=()=>{this.close()},Be.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(y)}close(){this.unloader&&(Be.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)}onChunk(y,w){for(;;){var L=this.advanceBuffer(w);if(L)this.emit("chunk",{status:y,data:L});else break}this.isBufferTooLong(w)&&this.emit("buffer_too_long")}advanceBuffer(y){var w=y.slice(this.position),L=w.indexOf(`
`);return L!==-1?(this.position+=L+1,w.slice(0,L)):null}isBufferTooLong(y){return this.position===y.length&&y.length>No}}var Io;(function(E){E[E.CONNECTING=0]="CONNECTING",E[E.OPEN=1]="OPEN",E[E.CLOSED=3]="CLOSED"})(Io||(Io={}));const ar=Io;var xr=1;class Ho{constructor(y,w){this.hooks=y,this.session=ms(1e3)+"/"+Nc(8),this.location=zo(w),this.readyState=ar.CONNECTING,this.openStream()}send(y){return this.sendRaw(JSON.stringify([y]))}ping(){this.hooks.sendHeartbeat(this)}close(y,w){this.onClose(y,w,!0)}sendRaw(y){if(this.readyState===ar.OPEN)try{return Be.createSocketRequest("POST",ia(za(this.location,this.session))).start(y),!0}catch{return!1}else return!1}reconnect(){this.closeStream(),this.openStream()}onClose(y,w,L){this.closeStream(),this.readyState=ar.CLOSED,this.onclose&&this.onclose({code:y,reason:w,wasClean:L})}onChunk(y){if(y.status===200){this.readyState===ar.OPEN&&this.onActivity();var w,L=y.data.slice(0,1);switch(L){case"o":w=JSON.parse(y.data.slice(1)||"{}"),this.onOpen(w);break;case"a":w=JSON.parse(y.data.slice(1)||"[]");for(var I=0;I<w.length;I++)this.onEvent(w[I]);break;case"m":w=JSON.parse(y.data.slice(1)||"null"),this.onEvent(w);break;case"h":this.hooks.onHeartbeat(this);break;case"c":w=JSON.parse(y.data.slice(1)||"[]"),this.onClose(w[0],w[1],!0);break}}}onOpen(y){this.readyState===ar.CONNECTING?(y&&y.hostname&&(this.location.base=$c(this.location.base,y.hostname)),this.readyState=ar.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)}onEvent(y){this.readyState===ar.OPEN&&this.onmessage&&this.onmessage({data:y})}onActivity(){this.onactivity&&this.onactivity()}onError(y){this.onerror&&this.onerror(y)}openStream(){this.stream=Be.createSocketRequest("POST",ia(this.hooks.getReceiveURL(this.location,this.session))),this.stream.bind("chunk",y=>{this.onChunk(y)}),this.stream.bind("finished",y=>{this.hooks.onFinished(this,y)}),this.stream.bind("buffer_too_long",()=>{this.reconnect()});try{this.stream.start()}catch(y){ke.defer(()=>{this.onError(y),this.onClose(1006,"Could not start streaming",!1)})}}closeStream(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)}}function zo(E){var y=/([^\?]*)\/*(\??.*)/.exec(E);return{base:y[1],queryString:y[2]}}function za(E,y){return E.base+"/"+y+"/xhr_send"}function ia(E){var y=E.indexOf("?")===-1?"?":"&";return E+y+"t="+ +new Date+"&n="+xr++}function $c(E,y){var w=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(E);return w[1]+y+w[3]}function ms(E){return Be.randomInt(E)}function Nc(E){for(var y=[],w=0;w<E;w++)y.push(ms(32).toString(32));return y.join("")}const Ci=Ho;var Tr={getReceiveURL:function(E,y){return E.base+"/"+y+"/xhr_streaming"+E.queryString},onHeartbeat:function(E){E.sendRaw("[]")},sendHeartbeat:function(E){E.sendRaw("[]")},onFinished:function(E,y){E.onClose(1006,"Connection interrupted ("+y+")",!1)}};const jo=Tr;var Ei={getReceiveURL:function(E,y){return E.base+"/"+y+"/xhr"+E.queryString},onHeartbeat:function(){},sendHeartbeat:function(E){E.sendRaw("[]")},onFinished:function(E,y){y===200?E.reconnect():E.onClose(1006,"Connection interrupted ("+y+")",!1)}};const qr=Ei;var Uo={getRequest:function(E){var y=Be.getXHRAPI(),w=new y;return w.onreadystatechange=w.onprogress=function(){switch(w.readyState){case 3:w.responseText&&w.responseText.length>0&&E.onChunk(w.status,w.responseText);break;case 4:w.responseText&&w.responseText.length>0&&E.onChunk(w.status,w.responseText),E.emit("finished",w.status),E.close();break}},w},abortRequest:function(E){E.onreadystatechange=null,E.abort()}};const ys=Uo;var Ic={createStreamingSocket(E){return this.createSocket(jo,E)},createPollingSocket(E){return this.createSocket(qr,E)},createSocket(E,y){return new Ci(E,y)},createXHR(E,y){return this.createRequest(ys,E,y)},createRequest(E,y,w){return new xf(E,y,w)}};const _i=Ic;_i.createXDR=function(E,y){return this.createRequest(Mc,E,y)};var Hc={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:m,DependenciesReceivers:_,getDefaultStrategy:Ha,Transports:kn,transportConnectionInitializer:Af,HTTPFactory:_i,TimelineTransport:on,getXHRAPI(){return window.XMLHttpRequest},getWebSocketAPI(){return window.WebSocket||window.MozWebSocket},setup(E){if(typeof window<"u"){window.Pusher=E;var y=()=>{this.onDocumentBody(E.ready)};window.JSON?y():A.load("json2",{},y)}},getDocument(){return document},getProtocol(){return this.getDocument().location.protocol},getAuthorizers(){return{ajax:Fe,jsonp:bn}},onDocumentBody(E){document.body?E():setTimeout(()=>{this.onDocumentBody(E)},0)},createJSONPRequest(E,y){return new rr(E,y)},createScriptRequest(E){return new na(E)},getLocalStorage(){try{return window.localStorage}catch{return}},createXHR(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest(){var E=this.getXHRAPI();return new E},createMicrosoftXHR(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork(){return Lo},createWebSocket(E){var y=this.getWebSocketAPI();return new y(E)},createSocketRequest(E,y){if(this.isXHRSupported())return this.HTTPFactory.createXHR(E,y);if(this.isXDRSupported(y.indexOf("https:")===0))return this.HTTPFactory.createXDR(E,y);throw"Cross-origin HTTP requests are not supported"},isXHRSupported(){var E=this.getXHRAPI();return!!E&&new E().withCredentials!==void 0},isXDRSupported(E){var y=E?"https:":"http:",w=this.getProtocol();return!!window.XDomainRequest&&w===y},addUnloadListener(E){window.addEventListener!==void 0?window.addEventListener("pagehide",E,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",E)},removeUnloadListener(E){window.addEventListener!==void 0?window.removeEventListener("pagehide",E,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",E)},randomInt(E){const y=window.crypto||window.msCrypto,w=Math.floor(Math.pow(2,32)/E)*E;let L;do L=y.getRandomValues(new Uint32Array(1))[0];while(L>=w);return L%E}};const Be=Hc;var Rr;(function(E){E[E.ERROR=3]="ERROR",E[E.INFO=6]="INFO",E[E.DEBUG=7]="DEBUG"})(Rr||(Rr={}));const sa=Rr;class Ai{constructor(y,w,L){this.key=y,this.session=w,this.events=[],this.options=L||{},this.sent=0,this.uniqueID=0}log(y,w){y<=this.options.level&&(this.events.push(ze({},w,{timestamp:ke.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}error(y){this.log(sa.ERROR,y)}info(y){this.log(sa.INFO,y)}debug(y){this.log(sa.DEBUG,y)}isEmpty(){return this.events.length===0}send(y,w){var L=ze({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],y(L,(I,re)=>{I||this.sent++,w&&w(I,re)}),!0}generateUniqueID(){return this.uniqueID++,this.uniqueID}}class Tf{constructor(y,w,L,I){this.name=y,this.priority=w,this.transport=L,this.options=I||{}}isSupported(){return this.transport.isSupported({useTLS:this.options.useTLS})}connect(y,w){if(this.isSupported()){if(this.priority<y)return bs(new q,w)}else return bs(new ve,w);var L=!1,I=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),re=null,me=function(){I.unbind("initialized",me),I.connect()},$e=function(){re=zn.createHandshake(I,function(zt){L=!0,pt(),w(null,zt)})},We=function(zt){pt(),w(zt)},ct=function(){pt();var zt;zt=yn(I),w(new X(zt))},pt=function(){I.unbind("initialized",me),I.unbind("open",$e),I.unbind("error",We),I.unbind("closed",ct)};return I.bind("initialized",me),I.bind("open",$e),I.bind("error",We),I.bind("closed",ct),I.initialize(),{abort:()=>{L||(pt(),re?re.close():I.close())},forceMinPriority:zt=>{L||this.priority<zt&&(re?re.close():I.close())}}}}function bs(E,y){return ke.defer(function(){y(E)}),{abort:function(){},forceMinPriority:function(){}}}const{Transports:Po}=Be;var xi=function(E,y,w,L,I,re){var me=Po[w];if(!me)throw new Ce(w);var $e=(!E.enabledTransports||it(E.enabledTransports,y)!==-1)&&(!E.disabledTransports||it(E.disabledTransports,y)===-1),We;return $e?(I=Object.assign({ignoreNullOrigin:E.ignoreNullOrigin},I),We=new Tf(y,L,re?re.getAssistant(me):me,I)):We=vs,We},vs={isSupported:function(){return!1},connect:function(E,y){var w=ke.defer(function(){y(new ve)});return{abort:function(){w.ensureAborted()},forceMinPriority:function(){}}}};function zc(E){if(E==null)throw"You must pass an options object";if(E.cluster==null)throw"Options object must provide a cluster";"disableStats"in E&&nt.warn("The disableStats option is deprecated in favor of enableStats")}const Rf=(E,y)=>{var w="socket_id="+encodeURIComponent(E.socketId);for(var L in y.params)w+="&"+encodeURIComponent(L)+"="+encodeURIComponent(y.params[L]);if(y.paramsProvider!=null){let I=y.paramsProvider();for(var L in I)w+="&"+encodeURIComponent(L)+"="+encodeURIComponent(I[L])}return w},kf=E=>{if(typeof Be.getAuthorizers()[E.transport]>"u")throw`'${E.transport}' is not a recognized auth transport`;return(y,w)=>{const L=Rf(y,E);Be.getAuthorizers()[E.transport](Be,L,E,x.UserAuthentication,w)}},qo=(E,y)=>{var w="socket_id="+encodeURIComponent(E.socketId);w+="&channel_name="+encodeURIComponent(E.channelName);for(var L in y.params)w+="&"+encodeURIComponent(L)+"="+encodeURIComponent(y.params[L]);if(y.paramsProvider!=null){let I=y.paramsProvider();for(var L in I)w+="&"+encodeURIComponent(L)+"="+encodeURIComponent(I[L])}return w},Df=E=>{if(typeof Be.getAuthorizers()[E.transport]>"u")throw`'${E.transport}' is not a recognized auth transport`;return(y,w)=>{const L=qo(y,E);Be.getAuthorizers()[E.transport](Be,L,E,x.ChannelAuthorization,w)}},Of=(E,y,w)=>{const L={authTransport:y.transport,authEndpoint:y.endpoint,auth:{params:y.params,headers:y.headers}};return(I,re)=>{const me=E.channel(I.channelName);w(me,L).authorize(I.socketId,re)}};function jc(E,y){let w={activityTimeout:E.activityTimeout||v.activityTimeout,cluster:E.cluster,httpPath:E.httpPath||v.httpPath,httpPort:E.httpPort||v.httpPort,httpsPort:E.httpsPort||v.httpsPort,pongTimeout:E.pongTimeout||v.pongTimeout,statsHost:E.statsHost||v.stats_host,unavailableTimeout:E.unavailableTimeout||v.unavailableTimeout,wsPath:E.wsPath||v.wsPath,wsPort:E.wsPort||v.wsPort,wssPort:E.wssPort||v.wssPort,enableStats:Nf(E),httpHost:Lf(E),useTLS:$f(E),wsHost:Uc(E),userAuthenticator:Go(E),channelAuthorizer:Hf(E,y)};return"disabledTransports"in E&&(w.disabledTransports=E.disabledTransports),"enabledTransports"in E&&(w.enabledTransports=E.enabledTransports),"ignoreNullOrigin"in E&&(w.ignoreNullOrigin=E.ignoreNullOrigin),"timelineParams"in E&&(w.timelineParams=E.timelineParams),"nacl"in E&&(w.nacl=E.nacl),w}function Lf(E){return E.httpHost?E.httpHost:E.cluster?`sockjs-${E.cluster}.pusher.com`:v.httpHost}function Uc(E){return E.wsHost?E.wsHost:Mf(E.cluster)}function Mf(E){return`ws-${E}.pusher.com`}function $f(E){return Be.getProtocol()==="https:"?!0:E.forceTLS!==!1}function Nf(E){return"enableStats"in E?E.enableStats:"disableStats"in E?!E.disableStats:!1}const Bc=E=>"customHandler"in E&&E.customHandler!=null;function Go(E){const y=Object.assign(Object.assign({},v.userAuthentication),E.userAuthentication);return Bc(y)?y.customHandler:kf(y)}function If(E,y){let w;return"channelAuthorization"in E?w=Object.assign(Object.assign({},v.channelAuthorization),E.channelAuthorization):(w={transport:E.authTransport||v.authTransport,endpoint:E.authEndpoint||v.authEndpoint},"auth"in E&&("params"in E.auth&&(w.params=E.auth.params),"headers"in E.auth&&(w.headers=E.auth.headers)),"authorizer"in E&&(w.customHandler=Of(y,w,E.authorizer))),w}function Hf(E,y){const w=If(E,y);return Bc(w)?w.customHandler:Df(w)}class zf extends _e{constructor(y){super(function(w,L){nt.debug(`No callbacks on watchlist events for ${w}`)}),this.pusher=y,this.bindWatchlistInternalEvent()}handleEvent(y){y.data.events.forEach(w=>{this.emit(w.name,w)})}bindWatchlistInternalEvent(){this.pusher.connection.bind("message",y=>{var w=y.event;w==="pusher_internal:watchlist_events"&&this.handleEvent(y)})}}function Pc(){let E,y;return{promise:new Promise((L,I)=>{E=L,y=I}),resolve:E,reject:y}}const jf=Pc;class Uf extends _e{constructor(y){super(function(w,L){nt.debug("No callbacks on user for "+w)}),this.signin_requested=!1,this.user_data=null,this.serverToUserChannel=null,this.signinDonePromise=null,this._signinDoneResolve=null,this._onAuthorize=(w,L)=>{if(w){nt.warn(`Error during signin: ${w}`),this.emit("pusher:signin_error",Object.assign({},{type:"AuthError",error:w.message},w instanceof Le?{status:w.status}:{})),this._cleanup();return}this.pusher.send_event("pusher:signin",{auth:L.auth,user_data:L.user_data})},this.pusher=y,this.pusher.connection.bind("state_change",({previous:w,current:L})=>{w!=="connected"&&L==="connected"&&this._signin(),w==="connected"&&L!=="connected"&&(this._cleanup(),this._newSigninPromiseIfNeeded())}),this.watchlist=new zf(y),this.pusher.connection.bind("message",w=>{var L=w.event;L==="pusher:signin_success"&&this._onSigninSuccess(w.data),this.serverToUserChannel&&this.serverToUserChannel.name===w.channel&&this.serverToUserChannel.handleEvent(w)})}signin(){this.signin_requested||(this.signin_requested=!0,this._signin())}_signin(){this.signin_requested&&(this._newSigninPromiseIfNeeded(),this.pusher.connection.state==="connected"&&this.pusher.config.userAuthenticator({socketId:this.pusher.connection.socket_id},this._onAuthorize))}_onSigninSuccess(y){try{this.user_data=JSON.parse(y.user_data)}catch{nt.error(`Failed parsing user data after signin: ${y.user_data}`),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){nt.error(`user_data doesn't contain an id. user_data: ${this.user_data}`),this._cleanup();return}this._signinDoneResolve(),this._subscribeChannels()}_subscribeChannels(){const y=w=>{w.subscriptionPending&&w.subscriptionCancelled?w.reinstateSubscription():!w.subscriptionPending&&this.pusher.connection.state==="connected"&&w.subscribe()};this.serverToUserChannel=new Pr(`#server-to-user-${this.user_data.id}`,this.pusher),this.serverToUserChannel.bind_global((w,L)=>{w.indexOf("pusher_internal:")===0||w.indexOf("pusher:")===0||this.emit(w,L)}),y(this.serverToUserChannel)}_cleanup(){this.user_data=null,this.serverToUserChannel&&(this.serverToUserChannel.unbind_all(),this.serverToUserChannel.disconnect(),this.serverToUserChannel=null),this.signin_requested&&this._signinDoneResolve()}_newSigninPromiseIfNeeded(){if(!this.signin_requested||this.signinDonePromise&&!this.signinDonePromise.done)return;const{promise:y,resolve:w}=jf();y.done=!1;const L=()=>{y.done=!0};y.then(L).catch(L),this.signinDonePromise=y,this._signinDoneResolve=w}}class dn{static ready(){dn.isReady=!0;for(var y=0,w=dn.instances.length;y<w;y++)dn.instances[y].connect()}static getClientFeatures(){return vt(Pt({ws:Be.Transports.ws},function(y){return y.isSupported({})}))}constructor(y,w){Bf(y),zc(w),this.key=y,this.options=w,this.config=jc(this.options,this),this.channels=zn.createChannels(),this.global_emitter=new _e,this.sessionID=Be.randomInt(1e9),this.timeline=new Ai(this.key,this.sessionID,{cluster:this.config.cluster,features:dn.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:sa.INFO,version:v.VERSION}),this.config.enableStats&&(this.timelineSender=zn.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+Be.TimelineTransport.name}));var L=I=>Be.getDefaultStrategy(this.config,I,xi);this.connection=zn.createConnectionManager(this.key,{getStrategy:L,timeline:this.timeline,activityTimeout:this.config.activityTimeout,pongTimeout:this.config.pongTimeout,unavailableTimeout:this.config.unavailableTimeout,useTLS:!!this.config.useTLS}),this.connection.bind("connected",()=>{this.subscribeAll(),this.timelineSender&&this.timelineSender.send(this.connection.isUsingTLS())}),this.connection.bind("message",I=>{var re=I.event,me=re.indexOf("pusher_internal:")===0;if(I.channel){var $e=this.channel(I.channel);$e&&$e.handleEvent(I)}me||this.global_emitter.emit(I.event,I.data)}),this.connection.bind("connecting",()=>{this.channels.disconnect()}),this.connection.bind("disconnected",()=>{this.channels.disconnect()}),this.connection.bind("error",I=>{nt.warn(I)}),dn.instances.push(this),this.timeline.info({instances:dn.instances.length}),this.user=new Uf(this),dn.isReady&&this.connect()}switchCluster(y){const{appKey:w,cluster:L}=y;this.key=w,this.options=Object.assign(Object.assign({},this.options),{cluster:L}),this.config=jc(this.options,this),this.connection.switchCluster(this.key)}channel(y){return this.channels.find(y)}allChannels(){return this.channels.all()}connect(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var y=this.connection.isUsingTLS(),w=this.timelineSender;this.timelineSenderTimer=new we(6e4,function(){w.send(y)})}}disconnect(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)}bind(y,w,L){return this.global_emitter.bind(y,w,L),this}unbind(y,w,L){return this.global_emitter.unbind(y,w,L),this}bind_global(y){return this.global_emitter.bind_global(y),this}unbind_global(y){return this.global_emitter.unbind_global(y),this}unbind_all(y){return this.global_emitter.unbind_all(),this}subscribeAll(){var y;for(y in this.channels.channels)this.channels.channels.hasOwnProperty(y)&&this.subscribe(y)}subscribe(y){var w=this.channels.add(y,this);return w.subscriptionPending&&w.subscriptionCancelled?w.reinstateSubscription():!w.subscriptionPending&&this.connection.state==="connected"&&w.subscribe(),w}unsubscribe(y){var w=this.channels.find(y);w&&w.subscriptionPending?w.cancelSubscription():(w=this.channels.remove(y),w&&w.subscribed&&w.unsubscribe())}send_event(y,w,L){return this.connection.send_event(y,w,L)}shouldUseTLS(){return this.config.useTLS}signin(){this.user.signin()}}dn.instances=[],dn.isReady=!1,dn.logToConsole=!1,dn.Runtime=Be,dn.ScriptReceivers=Be.ScriptReceivers,dn.DependenciesReceivers=Be.DependenciesReceivers,dn.auth_callbacks=Be.auth_callbacks;const Ss=dn;function Bf(E){if(E==null)throw"You must pass your app key when you instantiate Pusher."}Be.setup(dn)}},a={};function i(u){var d=a[u];if(d!==void 0)return d.exports;var f=a[u]={exports:{}};return n[u].call(f.exports,f,f.exports,i),f.exports}i.d=(u,d)=>{for(var f in d)i.o(d,f)&&!i.o(u,f)&&Object.defineProperty(u,f,{enumerable:!0,get:d[f]})},i.o=(u,d)=>Object.prototype.hasOwnProperty.call(u,d);var l=i(721);return l})())})(hf)),hf.exports}var X_=Y_();const uy=Yr(X_),Ut=ft("WebSocketManager");class J_{constructor(){$(this,"echo",null);$(this,"subscriptions",new Map);$(this,"initialized",!1);$(this,"config",null)}configure(e){if(this.initialized){Ut.warn("[WebSocketManager] 이미 초기화되어 설정을 변경할 수 없습니다.");return}this.config=e,Ut.log("[WebSocketManager] 설정 완료:",{appKey:e.appKey?"***":"(없음)",host:e.host,port:e.port,scheme:e.scheme})}initialize(){if(this.initialized)return;if(!this.config||!this.config.appKey){Ut.warn("[WebSocketManager] WebSocket 설정이 없습니다. initTemplateApp에서 websocket 옵션을 전달해주세요.");return}const{appKey:e,host:n="localhost",port:a=80,scheme:i="https",authEndpoint:l="/api/broadcasting/auth"}=this.config,u=Number(a)||80,d=i==="https";Ut.log("[WebSocketManager] 연결 설정:",{host:n,port:u,scheme:i,useTLS:d,authEndpoint:l}),window.Pusher=uy;const f=localStorage.getItem("auth_token"),g={wsHost:n,wsPort:u,wssPort:u,forceTLS:d,disableStats:!0,enabledTransports:["ws","wss"],cluster:"mt1",authEndpoint:l,auth:{headers:{Authorization:f?`Bearer ${f}`:"",Accept:"application/json"}}};Ut.log("[WebSocketManager] Pusher 옵션:",g);const m=new uy(e,g);m.connection.bind("connecting",()=>{Ut.log("[WebSocketManager] 연결 시도 중...")}),m.connection.bind("connected",()=>{Ut.log("[WebSocketManager] 연결 성공! Socket ID:",m.connection.socket_id)}),m.connection.bind("failed",()=>{Ut.error("[WebSocketManager] 연결 실패 - WebSocket을 사용할 수 없습니다.")}),m.connection.bind("error",b=>{Ut.error("[WebSocketManager] 연결 오류:",b)}),m.connection.bind("state_change",b=>{Ut.log(`[WebSocketManager] 상태 변경: ${b.previous} → ${b.current}`)}),m.connection.bind("unavailable",()=>{Ut.error("[WebSocketManager] WebSocket 사용 불가 - 연결할 수 없습니다.")}),m.connection.bind("disconnected",()=>{Ut.warn("[WebSocketManager] 연결이 끊어졌습니다.")}),Ut.log("[WebSocketManager] 초기 연결 상태:",m.connection.state),this.echo=new W_({broadcaster:"reverb",client:m}),Ut.log("[WebSocketManager] 연결 시작 시도..."),m.connect(),window.Echo=this.echo,this.initialized=!0,Ut.log("[WebSocketManager] Echo 초기화 완료")}subscribe(e,n,a,i={}){if(this.initialize(),!this.echo)return Ut.warn("[WebSocketManager] Echo가 초기화되지 않았습니다."),"";const{channelType:l="private"}=i,u=`${e}:${n}`;if(this.subscriptions.has(u))return Ut.log(`[WebSocketManager] 이미 구독 중: ${u}`),u;let d;switch(l){case"public":d=this.echo.channel(e);break;case"presence":d=this.echo.join(e);break;default:d=this.echo.private(e)}return d.listen(`.${n}`,a),this.subscriptions.set(u,d),Ut.log(`[WebSocketManager] 구독 완료: ${u} (${l})`),u}unsubscribe(e){const n=this.subscriptions.get(e);if(!n)return;const a=e.lastIndexOf(":"),i=a>=0?e.substring(a+1):"";if(i)try{n.stopListening(`.${i}`)}catch(l){Ut.warn(`[WebSocketManager] stopListening 실패: ${e}`,l)}this.subscriptions.delete(e),Ut.log(`[WebSocketManager] 구독 해제: ${e}`)}leaveChannel(e){if(!this.echo)return;this.echo.leave(e);const n=[];this.subscriptions.forEach((a,i)=>{i.startsWith(`${e}:`)&&n.push(i)}),n.forEach(a=>this.subscriptions.delete(a)),Ut.log(`[WebSocketManager] 채널 구독 해제: ${e}`)}disconnect(){this.echo&&(this.echo.disconnect(),this.subscriptions.clear(),this.initialized=!1,Ut.log("[WebSocketManager] 연결 종료"))}getEcho(){return this.echo}isInitialized(){return this.initialized}isConfigured(){return this.config!==null&&!!this.config.appKey}getSubscriptionCount(){return this.subscriptions.size}}const yc=new J_,bt=ft("DataSourceManager"),Q_=new On;function bc(o,e){const n=o.match(/^\{\{(.+)\}\}$/);if(n){const a=n[1].trim();try{return Q_.evaluateExpression(a,e)}catch(i){return bt.error("Failed to evaluate param expression:",a,i),o}}return Zi(o,e,{skipCache:!0})}function dy(o){const e={};for(const n of o.keys()){if(n in e)continue;const a=o.getAll(n);a.length>1?e[n]=a:a.length===1&&(n.endsWith("[]")?e[n]=a:e[n]=a[0])}return e}function Z_(){try{return window.G7Core?.devTools}catch{return}}const Ec=class Ec{constructor(e={}){$(this,"options");$(this,"dataCache",new Map);$(this,"bindingEngine");$(this,"globalHeaders",[]);this.options=e,this.bindingEngine=new On}setGlobalHeaders(e){this.globalHeaders=e||[]}matchesPattern(e,n){if(n==="*")return!0;const a=n.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*");return new RegExp(`^${a}$`).test(e)}toFormData(e){const n=new FormData;for(const[a,i]of Object.entries(e))i instanceof File||i instanceof Blob?n.append(a,i):i!=null&&n.append(a,typeof i=="object"?JSON.stringify(i):String(i));return n}getMatchingGlobalHeaders(e,n){const a={};for(const i of this.globalHeaders)this.matchesPattern(e,i.pattern)&&Object.entries(i.headers).forEach(([l,u])=>{const d=bc(u,n);d!=null&&d!==""&&(a[l]=String(d))});return a}filterByCondition(e,n={}){const a=new Set,i=[];for(const l of e){if(a.has(l.id))continue;if(!l.if&&!l.conditions){a.add(l.id),i.push(l);continue}Qi({if:l.if,conditions:l.conditions},n,this.bindingEngine,`data_source:${l.id}`)&&(a.add(l.id),i.push(l))}return i}checkErrorCondition(e,n){if(!e.errorCondition?.if||e.errorCondition?.errorCode===void 0)return null;try{const a={response:n};if(Qi({if:e.errorCondition.if},a,this.bindingEngine,`errorCondition:${e.id}`))return bt.log(`errorCondition matched for ${e.id}, triggering error ${e.errorCondition.errorCode}`),e.errorCondition.errorCode}catch(a){bt.error(`Failed to evaluate errorCondition for ${e.id}:`,a)}return null}async fetchDataSources(e,n={},a=new URLSearchParams,i,l){const u={},d=!!this.options.sampleProvider,f=e.filter(g=>(d||g.auto_fetch!==!1)&&g.type!=="websocket");return await Promise.all(f.map(async g=>{try{const m=await this.fetchDataSource(g,n,a,i,l);u[g.id]=m,this.dataCache.set(g.id,{data:m,timestamp:Date.now()});const b=this.checkErrorCondition(g,m);if(b!==null){const v={status:b,message:`Error condition matched for ${g.id}`,data:m},S=yr(),_=S.resolve(b,{errorHandling:g.errorHandling,onError:g.onError});if(_.handler)try{await S.execute(_.handler,v)}catch(A){bt.error(`Error executing errorCondition handler for ${g.id}:`,A)}g.fallback!==void 0&&(u[g.id]=g.fallback,this.dataCache.set(g.id,{data:g.fallback,timestamp:Date.now()}),bt.log(`Using fallback data for ${g.id} (errorCondition)`));return}if(g.onSuccess)try{const v={data:m,sourceId:g.id};await this.executeOnSuccessHandler(g.onSuccess,v)}catch(v){bt.error(`Error executing onSuccess handler for ${g.id}:`,v)}}catch(m){bt.error(`Failed to fetch data source: ${g.id}`,m);const b=m?.response?.status||m?.status||500,v=m?.response?.data,S=v?.message||m.message||"Unknown error",_={status:b,message:S,errors:v?.errors,data:v,statusText:m?.response?.statusText},A=yr(),k=A.resolve(b,{errorHandling:g.errorHandling,onError:g.onError});if(k.handler)try{await A.execute(k.handler,_)}catch(O){bt.error(`Error executing error handler for ${g.id}:`,O)}g.fallback!==void 0&&(u[g.id]=g.fallback,this.dataCache.set(g.id,{data:g.fallback,timestamp:Date.now()}),bt.log(`Using fallback data for ${g.id}`)),this.options.onError&&this.options.onError(m,g)}})),u}async fetchDataSourcesWithResults(e,n={},a=new URLSearchParams,i,l,u){if(e.some(m=>m.type==="websocket")){const m=e.filter(b=>b.type==="websocket").map(b=>b.id).join(", ");bt.warn(`fetchDataSourcesWithResults received WebSocket sources (caller should filter them out before calling): ${m}. WebSocket sources are event listeners, not data providers — they should not be passed to fetch.`)}const f=u?.ignoreAutoFetch?e.filter(m=>m.type!=="websocket"):e.filter(m=>m.auto_fetch!==!1&&m.type!=="websocket");return await Promise.all(f.map(async m=>{try{const b=await this.fetchDataSource(m,n,a,i,l);this.dataCache.set(m.id,{data:b,timestamp:Date.now()});const v=this.checkErrorCondition(m,b);if(v!==null){const S={status:v,message:`Error condition matched for ${m.id}`,data:b},_=yr(),A=_.resolve(v,{errorHandling:m.errorHandling,onError:m.onError});let k=!1;if(A.handler)if(m.loading_strategy==="blocking")_.execute(A.handler,S).catch(O=>{bt.error(`Error executing errorCondition handler for ${m.id}:`,O)}),k=!0;else try{await _.execute(A.handler,S),k=!0}catch(O){bt.error(`Error executing errorCondition handler for ${m.id}:`,O)}return m.fallback!==void 0?(this.dataCache.set(m.id,{data:m.fallback,timestamp:Date.now()}),bt.log(`Using fallback data for ${m.id} (errorCondition)`),{id:m.id,state:"success",data:m.fallback}):{id:m.id,state:"error",error:new Error(`Error condition matched: ${v}`),errorCode:v,errorHandled:k}}if(m.onSuccess)try{const S={data:b,sourceId:m.id};await this.executeOnSuccessHandler(m.onSuccess,S)}catch(S){bt.error(`Error executing onSuccess handler for ${m.id}:`,S)}return{id:m.id,state:"success",data:b}}catch(b){bt.error(`Failed to fetch data source: ${m.id}`,b);const v=b?.response?.status||b?.status||500,S=b?.response?.data,_=S?.message||b.message||"Unknown error",A={status:v,message:_,errors:S?.errors,data:S,statusText:b?.response?.statusText},k=yr(),O=k.resolve(v,{errorHandling:m.errorHandling,onError:m.onError});let M=!1;if(O.handler)if(m.loading_strategy==="blocking")k.execute(O.handler,A).catch(x=>{bt.error(`Error executing error handler for ${m.id}:`,x)}),M=!0;else try{await k.execute(O.handler,A),M=!0}catch(x){bt.error(`Error executing error handler for ${m.id}:`,x)}return m.fallback!==void 0?(this.dataCache.set(m.id,{data:m.fallback,timestamp:Date.now()}),bt.log(`Using fallback data for ${m.id}`),{id:m.id,state:"success",data:m.fallback}):(this.options.onError&&this.options.onError(b,m),{id:m.id,state:"error",error:b,errorCode:v,errorHandled:M})}}))}fetchDataSourcesInBackground(e,n={},a=new URLSearchParams,i){e.filter(u=>u.auto_fetch!==!1&&u.loading_strategy==="background"&&u.type!=="websocket").forEach(u=>{this.fetchDataSource(u,n,a).then(async d=>{this.dataCache.set(u.id,{data:d,timestamp:Date.now()});const f=this.checkErrorCondition(u,d);if(f!==null){const g={status:f,message:`Error condition matched for ${u.id}`,data:d},m=yr(),b=m.resolve(f,{errorHandling:u.errorHandling,onError:u.onError});if(b.handler)try{await m.execute(b.handler,g)}catch(v){bt.error(`Error executing errorCondition handler for ${u.id}:`,v)}u.fallback!==void 0&&(this.dataCache.set(u.id,{data:u.fallback,timestamp:Date.now()}),bt.log(`Using fallback data for ${u.id} (errorCondition)`),i&&i(u.id,u.fallback));return}if(u.onSuccess)try{const g={data:d,sourceId:u.id};await this.executeOnSuccessHandler(u.onSuccess,g)}catch(g){bt.error(`Error executing onSuccess handler for ${u.id}:`,g)}i&&i(u.id,d)}).catch(async d=>{bt.error(`Background fetch failed: ${u.id}`,d);const f=d?.response?.status||d?.status||500,g=d?.response?.data,m=g?.message||d.message||"Unknown error",b={status:f,message:m,errors:g?.errors,data:g,statusText:d?.response?.statusText},v=yr(),S=v.resolve(f,{errorHandling:u.errorHandling,onError:u.onError});if(S.handler)try{await v.execute(S.handler,b)}catch(_){bt.error(`Error executing error handler for ${u.id}:`,_)}if(u.fallback!==void 0){this.dataCache.set(u.id,{data:u.fallback,timestamp:Date.now()}),bt.log(`Using fallback data for ${u.id}`),i&&i(u.id,u.fallback);return}this.options.onError&&this.options.onError(d,u)})})}async fetchDataSource(e,n,a,i,l){switch(e.type){case"api":return this.fetchApiDataSource(e,n,a,i,l);case"static":return e.data;case"route_params":return n;case"query_params":return dy(a);default:throw new Error(`Unknown data source type: ${e.type}`)}}async fetchApiDataSource(e,n,a,i,l){if(this.options.sampleProvider?.has(e.id))return await Promise.resolve(this.options.sampleProvider.resolve(e));if(!e.endpoint)throw new Error(`API data source ${e.id} has no endpoint`);const u={route:n,query:dy(a)};i&&(u._global=i),l&&(u._local=l);let d=Zi(e.endpoint,u,{skipCache:!0});const f=e.method||"GET",m=(e.contentType?typeof e.contentType=="string"&&e.contentType.includes("{{")?Zi(e.contentType,u,{skipCache:!0}):e.contentType:"application/json")==="multipart/form-data";let b=m?{...e.params||{}}:JSON.parse(JSON.stringify(e.params||{}));Object.entries(b).forEach(([_,A])=>{typeof A=="string"&&(b[_]=bc(A,u))}),Object.keys(b).forEach(_=>{b[_]===""&&delete b[_]});const v=Z_();let S=null;if(v?.isEnabled()){v.trackDataSourceDefinition({id:e.id,type:e.type,endpoint:d,method:f,autoFetch:e.auto_fetch,initLocal:e.initLocal,initGlobal:e.initGlobal});let _=d;if(f==="GET"&&Object.keys(b).length>0){const A=new URLSearchParams;Object.entries(b).forEach(([O,M])=>{Array.isArray(M)?M.forEach(x=>A.append(O,String(x))):M!=null&&A.append(O,String(M))});const k=A.toString();_=k?`${d}?${k}`:d}S=v.trackRequest(_,f,{requestBody:f!=="GET"?b:void 0,dataSourceId:e.id}),v.trackDataSourceLoading(e.id)}try{let _;const A=e.auth_mode??(e.auth_required===!0?"required":"none"),k=pr.getInstance().isAuthenticated();if(A==="required"&&!k){bt.log(`[DataSourceManager] Skipping ${e.id}: auth_mode is 'required' but no token available`),v?.isEnabled()&&(v.trackDataSourceError(e.id,"Skipped: auth_mode required but not authenticated"),S&&v.failRequest(S,"Skipped: not authenticated"));const M=new Error("Auth required but not authenticated");throw M.response={status:401,statusText:"Unauthorized",data:null},M.status=401,M._authSkipped=!0,M}const O=A==="required"||A==="optional"&&k;if(O){const M=Ir(),x=d.startsWith("/api/")?d.substring(4):d.startsWith("/api")?d.substring(4)||"/":d;this.options.onError&&bt.log(`[DataSourceManager] Normalized endpoint: ${d} -> ${x}`);const D=this.getMatchingGlobalHeaders(d,u),U={};e.headers&&Object.entries(e.headers).forEach(([pe,Ce])=>{const ve=bc(Ce,u);ve!=null&&ve!==""&&(U[pe]=String(ve))});const z={...D,...U},q=Object.keys(z).length>0,X=m?this.toFormData(b):b;switch(f){case"GET":_=await M.get(x,{params:b,...q&&{headers:z}});break;case"POST":q?_=await M.post(x,X,{headers:z}):_=await M.post(x,X);break;case"PUT":q?_=await M.put(x,X,{headers:z}):_=await M.put(x,X);break;case"PATCH":q?_=await M.patch(x,X,{headers:z}):_=await M.patch(x,X);break;case"DELETE":_=await M.delete(x,{params:b,...q&&{headers:z}});break;default:throw new Error(`Unsupported HTTP method: ${f}`)}}else{let M=d;if(f==="GET"){const X=new URLSearchParams(b).toString();M=X?`${d}?${X}`:d}const x={...m?{}:{"Content-Type":"application/json"},Accept:"application/json"};if(typeof window<"u"){const X=localStorage.getItem("g7_locale");X&&(x["Accept-Language"]=X)}const D=this.getMatchingGlobalHeaders(d,u);Object.assign(x,D),e.headers&&Object.entries(e.headers).forEach(([X,pe])=>{const Ce=bc(pe,u);Ce!=null&&Ce!==""&&(x[X]=String(Ce))});let U;f!=="GET"&&(m?(U=this.toFormData(b),delete x["Content-Type"]):U=JSON.stringify(b));const z=await fetch(M,{method:f,headers:x,body:U});let q;try{q=await z.json()}catch{q=null}if(S&&v?.isEnabled()&&(v.completeRequest(S,z.status,q),S=null),!z.ok){v?.isEnabled()&&v.trackDataSourceError(e.id,`HTTP ${z.status}: ${z.statusText}`);const X=new Error(`HTTP error! status: ${z.status}`);throw X.response={status:z.status,statusText:z.statusText,data:q},X.status=z.status,X}_=q,v?.isEnabled()&&v.trackDataSourceLoaded(e.id,_)}return O&&S&&v?.isEnabled()&&(v.completeRequest(S,200,_),v.trackDataSourceLoaded(e.id,_)),_}catch(_){if(S&&v?.isEnabled()){const A=_;A?.response?v.completeRequest(S,A.response.status,A.response.data):v.failRequest(S,_ instanceof Error?_.message:String(_)),v.trackDataSourceError(e.id,_ instanceof Error?_.message:String(_))}throw _}}getCachedData(e){const n=this.dataCache.get(e);if(!n)return;if(Date.now()-n.timestamp>Ec.DATA_CACHE_TTL){this.dataCache.delete(e);return}return n.data}clearCache(){this.dataCache.clear()}subscribeWebSockets(e,n,a={}){const i=[],l=e.filter(u=>u.type==="websocket");return l.length===0||l.forEach(u=>{if(!u.channel||!u.event){bt.warn(`WebSocket source ${u.id} missing channel or event`);return}let d,f;try{d=Zi(u.channel,a,{skipCache:!0}),f=Zi(u.event,a,{skipCache:!0})}catch(b){bt.error(`Failed to resolve WebSocket channel/event for source ${u.id}:`,b);return}const g=b=>!!(!b||b.trim()===""||b.includes("{{")||b.endsWith(".")||b.endsWith(":")||b.startsWith(".")||b.startsWith(":")||b.includes("..")||b.includes("::"));if(g(d)||g(f)){bt.warn(`WebSocket source ${u.id} has invalid channel/event after expression resolution, skipping. Original channel="${u.channel}", resolved="${d}". Original event="${u.event}", resolved="${f}". Available context keys: [${Object.keys(a).join(", ")}]`);return}const m=yc.subscribe(d,f,b=>{const v=u.target_source||u.id;this.dataCache.set(v,{data:b,timestamp:Date.now()}),n(v,b)},{channelType:u.channel_type||"private"});m&&i.push(m)}),i}unsubscribeWebSockets(e){e.length!==0&&e.forEach(n=>{yc.unsubscribe(n)})}async executeOnSuccessHandler(e,n){const a=this.options.actionDispatcher??um();if(!a){bt.warn("ActionDispatcher not available, skipping onSuccess handler");return}const i=Array.isArray(e)?e:[e];for(const l of i)try{await a.dispatchAction({type:"click",...l},{data:{response:n}})}catch(u){throw bt.error("Failed to execute onSuccess handler:",u),u}}};$(Ec,"DATA_CACHE_TTL",3e5);let wr=Ec;const eA=new wr,gi=ft("ModalDataSourceWrapper");function tA(o,e){if(!o||!e)return o;const a=e.replace(/\?\./g,".").split(/\.(?![^\[]*\])/).flatMap(l=>{const u=l.match(/^([^\[]*)((?:\[\d+\])*)$/);if(u){const[,d,f]=u,g=[];d&&g.push(d);const m=f.match(/\[\d+\]/g);return m&&g.push(...m),g}return[l]}).filter(l=>l!=="");let i=o;for(const l of a){if(i==null)return;if(l.startsWith("[")&&l.endsWith("]")){const u=parseInt(l.slice(1,-1),10);i=i[u]}else i=i[l]}return i}const fy=({isOpen:o,modalId:e,dataSources:n,dataContext:a,globalStateUpdater:i,bindingEngine:l,debug:u=!1,children:d})=>{const[f,g]=H.useState(!1),[m,b]=H.useState(!1),v=H.useRef(!1),S=H.useRef(null);S.current||(S.current=new wr);const _=H.useCallback(async()=>{if(!(!n||n.length===0)&&S.current){g(!0);try{const A=a.route||{},k=new URLSearchParams(window.location.search),O=n.map(x=>{let D={...x};if(x.endpoint&&l){const U=l.resolveBindings(x.endpoint,a,{skipCache:!0});D.endpoint=U}if(x.params&&l){const U={};Object.entries(x.params).forEach(([z,q])=>{typeof q=="string"?U[z]=l.resolveBindings(q,a,{skipCache:!0}):U[z]=q}),D.params=U}return D});u&&gi.log(`[ModalDataSourceWrapper] Modal "${e}" fetching data sources:`,O.map(x=>({id:x.id,endpoint:x.endpoint})));const M=await S.current.fetchDataSourcesWithResults(O,A,k);i&&M.forEach(x=>{if(x.state==="success"&&x.data!==void 0){const D=O.find(U=>U.id===x.id);if(D?.initGlobal){const U=x.data?.data??x.data,z=Array.isArray(D.initGlobal)?D.initGlobal:[D.initGlobal];for(const q of z)if(typeof q=="string")i({[q]:U}),u&&gi.log(`[ModalDataSourceWrapper] Modal "${e}" initGlobal: ${x.id}.data -> _global.${q}`);else if(typeof q=="object"&&q.key){const{key:X,path:pe}=q,Ce=pe?tA(U,pe):U;i({[X]:Ce}),u&&gi.log(`Modal "${e}" initGlobal: ${x.id}.data${pe?"."+pe:""} -> _global.${X}`)}}}else x.state==="error"&&gi.error(`Modal "${e}" data source error:`,x.id,x.error)}),u&&gi.log(`Modal "${e}" data sources fetched successfully`)}catch(A){gi.error(`Modal "${e}" data source fetch error:`,A)}finally{g(!1),b(!0)}}},[n,a,i,l,e,u]);return H.useEffect(()=>{if(!n||n.length===0)return;const A=window.__templateApp;return A?.registerModalDataSources&&A.registerModalDataSources(e,n),()=>{A?.unregisterModalDataSources&&A.unregisterModalDataSources(e)}},[e,n]),H.useEffect(()=>{!o&&v.current&&(b(!1),u&&gi.log(`[ModalDataSourceWrapper] Modal "${e}" closed, reset fetch state`)),o&&!v.current&&n&&n.length>0&&!m&&_(),v.current=o},[o,n,m,_,e,u]),ht.jsx(ht.Fragment,{children:d})};class vc extends Error{constructor(n,a,i={}){super(a);$(this,"code");$(this,"userMessageKey");$(this,"showStack");$(this,"icon");$(this,"recoverable");this.name="TemplateEngineError",this.code=n,this.userMessageKey=a,this.showStack=i.showStack??!0,this.icon=i.icon??"fa-circle-exclamation",this.recoverable=i.recoverable??!0,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}getUserMessage(n,a){if(!a||!n)return this.userMessageKey;try{return a.translate(this.userMessageKey,n)}catch{return this.userMessageKey}}}class nA extends vc{constructor(){super("TEMPLATE_NOT_FOUND","$t:core.errors.template_not_found",{showStack:!1,icon:"fa-paint-brush",recoverable:!1}),this.name="TemplateNotFoundError"}}function hy(o){if(o instanceof vc)return o;if(o instanceof Error){const e=new vc("TEMPLATE_INIT_ERROR",o.message||"$t:core.errors.template_init_error",{showStack:!0,icon:"fa-circle-exclamation",recoverable:!0});return e.stack=o.stack,e}return new vc("TEMPLATE_INIT_ERROR","$t:core.errors.template_init_error",{showStack:!1,icon:"fa-circle-exclamation",recoverable:!0})}const rA=ft("ErrorDisplay");class gf{static render(e,n){const a=document.getElementById(e);if(!a){rA.error(`Container #${e} not found`);return}const i=n.debug&&n.showStack&&n.stackTrace,l=window.matchMedia("(prefers-color-scheme: dark)").matches,u={container:`
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
background-color: ${l?"#111827":"#f9fafb"};
padding: 1rem;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
`,card:`
max-width: 28rem;
width: 100%;
background-color: ${l?"#1f2937":"#ffffff"};
border-radius: 0.5rem;
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
padding: 2rem;
text-align: center;
`,iconContainer:`
margin-bottom: 1.5rem;
`,icon:`
font-size: 4rem;
color: #ef4444;
`,title:`
font-size: 1.5rem;
font-weight: 700;
color: ${l?"#ffffff":"#111827"};
margin-bottom: 1rem;
`,message:`
color: ${l?"#d1d5db":"#4b5563"};
margin-bottom: 0.5rem;
line-height: 1.625;
`,detailMessage:`
font-size: 0.875rem;
color: ${l?"#9ca3af":"#6b7280"};
margin-bottom: 1.5rem;
background-color: ${l?"#374151":"#f3f4f6"};
padding: 0.5rem 0.75rem;
border-radius: 0.25rem;
`,spacer:`
margin-bottom: 1.5rem;
`,stackContainer:`
margin-top: 1.5rem;
padding: 1rem;
background-color: ${l?"#374151":"#f3f4f6"};
border-radius: 0.375rem;
text-align: left;
`,stackTitle:`
font-size: 0.875rem;
font-weight: 600;
color: ${l?"#e5e7eb":"#374151"};
margin-bottom: 0.5rem;
`,stackTrace:`
font-size: 0.75rem;
color: ${l?"#d1d5db":"#4b5563"};
overflow-x: auto;
white-space: pre-wrap;
word-break: break-word;
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
`,buttonContainer:`
margin-top: 1.5rem;
`,button:`
display: inline-flex;
align-items: center;
padding: 0.75rem 1.5rem;
background-color: #2563eb;
color: #ffffff;
font-weight: 500;
border-radius: 0.375rem;
border: none;
cursor: pointer;
transition: background-color 0.2s;
`};a.innerHTML=`
<div style="${u.container}">
<div style="${u.card}">
<!-- 아이콘 -->
<div style="${u.iconContainer}">
<i class="fa-solid ${n.icon}" style="${u.icon}"></i>
</div>
<!-- 제목 -->
<h1 style="${u.title}">
${this.escapeHtml(n.title)}
</h1>
<!-- 사용자 메시지 -->
<p style="${u.message}">
${this.escapeHtml(n.message)}
</p>
<!-- 상세 메시지 (API 응답 등) -->
${n.detailMessage?`
<p style="${u.detailMessage}">
${this.escapeHtml(n.detailMessage)}
</p>
`:`<div style="${u.spacer}"></div>`}
<!-- Stack Trace (디버그 모드일 때만) -->
${i?`
<div style="${u.stackContainer}">
<p style="${u.stackTitle}">
Stack Trace:
</p>
<pre style="${u.stackTrace}">${this.escapeHtml(n.stackTrace)}</pre>
</div>
`:""}
<!-- 새로고침 버튼 (복구 가능할 때만) -->
${n.showReloadButton?`
<div style="${u.buttonContainer}">
<button
onclick="window.location.reload()"
style="${u.button}"
onmouseover="this.style.backgroundColor='#1d4ed8'"
onmouseout="this.style.backgroundColor='#2563eb'"
>
<i class="fa-solid fa-rotate-right" style="margin-right: 0.5rem;"></i>
새로고침
</button>
</div>
`:""}
</div>
</div>
`}static renderFromError(e,n,a,i=!1,l,u,d){let f,g;if(n.userMessageKey.startsWith("$t:"))if(u&&l)try{f=u.translate(n.userMessageKey,l)}catch{f=n.userMessageKey.replace("$t:","")}else f=n.userMessageKey.replace("$t:","");else f=n.userMessageKey;if(d){const m=d;m.details?.apiMessage?g=m.details.apiMessage:m.response?.data?.message&&(g=m.response.data.message)}this.render(e,{title:a,message:f,detailMessage:g,icon:n.icon,showStack:n.showStack,stackTrace:n.stack,showReloadButton:n.recoverable,debug:i})}static escapeHtml(e){if(!e)return"";const n=document.createElement("div");return n.textContent=e,n.innerHTML}}const ds=ft("Router");class aA{constructor(e){$(this,"routes",[]);$(this,"templateIdentifier");$(this,"eventHandlers",new Map);$(this,"pendingNavigation",null);$(this,"isNavigating",!1);$(this,"handlePopState",()=>{this.navigateToCurrentPath()});this.templateIdentifier=e,this.initPopstateListener()}initPopstateListener(){window.addEventListener("popstate",this.handlePopState)}on(e,n){this.eventHandlers.has(e)||this.eventHandlers.set(e,[]),this.eventHandlers.get(e).push(n)}async emit(e,...n){const a=this.eventHandlers.get(e);a&&await Promise.all(a.map(i=>i(...n)))}async loadRoutes(e){try{const n=e!==void 0&&e>0?e:null,a=await fetch(Mr(`/api/templates/${this.templateIdentifier}/routes`,"json",n));if(!a.ok)throw new Error(`Failed to load routes: ${a.statusText}`);const i=await a.json();if(!i.success)throw new Error("Failed to load routes from API");if(i.data&&Array.isArray(i.data.routes))this.routes=i.data.routes,ds.log(`Loaded ${this.routes.length} routes${e?` (v=${e})`:""}`);else throw new Error("Invalid routes data format")}catch(n){throw ds.error("Error loading routes:",n),n}}setRoutes(e){this.routes=e,ds.log(`Set ${this.routes.length} routes`)}match(e){const n=this.normalizePathname(e);for(const a of this.routes){const i=this.matchPattern(a.path,n);if(i!==null)return{route:a,params:i}}return null}normalizePathname(e){return e.length>1&&e.endsWith("/")?e.replace(/\/+$/,"")||"/":e}matchPattern(e,n){const a=[];let i=e.replace(/:([^/]+)/g,(f,g)=>(a.push(g),"([^/]+)"));i.startsWith("*/")&&(i="(?:/[^/]+)?"+i.slice(1)),i=i.replace(/\//g,"\\/");const l=new RegExp(`^${i}$`),u=n.match(l);if(!u)return null;const d={};return a.forEach((f,g)=>{d[f]=u[g+1]}),d}getRoutes(){return[...this.routes]}getAuthType(e,n){return e.auth_type?e.auth_type:n.startsWith("/admin")?"admin":"user"}async navigateToCurrentPath(){const e=window.location.pathname,n=window.location.search,a=this.match(e);if(!a){ds.warn(`No route matched for path: ${e}`),this.emit("routeNotFound",e);return}if(a.route.redirect){ds.log(`Redirecting from ${e} to ${a.route.redirect}`),this.navigate(a.route.redirect);return}if(a.route.auth_required){const u=this.getAuthType(a.route,e),d=pr.getInstance();let f=d.isAuthenticated()&&d.getAuthType()===u;if(f||(f=await d.checkAuth(u)),!f){const g=d.getLoginRedirectUrl(u,e+n);ds.log(`Not authenticated, redirecting to: ${g}`),window.location.href=g;return}}const i=new URLSearchParams(n),l={};for(const u of i.keys()){if(u in l)continue;const d=i.getAll(u);d.length>1?l[u]=d:d.length===1&&(u.endsWith("[]")?l[u]=d:l[u]=d[0])}await this.emit("routeChange",{path:e,layout:a.route.layout,endpoint:a.route.endpoint,params:{...a.route.params||{},...a.params},query:l,auth_required:a.route.auth_required,auth_type:a.route.auth_type,meta:a.route.meta})}navigate(e){if(this.isNavigating){this.pendingNavigation=e;return}this.executeNavigation(e)}async executeNavigation(e){this.isNavigating=!0,this.pendingNavigation=null;try{window.history.pushState({},"",e),await this.navigateToCurrentPath()}finally{if(this.isNavigating=!1,this.pendingNavigation){const n=this.pendingNavigation;this.executeNavigation(n)}}}}const iA=/^\/admin\/layout-editor\/([^/?#]+)\/?$/;function gy(o){const e=iA.exec(o);return e?{templateIdentifier:e[1]}:null}const Bt=ft("ErrorPageHandler");class sA{constructor(e){$(this,"templateId");$(this,"layoutLoader");$(this,"locale");$(this,"debug");$(this,"renderFunction");$(this,"dataSourceManager");$(this,"globalState");$(this,"errorConfig",null);$(this,"configLoaded",!1);this.templateId=e.templateId,this.layoutLoader=e.layoutLoader,this.locale=e.locale,this.debug=e.debug,this.renderFunction=e.renderFunction,this.dataSourceManager=e.dataSourceManager,this.globalState=e.globalState||{}}async loadConfig(){if(this.configLoaded)return this.errorConfig;try{const e=await fetch(Mr(`/api/templates/${this.templateId}/config`,"json"));if(!e.ok)return this.debug&&Bt.warn("Failed to load template config:",e.statusText),this.configLoaded=!0,null;const n=await e.json();if(!n.success||!n.data)return this.debug&&Bt.warn("Invalid template config response"),this.configLoaded=!0,null;const a=n.data;return!a.error_config||!a.error_config.layouts?(this.debug&&Bt.warn("No error_config found in template.json"),this.configLoaded=!0,null):(this.errorConfig=a.error_config,this.configLoaded=!0,this.debug&&Bt.log("Error config loaded:",this.errorConfig),this.errorConfig)}catch(e){return Bt.error("Failed to load error config:",e),this.configLoaded=!0,null}}async renderError(e,n="app"){try{const a=await this.loadConfig();if(!a)return this.debug&&Bt.warn("No error config available, cannot render error page"),!1;const i=a.layouts[e]||a.layouts[String(e)];if(!i)return this.debug&&Bt.warn(`No layout defined for error code: ${e}`),!1;this.debug&&Bt.log(`Loading error layout: ${i} for code: ${e}`);const l=await this.layoutLoader.loadLayout(this.templateId,i);if(!l)return this.debug&&Bt.error(`Failed to load error layout: ${i}`),!1;this.debug&&Bt.log("Error layout loaded:",l);let u={};const d=l.data_sources||[];if(d.length>0){this.debug&&Bt.log("Fetching data sources:",d.map(S=>S.id));const m=d.filter(S=>S.loading_strategy==="blocking"),b=d.filter(S=>!S.loading_strategy||S.loading_strategy==="progressive"),v=[...m,...b];if(v.length>0)try{u=await this.dataSourceManager.fetchDataSources(v,{},new URLSearchParams),this.debug&&Bt.log("Data sources fetched:",Object.keys(u))}catch(S){Bt.error("Failed to fetch data sources:",S)}}const f={};d.length>0&&(this.processInitOptions(d,u,f),this.debug&&Bt.log("initOptions processed:",{globalKeys:Object.keys(this.globalState),localKeys:Object.keys(f)}));const g={...u,errorCode:e,_global:{...this.globalState},_local:{...f}};return await this.renderFunction({containerId:n,layoutJson:l,dataContext:g,translationContext:{templateId:this.templateId,locale:this.locale}}),this.debug&&Bt.log(`Error page ${e} rendered successfully`),!0}catch(a){return Bt.error(`Failed to render error page ${e}:`,a),!1}}processInitOptions(e,n,a){for(const i of e){const l=n[i.id];if(!l)continue;const u=l?.data??l;if(i.initLocal){if(typeof i.initLocal=="string")a[i.initLocal]=u,Bt.log(`initLocal: ${i.id}.data -> _local.${i.initLocal}`);else if(typeof i.initLocal=="object"&&"key"in i.initLocal){const{key:d,path:f}=i.initLocal;a[d]=f?this.getValueByPath(u,f):u,Bt.log(`initLocal: ${i.id}.data${f?"."+f:""} -> _local.${d}`)}}if(i.initGlobal){const d=Array.isArray(i.initGlobal)?i.initGlobal:[i.initGlobal];for(const f of d)if(typeof f=="string")this.globalState[f]=u,Bt.log(`initGlobal: ${i.id}.data -> _global.${f}`);else if(typeof f=="object"&&f!==null&&"key"in f){const{key:g,path:m}=f;this.globalState[g]=m?this.getValueByPath(u,m):u,Bt.log(`initGlobal: ${i.id}.data${m?"."+m:""} -> _global.${g}`)}}}}getValueByPath(e,n){return n.split(".").reduce((a,i)=>a?.[i],e)}updateGlobalState(e){this.globalState={...this.globalState,...e}}updateLocale(e){this.locale=e,this.debug&&Bt.log("Locale updated:",e)}isConfigLoaded(){return this.configLoaded}async hasErrorLayout(e){const n=await this.loadConfig();return n?!!(n.layouts[e]||n.layouts[String(e)]):!1}clearConfigCache(){this.errorConfig=null,this.configLoaded=!1,this.debug&&Bt.log("Config cache cleared")}}const Ht=ft("ModuleAssetLoader");class oA{constructor(){$(this,"loadedAssets",new Map);$(this,"loadingPromises",new Map);$(this,"failedJsAssets",new Set)}hasFailedJsAssets(){return this.failedJsAssets.size>0}getFailedJsAssets(){return[...this.failedJsAssets]}async loadActiveExtensionAssets(e){if(!e||e.length===0){Ht.log("No module assets to load");return}const n=[...e].sort((d,f)=>d.priority-f.priority);Ht.log("Loading module assets:",n.map(d=>d.identifier));const a=n.filter(d=>d.css).map(d=>this.loadCSS(d.identifier,d.css)),i=n.filter(d=>d.js).map(d=>this.loadJS(d.identifier,d.js)),l=await Promise.allSettled([...a,...i]),u=l.filter(d=>d.status==="rejected");if(u.length>0){Ht.warn(`Some module assets failed to load (${u.length}/${l.length}); continuing with the rest`,this.getFailedJsAssets());return}Ht.log("All module assets loaded successfully")}async loadBundle(e,n,a){const i=[];if(a&&i.push(this.loadBundleCss(e,a)),n&&i.push(this.loadBundleJs(e,n)),i.length===0){Ht.log(`No bundle assets to load for: ${e}`);return}await Promise.all(i)}async loadBundleCss(e,n){const a=`ext-bundle-css-${e}`;if(document.getElementById(a)){Ht.log(`Bundle CSS already loaded: ${e}`);return}return new Promise(i=>{const l=document.createElement("link");l.rel="stylesheet",l.href=n,l.id=a,l.onload=()=>{Ht.log(`Bundle CSS loaded: ${e}`),this.registerLoadedAsset(`bundle-${e}`,{type:"css",element:l}),i()},l.onerror=()=>{Ht.warn(`Failed to load bundle CSS: ${e} (${n})`),i()},document.head.appendChild(l)})}async loadBundleJs(e,n){const a=`ext-bundle-js-${e}`;if(document.getElementById(a)){Ht.log(`Bundle JS already loaded: ${e}`);return}const i=this.loadingPromises.get(a);if(i)return Ht.log(`Bundle JS already loading: ${e}`),i;const l=tp(n,{id:a},{label:`bundle JS: ${e}`}).then(()=>{Ht.log(`Bundle JS loaded: ${e}`);const u=document.getElementById(a);u&&this.registerLoadedAsset(`bundle-${e}`,{type:"js",element:u}),this.loadingPromises.delete(a)}).catch(u=>{throw Ht.warn(`Failed to load bundle JS: ${e} (${n})`,u),this.failedJsAssets.add(e),this.loadingPromises.delete(a),u});return this.loadingPromises.set(a,l),l}async loadCSS(e,n){const a=`module-css-${e}`;if(document.getElementById(a)){Ht.log(`CSS already loaded: ${e}`);return}return new Promise((i,l)=>{const u=document.createElement("link");u.rel="stylesheet",u.href=n,u.id=a,u.onload=()=>{Ht.log(`CSS loaded: ${e}`),this.registerLoadedAsset(e,{type:"css",element:u}),i()},u.onerror=()=>{Ht.warn(`Failed to load CSS: ${e} (${n})`),i()},document.head.appendChild(u)})}async loadJS(e,n){const a=`module-js-${e}`;if(document.getElementById(a)){Ht.log(`JS already loaded: ${e}`);return}const i=this.loadingPromises.get(e);if(i)return Ht.log(`JS already loading: ${e}`),i;const l=tp(n,{id:a},{label:`JS: ${e}`}).then(()=>{Ht.log(`JS loaded: ${e}`);const u=document.getElementById(a);u&&this.registerLoadedAsset(e,{type:"js",element:u}),this.loadingPromises.delete(e)}).catch(u=>{throw Ht.warn(`Failed to load JS: ${e} (${n})`,u),this.failedJsAssets.add(e),this.loadingPromises.delete(e),u});return this.loadingPromises.set(e,l),l}registerLoadedAsset(e,n){const a=this.loadedAssets.get(e)||[];a.push(n),this.loadedAssets.set(e,a)}unloadExtensionAsset(e){const n=this.loadedAssets.get(e);if(!n||n.length===0){Ht.log(`No assets to unload for: ${e}`);return}n.forEach(a=>{a.element.parentNode&&(a.element.parentNode.removeChild(a.element),Ht.log(`${a.type.toUpperCase()} unloaded: ${e}`))}),this.loadedAssets.delete(e),Ht.log(`All assets unloaded for: ${e}`)}unloadAllAssets(){Array.from(this.loadedAssets.keys()).forEach(n=>{this.unloadExtensionAsset(n)}),Ht.log("All module assets unloaded")}isLoaded(e){return this.loadedAssets.has(e)}getLoadedModules(){return Array.from(this.loadedAssets.keys())}}let pf=null;function mf(){return pf||(pf=new oA),pf}function lA(){if(typeof window>"u")return[];const o=window.G7Config;if(!o?.moduleAssets)return[];const e=[];for(const[n,a]of Object.entries(o.moduleAssets)){const i=a;e.push({identifier:n,js:i.js?Ca(i.js):i.js,css:i.css?Ca(i.css):i.css,priority:i.priority,external:i.external})}return e}function cA(){if(typeof window>"u")return null;const o=window.G7Config;if(!o?.bundleUrls)return null;const e=o.bundleUrls;return{moduleJs:e.moduleJs?Ca(e.moduleJs):e.moduleJs,moduleCss:e.moduleCss?Ca(e.moduleCss):e.moduleCss,pluginJs:e.pluginJs?Ca(e.pluginJs):e.pluginJs,pluginCss:e.pluginCss?Ca(e.pluginCss):e.pluginCss}}function uA(){if(typeof window>"u")return[];const o=window.G7Config;if(!o?.pluginAssets)return[];const e=[];for(const[n,a]of Object.entries(o.pluginAssets)){const i=a;e.push({identifier:n,js:i.js?Ca(i.js):i.js,css:i.css?Ca(i.css):i.css,priority:i.priority,external:i.external})}return e}const yf=ft("SystemBannerManager");class Sc{static show(e){this.banners.set(e.id,e),this.render(),yf.log(`Banner shown: ${e.id}`)}static hide(e){this.banners.delete(e)&&(this.render(),yf.log(`Banner hidden: ${e}`))}static hideAll(){this.banners.clear(),this.render(),yf.log("All banners hidden")}static detectLocale(){try{const n=window.G7Core;if(n?.locale?.current)return n.locale.current()}catch{}return(navigator.language||"ko").split("-")[0]}static resolveMessage(e,n){return typeof e=="string"?e:e[n]||e.en||e.ko||Object.values(e)[0]||""}static render(){if(typeof document>"u")return;let e=document.getElementById(this.containerId);if(this.banners.size===0){e&&(e.remove(),this.adjustAppPadding(0));return}e||(e=document.createElement("div"),e.id=this.containerId,e.style.cssText="position:fixed;top:0;left:0;right:0;z-index:99999;",document.body.prepend(e));const n=Array.from(this.banners.values()).sort((i,l)=>(i.order??0)-(l.order??0)),a=this.detectLocale();e.innerHTML=n.map(i=>{const l=this.resolveMessage(i.message,a),u=i.background||"#f59e0b",d=i.color||"white";return`<div data-banner-id="${i.id}" style="background:${u};color:${d};text-align:center;padding:8px 16px;font-size:14px;font-weight:500;">${l}</div>`}).join(""),requestAnimationFrame(()=>{e&&this.adjustAppPadding(e.offsetHeight)})}static adjustAppPadding(e){const n=document.getElementById("app");n&&(n.style.paddingTop=e>0?`${e}px`:"")}}$(Sc,"banners",new Map),$(Sc,"containerId","g7-system-banners");const P=ft("TemplateApp");function py(o){const e={};for(const n of o.keys()){if(n in e)continue;const a=o.getAll(n);a.length>1?e[n]=a:a.length===1&&(n.endsWith("[]")?e[n]=a:e[n]=a[0])}return e}const _r=class _r{constructor(e){$(this,"router",null);$(this,"layoutLoader",null);$(this,"errorPageHandler",null);$(this,"config");$(this,"globalState");$(this,"globalStateListeners",new Set);$(this,"currentRouteChangeId",0);$(this,"currentDataSources",[]);$(this,"currentRawDataSources",[]);$(this,"currentRouteParams",{});$(this,"currentQueryParams",new URLSearchParams);$(this,"currentFetchedData",{});$(this,"currentLayoutName","");$(this,"templateErrorHandling",null);$(this,"currentWebSocketSubscriptions",[]);$(this,"extensionCacheVersion",0);$(this,"currentGlobalHeaders",[]);$(this,"transitionOverlayEl",null);$(this,"skeletonOverlayRoot",null);$(this,"skeletonOverlayContainer",null);$(this,"_spinnerState",null);$(this,"modalDataSources",new Map);this.globalState={sidebarOpen:!1},this.loadG7Config(),this.migrateLocaleStorage();const n=this.loadLocaleFromStorage(),a=n||e.locale||"ko";this.config={...e,locale:a},!n&&e.locale&&this.saveLocaleToStorage(e.locale)}loadG7Config(){if(typeof window<"u"&&window.G7Config){const e=window.G7Config;e.settings&&(this.globalState.settings=e.settings,P.log("Loaded settings from G7Config:",Object.keys(e.settings)),e.settings.upload&&(this.globalState.uploadSettings=e.settings.upload)),e.plugins&&(this.globalState.plugins=e.plugins,P.log("Loaded plugin settings from G7Config:",Object.keys(e.plugins))),e.modules&&(this.globalState.modules=e.modules,P.log("Loaded module settings from G7Config:",Object.keys(e.modules))),e.appConfig&&(this.globalState.appConfig=e.appConfig,P.log("Loaded appConfig from G7Config:",Object.keys(e.appConfig)))}}resolveRouteExpressions(e){const n=new On,a={_global:this.globalState};return e.map(i=>{const l={...i};if(l.path&&l.path.includes("{{")){const u=l.path;l.path=n.resolveBindings(l.path,a),l.path=l.path.replace(/\/\/+/g,"/")||"/",l.path.includes("{{")&&(P.warn("Route expression resolution failed, using fallback:",u),l.path=u.replace(/\{\{[^}]+\}\}/g,"").replace(/\/\/+/g,"/")||"/")}if(l.redirect&&l.redirect.includes("{{")){const u=l.redirect;l.redirect=n.resolveBindings(l.redirect,a),l.redirect=l.redirect.replace(/\/\/+/g,"/")||"/",l.redirect.includes("{{")&&(P.warn("Route redirect expression resolution failed:",u),l.redirect=u.replace(/\{\{[^}]+\}\}/g,"").replace(/\/\/+/g,"/")||"/")}return l})}migrateLocaleStorage(){const e=["locale","g7_template_locale"];for(const n of e)try{const a=localStorage.getItem(n);a&&a!==localStorage.getItem(_r.LOCALE_STORAGE_KEY)&&(localStorage.setItem(_r.LOCALE_STORAGE_KEY,a),P.log(`Migrated locale from '${n}' to '${_r.LOCALE_STORAGE_KEY}'`)),localStorage.removeItem(n)}catch(a){P.warn(`Failed to migrate locale key '${n}':`,a)}}async init(){try{Js.getInstance().setDebug(this.config.debug),P.log("Initializing with config:",this.config),KS();const e=hr.getInstance(),n=pr.getInstance(),a=this.loadCacheVersionFromStorage()||0,[i,l,u,d,f]=await Promise.all([ko({templateId:this.config.templateId,templateType:this.config.templateType,locale:this.config.locale,debug:this.config.debug,cacheVersion:a}),e.loadComponents(this.config.templateId,this.config.templateType),Dl(Mr(`/api/templates/${this.config.templateId}/routes`,"json",a>0?a:null),{label:"routes.json"}).then(A=>{if(!A.ok)throw new Error(`Failed to load routes: ${A.statusText}`);return A.json()}).then(A=>{if(!A.success)throw new Error("Failed to load routes from API");return A.data}).catch(A=>{throw P.error("Error loading routes:",A),A}),n.preloadAuth(this.config.templateType==="admin"?"admin":"user"),fetch(Mr(`/api/templates/${this.config.templateId}/config`,"json")).then(A=>A.ok?A.json():null).then(A=>!A?.success||!A?.data?null:A.data).catch(A=>(P.warn("Error loading template config:",A),null))]);if(P.log("Template Engine initialized"),P.log("ComponentRegistry loaded"),P.log("Routes data loaded"),P.log("User info preloaded"),P.log("Template config loaded:",f),f?.cache_version!==void 0){const A=this.loadCacheVersionFromStorage();if(this.extensionCacheVersion=f.cache_version,this.saveCacheVersionToStorage(this.extensionCacheVersion),P.log("Extension cache version:",this.extensionCacheVersion),A!==null&&A!==this.extensionCacheVersion){P.log("Cache version changed, reloading routes...");const k=await Dl(Mr(`/api/templates/${this.config.templateId}/routes`,"json",this.extensionCacheVersion),{label:"routes.json (reload)"}).then(O=>{if(!O.ok)throw new Error(`Failed to reload routes: ${O.statusText}`);return O.json()}).then(O=>{if(!O.success)throw new Error("Failed to reload routes from API");return O.data});Array.isArray(k.routes)&&(k.routes=this.resolveRouteExpressions(k.routes),Object.assign(u,k),P.log("Routes reloaded with new cache version"));try{const{TranslationEngine:O}=await Promise.resolve().then(()=>sp),M=O.getInstance();M.setCacheVersion(this.extensionCacheVersion);const x=this.config.locale||"ko",D="en";await M.loadTranslations(this.config.templateId,x,"/api",!0),x!==D&&await M.loadTranslations(this.config.templateId,D,"/api",!0),P.log("Translations reloaded with new cache version")}catch(O){P.error("Failed to reload translations:",O)}}}f?.errorHandling&&(this.templateErrorHandling=f.errorHandling,yr().setTemplateConfig(this.templateErrorHandling),P.log("Template errorHandling registered:",this.templateErrorHandling)),n.on("logout",()=>{P.log("User logged out")}),n.on("authStateChange",A=>{P.log("Auth state changed:",A)}),P.log("AuthManager event handlers registered");const g=Ir(),m=this.config.templateType==="admin"?"admin":"user",b=n.getConfig(m);g.setOnUnauthorized(()=>{P.log("Unauthorized - redirecting to login page"),g.removeToken();const A=window.location.pathname+window.location.search,k=n.getLoginRedirectUrl(m,A,"session_expired");window.location.href=k}),P.log("ApiClient onUnauthorized callback registered"),this.layoutLoader=new lf(e),this.extensionCacheVersion>0&&this.layoutLoader.setCacheVersion(this.extensionCacheVersion),P.log("LayoutLoader initialized:",this.layoutLoader);const v=new wr({onUnauthorized:()=>{P.warn("Unauthorized request in error page")}});if(this.errorPageHandler=new sA({templateId:this.config.templateId,layoutLoader:this.layoutLoader,locale:this.config.locale,debug:this.config.debug,renderFunction:fs,dataSourceManager:v,globalState:this.globalState}),P.log("ErrorPageHandler initialized with DataSourceManager"),await this.handleServerError()){P.log("Server error handled, skipping normal initialization");return}if(this.router=new aA(this.config.templateId),Array.isArray(u.routes)){const A=this.resolveRouteExpressions(u.routes);this.router.setRoutes(A)}else throw new Error("Invalid routes data format");P.log("Router initialized:",this.router),P.log("Routes set:",this.router.getRoutes());const{getActionDispatcher:S}=await Promise.resolve().then(()=>Ur),_=S();if(_&&(_.setDefaultContext({navigate:A=>this.router?.navigate(A)}),_.setGlobalStateUpdater((A,k)=>this.setGlobalState(A,k)),P.log("Navigate function and setGlobalState injected to ActionDispatcher")),await this.loadExtensionAssets(),this.reinitializeTemplateHandlers(),this.router.on("routeChange",A=>this.handleRouteChange(A)),this.router.on("routeNotFound",A=>this.handleRouteNotFound(A)),typeof window<"u"&&gy(window.location.pathname)){P.log("Layout editor mode detected — skipping router match"),await fs({containerId:"app",layoutJson:{components:[]},dataContext:{},translationContext:{templateId:this.config.templateId,locale:this.config.locale}}),P.log("Template App initialized in layout editor mode");return}this.router.navigateToCurrentPath(),P.log("Template App initialized successfully")}catch(e){P.error("Initialization failed:",e),this.showInitError(e)}}async loadExtensionAssets(){try{const e=mf(),n=cA();if(!n){await this.loadExtensionAssetsIndividually();return}await e.loadBundle("module",n.moduleJs,n.moduleCss),await e.loadBundle("plugin",n.pluginJs,n.pluginCss),P.log("Extension bundle assets loaded successfully")}catch(e){P.warn("Failed to load extension assets:",e)}}async loadExtensionAssetsIndividually(){const e=mf(),n=lA();n.length>0&&(P.log("Loading module assets (individual fallback):",n.map(i=>i.identifier)),await e.loadActiveExtensionAssets(n));const a=uA();a.length>0&&(P.log("Loading plugin assets (individual fallback):",a.map(i=>i.identifier)),await e.loadActiveExtensionAssets(a))}async handleRouteChange(e){const n=++this.currentRouteChangeId;window.__g7ForcedLocalFields=void 0,window.__g7ActionContext=void 0,window.__g7PendingLocalState=void 0,window.__g7LastSetLocalSnapshot=void 0,window.__g7SetLocalOverrideKeys=void 0,window.__g7SequenceLocalSync=void 0,window.__g7AutoBindingPaths=new Map;try{if(P.log("Route changed:",e,"requestId:",n),!this.layoutLoader)throw new Error("LayoutLoader is not initialized");if(!e.layout)throw new Error("Route layout is not defined");let a=e.layout;const i=a==="__preview__";i&&e.params?.token&&(a=`__preview__/${e.params.token}`);const l=await this.layoutLoader.loadLayout(this.config.templateId,a);if(n!==this.currentRouteChangeId){P.log("Route change cancelled (newer request exists):",n);return}P.log("Layout loaded:",l);const u=yr();l.errorHandling?(u.setLayoutConfig(l.errorHandling),P.log("Layout errorHandling registered:",l.errorHandling)):u.clearLayoutConfig();const d=l.data_sources||[],f=e.query||{},g=new URLSearchParams;for(const[ee,ge]of Object.entries(f))if(Array.isArray(ge))for(const N of ge)g.append(ee,N);else g.set(ee,ge);const m={route:e.params||{},query:f,_global:this.globalState};l.scripts&&Array.isArray(l.scripts)&&await this.loadLayoutScripts(l.scripts,m);const{DataSourceManager:b,getActionDispatcher:v}=await Promise.resolve().then(()=>Ur),S=new b;if(i){const ee=v();ee&&ee.setPreviewMode(!0),this.setGlobalState({__isPreview:!0}),Sc.show({id:"preview-mode",message:{ko:"⚠ 미리보기 모드 — 페이지 이동이 비활성화됩니다",en:"⚠ Preview Mode — Navigation is disabled"},background:"linear-gradient(90deg, #f59e0b, #d97706)",color:"white"}),P.log("Preview mode activated")}else{const ee=v();ee?.isPreviewMode()&&(ee.setPreviewMode(!1),Sc.hide("preview-mode"))}if(this.currentGlobalHeaders=l.globalHeaders||[],this.currentGlobalHeaders.length>0){S.setGlobalHeaders(this.currentGlobalHeaders);const ee=v();ee&&ee.setGlobalHeaders(this.currentGlobalHeaders),P.log("globalHeaders set:",this.currentGlobalHeaders.map(ge=>ge.pattern))}if(l.named_actions&&Object.keys(l.named_actions).length>0){const ee=v();ee&&ee.setNamedActions(l.named_actions)}const _=S.filterByCondition(d,m);d.length!==_.length&&P.log("Data sources filtered by condition:",{before:d.map(ee=>ee.id),after:_.map(ee=>ee.id)});const A=_.filter(ee=>ee.loading_strategy==="blocking"),k=_.filter(ee=>(ee.loading_strategy||"progressive")!=="blocking"&&ee.type!=="websocket"),O=Array.isArray(l.transition_overlay?.wait_for)?l.transition_overlay.wait_for:[],M=O.length>0&&_.some(ee=>O.includes(ee.id)&&ee.type!=="websocket"&&(ee.loading_strategy||"progressive")!=="background");if((A.length>0||M)&&l.transition_overlay){const ee=typeof l.transition_overlay=="boolean"?{enabled:l.transition_overlay,style:"opaque"}:l.transition_overlay;ee.enabled&&ee.style==="skeleton"&&ee.skeleton?.component&&ee.target?this.renderSkeletonOverlay(ee.target,ee.skeleton,l,ee.fallback_target):ee.enabled&&ee.style==="spinner"&&ee.target&&this.renderSpinnerOverlay(ee.target,ee.spinner,ee.fallback_target)}let x={},D={},U={},z={};this.currentWebSocketSubscriptions.length>0&&(P.log("Unsubscribing previous WebSocket subscriptions:",this.currentWebSocketSubscriptions),S.unsubscribeWebSockets(this.currentWebSocketSubscriptions),this.currentWebSocketSubscriptions=[]),this.currentDataSources=_,this.currentRawDataSources=d,this.currentRouteParams=e.params||{},this.currentQueryParams=g,P.log(`handleRouteChange #${n} - queryObject:`,f),P.log(`handleRouteChange #${n} - queryParams:`,g.toString()),A.length>0&&(P.log("Fetching blocking data sources:",A.map(ge=>ge.id)),(await S.fetchDataSourcesWithResults(A,e.params||{},g)).forEach(ge=>{if(ge.state==="success"&&ge.data!==void 0)x[ge.id]=ge.data;else if(ge.state==="error"&&ge.error){const N=ge.error,T=N.response?.data?.message;D[ge.id]={message:T||ge.error.message,status:N.response?.status||N.status}}}),this.processInitOptions(A,x,U,z),this.currentFetchedData={...x},P.log("Blocking data loaded:",Object.keys(x)),Object.keys(D).length>0&&P.log("Data source errors:",D),Object.keys(U).length>0&&P.log("Local state init (blocking):",Object.keys(U)),Object.keys(z).length>0&&P.log("Isolated state init (blocking):",Object.keys(z)));const q=k.length>0;if(q&&(Hr.setPending(!0),P.log("Transition started before rendering")),n!==this.currentRouteChangeId){P.log("Route change cancelled after blocking data (newer request exists):",n);return}const{getState:X}=await Promise.resolve().then(()=>Ur),pe=X().currentDataContext||{},Ce=k.map(ee=>ee.id),ve={};if(q){Ce.forEach(ge=>{pe[ge]!==void 0?ve[ge]=pe[ge]:ve[ge]=void 0});const ee=Object.keys(ve).filter(ge=>ve[ge]!==void 0);ee.length>0&&P.log("Preserving previous progressive data:",ee),P.log("Progressive data sources initialized:",Ce)}const Le=l.defines||{},Ve={...ve,...e.params,...x,route:{...e.params||{},path:e.path},query:f,_global:{...this.globalState},_globalSetState:ee=>this.setGlobalState(ee),_dataSourceErrors:Object.keys(D).length>0?D:void 0,_localInit:Object.keys(U).length>0?U:void 0,_isolatedInit:Object.keys(z).length>0?z:void 0,_defines:Object.keys(Le).length>0?Le:void 0};if(l.computed&&Object.keys(l.computed).length>0){const ee=this.calculateComputed(l.computed,Ve);Object.keys(ee).length>0&&(Ve._computed=ee,this.globalState._computed=ee,P.log("Computed values calculated:",Object.keys(ee))),Ve._computedDefinitions=l.computed}const Fe=l.layout_name||e.layout;this.currentLayoutName!==""&&this.currentLayoutName!==Fe&&(P.log("_local reset due to layout change:",{from:this.currentLayoutName,to:Fe}),this.globalState._local={},vC()),this.currentLayoutName=Fe;const J=l.initLocal||l.state;if(J&&Object.keys(J).length>0){this.globalState._local||(this.globalState._local={});for(const[ee,ge]of Object.entries(J))this.globalState._local[ee]===void 0&&(this.globalState._local[ee]=JSON.parse(JSON.stringify(ge)));Ve._local={...this.globalState._local},P.log("initLocal applied to _local:",Object.keys(J))}if(l.initGlobal&&Object.keys(l.initGlobal).length>0){for(const[ee,ge]of Object.entries(l.initGlobal))this.globalState[ee]===void 0&&(this.globalState[ee]=JSON.parse(JSON.stringify(ge)));P.log("initGlobal applied to _global:",Object.keys(l.initGlobal))}if(l.initIsolated&&Object.keys(l.initIsolated).length>0){for(const[ee,ge]of Object.entries(l.initIsolated))z[ee]===void 0&&(z[ee]=JSON.parse(JSON.stringify(ge)));P.log("initIsolated applied:",Object.keys(l.initIsolated))}Ve._global={...this.globalState,layoutWarnings:l.warnings||[]};const de=l.initActions||l.init_actions;if(de&&de.length>0){await this.executeInitActions(de,Ve),P.log("initActions executed before render");const ee=this.globalState;if(ee._local){if(Object.keys(U).length>0){for(const[ge,N]of Object.entries(U))ee._local[ge]!==void 0?ee._local[ge]=this.deepMerge(ee._local[ge],N):ee._local[ge]=N;P.log("localInit merged into _local after initActions:",Object.keys(U))}Ve._local=ee._local,P.log("_local merged into dataContext:",ee._local)}if(Ve._global={...this.globalState,layoutWarnings:l.warnings||[]},P.log("_global merged into dataContext after initActions"),l.computed&&Object.keys(l.computed).length>0){const ge=this.calculateComputed(l.computed,Ve);Object.keys(ge).length>0&&(Ve._computed=ge,this.globalState._computed=ge,P.log("Computed values recalculated after init_actions:",Object.keys(ge)))}if(Object.keys(this.currentFetchedData).length>0){for(const[ge,N]of Object.entries(this.currentFetchedData))Ve[ge]=N;P.log("Fetched data sources merged into dataContext after initActions:",Object.keys(this.currentFetchedData))}}if(l.transition_overlay&&!this.skeletonOverlayContainer&&this.showTransitionOverlay(l.transition_overlay,l),await fs({containerId:"app",layoutJson:l,dataContext:Ve,translationContext:{templateId:this.config.templateId,locale:this.config.locale}}),P.log("Initial render complete with blocking data"),this.reattachSpinnerOverlay(),k.length>0){if(n!==this.currentRouteChangeId){P.log("Route change cancelled before progressive fetch (newer request exists):",n),Hr.setPending(!1),this.hideTransitionOverlay();return}P.log("Fetching progressive/background data sources:",k.map(N=>N.id));const{updateTemplateData:ee,getState:ge}=await Promise.resolve().then(()=>Ur);try{const N=k.map(async T=>{try{const he=(await S.fetchDataSourcesWithResults([T],e.params||{},g,this.globalState))[0];if(!he){P.log(`Data source ${T.id} skipped (no fetch result)`);return}if(n!==this.currentRouteChangeId){P.log(`Data source ${T.id} fetch cancelled (newer request exists)`);return}if(he.state==="success"&&he.data!==void 0){P.log(`Progressive data source loaded: ${T.id}`),this.currentFetchedData[T.id]=he.data;const Ae={};this.processInitOptions([T],{[T.id]:he.data},Ae);const te=ge();if(te.bindingEngine){const qe=[T.id];T.initGlobal&&qe.push("_global"),T.initLocal&&qe.push("_local"),te.bindingEngine.invalidateCacheByKeys(qe)}const we={[T.id]:he.data};Object.keys(Ae).length>0&&(we._localInit=Ae,Object.assign(U,Ae)),T.initGlobal&&(we._global={...this.globalState}),ee(we)}else if(he.state==="error"&&he.error){const Ae=he.error,te=Ae.response?.data?.message;D[T.id]={message:te||he.error.message,status:Ae.response?.status||Ae.status},P.log(`Progressive data source error: ${T.id}`,D[T.id]),ee({[T.id]:null,_dataSourceErrors:{...D}})}}catch(fe){P.error(`Failed to fetch data source: ${T.id}`,fe)}});if(await Promise.all(N),n!==this.currentRouteChangeId){P.log("Route change cancelled after progressive fetch (newer request exists):",n);return}P.log("All progressive data sources loaded")}finally{Hr.setPending(!1),this.hideTransitionOverlay()}}else this.hideTransitionOverlay();const Ne=_.filter(ee=>ee.type==="websocket");if(Ne.length>0){P.log("Subscribing WebSocket data sources:",Ne.map(T=>T.id));const{updateTemplateData:ee,getState:ge}=await Promise.resolve().then(()=>Ur),N={...this.currentFetchedData,...e.params,route:{...e.params||{},path:e.path},query:f,_global:{...this.globalState}};P.log("WebSocket binding context keys:",Object.keys(N)),this.currentWebSocketSubscriptions=S.subscribeWebSockets(_,(T,fe)=>{P.log(`WebSocket data received for: ${T}`,fe),this.currentFetchedData[T]=fe;const he=_.find(qe=>qe.id===T),Ae=ge();if(Ae.bindingEngine){const qe=[T];he?.initGlobal&&qe.push("_global"),he?.initLocal&&qe.push("_local"),Ae.bindingEngine.invalidateCacheByKeys(qe)}ee({[T]:fe});const we=_.find(qe=>qe.type==="websocket"&&(qe.target_source||qe.id)===T)?.onReceive;Array.isArray(we)&&we.length>0&&window.G7Core?.dispatch&&(async()=>{for(const ke of we)try{const ze=this.getActionDispatcher?.();ze&&await ze.dispatchAction(ke,{navigate:this.getRouter?.()?(Ct,it)=>this.getRouter().navigate(Ct,it):void 0,setState:Ct=>this.setGlobalState(Ct),state:this.globalState,data:{...this.globalState,$args:[fe],$event:fe},_isDispatchFallbackContext:!0})}catch(ze){P.error(`WebSocket onReceive action failed for ${T}:`,ze)}})()},N),P.log("WebSocket subscriptions established:",this.currentWebSocketSubscriptions)}P.log("Layout rendered successfully")}catch(a){P.error("Route change handling failed:",a),this.hideTransitionOverlay(),this.showRouteError(a)}}processInitOptions(e,n,a,i){e.some(u=>u.refetchOnMount===!0&&u.initLocal)&&(a._forceLocalInit=Date.now(),P.log("refetchOnMount detected, forcing local state init")),e.forEach(u=>{const d=n[u.id];if(!d)return;const f=d.data??d;if(u.initLocal){if(typeof u.initLocal=="string"){let g=f;if(u.initLocalDefaults&&typeof u.initLocalDefaults=="object"){const b=this.evaluateDefaults(u.initLocalDefaults,n);g={...b,...f},P.log(`initLocalDefaults applied for ${u.initLocal}:`,Object.keys(b))}const m=this.globalState._local?.[u.initLocal];m!==void 0&&typeof m=="object"&&typeof g=="object"?(a[u.initLocal]=this.deepMerge(m,g),P.log(`initLocal (merged): ${u.id}.data -> _local.${u.initLocal}`)):(a[u.initLocal]=g,P.log(`initLocal: ${u.id}.data -> _local.${u.initLocal}`))}else if(typeof u.initLocal=="object"&&u.initLocal.key){const{key:g,path:m}=u.initLocal;let b=m?this.extractValueByPathOrExpression(f,m,u.id):f;if(u.initLocalDefaults&&typeof u.initLocalDefaults=="object"){const S=this.evaluateDefaults(u.initLocalDefaults,n);b={...S,...b},P.log(`initLocalDefaults applied for ${g}:`,Object.keys(S))}const v=this.globalState._local?.[g];v!==void 0&&typeof v=="object"&&typeof b=="object"?(a[g]=this.deepMerge(v,b),P.log(`initLocal (merged): ${u.id}.data${m?"."+m:""} -> _local.${g}`)):(a[g]=b,P.log(`initLocal: ${u.id}.data${m?"."+m:""} -> _local.${g}`))}else if(typeof u.initLocal=="object"){const g=u.initLocal._merge||"deep",m=this.flattenNestedObjectToMappings(u.initLocal);for(const{targetPath:b,sourcePath:v}of m){const S=this.extractValueByPathOrExpression(f,v,u.id);if(b.includes(".")){const _=b.split(".")[0];a[_]===void 0&&this.globalState._local?.[_]!==void 0&&(a[_]=JSON.parse(JSON.stringify(this.globalState._local[_]))),this.setValueAtPath(a,b,S,g),P.log(`initLocal map (${g}): ${u.id} ${v} -> _local.${b}`)}else{const _=this.globalState._local?.[b];g==="replace"?(a[b]=S,P.log(`initLocal map (replace): ${u.id} ${v} -> _local.${b}`)):g==="shallow"?_!==void 0&&typeof _=="object"&&typeof S=="object"?(a[b]={..._,...S},P.log(`initLocal map (shallow): ${u.id} ${v} -> _local.${b}`)):(a[b]=S,P.log(`initLocal map: ${u.id} ${v} -> _local.${b}`)):_!==void 0&&typeof _=="object"&&typeof S=="object"?(a[b]=this.deepMerge(_,S),P.log(`initLocal map (deep): ${u.id} ${v} -> _local.${b}`)):(a[b]=S,P.log(`initLocal map: ${u.id} ${v} -> _local.${b}`))}}}}if(u.initGlobal)if(typeof u.initGlobal=="object"&&!Array.isArray(u.initGlobal)&&!("key"in u.initGlobal))for(const[m,b]of Object.entries(u.initGlobal)){if(typeof b!="string"){P.warn(`initGlobal map value must be string, got ${typeof b} for key ${m}`);continue}const v=this.extractValueByPathOrExpression(f,b,u.id),S=this.globalState[m];S!==void 0&&typeof S=="object"&&typeof v=="object"?(this.globalState[m]=this.deepMerge(S,v),P.log(`initGlobal map (merged): ${u.id} ${b} -> _global.${m}`)):(this.globalState[m]=v,P.log(`initGlobal map: ${u.id} ${b} -> _global.${m}`))}else{const m=Array.isArray(u.initGlobal)?u.initGlobal:[u.initGlobal];for(const b of m)if(typeof b=="string"){const v=this.globalState[b];v!==void 0&&typeof v=="object"&&typeof f=="object"?(this.globalState[b]=this.deepMerge(v,f),P.log(`initGlobal (merged): ${u.id}.data -> _global.${b}`)):(this.globalState[b]=f,P.log(`initGlobal: ${u.id}.data -> _global.${b}`))}else if(typeof b=="object"&&b.key){const{key:v,path:S}=b,_=S?this.extractValueByPathOrExpression(f,S,u.id):f,A=this.globalState[v];A!==void 0&&typeof A=="object"&&typeof _=="object"?(this.globalState[v]=this.deepMerge(A,_),P.log(`initGlobal (merged): ${u.id}.data${S?"."+S:""} -> _global.${v}`)):(this.globalState[v]=_,P.log(`initGlobal: ${u.id}.data${S?"."+S:""} -> _global.${v}`))}}if(i&&u.initIsolated){if(typeof u.initIsolated=="string"){const g=i[u.initIsolated];g!==void 0&&typeof g=="object"&&typeof f=="object"?(i[u.initIsolated]=this.deepMerge(g,f),P.log(`initIsolated (merged): ${u.id}.data -> _isolated.${u.initIsolated}`)):(i[u.initIsolated]=f,P.log(`initIsolated: ${u.id}.data -> _isolated.${u.initIsolated}`))}else if(typeof u.initIsolated=="object"&&u.initIsolated.key){const{key:g,path:m}=u.initIsolated,b=m?this.extractValueByPathOrExpression(f,m,u.id):f,v=i[g];v!==void 0&&typeof v=="object"&&typeof b=="object"?(i[g]=this.deepMerge(v,b),P.log(`initIsolated (merged): ${u.id}.data${m?"."+m:""} -> _isolated.${g}`)):(i[g]=b,P.log(`initIsolated: ${u.id}.data${m?"."+m:""} -> _isolated.${g}`))}else if(typeof u.initIsolated=="object")for(const[g,m]of Object.entries(u.initIsolated)){if(typeof m!="string"){P.warn(`initIsolated map value must be string, got ${typeof m} for key ${g}`);continue}const b=this.extractValueByPathOrExpression(f,m,u.id),v=i[g];v!==void 0&&typeof v=="object"&&typeof b=="object"?(i[g]=this.deepMerge(v,b),P.log(`initIsolated map (merged): ${u.id} ${m} -> _isolated.${g}`)):(i[g]=b,P.log(`initIsolated map: ${u.id} ${m} -> _isolated.${g}`))}}})}evaluateDefaults(e,n){const a={};for(const[i,l]of Object.entries(e))if(typeof l=="string"&&l.startsWith("{{")&&l.endsWith("}}")){const u=l.slice(2,-2).trim();a[i]=this.evaluateExpression(u,n)}else a[i]=l;return a}evaluateExpression(e,n){try{const a=e.split("??").map(i=>i.trim());for(const i of a){if(/^['"].*['"]$/.test(i))return i.slice(1,-1);if(i==="true")return!0;if(i==="false")return!1;if(/^-?\d+(\.\d+)?$/.test(i))return Number(i);const l=this.getNestedValue(n,i);if(l!=null)return l}return}catch(a){P.warn(`Expression evaluation failed: ${e}`,a);return}}getNestedValue(e,n){const a=n.replace(/\?\./g,".");let i=e;const l=a.split(/\.(?![^\[]*\])/).flatMap(u=>{const d=u.match(/^([^\[]*)((?:\[\d+\])*)$/);if(d){const[,f,g]=d,m=[];f&&m.push(f);const b=g.match(/\[\d+\]/g);return b&&m.push(...b),m}return[u]}).filter(u=>u!=="");for(const u of l){if(i==null)return;if(u.startsWith("[")&&u.endsWith("]")){const d=parseInt(u.slice(1,-1),10);i=i[d]}else i=i[u]}return i}extractValueByPathOrExpression(e,n,a){const i=n.match(/^\{\{(.+)\}\}$/);if(i){const l=i[1].trim(),u=new On,d={data:e,_global:this.globalState,_local:this.globalState._local||{}};try{const f=u.evaluateExpression(l,d);return P.log(`initLocal/initGlobal expression evaluated: ${n} -> `,f),f}catch(f){P.warn(`initLocal/initGlobal expression evaluation failed for ${a}:`,n,f);return}}return this.getNestedValue(e,n)}async loadLayoutScripts(e,n){const a=[];for(const i of e){if((i.if!==void 0||i.conditions!==void 0)&&!Qi({if:i.if,conditions:i.conditions},n,this.bindingEngine,`script:${i.id}`)){P.log(`Script skipped (condition not met): ${i.id}`);continue}if(document.getElementById(i.id)){P.log(`Script already loaded: ${i.id}`);continue}const u=new Promise((d,f)=>{const g=document.createElement("script");g.src=i.src,g.id=i.id,g.async=i.async??!0,g.onload=()=>{P.log(`Script loaded successfully: ${i.id}`),d()},g.onerror=()=>{P.warn(`Failed to load script: ${i.id} (${i.src})`),d()},document.head.appendChild(g)});a.push(u)}a.length>0&&(await Promise.all(a),P.log(`All scripts loaded: ${e.filter(i=>!document.getElementById(i.id)||a.length>0).map(i=>i.id).join(", ")}`))}evaluateScriptCondition(e,n){try{if(e.startsWith("{{")&&e.endsWith("}}")){const a=e.slice(2,-2).trim();return new Function("ctx",`
with(ctx) {
try {
return Boolean(${a});
} catch (e) {
return false;
}
}
`)(n)}return!!e}catch(a){return P.warn(`Failed to evaluate script condition: ${e}`,a),!1}}showInitError(e){if(od()){P.warn("Init failed while document is unloading — skipping error screen",e);return}const n=hy(e);gf.renderFromError("app",n,"초기화 실패",this.config.debug,{templateId:this.config.templateId,locale:this.config.locale},void 0,e)}showTransitionOverlay(e,n){const a=typeof e=="boolean"?{enabled:e,style:"opaque",target:void 0,skeleton:void 0,spinner:void 0}:{enabled:e.enabled,style:e.style||"opaque",target:e.target,skeleton:e.skeleton,spinner:e.spinner,fallback_target:e.fallback_target};if(!a.enabled)return;if(this.hideTransitionOverlay(),a.style==="skeleton"&&a.skeleton?.component&&a.target&&n){this.renderSkeletonOverlay(a.target,a.skeleton,n,a.fallback_target);return}if(a.style==="spinner"&&a.target){this.renderSpinnerOverlay(a.target,a.spinner,a.fallback_target);return}const i=document.documentElement.classList.contains("dark");let l,u="";switch(a.style){case"blur":l=i?"rgba(17,24,39,0.3)":"rgba(255,255,255,0.3)",u="backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);";break;case"fade":l=i?"rgba(17,24,39,0.8)":"rgba(255,255,255,0.8)";break;case"skeleton":l=i?"rgb(17,24,39)":"rgb(249,250,251)";break;default:l=i?"rgb(17,24,39)":"rgb(249,250,251)";break}if(a.target){const d=`#${CSS.escape(a.target)}`,f=document.createElement("style");f.id="g7-transition-overlay",f.textContent=`${d}{position:relative;z-index:0;}${d}::after{content:'';position:absolute;inset:0;background:${l};${u}z-index:2147483647;pointer-events:none;}`,document.head.appendChild(f),this.transitionOverlayEl=f}else{const d=document.createElement("div");d.id="g7-transition-overlay",d.setAttribute("aria-hidden","true"),d.style.position="fixed",d.style.inset="0",d.style.zIndex="9999",d.style.pointerEvents="none",d.style.background=l;for(const f of u.split(";")){const g=f.indexOf(":");g!==-1&&d.style.setProperty(f.slice(0,g).trim(),f.slice(g+1).trim())}document.body.appendChild(d),this.transitionOverlayEl=d}}hideTransitionOverlay(){this.transitionOverlayEl&&(this.transitionOverlayEl.remove(),this.transitionOverlayEl=null),this.hideSkeletonOverlay()}renderSkeletonOverlay(e,n,a,i){const u=hr.getInstance().getComponent(n.component);if(!u){P.log(`Skeleton component "${n.component}" not found in registry, falling back to opaque overlay`),this.showTransitionOverlay({enabled:!0,style:"opaque",target:e});return}let d=document.getElementById(e),f="target";if(!d&&i&&(d=document.getElementById(i),f="fallback"),d||(d=document.getElementById("app"),f="fullpage"),!d){P.log(`Skeleton overlay: no target found (target="#${e}", fallback="${i||"none"}"), falling back to opaque overlay`),this.showTransitionOverlay({enabled:!0,style:"opaque",target:e});return}this.hideSkeletonOverlay();const m=document.documentElement.classList.contains("dark")?"rgb(17,24,39)":"rgb(249,250,251)",b=f==="fullpage"?"app":f==="fallback"?i:e,v=`#${CSS.escape(b)}`,S=document.createElement("style");S.id="g7-skeleton-overlay-style",S.textContent=`${v}{position:relative;z-index:0;}${v}::after{content:'';position:absolute;inset:0;background:${m};z-index:2147483646;pointer-events:none;}`,document.head.appendChild(S),this.transitionOverlayEl=S;const _=document.createElement("div");if(_.id="g7-skeleton-overlay",_.setAttribute("role","status"),_.setAttribute("aria-busy","true"),_.setAttribute("aria-label","Loading..."),f==="fullpage")_.style.cssText=["position:fixed","inset:0","z-index:20","overflow:hidden","pointer-events:none",`background:${m}`].join(";")+";";else{const x=d.getBoundingClientRect(),D=window.scrollX||document.documentElement.scrollLeft,U=window.scrollY||document.documentElement.scrollTop;_.style.cssText=["position:absolute",`top:${x.top+U}px`,`left:${x.left+D}px`,`width:${x.width}px`,`height:${x.height}px`,"z-index:20","overflow:hidden","pointer-events:none",`background:${m}`].join(";")+";"}document.body.appendChild(_),this.skeletonOverlayContainer=_;const A=a.components||[];let k;if(f==="fullpage")k=A;else{const x=f==="fallback"?i:e;k=this.findComponentChildrenById(A,x)}const O=nd.createRoot(_);this.skeletonOverlayRoot=O,Aa.flushSync(()=>{O.render(Xe.createElement(u,{components:k,options:{animation:n.animation||"pulse",iteration_count:n.iteration_count||5}}))});const M=f==="fullpage"?"fullpage (#app)":f==="fallback"?`fallback (#${i})`:`target (#${e})`;P.log(`Skeleton overlay rendered [${M}] with "${n.component}" (${k.length} components)`)}findComponentChildrenById(e,n){const a=i=>{for(const l of i){if(l.id===n)return l.children||[];if(l.children&&Array.isArray(l.children)){const u=a(l.children);if(u!==null)return u}}return null};return a(e)||e}renderSpinnerOverlay(e,n,a){let i=document.getElementById(e),l="target";if(!i&&a&&(i=document.getElementById(a),l="fallback"),i||(i=document.getElementById("app"),l="fullpage"),!i){P.log(`Spinner overlay: no target found (target="#${e}", fallback="${a||"none"}"), falling back to opaque overlay`),this.showTransitionOverlay({enabled:!0,style:"opaque",target:e});return}this.hideSkeletonOverlay();const u=l==="fullpage"?"app":l==="fallback"?a:e,d=`#${CSS.escape(u)}`,f=document.createElement("style");f.id="g7-skeleton-overlay-style",f.textContent=[`${d}{position:relative;}`,"@keyframes g7-spin{to{transform:rotate(360deg)}}"].join(""),document.head.appendChild(f),this.transitionOverlayEl=f;const g=n?.text||window.G7Core?.t?.("nav.loading")||"";this._spinnerState={target:e,fallbackTarget:a,spinnerConfig:n,resolvedText:g},this._mountSpinnerInTarget(i);const m=l==="fullpage"?"fullpage (#app)":l==="fallback"?`fallback (#${a})`:`target (#${e})`,b=n?.component||"default spinner";P.log(`Spinner overlay rendered [${m}] with "${b}"`)}_mountSpinnerInTarget(e){if(!this._spinnerState)return;const{spinnerConfig:n,resolvedText:a}=this._spinnerState;if(this.skeletonOverlayRoot){try{this.skeletonOverlayRoot.unmount()}catch{}this.skeletonOverlayRoot=null}if(this.skeletonOverlayContainer){try{this.skeletonOverlayContainer.remove()}catch{}this.skeletonOverlayContainer=null}const i=document.createElement("div");if(i.id="g7-skeleton-overlay",i.setAttribute("role","status"),i.setAttribute("aria-busy","true"),e.appendChild(i),this.skeletonOverlayContainer=i,n?.component){const u=hr.getInstance().getComponent(n.component);if(u){const d=nd.createRoot(i);this.skeletonOverlayRoot=d,Aa.flushSync(()=>{d.render(Xe.createElement(u,{options:{text:a}}))});return}P.log(`Spinner component "${n.component}" not found in registry, using default spinner`)}i.innerHTML='<div style="position:absolute;inset:0;z-index:2147483647;overflow:hidden;background:var(--g7-overlay-bg, rgb(249,250,251));display:flex;align-items:center;justify-content:center;"><div style="width:32px;height:32px;border:3px solid var(--g7-spinner-color, #9ca3af);border-top-color:transparent;border-radius:50%;animation:g7-spin 0.8s linear infinite;"></div></div>'}reattachSpinnerOverlay(){if(!this._spinnerState)return;const{target:e,fallbackTarget:n}=this._spinnerState;let a=document.getElementById(e);!a&&n&&(a=document.getElementById(n)),a||(a=document.getElementById("app")),a&&(this._mountSpinnerInTarget(a),P.log("Spinner overlay reattached to new DOM target"))}hideSkeletonOverlay(){if(this.skeletonOverlayRoot){try{this.skeletonOverlayRoot.unmount()}catch{}this.skeletonOverlayRoot=null}if(this.skeletonOverlayContainer){try{this.skeletonOverlayContainer.parentNode&&this.skeletonOverlayContainer.remove()}catch{}this.skeletonOverlayContainer=null}const e=document.getElementById("g7-skeleton-overlay-style");e&&e.remove(),this._spinnerState=null}showRouteError(e){if(e instanceof Sr&&e.details?.status===401){const a=this.config.templateId||"",i=window.location.pathname,l=a.includes("admin")||i.startsWith("/admin")?"admin":"user",u=i+window.location.search,d=!!Ir().getToken()||e.details?.hadToken===!0,f=pr.getInstance().getLoginRedirectUrl(l,u,d?"session_expired":void 0);window.location.href=f;return}const n=hy(e);gf.renderFromError("app",n,"페이지 로딩 실패",this.config.debug,{templateId:this.config.templateId,locale:this.config.locale},void 0,e)}async handleServerError(){const e=window.G7Error;if(!e)return!1;P.warn("Server error detected:",e);try{return this.errorPageHandler&&(e.data&&(this.globalState.errorData=e.data),this.errorPageHandler.updateGlobalState(this.globalState),this.errorPageHandler.updateLocale(this.config.locale),await this.errorPageHandler.renderError(e.code,"app"))?(P.log(`${e.code} error page rendered successfully`),!0):(P.log(`Falling back to ErrorDisplay for ${e.code}`),this.showInitError(new Error(`Service unavailable (${e.code})`)),!0)}catch(n){return P.error(`Failed to render ${e.code} page:`,n),this.showInitError(new Error(`Service unavailable (${e.code})`)),!0}}async handleRouteNotFound(e){P.warn("Route not found:",e);try{if(this.errorPageHandler&&(this.errorPageHandler.updateGlobalState(this.globalState),this.errorPageHandler.updateLocale(this.config.locale),await this.errorPageHandler.renderError(404,"app"))){P.log("404 error page rendered successfully");return}P.log("Falling back to ErrorDisplay for 404"),this.showRouteError(new Error(`Page not found: ${e}`))}catch(n){P.error("Failed to render 404 page:",n),this.showRouteError(new Error(`Page not found: ${e}`))}}getRouter(){return this.router}getConfig(){return this.config}getLayoutLoader(){return this.layoutLoader}async reloadExtensionState(){P.log("reloadExtensionState: start");let e;try{const n=await fetch(Mr(`/api/templates/${this.config.templateId}/config`,"json",null,`_=${Date.now()}`));if(n.ok){const a=await n.json();a?.success&&a?.data?.cache_version!==void 0&&(e=a.data.cache_version)}}catch(n){P.warn("reloadExtensionState: failed to fetch config.json",n)}e!==void 0&&e!==this.extensionCacheVersion&&(P.log(`reloadExtensionState: cache version ${this.extensionCacheVersion} -> ${e}`),this.extensionCacheVersion=e,this.saveCacheVersionToStorage(e));try{this.router&&(await this.router.loadRoutes(this.extensionCacheVersion),P.log("reloadExtensionState: routes reloaded"))}catch(n){P.error("reloadExtensionState: routes reload failed",n)}try{this.layoutLoader&&(this.extensionCacheVersion>0&&this.layoutLoader.setCacheVersion(this.extensionCacheVersion),this.layoutLoader.clear(),P.log("reloadExtensionState: layout cache cleared"))}catch(n){P.error("reloadExtensionState: layout cache clear failed",n)}try{const{TranslationEngine:n}=await Promise.resolve().then(()=>sp),a=n.getInstance();this.extensionCacheVersion>0&&a.setCacheVersion(this.extensionCacheVersion);const i=this.config.locale||"ko",l="en";await a.loadTranslations(this.config.templateId,i,"/api",!0),i!==l&&await a.loadTranslations(this.config.templateId,l,"/api",!0),P.log("reloadExtensionState: translations reloaded")}catch(n){P.error("reloadExtensionState: translations reload failed",n)}try{const n=await fetch(`/api/locales/active?_=${Date.now()}`);if(n.ok){const i=(await n.json())?.data?.locales;if(Array.isArray(i)&&i.length>0){const l=this.globalState.appConfig??{};this.setGlobalState({appConfig:{...l,supportedLocales:i}}),P.log("reloadExtensionState: supportedLocales refreshed",i)}}}catch(n){P.warn("reloadExtensionState: supportedLocales refresh failed",n)}P.log("reloadExtensionState: done")}getActionDispatcher(){return Zr().actionDispatcher}async changeLocale(e){try{if(P.log("Changing locale to:",e),this.config.locale===e){P.log("Locale is already",e);return}this.config.locale=e,this.saveLocaleToStorage(e),await this.saveLocaleToDatabase(e),this.layoutLoader&&(this.layoutLoader.clear(),P.log("Layout cache cleared")),this.errorPageHandler&&(this.errorPageHandler.updateLocale(e),P.log("ErrorPageHandler locale updated")),wc(),await ko({templateId:this.config.templateId,templateType:this.config.templateType,locale:e,debug:this.config.debug,cacheVersion:this.extensionCacheVersion}),P.log("Template Engine re-initialized with new locale");const{getActionDispatcher:n}=await Promise.resolve().then(()=>Ur),a=n();a&&(a.setDefaultContext({navigate:i=>this.router?.navigate(i)}),a.setGlobalStateUpdater((i,l)=>this.setGlobalState(i,l)),P.log("Navigate function and setGlobalState re-injected to ActionDispatcher")),this.reinitializeModuleHandlers(),P.log("Module handlers re-initialized"),this.reinitializeTemplateHandlers(),P.log("Template handlers re-initialized"),this.reinitializePluginHandlers(),P.log("Plugin handlers re-initialized"),this.router&&this.router.navigateToCurrentPath(),P.log("Locale changed successfully to",e)}catch(n){throw P.error("Failed to change locale:",n),n}}loadLocaleFromStorage(){try{return localStorage.getItem(_r.LOCALE_STORAGE_KEY)}catch(e){return P.warn("Failed to load locale from storage:",e),null}}saveLocaleToStorage(e){try{localStorage.setItem(_r.LOCALE_STORAGE_KEY,e)}catch(n){P.warn("Failed to save locale to storage:",n)}}async saveLocaleToDatabase(e){const n=localStorage.getItem("auth_token");if(!n){P.log("No auth token, skipping DB locale save");return}let a,i;if(this.config.localeApi)a=this.config.localeApi.endpoint,i=this.config.localeApi.method;else{const l=this.config.templateType==="admin";a=l?"/api/admin/users/me/language":"/api/user/profile/update-language",i=l?"PATCH":"POST"}try{const l=this.getXsrfToken(),u=await fetch(a,{method:i,headers:{"Content-Type":"application/json",Accept:"application/json",...l&&{"X-XSRF-TOKEN":l},Authorization:`Bearer ${n}`},credentials:"include",body:JSON.stringify({language:e})});u.ok?P.log("Locale saved to DB:",e):P.warn("Failed to save locale to DB (UI will still change):",u.statusText)}catch(l){P.warn("Failed to call locale API (UI will still change):",l)}}getXsrfToken(){if(typeof document>"u")return null;const n=`; ${document.cookie}`.split("; XSRF-TOKEN=");return n.length===2?decodeURIComponent(n.pop()?.split(";").shift()||""):null}loadCacheVersionFromStorage(){try{const e=localStorage.getItem(_r.CACHE_VERSION_STORAGE_KEY);return e?parseInt(e,10):null}catch(e){return P.warn("Failed to load cache version from storage:",e),null}}saveCacheVersionToStorage(e){try{localStorage.setItem(_r.CACHE_VERSION_STORAGE_KEY,String(e))}catch(n){P.warn("Failed to save cache version to storage:",n)}}reinitializeModuleHandlers(){if(typeof window>"u")return;const e="__",n=window;Object.keys(n).forEach(a=>{if(a.startsWith(e)&&typeof n[a]?.initModule=="function")try{n[a].initModule(),P.log(`Module handler re-initialized: ${a}`)}catch(i){P.warn(`Failed to re-initialize module handlers for ${a}:`,i)}})}reinitializeTemplateHandlers(){if(typeof window>"u")return;const e=window.G7TemplateHandlers;if(!e){P.warn("Template handlers not found on window.G7TemplateHandlers");return}const n=this.getActionDispatcher();if(!n){P.warn("ActionDispatcher not available for template handler registration");return}Object.entries(e).forEach(([a,i])=>{n.registerHandler(a,i)}),P.log(`${Object.keys(e).length} template handler(s) re-registered:`,Object.keys(e))}reinitializePluginHandlers(){if(typeof window>"u")return;const e="__",n=window;Object.keys(n).forEach(a=>{if(a.startsWith(e)&&typeof n[a]?.initPlugin=="function")try{n[a].initPlugin(),P.log(`Plugin handler re-initialized: ${a}`)}catch(i){P.warn(`Failed to re-initialize plugin handlers for ${a}:`,i)}})}getLocale(){return this.config.locale}getErrorPageHandler(){return this.errorPageHandler}getGlobalState(){return{...this.globalState}}setGlobalState(e,n){const a={...this.globalState};typeof e=="function"?this.globalState=e(this.globalState):this.globalState={...this.globalState,...e},P.log("Global state updated:",this.globalState),window.G7Core?.devTools?.captureStateSnapshot?.({source:"setGlobalState",prev:a,next:this.globalState}),this.globalStateListeners.forEach(l=>{l(this.globalState)}),n?.render!==!1&&Promise.resolve().then(()=>Ur).then(({updateTemplateData:l,getState:u})=>{const d=u();d.reactRoot&&d.currentLayoutJson&&l({_global:{...this.globalState},_local:this.globalState._local||{}})})}onGlobalStateChange(e){this.globalStateListeners.add(e)}offGlobalStateChange(e){this.globalStateListeners.delete(e)}async refetchDataSource(e,n){let a=this.currentDataSources.find(i=>i.id===e);if(!a)for(const[,i]of this.modalDataSources){const l=i.find(u=>u.id===e);if(l){a=l;break}}if(!a){P.warn(`Data source not found: ${e}`);return}P.log(`Refetching data source: ${e}`,n?.sync?"(sync mode)":"",n?.globalStateOverride?"(with global override)":"",n?.localStateOverride?"(with local override)":""),Hr.setPending(!0);try{const i=new wr;this.currentGlobalHeaders.length>0&&i.setGlobalHeaders(this.currentGlobalHeaders);const l=Zr(),u=l.currentDataContext?._global||{},d=n?.globalStateOverride?{...u,...n.globalStateOverride}:u,f=l.currentDataContext?._local||{},g=n?.localStateOverride?{...f,...n.localStateOverride}:f,b=(await i.fetchDataSourcesWithResults([a],this.currentRouteParams,this.currentQueryParams,d,g,{ignoreAutoFetch:!0}))[0];if(b.state==="success"&&b.data!==void 0){this.currentFetchedData[e]=b.data;const v={};this.processInitOptions([a],{[e]:b.data},v);const S=Zr();if(S.bindingEngine){const A=[e];a.initGlobal&&A.push("_global"),a.initLocal&&A.push("_local"),S.bindingEngine.invalidateCacheByKeys(A)}const _={[e]:b.data};return Object.keys(v).length>0&&(_._localInit=v),a.initGlobal&&(_._global={...this.globalState}),hs(_,n?.sync?{sync:!0}:void 0),P.log(`Data source refetched successfully: ${e}`),b.data}else if(b.state==="error"){P.error(`Failed to refetch data source: ${e}`,b.error);return}}catch(i){P.error(`Error refetching data source: ${e}`,i);return}finally{Hr.setPending(!1)}}registerModalDataSources(e,n){this.modalDataSources.set(e,n),P.log(`Modal data sources registered: ${e} (${n.length} sources)`)}unregisterModalDataSources(e){this.modalDataSources.delete(e),P.log(`Modal data sources unregistered: ${e}`)}getDataSource(e){return this.currentFetchedData[e]}setDataSource(e,n,a){if(!e){P.warn("setDataSource: dataSourceId is required");return}const{merge:i=!1,sync:l=!1}=a||{};i&&this.currentFetchedData[e]?this.currentFetchedData[e]={...this.currentFetchedData[e],...n}:this.currentFetchedData[e]=n,Promise.resolve().then(()=>Ur).then(({updateTemplateData:u})=>{u({[e]:this.currentFetchedData[e]},l?{sync:!0}:void 0)}),P.log(`setDataSource: Updated ${e}`,i?"(merged)":"(replaced)")}updateDataSourceItem(e,n,a,i,l){const{idField:u="id",merge:d=!0,skipRender:f=!1}=l||{},g=this.currentFetchedData[e];if(!g)return P.warn(`updateDataSourceItem: DataSource '${e}' not found`),!1;const m=this.parseItemPath(n);let b=g;for(const _ of m)if(b=b?.[_],b===void 0)return P.warn(`updateDataSourceItem: Path '${n}' not found in dataSource`),!1;if(!Array.isArray(b))return P.warn(`updateDataSourceItem: Target at '${n}' is not an array`),!1;const v=b.findIndex(_=>String(_[u])===String(a));if(v===-1)return P.warn(`updateDataSourceItem: Item with ${u}='${a}' not found`),!1;d?b[v]=this.deepMerge(b[v],i):b[v]={...b[v],...i};const S=window.G7Core?.devTools;return S?.isEnabled?.()&&S.trackDataSourceUpdate?.({dataSourceId:e,updateType:"partial",itemPath:n,itemId:a,updates:i,timestamp:Date.now()}),f||Promise.resolve().then(()=>Ur).then(({updateTemplateData:_})=>{_({[e]:this.currentFetchedData[e]},{sync:!1})}),P.log(`updateDataSourceItem: Updated ${e}.${n}[${u}=${a}]`),!0}parseItemPath(e){const n=[],a=/([^\.\[\]]+)|\[(\d+)\]/g;let i;for(;(i=a.exec(e))!==null;)i[1]!==void 0?n.push(i[1]):i[2]!==void 0&&n.push(parseInt(i[2],10));return n}deepMerge(e,n){if(n==null)return e;if(typeof n!="object"||Array.isArray(n))return n;const a={...e};for(const i of Object.keys(n))typeof n[i]=="object"&&n[i]!==null&&!Array.isArray(n[i])?a[i]=this.deepMerge(a[i]||{},n[i]):a[i]=n[i];return a}setValueAtPath(e,n,a,i="deep"){const l=n.split(".");let u=e;for(let g=0;g<l.length-1;g++){const m=l[g];(u[m]===void 0||u[m]===null||typeof u[m]!="object")&&(u[m]={}),u=u[m]}const d=l[l.length-1],f=u[d];i==="replace"||f===void 0?u[d]=a:i==="shallow"?typeof f=="object"&&typeof a=="object"&&!Array.isArray(a)?u[d]={...f,...a}:u[d]=a:typeof f=="object"&&typeof a=="object"&&!Array.isArray(a)?u[d]=this.deepMerge(f,a):u[d]=a}flattenNestedObjectToMappings(e,n=""){const a=[];for(const[i,l]of Object.entries(e)){if(i==="_merge")continue;const u=n?`${n}.${i}`:i;typeof l=="string"?a.push({targetPath:u,sourcePath:l}):typeof l=="object"&&l!==null&&!Array.isArray(l)&&a.push(...this.flattenNestedObjectToMappings(l,u))}return a}async updateQueryParams(e,n){P.log("updateQueryParams:",e);const a=new URL(e,window.location.origin),i=new URLSearchParams(a.search);window.history.replaceState(null,"",e),P.log("URL updated via replaceState"),this.currentQueryParams=i,P.log("currentQueryParams updated:",Object.fromEntries(i.entries()));const l=new wr,u=Zr().currentDataContext?._global||this.globalState||{},d={route:this.currentRouteParams||{},query:py(this.currentQueryParams),_global:u},f=Array.isArray(this.currentRawDataSources)&&this.currentRawDataSources.length>0?l.filterByCondition(this.currentRawDataSources,d):this.currentDataSources;this.currentDataSources=f;const g=f.filter(A=>A.auto_fetch!==!1&&A.type!=="websocket");if(g.length===0){P.log("No auto_fetch data sources to refetch");return}P.log(`Refetching ${g.length} auto_fetch data sources`),Hr.setPending(!0);const m=Zr().currentLayoutJson,b=m?.transition_overlay,v=Array.isArray(b?.wait_for)?b.wait_for:[],S=g.some(A=>(A.loading_strategy||"progressive")==="blocking"),_=v.length>0&&g.some(A=>v.includes(A.id)&&A.type!=="websocket"&&(A.loading_strategy||"progressive")!=="background");if((S||_)&&b&&typeof b=="object"){const A=n?.transitionOverlayTarget||b.target;b.enabled&&b.style==="skeleton"&&b.skeleton?.component&&A?this.renderSkeletonOverlay(A,b.skeleton,m,b.fallback_target):b.enabled&&b.style==="spinner"&&A&&this.renderSpinnerOverlay(A,b.spinner,b.fallback_target)}try{const A=new wr;this.currentGlobalHeaders.length>0&&A.setGlobalHeaders(this.currentGlobalHeaders);const k=Zr(),O=k.currentDataContext?._global||{},M=await A.fetchDataSourcesWithResults(g,this.currentRouteParams,this.currentQueryParams,O,void 0,{ignoreAutoFetch:!1}),x={},D={},U=new Map(g.map(z=>[z.id,z]));for(const z of M){const q=U.get(z.id);if(!q){P.warn(`Refetch result id not found in autoFetchDataSources: ${z.id}`);continue}const X=z.id;z.state==="success"&&z.data!==void 0?(this.currentFetchedData[X]=z.data,x[X]=z.data,this.processInitOptions([q],{[X]:z.data},D),P.log(`Data source refetched: ${X}`)):z.state==="error"&&P.error(`Failed to refetch data source: ${X}`,z.error)}if(k.bindingEngine){const z=Object.keys(x);z.push("query"),k.bindingEngine.invalidateCacheByKeys(z)}if(Object.keys(D).length>0&&(x._localInit=D),Object.keys(x).length>0){if(x.query=py(this.currentQueryParams),k.currentLayoutJson?.computed&&Object.keys(k.currentLayoutJson.computed).length>0){const z={...k.currentDataContext,...x,query:x.query},q=this.calculateComputed(k.currentLayoutJson.computed,z);Object.keys(q).length>0&&(x._computed=q,this.globalState._computed=q,P.log("Computed values recalculated in updateQueryParams:",Object.keys(q)))}hs(x,{sync:!0}),P.log("Template data updated with new query params")}}catch(A){P.error("Error in updateQueryParams:",A)}finally{Hr.setPending(!1),this.hideTransitionOverlay()}}calculateComputed(e,n){const a={},i=new On;for(const[l,u]of Object.entries(e))try{let d;if(this.isComputedSwitchDefinition(u))d=i.resolveSwitch(u,n,{skipCache:!0});else if(typeof u=="string")if(u.startsWith("{{")&&u.endsWith("}}")){const f=u.slice(2,-2).trim();d=this.evaluateComputedExpression(f,n)}else d=u;a[l]=d,P.log(`Computed ${l}:`,d)}catch(d){P.warn(`Failed to calculate computed value: ${l}`,d),a[l]=void 0}return a}isComputedSwitchDefinition(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&"$switch"in e&&"$cases"in e}evaluateComputedExpression(e,n){try{return new Function("ctx",`
with(ctx) {
try {
return ${e};
} catch (e) {
return undefined;
}
}
`)(n)}catch(a){P.warn(`Expression evaluation failed: ${e}`,a);return}}async executeInitActions(e,n={}){const{getActionDispatcher:a}=await Promise.resolve().then(()=>Ur),i=a();if(!i){P.warn("ActionDispatcher not available for init_actions");return}P.log("Executing init_actions:",e.map(d=>d.handler)),P.log("Init actions dataContext:",n),P.log("Init actions dataContext._global:",n._global);const l=e.map(d=>d.handler).filter(d=>d.includes("."));l.length>0&&await this.waitForHandlers(i,l);let u={...n};for(const d of e)try{const f={type:"click",handler:d.handler,target:d.target,params:d.params,resultTo:d.resultTo,onSuccess:d.onSuccess,onError:d.onError,if:d.if,conditions:d.conditions,auth_mode:d.auth_mode,auth_required:d.auth_required},g=i.createHandler(f,u),m=new Event("init");await g(m),P.log(`Init action executed: ${d.handler}`);const b=this.globalState;u={...u,_global:{...b},_local:b._local||u._local||{}},P.log(`Data context refreshed after ${d.handler}:`,{cartKey:u._global?.cartKey})}catch(f){P.error(`Failed to execute init action: ${d.handler}`,f)}}async waitForHandlers(e,n,a=5e3){const i=Date.now(),l=50,u=()=>n.every(f=>e.customHandlers?.has(f));if(u()){P.log("All module handlers already registered");return}const d=mf().getFailedJsAssets();if(d.length>0){const f=d.some(b=>b==="module"||b==="plugin"),g=n.filter(b=>!e.customHandlers?.has(b)),m=g.length>0&&g.every(b=>d.some(v=>b.startsWith(`${v}.`)));if(f||m){P.warn("Extension asset load failed — not waiting for handlers that will never register:",{pending:g,failedAssets:d});return}}return P.log("Waiting for module handlers:",n),new Promise(f=>{const g=()=>{if(u()){P.log("All module handlers now registered"),f();return}if(Date.now()-i>=a){const m=n.filter(b=>!e.customHandlers?.has(b));P.warn("Timeout waiting for handlers:",m),f();return}setTimeout(g,l)};g()})}};$(_r,"LOCALE_STORAGE_KEY","g7_locale"),$(_r,"CACHE_VERSION_STORAGE_KEY","g7_cache_version");let _o=_r;function bf(o){const e=new _o(o);return o.websocket&&(yc.configure(o.websocket),P.log("WebSocket 설정 완료")),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{e.init(),window.__templateApp=e}):(e.init(),window.__templateApp=e),e}typeof window<"u"&&(window.G7Core=window.G7Core||{},window.G7Core.initTemplateApp=bf,window.G7Core.dataSource={refetch:async(o,e)=>{const n=window.__templateApp;if(!n){P.warn("TemplateApp not initialized (G7Core.dataSource.refetch)");return}return n.refetchDataSource(o,e)},get:o=>{const e=window.__templateApp;if(!e){P.warn("TemplateApp not initialized (G7Core.dataSource.get)");return}return e.getDataSource(o)}});function dA(o={}){const{checked:e,value:n,name:a,type:i="checkbox"}=o,u=n!==void 0?n:i==="checkbox"||i==="radio"?e??!1:String(e??""),d={checked:e??!1,value:u,name:a??"",type:i};return{target:d,currentTarget:d,preventDefault:()=>{},stopPropagation:()=>{},nativeEvent:new Event("change"),bubbles:!0,cancelable:!0,defaultPrevented:!1,eventPhase:Event.AT_TARGET,isTrusted:!1,timeStamp:Date.now(),type:"change",isDefaultPrevented:()=>!1,isPropagationStopped:()=>!1,persist:()=>{}}}function fA(o={}){const{button:e=0,clientX:n=0,clientY:a=0}=o;return{button:e,clientX:n,clientY:a,preventDefault:()=>{},stopPropagation:()=>{},nativeEvent:new MouseEvent("click"),bubbles:!0,cancelable:!0,defaultPrevented:!1,eventPhase:Event.AT_TARGET,isTrusted:!1,timeStamp:Date.now(),type:"click",isDefaultPrevented:()=>!1,isPropagationStopped:()=>!1,persist:()=>{},target:document.createElement("div"),currentTarget:document.createElement("div")}}function hA(){return{preventDefault:()=>{},stopPropagation:()=>{},nativeEvent:new Event("submit"),bubbles:!0,cancelable:!0,defaultPrevented:!1,eventPhase:Event.AT_TARGET,isTrusted:!1,timeStamp:Date.now(),type:"submit",isDefaultPrevented:()=>!1,isPropagationStopped:()=>!1,persist:()=>{},target:document.createElement("form"),currentTarget:document.createElement("form")}}function gA(o,e="keydown"){return{key:o,code:o.length===1?`Key${o.toUpperCase()}`:o,preventDefault:()=>{},stopPropagation:()=>{},nativeEvent:new KeyboardEvent(e,{key:o}),bubbles:!0,cancelable:!0,defaultPrevented:!1,eventPhase:Event.AT_TARGET,isTrusted:!1,timeStamp:Date.now(),type:e,isDefaultPrevented:()=>!1,isPropagationStopped:()=>!1,persist:()=>{},target:document.createElement("div"),currentTarget:document.createElement("div"),altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,repeat:!1}}const pA={justify:/^justify-(start|end|center|between|around|evenly)$/,items:/^items-(start|end|center|baseline|stretch)$/,content:/^content-(start|end|center|between|around|evenly|stretch)$/,self:/^self-(auto|start|end|center|stretch|baseline)$/,flex:/^flex-(row|row-reverse|col|col-reverse|wrap|wrap-reverse|nowrap|1|auto|initial|none)$/,grow:/^(grow|grow-0)$/,shrink:/^(shrink|shrink-0)$/,basis:/^basis-/,order:/^(order-|-)order-/,gap:/^gap(-x|-y)?-/,gridCols:/^grid-cols-/,gridRows:/^grid-rows-/,colSpan:/^col-(span-|start-|end-)/,rowSpan:/^row-(span-|start-|end-)/,display:/^(block|inline-block|inline|flex|inline-flex|table|inline-table|table-caption|table-cell|table-column|table-column-group|table-footer-group|table-header-group|table-row-group|table-row|flow-root|grid|inline-grid|contents|list-item|hidden)$/,position:/^(static|fixed|absolute|relative|sticky)$/,inset:/^(inset|top|right|bottom|left)-/,zIndex:/^z-/,width:/^w-/,minWidth:/^min-w-/,maxWidth:/^max-w-/,height:/^h-/,minHeight:/^min-h-/,maxHeight:/^max-h-/,padding:/^p[xytblr]?-/,margin:/^-?m[xytblr]?-/,space:/^space-(x|y)-/,fontSize:/^text-(xs|sm|base|lg|xl|2xl|3xl|4xl|5xl|6xl|7xl|8xl|9xl)$/,fontWeight:/^font-(thin|extralight|light|normal|medium|semibold|bold|extrabold|black)$/,fontStyle:/^(italic|not-italic)$/,fontFamily:/^font-(sans|serif|mono)/,textAlign:/^text-(left|center|right|justify|start|end)$/,textColor:/^text-(inherit|current|transparent|black|white|slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-/,textDecoration:/^(underline|overline|line-through|no-underline)$/,textTransform:/^(uppercase|lowercase|capitalize|normal-case)$/,lineHeight:/^leading-/,letterSpacing:/^tracking-/,textOverflow:/^(truncate|text-ellipsis|text-clip)$/,whitespace:/^whitespace-/,wordBreak:/^break-/,bgColor:/^bg-(inherit|current|transparent|black|white|slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-/,bgGradient:/^bg-gradient-/,bgSize:/^bg-(auto|cover|contain)$/,bgPosition:/^bg-(bottom|center|left|left-bottom|left-top|right|right-bottom|right-top|top)$/,bgRepeat:/^bg-(repeat|no-repeat|repeat-x|repeat-y|repeat-round|repeat-space)$/,bgAttachment:/^bg-(fixed|local|scroll)$/,bgClip:/^bg-clip-/,bgOrigin:/^bg-origin-/,borderWidth:/^border(-[xytblr])?(-0|-2|-4|-8)?$/,borderColor:/^border-(inherit|current|transparent|black|white|slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-/,borderStyle:/^border-(solid|dashed|dotted|double|hidden|none)$/,borderRadius:/^rounded(-[tblrse]{1,2})?(-none|-sm|-md|-lg|-xl|-2xl|-3xl|-full)?$/,ringWidth:/^ring(-0|-1|-2|-4|-8|-inset)?$/,ringColor:/^ring-(inherit|current|transparent|black|white|slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-/,ringOffset:/^ring-offset-/,shadow:/^shadow(-sm|-md|-lg|-xl|-2xl|-inner|-none)?$/,opacity:/^opacity-/,mixBlend:/^mix-blend-/,bgBlend:/^bg-blend-/,blur:/^blur(-none|-sm|-md|-lg|-xl|-2xl|-3xl)?$/,brightness:/^brightness-/,contrast:/^contrast-/,grayscale:/^grayscale(-0)?$/,hueRotate:/^-?hue-rotate-/,invert:/^invert(-0)?$/,saturate:/^saturate-/,sepia:/^sepia(-0)?$/,backdropBlur:/^backdrop-blur-/,backdropBrightness:/^backdrop-brightness-/,backdropContrast:/^backdrop-contrast-/,backdropGrayscale:/^backdrop-grayscale-/,backdropHueRotate:/^backdrop-hue-rotate-/,backdropInvert:/^backdrop-invert-/,backdropOpacity:/^backdrop-opacity-/,backdropSaturate:/^backdrop-saturate-/,backdropSepia:/^backdrop-sepia-/,scale:/^scale(-x|-y)?-/,rotate:/^-?rotate-/,translate:/^-?translate-[xy]-/,skew:/^-?skew-[xy]-/,transformOrigin:/^origin-/,transition:/^transition(-none|-all|-colors|-opacity|-shadow|-transform)?$/,duration:/^duration-/,ease:/^ease-(linear|in|out|in-out)$/,delay:/^delay-/,animate:/^animate-/,cursor:/^cursor-/,userSelect:/^select-/,pointerEvents:/^pointer-events-/,resize:/^resize(-none|-x|-y)?$/,scrollBehavior:/^scroll-(auto|smooth)$/,touchAction:/^touch-/,overflow:/^overflow(-x|-y)?-(auto|hidden|clip|visible|scroll)$/,overscroll:/^overscroll(-x|-y)?-(auto|contain|none)$/,visibility:/^(visible|invisible|collapse)$/,aspectRatio:/^aspect-/,columns:/^columns-/,breakAfter:/^break-after-/,breakBefore:/^break-before-/,breakInside:/^break-inside-/,boxDecorationBreak:/^box-decoration-/,boxSizing:/^box-(border|content)$/,float:/^float-(right|left|none)$/,clear:/^clear-(left|right|both|none)$/,isolation:/^(isolate|isolation-auto)$/,objectFit:/^object-(contain|cover|fill|none|scale-down)$/,objectPosition:/^object-/};function my(o){const e=o.replace(/^(dark:|hover:|focus:|active:|disabled:|group-hover:|sm:|md:|lg:|xl:|2xl:)+/,"");for(const[n,a]of Object.entries(pA))if(a.test(e))return n;return null}function yy(o){const e=o.match(/^((dark:|hover:|focus:|active:|disabled:|group-hover:|sm:|md:|lg:|xl:|2xl:)+)/);return e?e[1]:""}function mA(o,e){if(!e||e.trim()==="")return o;if(!o||o.trim()==="")return e;const n=o.split(/\s+/).filter(Boolean),a=e.split(/\s+/).filter(Boolean),i=new Map;for(const u of a){const d=my(u);if(d){const f=yy(u),g=`${d}:${f}`;i.set(g,u)}}return[...n.filter(u=>{const d=my(u);if(!d)return!0;const f=yy(u),g=`${d}:${f}`;return!i.has(g)}),...a].join(" ")}function yA(o){return Object.entries(o).filter(([,e])=>e).map(([e])=>e).join(" ")}function bA(...o){return o.filter(e=>typeof e=="string"&&e.length>0).join(" ")}const be=ft("G7CoreGlobals");function vA(){window.React=Xe,window.ReactDOM={...rd,createPortal:Aa.createPortal,unstable_batchedUpdates:o=>o()},window.ReactJSXRuntime=hC,be.log("전역 객체 window.React, window.ReactDOM, window.ReactJSXRuntime에 노출됨")}function SA(o){const e=new Map,n=Ta.getInstance();o.componentEvent={on:(a,i)=>(e.has(a)||e.set(a,new Set),e.get(a).add(i),n.trackEventSubscribe(a),()=>{e.get(a)?.delete(i),n.trackEventUnsubscribe(a)}),emit:async(a,i)=>{const l=e.get(a),u=l?.size??0;if(!l||l.size===0)return n.trackEventEmit(a,i,0),[];let d,f=[];try{f=await Promise.all(Array.from(l).map(async g=>{try{return await g(i)}catch(m){throw be.error(`componentEvent: Error in listener for "${a}":`,m),m}}))}catch(g){d=g instanceof Error?g:new Error(String(g))}if(n.trackEventEmit(a,i,u,f,d),d)throw d;return f},off:a=>{e.delete(a),n.trackEventOff(a)},clear:()=>{e.clear(),n.trackEventClear()}},be.log("전역 객체 window.G7Core.componentEvent에 노출됨")}function wA(o){o.__runtime||(o.__runtime={DynamicRenderer:jr,ComponentRegistry:hr,TranslationEngine:Ea,DataSourceManager:wr,dataSourceManager:eA,DataBindingEngine:On,dataBindingEngine:rw,ActionDispatcher:fo,TranslationReactContext:cf,TranslationProvider:gc,useTranslation:ny,ResponsiveContext:jd,ResponsiveProvider:ec,useResponsive:Ud,responsiveManager:ci,BREAKPOINT_PRESETS:$l,AuthManager:pr,createLogger:ft,G7DevToolsCore:Ta},be.log("전역 객체 window.G7Core.__runtime(코어 런타임 표면)에 노출됨"))}function CA(o){if(o.layoutEditor&&o.layoutEditor.__isStub!==!0||o.layoutEditor&&o.layoutEditor.__isStub===!0)return;const e=[],n=[];o.layoutEditor={__isStub:!0,__queue:e,__readyCallbacks:n,registerWidget:(a,i)=>e.push(["widget",a,i]),registerNodeEditor:(a,i)=>e.push(["nodeEditor",a,i]),registerCanvasOverlay:(a,i)=>e.push(["canvasOverlay",a,i]),onReady:a=>{typeof a=="function"&&n.push(a)}},be.log("전역 객체 window.G7Core.layoutEditor 예약 접수함(stub) 노출됨")}function EA(o,e){o.useTranslation=ny,o.t=(n,a)=>{const i=e.getState();if(!i.translationEngine||!i.translationContext)return n;if(a){const l="|"+Object.entries(a).map(([u,d])=>`${u}=${d}`).join("|");return i.translationEngine.translate(n,i.translationContext,l)}return i.translationEngine.translate(n,i.translationContext)},be.log("전역 객체 window.G7Core.useTranslation에 노출됨")}function _A(o,e){o.createChangeEvent=dA,o.createClickEvent=fA,o.createSubmitEvent=hA,o.createKeyboardEvent=gA,o.uuid=()=>typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,n=>{const a=Math.random()*16|0;return(n==="x"?a:a&3|8).toString(16)}),o.createLogger=ft,be.log("전역 객체 window.G7Core.createLogger에 노출됨"),o.renderItemChildren=(n,a,i,l,u)=>{const d=e.getState(),m={_global:window.__templateApp?.getGlobalState?.()||{},_local:a._local||{},_computed:a._computed||{},...a},b=new Set,v=(_,A)=>{const k=m._global?._remountKeys;return _&&k?.[_]&&!b.has(_)?(b.add(_),`${_}-remount-${k[_]}`):_||A},S={translationContext:d.translationContext,translationEngine:d.translationEngine,bindingEngine:d.bindingEngine,actionDispatcher:d.actionDispatcher,getRemountKey:v,...u};return no(n,m,i,l,S)},o.getComponentMap=()=>hr.getInstance().getComponentMap(),o.renderComponentLayout=(n,a,i)=>{if(!n||!Array.isArray(n)||n.length===0)return null;const l=hr.getInstance().getComponentMap(),u=e.getState(),f=window.__templateApp?.getGlobalState?.()||{},g={_global:f._global||{},_local:f._local||{},_computed:f._computed||{},...a},m=new Set,b=(v,S)=>{const _=g._global?._remountKeys;return v&&_?.[v]&&!m.has(v)?(m.add(v),`${v}-remount-${_[v]}`):v||S};return no(n,g,l,i,{translationContext:u.translationContext,translationEngine:u.translationEngine,bindingEngine:u.bindingEngine,actionDispatcher:u.actionDispatcher,getRemountKey:b})},o.renderExpandContent=n=>{const{children:a,row:i,expandContext:l,componentContext:u,keyPrefix:d}=n;if(!a||!Array.isArray(a)||a.length===0)return null;const f=n.componentMap||hr.getInstance().getComponentMap(),g=e.getState(),m=o.state?.get?.()||{},b=u?.stateRef?.current??u?.state??{},v={...m._local||{},...b},S=u?.computedRef?.current??m._computed??{},_=g.bindingEngine??o.getDataBindingEngine?.(),A={...m,_local:v,_computed:S,row:i,item:i,$item:i};let k={};if(l&&typeof l=="object"&&_)try{for(const[D,U]of Object.entries(l))if(typeof U=="string"){const z=U.match(/^\{\{([^}]+)\}\}$/);if(z){const q=z[1].trim();try{k[D]=_.evaluateExpression(q,A,{skipCache:!0})}catch{k[D]=void 0}}else k[D]=_.resolveBindings(U,A,{skipCache:!0})}else k[D]=U}catch(D){be.warn("renderExpandContent: expandContext 평가 오류:",D)}const O={row:i,item:i,$item:i,_local:v,_global:m._global||{},_computed:m._computed||{},...k},M=new Set,x=(D,U)=>{const z=O._global?._remountKeys;return D&&z?.[D]&&!M.has(D)?(M.add(D),`${D}-remount-${z[D]}`):D||U};return no(a,O,f,d,{translationContext:g.translationContext,translationEngine:g.translationEngine??void 0,bindingEngine:g.bindingEngine??void 0,actionDispatcher:g.actionDispatcher,componentContext:u,getRemountKey:x})},o.$get=function(a,i,l=void 0){if(a==null)return l;const u=Array.isArray(i)?i:[i];if(u.length===0)return a;let d=a;for(const f of u){if(d==null||f==null)return l;d=d[f]}return d??l},be.log("전역 객체 window.G7Core.renderItemChildren에 노출됨"),be.log("전역 객체 window.G7Core.renderComponentLayout에 노출됨"),be.log("전역 객체 window.G7Core.renderExpandContent에 노출됨"),be.log("전역 객체 window.G7Core.$get에 노출됨")}function AA(o){o.dispatch=async(e,n)=>{const a=window.__templateApp;if(!a)return be.warn("G7Core.dispatch: TemplateApp이 초기화되지 않았습니다."),{success:!1,error:new Error("TemplateApp이 초기화되지 않았습니다.")};const i=a.getActionDispatcher?.();if(!i)return be.warn("G7Core.dispatch: ActionDispatcher를 찾을 수 없습니다."),{success:!1,error:new Error("ActionDispatcher를 찾을 수 없습니다.")};const l=a.getRouter?.(),u=a.getGlobalState?.(),d=a.setGlobalState?.bind(a),g=n?.componentContext||window.__g7ActionContext,m=window.__g7PendingLocalState;let b=g?.state??u;m&&g&&(b=m,be.log("[dispatch] Using __g7PendingLocalState for context.state:",m));let v=g?.data??u;m&&g?.data?._local&&(v={...g.data,_local:m},be.log("[dispatch] Updated context.data._local with pendingLocalState"));const S={navigate:l?(_,A)=>l.navigate(_,A):void 0,setState:g?.setState??d,state:b,data:v,_isDispatchFallbackContext:!g?.setState};if(e.debounce){const _=e.debounceKey||`dispatch-${e.handler}`,A=typeof e.debounce=="number"?e.debounce:e.debounce.delay;return i.debouncedCall(_,A,()=>{const{debounce:k,debounceKey:O,...M}=e;i.dispatchAction(M,S)}),{success:!0,debounced:!0}}try{return await i.dispatchAction(e,S)}catch(_){return be.error("G7Core.dispatch: 액션 실행 오류:",_),{success:!1,error:_ instanceof Error?_:new Error(String(_))}}},be.log("전역 객체 window.G7Core.dispatch에 노출됨")}function Ao(o){const e={};for(const[n,a]of Object.entries(o))if(n.includes(".")){const i=n.split(".");let l=e;for(let u=0;u<i.length-1;u++){const d=i[u];d in l?(typeof l[d]!="object"||l[d]===null)&&(l[d]={}):l[d]={},l=l[d]}l[i[i.length-1]]=a}else e[n]=a;return e}function by(o,e=""){const n=[];if(!o||typeof o!="object")return n;for(const a of Object.keys(o)){const i=e?`${e}.${a}`:a,l=o[a];l&&typeof l=="object"&&!Array.isArray(l)?n.push(...by(l,i)):n.push(i)}return n}function xA(o){const e=Object.keys(o);return e.length>0&&e.every(n=>/^\d+$/.test(n))}function vy(o,e){const n={...o};for(const a of Object.keys(e))a in n?n[a]!==null&&typeof n[a]=="object"&&!Array.isArray(n[a])&&e[a]!==null&&typeof e[a]=="object"&&!Array.isArray(e[a])&&(n[a]=vy(n[a],e[a])):n[a]=e[a];return n}function nr(o,e){if(Array.isArray(o)&&!Array.isArray(e)&&xA(e)){const a=Object.keys(e).map(l=>parseInt(l,10));if(!((a.length>0?Math.max(...a):0)>=o.length+a.length+10)){const l=[...o];for(const[u,d]of Object.entries(e)){const f=parseInt(u,10);f>=0&&f<l.length?d!==null&&typeof d=="object"&&!Array.isArray(d)&&l[f]!==null&&typeof l[f]=="object"?l[f]=nr(l[f],d):l[f]=d:f>=l.length&&(l[f]=d)}return l}}const n={...o};for(const[a,i]of Object.entries(e))i!==null&&typeof i=="object"&&!Array.isArray(i)?n[a]!==null&&typeof n[a]=="object"?n[a]=nr(n[a],i):n[a]={...i}:n[a]=i;return n}function TA(o){o.state={get:()=>window.__templateApp?.getGlobalState?.()||{},set:(e,n)=>{const a=window.__templateApp;if(a?.setGlobalState&&a?.getGlobalState){const i=n?.merge||"deep",l=Ao(e);let u;if(i==="replace")u=l;else if(i==="shallow")u={...a.getGlobalState(),...l};else{const d=a.getGlobalState();u=nr(d,l)}a.setGlobalState(u,{render:n?.render})}else be.warn("G7Core.state.set: TemplateApp이 초기화되지 않았습니다.")},setLocal:(e,n)=>{const a=window.__templateApp;if(n?.render===!1&&!n?.selfManaged){const k=window.__g7AutoBindingPaths;k&&k.size>0&&by(Ao(e)).some(M=>k.has(M))&&(be.log("[setLocal] render:false + 자동바인딩 경로 겹침 감지 → render:true 자동 승격 (engine-v1.43.0)"),n={...n,render:!0})}if(n?.debounce){const k=a?.getActionDispatcher?.();if(k){const O=n.debounceKey||`setLocal-${Object.keys(e).join(",")}`,{debounce:M,debounceKey:x,...D}=n;k.debouncedCall(O,n.debounce,()=>{o.state.setLocal(e,D)});return}}const i=n?.scope??"current",l=n?.merge||"deep",u=window.__g7ActionContext,d=Ao(e);if(i==="parent"||i==="root"){const k=window.__g7LayoutContextStack||[];if(k.length>0){const O=i==="parent"?k[k.length-1]:k[0];if(O?.setState){O.setState(M=>l==="replace"?d:l==="shallow"?{...M||{},...d}:nr(M||{},d)),be.log(`[setLocal] scope=${i}: 타겟 컨텍스트에 상태 업데이트 (mergeMode=${l})`,d);return}}be.warn(`[setLocal] scope=${i}: 레이아웃 컨텍스트 스택이 비어있습니다. current로 폴백합니다.`)}const f=window.__g7PendingLocalState,g=a?.getGlobalState?.()?._local||{},v=!((window.__g7LayoutContextStack||[]).length>0)&&u?.state?u.state:void 0,S=v?vy(g,v):g,_=f||S;let A;if(l==="replace"?A=d:l==="shallow"?A={..._,...d}:A=nr(_,d),a?.setGlobalState&&(a.setGlobalState({_local:A},{render:n?.render}),be.log(`[setLocal] globalLocal updated via setGlobalState (mergeMode=${l}, render=${n?.render??!0}):`,d)),window.__g7PendingLocalState=A,be.log("[setLocal] __g7PendingLocalState updated:",A),window.__g7SequenceLocalSync=A,window.__g7LastSetLocalSnapshot=A,l==="replace")window.__g7ForcedLocalFields=d;else{const k=window.__g7ForcedLocalFields||{};window.__g7ForcedLocalFields=nr(k,d)}if(be.log("[setLocal] __g7ForcedLocalFields updated:",d),l==="replace")window.__g7SetLocalOverrideKeys=d;else{const k=window.__g7SetLocalOverrideKeys||{};window.__g7SetLocalOverrideKeys=nr(k,d)}be.log("[setLocal] __g7SetLocalOverrideKeys updated:",d),u?.setState&&u.setState(k=>l==="replace"?d:l==="shallow"?{...k||{},...d}:nr(k||{},d)),a?.setGlobalState||be.warn("G7Core.state.setLocal: TemplateApp이 없습니다.")},getLocal:()=>{const a=(window.__templateApp?.getGlobalState?.()||{})._local||{},i=window.__g7PendingLocalState;if(i)return nr(a,i);const l=window.__g7LastSetLocalSnapshot;return l&&l!==a?nr(a,l):a},update:e=>{const n=window.__templateApp;if(n?.getGlobalState&&n?.setGlobalState){const a=n.getGlobalState(),i=e(a);n.setGlobalState(i)}else be.warn("G7Core.state.update: TemplateApp이 초기화되지 않았습니다.")},subscribe:e=>{const n=window.__templateApp;return n?.onGlobalStateChange?n.onGlobalStateChange(e):(be.warn("G7Core.state.subscribe: TemplateApp이 초기화되지 않았습니다."),()=>{})},getDataSource:e=>window.__templateApp?.getDataSource?.(e),getIsolated:e=>e?window.__g7IsolatedStates?.[e]?.state??null:window.__g7ActionContext?.isolatedContext?.state??null,setIsolated:(e,n,a)=>{let i,l,u;typeof e=="string"?(i=e,l=n||{},u=a):(l=e,u=n&&typeof n=="object"&&"merge"in n?n:a);const d=u?.merge||"deep",f=Ao(l);if(i){const b=window.__g7IsolatedStates?.[i];b?.mergeState?b.mergeState(f,d):be.warn(`G7Core.state.setIsolated: scopeId '${i}'를 찾을 수 없습니다.`);return}const g=window.__g7ActionContext;g?.isolatedContext?.mergeState?g.isolatedContext.mergeState(f,d):be.warn("G7Core.state.setIsolated: 액션 컨텍스트에 isolatedContext가 없습니다.")},getParent:()=>{const e=window.__g7LayoutContextStack||[];if(e.length===0)return be.log("[getParent] 레이아웃 컨텍스트 스택이 비어있습니다."),null;const n=e[e.length-1];if(!n)return null;const a=n.dataContext||{};return{_local:n.state||a._local||{},_global:a._global||o.state.get()||{},setState:n.setState}},setParentLocal:(e,n,a)=>{const i=window.__g7LayoutContextStack||[];if(i.length===0){be.warn("[setParentLocal] 레이아웃 컨텍스트 스택이 비어있습니다.");return}const l=i[i.length-1];if(!l?.setState){be.warn("[setParentLocal] 부모 컨텍스트에 setState가 없습니다.");return}let u,d;typeof e=="string"?(u={[e]:n},d=a):(u=e,d=n&&typeof n=="object"&&"merge"in n?n:a);const f=d?.merge||"deep",g=Ao(u),m=l.state?._local!==void 0,b=m?l.state._local:l.state||{};let v;f==="replace"?v=g:f==="shallow"?v={...b,...g}:v=nr(b,g),window.__g7PendingLocalState=v;const S=window.__templateApp;if(S?.setGlobalState&&S.setGlobalState({_local:v}),l.setState(v),m?l.state._local=v:l.state=v,l.dataContext&&(l.dataContext._local=v),f==="replace")window.__g7ForcedLocalFields=g;else{const _=window.__g7ForcedLocalFields||{};window.__g7ForcedLocalFields=nr(_,g)}Id()},setParentGlobal:(e,n)=>{let a;typeof e=="string"?a={[e]:n}:a=e,o.state.set(a),be.log("[setParentGlobal] 전역 상태 업데이트:",a)}},window.__g7IsolatedStates||(window.__g7IsolatedStates={}),o.state.getGlobal=o.state.get,o.state.setGlobal=o.state.set,be.log("전역 객체 window.G7Core.state에 노출됨")}function RA(o){o.dataSource={get:e=>window.__templateApp?.getDataSource?.(e),set:(e,n,a)=>{const i=window.__templateApp;i?.setDataSource?i.setDataSource(e,n,a):be.warn("G7Core.dataSource.set: TemplateApp이 초기화되지 않았습니다.")},refetch:async(e,n)=>{const a=window.__templateApp;if(a?.refetchDataSource)return a.refetchDataSource(e,n);be.warn("G7Core.dataSource.refetch: TemplateApp이 초기화되지 않았습니다.")},updateItem:(e,n,a,i,l)=>{const u=window.__templateApp;return u?.updateDataSourceItem?u.updateDataSourceItem(e,n,a,i,l):(be.warn("G7Core.dataSource.updateItem: TemplateApp이 초기화되지 않았습니다."),!1)},updateData:(e,n,a,i="append")=>{const l=window.__templateApp;if(!l?.getDataSource||!l?.setDataSource)return be.warn("G7Core.dataSource.updateData: TemplateApp이 초기화되지 않았습니다."),!1;const u=l.getDataSource(e);if(!u)return be.warn(`G7Core.dataSource.updateData: 데이터 소스 '${e}'를 찾을 수 없습니다.`),!1;let d,f=u,g=null;if(n){const b=n.split(".");g=b.pop();for(const v of b)if(f&&typeof f=="object"&&v in f)f=f[v];else return be.warn(`G7Core.dataSource.updateData: 경로 '${n}'를 찾을 수 없습니다.`),!1;d=f[g]}else d=u;if(!Array.isArray(d))return be.warn("G7Core.dataSource.updateData: 대상 경로의 데이터가 배열이 아닙니다."),!1;if(!Array.isArray(a))return be.warn("G7Core.dataSource.updateData: newData가 배열이 아닙니다."),!1;const m=i==="prepend"?[...a,...d]:[...d,...a];return n&&g?(f[g]=m,l.setDataSource(e,u,{merge:!1})):l.setDataSource(e,m,{merge:!1}),be.log(`G7Core.dataSource.updateData: '${e}'에 ${a.length}개 항목 ${i==="prepend"?"앞에":"뒤에"} 추가됨`),!0}},be.log("전역 객체 window.G7Core.dataSource에 노출됨")}function kA(o,e){o.locale={current:()=>window.__templateApp?.getLocale?.()||"ko",supported:()=>{const a=window.__templateApp?.globalState?.appConfig?.supportedLocales;return Array.isArray(a)&&a.length>0?a:e.getState().templateMetadata?.locales||["ko","en"]},change:async n=>{const a=window.__templateApp;a?.changeLocale?await a.changeLocale(n):be.warn("G7Core.locale.change: TemplateApp이 초기화되지 않았습니다.")}},be.log("전역 객체 window.G7Core.locale에 노출됨")}function DA(o){o.toast={show:(e,n)=>{o.dispatch({handler:"toast",params:{message:e,type:n?.type||"info",...n?.duration&&{duration:n.duration}}})},success:(e,n)=>{o.toast.show(e,{type:"success",duration:n})},error:(e,n)=>{o.toast.show(e,{type:"error",duration:n})},warning:(e,n)=>{o.toast.show(e,{type:"warning",duration:n})},info:(e,n)=>{o.toast.show(e,{type:"info",duration:n})}},be.log("전역 객체 window.G7Core.toast에 노출됨")}function OA(o){o.modal={open:e=>{o.dispatch({handler:"openModal",target:e})},close:e=>{o.dispatch({handler:"closeModal",...e&&{target:e}})},closeAll:()=>{o.dispatch({handler:"closeAllModals"})},isOpen:e=>{const n=o.state.get();return n._global?.activeModal===e||n._global?.modalStack?.includes(e)||!1},getStack:()=>o.state.get()._global?.modalStack||[]},be.log("전역 객체 window.G7Core.modal에 노출됨")}function LA(o){o.style={mergeClasses:mA,conditionalClass:yA,joinClasses:bA},be.log("전역 객체 window.G7Core.style에 노출됨")}function MA(o,e){const{webSocketManager:n}=e;o.websocket={manager:n,subscribe:(a,i,l,u)=>n.subscribe(a,i,l,u),unsubscribe:a=>n.unsubscribe(a),leaveChannel:a=>n.leaveChannel(a),disconnect:()=>n.disconnect(),isInitialized:()=>n.isInitialized(),getSubscriptionCount:()=>n.getSubscriptionCount()},be.log("전역 객체 window.G7Core.websocket에 노출됨")}function $A(o,e){const{transitionManager:n}=e;o.navigation={isPending:()=>n?.getIsPending?.()||!1,onComplete:a=>{if(!n)return a(),()=>{};let i=n.getIsPending();const l=n.subscribe(u=>{u?i=!0:i&&(a(),l())});return l}},be.log("전역 객체 window.G7Core.navigation에 노출됨")}function NA(o){o.plugin={getSettings:e=>window.G7Config?.plugins?.[e],get:(e,n,a)=>window.G7Config?.plugins?.[e]?.[n]??a,getAll:()=>window.G7Config?.plugins??{}},be.log("전역 객체 window.G7Core.plugin에 노출됨")}function IA(o){o.module={getSettings:e=>window.G7Config?.modules?.[e],get:(e,n,a)=>window.G7Config?.modules?.[e]?.[n]??a,getAll:()=>window.G7Config?.modules??{}},be.log("전역 객체 window.G7Core.module에 노출됨")}function HA(o,e){const{transitionManager:n,responsiveManager:a}=e;o.AuthManager=pr,o.api=Ir(),o.TransitionManager=n,o.useTransitionState=hm,o.ResponsiveManager=a,o.useResponsive=Ud,o.useControllableState=xC,o.shallowArrayEqual=TC,o.shallowObjectEqual=pm,o.updateQueryParams=async(i,l)=>{const u=window.__templateApp;if(u?.updateQueryParams)return u.updateQueryParams(i,l);be.warn("G7Core.updateQueryParams: TemplateApp이 초기화되지 않았습니다.")},be.log("전역 객체 window.G7Core.AuthManager에 노출됨"),be.log("전역 객체 window.G7Core.api에 노출됨"),be.log("전역 객체 window.G7Core.ResponsiveManager에 노출됨"),be.log("전역 객체 window.G7Core.useResponsive에 노출됨"),be.log("전역 객체 window.G7Core.useControllableState에 노출됨"),be.log("전역 객체 window.G7Core.updateQueryParams에 노출됨")}function zA(o,e){o.getSlotContext=()=>window.__slotContextValue??null,o.getDynamicRenderer=()=>window.__DynamicRenderer??null,o.getComponentRegistry=()=>e.getComponentRegistry?.()??hr.getInstance(),o.getDataBindingEngine=()=>e.getDataBindingEngine?.()??e.getState().bindingEngine,o.getTranslationEngine=()=>e.getTranslationEngine?.()??e.getState().translationEngine,o.getActionDispatcher=()=>e.getActionDispatcher?.()??e.getState().actionDispatcher,be.log("전역 객체 window.G7Core 슬롯 API에 노출됨 (getSlotContext, getDynamicRenderer 등)")}function jA(o){o.identity={setLauncher:Et.setLauncher.bind(Et),handle:Et.handle.bind(Et),isIdentityRequired:Et.isIdentityRequired.bind(Et),hasLauncher:Et.hasLauncher.bind(Et),markDomainNoticeShown:Et.markDomainNoticeShown.bind(Et),redirectExternally:Et.redirectExternally.bind(Et),createDeferred:Et.createDeferred.bind(Et),resolveDeferred:Et.resolveDeferred.bind(Et),reset:Et.reset.bind(Et),redirectStashKey:Dd},be.log("전역 객체 window.G7Core 본인인증(IDV) API에 노출됨 (identity)")}function UA(o){if(typeof window>"u")return;vA(),window.G7Core||(window.G7Core={});const e=window.G7Core;wA(e),SA(e),CA(e),HA(e,o),EA(e,o),_A(e,o),AA(e),TA(e),RA(e),kA(e,o),DA(e),OA(e),LA(e),MA(e,o),$A(e,o),NA(e),IA(e),zA(e,o),jA(e),be.log("G7Core 전역 객체 초기화 완료")}function BA(){const o=window.G7Core;if(!o){be.warn("G7Core가 초기화되지 않았습니다.");return}const e=()=>Ta.getInstance(),n={isEnabled:()=>{try{return e().isEnabled()}catch{return!1}},trackRender:a=>{try{e().isEnabled()&&e().trackRender(a)}catch{}},trackIteration:(a,i,l,u,d)=>{try{e().isEnabled()&&e().trackIteration(a,{source:i,itemVar:l,indexVar:u,sourceLength:d})}catch{}},trackIfCondition:(a,i,l,u)=>{try{e().isEnabled()&&e().trackIfCondition(a,i,l)}catch{}},trackMount:(a,i)=>{try{e().isEnabled()&&e().trackMount(a,{...i,id:a})}catch{}},trackUnmount:a=>{try{e().isEnabled()&&e().trackUnmount(a)}catch{}},trackExpressionEval:a=>{try{e().isEnabled()&&e().trackExpressionEval(a)}catch{}},trackBindingEval:a=>{try{e().isEnabled()&&e().trackBindingEval(a)}catch{}},recordCacheHit:()=>{try{e().isEnabled()&&e().recordCacheHit()}catch{}},recordCacheMiss:()=>{try{e().isEnabled()&&e().recordCacheMiss()}catch{}},trackHandlerRegistration:(a,i,l,u)=>{try{e().isEnabled()&&e().trackHandlerRegistration(a,i,l,u)}catch{}},trackHandlerUnregistration:a=>{try{e().isEnabled()&&e().trackHandlerUnregistration(a)}catch{}},logAction:a=>{try{e().isEnabled()&&e().logAction(a)}catch{}},trackRequest:(a,i)=>{try{return e().isEnabled()?e().trackRequest(a,i):""}catch{return""}},completeRequest:(a,i,l)=>{try{e().isEnabled()&&e().completeRequest(a,i,l)}catch{}},failRequest:(a,i)=>{try{e().isEnabled()&&e().failRequest(a,i)}catch{}},trackDataSourceDefinition:a=>{try{e().isEnabled()&&e().trackDataSourceDefinition(a)}catch{}},trackDataSourceLoading:a=>{try{e().isEnabled()&&e().trackDataSourceLoading(a)}catch{}},trackDataSourceLoaded:(a,i,l)=>{try{e().isEnabled()&&e().trackDataSourceLoaded(a,i,l)}catch{}},trackDataSourceError:(a,i)=>{try{e().isEnabled()&&e().trackDataSourceError(a,i)}catch{}},trackForm:(a,i,l)=>{try{e().isEnabled()&&e().trackForm(a,i,l)}catch{}},untrackForm:a=>{try{e().isEnabled()&&e().untrackForm(a)}catch{}},startStateChange:(a,i,l,u)=>{try{return e().isEnabled()?e().startStateChange(a,i,l,u):""}catch{return""}},completeStateChange:a=>{try{e().isEnabled()&&e().completeStateChange(a)}catch{}},trackComponentRender:(a,i,l,u,d,f)=>{try{e().isEnabled()&&e().trackComponentRender(a,i,l,u,d,f)}catch{}},updateLocalState:a=>{try{e().isEnabled()&&e().updateLocalState(a)}catch{}},updateComputedState:a=>{try{e().isEnabled()&&e().updateComputedState(a)}catch{}},updateParentContext:a=>{try{e().isEnabled()&&e().updateParentContext(a)}catch{}},trackComponentStateSource:(a,i,l,u)=>{try{e().isEnabled()&&e().trackComponentStateSource(a,i,l,u)}catch{}},trackDynamicState:(a,i)=>{try{e().isEnabled()&&e().trackDynamicState(a,i)}catch{}},trackContextFlow:(a,i,l,u,d,f)=>{try{e().isEnabled()&&e().trackContextFlow(a,i,l,u,d,f)}catch{}},trackComponentStyle:(a,i,l,u)=>{try{e().isEnabled()&&e().trackComponentStyle(a,i,l,u)}catch{}},trackAuthEvent:(a,i,l,u)=>{try{e().isEnabled()&&e().trackAuthEvent(a,i,l,u)}catch{}},trackAuthHeader:(a,i,l,u,d)=>{try{e().isEnabled()&&e().trackAuthHeader(a,i,l,u,d)}catch{}},trackLog:(a,i,l)=>{try{e().isEnabled()&&e().trackLog(a,i,l)}catch{}},trackAction:a=>{try{e().isEnabled()&&e().trackAction?.(a)}catch{}},trackDataSourceUpdate:a=>{try{e().isEnabled()&&e().trackDataSourceUpdate?.(a)}catch{}},startSequenceExecution:a=>{try{return e().isEnabled()?e().startSequenceExecution(a):""}catch{return""}},captureSequenceActionBefore:(a,i,l,u,d)=>{try{e().isEnabled()&&e().captureSequenceActionBefore(a,i,l,u,d)}catch{}},captureSequenceActionAfter:(a,i,l,u,d,f)=>{try{e().isEnabled()&&e().captureSequenceActionAfter(a,i,l,u,d,f)}catch{}},endSequenceExecution:(a,i)=>{try{e().isEnabled()&&e().endSequenceExecution(a,i)}catch{}},registerStateCaptureForHandler:(a,i,l)=>{try{e().isEnabled()&&e().registerStateCaptureForHandler(a,i,l)}catch{}},detectStaleClosure:(a,i,l,u,d)=>{try{return e().isEnabled()?e().detectStaleClosure(a,i,l,u,d):[]}catch{return[]}},trackStaleClosureWarning:a=>{try{e().isEnabled()&&e().trackStaleClosureWarning(a)}catch{}},trackModalOpen:a=>{try{e().isEnabled()&&e().trackModalOpen(a)}catch{}},trackModalClose:(a,i)=>{try{e().isEnabled()&&e().trackModalClose(a,i)}catch{}},trackModalStateChange:a=>{try{e().isEnabled()&&e().trackModalStateChange(a)}catch{}},trackNestedContext:a=>{try{return e().isEnabled()?e().trackNestedContext(a):""}catch{return""}},trackNestedContextAccess:(a,i)=>{try{e().isEnabled()&&e().trackNestedContextAccess(a,i)}catch{}},trackComputedProperty:(a,i,l,u,d,f,g)=>{try{e().isEnabled()&&e().trackComputedProperty(a,i,l,u,d,f,g)}catch{}},trackComputedRecalc:(a,i,l,u,d,f,g)=>{try{e().isEnabled()&&e().trackComputedRecalc(a,i,l,u,d,f,g)}catch{}},setNamedActionDefinitions:a=>{try{e().isEnabled()&&e().setNamedActionDefinitions(a)}catch{}},trackNamedActionRef:a=>{try{e().isEnabled()&&e().trackNamedActionRef(a)}catch{}}};o.devTools=n,be.log("G7Core.devTools 인터페이스 초기화 완료")}let xo=null;function PA(){const o=window.G7Core;return o?.__devtools?Promise.resolve(o.__devtools):xo||(xo=new Promise((e,n)=>{const a=window.G7Config?.coreDevToolsAsset||"/build/core/devtools.min.js",i="g7-devtools-bundle",l=()=>{const f=window.G7Core?.__devtools;f?e(f):n(new Error("DevTools 번들 로드됨 — 그러나 __devtools 미노출"))};window.G7Core=window.G7Core||{},window.G7Core.__onDevToolsReady=l;const u=document.getElementById(i);if(u){u.addEventListener("load",l,{once:!0}),u.addEventListener("error",()=>n(new Error(`DevTools 번들 로드 실패: ${a}`)),{once:!0});return}const d=document.createElement("script");d.id=i,d.src=a,d.async=!1,d.addEventListener("load",l,{once:!0}),d.addEventListener("error",()=>{xo=null,n(new Error(`DevTools 번들 로드 실패: ${a}`))},{once:!0}),document.head.appendChild(d)}),xo)}function qA(){const o=window.G7Core;if(!o){be.warn("G7Core가 초기화되지 않았습니다.");return}const e=Ta.getInstance();if(e.initialize(),!e.isEnabled()){window.G7DevTools={isEnabled:()=>!1,enable:()=>{be.log("환경설정 > 고급 설정 > 디버그 모드를 켜세요")}},id(),be.log("G7DevTools 비활성화됨 (디버그 모드 꺼짐)");return}GA(o,e)}async function GA(o,e){let n;try{n=await PA()}catch(g){be.warn("DevTools 번들 로드 실패 — 최소 API 로 폴백:",g),window.G7DevTools={isEnabled:()=>!1,enable:()=>{}},id();return}const{DiagnosticEngine:a,getServerConnector:i,getStyleTracker:l}=n;BA(),id();try{l().enable(),be.log("StyleTracker 활성화됨")}catch(g){be.warn("StyleTracker 활성화 실패:",g)}const u=new a,d=i(),f={isEnabled:()=>e.isEnabled(),state:{get:()=>e.getState(),getHistory:()=>e.getStateHistory(),watch:(g,m)=>e.watchState(g,m)},actions:{getHistory:()=>e.getActionHistory(),watch:g=>e.watchActions(g),getMetrics:()=>e.getActionMetrics()},binding:{evaluate:g=>{const m=o.getDataBindingEngine?.();if(!m){be.warn("DataBindingEngine이 없습니다.");return}return m.evaluateExpression(g,e.getState())},getCacheStats:()=>e.getCacheStats(),clearStats:()=>{e.resetCacheStats(),be.log("캐시 통계 초기화됨")}},diagnose:{analyze:g=>u.analyze(g),suggestFix:g=>u.suggestFix(g),getCommonIssues:()=>u.getCommonIssues(),getRulesByCategory:g=>u.getRulesByCategory(g)},server:{dumpState:g=>d.dumpState(g),sendLog:g=>d.sendLog(g),sendError:(g,m)=>d.sendError(g,m),isConnected:()=>d.isConnected(),testConnection:()=>d.testConnection()},config:{isDebugMode:()=>e.isEnabled(),setLogLevel:g=>e.setLogLevel(g),setMaxHistory:g=>e.setMaxHistory(g)},lifecycle:{getMountedComponents:()=>e.getLifecycleInfo().mountedComponents,getOrphanedListeners:()=>e.getLifecycleInfo().orphanedListeners},performance:{getRenderCount:()=>e.getPerformanceInfo().renderCounts,getBindingEvalCount:()=>e.getPerformanceInfo().bindingEvalCount,getMemoryWarnings:()=>e.getPerformanceInfo().memoryWarnings,startProfiling:()=>e.startProfiling(),stopProfiling:()=>e.stopProfiling()},network:{getActiveRequests:()=>e.getNetworkInfo().activeRequests,getRequestHistory:()=>e.getNetworkInfo().requestHistory,getPendingDataSources:()=>e.getNetworkInfo().pendingDataSources},conditional:{getIfConditions:()=>e.getConditionalInfo().ifConditions,getIterations:()=>e.getConditionalInfo().iterations},form:{getForms:()=>e.getFormInfo()},websocket:{getInfo:()=>e.getWebSocketInfo()}};window.G7DevTools=f,o.devtools=f,be.log("G7DevTools 전역 객체 초기화 완료 (window.G7DevTools)"),VA(n.DevToolsPanel)}function VA(o){if(document.getElementById("g7-devtools-root")){be.log("DevToolsPanel 이미 렌더링됨");return}const e=document.createElement("div");e.id="g7-devtools-root",document.body.appendChild(e);try{rd.createRoot(e).render(Xe.createElement(o)),be.log("DevToolsPanel UI 렌더링 완료")}catch(n){be.error("DevToolsPanel UI 렌더링 실패:",n)}}const Ze=ft("TemplateEngine"),ie={templateId:null,locale:"ko",isInitialized:!1,reactRoot:null,containerId:null,currentLayoutJson:null,currentDataContext:{},translationContext:{templateId:"",locale:"ko"},registry:null,bindingEngine:null,translationEngine:null,actionDispatcher:null,templateMetadata:null};let To=!1;const Ro=[];async function FA(o){try{Ze.log("템플릿 메타데이터 로드 중...",o);const e=o.split("-").map(a=>a.split("_").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join("")).join(""),n=window[e];return n?.templateMetadata?(Ze.log("템플릿 메타데이터 로드 완료 (전역 변수)",n.templateMetadata),n.templateMetadata):(Ze.warn(`템플릿 번들에 메타데이터가 없습니다. 전역 변수: ${e}`),{identifier:o,locales:["ko","en"],name:{ko:o,en:o},description:{ko:"",en:""},version:"1.0.0",type:"admin"})}catch(e){return Ze.error("템플릿 메타데이터 로드 실패",e),{identifier:o,locales:["ko","en"],name:{ko:o,en:o},description:{ko:"",en:""},version:"1.0.0",type:"admin"}}}function Sy(){const e=(typeof window<"u"?window.__templateApp:void 0)?.globalState?.appConfig?.supportedLocales,n=ie.templateMetadata?.locales;return{$locale:ie.locale,$locales:Array.isArray(e)&&e.length>0?e:n||["ko","en"],$templateLocales:n||["ko","en"],$templateId:ie.templateId}}async function ko(o){try{if(Ze.log("템플릿 엔진 초기화 시작",o),ie.isInitialized)throw new Error("템플릿 엔진이 이미 초기화되었습니다. destroyTemplate()을 먼저 호출하세요.");if(!o.templateId)throw new nA;To=o.debug??!1,typeof window<"u"&&(window.G7Config||(window.G7Config={}),window.G7Config.debug=To),qA(),ie.templateId=o.templateId,ie.locale=o.locale||"ko",Ze.log("엔진 인스턴스 생성 중..."),ie.registry=hr.getInstance(),ie.bindingEngine=new On,ie.translationEngine=Ea.getInstance(),o.cacheVersion!==void 0&&o.cacheVersion>0&&ie.translationEngine.setCacheVersion(o.cacheVersion),ie.translationContext={templateId:o.templateId,locale:ie.locale},ie.actionDispatcher=new fo({},ie.translationEngine,ie.translationContext),yC(ie.actionDispatcher),Ze.log("다국어 파일 로드 중...",o.templateId,ie.locale);const e="en",n=[ie.translationEngine.loadTranslations(o.templateId,ie.locale).then(()=>{Ze.log(`다국어 파일 로드 완료: ${ie.locale}`)}).catch(a=>{Ze.warn(`다국어 파일 로드 실패 (${ie.locale}):`,a instanceof Error?a.message:a)})];ie.locale!==e&&n.push(ie.translationEngine.loadTranslations(o.templateId,e).then(()=>{Ze.log(`폴백 다국어 파일 로드 완료: ${e}`)}).catch(a=>{Ze.warn(`폴백 다국어 파일 로드 실패 (${e}):`,a instanceof Error?a.message:a)})),await Promise.allSettled(n),Ze.log("템플릿 메타데이터 로드 중...",o.templateId),ie.templateMetadata=await FA(o.templateId),ie.isInitialized=!0,Ze.log("템플릿 엔진 초기화 완료 (ComponentRegistry는 별도 로드)")}catch(e){throw Ze.error("템플릿 엔진 초기화 실패",e),ie.isInitialized=!1,ie.registry=null,ie.bindingEngine=null,ie.translationEngine=null,ie.actionDispatcher=null,e}}let Do=null;function vf(){const o=window.G7Core;return o?.__LayoutEditorChrome?Promise.resolve(o.__LayoutEditorChrome):Do||(Do=new Promise((e,n)=>{const a=window.G7Config?.coreEditorAsset||"/build/core/layout-editor.min.js",i="g7-layout-editor-bundle",l=document.getElementById(i),u=()=>{const f=window.G7Core?.__LayoutEditorChrome;f?e(f):n(new Error("편집기 번들 로드됨 — 그러나 __LayoutEditorChrome 미노출"))};if(window.G7Core=window.G7Core||{},window.G7Core.__onChromeReady=u,l){l.addEventListener("load",u,{once:!0}),l.addEventListener("error",()=>n(new Error(`편집기 번들 로드 실패: ${a}`)),{once:!0});return}const d=document.createElement("script");d.id=i,d.src=a,d.async=!1,d.addEventListener("load",u,{once:!0}),d.addEventListener("error",()=>{Do=null,n(new Error(`편집기 번들 로드 실패: ${a}`))},{once:!0}),document.head.appendChild(d)}),Do)}async function fs(o){try{if(Ze.log("템플릿 렌더링 시작",o),!ie.isInitialized)throw new Error("템플릿 엔진이 초기화되지 않았습니다. initTemplateEngine()을 먼저 호출하세요.");if(!o.containerId)throw new Error("containerId는 필수입니다.");if(!o.layoutJson)throw new Error("layoutJson은 필수입니다.");const e=document.getElementById(o.containerId);if(!e)throw new Error(`컨테이너를 찾을 수 없습니다: #${o.containerId}`);const n=Sy();if(ie.containerId=o.containerId,ie.currentLayoutJson=o.layoutJson,ie.currentDataContext={...n,...o.dataContext||{}},ie.translationContext=o.translationContext||{templateId:ie.templateId||"",locale:ie.locale},ie.reactRoot||(Ze.log("React Root 생성"),ie.reactRoot=rd.createRoot(e)),typeof window<"u"){const l=gy(window.location.pathname);if(l){Ze.log("레이아웃 편집기 모드 진입",l);let u;try{u=await vf()}catch(f){Ze.error("레이아웃 편집기 번들 로드 실패",f),gf.render(o.containerId,{title:"레이아웃 편집기 로드 실패",message:f instanceof Error?f.message:"편집기 번들을 불러오지 못했습니다.",icon:"fas fa-triangle-exclamation",showStack:!1,showReloadButton:!0,debug:To});return}const d=Xe.createElement(u,{templateIdentifier:l.templateIdentifier,initialLocale:ie.locale});ie.reactRoot.render(Xe.createElement(gc,{translationEngine:ie.translationEngine,translationContext:ie.translationContext,children:Xe.createElement(Hd,{children:Xe.createElement(ec,{children:Xe.createElement(uf,{children:d})})})}));return}}const a=o.layoutJson.components||[];if(a.length===0){Ze.warn("렌더링할 컴포넌트가 없습니다.");return}const i=o.layoutJson.modals||[];if(Ze.log("modals 배열:",i),Ze.log("modals 개수:",i.length),Ze.log("DynamicRenderer로 렌더링 시작"),ie.reactRoot.render(Xe.createElement(gc,{translationEngine:ie.translationEngine,translationContext:ie.translationContext},Xe.createElement(Hd,null,Xe.createElement(ec,null,Xe.createElement(uf,null,[...a.map((l,u)=>{const d=ie.currentLayoutJson?.layout_name||"";return Xe.createElement(jr,{key:d&&!l._fromBase?`${l.id}_${d}`:l.id,componentDef:l,dataContext:ie.currentDataContext,translationContext:ie.translationContext,registry:ie.registry,bindingEngine:ie.bindingEngine,translationEngine:ie.translationEngine,actionDispatcher:ie.actionDispatcher,isRootRenderer:u===0,layoutKey:d})}),Xe.createElement(lm,{key:"__modal_parent_context_provider"},i.map(l=>{const u=ie.currentDataContext._global?.modalStack||[],f=u.includes(l.id)||ie.currentDataContext._global?.activeModal===l.id,g=u.indexOf(l.id),m=g>=0?50+g:50,b=window.__g7LayoutContextStack||[],S=b[b.length-1]?.dataContext,_=Xe.createElement(jr,{key:`modal_${l.id}_renderer`,componentDef:{...l,props:{...l.props,isOpen:f,style:{...l.props?.style,zIndex:m},onClose:ie.actionDispatcher?.createHandler({type:"click",handler:"closeModal"},ie.currentDataContext)}},dataContext:ie.currentDataContext,translationContext:ie.translationContext,registry:ie.registry,bindingEngine:ie.bindingEngine,translationEngine:ie.translationEngine,actionDispatcher:ie.actionDispatcher,parentDataContext:S});return l.data_sources&&l.data_sources.length>0?Xe.createElement(fy,{key:`modal_${l.id}`,isOpen:f,modalId:l.id,dataSources:l.data_sources,dataContext:ie.currentDataContext,globalStateUpdater:ie.actionDispatcher?.getGlobalStateUpdater(),bindingEngine:ie.bindingEngine,debug:To,children:_}):_}))]))))),Ze.log("템플릿 렌더링 완료"),Ro.length>0){Ze.log(`대기 중인 데이터 업데이트 ${Ro.length}건 적용`);const l=[...Ro];Ro.length=0;for(const{data:u,options:d}of l)hs(u,d)}}catch(e){throw Ze.error("템플릿 렌더링 실패",e),e}}function hs(o,e){try{if(Ze.log("템플릿 데이터 업데이트 시작",Object.keys(o)),!ie.isInitialized)throw new Error("템플릿 엔진이 초기화되지 않았습니다.");if(!ie.reactRoot||!ie.currentLayoutJson){Ze.log("React 미준비 - 데이터 업데이트 큐잉:",Object.keys(o)),Ro.push({data:o,options:e});return}const n=Sy(),a={...ie.currentDataContext._global||{},...o._global||{}},i=_C(ie.currentDataContext._localInit,o._localInit);ie.currentDataContext={...n,...ie.currentDataContext,...o,_global:a,_localInit:i},a._local!==void 0&&(ie.currentDataContext._local=a._local),a._computed!==void 0&&(ie.currentDataContext._computed=a._computed);const l=ie.currentLayoutJson.components||[],u=ie.currentLayoutJson.modals||[];Ze.log("updateTemplateData - modals 배열:",u),Ze.log("updateTemplateData - modals 개수:",u.length),Ze.log("updateTemplateData - activeModal:",ie.currentDataContext._global?.activeModal);const d=()=>{ie.reactRoot.render(Xe.createElement(gc,{translationEngine:ie.translationEngine,translationContext:ie.translationContext},Xe.createElement(Hd,null,Xe.createElement(ec,null,Xe.createElement(uf,null,[...l.map((f,g)=>{const m=ie.currentLayoutJson?.layout_name||"";return Xe.createElement(jr,{key:m&&!f._fromBase?`${f.id}_${m}`:f.id,componentDef:f,dataContext:ie.currentDataContext,translationContext:ie.translationContext,registry:ie.registry,bindingEngine:ie.bindingEngine,translationEngine:ie.translationEngine,actionDispatcher:ie.actionDispatcher,isRootRenderer:g===0,layoutKey:m})}),Xe.createElement(lm,{key:"__modal_parent_context_provider_update"},u.map(f=>{const g=ie.currentDataContext._global?.modalStack||[],b=g.includes(f.id)||ie.currentDataContext._global?.activeModal===f.id,v=g.indexOf(f.id),S=v>=0?50+v:50,_=window.__g7LayoutContextStack||[],k=_[_.length-1]?.dataContext,O=Xe.createElement(jr,{key:`modal_${f.id}_renderer`,componentDef:{...f,props:{...f.props,isOpen:b,style:{...f.props?.style,zIndex:S},onClose:ie.actionDispatcher?.createHandler({type:"click",handler:"closeModal"},ie.currentDataContext)}},dataContext:ie.currentDataContext,translationContext:ie.translationContext,registry:ie.registry,bindingEngine:ie.bindingEngine,translationEngine:ie.translationEngine,actionDispatcher:ie.actionDispatcher,parentDataContext:k});return f.data_sources&&f.data_sources.length>0?Xe.createElement(fy,{key:`modal_${f.id}`,isOpen:b,modalId:f.id,dataSources:f.data_sources,dataContext:ie.currentDataContext,globalStateUpdater:ie.actionDispatcher?.getGlobalStateUpdater(),bindingEngine:ie.bindingEngine,debug:To,children:O}):O}))])))))};e?.sync?(Ze.log("재렌더링 시작 (sync mode - 즉시 렌더링)"),d()):(Ze.log("재렌더링 시작 (with startTransition)"),H.startTransition(()=>{d()})),Ze.log("템플릿 데이터 업데이트 완료")}catch(n){throw Ze.error("템플릿 데이터 업데이트 실패",n),n}}function wc(){try{Ze.log("템플릿 정리 시작"),ie.reactRoot&&(Ze.log("React Root 언마운트"),ie.reactRoot.unmount(),ie.reactRoot=null),ie.templateId=null,ie.locale="ko",ie.isInitialized=!1,ie.containerId=null,ie.currentLayoutJson=null,ie.currentDataContext={},ie.translationContext={templateId:"",locale:"ko"},ie.registry=null,ie.bindingEngine=null,ie.translationEngine=null,ie.actionDispatcher=null,ie.templateMetadata=null,Ze.log("템플릿 정리 완료")}catch(o){throw Ze.error("템플릿 정리 실패",o),o}}function Zr(){return Object.freeze({...ie})}function wy(){return ie.actionDispatcher}const Oo={initTemplateEngine:ko,renderTemplate:fs,updateTemplateData:hs,destroyTemplate:wc,getState:Zr};typeof window<"u"&&(window.G7Core||(window.G7Core={}),window.G7Core.TemplateEngine=Oo,UA({getState:()=>({translationEngine:ie.translationEngine,translationContext:ie.translationContext,bindingEngine:ie.bindingEngine,actionDispatcher:ie.actionDispatcher,templateMetadata:ie.templateMetadata}),transitionManager:Hr,responsiveManager:ci,webSocketManager:yc}),Ze.log("전역 객체 window.G7Core.TemplateEngine에 노출됨"));const Ur=Object.freeze(Object.defineProperty({__proto__:null,DataSourceManager:wr,LayoutLoader:lf,TemplateApp:_o,TemplateEngine:Oo,default:Oo,destroyTemplate:wc,getActionDispatcher:wy,getState:Zr,initTemplateApp:bf,initTemplateEngine:ko,loadLayoutEditorBundle:vf,renderTemplate:fs,updateTemplateData:hs},Symbol.toStringTag,{value:"Module"}));Yt.DataSourceManager=wr,Yt.LayoutLoader=lf,Yt.TemplateApp=_o,Yt.TemplateEngine=Oo,Yt.default=Oo,Yt.destroyTemplate=wc,Yt.getActionDispatcher=wy,Yt.getState=Zr,Yt.initTemplateApp=bf,Yt.initTemplateEngine=ko,Yt.loadLayoutEditorBundle=vf,Yt.renderTemplate=fs,Yt.updateTemplateData=hs,Object.defineProperties(Yt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})})(this.G7Core=this.G7Core||{});
//# sourceMappingURL=template-engine.min.js.map