- SafeExpressionEvaluator 교체(engine-v1.60.0)가 구 평가기가 허용하던 화살표 파라미터 배열 구조분해(([k, v]) / ([, vid]))를 누락해 해당 문법을 쓰는 액션 params 가 미평가 원문으로 전송, 장바구니 담기/바로 구매가 전 상품 불능이던 회귀를 수정 (engine-v1.60.5, production 재빌드 동반). 저장소 레이아웃 54파일 104곳 사용 형태 전수를 단위/E2E 테스트로 잠금 - TrimStrings 가 타이틀 접미사의 선행 공백을 제거해 봇 렌더 제목이 "제목| 사이트명" 으로 접착되고 빈 제목 화면은 "| 사이트명" 이 매달리던 기존 결함 수정 — 조립 규칙을 composeTitleSuffix 단일 지점(SSoT)으로 정규화 - JSON-LD 직렬화에 JSON_HEX_TAG 미적용으로 검색어의 </script> 가 스크립트 컨텍스트를 조기 종료해 실행 가능한 script 요소가 재생성되던 반사형 XSS(기존 결함) 차단 — 태그 문자 이스케이프, 구조화 데이터 의미는 보존
231 lines
774 KiB
JavaScript
231 lines
774 KiB
JavaScript
var tk=Object.defineProperty;var nk=(Zt,Qr,Zr)=>Qr in Zt?tk(Zt,Qr,{enumerable:!0,configurable:!0,writable:!0,value:Zr}):Zt[Qr]=Zr;var $=(Zt,Qr,Zr)=>nk(Zt,typeof Qr!="symbol"?Qr+"":Qr,Zr);(function(Zt){"use strict";function Qr(s,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 s)){const l=Object.getOwnPropertyDescriptor(a,i);l&&Object.defineProperty(s,i,l.get?l:{enumerable:!0,get:()=>a[i]})}}}return Object.freeze(Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}))}function Zr(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var sd={exports:{}},Ye={};var sg;function bw(){if(sg)return Ye;sg=1;var s=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"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),S=Symbol.iterator;function v(N){return N===null||typeof N!="object"?null:(N=S&&N[S]||N["@@iterator"],typeof N=="function"?N:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,x={};function D(N,k,de){this.props=N,this.context=k,this.refs=x,this.updater=de||_}D.prototype.isReactComponent={},D.prototype.setState=function(N,k){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,k,"setState")},D.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function M(){}M.prototype=D.prototype;function T(N,k,de){this.props=N,this.context=k,this.refs=x,this.updater=de||_}var L=T.prototype=new M;L.constructor=T,A(L,D.prototype),L.isPureReactComponent=!0;var q=Array.isArray;function P(){}var B={H:null,A:null,T:null,S:null},W=Object.prototype.hasOwnProperty;function he(N,k,de){var fe=de.ref;return{$$typeof:s,type:N,key:k,ref:fe!==void 0?fe:null,props:de}}function Se(N,k){return he(N.type,k,N.props)}function be(N){return typeof N=="object"&&N!==null&&N.$$typeof===s}function Ue(N){var k={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(de){return k[de]})}var Ve=/\/+/g;function Ge(N,k){return typeof N=="object"&&N!==null&&N.key!=null?Ue(""+N.key):k.toString(36)}function Ct(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(P,P):(N.status="pending",N.then(function(k){N.status==="pending"&&(N.status="fulfilled",N.value=k)},function(k){N.status==="pending"&&(N.status="rejected",N.reason=k)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function J(N,k,de,fe,xe){var ee=typeof N;(ee==="undefined"||ee==="boolean")&&(N=null);var _e=!1;if(N===null)_e=!0;else switch(ee){case"bigint":case"string":case"number":_e=!0;break;case"object":switch(N.$$typeof){case s:case e:_e=!0;break;case m:return _e=N._init,J(_e(N._payload),k,de,fe,xe)}}if(_e)return xe=xe(N),_e=fe===""?"."+Ge(N,0):fe,q(xe)?(de="",_e!=null&&(de=_e.replace(Ve,"$&/")+"/"),J(xe,k,de,"",function(Ie){return Ie})):xe!=null&&(be(xe)&&(xe=Se(xe,de+(xe.key==null||N&&N.key===xe.key?"":(""+xe.key).replace(Ve,"$&/")+"/")+_e)),k.push(xe)),1;_e=0;var Be=fe===""?".":fe+":";if(q(N))for(var Re=0;Re<N.length;Re++)fe=N[Re],ee=Be+Ge(fe,Re),_e+=J(fe,k,de,ee,xe);else if(Re=v(N),typeof Re=="function")for(N=Re.call(N),Re=0;!(fe=N.next()).done;)fe=fe.value,ee=Be+Ge(fe,Re++),_e+=J(fe,k,de,ee,xe);else if(ee==="object"){if(typeof N.then=="function")return J(Ct(N),k,de,fe,xe);throw k=String(N),Error("Objects are not valid as a React child (found: "+(k==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":k)+"). If you meant to render a collection of children, use an array instead.")}return _e}function ue(N,k,de){if(N==null)return N;var fe=[],xe=0;return J(N,fe,"","",function(ee){return k.call(de,ee,xe++)}),fe}function Me(N){if(N._status===-1){var k=N._result;k=k(),k.then(function(de){(N._status===0||N._status===-1)&&(N._status=1,N._result=de)},function(de){(N._status===0||N._status===-1)&&(N._status=2,N._result=de)}),N._status===-1&&(N._status=0,N._result=k)}if(N._status===1)return N._result.default;throw N._result}var te=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var k=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(k))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},ge={map:ue,forEach:function(N,k,de){ue(N,function(){k.apply(this,arguments)},de)},count:function(N){var k=0;return ue(N,function(){k++}),k},toArray:function(N){return ue(N,function(k){return k})||[]},only:function(N){if(!be(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return Ye.Activity=y,Ye.Children=ge,Ye.Component=D,Ye.Fragment=n,Ye.Profiler=i,Ye.PureComponent=T,Ye.StrictMode=a,Ye.Suspense=f,Ye.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,Ye.__COMPILER_RUNTIME={__proto__:null,c:function(N){return B.H.useMemoCache(N)}},Ye.cache=function(N){return function(){return N.apply(null,arguments)}},Ye.cacheSignal=function(){return null},Ye.cloneElement=function(N,k,de){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var fe=A({},N.props),xe=N.key;if(k!=null)for(ee in k.key!==void 0&&(xe=""+k.key),k)!W.call(k,ee)||ee==="key"||ee==="__self"||ee==="__source"||ee==="ref"&&k.ref===void 0||(fe[ee]=k[ee]);var ee=arguments.length-2;if(ee===1)fe.children=de;else if(1<ee){for(var _e=Array(ee),Be=0;Be<ee;Be++)_e[Be]=arguments[Be+2];fe.children=_e}return he(N.type,xe,fe)},Ye.createContext=function(N){return N={$$typeof:c,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:l,_context:N},N},Ye.createElement=function(N,k,de){var fe,xe={},ee=null;if(k!=null)for(fe in k.key!==void 0&&(ee=""+k.key),k)W.call(k,fe)&&fe!=="key"&&fe!=="__self"&&fe!=="__source"&&(xe[fe]=k[fe]);var _e=arguments.length-2;if(_e===1)xe.children=de;else if(1<_e){for(var Be=Array(_e),Re=0;Re<_e;Re++)Be[Re]=arguments[Re+2];xe.children=Be}if(N&&N.defaultProps)for(fe in _e=N.defaultProps,_e)xe[fe]===void 0&&(xe[fe]=_e[fe]);return he(N,ee,xe)},Ye.createRef=function(){return{current:null}},Ye.forwardRef=function(N){return{$$typeof:d,render:N}},Ye.isValidElement=be,Ye.lazy=function(N){return{$$typeof:m,_payload:{_status:-1,_result:N},_init:Me}},Ye.memo=function(N,k){return{$$typeof:h,type:N,compare:k===void 0?null:k}},Ye.startTransition=function(N){var k=B.T,de={};B.T=de;try{var fe=N(),xe=B.S;xe!==null&&xe(de,fe),typeof fe=="object"&&fe!==null&&typeof fe.then=="function"&&fe.then(P,te)}catch(ee){te(ee)}finally{k!==null&&de.types!==null&&(k.types=de.types),B.T=k}},Ye.unstable_useCacheRefresh=function(){return B.H.useCacheRefresh()},Ye.use=function(N){return B.H.use(N)},Ye.useActionState=function(N,k,de){return B.H.useActionState(N,k,de)},Ye.useCallback=function(N,k){return B.H.useCallback(N,k)},Ye.useContext=function(N){return B.H.useContext(N)},Ye.useDebugValue=function(){},Ye.useDeferredValue=function(N,k){return B.H.useDeferredValue(N,k)},Ye.useEffect=function(N,k){return B.H.useEffect(N,k)},Ye.useEffectEvent=function(N){return B.H.useEffectEvent(N)},Ye.useId=function(){return B.H.useId()},Ye.useImperativeHandle=function(N,k,de){return B.H.useImperativeHandle(N,k,de)},Ye.useInsertionEffect=function(N,k){return B.H.useInsertionEffect(N,k)},Ye.useLayoutEffect=function(N,k){return B.H.useLayoutEffect(N,k)},Ye.useMemo=function(N,k){return B.H.useMemo(N,k)},Ye.useOptimistic=function(N,k){return B.H.useOptimistic(N,k)},Ye.useReducer=function(N,k,de){return B.H.useReducer(N,k,de)},Ye.useRef=function(N){return B.H.useRef(N)},Ye.useState=function(N){return B.H.useState(N)},Ye.useSyncExternalStore=function(N,k,de){return B.H.useSyncExternalStore(N,k,de)},Ye.useTransition=function(){return B.H.useTransition()},Ye.version="19.2.8",Ye}var og;function od(){return og||(og=1,sd.exports=bw()),sd.exports}var j=od();const Xe=Zr(j);var ld={exports:{}},no={},cd={exports:{}},ud={};var lg;function vw(){return lg||(lg=1,(function(s){function e(J,ue){var Me=J.length;J.push(ue);e:for(;0<Me;){var te=Me-1>>>1,ge=J[te];if(0<i(ge,ue))J[te]=ue,J[Me]=ge,Me=te;else break e}}function n(J){return J.length===0?null:J[0]}function a(J){if(J.length===0)return null;var ue=J[0],Me=J.pop();if(Me!==ue){J[0]=Me;e:for(var te=0,ge=J.length,N=ge>>>1;te<N;){var k=2*(te+1)-1,de=J[k],fe=k+1,xe=J[fe];if(0>i(de,Me))fe<ge&&0>i(xe,de)?(J[te]=xe,J[fe]=Me,te=fe):(J[te]=de,J[k]=Me,te=k);else if(fe<ge&&0>i(xe,Me))J[te]=xe,J[fe]=Me,te=fe;else break e}}return ue}function i(J,ue){var Me=J.sortIndex-ue.sortIndex;return Me!==0?Me:J.id-ue.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;s.unstable_now=function(){return l.now()}}else{var c=Date,d=c.now();s.unstable_now=function(){return c.now()-d}}var f=[],h=[],m=1,y=null,S=3,v=!1,_=!1,A=!1,x=!1,D=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function L(J){for(var ue=n(h);ue!==null;){if(ue.callback===null)a(h);else if(ue.startTime<=J)a(h),ue.sortIndex=ue.expirationTime,e(f,ue);else break;ue=n(h)}}function q(J){if(A=!1,L(J),!_)if(n(f)!==null)_=!0,P||(P=!0,Ue());else{var ue=n(h);ue!==null&&Ct(q,ue.startTime-J)}}var P=!1,B=-1,W=5,he=-1;function Se(){return x?!0:!(s.unstable_now()-he<W)}function be(){if(x=!1,P){var J=s.unstable_now();he=J;var ue=!0;try{e:{_=!1,A&&(A=!1,M(B),B=-1),v=!0;var Me=S;try{t:{for(L(J),y=n(f);y!==null&&!(y.expirationTime>J&&Se());){var te=y.callback;if(typeof te=="function"){y.callback=null,S=y.priorityLevel;var ge=te(y.expirationTime<=J);if(J=s.unstable_now(),typeof ge=="function"){y.callback=ge,L(J),ue=!0;break t}y===n(f)&&a(f),L(J)}else a(f);y=n(f)}if(y!==null)ue=!0;else{var N=n(h);N!==null&&Ct(q,N.startTime-J),ue=!1}}break e}finally{y=null,S=Me,v=!1}ue=void 0}}finally{ue?Ue():P=!1}}}var Ue;if(typeof T=="function")Ue=function(){T(be)};else if(typeof MessageChannel<"u"){var Ve=new MessageChannel,Ge=Ve.port2;Ve.port1.onmessage=be,Ue=function(){Ge.postMessage(null)}}else Ue=function(){D(be,0)};function Ct(J,ue){B=D(function(){J(s.unstable_now())},ue)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(J){J.callback=null},s.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"):W=0<J?Math.floor(1e3/J):5},s.unstable_getCurrentPriorityLevel=function(){return S},s.unstable_next=function(J){switch(S){case 1:case 2:case 3:var ue=3;break;default:ue=S}var Me=S;S=ue;try{return J()}finally{S=Me}},s.unstable_requestPaint=function(){x=!0},s.unstable_runWithPriority=function(J,ue){switch(J){case 1:case 2:case 3:case 4:case 5:break;default:J=3}var Me=S;S=J;try{return ue()}finally{S=Me}},s.unstable_scheduleCallback=function(J,ue,Me){var te=s.unstable_now();switch(typeof Me=="object"&&Me!==null?(Me=Me.delay,Me=typeof Me=="number"&&0<Me?te+Me:te):Me=te,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=Me+ge,J={id:m++,callback:ue,priorityLevel:J,startTime:Me,expirationTime:ge,sortIndex:-1},Me>te?(J.sortIndex=Me,e(h,J),n(f)===null&&J===n(h)&&(A?(M(B),B=-1):A=!0,Ct(q,Me-te))):(J.sortIndex=ge,e(f,J),_||v||(_=!0,P||(P=!0,Ue()))),J},s.unstable_shouldYield=Se,s.unstable_wrapCallback=function(J){var ue=S;return function(){var Me=S;S=ue;try{return J.apply(this,arguments)}finally{S=Me}}}})(ud)),ud}var cg;function Sw(){return cg||(cg=1,cd.exports=vw()),cd.exports}var dd={exports:{}},An={};var ug;function ww(){if(ug)return An;ug=1;var s=od();function e(f){var h="https://react.dev/errors/"+f;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)h+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+f+"; visit "+h+" 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,h,m){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:y==null?null:""+y,children:f,containerInfo:h,implementation:m}}var c=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(f,h){if(f==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return An.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,An.createPortal=function(f,h){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(e(299));return l(f,h,null,m)},An.flushSync=function(f){var h=c.T,m=a.p;try{if(c.T=null,a.p=2,f)return f()}finally{c.T=h,a.p=m,a.d.f()}},An.preconnect=function(f,h){typeof f=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,a.d.C(f,h))},An.prefetchDNS=function(f){typeof f=="string"&&a.d.D(f)},An.preinit=function(f,h){if(typeof f=="string"&&h&&typeof h.as=="string"){var m=h.as,y=d(m,h.crossOrigin),S=typeof h.integrity=="string"?h.integrity:void 0,v=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;m==="style"?a.d.S(f,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:y,integrity:S,fetchPriority:v}):m==="script"&&a.d.X(f,{crossOrigin:y,integrity:S,fetchPriority:v,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},An.preinitModule=function(f,h){if(typeof f=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var m=d(h.as,h.crossOrigin);a.d.M(f,{crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&a.d.M(f)},An.preload=function(f,h){if(typeof f=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var m=h.as,y=d(m,h.crossOrigin);a.d.L(f,m,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},An.preloadModule=function(f,h){if(typeof f=="string")if(h){var m=d(h.as,h.crossOrigin);a.d.m(f,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else a.d.m(f)},An.requestFormReset=function(f){a.d.r(f)},An.unstable_batchedUpdates=function(f,h){return f(h)},An.useFormState=function(f,h,m){return c.H.useFormState(f,h,m)},An.useFormStatus=function(){return c.H.useHostTransitionStatus()},An.version="19.2.8",An}var dg;function fg(){if(dg)return dd.exports;dg=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(e){console.error(e)}}return s(),dd.exports=ww(),dd.exports}var hg;function Cw(){if(hg)return no;hg=1;var s=Sw(),e=od(),n=fg();function a(t){var r="https://react.dev/errors/"+t;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)r+="&args[]="+encodeURIComponent(arguments[o])}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,o=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,(r.flags&4098)!==0&&(o=r.return),t=r.return;while(t)}return r.tag===3?o:null}function c(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 h(t){var r=t.alternate;if(!r){if(r=l(t),r===null)throw Error(a(188));return r!==t?null:t}for(var o=t,u=r;;){var p=o.return;if(p===null)break;var g=p.alternate;if(g===null){if(u=p.return,u!==null){o=u;continue}break}if(p.child===g.child){for(g=p.child;g;){if(g===o)return f(p),t;if(g===u)return f(p),r;g=g.sibling}throw Error(a(188))}if(o.return!==u.return)o=p,u=g;else{for(var C=!1,R=p.child;R;){if(R===o){C=!0,o=p,u=g;break}if(R===u){C=!0,u=p,o=g;break}R=R.sibling}if(!C){for(R=g.child;R;){if(R===o){C=!0,o=g,u=p;break}if(R===u){C=!0,u=g,o=p;break}R=R.sibling}if(!C)throw Error(a(189))}}if(o.alternate!==u)throw Error(a(190))}if(o.tag!==3)throw Error(a(188));return o.stateNode.current===o?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 y=Object.assign,S=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),T=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),q=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),he=Symbol.for("react.activity"),Se=Symbol.for("react.memo_cache_sentinel"),be=Symbol.iterator;function Ue(t){return t===null||typeof t!="object"?null:(t=be&&t[be]||t["@@iterator"],typeof t=="function"?t:null)}var Ve=Symbol.for("react.client.reference");function Ge(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 D:return"Profiler";case x:return"StrictMode";case q:return"Suspense";case P:return"SuspenseList";case he:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case _:return"Portal";case T:return t.displayName||"Context";case M:return(t._context.displayName||"Context")+".Consumer";case L:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case B:return r=t.displayName||null,r!==null?r:Ge(t.type)||"Memo";case W:r=t._payload,t=t._init;try{return Ge(t(r))}catch{}}return null}var Ct=Array.isArray,J=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Me={pending:!1,data:null,method:null,action:null},te=[],ge=-1;function N(t){return{current:t}}function k(t){0>ge||(t.current=te[ge],te[ge]=null,ge--)}function de(t,r){ge++,te[ge]=t.current,t.current=r}var fe=N(null),xe=N(null),ee=N(null),_e=N(null);function Be(t,r){switch(de(ee,r),de(xe,t),de(fe,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?zS(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=zS(r),t=US(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}k(fe),de(fe,t)}function Re(){k(fe),k(xe),k(ee)}function Ie(t){t.memoizedState!==null&&de(_e,t);var r=fe.current,o=US(r,t.type);r!==o&&(de(xe,t),de(fe,o))}function Et(t){xe.current===t&&(k(fe),k(xe)),_e.current===t&&(k(_e),Nl._currentValue=Me)}var lt,Lt;function St(t){if(lt===void 0)try{throw Error()}catch(o){var r=o.stack.trim().match(/\n( *(at )?)/);lt=r&&r[1]||"",Lt=-1<o.stack.indexOf(`
|
||
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
|
||
`+lt+t+Lt}var At=!1;function Oe(t,r){if(!t||At)return"";At=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(r){var le=function(){throw Error()};if(Object.defineProperty(le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(le,[])}catch(ne){var Q=ne}Reflect.construct(t,[],le)}else{try{le.call()}catch(ne){Q=ne}t.call(le.prototype)}}else{try{throw Error()}catch(ne){Q=ne}(le=t())&&typeof le.catch=="function"&&le.catch(function(){})}}catch(ne){if(ne&&Q&&typeof ne.stack=="string")return[ne.stack,Q.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=u.DetermineComponentFrameRoot(),C=g[0],R=g[1];if(C&&R){var z=C.split(`
|
||
`),X=R.split(`
|
||
`);for(p=u=0;u<z.length&&!z[u].includes("DetermineComponentFrameRoot");)u++;for(;p<X.length&&!X[p].includes("DetermineComponentFrameRoot");)p++;if(u===z.length||p===X.length)for(u=z.length-1,p=X.length-1;1<=u&&0<=p&&z[u]!==X[p];)p--;for(;1<=u&&0<=p;u--,p--)if(z[u]!==X[p]){if(u!==1||p!==1)do if(u--,p--,0>p||z[u]!==X[p]){var ae=`
|
||
`+z[u].replace(" at new "," at ");return t.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",t.displayName)),ae}while(1<=u&&0<=p);break}}}finally{At=!1,Error.prepareStackTrace=o}return(o=t?t.displayName||t.name:"")?St(o):""}function rt(t,r){switch(t.tag){case 26:case 27:case 5:return St(t.type);case 16:return St("Lazy");case 13:return t.child!==r&&r!==null?St("Suspense Fallback"):St("Suspense");case 19:return St("SuspenseList");case 0:case 15:return Oe(t.type,!1);case 11:return Oe(t.type.render,!1);case 1:return Oe(t.type,!0);case 31:return St("Activity");default:return""}}function on(t){try{var r="",o=null;do r+=rt(t,o),o=t,t=t.return;while(t);return r}catch(u){return`
|
||
Error generating stack: `+u.message+`
|
||
`+u.stack}}var $t=Object.prototype.hasOwnProperty,Vt=s.unstable_scheduleCallback,ln=s.unstable_cancelCallback,cn=s.unstable_shouldYield,Gr=s.unstable_requestPaint,Kt=s.unstable_now,Ai=s.unstable_getCurrentPriorityLevel,aa=s.unstable_ImmediatePriority,bn=s.unstable_UserBlockingPriority,Ln=s.unstable_NormalPriority,at=s.unstable_LowPriority,Hn=s.unstable_IdlePriority,vn=s.log,ia=s.unstable_setDisableYieldValue,lr=null,un=null;function kn(t){if(typeof vn=="function"&&ia(t),un&&typeof un.setStrictMode=="function")try{un.setStrictMode(lr,t)}catch{}}var dn=Math.clz32?Math.clz32:ce,F=Math.log,se=Math.LN2;function ce(t){return t>>>=0,t===0?32:31-(F(t)/se|0)|0}var Z=256,ve=262144,pe=4194304;function Ce(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 Ae(t,r,o){var u=t.pendingLanes;if(u===0)return 0;var p=0,g=t.suspendedLanes,C=t.pingedLanes;t=t.warmLanes;var R=u&134217727;return R!==0?(u=R&~g,u!==0?p=Ce(u):(C&=R,C!==0?p=Ce(C):o||(o=R&~t,o!==0&&(p=Ce(o))))):(R=u&~g,R!==0?p=Ce(R):C!==0?p=Ce(C):o||(o=u&~t,o!==0&&(p=Ce(o)))),p===0?0:r!==0&&r!==p&&(r&g)===0&&(g=p&-p,o=r&-r,g>=o||g===32&&(o&4194048)!==0)?r:p}function Ke(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function Te(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 $e(){var t=pe;return pe<<=1,(pe&62914560)===0&&(pe=4194304),t}function ke(t){for(var r=[],o=0;31>o;o++)r.push(t);return r}function tt(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function He(t,r,o,u,p,g){var C=t.pendingLanes;t.pendingLanes=o,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=o,t.entangledLanes&=o,t.errorRecoveryDisabledLanes&=o,t.shellSuspendCounter=0;var R=t.entanglements,z=t.expirationTimes,X=t.hiddenUpdates;for(o=C&~o;0<o;){var ae=31-dn(o),le=1<<ae;R[ae]=0,z[ae]=-1;var Q=X[ae];if(Q!==null)for(X[ae]=null,ae=0;ae<Q.length;ae++){var ne=Q[ae];ne!==null&&(ne.lane&=-536870913)}o&=~le}u!==0&&Fe(t,u,0),g!==0&&p===0&&t.tag!==0&&(t.suspendedLanes|=g&~(C&~r))}function Fe(t,r,o){t.pendingLanes|=r,t.suspendedLanes&=~r;var u=31-dn(r);t.entangledLanes|=r,t.entanglements[u]=t.entanglements[u]|1073741824|o&261930}function we(t,r){var o=t.entangledLanes|=r;for(t=t.entanglements;o;){var u=31-dn(o),p=1<<u;p&r|t[u]&r&&(t[u]|=r),o&=~p}}function je(t,r){var o=r&-r;return o=(o&42)!==0?1:nt(o),(o&(t.suspendedLanes|r))!==0?0:o}function nt(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 kt(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function jt(){var t=ue.p;return t!==0?t:(t=window.event,t===void 0?32:cw(t.type))}function Mn(t,r){var o=ue.p;try{return ue.p=t,r()}finally{ue.p=o}}var Ut=Math.random().toString(36).slice(2),Pt="__reactFiber$"+Ut,Rn="__reactProps$"+Ut,Ia="__reactContainer$"+Ut,Bo="__reactEvents$"+Ut,Bf="__reactListeners$"+Ut,$c="__reactHandles$"+Ut,Fr="__reactResources$"+Ut,xi="__reactMarker$"+Ut;function qo(t){delete t[Pt],delete t[Rn],delete t[Bo],delete t[Bf],delete t[$c]}function ja(t){var r=t[Pt];if(r)return r;for(var o=t.parentNode;o;){if(r=o[Ia]||o[Pt]){if(o=r.alternate,r.child!==null||o!==null&&o.child!==null)for(t=KS(t);t!==null;){if(o=t[Pt])return o;t=KS(t)}return r}t=o,o=t.parentNode}return null}function Vr(t){if(t=t[Pt]||t[Ia]){var r=t.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return t}return null}function sa(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t.stateNode;throw Error(a(33))}function Ha(t){var r=t[Fr];return r||(r=t[Fr]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function en(t){t[xi]=!0}var Nc=new Set,Ic={};function Rr(t,r){za(t,r),za(t+"Capture",r)}function za(t,r){for(Ic[t]=r,t=0;t<r.length;t++)Nc.add(r[t])}var qf=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]*$"),jc={},Hc={};function Gf(t){return $t.call(Hc,t)?!0:$t.call(jc,t)?!1:qf.test(t)?Hc[t]=!0:(jc[t]=!0,!1)}function zn(t,r,o){if(Gf(r))if(o===null)t.removeAttribute(r);else{switch(typeof o){case"undefined":case"function":case"symbol":t.removeAttribute(r);return;case"boolean":var u=r.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){t.removeAttribute(r);return}}t.setAttribute(r,""+o)}}function Ti(t,r,o){if(o===null)t.removeAttribute(r);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttribute(r,""+o)}}function Sn(t,r,o,u){if(u===null)t.removeAttribute(o);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(o);return}t.setAttributeNS(r,o,""+u)}}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 zc(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Ff(t,r,o){var u=Object.getOwnPropertyDescriptor(t.constructor.prototype,r);if(!t.hasOwnProperty(r)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var p=u.get,g=u.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return p.call(this)},set:function(C){o=""+C,g.call(this,C)}}),Object.defineProperty(t,r,{enumerable:u.enumerable}),{getValue:function(){return o},setValue:function(C){o=""+C},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function Go(t){if(!t._valueTracker){var r=zc(t)?"checked":"value";t._valueTracker=Ff(t,r,""+t[r])}}function Uc(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var o=r.getValue(),u="";return t&&(u=zc(t)?t.checked?"true":"false":t.value),t=u,t!==o?(r.setValue(t),!0):!1}function Ua(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 Vf=/[\n"\\]/g;function Un(t){return t.replace(Vf,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Cs(t,r,o,u,p,g,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?oa(t,C,Dn(r)):o!=null?oa(t,C,Dn(o)):u!=null&&t.removeAttribute("value"),p==null&&g!=null&&(t.defaultChecked=!!g),p!=null&&(t.checked=p&&typeof p!="function"&&typeof p!="symbol"),R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?t.name=""+Dn(R):t.removeAttribute("name")}function ki(t,r,o,u,p,g,C,R){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(t.type=g),r!=null||o!=null){if(!(g!=="submit"&&g!=="reset"||r!=null)){Go(t);return}o=o!=null?""+Dn(o):"",r=r!=null?""+Dn(r):o,R||r===t.value||(t.value=r),t.defaultValue=r}u=u??p,u=typeof u!="function"&&typeof u!="symbol"&&!!u,t.checked=R?t.checked:!!u,t.defaultChecked=!!u,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(t.name=C),Go(t)}function oa(t,r,o){r==="number"&&Ua(t.ownerDocument)===t||t.defaultValue===""+o||(t.defaultValue=""+o)}function Pa(t,r,o,u){if(t=t.options,r){r={};for(var p=0;p<o.length;p++)r["$"+o[p]]=!0;for(o=0;o<t.length;o++)p=r.hasOwnProperty("$"+t[o].value),t[o].selected!==p&&(t[o].selected=p),p&&u&&(t[o].defaultSelected=!0)}else{for(o=""+Dn(o),r=null,p=0;p<t.length;p++){if(t[p].value===o){t[p].selected=!0,u&&(t[p].defaultSelected=!0);return}r!==null||t[p].disabled||(r=t[p])}r!==null&&(r.selected=!0)}}function Ba(t,r,o){if(r!=null&&(r=""+Dn(r),r!==t.value&&(t.value=r),o==null)){t.defaultValue!==r&&(t.defaultValue=r);return}t.defaultValue=o!=null?""+Dn(o):""}function Pc(t,r,o,u){if(r==null){if(u!=null){if(o!=null)throw Error(a(92));if(Ct(u)){if(1<u.length)throw Error(a(93));u=u[0]}o=u}o==null&&(o=""),r=o}o=Dn(r),t.defaultValue=o,u=t.textContent,u===o&&u!==""&&u!==null&&(t.value=u),Go(t)}function qa(t,r){if(r){var o=t.firstChild;if(o&&o===t.lastChild&&o.nodeType===3){o.nodeValue=r;return}}t.textContent=r}var Kf=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 Bc(t,r,o){var u=r.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?u?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="":u?t.setProperty(r,o):typeof o!="number"||o===0||Kf.has(r)?r==="float"?t.cssFloat=o:t[r]=(""+o).trim():t[r]=o+"px"}function qc(t,r,o){if(r!=null&&typeof r!="object")throw Error(a(62));if(t=t.style,o!=null){for(var u in o)!o.hasOwnProperty(u)||r!=null&&r.hasOwnProperty(u)||(u.indexOf("--")===0?t.setProperty(u,""):u==="float"?t.cssFloat="":t[u]="");for(var p in r)u=r[p],r.hasOwnProperty(p)&&o[p]!==u&&Bc(t,p,u)}else for(var g in r)r.hasOwnProperty(g)&&Bc(t,g,r[g])}function Fo(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 Wf=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"]]),Vo=/^[\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 cr(t){return Vo.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Dr(){}var Ko=null;function Wo(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Ga=null,la=null;function Gc(t){var r=Vr(t);if(r&&(t=r.stateNode)){var o=t[Rn]||null;e:switch(t=r.stateNode,r.type){case"input":if(Cs(t,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),r=o.name,o.type==="radio"&&r!=null){for(o=t;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+Un(""+r)+'"][type="radio"]'),r=0;r<o.length;r++){var u=o[r];if(u!==t&&u.form===t.form){var p=u[Rn]||null;if(!p)throw Error(a(90));Cs(u,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(r=0;r<o.length;r++)u=o[r],u.form===t.form&&Uc(u)}break e;case"textarea":Ba(t,o.value,o.defaultValue);break e;case"select":r=o.value,r!=null&&Pa(t,!!o.multiple,r,!1)}}}var Es=!1;function Fc(t,r,o){if(Es)return t(r,o);Es=!0;try{var u=t(r);return u}finally{if(Es=!1,(Ga!==null||la!==null)&&(Hu(),Ga&&(r=Ga,t=la,la=Ga=null,Gc(r),t)))for(r=0;r<t.length;r++)Gc(t[r])}}function Ri(t,r){var o=t.stateNode;if(o===null)return null;var u=o[Rn]||null;if(u===null)return null;o=u[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":(u=!u.disabled)||(t=t.type,u=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!u;break e;default:t=!1}if(t)return null;if(o&&typeof o!="function")throw Error(a(231,r,typeof o));return o}var Or=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Yo=!1;if(Or)try{var Di={};Object.defineProperty(Di,"passive",{get:function(){Yo=!0}}),window.addEventListener("test",Di,Di),window.removeEventListener("test",Di,Di)}catch{Yo=!1}var Kr=null,Xo=null,_s=null;function Vc(){if(_s)return _s;var t,r=Xo,o=r.length,u,p="value"in Kr?Kr.value:Kr.textContent,g=p.length;for(t=0;t<o&&r[t]===p[t];t++);var C=o-t;for(u=1;u<=C&&r[o-u]===p[g-u];u++);return _s=p.slice(t,1<u?1-u:void 0)}function Oi(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 Jo(){return!0}function Kc(){return!1}function ze(t){function r(o,u,p,g,C){this._reactName=o,this._targetInst=p,this.type=u,this.nativeEvent=g,this.target=C,this.currentTarget=null;for(var R in t)t.hasOwnProperty(R)&&(o=t[R],this[R]=o?o(g):g[R]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?Jo:Kc,this.isPropagationStopped=Kc,this}return y(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=Jo)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=Jo)},persist:function(){},isPersistent:Jo}),r}var Lr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ca=ze(Lr),Li=y({},Lr,{view:0,detail:0}),Yf=ze(Li),As,Qo,Mi,xs=y({},Li,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:el,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!==Mi&&(Mi&&t.type==="mousemove"?(As=t.screenX-Mi.screenX,Qo=t.screenY-Mi.screenY):Qo=As=0,Mi=t),As)},movementY:function(t){return"movementY"in t?t.movementY:Qo}}),Wc=ze(xs),Xf=y({},xs,{dataTransfer:0}),tb=ze(Xf),Jf=y({},Li,{relatedTarget:0}),Zo=ze(Jf),nb=y({},Lr,{animationName:0,elapsedTime:0,pseudoElement:0}),Qf=ze(nb),Zf=y({},Lr,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Yc=ze(Zf),eh=y({},Lr,{data:0}),Xc=ze(eh),th={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},nh={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"},rh={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Jc(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=rh[t])?!!r[t]:!1}function el(){return Jc}var ah=y({},Li,{key:function(t){if(t.key){var r=th[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=Oi(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?nh[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:el,charCode:function(t){return t.type==="keypress"?Oi(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Oi(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),ih=ze(ah),sh=y({},xs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Qc=ze(sh),oh=y({},Li,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:el}),lh=ze(oh),fn=y({},Lr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ts=ze(fn),ch=y({},xs,{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=ze(ch),b=y({},Lr,{newState:0,oldState:0}),w=ze(b),O=[9,13,27,32],I=Or&&"CompositionEvent"in window,re=null;Or&&"documentMode"in document&&(re=document.documentMode);var me=Or&&"TextEvent"in window&&!re,Le=Or&&(!I||re&&8<re&&11>=re),We=" ",ft=!1;function mt(t,r){switch(t){case"keyup":return O.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bt(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Mr=!1;function uh(t,r){switch(t){case"compositionend":return Bt(r);case"keypress":return r.which!==32?null:(ft=!0,We);case"textInput":return t=r.data,t===We&&ft?null:t;default:return null}}function Zc(t,r){if(Mr)return t==="compositionend"||!I&&mt(t,r)?(t=Vc(),_s=Xo=Kr=null,Mr=!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 Le&&r.locale!=="ko"?null:r.data;default:return null}}var dh={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 tl(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!dh[t.type]:r==="textarea"}function eu(t,r,o,u){Ga?la?la.push(u):la=[u]:Ga=u,r=Fu(r,"onChange"),0<r.length&&(o=new ca("onChange","change",null,o,u),t.push({event:o,listeners:r}))}var Fa=null,$i=null;function fh(t){MS(t,0)}function Ni(t){var r=sa(t);if(Uc(r))return t}function nl(t,r){if(t==="change")return r}var rl=!1;if(Or){var Ii;if(Or){var ji="oninput"in document;if(!ji){var al=document.createElement("div");al.setAttribute("oninput","return;"),ji=typeof al.oninput=="function"}Ii=ji}else Ii=!1;rl=Ii&&(!document.documentMode||9<document.documentMode)}function tu(){Fa&&(Fa.detachEvent("onpropertychange",nu),$i=Fa=null)}function nu(t){if(t.propertyName==="value"&&Ni($i)){var r=[];eu(r,$i,t,Wo(t)),Fc(fh,r)}}function hh(t,r,o){t==="focusin"?(tu(),Fa=r,$i=o,Fa.attachEvent("onpropertychange",nu)):t==="focusout"&&tu()}function ph(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Ni($i)}function ru(t,r){if(t==="click")return Ni(r)}function Lx(t,r){if(t==="input"||t==="change")return Ni(r)}function Mx(t,r){return t===r&&(t!==0||1/t===1/r)||t!==t&&r!==r}var Xn=typeof Object.is=="function"?Object.is:Mx;function il(t,r){if(Xn(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;var o=Object.keys(t),u=Object.keys(r);if(o.length!==u.length)return!1;for(u=0;u<o.length;u++){var p=o[u];if(!$t.call(r,p)||!Xn(t[p],r[p]))return!1}return!0}function rb(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function ab(t,r){var o=rb(t);t=0;for(var u;o;){if(o.nodeType===3){if(u=t+o.textContent.length,t<=r&&u>=r)return{node:o,offset:r-t};t=u}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=rb(o)}}function ib(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?ib(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function sb(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var r=Ua(t.document);r instanceof t.HTMLIFrameElement;){try{var o=typeof r.contentWindow.location.href=="string"}catch{o=!1}if(o)t=r.contentWindow;else break;r=Ua(t.document)}return r}function gh(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 $x=Or&&"documentMode"in document&&11>=document.documentMode,ks=null,mh=null,sl=null,yh=!1;function ob(t,r,o){var u=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;yh||ks==null||ks!==Ua(u)||(u=ks,"selectionStart"in u&&gh(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),sl&&il(sl,u)||(sl=u,u=Fu(mh,"onSelect"),0<u.length&&(r=new ca("onSelect","select",null,r,o),t.push({event:r,listeners:u}),r.target=ks)))}function Hi(t,r){var o={};return o[t.toLowerCase()]=r.toLowerCase(),o["Webkit"+t]="webkit"+r,o["Moz"+t]="moz"+r,o}var Rs={animationend:Hi("Animation","AnimationEnd"),animationiteration:Hi("Animation","AnimationIteration"),animationstart:Hi("Animation","AnimationStart"),transitionrun:Hi("Transition","TransitionRun"),transitionstart:Hi("Transition","TransitionStart"),transitioncancel:Hi("Transition","TransitionCancel"),transitionend:Hi("Transition","TransitionEnd")},bh={},lb={};Or&&(lb=document.createElement("div").style,"AnimationEvent"in window||(delete Rs.animationend.animation,delete Rs.animationiteration.animation,delete Rs.animationstart.animation),"TransitionEvent"in window||delete Rs.transitionend.transition);function zi(t){if(bh[t])return bh[t];if(!Rs[t])return t;var r=Rs[t],o;for(o in r)if(r.hasOwnProperty(o)&&o in lb)return bh[t]=r[o];return t}var cb=zi("animationend"),ub=zi("animationiteration"),db=zi("animationstart"),Nx=zi("transitionrun"),Ix=zi("transitionstart"),jx=zi("transitioncancel"),fb=zi("transitionend"),hb=new Map,vh="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(" ");vh.push("scrollEnd");function $r(t,r){hb.set(t,r),Rr(r,[t])}var au=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)},ur=[],Ds=0,Sh=0;function iu(){for(var t=Ds,r=Sh=Ds=0;r<t;){var o=ur[r];ur[r++]=null;var u=ur[r];ur[r++]=null;var p=ur[r];ur[r++]=null;var g=ur[r];if(ur[r++]=null,u!==null&&p!==null){var C=u.pending;C===null?p.next=p:(p.next=C.next,C.next=p),u.pending=p}g!==0&&pb(o,p,g)}}function su(t,r,o,u){ur[Ds++]=t,ur[Ds++]=r,ur[Ds++]=o,ur[Ds++]=u,Sh|=u,t.lanes|=u,t=t.alternate,t!==null&&(t.lanes|=u)}function wh(t,r,o,u){return su(t,r,o,u),ou(t)}function Ui(t,r){return su(t,null,null,r),ou(t)}function pb(t,r,o){t.lanes|=o;var u=t.alternate;u!==null&&(u.lanes|=o);for(var p=!1,g=t.return;g!==null;)g.childLanes|=o,u=g.alternate,u!==null&&(u.childLanes|=o),g.tag===22&&(t=g.stateNode,t===null||t._visibility&1||(p=!0)),t=g,g=g.return;return t.tag===3?(g=t.stateNode,p&&r!==null&&(p=31-dn(o),t=g.hiddenUpdates,u=t[p],u===null?t[p]=[r]:u.push(r),r.lane=o|536870912),g):null}function ou(t){if(50<kl)throw kl=0,Dp=null,Error(a(185));for(var r=t.return;r!==null;)t=r,r=t.return;return t.tag===3?t.stateNode:null}var Os={};function Hx(t,r,o,u){this.tag=t,this.key=o,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=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Jn(t,r,o,u){return new Hx(t,r,o,u)}function Ch(t){return t=t.prototype,!(!t||!t.isReactComponent)}function ua(t,r){var o=t.alternate;return o===null?(o=Jn(t.tag,r,t.key,t.mode),o.elementType=t.elementType,o.type=t.type,o.stateNode=t.stateNode,o.alternate=t,t.alternate=o):(o.pendingProps=r,o.type=t.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=t.flags&65011712,o.childLanes=t.childLanes,o.lanes=t.lanes,o.child=t.child,o.memoizedProps=t.memoizedProps,o.memoizedState=t.memoizedState,o.updateQueue=t.updateQueue,r=t.dependencies,o.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},o.sibling=t.sibling,o.index=t.index,o.ref=t.ref,o.refCleanup=t.refCleanup,o}function gb(t,r){t.flags&=65011714;var o=t.alternate;return o===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=o.childLanes,t.lanes=o.lanes,t.child=o.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=o.memoizedProps,t.memoizedState=o.memoizedState,t.updateQueue=o.updateQueue,t.type=o.type,r=o.dependencies,t.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),t}function lu(t,r,o,u,p,g){var C=0;if(u=t,typeof t=="function")Ch(t)&&(C=1);else if(typeof t=="string")C=qT(t,o,fe.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case he:return t=Jn(31,o,r,p),t.elementType=he,t.lanes=g,t;case A:return Pi(o.children,p,g,r);case x:C=8,p|=24;break;case D:return t=Jn(12,o,r,p|2),t.elementType=D,t.lanes=g,t;case q:return t=Jn(13,o,r,p),t.elementType=q,t.lanes=g,t;case P:return t=Jn(19,o,r,p),t.elementType=P,t.lanes=g,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case T:C=10;break e;case M:C=9;break e;case L:C=11;break e;case B:C=14;break e;case W:C=16,u=null;break e}C=29,o=Error(a(130,t===null?"null":typeof t,"")),u=null}return r=Jn(C,o,r,p),r.elementType=t,r.type=u,r.lanes=g,r}function Pi(t,r,o,u){return t=Jn(7,t,u,r),t.lanes=o,t}function Eh(t,r,o){return t=Jn(6,t,null,r),t.lanes=o,t}function mb(t){var r=Jn(18,null,null,0);return r.stateNode=t,r}function _h(t,r,o){return r=Jn(4,t.children!==null?t.children:[],t.key,r),r.lanes=o,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}var yb=new WeakMap;function dr(t,r){if(typeof t=="object"&&t!==null){var o=yb.get(t);return o!==void 0?o:(r={value:t,source:r,stack:on(r)},yb.set(t,r),r)}return{value:t,source:r,stack:on(r)}}var Ls=[],Ms=0,cu=null,ol=0,fr=[],hr=0,Va=null,Wr=1,Yr="";function da(t,r){Ls[Ms++]=ol,Ls[Ms++]=cu,cu=t,ol=r}function bb(t,r,o){fr[hr++]=Wr,fr[hr++]=Yr,fr[hr++]=Va,Va=t;var u=Wr;t=Yr;var p=32-dn(u)-1;u&=~(1<<p),o+=1;var g=32-dn(r)+p;if(30<g){var C=p-p%5;g=(u&(1<<C)-1).toString(32),u>>=C,p-=C,Wr=1<<32-dn(r)+p|o<<p|u,Yr=g+t}else Wr=1<<g|o<<p|u,Yr=t}function Ah(t){t.return!==null&&(da(t,1),bb(t,1,0))}function xh(t){for(;t===cu;)cu=Ls[--Ms],Ls[Ms]=null,ol=Ls[--Ms],Ls[Ms]=null;for(;t===Va;)Va=fr[--hr],fr[hr]=null,Yr=fr[--hr],fr[hr]=null,Wr=fr[--hr],fr[hr]=null}function vb(t,r){fr[hr++]=Wr,fr[hr++]=Yr,fr[hr++]=Va,Wr=r.id,Yr=r.overflow,Va=t}var wn=null,Nt=null,ht=!1,Ka=null,pr=!1,Th=Error(a(519));function Wa(t){var r=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ll(dr(r,t)),Th}function Sb(t){var r=t.stateNode,o=t.type,u=t.memoizedProps;switch(r[Pt]=t,r[Rn]=u,o){case"dialog":st("cancel",r),st("close",r);break;case"iframe":case"object":case"embed":st("load",r);break;case"video":case"audio":for(o=0;o<Dl.length;o++)st(Dl[o],r);break;case"source":st("error",r);break;case"img":case"image":case"link":st("error",r),st("load",r);break;case"details":st("toggle",r);break;case"input":st("invalid",r),ki(r,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":st("invalid",r);break;case"textarea":st("invalid",r),Pc(r,u.value,u.defaultValue,u.children)}o=u.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||r.textContent===""+o||u.suppressHydrationWarning===!0||jS(r.textContent,o)?(u.popover!=null&&(st("beforetoggle",r),st("toggle",r)),u.onScroll!=null&&st("scroll",r),u.onScrollEnd!=null&&st("scrollend",r),u.onClick!=null&&(r.onclick=Dr),r=!0):r=!1,r||Wa(t,!0)}function wb(t){for(wn=t.return;wn;)switch(wn.tag){case 5:case 31:case 13:pr=!1;return;case 27:case 3:pr=!0;return;default:wn=wn.return}}function $s(t){if(t!==wn)return!1;if(!ht)return wb(t),ht=!0,!1;var r=t.tag,o;if((o=r!==3&&r!==27)&&((o=r===5)&&(o=t.type,o=!(o!=="form"&&o!=="button")||Fp(t.type,t.memoizedProps)),o=!o),o&&Nt&&Wa(t),wb(t),r===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));Nt=VS(t)}else if(r===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));Nt=VS(t)}else r===27?(r=Nt,li(t.type)?(t=Xp,Xp=null,Nt=t):Nt=r):Nt=wn?mr(t.stateNode.nextSibling):null;return!0}function Bi(){Nt=wn=null,ht=!1}function kh(){var t=Ka;return t!==null&&(Gn===null?Gn=t:Gn.push.apply(Gn,t),Ka=null),t}function ll(t){Ka===null?Ka=[t]:Ka.push(t)}var Rh=N(null),qi=null,fa=null;function Ya(t,r,o){de(Rh,r._currentValue),r._currentValue=o}function ha(t){t._currentValue=Rh.current,k(Rh)}function Dh(t,r,o){for(;t!==null;){var u=t.alternate;if((t.childLanes&r)!==r?(t.childLanes|=r,u!==null&&(u.childLanes|=r)):u!==null&&(u.childLanes&r)!==r&&(u.childLanes|=r),t===o)break;t=t.return}}function Oh(t,r,o,u){var p=t.child;for(p!==null&&(p.return=t);p!==null;){var g=p.dependencies;if(g!==null){var C=p.child;g=g.firstContext;e:for(;g!==null;){var R=g;g=p;for(var z=0;z<r.length;z++)if(R.context===r[z]){g.lanes|=o,R=g.alternate,R!==null&&(R.lanes|=o),Dh(g.return,o,t),u||(C=null);break e}g=R.next}}else if(p.tag===18){if(C=p.return,C===null)throw Error(a(341));C.lanes|=o,g=C.alternate,g!==null&&(g.lanes|=o),Dh(C,o,t),C=null}else C=p.child;if(C!==null)C.return=p;else for(C=p;C!==null;){if(C===t){C=null;break}if(p=C.sibling,p!==null){p.return=C.return,C=p;break}C=C.return}p=C}}function Ns(t,r,o,u){t=null;for(var p=r,g=!1;p!==null;){if(!g){if((p.flags&524288)!==0)g=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var C=p.alternate;if(C===null)throw Error(a(387));if(C=C.memoizedProps,C!==null){var R=p.type;Xn(p.pendingProps.value,C.value)||(t!==null?t.push(R):t=[R])}}else if(p===_e.current){if(C=p.alternate,C===null)throw Error(a(387));C.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(t!==null?t.push(Nl):t=[Nl])}p=p.return}t!==null&&Oh(r,t,o,u),r.flags|=262144}function uu(t){for(t=t.firstContext;t!==null;){if(!Xn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Gi(t){qi=t,fa=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Cn(t){return Cb(qi,t)}function du(t,r){return qi===null&&Gi(t),Cb(t,r)}function Cb(t,r){var o=r._currentValue;if(r={context:r,memoizedValue:o,next:null},fa===null){if(t===null)throw Error(a(308));fa=r,t.dependencies={lanes:0,firstContext:r},t.flags|=524288}else fa=fa.next=r;return o}var zx=typeof AbortController<"u"?AbortController:function(){var t=[],r=this.signal={aborted:!1,addEventListener:function(o,u){t.push(u)}};this.abort=function(){r.aborted=!0,t.forEach(function(o){return o()})}},Ux=s.unstable_scheduleCallback,Px=s.unstable_NormalPriority,tn={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Lh(){return{controller:new zx,data:new Map,refCount:0}}function cl(t){t.refCount--,t.refCount===0&&Ux(Px,function(){t.controller.abort()})}var ul=null,Mh=0,Is=0,js=null;function Bx(t,r){if(ul===null){var o=ul=[];Mh=0,Is=Ip(),js={status:"pending",value:void 0,then:function(u){o.push(u)}}}return Mh++,r.then(Eb,Eb),r}function Eb(){if(--Mh===0&&ul!==null){js!==null&&(js.status="fulfilled");var t=ul;ul=null,Is=0,js=null;for(var r=0;r<t.length;r++)(0,t[r])()}}function qx(t,r){var o=[],u={status:"pending",value:null,reason:null,then:function(p){o.push(p)}};return t.then(function(){u.status="fulfilled",u.value=r;for(var p=0;p<o.length;p++)(0,o[p])(r)},function(p){for(u.status="rejected",u.reason=p,p=0;p<o.length;p++)(0,o[p])(void 0)}),u}var _b=J.S;J.S=function(t,r){oS=Kt(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&Bx(t,r),_b!==null&&_b(t,r)};var Fi=N(null);function $h(){var t=Fi.current;return t!==null?t:Mt.pooledCache}function fu(t,r){r===null?de(Fi,Fi.current):de(Fi,r.pool)}function Ab(){var t=$h();return t===null?null:{parent:tn._currentValue,pool:t}}var Hs=Error(a(460)),Nh=Error(a(474)),hu=Error(a(542)),pu={then:function(){}};function xb(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Tb(t,r,o){switch(o=t[o],o===void 0?t.push(r):o!==r&&(r.then(Dr,Dr),r=o),r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Rb(t),t;default:if(typeof r.status=="string")r.then(Dr,Dr);else{if(t=Mt,t!==null&&100<t.shellSuspendCounter)throw Error(a(482));t=r,t.status="pending",t.then(function(u){if(r.status==="pending"){var p=r;p.status="fulfilled",p.value=u}},function(u){if(r.status==="pending"){var p=r;p.status="rejected",p.reason=u}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Rb(t),t}throw Ki=r,Hs}}function Vi(t){try{var r=t._init;return r(t._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(Ki=o,Hs):o}}var Ki=null;function kb(){if(Ki===null)throw Error(a(459));var t=Ki;return Ki=null,t}function Rb(t){if(t===Hs||t===hu)throw Error(a(483))}var zs=null,dl=0;function gu(t){var r=dl;return dl+=1,zs===null&&(zs=[]),Tb(zs,t,r)}function fl(t,r){r=r.props.ref,t.ref=r!==void 0?r:null}function mu(t,r){throw r.$$typeof===S?Error(a(525)):(t=Object.prototype.toString.call(r),Error(a(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t)))}function Db(t){function r(K,G){if(t){var Y=K.deletions;Y===null?(K.deletions=[G],K.flags|=16):Y.push(G)}}function o(K,G){if(!t)return null;for(;G!==null;)r(K,G),G=G.sibling;return null}function u(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 p(K,G){return K=ua(K,G),K.index=0,K.sibling=null,K}function g(K,G,Y){return K.index=Y,t?(Y=K.alternate,Y!==null?(Y=Y.index,Y<G?(K.flags|=67108866,G):Y):(K.flags|=67108866,G)):(K.flags|=1048576,G)}function C(K){return t&&K.alternate===null&&(K.flags|=67108866),K}function R(K,G,Y,oe){return G===null||G.tag!==6?(G=Eh(Y,K.mode,oe),G.return=K,G):(G=p(G,Y),G.return=K,G)}function z(K,G,Y,oe){var Pe=Y.type;return Pe===A?ae(K,G,Y.props.children,oe,Y.key):G!==null&&(G.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===W&&Vi(Pe)===G.type)?(G=p(G,Y.props),fl(G,Y),G.return=K,G):(G=lu(Y.type,Y.key,Y.props,null,K.mode,oe),fl(G,Y),G.return=K,G)}function X(K,G,Y,oe){return G===null||G.tag!==4||G.stateNode.containerInfo!==Y.containerInfo||G.stateNode.implementation!==Y.implementation?(G=_h(Y,K.mode,oe),G.return=K,G):(G=p(G,Y.children||[]),G.return=K,G)}function ae(K,G,Y,oe,Pe){return G===null||G.tag!==7?(G=Pi(Y,K.mode,oe,Pe),G.return=K,G):(G=p(G,Y),G.return=K,G)}function le(K,G,Y){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return G=Eh(""+G,K.mode,Y),G.return=K,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case v:return Y=lu(G.type,G.key,G.props,null,K.mode,Y),fl(Y,G),Y.return=K,Y;case _:return G=_h(G,K.mode,Y),G.return=K,G;case W:return G=Vi(G),le(K,G,Y)}if(Ct(G)||Ue(G))return G=Pi(G,K.mode,Y,null),G.return=K,G;if(typeof G.then=="function")return le(K,gu(G),Y);if(G.$$typeof===T)return le(K,du(K,G),Y);mu(K,G)}return null}function Q(K,G,Y,oe){var Pe=G!==null?G.key:null;if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Pe!==null?null:R(K,G,""+Y,oe);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case v:return Y.key===Pe?z(K,G,Y,oe):null;case _:return Y.key===Pe?X(K,G,Y,oe):null;case W:return Y=Vi(Y),Q(K,G,Y,oe)}if(Ct(Y)||Ue(Y))return Pe!==null?null:ae(K,G,Y,oe,null);if(typeof Y.then=="function")return Q(K,G,gu(Y),oe);if(Y.$$typeof===T)return Q(K,G,du(K,Y),oe);mu(K,Y)}return null}function ne(K,G,Y,oe,Pe){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return K=K.get(Y)||null,R(G,K,""+oe,Pe);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case v:return K=K.get(oe.key===null?Y:oe.key)||null,z(G,K,oe,Pe);case _:return K=K.get(oe.key===null?Y:oe.key)||null,X(G,K,oe,Pe);case W:return oe=Vi(oe),ne(K,G,Y,oe,Pe)}if(Ct(oe)||Ue(oe))return K=K.get(Y)||null,ae(G,K,oe,Pe,null);if(typeof oe.then=="function")return ne(K,G,Y,gu(oe),Pe);if(oe.$$typeof===T)return ne(K,G,Y,du(G,oe),Pe);mu(G,oe)}return null}function De(K,G,Y,oe){for(var Pe=null,yt=null,Ne=G,Qe=G=0,ut=null;Ne!==null&&Qe<Y.length;Qe++){Ne.index>Qe?(ut=Ne,Ne=null):ut=Ne.sibling;var bt=Q(K,Ne,Y[Qe],oe);if(bt===null){Ne===null&&(Ne=ut);break}t&&Ne&&bt.alternate===null&&r(K,Ne),G=g(bt,G,Qe),yt===null?Pe=bt:yt.sibling=bt,yt=bt,Ne=ut}if(Qe===Y.length)return o(K,Ne),ht&&da(K,Qe),Pe;if(Ne===null){for(;Qe<Y.length;Qe++)Ne=le(K,Y[Qe],oe),Ne!==null&&(G=g(Ne,G,Qe),yt===null?Pe=Ne:yt.sibling=Ne,yt=Ne);return ht&&da(K,Qe),Pe}for(Ne=u(Ne);Qe<Y.length;Qe++)ut=ne(Ne,K,Qe,Y[Qe],oe),ut!==null&&(t&&ut.alternate!==null&&Ne.delete(ut.key===null?Qe:ut.key),G=g(ut,G,Qe),yt===null?Pe=ut:yt.sibling=ut,yt=ut);return t&&Ne.forEach(function(hi){return r(K,hi)}),ht&&da(K,Qe),Pe}function qe(K,G,Y,oe){if(Y==null)throw Error(a(151));for(var Pe=null,yt=null,Ne=G,Qe=G=0,ut=null,bt=Y.next();Ne!==null&&!bt.done;Qe++,bt=Y.next()){Ne.index>Qe?(ut=Ne,Ne=null):ut=Ne.sibling;var hi=Q(K,Ne,bt.value,oe);if(hi===null){Ne===null&&(Ne=ut);break}t&&Ne&&hi.alternate===null&&r(K,Ne),G=g(hi,G,Qe),yt===null?Pe=hi:yt.sibling=hi,yt=hi,Ne=ut}if(bt.done)return o(K,Ne),ht&&da(K,Qe),Pe;if(Ne===null){for(;!bt.done;Qe++,bt=Y.next())bt=le(K,bt.value,oe),bt!==null&&(G=g(bt,G,Qe),yt===null?Pe=bt:yt.sibling=bt,yt=bt);return ht&&da(K,Qe),Pe}for(Ne=u(Ne);!bt.done;Qe++,bt=Y.next())bt=ne(Ne,K,Qe,bt.value,oe),bt!==null&&(t&&bt.alternate!==null&&Ne.delete(bt.key===null?Qe:bt.key),G=g(bt,G,Qe),yt===null?Pe=bt:yt.sibling=bt,yt=bt);return t&&Ne.forEach(function(ek){return r(K,ek)}),ht&&da(K,Qe),Pe}function Ot(K,G,Y,oe){if(typeof Y=="object"&&Y!==null&&Y.type===A&&Y.key===null&&(Y=Y.props.children),typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case v:e:{for(var Pe=Y.key;G!==null;){if(G.key===Pe){if(Pe=Y.type,Pe===A){if(G.tag===7){o(K,G.sibling),oe=p(G,Y.props.children),oe.return=K,K=oe;break e}}else if(G.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===W&&Vi(Pe)===G.type){o(K,G.sibling),oe=p(G,Y.props),fl(oe,Y),oe.return=K,K=oe;break e}o(K,G);break}else r(K,G);G=G.sibling}Y.type===A?(oe=Pi(Y.props.children,K.mode,oe,Y.key),oe.return=K,K=oe):(oe=lu(Y.type,Y.key,Y.props,null,K.mode,oe),fl(oe,Y),oe.return=K,K=oe)}return C(K);case _:e:{for(Pe=Y.key;G!==null;){if(G.key===Pe)if(G.tag===4&&G.stateNode.containerInfo===Y.containerInfo&&G.stateNode.implementation===Y.implementation){o(K,G.sibling),oe=p(G,Y.children||[]),oe.return=K,K=oe;break e}else{o(K,G);break}else r(K,G);G=G.sibling}oe=_h(Y,K.mode,oe),oe.return=K,K=oe}return C(K);case W:return Y=Vi(Y),Ot(K,G,Y,oe)}if(Ct(Y))return De(K,G,Y,oe);if(Ue(Y)){if(Pe=Ue(Y),typeof Pe!="function")throw Error(a(150));return Y=Pe.call(Y),qe(K,G,Y,oe)}if(typeof Y.then=="function")return Ot(K,G,gu(Y),oe);if(Y.$$typeof===T)return Ot(K,G,du(K,Y),oe);mu(K,Y)}return typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint"?(Y=""+Y,G!==null&&G.tag===6?(o(K,G.sibling),oe=p(G,Y),oe.return=K,K=oe):(o(K,G),oe=Eh(Y,K.mode,oe),oe.return=K,K=oe),C(K)):o(K,G)}return function(K,G,Y,oe){try{dl=0;var Pe=Ot(K,G,Y,oe);return zs=null,Pe}catch(Ne){if(Ne===Hs||Ne===hu)throw Ne;var yt=Jn(29,Ne,null,K.mode);return yt.lanes=oe,yt.return=K,yt}}}var Wi=Db(!0),Ob=Db(!1),Xa=!1;function Ih(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function jh(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 Ja(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Qa(t,r,o){var u=t.updateQueue;if(u===null)return null;if(u=u.shared,(wt&2)!==0){var p=u.pending;return p===null?r.next=r:(r.next=p.next,p.next=r),u.pending=r,r=ou(t),pb(t,null,o),r}return su(t,u,r,o),ou(t)}function hl(t,r,o){if(r=r.updateQueue,r!==null&&(r=r.shared,(o&4194048)!==0)){var u=r.lanes;u&=t.pendingLanes,o|=u,r.lanes=o,we(t,o)}}function Hh(t,r){var o=t.updateQueue,u=t.alternate;if(u!==null&&(u=u.updateQueue,o===u)){var p=null,g=null;if(o=o.firstBaseUpdate,o!==null){do{var C={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};g===null?p=g=C:g=g.next=C,o=o.next}while(o!==null);g===null?p=g=r:g=g.next=r}else p=g=r;o={baseState:u.baseState,firstBaseUpdate:p,lastBaseUpdate:g,shared:u.shared,callbacks:u.callbacks},t.updateQueue=o;return}t=o.lastBaseUpdate,t===null?o.firstBaseUpdate=r:t.next=r,o.lastBaseUpdate=r}var zh=!1;function pl(){if(zh){var t=js;if(t!==null)throw t}}function gl(t,r,o,u){zh=!1;var p=t.updateQueue;Xa=!1;var g=p.firstBaseUpdate,C=p.lastBaseUpdate,R=p.shared.pending;if(R!==null){p.shared.pending=null;var z=R,X=z.next;z.next=null,C===null?g=X:C.next=X,C=z;var ae=t.alternate;ae!==null&&(ae=ae.updateQueue,R=ae.lastBaseUpdate,R!==C&&(R===null?ae.firstBaseUpdate=X:R.next=X,ae.lastBaseUpdate=z))}if(g!==null){var le=p.baseState;C=0,ae=X=z=null,R=g;do{var Q=R.lane&-536870913,ne=Q!==R.lane;if(ne?(ct&Q)===Q:(u&Q)===Q){Q!==0&&Q===Is&&(zh=!0),ae!==null&&(ae=ae.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});e:{var De=t,qe=R;Q=r;var Ot=o;switch(qe.tag){case 1:if(De=qe.payload,typeof De=="function"){le=De.call(Ot,le,Q);break e}le=De;break e;case 3:De.flags=De.flags&-65537|128;case 0:if(De=qe.payload,Q=typeof De=="function"?De.call(Ot,le,Q):De,Q==null)break e;le=y({},le,Q);break e;case 2:Xa=!0}}Q=R.callback,Q!==null&&(t.flags|=64,ne&&(t.flags|=8192),ne=p.callbacks,ne===null?p.callbacks=[Q]:ne.push(Q))}else ne={lane:Q,tag:R.tag,payload:R.payload,callback:R.callback,next:null},ae===null?(X=ae=ne,z=le):ae=ae.next=ne,C|=Q;if(R=R.next,R===null){if(R=p.shared.pending,R===null)break;ne=R,R=ne.next,ne.next=null,p.lastBaseUpdate=ne,p.shared.pending=null}}while(!0);ae===null&&(z=le),p.baseState=z,p.firstBaseUpdate=X,p.lastBaseUpdate=ae,g===null&&(p.shared.lanes=0),ri|=C,t.lanes=C,t.memoizedState=le}}function Lb(t,r){if(typeof t!="function")throw Error(a(191,t));t.call(r)}function Mb(t,r){var o=t.callbacks;if(o!==null)for(t.callbacks=null,t=0;t<o.length;t++)Lb(o[t],r)}var Us=N(null),yu=N(0);function $b(t,r){t=Ca,de(yu,t),de(Us,r),Ca=t|r.baseLanes}function Uh(){de(yu,Ca),de(Us,Us.current)}function Ph(){Ca=yu.current,k(Us),k(yu)}var Qn=N(null),gr=null;function Za(t){var r=t.alternate;de(Jt,Jt.current&1),de(Qn,t),gr===null&&(r===null||Us.current!==null||r.memoizedState!==null)&&(gr=t)}function Bh(t){de(Jt,Jt.current),de(Qn,t),gr===null&&(gr=t)}function Nb(t){t.tag===22?(de(Jt,Jt.current),de(Qn,t),gr===null&&(gr=t)):ei()}function ei(){de(Jt,Jt.current),de(Qn,Qn.current)}function Zn(t){k(Qn),gr===t&&(gr=null),k(Jt)}var Jt=N(0);function bu(t){for(var r=t;r!==null;){if(r.tag===13){var o=r.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||Wp(o)||Yp(o)))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 pa=0,Je=null,Rt=null,nn=null,vu=!1,Ps=!1,Yi=!1,Su=0,ml=0,Bs=null,Gx=0;function Wt(){throw Error(a(321))}function qh(t,r){if(r===null)return!1;for(var o=0;o<r.length&&o<t.length;o++)if(!Xn(t[o],r[o]))return!1;return!0}function Gh(t,r,o,u,p,g){return pa=g,Je=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,J.H=t===null||t.memoizedState===null?bv:ip,Yi=!1,g=o(u,p),Yi=!1,Ps&&(g=jb(r,o,u,p)),Ib(t),g}function Ib(t){J.H=vl;var r=Rt!==null&&Rt.next!==null;if(pa=0,nn=Rt=Je=null,vu=!1,ml=0,Bs=null,r)throw Error(a(300));t===null||rn||(t=t.dependencies,t!==null&&uu(t)&&(rn=!0))}function jb(t,r,o,u){Je=t;var p=0;do{if(Ps&&(Bs=null),ml=0,Ps=!1,25<=p)throw Error(a(301));if(p+=1,nn=Rt=null,t.updateQueue!=null){var g=t.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}J.H=vv,g=r(o,u)}while(Ps);return g}function Fx(){var t=J.H,r=t.useState()[0];return r=typeof r.then=="function"?yl(r):r,t=t.useState()[0],(Rt!==null?Rt.memoizedState:null)!==t&&(Je.flags|=1024),r}function Fh(){var t=Su!==0;return Su=0,t}function Vh(t,r,o){r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~o}function Kh(t){if(vu){for(t=t.memoizedState;t!==null;){var r=t.queue;r!==null&&(r.pending=null),t=t.next}vu=!1}pa=0,nn=Rt=Je=null,Ps=!1,ml=Su=0,Bs=null}function $n(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return nn===null?Je.memoizedState=nn=t:nn=nn.next=t,nn}function Qt(){if(Rt===null){var t=Je.alternate;t=t!==null?t.memoizedState:null}else t=Rt.next;var r=nn===null?Je.memoizedState:nn.next;if(r!==null)nn=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},nn===null?Je.memoizedState=nn=t:nn=nn.next=t}return nn}function wu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function yl(t){var r=ml;return ml+=1,Bs===null&&(Bs=[]),t=Tb(Bs,t,r),r=Je,(nn===null?r.memoizedState:nn.next)===null&&(r=r.alternate,J.H=r===null||r.memoizedState===null?bv:ip),t}function Cu(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return yl(t);if(t.$$typeof===T)return Cn(t)}throw Error(a(438,String(t)))}function Wh(t){var r=null,o=Je.updateQueue;if(o!==null&&(r=o.memoCache),r==null){var u=Je.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(r={data:u.data.map(function(p){return p.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),o===null&&(o=wu(),Je.updateQueue=o),o.memoCache=r,o=r.data[r.index],o===void 0)for(o=r.data[r.index]=Array(t),u=0;u<t;u++)o[u]=Se;return r.index++,o}function ga(t,r){return typeof r=="function"?r(t):r}function Eu(t){var r=Qt();return Yh(r,Rt,t)}function Yh(t,r,o){var u=t.queue;if(u===null)throw Error(a(311));u.lastRenderedReducer=o;var p=t.baseQueue,g=u.pending;if(g!==null){if(p!==null){var C=p.next;p.next=g.next,g.next=C}r.baseQueue=p=g,u.pending=null}if(g=t.baseState,p===null)t.memoizedState=g;else{r=p.next;var R=C=null,z=null,X=r,ae=!1;do{var le=X.lane&-536870913;if(le!==X.lane?(ct&le)===le:(pa&le)===le){var Q=X.revertLane;if(Q===0)z!==null&&(z=z.next={lane:0,revertLane:0,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null}),le===Is&&(ae=!0);else if((pa&Q)===Q){X=X.next,Q===Is&&(ae=!0);continue}else le={lane:0,revertLane:X.revertLane,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},z===null?(R=z=le,C=g):z=z.next=le,Je.lanes|=Q,ri|=Q;le=X.action,Yi&&o(g,le),g=X.hasEagerState?X.eagerState:o(g,le)}else Q={lane:le,revertLane:X.revertLane,gesture:X.gesture,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},z===null?(R=z=Q,C=g):z=z.next=Q,Je.lanes|=le,ri|=le;X=X.next}while(X!==null&&X!==r);if(z===null?C=g:z.next=R,!Xn(g,t.memoizedState)&&(rn=!0,ae&&(o=js,o!==null)))throw o;t.memoizedState=g,t.baseState=C,t.baseQueue=z,u.lastRenderedState=g}return p===null&&(u.lanes=0),[t.memoizedState,u.dispatch]}function Xh(t){var r=Qt(),o=r.queue;if(o===null)throw Error(a(311));o.lastRenderedReducer=t;var u=o.dispatch,p=o.pending,g=r.memoizedState;if(p!==null){o.pending=null;var C=p=p.next;do g=t(g,C.action),C=C.next;while(C!==p);Xn(g,r.memoizedState)||(rn=!0),r.memoizedState=g,r.baseQueue===null&&(r.baseState=g),o.lastRenderedState=g}return[g,u]}function Hb(t,r,o){var u=Je,p=Qt(),g=ht;if(g){if(o===void 0)throw Error(a(407));o=o()}else o=r();var C=!Xn((Rt||p).memoizedState,o);if(C&&(p.memoizedState=o,rn=!0),p=p.queue,Zh(Pb.bind(null,u,p,t),[t]),p.getSnapshot!==r||C||nn!==null&&nn.memoizedState.tag&1){if(u.flags|=2048,qs(9,{destroy:void 0},Ub.bind(null,u,p,o,r),null),Mt===null)throw Error(a(349));g||(pa&127)!==0||zb(u,r,o)}return o}function zb(t,r,o){t.flags|=16384,t={getSnapshot:r,value:o},r=Je.updateQueue,r===null?(r=wu(),Je.updateQueue=r,r.stores=[t]):(o=r.stores,o===null?r.stores=[t]:o.push(t))}function Ub(t,r,o,u){r.value=o,r.getSnapshot=u,Bb(r)&&qb(t)}function Pb(t,r,o){return o(function(){Bb(r)&&qb(t)})}function Bb(t){var r=t.getSnapshot;t=t.value;try{var o=r();return!Xn(t,o)}catch{return!0}}function qb(t){var r=Ui(t,2);r!==null&&Fn(r,t,2)}function Jh(t){var r=$n();if(typeof t=="function"){var o=t;if(t=o(),Yi){kn(!0);try{o()}finally{kn(!1)}}}return r.memoizedState=r.baseState=t,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ga,lastRenderedState:t},r}function Gb(t,r,o,u){return t.baseState=o,Yh(t,Rt,typeof u=="function"?u:ga)}function Vx(t,r,o,u,p){if(xu(t))throw Error(a(485));if(t=r.action,t!==null){var g={payload:p,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(C){g.listeners.push(C)}};J.T!==null?o(!0):g.isTransition=!1,u(g),o=r.pending,o===null?(g.next=r.pending=g,Fb(r,g)):(g.next=o.next,r.pending=o.next=g)}}function Fb(t,r){var o=r.action,u=r.payload,p=t.state;if(r.isTransition){var g=J.T,C={};J.T=C;try{var R=o(p,u),z=J.S;z!==null&&z(C,R),Vb(t,r,R)}catch(X){Qh(t,r,X)}finally{g!==null&&C.types!==null&&(g.types=C.types),J.T=g}}else try{g=o(p,u),Vb(t,r,g)}catch(X){Qh(t,r,X)}}function Vb(t,r,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(u){Kb(t,r,u)},function(u){return Qh(t,r,u)}):Kb(t,r,o)}function Kb(t,r,o){r.status="fulfilled",r.value=o,Wb(r),t.state=o,r=t.pending,r!==null&&(o=r.next,o===r?t.pending=null:(o=o.next,r.next=o,Fb(t,o)))}function Qh(t,r,o){var u=t.pending;if(t.pending=null,u!==null){u=u.next;do r.status="rejected",r.reason=o,Wb(r),r=r.next;while(r!==u)}t.action=null}function Wb(t){t=t.listeners;for(var r=0;r<t.length;r++)(0,t[r])()}function Yb(t,r){return r}function Xb(t,r){if(ht){var o=Mt.formState;if(o!==null){e:{var u=Je;if(ht){if(Nt){t:{for(var p=Nt,g=pr;p.nodeType!==8;){if(!g){p=null;break t}if(p=mr(p.nextSibling),p===null){p=null;break t}}g=p.data,p=g==="F!"||g==="F"?p:null}if(p){Nt=mr(p.nextSibling),u=p.data==="F!";break e}}Wa(u)}u=!1}u&&(r=o[0])}}return o=$n(),o.memoizedState=o.baseState=r,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yb,lastRenderedState:r},o.queue=u,o=gv.bind(null,Je,u),u.dispatch=o,u=Jh(!1),g=ap.bind(null,Je,!1,u.queue),u=$n(),p={state:r,dispatch:null,action:t,pending:null},u.queue=p,o=Vx.bind(null,Je,p,g,o),p.dispatch=o,u.memoizedState=t,[r,o,!1]}function Jb(t){var r=Qt();return Qb(r,Rt,t)}function Qb(t,r,o){if(r=Yh(t,r,Yb)[0],t=Eu(ga)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var u=yl(r)}catch(C){throw C===Hs?hu:C}else u=r;r=Qt();var p=r.queue,g=p.dispatch;return o!==r.memoizedState&&(Je.flags|=2048,qs(9,{destroy:void 0},Kx.bind(null,p,o),null)),[u,g,t]}function Kx(t,r){t.action=r}function Zb(t){var r=Qt(),o=Rt;if(o!==null)return Qb(r,o,t);Qt(),r=r.memoizedState,o=Qt();var u=o.queue.dispatch;return o.memoizedState=t,[r,u,!1]}function qs(t,r,o,u){return t={tag:t,create:o,deps:u,inst:r,next:null},r=Je.updateQueue,r===null&&(r=wu(),Je.updateQueue=r),o=r.lastEffect,o===null?r.lastEffect=t.next=t:(u=o.next,o.next=t,t.next=u,r.lastEffect=t),t}function ev(){return Qt().memoizedState}function _u(t,r,o,u){var p=$n();Je.flags|=t,p.memoizedState=qs(1|r,{destroy:void 0},o,u===void 0?null:u)}function Au(t,r,o,u){var p=Qt();u=u===void 0?null:u;var g=p.memoizedState.inst;Rt!==null&&u!==null&&qh(u,Rt.memoizedState.deps)?p.memoizedState=qs(r,g,o,u):(Je.flags|=t,p.memoizedState=qs(1|r,g,o,u))}function tv(t,r){_u(8390656,8,t,r)}function Zh(t,r){Au(2048,8,t,r)}function Wx(t){Je.flags|=4;var r=Je.updateQueue;if(r===null)r=wu(),Je.updateQueue=r,r.events=[t];else{var o=r.events;o===null?r.events=[t]:o.push(t)}}function nv(t){var r=Qt().memoizedState;return Wx({ref:r,nextImpl:t}),function(){if((wt&2)!==0)throw Error(a(440));return r.impl.apply(void 0,arguments)}}function rv(t,r){return Au(4,2,t,r)}function av(t,r){return Au(4,4,t,r)}function iv(t,r){if(typeof r=="function"){t=t();var o=r(t);return function(){typeof o=="function"?o():r(null)}}if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function sv(t,r,o){o=o!=null?o.concat([t]):null,Au(4,4,iv.bind(null,r,t),o)}function ep(){}function ov(t,r){var o=Qt();r=r===void 0?null:r;var u=o.memoizedState;return r!==null&&qh(r,u[1])?u[0]:(o.memoizedState=[t,r],t)}function lv(t,r){var o=Qt();r=r===void 0?null:r;var u=o.memoizedState;if(r!==null&&qh(r,u[1]))return u[0];if(u=t(),Yi){kn(!0);try{t()}finally{kn(!1)}}return o.memoizedState=[u,r],u}function tp(t,r,o){return o===void 0||(pa&1073741824)!==0&&(ct&261930)===0?t.memoizedState=r:(t.memoizedState=o,t=cS(),Je.lanes|=t,ri|=t,o)}function cv(t,r,o,u){return Xn(o,r)?o:Us.current!==null?(t=tp(t,o,u),Xn(t,r)||(rn=!0),t):(pa&42)===0||(pa&1073741824)!==0&&(ct&261930)===0?(rn=!0,t.memoizedState=o):(t=cS(),Je.lanes|=t,ri|=t,r)}function uv(t,r,o,u,p){var g=ue.p;ue.p=g!==0&&8>g?g:8;var C=J.T,R={};J.T=R,ap(t,!1,r,o);try{var z=p(),X=J.S;if(X!==null&&X(R,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var ae=qx(z,u);bl(t,r,ae,nr(t))}else bl(t,r,u,nr(t))}catch(le){bl(t,r,{then:function(){},status:"rejected",reason:le},nr())}finally{ue.p=g,C!==null&&R.types!==null&&(C.types=R.types),J.T=C}}function Yx(){}function np(t,r,o,u){if(t.tag!==5)throw Error(a(476));var p=dv(t).queue;uv(t,p,r,Me,o===null?Yx:function(){return fv(t),o(u)})}function dv(t){var r=t.memoizedState;if(r!==null)return r;r={memoizedState:Me,baseState:Me,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ga,lastRenderedState:Me},next:null};var o={};return r.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ga,lastRenderedState:o},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function fv(t){var r=dv(t);r.next===null&&(r=t.alternate.memoizedState),bl(t,r.next.queue,{},nr())}function rp(){return Cn(Nl)}function hv(){return Qt().memoizedState}function pv(){return Qt().memoizedState}function Xx(t){for(var r=t.return;r!==null;){switch(r.tag){case 24:case 3:var o=nr();t=Ja(o);var u=Qa(r,t,o);u!==null&&(Fn(u,r,o),hl(u,r,o)),r={cache:Lh()},t.payload=r;return}r=r.return}}function Jx(t,r,o){var u=nr();o={lane:u,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},xu(t)?mv(r,o):(o=wh(t,r,o,u),o!==null&&(Fn(o,t,u),yv(o,r,u)))}function gv(t,r,o){var u=nr();bl(t,r,o,u)}function bl(t,r,o,u){var p={lane:u,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(xu(t))mv(r,p);else{var g=t.alternate;if(t.lanes===0&&(g===null||g.lanes===0)&&(g=r.lastRenderedReducer,g!==null))try{var C=r.lastRenderedState,R=g(C,o);if(p.hasEagerState=!0,p.eagerState=R,Xn(R,C))return su(t,r,p,0),Mt===null&&iu(),!1}catch{}if(o=wh(t,r,p,u),o!==null)return Fn(o,t,u),yv(o,r,u),!0}return!1}function ap(t,r,o,u){if(u={lane:2,revertLane:Ip(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},xu(t)){if(r)throw Error(a(479))}else r=wh(t,o,u,2),r!==null&&Fn(r,t,2)}function xu(t){var r=t.alternate;return t===Je||r!==null&&r===Je}function mv(t,r){Ps=vu=!0;var o=t.pending;o===null?r.next=r:(r.next=o.next,o.next=r),t.pending=r}function yv(t,r,o){if((o&4194048)!==0){var u=r.lanes;u&=t.pendingLanes,o|=u,r.lanes=o,we(t,o)}}var vl={readContext:Cn,use:Cu,useCallback:Wt,useContext:Wt,useEffect:Wt,useImperativeHandle:Wt,useLayoutEffect:Wt,useInsertionEffect:Wt,useMemo:Wt,useReducer:Wt,useRef:Wt,useState:Wt,useDebugValue:Wt,useDeferredValue:Wt,useTransition:Wt,useSyncExternalStore:Wt,useId:Wt,useHostTransitionStatus:Wt,useFormState:Wt,useActionState:Wt,useOptimistic:Wt,useMemoCache:Wt,useCacheRefresh:Wt};vl.useEffectEvent=Wt;var bv={readContext:Cn,use:Cu,useCallback:function(t,r){return $n().memoizedState=[t,r===void 0?null:r],t},useContext:Cn,useEffect:tv,useImperativeHandle:function(t,r,o){o=o!=null?o.concat([t]):null,_u(4194308,4,iv.bind(null,r,t),o)},useLayoutEffect:function(t,r){return _u(4194308,4,t,r)},useInsertionEffect:function(t,r){_u(4,2,t,r)},useMemo:function(t,r){var o=$n();r=r===void 0?null:r;var u=t();if(Yi){kn(!0);try{t()}finally{kn(!1)}}return o.memoizedState=[u,r],u},useReducer:function(t,r,o){var u=$n();if(o!==void 0){var p=o(r);if(Yi){kn(!0);try{o(r)}finally{kn(!1)}}}else p=r;return u.memoizedState=u.baseState=p,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:p},u.queue=t,t=t.dispatch=Jx.bind(null,Je,t),[u.memoizedState,t]},useRef:function(t){var r=$n();return t={current:t},r.memoizedState=t},useState:function(t){t=Jh(t);var r=t.queue,o=gv.bind(null,Je,r);return r.dispatch=o,[t.memoizedState,o]},useDebugValue:ep,useDeferredValue:function(t,r){var o=$n();return tp(o,t,r)},useTransition:function(){var t=Jh(!1);return t=uv.bind(null,Je,t.queue,!0,!1),$n().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,o){var u=Je,p=$n();if(ht){if(o===void 0)throw Error(a(407));o=o()}else{if(o=r(),Mt===null)throw Error(a(349));(ct&127)!==0||zb(u,r,o)}p.memoizedState=o;var g={value:o,getSnapshot:r};return p.queue=g,tv(Pb.bind(null,u,g,t),[t]),u.flags|=2048,qs(9,{destroy:void 0},Ub.bind(null,u,g,o,r),null),o},useId:function(){var t=$n(),r=Mt.identifierPrefix;if(ht){var o=Yr,u=Wr;o=(u&~(1<<32-dn(u)-1)).toString(32)+o,r="_"+r+"R_"+o,o=Su++,0<o&&(r+="H"+o.toString(32)),r+="_"}else o=Gx++,r="_"+r+"r_"+o.toString(32)+"_";return t.memoizedState=r},useHostTransitionStatus:rp,useFormState:Xb,useActionState:Xb,useOptimistic:function(t){var r=$n();r.memoizedState=r.baseState=t;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=o,r=ap.bind(null,Je,!0,o),o.dispatch=r,[t,r]},useMemoCache:Wh,useCacheRefresh:function(){return $n().memoizedState=Xx.bind(null,Je)},useEffectEvent:function(t){var r=$n(),o={impl:t};return r.memoizedState=o,function(){if((wt&2)!==0)throw Error(a(440));return o.impl.apply(void 0,arguments)}}},ip={readContext:Cn,use:Cu,useCallback:ov,useContext:Cn,useEffect:Zh,useImperativeHandle:sv,useInsertionEffect:rv,useLayoutEffect:av,useMemo:lv,useReducer:Eu,useRef:ev,useState:function(){return Eu(ga)},useDebugValue:ep,useDeferredValue:function(t,r){var o=Qt();return cv(o,Rt.memoizedState,t,r)},useTransition:function(){var t=Eu(ga)[0],r=Qt().memoizedState;return[typeof t=="boolean"?t:yl(t),r]},useSyncExternalStore:Hb,useId:hv,useHostTransitionStatus:rp,useFormState:Jb,useActionState:Jb,useOptimistic:function(t,r){var o=Qt();return Gb(o,Rt,t,r)},useMemoCache:Wh,useCacheRefresh:pv};ip.useEffectEvent=nv;var vv={readContext:Cn,use:Cu,useCallback:ov,useContext:Cn,useEffect:Zh,useImperativeHandle:sv,useInsertionEffect:rv,useLayoutEffect:av,useMemo:lv,useReducer:Xh,useRef:ev,useState:function(){return Xh(ga)},useDebugValue:ep,useDeferredValue:function(t,r){var o=Qt();return Rt===null?tp(o,t,r):cv(o,Rt.memoizedState,t,r)},useTransition:function(){var t=Xh(ga)[0],r=Qt().memoizedState;return[typeof t=="boolean"?t:yl(t),r]},useSyncExternalStore:Hb,useId:hv,useHostTransitionStatus:rp,useFormState:Zb,useActionState:Zb,useOptimistic:function(t,r){var o=Qt();return Rt!==null?Gb(o,Rt,t,r):(o.baseState=t,[t,o.queue.dispatch])},useMemoCache:Wh,useCacheRefresh:pv};vv.useEffectEvent=nv;function sp(t,r,o,u){r=t.memoizedState,o=o(u,r),o=o==null?r:y({},r,o),t.memoizedState=o,t.lanes===0&&(t.updateQueue.baseState=o)}var op={enqueueSetState:function(t,r,o){t=t._reactInternals;var u=nr(),p=Ja(u);p.payload=r,o!=null&&(p.callback=o),r=Qa(t,p,u),r!==null&&(Fn(r,t,u),hl(r,t,u))},enqueueReplaceState:function(t,r,o){t=t._reactInternals;var u=nr(),p=Ja(u);p.tag=1,p.payload=r,o!=null&&(p.callback=o),r=Qa(t,p,u),r!==null&&(Fn(r,t,u),hl(r,t,u))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var o=nr(),u=Ja(o);u.tag=2,r!=null&&(u.callback=r),r=Qa(t,u,o),r!==null&&(Fn(r,t,o),hl(r,t,o))}};function Sv(t,r,o,u,p,g,C){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(u,g,C):r.prototype&&r.prototype.isPureReactComponent?!il(o,u)||!il(p,g):!0}function wv(t,r,o,u){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(o,u),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(o,u),r.state!==t&&op.enqueueReplaceState(r,r.state,null)}function Xi(t,r){var o=r;if("ref"in r){o={};for(var u in r)u!=="ref"&&(o[u]=r[u])}if(t=t.defaultProps){o===r&&(o=y({},o));for(var p in t)o[p]===void 0&&(o[p]=t[p])}return o}function Cv(t){au(t)}function Ev(t){console.error(t)}function _v(t){au(t)}function Tu(t,r){try{var o=t.onUncaughtError;o(r.value,{componentStack:r.stack})}catch(u){setTimeout(function(){throw u})}}function Av(t,r,o){try{var u=t.onCaughtError;u(o.value,{componentStack:o.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function lp(t,r,o){return o=Ja(o),o.tag=3,o.payload={element:null},o.callback=function(){Tu(t,r)},o}function xv(t){return t=Ja(t),t.tag=3,t}function Tv(t,r,o,u){var p=o.type.getDerivedStateFromError;if(typeof p=="function"){var g=u.value;t.payload=function(){return p(g)},t.callback=function(){Av(r,o,u)}}var C=o.stateNode;C!==null&&typeof C.componentDidCatch=="function"&&(t.callback=function(){Av(r,o,u),typeof p!="function"&&(ai===null?ai=new Set([this]):ai.add(this));var R=u.stack;this.componentDidCatch(u.value,{componentStack:R!==null?R:""})})}function Qx(t,r,o,u,p){if(o.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(r=o.alternate,r!==null&&Ns(r,o,p,!0),o=Qn.current,o!==null){switch(o.tag){case 31:case 13:return gr===null?zu():o.alternate===null&&Yt===0&&(Yt=3),o.flags&=-257,o.flags|=65536,o.lanes=p,u===pu?o.flags|=16384:(r=o.updateQueue,r===null?o.updateQueue=new Set([u]):r.add(u),Mp(t,u,p)),!1;case 22:return o.flags|=65536,u===pu?o.flags|=16384:(r=o.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([u])},o.updateQueue=r):(o=r.retryQueue,o===null?r.retryQueue=new Set([u]):o.add(u)),Mp(t,u,p)),!1}throw Error(a(435,o.tag))}return Mp(t,u,p),zu(),!1}if(ht)return r=Qn.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=p,u!==Th&&(t=Error(a(422),{cause:u}),ll(dr(t,o)))):(u!==Th&&(r=Error(a(423),{cause:u}),ll(dr(r,o))),t=t.current.alternate,t.flags|=65536,p&=-p,t.lanes|=p,u=dr(u,o),p=lp(t.stateNode,u,p),Hh(t,p),Yt!==4&&(Yt=2)),!1;var g=Error(a(520),{cause:u});if(g=dr(g,o),Tl===null?Tl=[g]:Tl.push(g),Yt!==4&&(Yt=2),r===null)return!0;u=dr(u,o),o=r;do{switch(o.tag){case 3:return o.flags|=65536,t=p&-p,o.lanes|=t,t=lp(o.stateNode,u,t),Hh(o,t),!1;case 1:if(r=o.type,g=o.stateNode,(o.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(ai===null||!ai.has(g))))return o.flags|=65536,p&=-p,o.lanes|=p,p=xv(p),Tv(p,t,o,u),Hh(o,p),!1}o=o.return}while(o!==null);return!1}var cp=Error(a(461)),rn=!1;function En(t,r,o,u){r.child=t===null?Ob(r,null,o,u):Wi(r,t.child,o,u)}function kv(t,r,o,u,p){o=o.render;var g=r.ref;if("ref"in u){var C={};for(var R in u)R!=="ref"&&(C[R]=u[R])}else C=u;return Gi(r),u=Gh(t,r,o,C,g,p),R=Fh(),t!==null&&!rn?(Vh(t,r,p),ma(t,r,p)):(ht&&R&&Ah(r),r.flags|=1,En(t,r,u,p),r.child)}function Rv(t,r,o,u,p){if(t===null){var g=o.type;return typeof g=="function"&&!Ch(g)&&g.defaultProps===void 0&&o.compare===null?(r.tag=15,r.type=g,Dv(t,r,g,u,p)):(t=lu(o.type,null,u,r,r.mode,p),t.ref=r.ref,t.return=r,r.child=t)}if(g=t.child,!yp(t,p)){var C=g.memoizedProps;if(o=o.compare,o=o!==null?o:il,o(C,u)&&t.ref===r.ref)return ma(t,r,p)}return r.flags|=1,t=ua(g,u),t.ref=r.ref,t.return=r,r.child=t}function Dv(t,r,o,u,p){if(t!==null){var g=t.memoizedProps;if(il(g,u)&&t.ref===r.ref)if(rn=!1,r.pendingProps=u=g,yp(t,p))(t.flags&131072)!==0&&(rn=!0);else return r.lanes=t.lanes,ma(t,r,p)}return up(t,r,o,u,p)}function Ov(t,r,o,u){var p=u.children,g=t!==null?t.memoizedState:null;if(t===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((r.flags&128)!==0){if(g=g!==null?g.baseLanes|o:o,t!==null){for(u=r.child=t.child,p=0;u!==null;)p=p|u.lanes|u.childLanes,u=u.sibling;u=p&~g}else u=0,r.child=null;return Lv(t,r,g,o,u)}if((o&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},t!==null&&fu(r,g!==null?g.cachePool:null),g!==null?$b(r,g):Uh(),Nb(r);else return u=r.lanes=536870912,Lv(t,r,g!==null?g.baseLanes|o:o,o,u)}else g!==null?(fu(r,g.cachePool),$b(r,g),ei(),r.memoizedState=null):(t!==null&&fu(r,null),Uh(),ei());return En(t,r,p,o),r.child}function Sl(t,r){return t!==null&&t.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function Lv(t,r,o,u,p){var g=$h();return g=g===null?null:{parent:tn._currentValue,pool:g},r.memoizedState={baseLanes:o,cachePool:g},t!==null&&fu(r,null),Uh(),Nb(r),t!==null&&Ns(t,r,u,!0),r.childLanes=p,null}function ku(t,r){return r=Du({mode:r.mode,children:r.children},t.mode),r.ref=t.ref,t.child=r,r.return=t,r}function Mv(t,r,o){return Wi(r,t.child,null,o),t=ku(r,r.pendingProps),t.flags|=2,Zn(r),r.memoizedState=null,t}function Zx(t,r,o){var u=r.pendingProps,p=(r.flags&128)!==0;if(r.flags&=-129,t===null){if(ht){if(u.mode==="hidden")return t=ku(r,u),r.lanes=536870912,Sl(null,t);if(Bh(r),(t=Nt)?(t=FS(t,pr),t=t!==null&&t.data==="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:Va!==null?{id:Wr,overflow:Yr}:null,retryLane:536870912,hydrationErrors:null},o=mb(t),o.return=r,r.child=o,wn=r,Nt=null)):t=null,t===null)throw Wa(r);return r.lanes=536870912,null}return ku(r,u)}var g=t.memoizedState;if(g!==null){var C=g.dehydrated;if(Bh(r),p)if(r.flags&256)r.flags&=-257,r=Mv(t,r,o);else if(r.memoizedState!==null)r.child=t.child,r.flags|=128,r=null;else throw Error(a(558));else if(rn||Ns(t,r,o,!1),p=(o&t.childLanes)!==0,rn||p){if(u=Mt,u!==null&&(C=je(u,o),C!==0&&C!==g.retryLane))throw g.retryLane=C,Ui(t,C),Fn(u,t,C),cp;zu(),r=Mv(t,r,o)}else t=g.treeContext,Nt=mr(C.nextSibling),wn=r,ht=!0,Ka=null,pr=!1,t!==null&&vb(r,t),r=ku(r,u),r.flags|=4096;return r}return t=ua(t.child,{mode:u.mode,children:u.children}),t.ref=r.ref,r.child=t,t.return=r,t}function Ru(t,r){var o=r.ref;if(o===null)t!==null&&t.ref!==null&&(r.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(a(284));(t===null||t.ref!==o)&&(r.flags|=4194816)}}function up(t,r,o,u,p){return Gi(r),o=Gh(t,r,o,u,void 0,p),u=Fh(),t!==null&&!rn?(Vh(t,r,p),ma(t,r,p)):(ht&&u&&Ah(r),r.flags|=1,En(t,r,o,p),r.child)}function $v(t,r,o,u,p,g){return Gi(r),r.updateQueue=null,o=jb(r,u,o,p),Ib(t),u=Fh(),t!==null&&!rn?(Vh(t,r,g),ma(t,r,g)):(ht&&u&&Ah(r),r.flags|=1,En(t,r,o,g),r.child)}function Nv(t,r,o,u,p){if(Gi(r),r.stateNode===null){var g=Os,C=o.contextType;typeof C=="object"&&C!==null&&(g=Cn(C)),g=new o(u,g),r.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=op,r.stateNode=g,g._reactInternals=r,g=r.stateNode,g.props=u,g.state=r.memoizedState,g.refs={},Ih(r),C=o.contextType,g.context=typeof C=="object"&&C!==null?Cn(C):Os,g.state=r.memoizedState,C=o.getDerivedStateFromProps,typeof C=="function"&&(sp(r,o,C,u),g.state=r.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(C=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),C!==g.state&&op.enqueueReplaceState(g,g.state,null),gl(r,u,g,p),pl(),g.state=r.memoizedState),typeof g.componentDidMount=="function"&&(r.flags|=4194308),u=!0}else if(t===null){g=r.stateNode;var R=r.memoizedProps,z=Xi(o,R);g.props=z;var X=g.context,ae=o.contextType;C=Os,typeof ae=="object"&&ae!==null&&(C=Cn(ae));var le=o.getDerivedStateFromProps;ae=typeof le=="function"||typeof g.getSnapshotBeforeUpdate=="function",R=r.pendingProps!==R,ae||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(R||X!==C)&&wv(r,g,u,C),Xa=!1;var Q=r.memoizedState;g.state=Q,gl(r,u,g,p),pl(),X=r.memoizedState,R||Q!==X||Xa?(typeof le=="function"&&(sp(r,o,le,u),X=r.memoizedState),(z=Xa||Sv(r,o,z,u,Q,X,C))?(ae||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(r.flags|=4194308)):(typeof g.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=u,r.memoizedState=X),g.props=u,g.state=X,g.context=C,u=z):(typeof g.componentDidMount=="function"&&(r.flags|=4194308),u=!1)}else{g=r.stateNode,jh(t,r),C=r.memoizedProps,ae=Xi(o,C),g.props=ae,le=r.pendingProps,Q=g.context,X=o.contextType,z=Os,typeof X=="object"&&X!==null&&(z=Cn(X)),R=o.getDerivedStateFromProps,(X=typeof R=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(C!==le||Q!==z)&&wv(r,g,u,z),Xa=!1,Q=r.memoizedState,g.state=Q,gl(r,u,g,p),pl();var ne=r.memoizedState;C!==le||Q!==ne||Xa||t!==null&&t.dependencies!==null&&uu(t.dependencies)?(typeof R=="function"&&(sp(r,o,R,u),ne=r.memoizedState),(ae=Xa||Sv(r,o,ae,u,Q,ne,z)||t!==null&&t.dependencies!==null&&uu(t.dependencies))?(X||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(u,ne,z),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(u,ne,z)),typeof g.componentDidUpdate=="function"&&(r.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof g.componentDidUpdate!="function"||C===t.memoizedProps&&Q===t.memoizedState||(r.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||C===t.memoizedProps&&Q===t.memoizedState||(r.flags|=1024),r.memoizedProps=u,r.memoizedState=ne),g.props=u,g.state=ne,g.context=z,u=ae):(typeof g.componentDidUpdate!="function"||C===t.memoizedProps&&Q===t.memoizedState||(r.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||C===t.memoizedProps&&Q===t.memoizedState||(r.flags|=1024),u=!1)}return g=u,Ru(t,r),u=(r.flags&128)!==0,g||u?(g=r.stateNode,o=u&&typeof o.getDerivedStateFromError!="function"?null:g.render(),r.flags|=1,t!==null&&u?(r.child=Wi(r,t.child,null,p),r.child=Wi(r,null,o,p)):En(t,r,o,p),r.memoizedState=g.state,t=r.child):t=ma(t,r,p),t}function Iv(t,r,o,u){return Bi(),r.flags|=256,En(t,r,o,u),r.child}var dp={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function fp(t){return{baseLanes:t,cachePool:Ab()}}function hp(t,r,o){return t=t!==null?t.childLanes&~o:0,r&&(t|=tr),t}function jv(t,r,o){var u=r.pendingProps,p=!1,g=(r.flags&128)!==0,C;if((C=g)||(C=t!==null&&t.memoizedState===null?!1:(Jt.current&2)!==0),C&&(p=!0,r.flags&=-129),C=(r.flags&32)!==0,r.flags&=-33,t===null){if(ht){if(p?Za(r):ei(),(t=Nt)?(t=FS(t,pr),t=t!==null&&t.data!=="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:Va!==null?{id:Wr,overflow:Yr}:null,retryLane:536870912,hydrationErrors:null},o=mb(t),o.return=r,r.child=o,wn=r,Nt=null)):t=null,t===null)throw Wa(r);return Yp(t)?r.lanes=32:r.lanes=536870912,null}var R=u.children;return u=u.fallback,p?(ei(),p=r.mode,R=Du({mode:"hidden",children:R},p),u=Pi(u,p,o,null),R.return=r,u.return=r,R.sibling=u,r.child=R,u=r.child,u.memoizedState=fp(o),u.childLanes=hp(t,C,o),r.memoizedState=dp,Sl(null,u)):(Za(r),pp(r,R))}var z=t.memoizedState;if(z!==null&&(R=z.dehydrated,R!==null)){if(g)r.flags&256?(Za(r),r.flags&=-257,r=gp(t,r,o)):r.memoizedState!==null?(ei(),r.child=t.child,r.flags|=128,r=null):(ei(),R=u.fallback,p=r.mode,u=Du({mode:"visible",children:u.children},p),R=Pi(R,p,o,null),R.flags|=2,u.return=r,R.return=r,u.sibling=R,r.child=u,Wi(r,t.child,null,o),u=r.child,u.memoizedState=fp(o),u.childLanes=hp(t,C,o),r.memoizedState=dp,r=Sl(null,u));else if(Za(r),Yp(R)){if(C=R.nextSibling&&R.nextSibling.dataset,C)var X=C.dgst;C=X,u=Error(a(419)),u.stack="",u.digest=C,ll({value:u,source:null,stack:null}),r=gp(t,r,o)}else if(rn||Ns(t,r,o,!1),C=(o&t.childLanes)!==0,rn||C){if(C=Mt,C!==null&&(u=je(C,o),u!==0&&u!==z.retryLane))throw z.retryLane=u,Ui(t,u),Fn(C,t,u),cp;Wp(R)||zu(),r=gp(t,r,o)}else Wp(R)?(r.flags|=192,r.child=t.child,r=null):(t=z.treeContext,Nt=mr(R.nextSibling),wn=r,ht=!0,Ka=null,pr=!1,t!==null&&vb(r,t),r=pp(r,u.children),r.flags|=4096);return r}return p?(ei(),R=u.fallback,p=r.mode,z=t.child,X=z.sibling,u=ua(z,{mode:"hidden",children:u.children}),u.subtreeFlags=z.subtreeFlags&65011712,X!==null?R=ua(X,R):(R=Pi(R,p,o,null),R.flags|=2),R.return=r,u.return=r,u.sibling=R,r.child=u,Sl(null,u),u=r.child,R=t.child.memoizedState,R===null?R=fp(o):(p=R.cachePool,p!==null?(z=tn._currentValue,p=p.parent!==z?{parent:z,pool:z}:p):p=Ab(),R={baseLanes:R.baseLanes|o,cachePool:p}),u.memoizedState=R,u.childLanes=hp(t,C,o),r.memoizedState=dp,Sl(t.child,u)):(Za(r),o=t.child,t=o.sibling,o=ua(o,{mode:"visible",children:u.children}),o.return=r,o.sibling=null,t!==null&&(C=r.deletions,C===null?(r.deletions=[t],r.flags|=16):C.push(t)),r.child=o,r.memoizedState=null,o)}function pp(t,r){return r=Du({mode:"visible",children:r},t.mode),r.return=t,t.child=r}function Du(t,r){return t=Jn(22,t,null,r),t.lanes=0,t}function gp(t,r,o){return Wi(r,t.child,null,o),t=pp(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function Hv(t,r,o){t.lanes|=r;var u=t.alternate;u!==null&&(u.lanes|=r),Dh(t.return,r,o)}function mp(t,r,o,u,p,g){var C=t.memoizedState;C===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:u,tail:o,tailMode:p,treeForkCount:g}:(C.isBackwards=r,C.rendering=null,C.renderingStartTime=0,C.last=u,C.tail=o,C.tailMode=p,C.treeForkCount=g)}function zv(t,r,o){var u=r.pendingProps,p=u.revealOrder,g=u.tail;u=u.children;var C=Jt.current,R=(C&2)!==0;if(R?(C=C&1|2,r.flags|=128):C&=1,de(Jt,C),En(t,r,u,o),u=ht?ol:0,!R&&t!==null&&(t.flags&128)!==0)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Hv(t,o,r);else if(t.tag===19)Hv(t,o,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(p){case"forwards":for(o=r.child,p=null;o!==null;)t=o.alternate,t!==null&&bu(t)===null&&(p=o),o=o.sibling;o=p,o===null?(p=r.child,r.child=null):(p=o.sibling,o.sibling=null),mp(r,!1,p,o,g,u);break;case"backwards":case"unstable_legacy-backwards":for(o=null,p=r.child,r.child=null;p!==null;){if(t=p.alternate,t!==null&&bu(t)===null){r.child=p;break}t=p.sibling,p.sibling=o,o=p,p=t}mp(r,!0,o,null,g,u);break;case"together":mp(r,!1,null,null,void 0,u);break;default:r.memoizedState=null}return r.child}function ma(t,r,o){if(t!==null&&(r.dependencies=t.dependencies),ri|=r.lanes,(o&r.childLanes)===0)if(t!==null){if(Ns(t,r,o,!1),(o&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,o=ua(t,t.pendingProps),r.child=o,o.return=r;t.sibling!==null;)t=t.sibling,o=o.sibling=ua(t,t.pendingProps),o.return=r;o.sibling=null}return r.child}function yp(t,r){return(t.lanes&r)!==0?!0:(t=t.dependencies,!!(t!==null&&uu(t)))}function eT(t,r,o){switch(r.tag){case 3:Be(r,r.stateNode.containerInfo),Ya(r,tn,t.memoizedState.cache),Bi();break;case 27:case 5:Ie(r);break;case 4:Be(r,r.stateNode.containerInfo);break;case 10:Ya(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Bh(r),null;break;case 13:var u=r.memoizedState;if(u!==null)return u.dehydrated!==null?(Za(r),r.flags|=128,null):(o&r.child.childLanes)!==0?jv(t,r,o):(Za(r),t=ma(t,r,o),t!==null?t.sibling:null);Za(r);break;case 19:var p=(t.flags&128)!==0;if(u=(o&r.childLanes)!==0,u||(Ns(t,r,o,!1),u=(o&r.childLanes)!==0),p){if(u)return zv(t,r,o);r.flags|=128}if(p=r.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),de(Jt,Jt.current),u)break;return null;case 22:return r.lanes=0,Ov(t,r,o,r.pendingProps);case 24:Ya(r,tn,t.memoizedState.cache)}return ma(t,r,o)}function Uv(t,r,o){if(t!==null)if(t.memoizedProps!==r.pendingProps)rn=!0;else{if(!yp(t,o)&&(r.flags&128)===0)return rn=!1,eT(t,r,o);rn=(t.flags&131072)!==0}else rn=!1,ht&&(r.flags&1048576)!==0&&bb(r,ol,r.index);switch(r.lanes=0,r.tag){case 16:e:{var u=r.pendingProps;if(t=Vi(r.elementType),r.type=t,typeof t=="function")Ch(t)?(u=Xi(t,u),r.tag=1,r=Nv(null,r,t,u,o)):(r.tag=0,r=up(null,r,t,u,o));else{if(t!=null){var p=t.$$typeof;if(p===L){r.tag=11,r=kv(null,r,t,u,o);break e}else if(p===B){r.tag=14,r=Rv(null,r,t,u,o);break e}}throw r=Ge(t)||t,Error(a(306,r,""))}}return r;case 0:return up(t,r,r.type,r.pendingProps,o);case 1:return u=r.type,p=Xi(u,r.pendingProps),Nv(t,r,u,p,o);case 3:e:{if(Be(r,r.stateNode.containerInfo),t===null)throw Error(a(387));u=r.pendingProps;var g=r.memoizedState;p=g.element,jh(t,r),gl(r,u,null,o);var C=r.memoizedState;if(u=C.cache,Ya(r,tn,u),u!==g.cache&&Oh(r,[tn],o,!0),pl(),u=C.element,g.isDehydrated)if(g={element:u,isDehydrated:!1,cache:C.cache},r.updateQueue.baseState=g,r.memoizedState=g,r.flags&256){r=Iv(t,r,u,o);break e}else if(u!==p){p=dr(Error(a(424)),r),ll(p),r=Iv(t,r,u,o);break e}else for(t=r.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,Nt=mr(t.firstChild),wn=r,ht=!0,Ka=null,pr=!0,o=Ob(r,null,u,o),r.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(Bi(),u===p){r=ma(t,r,o);break e}En(t,r,u,o)}r=r.child}return r;case 26:return Ru(t,r),t===null?(o=JS(r.type,null,r.pendingProps,null))?r.memoizedState=o:ht||(o=r.type,t=r.pendingProps,u=Vu(ee.current).createElement(o),u[Pt]=r,u[Rn]=t,_n(u,o,t),en(u),r.stateNode=u):r.memoizedState=JS(r.type,t.memoizedProps,r.pendingProps,t.memoizedState),null;case 27:return Ie(r),t===null&&ht&&(u=r.stateNode=WS(r.type,r.pendingProps,ee.current),wn=r,pr=!0,p=Nt,li(r.type)?(Xp=p,Nt=mr(u.firstChild)):Nt=p),En(t,r,r.pendingProps.children,o),Ru(t,r),t===null&&(r.flags|=4194304),r.child;case 5:return t===null&&ht&&((p=u=Nt)&&(u=DT(u,r.type,r.pendingProps,pr),u!==null?(r.stateNode=u,wn=r,Nt=mr(u.firstChild),pr=!1,p=!0):p=!1),p||Wa(r)),Ie(r),p=r.type,g=r.pendingProps,C=t!==null?t.memoizedProps:null,u=g.children,Fp(p,g)?u=null:C!==null&&Fp(p,C)&&(r.flags|=32),r.memoizedState!==null&&(p=Gh(t,r,Fx,null,null,o),Nl._currentValue=p),Ru(t,r),En(t,r,u,o),r.child;case 6:return t===null&&ht&&((t=o=Nt)&&(o=OT(o,r.pendingProps,pr),o!==null?(r.stateNode=o,wn=r,Nt=null,t=!0):t=!1),t||Wa(r)),null;case 13:return jv(t,r,o);case 4:return Be(r,r.stateNode.containerInfo),u=r.pendingProps,t===null?r.child=Wi(r,null,u,o):En(t,r,u,o),r.child;case 11:return kv(t,r,r.type,r.pendingProps,o);case 7:return En(t,r,r.pendingProps,o),r.child;case 8:return En(t,r,r.pendingProps.children,o),r.child;case 12:return En(t,r,r.pendingProps.children,o),r.child;case 10:return u=r.pendingProps,Ya(r,r.type,u.value),En(t,r,u.children,o),r.child;case 9:return p=r.type._context,u=r.pendingProps.children,Gi(r),p=Cn(p),u=u(p),r.flags|=1,En(t,r,u,o),r.child;case 14:return Rv(t,r,r.type,r.pendingProps,o);case 15:return Dv(t,r,r.type,r.pendingProps,o);case 19:return zv(t,r,o);case 31:return Zx(t,r,o);case 22:return Ov(t,r,o,r.pendingProps);case 24:return Gi(r),u=Cn(tn),t===null?(p=$h(),p===null&&(p=Mt,g=Lh(),p.pooledCache=g,g.refCount++,g!==null&&(p.pooledCacheLanes|=o),p=g),r.memoizedState={parent:u,cache:p},Ih(r),Ya(r,tn,p)):((t.lanes&o)!==0&&(jh(t,r),gl(r,null,null,o),pl()),p=t.memoizedState,g=r.memoizedState,p.parent!==u?(p={parent:u,cache:u},r.memoizedState=p,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=p),Ya(r,tn,u)):(u=g.cache,Ya(r,tn,u),u!==p.cache&&Oh(r,[tn],o,!0))),En(t,r,r.pendingProps.children,o),r.child;case 29:throw r.pendingProps}throw Error(a(156,r.tag))}function ya(t){t.flags|=4}function bp(t,r,o,u,p){if((r=(t.mode&32)!==0)&&(r=!1),r){if(t.flags|=16777216,(p&335544128)===p)if(t.stateNode.complete)t.flags|=8192;else if(hS())t.flags|=8192;else throw Ki=pu,Nh}else t.flags&=-16777217}function Pv(t,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!nw(r))if(hS())t.flags|=8192;else throw Ki=pu,Nh}function Ou(t,r){r!==null&&(t.flags|=4),t.flags&16384&&(r=t.tag!==22?$e():536870912,t.lanes|=r,Ks|=r)}function wl(t,r){if(!ht)switch(t.tailMode){case"hidden":r=t.tail;for(var o=null;r!==null;)r.alternate!==null&&(o=r),r=r.sibling;o===null?t.tail=null:o.sibling=null;break;case"collapsed":o=t.tail;for(var u=null;o!==null;)o.alternate!==null&&(u=o),o=o.sibling;u===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:u.sibling=null}}function It(t){var r=t.alternate!==null&&t.alternate.child===t.child,o=0,u=0;if(r)for(var p=t.child;p!==null;)o|=p.lanes|p.childLanes,u|=p.subtreeFlags&65011712,u|=p.flags&65011712,p.return=t,p=p.sibling;else for(p=t.child;p!==null;)o|=p.lanes|p.childLanes,u|=p.subtreeFlags,u|=p.flags,p.return=t,p=p.sibling;return t.subtreeFlags|=u,t.childLanes=o,r}function tT(t,r,o){var u=r.pendingProps;switch(xh(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return It(r),null;case 1:return It(r),null;case 3:return o=r.stateNode,u=null,t!==null&&(u=t.memoizedState.cache),r.memoizedState.cache!==u&&(r.flags|=2048),ha(tn),Re(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(t===null||t.child===null)&&($s(r)?ya(r):t===null||t.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,kh())),It(r),null;case 26:var p=r.type,g=r.memoizedState;return t===null?(ya(r),g!==null?(It(r),Pv(r,g)):(It(r),bp(r,p,null,u,o))):g?g!==t.memoizedState?(ya(r),It(r),Pv(r,g)):(It(r),r.flags&=-16777217):(t=t.memoizedProps,t!==u&&ya(r),It(r),bp(r,p,t,u,o)),null;case 27:if(Et(r),o=ee.current,p=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==u&&ya(r);else{if(!u){if(r.stateNode===null)throw Error(a(166));return It(r),null}t=fe.current,$s(r)?Sb(r):(t=WS(p,u,o),r.stateNode=t,ya(r))}return It(r),null;case 5:if(Et(r),p=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==u&&ya(r);else{if(!u){if(r.stateNode===null)throw Error(a(166));return It(r),null}if(g=fe.current,$s(r))Sb(r);else{var C=Vu(ee.current);switch(g){case 1:g=C.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:g=C.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":g=C.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":g=C.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":g=C.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof u.is=="string"?C.createElement("select",{is:u.is}):C.createElement("select"),u.multiple?g.multiple=!0:u.size&&(g.size=u.size);break;default:g=typeof u.is=="string"?C.createElement(p,{is:u.is}):C.createElement(p)}}g[Pt]=r,g[Rn]=u;e:for(C=r.child;C!==null;){if(C.tag===5||C.tag===6)g.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=g;e:switch(_n(g,p,u),p){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&ya(r)}}return It(r),bp(r,r.type,t===null?null:t.memoizedProps,r.pendingProps,o),null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==u&&ya(r);else{if(typeof u!="string"&&r.stateNode===null)throw Error(a(166));if(t=ee.current,$s(r)){if(t=r.stateNode,o=r.memoizedProps,u=null,p=wn,p!==null)switch(p.tag){case 27:case 5:u=p.memoizedProps}t[Pt]=r,t=!!(t.nodeValue===o||u!==null&&u.suppressHydrationWarning===!0||jS(t.nodeValue,o)),t||Wa(r,!0)}else t=Vu(t).createTextNode(u),t[Pt]=r,r.stateNode=t}return It(r),null;case 31:if(o=r.memoizedState,t===null||t.memoizedState!==null){if(u=$s(r),o!==null){if(t===null){if(!u)throw Error(a(318));if(t=r.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(557));t[Pt]=r}else Bi(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;It(r),t=!1}else o=kh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=o),t=!0;if(!t)return r.flags&256?(Zn(r),r):(Zn(r),null);if((r.flags&128)!==0)throw Error(a(558))}return It(r),null;case 13:if(u=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(p=$s(r),u!==null&&u.dehydrated!==null){if(t===null){if(!p)throw Error(a(318));if(p=r.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(a(317));p[Pt]=r}else Bi(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;It(r),p=!1}else p=kh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=p),p=!0;if(!p)return r.flags&256?(Zn(r),r):(Zn(r),null)}return Zn(r),(r.flags&128)!==0?(r.lanes=o,r):(o=u!==null,t=t!==null&&t.memoizedState!==null,o&&(u=r.child,p=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(p=u.alternate.memoizedState.cachePool.pool),g=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(g=u.memoizedState.cachePool.pool),g!==p&&(u.flags|=2048)),o!==t&&o&&(r.child.flags|=8192),Ou(r,r.updateQueue),It(r),null);case 4:return Re(),t===null&&Up(r.stateNode.containerInfo),It(r),null;case 10:return ha(r.type),It(r),null;case 19:if(k(Jt),u=r.memoizedState,u===null)return It(r),null;if(p=(r.flags&128)!==0,g=u.rendering,g===null)if(p)wl(u,!1);else{if(Yt!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(g=bu(t),g!==null){for(r.flags|=128,wl(u,!1),t=g.updateQueue,r.updateQueue=t,Ou(r,t),r.subtreeFlags=0,t=o,o=r.child;o!==null;)gb(o,t),o=o.sibling;return de(Jt,Jt.current&1|2),ht&&da(r,u.treeForkCount),r.child}t=t.sibling}u.tail!==null&&Kt()>Iu&&(r.flags|=128,p=!0,wl(u,!1),r.lanes=4194304)}else{if(!p)if(t=bu(g),t!==null){if(r.flags|=128,p=!0,t=t.updateQueue,r.updateQueue=t,Ou(r,t),wl(u,!0),u.tail===null&&u.tailMode==="hidden"&&!g.alternate&&!ht)return It(r),null}else 2*Kt()-u.renderingStartTime>Iu&&o!==536870912&&(r.flags|=128,p=!0,wl(u,!1),r.lanes=4194304);u.isBackwards?(g.sibling=r.child,r.child=g):(t=u.last,t!==null?t.sibling=g:r.child=g,u.last=g)}return u.tail!==null?(t=u.tail,u.rendering=t,u.tail=t.sibling,u.renderingStartTime=Kt(),t.sibling=null,o=Jt.current,de(Jt,p?o&1|2:o&1),ht&&da(r,u.treeForkCount),t):(It(r),null);case 22:case 23:return Zn(r),Ph(),u=r.memoizedState!==null,t!==null?t.memoizedState!==null!==u&&(r.flags|=8192):u&&(r.flags|=8192),u?(o&536870912)!==0&&(r.flags&128)===0&&(It(r),r.subtreeFlags&6&&(r.flags|=8192)):It(r),o=r.updateQueue,o!==null&&Ou(r,o.retryQueue),o=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(o=t.memoizedState.cachePool.pool),u=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),u!==o&&(r.flags|=2048),t!==null&&k(Fi),null;case 24:return o=null,t!==null&&(o=t.memoizedState.cache),r.memoizedState.cache!==o&&(r.flags|=2048),ha(tn),It(r),null;case 25:return null;case 30:return null}throw Error(a(156,r.tag))}function nT(t,r){switch(xh(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return ha(tn),Re(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 26:case 27:case 5:return Et(r),null;case 31:if(r.memoizedState!==null){if(Zn(r),r.alternate===null)throw Error(a(340));Bi()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 13:if(Zn(r),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(a(340));Bi()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return k(Jt),null;case 4:return Re(),null;case 10:return ha(r.type),null;case 22:case 23:return Zn(r),Ph(),t!==null&&k(Fi),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return ha(tn),null;case 25:return null;default:return null}}function Bv(t,r){switch(xh(r),r.tag){case 3:ha(tn),Re();break;case 26:case 27:case 5:Et(r);break;case 4:Re();break;case 31:r.memoizedState!==null&&Zn(r);break;case 13:Zn(r);break;case 19:k(Jt);break;case 10:ha(r.type);break;case 22:case 23:Zn(r),Ph(),t!==null&&k(Fi);break;case 24:ha(tn)}}function Cl(t,r){try{var o=r.updateQueue,u=o!==null?o.lastEffect:null;if(u!==null){var p=u.next;o=p;do{if((o.tag&t)===t){u=void 0;var g=o.create,C=o.inst;u=g(),C.destroy=u}o=o.next}while(o!==p)}}catch(R){Tt(r,r.return,R)}}function ti(t,r,o){try{var u=r.updateQueue,p=u!==null?u.lastEffect:null;if(p!==null){var g=p.next;u=g;do{if((u.tag&t)===t){var C=u.inst,R=C.destroy;if(R!==void 0){C.destroy=void 0,p=r;var z=o,X=R;try{X()}catch(ae){Tt(p,z,ae)}}}u=u.next}while(u!==g)}}catch(ae){Tt(r,r.return,ae)}}function qv(t){var r=t.updateQueue;if(r!==null){var o=t.stateNode;try{Mb(r,o)}catch(u){Tt(t,t.return,u)}}}function Gv(t,r,o){o.props=Xi(t.type,t.memoizedProps),o.state=t.memoizedState;try{o.componentWillUnmount()}catch(u){Tt(t,r,u)}}function El(t,r){try{var o=t.ref;if(o!==null){switch(t.tag){case 26:case 27:case 5:var u=t.stateNode;break;case 30:u=t.stateNode;break;default:u=t.stateNode}typeof o=="function"?t.refCleanup=o(u):o.current=u}}catch(p){Tt(t,r,p)}}function Xr(t,r){var o=t.ref,u=t.refCleanup;if(o!==null)if(typeof u=="function")try{u()}catch(p){Tt(t,r,p)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(p){Tt(t,r,p)}else o.current=null}function Fv(t){var r=t.type,o=t.memoizedProps,u=t.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":o.autoFocus&&u.focus();break e;case"img":o.src?u.src=o.src:o.srcSet&&(u.srcset=o.srcSet)}}catch(p){Tt(t,t.return,p)}}function vp(t,r,o){try{var u=t.stateNode;_T(u,t.type,o,r),u[Rn]=r}catch(p){Tt(t,t.return,p)}}function Vv(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&li(t.type)||t.tag===4}function Sp(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Vv(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&&li(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 wp(t,r,o){var u=t.tag;if(u===5||u===6)t=t.stateNode,r?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(t,r):(r=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,r.appendChild(t),o=o._reactRootContainer,o!=null||r.onclick!==null||(r.onclick=Dr));else if(u!==4&&(u===27&&li(t.type)&&(o=t.stateNode,r=null),t=t.child,t!==null))for(wp(t,r,o),t=t.sibling;t!==null;)wp(t,r,o),t=t.sibling}function Lu(t,r,o){var u=t.tag;if(u===5||u===6)t=t.stateNode,r?o.insertBefore(t,r):o.appendChild(t);else if(u!==4&&(u===27&&li(t.type)&&(o=t.stateNode),t=t.child,t!==null))for(Lu(t,r,o),t=t.sibling;t!==null;)Lu(t,r,o),t=t.sibling}function Kv(t){var r=t.stateNode,o=t.memoizedProps;try{for(var u=t.type,p=r.attributes;p.length;)r.removeAttributeNode(p[0]);_n(r,u,o),r[Pt]=t,r[Rn]=o}catch(g){Tt(t,t.return,g)}}var ba=!1,an=!1,Cp=!1,Wv=typeof WeakSet=="function"?WeakSet:Set,mn=null;function rT(t,r){if(t=t.containerInfo,qp=Zu,t=sb(t),gh(t)){if("selectionStart"in t)var o={start:t.selectionStart,end:t.selectionEnd};else e:{o=(o=t.ownerDocument)&&o.defaultView||window;var u=o.getSelection&&o.getSelection();if(u&&u.rangeCount!==0){o=u.anchorNode;var p=u.anchorOffset,g=u.focusNode;u=u.focusOffset;try{o.nodeType,g.nodeType}catch{o=null;break e}var C=0,R=-1,z=-1,X=0,ae=0,le=t,Q=null;t:for(;;){for(var ne;le!==o||p!==0&&le.nodeType!==3||(R=C+p),le!==g||u!==0&&le.nodeType!==3||(z=C+u),le.nodeType===3&&(C+=le.nodeValue.length),(ne=le.firstChild)!==null;)Q=le,le=ne;for(;;){if(le===t)break t;if(Q===o&&++X===p&&(R=C),Q===g&&++ae===u&&(z=C),(ne=le.nextSibling)!==null)break;le=Q,Q=le.parentNode}le=ne}o=R===-1||z===-1?null:{start:R,end:z}}else o=null}o=o||{start:0,end:0}}else o=null;for(Gp={focusedElem:t,selectionRange:o},Zu=!1,mn=r;mn!==null;)if(r=mn,t=r.child,(r.subtreeFlags&1028)!==0&&t!==null)t.return=r,mn=t;else for(;mn!==null;){switch(r=mn,g=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(o=0;o<t.length;o++)p=t[o],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&g!==null){t=void 0,o=r,p=g.memoizedProps,g=g.memoizedState,u=o.stateNode;try{var De=Xi(o.type,p);t=u.getSnapshotBeforeUpdate(De,g),u.__reactInternalSnapshotBeforeUpdate=t}catch(qe){Tt(o,o.return,qe)}}break;case 3:if((t&1024)!==0){if(t=r.stateNode.containerInfo,o=t.nodeType,o===9)Kp(t);else if(o===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Kp(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,mn=t;break}mn=r.return}}function Yv(t,r,o){var u=o.flags;switch(o.tag){case 0:case 11:case 15:Sa(t,o),u&4&&Cl(5,o);break;case 1:if(Sa(t,o),u&4)if(t=o.stateNode,r===null)try{t.componentDidMount()}catch(C){Tt(o,o.return,C)}else{var p=Xi(o.type,r.memoizedProps);r=r.memoizedState;try{t.componentDidUpdate(p,r,t.__reactInternalSnapshotBeforeUpdate)}catch(C){Tt(o,o.return,C)}}u&64&&qv(o),u&512&&El(o,o.return);break;case 3:if(Sa(t,o),u&64&&(t=o.updateQueue,t!==null)){if(r=null,o.child!==null)switch(o.child.tag){case 27:case 5:r=o.child.stateNode;break;case 1:r=o.child.stateNode}try{Mb(t,r)}catch(C){Tt(o,o.return,C)}}break;case 27:r===null&&u&4&&Kv(o);case 26:case 5:Sa(t,o),r===null&&u&4&&Fv(o),u&512&&El(o,o.return);break;case 12:Sa(t,o);break;case 31:Sa(t,o),u&4&&Qv(t,o);break;case 13:Sa(t,o),u&4&&Zv(t,o),u&64&&(t=o.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(o=fT.bind(null,o),LT(t,o))));break;case 22:if(u=o.memoizedState!==null||ba,!u){r=r!==null&&r.memoizedState!==null||an,p=ba;var g=an;ba=u,(an=r)&&!g?wa(t,o,(o.subtreeFlags&8772)!==0):Sa(t,o),ba=p,an=g}break;case 30:break;default:Sa(t,o)}}function Xv(t){var r=t.alternate;r!==null&&(t.alternate=null,Xv(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&qo(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 Ht=null,Pn=!1;function va(t,r,o){for(o=o.child;o!==null;)Jv(t,r,o),o=o.sibling}function Jv(t,r,o){if(un&&typeof un.onCommitFiberUnmount=="function")try{un.onCommitFiberUnmount(lr,o)}catch{}switch(o.tag){case 26:an||Xr(o,r),va(t,r,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:an||Xr(o,r);var u=Ht,p=Pn;li(o.type)&&(Ht=o.stateNode,Pn=!1),va(t,r,o),Ll(o.stateNode),Ht=u,Pn=p;break;case 5:an||Xr(o,r);case 6:if(u=Ht,p=Pn,Ht=null,va(t,r,o),Ht=u,Pn=p,Ht!==null)if(Pn)try{(Ht.nodeType===9?Ht.body:Ht.nodeName==="HTML"?Ht.ownerDocument.body:Ht).removeChild(o.stateNode)}catch(g){Tt(o,r,g)}else try{Ht.removeChild(o.stateNode)}catch(g){Tt(o,r,g)}break;case 18:Ht!==null&&(Pn?(t=Ht,qS(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,o.stateNode),to(t)):qS(Ht,o.stateNode));break;case 4:u=Ht,p=Pn,Ht=o.stateNode.containerInfo,Pn=!0,va(t,r,o),Ht=u,Pn=p;break;case 0:case 11:case 14:case 15:ti(2,o,r),an||ti(4,o,r),va(t,r,o);break;case 1:an||(Xr(o,r),u=o.stateNode,typeof u.componentWillUnmount=="function"&&Gv(o,r,u)),va(t,r,o);break;case 21:va(t,r,o);break;case 22:an=(u=an)||o.memoizedState!==null,va(t,r,o),an=u;break;default:va(t,r,o)}}function Qv(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{to(t)}catch(o){Tt(r,r.return,o)}}}function Zv(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{to(t)}catch(o){Tt(r,r.return,o)}}function aT(t){switch(t.tag){case 31:case 13:case 19:var r=t.stateNode;return r===null&&(r=t.stateNode=new Wv),r;case 22:return t=t.stateNode,r=t._retryCache,r===null&&(r=t._retryCache=new Wv),r;default:throw Error(a(435,t.tag))}}function Mu(t,r){var o=aT(t);r.forEach(function(u){if(!o.has(u)){o.add(u);var p=hT.bind(null,t,u);u.then(p,p)}})}function Bn(t,r){var o=r.deletions;if(o!==null)for(var u=0;u<o.length;u++){var p=o[u],g=t,C=r,R=C;e:for(;R!==null;){switch(R.tag){case 27:if(li(R.type)){Ht=R.stateNode,Pn=!1;break e}break;case 5:Ht=R.stateNode,Pn=!1;break e;case 3:case 4:Ht=R.stateNode.containerInfo,Pn=!0;break e}R=R.return}if(Ht===null)throw Error(a(160));Jv(g,C,p),Ht=null,Pn=!1,g=p.alternate,g!==null&&(g.return=null),p.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)eS(r,t),r=r.sibling}var Nr=null;function eS(t,r){var o=t.alternate,u=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Bn(r,t),qn(t),u&4&&(ti(3,t,t.return),Cl(3,t),ti(5,t,t.return));break;case 1:Bn(r,t),qn(t),u&512&&(an||o===null||Xr(o,o.return)),u&64&&ba&&(t=t.updateQueue,t!==null&&(u=t.callbacks,u!==null&&(o=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=o===null?u:o.concat(u))));break;case 26:var p=Nr;if(Bn(r,t),qn(t),u&512&&(an||o===null||Xr(o,o.return)),u&4){var g=o!==null?o.memoizedState:null;if(u=t.memoizedState,o===null)if(u===null)if(t.stateNode===null){e:{u=t.type,o=t.memoizedProps,p=p.ownerDocument||p;t:switch(u){case"title":g=p.getElementsByTagName("title")[0],(!g||g[xi]||g[Pt]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=p.createElement(u),p.head.insertBefore(g,p.querySelector("head > title"))),_n(g,u,o),g[Pt]=t,en(g),u=g;break e;case"link":var C=ew("link","href",p).get(u+(o.href||""));if(C){for(var R=0;R<C.length;R++)if(g=C[R],g.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&g.getAttribute("rel")===(o.rel==null?null:o.rel)&&g.getAttribute("title")===(o.title==null?null:o.title)&&g.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){C.splice(R,1);break t}}g=p.createElement(u),_n(g,u,o),p.head.appendChild(g);break;case"meta":if(C=ew("meta","content",p).get(u+(o.content||""))){for(R=0;R<C.length;R++)if(g=C[R],g.getAttribute("content")===(o.content==null?null:""+o.content)&&g.getAttribute("name")===(o.name==null?null:o.name)&&g.getAttribute("property")===(o.property==null?null:o.property)&&g.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&g.getAttribute("charset")===(o.charSet==null?null:o.charSet)){C.splice(R,1);break t}}g=p.createElement(u),_n(g,u,o),p.head.appendChild(g);break;default:throw Error(a(468,u))}g[Pt]=t,en(g),u=g}t.stateNode=u}else tw(p,t.type,t.stateNode);else t.stateNode=ZS(p,u,t.memoizedProps);else g!==u?(g===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):g.count--,u===null?tw(p,t.type,t.stateNode):ZS(p,u,t.memoizedProps)):u===null&&t.stateNode!==null&&vp(t,t.memoizedProps,o.memoizedProps)}break;case 27:Bn(r,t),qn(t),u&512&&(an||o===null||Xr(o,o.return)),o!==null&&u&4&&vp(t,t.memoizedProps,o.memoizedProps);break;case 5:if(Bn(r,t),qn(t),u&512&&(an||o===null||Xr(o,o.return)),t.flags&32){p=t.stateNode;try{qa(p,"")}catch(De){Tt(t,t.return,De)}}u&4&&t.stateNode!=null&&(p=t.memoizedProps,vp(t,p,o!==null?o.memoizedProps:p)),u&1024&&(Cp=!0);break;case 6:if(Bn(r,t),qn(t),u&4){if(t.stateNode===null)throw Error(a(162));u=t.memoizedProps,o=t.stateNode;try{o.nodeValue=u}catch(De){Tt(t,t.return,De)}}break;case 3:if(Yu=null,p=Nr,Nr=Ku(r.containerInfo),Bn(r,t),Nr=p,qn(t),u&4&&o!==null&&o.memoizedState.isDehydrated)try{to(r.containerInfo)}catch(De){Tt(t,t.return,De)}Cp&&(Cp=!1,tS(t));break;case 4:u=Nr,Nr=Ku(t.stateNode.containerInfo),Bn(r,t),qn(t),Nr=u;break;case 12:Bn(r,t),qn(t);break;case 31:Bn(r,t),qn(t),u&4&&(u=t.updateQueue,u!==null&&(t.updateQueue=null,Mu(t,u)));break;case 13:Bn(r,t),qn(t),t.child.flags&8192&&t.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(Nu=Kt()),u&4&&(u=t.updateQueue,u!==null&&(t.updateQueue=null,Mu(t,u)));break;case 22:p=t.memoizedState!==null;var z=o!==null&&o.memoizedState!==null,X=ba,ae=an;if(ba=X||p,an=ae||z,Bn(r,t),an=ae,ba=X,qn(t),u&8192)e:for(r=t.stateNode,r._visibility=p?r._visibility&-2:r._visibility|1,p&&(o===null||z||ba||an||Ji(t)),o=null,r=t;;){if(r.tag===5||r.tag===26){if(o===null){z=o=r;try{if(g=z.stateNode,p)C=g.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none";else{R=z.stateNode;var le=z.memoizedProps.style,Q=le!=null&&le.hasOwnProperty("display")?le.display:null;R.style.display=Q==null||typeof Q=="boolean"?"":(""+Q).trim()}}catch(De){Tt(z,z.return,De)}}}else if(r.tag===6){if(o===null){z=r;try{z.stateNode.nodeValue=p?"":z.memoizedProps}catch(De){Tt(z,z.return,De)}}}else if(r.tag===18){if(o===null){z=r;try{var ne=z.stateNode;p?GS(ne,!0):GS(z.stateNode,!1)}catch(De){Tt(z,z.return,De)}}}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;o===r&&(o=null),r=r.return}o===r&&(o=null),r.sibling.return=r.return,r=r.sibling}u&4&&(u=t.updateQueue,u!==null&&(o=u.retryQueue,o!==null&&(u.retryQueue=null,Mu(t,o))));break;case 19:Bn(r,t),qn(t),u&4&&(u=t.updateQueue,u!==null&&(t.updateQueue=null,Mu(t,u)));break;case 30:break;case 21:break;default:Bn(r,t),qn(t)}}function qn(t){var r=t.flags;if(r&2){try{for(var o,u=t.return;u!==null;){if(Vv(u)){o=u;break}u=u.return}if(o==null)throw Error(a(160));switch(o.tag){case 27:var p=o.stateNode,g=Sp(t);Lu(t,g,p);break;case 5:var C=o.stateNode;o.flags&32&&(qa(C,""),o.flags&=-33);var R=Sp(t);Lu(t,R,C);break;case 3:case 4:var z=o.stateNode.containerInfo,X=Sp(t);wp(t,X,z);break;default:throw Error(a(161))}}catch(ae){Tt(t,t.return,ae)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function tS(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var r=t;tS(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),t=t.sibling}}function Sa(t,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)Yv(t,r.alternate,r),r=r.sibling}function Ji(t){for(t=t.child;t!==null;){var r=t;switch(r.tag){case 0:case 11:case 14:case 15:ti(4,r,r.return),Ji(r);break;case 1:Xr(r,r.return);var o=r.stateNode;typeof o.componentWillUnmount=="function"&&Gv(r,r.return,o),Ji(r);break;case 27:Ll(r.stateNode);case 26:case 5:Xr(r,r.return),Ji(r);break;case 22:r.memoizedState===null&&Ji(r);break;case 30:Ji(r);break;default:Ji(r)}t=t.sibling}}function wa(t,r,o){for(o=o&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var u=r.alternate,p=t,g=r,C=g.flags;switch(g.tag){case 0:case 11:case 15:wa(p,g,o),Cl(4,g);break;case 1:if(wa(p,g,o),u=g,p=u.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(X){Tt(u,u.return,X)}if(u=g,p=u.updateQueue,p!==null){var R=u.stateNode;try{var z=p.shared.hiddenCallbacks;if(z!==null)for(p.shared.hiddenCallbacks=null,p=0;p<z.length;p++)Lb(z[p],R)}catch(X){Tt(u,u.return,X)}}o&&C&64&&qv(g),El(g,g.return);break;case 27:Kv(g);case 26:case 5:wa(p,g,o),o&&u===null&&C&4&&Fv(g),El(g,g.return);break;case 12:wa(p,g,o);break;case 31:wa(p,g,o),o&&C&4&&Qv(p,g);break;case 13:wa(p,g,o),o&&C&4&&Zv(p,g);break;case 22:g.memoizedState===null&&wa(p,g,o),El(g,g.return);break;case 30:break;default:wa(p,g,o)}r=r.sibling}}function Ep(t,r){var o=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(o=t.memoizedState.cachePool.pool),t=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(t=r.memoizedState.cachePool.pool),t!==o&&(t!=null&&t.refCount++,o!=null&&cl(o))}function _p(t,r){t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&cl(t))}function Ir(t,r,o,u){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)nS(t,r,o,u),r=r.sibling}function nS(t,r,o,u){var p=r.flags;switch(r.tag){case 0:case 11:case 15:Ir(t,r,o,u),p&2048&&Cl(9,r);break;case 1:Ir(t,r,o,u);break;case 3:Ir(t,r,o,u),p&2048&&(t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&cl(t)));break;case 12:if(p&2048){Ir(t,r,o,u),t=r.stateNode;try{var g=r.memoizedProps,C=g.id,R=g.onPostCommit;typeof R=="function"&&R(C,r.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(z){Tt(r,r.return,z)}}else Ir(t,r,o,u);break;case 31:Ir(t,r,o,u);break;case 13:Ir(t,r,o,u);break;case 23:break;case 22:g=r.stateNode,C=r.alternate,r.memoizedState!==null?g._visibility&2?Ir(t,r,o,u):_l(t,r):g._visibility&2?Ir(t,r,o,u):(g._visibility|=2,Gs(t,r,o,u,(r.subtreeFlags&10256)!==0||!1)),p&2048&&Ep(C,r);break;case 24:Ir(t,r,o,u),p&2048&&_p(r.alternate,r);break;default:Ir(t,r,o,u)}}function Gs(t,r,o,u,p){for(p=p&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var g=t,C=r,R=o,z=u,X=C.flags;switch(C.tag){case 0:case 11:case 15:Gs(g,C,R,z,p),Cl(8,C);break;case 23:break;case 22:var ae=C.stateNode;C.memoizedState!==null?ae._visibility&2?Gs(g,C,R,z,p):_l(g,C):(ae._visibility|=2,Gs(g,C,R,z,p)),p&&X&2048&&Ep(C.alternate,C);break;case 24:Gs(g,C,R,z,p),p&&X&2048&&_p(C.alternate,C);break;default:Gs(g,C,R,z,p)}r=r.sibling}}function _l(t,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var o=t,u=r,p=u.flags;switch(u.tag){case 22:_l(o,u),p&2048&&Ep(u.alternate,u);break;case 24:_l(o,u),p&2048&&_p(u.alternate,u);break;default:_l(o,u)}r=r.sibling}}var Al=8192;function Fs(t,r,o){if(t.subtreeFlags&Al)for(t=t.child;t!==null;)rS(t,r,o),t=t.sibling}function rS(t,r,o){switch(t.tag){case 26:Fs(t,r,o),t.flags&Al&&t.memoizedState!==null&>(o,Nr,t.memoizedState,t.memoizedProps);break;case 5:Fs(t,r,o);break;case 3:case 4:var u=Nr;Nr=Ku(t.stateNode.containerInfo),Fs(t,r,o),Nr=u;break;case 22:t.memoizedState===null&&(u=t.alternate,u!==null&&u.memoizedState!==null?(u=Al,Al=16777216,Fs(t,r,o),Al=u):Fs(t,r,o));break;default:Fs(t,r,o)}}function aS(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 xl(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var o=0;o<r.length;o++){var u=r[o];mn=u,sS(u,t)}aS(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)iS(t),t=t.sibling}function iS(t){switch(t.tag){case 0:case 11:case 15:xl(t),t.flags&2048&&ti(9,t,t.return);break;case 3:xl(t);break;case 12:xl(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)):xl(t);break;default:xl(t)}}function $u(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var o=0;o<r.length;o++){var u=r[o];mn=u,sS(u,t)}aS(t)}for(t=t.child;t!==null;){switch(r=t,r.tag){case 0:case 11:case 15:ti(8,r,r.return),$u(r);break;case 22:o=r.stateNode,o._visibility&2&&(o._visibility&=-3,$u(r));break;default:$u(r)}t=t.sibling}}function sS(t,r){for(;mn!==null;){var o=mn;switch(o.tag){case 0:case 11:case 15:ti(8,o,r);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var u=o.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:cl(o.memoizedState.cache)}if(u=o.child,u!==null)u.return=o,mn=u;else e:for(o=t;mn!==null;){u=mn;var p=u.sibling,g=u.return;if(Xv(u),u===o){mn=null;break e}if(p!==null){p.return=g,mn=p;break e}mn=g}}}var iT={getCacheForType:function(t){var r=Cn(tn),o=r.data.get(t);return o===void 0&&(o=t(),r.data.set(t,o)),o},cacheSignal:function(){return Cn(tn).controller.signal}},sT=typeof WeakMap=="function"?WeakMap:Map,wt=0,Mt=null,it=null,ct=0,xt=0,er=null,ni=!1,Vs=!1,Ap=!1,Ca=0,Yt=0,ri=0,Qi=0,xp=0,tr=0,Ks=0,Tl=null,Gn=null,Tp=!1,Nu=0,oS=0,Iu=1/0,ju=null,ai=null,hn=0,ii=null,Ws=null,Ea=0,kp=0,Rp=null,lS=null,kl=0,Dp=null;function nr(){return(wt&2)!==0&&ct!==0?ct&-ct:J.T!==null?Ip():jt()}function cS(){if(tr===0)if((ct&536870912)===0||ht){var t=ve;ve<<=1,(ve&3932160)===0&&(ve=262144),tr=t}else tr=536870912;return t=Qn.current,t!==null&&(t.flags|=32),tr}function Fn(t,r,o){(t===Mt&&(xt===2||xt===9)||t.cancelPendingCommit!==null)&&(Ys(t,0),si(t,ct,tr,!1)),tt(t,o),((wt&2)===0||t!==Mt)&&(t===Mt&&((wt&2)===0&&(Qi|=o),Yt===4&&si(t,ct,tr,!1)),Jr(t))}function uS(t,r,o){if((wt&6)!==0)throw Error(a(327));var u=!o&&(r&127)===0&&(r&t.expiredLanes)===0||Ke(t,r),p=u?cT(t,r):Lp(t,r,!0),g=u;do{if(p===0){Vs&&!u&&si(t,r,0,!1);break}else{if(o=t.current.alternate,g&&!oT(o)){p=Lp(t,r,!1),g=!1;continue}if(p===2){if(g=r,t.errorRecoveryDisabledLanes&g)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;p=Tl;var z=R.current.memoizedState.isDehydrated;if(z&&(Ys(R,C).flags|=256),C=Lp(R,C,!1),C!==2){if(Ap&&!z){R.errorRecoveryDisabledLanes|=g,Qi|=g,p=4;break e}g=Gn,Gn=p,g!==null&&(Gn===null?Gn=g:Gn.push.apply(Gn,g))}p=C}if(g=!1,p!==2)continue}}if(p===1){Ys(t,0),si(t,r,0,!0);break}e:{switch(u=t,g=p,g){case 0:case 1:throw Error(a(345));case 4:if((r&4194048)!==r)break;case 6:si(u,r,tr,!ni);break e;case 2:Gn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((r&62914560)===r&&(p=Nu+300-Kt(),10<p)){if(si(u,r,tr,!ni),Ae(u,0,!0)!==0)break e;Ea=r,u.timeoutHandle=PS(dS.bind(null,u,o,Gn,ju,Tp,r,tr,Qi,Ks,ni,g,"Throttled",-0,0),p);break e}dS(u,o,Gn,ju,Tp,r,tr,Qi,Ks,ni,g,null,-0,0)}}break}while(!0);Jr(t)}function dS(t,r,o,u,p,g,C,R,z,X,ae,le,Q,ne){if(t.timeoutHandle=-1,le=r.subtreeFlags,le&8192||(le&16785408)===16785408){le={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Dr},rS(r,g,le);var De=(g&62914560)===g?Nu-Kt():(g&4194048)===g?oS-Kt():0;if(De=FT(le,De),De!==null){Ea=g,t.cancelPendingCommit=De(vS.bind(null,t,r,g,o,u,p,C,R,z,ae,le,null,Q,ne)),si(t,g,C,!X);return}}vS(t,r,g,o,u,p,C,R,z)}function oT(t){for(var r=t;;){var o=r.tag;if((o===0||o===11||o===15)&&r.flags&16384&&(o=r.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var u=0;u<o.length;u++){var p=o[u],g=p.getSnapshot;p=p.value;try{if(!Xn(g(),p))return!1}catch{return!1}}if(o=r.child,r.subtreeFlags&16384&&o!==null)o.return=r,r=o;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 si(t,r,o,u){r&=~xp,r&=~Qi,t.suspendedLanes|=r,t.pingedLanes&=~r,u&&(t.warmLanes|=r),u=t.expirationTimes;for(var p=r;0<p;){var g=31-dn(p),C=1<<g;u[g]=-1,p&=~C}o!==0&&Fe(t,o,r)}function Hu(){return(wt&6)===0?(Rl(0),!1):!0}function Op(){if(it!==null){if(xt===0)var t=it.return;else t=it,fa=qi=null,Kh(t),zs=null,dl=0,t=it;for(;t!==null;)Bv(t.alternate,t),t=t.return;it=null}}function Ys(t,r){var o=t.timeoutHandle;o!==-1&&(t.timeoutHandle=-1,TT(o)),o=t.cancelPendingCommit,o!==null&&(t.cancelPendingCommit=null,o()),Ea=0,Op(),Mt=t,it=o=ua(t.current,null),ct=r,xt=0,er=null,ni=!1,Vs=Ke(t,r),Ap=!1,Ks=tr=xp=Qi=ri=Yt=0,Gn=Tl=null,Tp=!1,(r&8)!==0&&(r|=r&32);var u=t.entangledLanes;if(u!==0)for(t=t.entanglements,u&=r;0<u;){var p=31-dn(u),g=1<<p;r|=t[p],u&=~g}return Ca=r,iu(),o}function fS(t,r){Je=null,J.H=vl,r===Hs||r===hu?(r=kb(),xt=3):r===Nh?(r=kb(),xt=4):xt=r===cp?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,er=r,it===null&&(Yt=1,Tu(t,dr(r,t.current)))}function hS(){var t=Qn.current;return t===null?!0:(ct&4194048)===ct?gr===null:(ct&62914560)===ct||(ct&536870912)!==0?t===gr:!1}function pS(){var t=J.H;return J.H=vl,t===null?vl:t}function gS(){var t=J.A;return J.A=iT,t}function zu(){Yt=4,ni||(ct&4194048)!==ct&&Qn.current!==null||(Vs=!0),(ri&134217727)===0&&(Qi&134217727)===0||Mt===null||si(Mt,ct,tr,!1)}function Lp(t,r,o){var u=wt;wt|=2;var p=pS(),g=gS();(Mt!==t||ct!==r)&&(ju=null,Ys(t,r)),r=!1;var C=Yt;e:do try{if(xt!==0&&it!==null){var R=it,z=er;switch(xt){case 8:Op(),C=6;break e;case 3:case 2:case 9:case 6:Qn.current===null&&(r=!0);var X=xt;if(xt=0,er=null,Xs(t,R,z,X),o&&Vs){C=0;break e}break;default:X=xt,xt=0,er=null,Xs(t,R,z,X)}}lT(),C=Yt;break}catch(ae){fS(t,ae)}while(!0);return r&&t.shellSuspendCounter++,fa=qi=null,wt=u,J.H=p,J.A=g,it===null&&(Mt=null,ct=0,iu()),C}function lT(){for(;it!==null;)mS(it)}function cT(t,r){var o=wt;wt|=2;var u=pS(),p=gS();Mt!==t||ct!==r?(ju=null,Iu=Kt()+500,Ys(t,r)):Vs=Ke(t,r);e:do try{if(xt!==0&&it!==null){r=it;var g=er;t:switch(xt){case 1:xt=0,er=null,Xs(t,r,g,1);break;case 2:case 9:if(xb(g)){xt=0,er=null,yS(r);break}r=function(){xt!==2&&xt!==9||Mt!==t||(xt=7),Jr(t)},g.then(r,r);break e;case 3:xt=7;break e;case 4:xt=5;break e;case 7:xb(g)?(xt=0,er=null,yS(r)):(xt=0,er=null,Xs(t,r,g,7));break;case 5:var C=null;switch(it.tag){case 26:C=it.memoizedState;case 5:case 27:var R=it;if(C?nw(C):R.stateNode.complete){xt=0,er=null;var z=R.sibling;if(z!==null)it=z;else{var X=R.return;X!==null?(it=X,Uu(X)):it=null}break t}}xt=0,er=null,Xs(t,r,g,5);break;case 6:xt=0,er=null,Xs(t,r,g,6);break;case 8:Op(),Yt=6;break e;default:throw Error(a(462))}}uT();break}catch(ae){fS(t,ae)}while(!0);return fa=qi=null,J.H=u,J.A=p,wt=o,it!==null?0:(Mt=null,ct=0,iu(),Yt)}function uT(){for(;it!==null&&!cn();)mS(it)}function mS(t){var r=Uv(t.alternate,t,Ca);t.memoizedProps=t.pendingProps,r===null?Uu(t):it=r}function yS(t){var r=t,o=r.alternate;switch(r.tag){case 15:case 0:r=$v(o,r,r.pendingProps,r.type,void 0,ct);break;case 11:r=$v(o,r,r.pendingProps,r.type.render,r.ref,ct);break;case 5:Kh(r);default:Bv(o,r),r=it=gb(r,Ca),r=Uv(o,r,Ca)}t.memoizedProps=t.pendingProps,r===null?Uu(t):it=r}function Xs(t,r,o,u){fa=qi=null,Kh(r),zs=null,dl=0;var p=r.return;try{if(Qx(t,p,r,o,ct)){Yt=1,Tu(t,dr(o,t.current)),it=null;return}}catch(g){if(p!==null)throw it=p,g;Yt=1,Tu(t,dr(o,t.current)),it=null;return}r.flags&32768?(ht||u===1?t=!0:Vs||(ct&536870912)!==0?t=!1:(ni=t=!0,(u===2||u===9||u===3||u===6)&&(u=Qn.current,u!==null&&u.tag===13&&(u.flags|=16384))),bS(r,t)):Uu(r)}function Uu(t){var r=t;do{if((r.flags&32768)!==0){bS(r,ni);return}t=r.return;var o=tT(r.alternate,r,Ca);if(o!==null){it=o;return}if(r=r.sibling,r!==null){it=r;return}it=r=t}while(r!==null);Yt===0&&(Yt=5)}function bS(t,r){do{var o=nT(t.alternate,t);if(o!==null){o.flags&=32767,it=o;return}if(o=t.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!r&&(t=t.sibling,t!==null)){it=t;return}it=t=o}while(t!==null);Yt=6,it=null}function vS(t,r,o,u,p,g,C,R,z){t.cancelPendingCommit=null;do Pu();while(hn!==0);if((wt&6)!==0)throw Error(a(327));if(r!==null){if(r===t.current)throw Error(a(177));if(g=r.lanes|r.childLanes,g|=Sh,He(t,o,g,C,R,z),t===Mt&&(it=Mt=null,ct=0),Ws=r,ii=t,Ea=o,kp=g,Rp=p,lS=u,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,pT(Ln,function(){return _S(),null})):(t.callbackNode=null,t.callbackPriority=0),u=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||u){u=J.T,J.T=null,p=ue.p,ue.p=2,C=wt,wt|=4;try{rT(t,r,o)}finally{wt=C,ue.p=p,J.T=u}}hn=1,SS(),wS(),CS()}}function SS(){if(hn===1){hn=0;var t=ii,r=Ws,o=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||o){o=J.T,J.T=null;var u=ue.p;ue.p=2;var p=wt;wt|=4;try{eS(r,t);var g=Gp,C=sb(t.containerInfo),R=g.focusedElem,z=g.selectionRange;if(C!==R&&R&&R.ownerDocument&&ib(R.ownerDocument.documentElement,R)){if(z!==null&&gh(R)){var X=z.start,ae=z.end;if(ae===void 0&&(ae=X),"selectionStart"in R)R.selectionStart=X,R.selectionEnd=Math.min(ae,R.value.length);else{var le=R.ownerDocument||document,Q=le&&le.defaultView||window;if(Q.getSelection){var ne=Q.getSelection(),De=R.textContent.length,qe=Math.min(z.start,De),Ot=z.end===void 0?qe:Math.min(z.end,De);!ne.extend&&qe>Ot&&(C=Ot,Ot=qe,qe=C);var K=ab(R,qe),G=ab(R,Ot);if(K&&G&&(ne.rangeCount!==1||ne.anchorNode!==K.node||ne.anchorOffset!==K.offset||ne.focusNode!==G.node||ne.focusOffset!==G.offset)){var Y=le.createRange();Y.setStart(K.node,K.offset),ne.removeAllRanges(),qe>Ot?(ne.addRange(Y),ne.extend(G.node,G.offset)):(Y.setEnd(G.node,G.offset),ne.addRange(Y))}}}}for(le=[],ne=R;ne=ne.parentNode;)ne.nodeType===1&&le.push({element:ne,left:ne.scrollLeft,top:ne.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R<le.length;R++){var oe=le[R];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}Zu=!!qp,Gp=qp=null}finally{wt=p,ue.p=u,J.T=o}}t.current=r,hn=2}}function wS(){if(hn===2){hn=0;var t=ii,r=Ws,o=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||o){o=J.T,J.T=null;var u=ue.p;ue.p=2;var p=wt;wt|=4;try{Yv(t,r.alternate,r)}finally{wt=p,ue.p=u,J.T=o}}hn=3}}function CS(){if(hn===4||hn===3){hn=0,Gr();var t=ii,r=Ws,o=Ea,u=lS;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?hn=5:(hn=0,Ws=ii=null,ES(t,t.pendingLanes));var p=t.pendingLanes;if(p===0&&(ai=null),kt(o),r=r.stateNode,un&&typeof un.onCommitFiberRoot=="function")try{un.onCommitFiberRoot(lr,r,void 0,(r.current.flags&128)===128)}catch{}if(u!==null){r=J.T,p=ue.p,ue.p=2,J.T=null;try{for(var g=t.onRecoverableError,C=0;C<u.length;C++){var R=u[C];g(R.value,{componentStack:R.stack})}}finally{J.T=r,ue.p=p}}(Ea&3)!==0&&Pu(),Jr(t),p=t.pendingLanes,(o&261930)!==0&&(p&42)!==0?t===Dp?kl++:(kl=0,Dp=t):kl=0,Rl(0)}}function ES(t,r){(t.pooledCacheLanes&=r)===0&&(r=t.pooledCache,r!=null&&(t.pooledCache=null,cl(r)))}function Pu(){return SS(),wS(),CS(),_S()}function _S(){if(hn!==5)return!1;var t=ii,r=kp;kp=0;var o=kt(Ea),u=J.T,p=ue.p;try{ue.p=32>o?32:o,J.T=null,o=Rp,Rp=null;var g=ii,C=Ea;if(hn=0,Ws=ii=null,Ea=0,(wt&6)!==0)throw Error(a(331));var R=wt;if(wt|=4,iS(g.current),nS(g,g.current,C,o),wt=R,Rl(0,!1),un&&typeof un.onPostCommitFiberRoot=="function")try{un.onPostCommitFiberRoot(lr,g)}catch{}return!0}finally{ue.p=p,J.T=u,ES(t,r)}}function AS(t,r,o){r=dr(o,r),r=lp(t.stateNode,r,2),t=Qa(t,r,2),t!==null&&(tt(t,2),Jr(t))}function Tt(t,r,o){if(t.tag===3)AS(t,t,o);else for(;r!==null;){if(r.tag===3){AS(r,t,o);break}else if(r.tag===1){var u=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(ai===null||!ai.has(u))){t=dr(o,t),o=xv(2),u=Qa(r,o,2),u!==null&&(Tv(o,u,r,t),tt(u,2),Jr(u));break}}r=r.return}}function Mp(t,r,o){var u=t.pingCache;if(u===null){u=t.pingCache=new sT;var p=new Set;u.set(r,p)}else p=u.get(r),p===void 0&&(p=new Set,u.set(r,p));p.has(o)||(Ap=!0,p.add(o),t=dT.bind(null,t,r,o),r.then(t,t))}function dT(t,r,o){var u=t.pingCache;u!==null&&u.delete(r),t.pingedLanes|=t.suspendedLanes&o,t.warmLanes&=~o,Mt===t&&(ct&o)===o&&(Yt===4||Yt===3&&(ct&62914560)===ct&&300>Kt()-Nu?(wt&2)===0&&Ys(t,0):xp|=o,Ks===ct&&(Ks=0)),Jr(t)}function xS(t,r){r===0&&(r=$e()),t=Ui(t,r),t!==null&&(tt(t,r),Jr(t))}function fT(t){var r=t.memoizedState,o=0;r!==null&&(o=r.retryLane),xS(t,o)}function hT(t,r){var o=0;switch(t.tag){case 31:case 13:var u=t.stateNode,p=t.memoizedState;p!==null&&(o=p.retryLane);break;case 19:u=t.stateNode;break;case 22:u=t.stateNode._retryCache;break;default:throw Error(a(314))}u!==null&&u.delete(r),xS(t,o)}function pT(t,r){return Vt(t,r)}var Bu=null,Js=null,$p=!1,qu=!1,Np=!1,oi=0;function Jr(t){t!==Js&&t.next===null&&(Js===null?Bu=Js=t:Js=Js.next=t),qu=!0,$p||($p=!0,mT())}function Rl(t,r){if(!Np&&qu){Np=!0;do for(var o=!1,u=Bu;u!==null;){if(t!==0){var p=u.pendingLanes;if(p===0)var g=0;else{var C=u.suspendedLanes,R=u.pingedLanes;g=(1<<31-dn(42|t)+1)-1,g&=p&~(C&~R),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(o=!0,DS(u,g))}else g=ct,g=Ae(u,u===Mt?g:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(g&3)===0||Ke(u,g)||(o=!0,DS(u,g));u=u.next}while(o);Np=!1}}function gT(){TS()}function TS(){qu=$p=!1;var t=0;oi!==0&&xT()&&(t=oi);for(var r=Kt(),o=null,u=Bu;u!==null;){var p=u.next,g=kS(u,r);g===0?(u.next=null,o===null?Bu=p:o.next=p,p===null&&(Js=o)):(o=u,(t!==0||(g&3)!==0)&&(qu=!0)),u=p}hn!==0&&hn!==5||Rl(t),oi!==0&&(oi=0)}function kS(t,r){for(var o=t.suspendedLanes,u=t.pingedLanes,p=t.expirationTimes,g=t.pendingLanes&-62914561;0<g;){var C=31-dn(g),R=1<<C,z=p[C];z===-1?((R&o)===0||(R&u)!==0)&&(p[C]=Te(R,r)):z<=r&&(t.expiredLanes|=R),g&=~R}if(r=Mt,o=ct,o=Ae(t,t===r?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),u=t.callbackNode,o===0||t===r&&(xt===2||xt===9)||t.cancelPendingCommit!==null)return u!==null&&u!==null&&ln(u),t.callbackNode=null,t.callbackPriority=0;if((o&3)===0||Ke(t,o)){if(r=o&-o,r===t.callbackPriority)return r;switch(u!==null&&ln(u),kt(o)){case 2:case 8:o=bn;break;case 32:o=Ln;break;case 268435456:o=Hn;break;default:o=Ln}return u=RS.bind(null,t),o=Vt(o,u),t.callbackPriority=r,t.callbackNode=o,r}return u!==null&&u!==null&&ln(u),t.callbackPriority=2,t.callbackNode=null,2}function RS(t,r){if(hn!==0&&hn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var o=t.callbackNode;if(Pu()&&t.callbackNode!==o)return null;var u=ct;return u=Ae(t,t===Mt?u:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),u===0?null:(uS(t,u,r),kS(t,Kt()),t.callbackNode!=null&&t.callbackNode===o?RS.bind(null,t):null)}function DS(t,r){if(Pu())return null;uS(t,r,!0)}function mT(){kT(function(){(wt&6)!==0?Vt(aa,gT):TS()})}function Ip(){if(oi===0){var t=Is;t===0&&(t=Z,Z<<=1,(Z&261888)===0&&(Z=256)),oi=t}return oi}function OS(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:cr(""+t)}function LS(t,r){var o=r.ownerDocument.createElement("input");return o.name=r.name,o.value=r.value,t.id&&o.setAttribute("form",t.id),r.parentNode.insertBefore(o,r),t=new FormData(t),o.parentNode.removeChild(o),t}function yT(t,r,o,u,p){if(r==="submit"&&o&&o.stateNode===p){var g=OS((p[Rn]||null).action),C=u.submitter;C&&(r=(r=C[Rn]||null)?OS(r.formAction):C.getAttribute("formAction"),r!==null&&(g=r,C=null));var R=new ca("action","action",null,u,p);t.push({event:R,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(oi!==0){var z=C?LS(p,C):new FormData(p);np(o,{pending:!0,data:z,method:p.method,action:g},null,z)}}else typeof g=="function"&&(R.preventDefault(),z=C?LS(p,C):new FormData(p),np(o,{pending:!0,data:z,method:p.method,action:g},g,z))},currentTarget:p}]})}}for(var jp=0;jp<vh.length;jp++){var Hp=vh[jp],bT=Hp.toLowerCase(),vT=Hp[0].toUpperCase()+Hp.slice(1);$r(bT,"on"+vT)}$r(cb,"onAnimationEnd"),$r(ub,"onAnimationIteration"),$r(db,"onAnimationStart"),$r("dblclick","onDoubleClick"),$r("focusin","onFocus"),$r("focusout","onBlur"),$r(Nx,"onTransitionRun"),$r(Ix,"onTransitionStart"),$r(jx,"onTransitionCancel"),$r(fb,"onTransitionEnd"),za("onMouseEnter",["mouseout","mouseover"]),za("onMouseLeave",["mouseout","mouseover"]),za("onPointerEnter",["pointerout","pointerover"]),za("onPointerLeave",["pointerout","pointerover"]),Rr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Rr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Rr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Rr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Rr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Rr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Dl="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(" "),ST=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Dl));function MS(t,r){r=(r&4)!==0;for(var o=0;o<t.length;o++){var u=t[o],p=u.event;u=u.listeners;e:{var g=void 0;if(r)for(var C=u.length-1;0<=C;C--){var R=u[C],z=R.instance,X=R.currentTarget;if(R=R.listener,z!==g&&p.isPropagationStopped())break e;g=R,p.currentTarget=X;try{g(p)}catch(ae){au(ae)}p.currentTarget=null,g=z}else for(C=0;C<u.length;C++){if(R=u[C],z=R.instance,X=R.currentTarget,R=R.listener,z!==g&&p.isPropagationStopped())break e;g=R,p.currentTarget=X;try{g(p)}catch(ae){au(ae)}p.currentTarget=null,g=z}}}}function st(t,r){var o=r[Bo];o===void 0&&(o=r[Bo]=new Set);var u=t+"__bubble";o.has(u)||($S(r,t,2,!1),o.add(u))}function zp(t,r,o){var u=0;r&&(u|=4),$S(o,t,u,r)}var Gu="_reactListening"+Math.random().toString(36).slice(2);function Up(t){if(!t[Gu]){t[Gu]=!0,Nc.forEach(function(o){o!=="selectionchange"&&(ST.has(o)||zp(o,!1,t),zp(o,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[Gu]||(r[Gu]=!0,zp("selectionchange",!1,r))}}function $S(t,r,o,u){switch(cw(r)){case 2:var p=WT;break;case 8:p=YT;break;default:p=tg}o=p.bind(null,r,o,t),p=void 0,!Yo||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(p=!0),u?p!==void 0?t.addEventListener(r,o,{capture:!0,passive:p}):t.addEventListener(r,o,!0):p!==void 0?t.addEventListener(r,o,{passive:p}):t.addEventListener(r,o,!1)}function Pp(t,r,o,u,p){var g=u;if((r&1)===0&&(r&2)===0&&u!==null)e:for(;;){if(u===null)return;var C=u.tag;if(C===3||C===4){var R=u.stateNode.containerInfo;if(R===p)break;if(C===4)for(C=u.return;C!==null;){var z=C.tag;if((z===3||z===4)&&C.stateNode.containerInfo===p)return;C=C.return}for(;R!==null;){if(C=ja(R),C===null)return;if(z=C.tag,z===5||z===6||z===26||z===27){u=g=C;continue e}R=R.parentNode}}u=u.return}Fc(function(){var X=g,ae=Wo(o),le=[];e:{var Q=hb.get(t);if(Q!==void 0){var ne=ca,De=t;switch(t){case"keypress":if(Oi(o)===0)break e;case"keydown":case"keyup":ne=ih;break;case"focusin":De="focus",ne=Zo;break;case"focusout":De="blur",ne=Zo;break;case"beforeblur":case"afterblur":ne=Zo;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ne=Wc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ne=tb;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=lh;break;case cb:case ub:case db:ne=Qf;break;case fb:ne=Ts;break;case"scroll":case"scrollend":ne=Yf;break;case"wheel":ne=E;break;case"copy":case"cut":case"paste":ne=Yc;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ne=Qc;break;case"toggle":case"beforetoggle":ne=w}var qe=(r&4)!==0,Ot=!qe&&(t==="scroll"||t==="scrollend"),K=qe?Q!==null?Q+"Capture":null:Q;qe=[];for(var G=X,Y;G!==null;){var oe=G;if(Y=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||Y===null||K===null||(oe=Ri(G,K),oe!=null&&qe.push(Ol(G,oe,Y))),Ot)break;G=G.return}0<qe.length&&(Q=new ne(Q,De,null,o,ae),le.push({event:Q,listeners:qe}))}}if((r&7)===0){e:{if(Q=t==="mouseover"||t==="pointerover",ne=t==="mouseout"||t==="pointerout",Q&&o!==Ko&&(De=o.relatedTarget||o.fromElement)&&(ja(De)||De[Ia]))break e;if((ne||Q)&&(Q=ae.window===ae?ae:(Q=ae.ownerDocument)?Q.defaultView||Q.parentWindow:window,ne?(De=o.relatedTarget||o.toElement,ne=X,De=De?ja(De):null,De!==null&&(Ot=l(De),qe=De.tag,De!==Ot||qe!==5&&qe!==27&&qe!==6)&&(De=null)):(ne=null,De=X),ne!==De)){if(qe=Wc,oe="onMouseLeave",K="onMouseEnter",G="mouse",(t==="pointerout"||t==="pointerover")&&(qe=Qc,oe="onPointerLeave",K="onPointerEnter",G="pointer"),Ot=ne==null?Q:sa(ne),Y=De==null?Q:sa(De),Q=new qe(oe,G+"leave",ne,o,ae),Q.target=Ot,Q.relatedTarget=Y,oe=null,ja(ae)===X&&(qe=new qe(K,G+"enter",De,o,ae),qe.target=Y,qe.relatedTarget=Ot,oe=qe),Ot=oe,ne&&De)t:{for(qe=wT,K=ne,G=De,Y=0,oe=K;oe;oe=qe(oe))Y++;oe=0;for(var Pe=G;Pe;Pe=qe(Pe))oe++;for(;0<Y-oe;)K=qe(K),Y--;for(;0<oe-Y;)G=qe(G),oe--;for(;Y--;){if(K===G||G!==null&&K===G.alternate){qe=K;break t}K=qe(K),G=qe(G)}qe=null}else qe=null;ne!==null&&NS(le,Q,ne,qe,!1),De!==null&&Ot!==null&&NS(le,Ot,De,qe,!0)}}e:{if(Q=X?sa(X):window,ne=Q.nodeName&&Q.nodeName.toLowerCase(),ne==="select"||ne==="input"&&Q.type==="file")var yt=nl;else if(tl(Q))if(rl)yt=Lx;else{yt=ph;var Ne=hh}else ne=Q.nodeName,!ne||ne.toLowerCase()!=="input"||Q.type!=="checkbox"&&Q.type!=="radio"?X&&Fo(X.elementType)&&(yt=nl):yt=ru;if(yt&&(yt=yt(t,X))){eu(le,yt,o,ae);break e}Ne&&Ne(t,Q,X),t==="focusout"&&X&&Q.type==="number"&&X.memoizedProps.value!=null&&oa(Q,"number",Q.value)}switch(Ne=X?sa(X):window,t){case"focusin":(tl(Ne)||Ne.contentEditable==="true")&&(ks=Ne,mh=X,sl=null);break;case"focusout":sl=mh=ks=null;break;case"mousedown":yh=!0;break;case"contextmenu":case"mouseup":case"dragend":yh=!1,ob(le,o,ae);break;case"selectionchange":if($x)break;case"keydown":case"keyup":ob(le,o,ae)}var Qe;if(I)e:{switch(t){case"compositionstart":var ut="onCompositionStart";break e;case"compositionend":ut="onCompositionEnd";break e;case"compositionupdate":ut="onCompositionUpdate";break e}ut=void 0}else Mr?mt(t,o)&&(ut="onCompositionEnd"):t==="keydown"&&o.keyCode===229&&(ut="onCompositionStart");ut&&(Le&&o.locale!=="ko"&&(Mr||ut!=="onCompositionStart"?ut==="onCompositionEnd"&&Mr&&(Qe=Vc()):(Kr=ae,Xo="value"in Kr?Kr.value:Kr.textContent,Mr=!0)),Ne=Fu(X,ut),0<Ne.length&&(ut=new Xc(ut,t,null,o,ae),le.push({event:ut,listeners:Ne}),Qe?ut.data=Qe:(Qe=Bt(o),Qe!==null&&(ut.data=Qe)))),(Qe=me?uh(t,o):Zc(t,o))&&(ut=Fu(X,"onBeforeInput"),0<ut.length&&(Ne=new Xc("onBeforeInput","beforeinput",null,o,ae),le.push({event:Ne,listeners:ut}),Ne.data=Qe)),yT(le,t,X,o,ae)}MS(le,r)})}function Ol(t,r,o){return{instance:t,listener:r,currentTarget:o}}function Fu(t,r){for(var o=r+"Capture",u=[];t!==null;){var p=t,g=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||g===null||(p=Ri(t,o),p!=null&&u.unshift(Ol(t,p,g)),p=Ri(t,r),p!=null&&u.push(Ol(t,p,g))),t.tag===3)return u;t=t.return}return[]}function wT(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,o,u,p){for(var g=r._reactName,C=[];o!==null&&o!==u;){var R=o,z=R.alternate,X=R.stateNode;if(R=R.tag,z!==null&&z===u)break;R!==5&&R!==26&&R!==27||X===null||(z=X,p?(X=Ri(o,g),X!=null&&C.unshift(Ol(o,X,z))):p||(X=Ri(o,g),X!=null&&C.push(Ol(o,X,z)))),o=o.return}C.length!==0&&t.push({event:r,listeners:C})}var CT=/\r\n?/g,ET=/\u0000|\uFFFD/g;function IS(t){return(typeof t=="string"?t:""+t).replace(CT,`
|
||
`).replace(ET,"")}function jS(t,r){return r=IS(r),IS(t)===r}function Dt(t,r,o,u,p,g){switch(o){case"children":typeof u=="string"?r==="body"||r==="textarea"&&u===""||qa(t,u):(typeof u=="number"||typeof u=="bigint")&&r!=="body"&&qa(t,""+u);break;case"className":Ti(t,"class",u);break;case"tabIndex":Ti(t,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":Ti(t,o,u);break;case"style":qc(t,u,g);break;case"data":if(r!=="object"){Ti(t,"data",u);break}case"src":case"href":if(u===""&&(r!=="a"||o!=="href")){t.removeAttribute(o);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(o);break}u=cr(""+u),t.setAttribute(o,u);break;case"action":case"formAction":if(typeof u=="function"){t.setAttribute(o,"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 g=="function"&&(o==="formAction"?(r!=="input"&&Dt(t,r,"name",p.name,p,null),Dt(t,r,"formEncType",p.formEncType,p,null),Dt(t,r,"formMethod",p.formMethod,p,null),Dt(t,r,"formTarget",p.formTarget,p,null)):(Dt(t,r,"encType",p.encType,p,null),Dt(t,r,"method",p.method,p,null),Dt(t,r,"target",p.target,p,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(o);break}u=cr(""+u),t.setAttribute(o,u);break;case"onClick":u!=null&&(t.onclick=Dr);break;case"onScroll":u!=null&&st("scroll",t);break;case"onScrollEnd":u!=null&&st("scrollend",t);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(a(61));if(o=u.__html,o!=null){if(p.children!=null)throw Error(a(60));t.innerHTML=o}}break;case"multiple":t.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":t.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){t.removeAttribute("xlink:href");break}o=cr(""+u),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(o,""+u):t.removeAttribute(o);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":u&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(o,""):t.removeAttribute(o);break;case"capture":case"download":u===!0?t.setAttribute(o,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(o,u):t.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?t.setAttribute(o,u):t.removeAttribute(o);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?t.removeAttribute(o):t.setAttribute(o,u);break;case"popover":st("beforetoggle",t),st("toggle",t),zn(t,"popover",u);break;case"xlinkActuate":Sn(t,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Sn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Sn(t,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Sn(t,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Sn(t,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Sn(t,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Sn(t,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Sn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Sn(t,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":zn(t,"is",u);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=Wf.get(o)||o,zn(t,o,u))}}function Bp(t,r,o,u,p,g){switch(o){case"style":qc(t,u,g);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(a(61));if(o=u.__html,o!=null){if(p.children!=null)throw Error(a(60));t.innerHTML=o}}break;case"children":typeof u=="string"?qa(t,u):(typeof u=="number"||typeof u=="bigint")&&qa(t,""+u);break;case"onScroll":u!=null&&st("scroll",t);break;case"onScrollEnd":u!=null&&st("scrollend",t);break;case"onClick":u!=null&&(t.onclick=Dr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ic.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(p=o.endsWith("Capture"),r=o.slice(2,p?o.length-7:void 0),g=t[Rn]||null,g=g!=null?g[o]:null,typeof g=="function"&&t.removeEventListener(r,g,p),typeof u=="function")){typeof g!="function"&&g!==null&&(o in t?t[o]=null:t.hasAttribute(o)&&t.removeAttribute(o)),t.addEventListener(r,u,p);break e}o in t?t[o]=u:u===!0?t.setAttribute(o,""):zn(t,o,u)}}}function _n(t,r,o){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":st("error",t),st("load",t);var u=!1,p=!1,g;for(g in o)if(o.hasOwnProperty(g)){var C=o[g];if(C!=null)switch(g){case"src":u=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,r));default:Dt(t,r,g,C,o,null)}}p&&Dt(t,r,"srcSet",o.srcSet,o,null),u&&Dt(t,r,"src",o.src,o,null);return;case"input":st("invalid",t);var R=g=C=p=null,z=null,X=null;for(u in o)if(o.hasOwnProperty(u)){var ae=o[u];if(ae!=null)switch(u){case"name":p=ae;break;case"type":C=ae;break;case"checked":z=ae;break;case"defaultChecked":X=ae;break;case"value":g=ae;break;case"defaultValue":R=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(a(137,r));break;default:Dt(t,r,u,ae,o,null)}}ki(t,g,R,z,X,C,p,!1);return;case"select":st("invalid",t),u=C=g=null;for(p in o)if(o.hasOwnProperty(p)&&(R=o[p],R!=null))switch(p){case"value":g=R;break;case"defaultValue":C=R;break;case"multiple":u=R;default:Dt(t,r,p,R,o,null)}r=g,o=C,t.multiple=!!u,r!=null?Pa(t,!!u,r,!1):o!=null&&Pa(t,!!u,o,!0);return;case"textarea":st("invalid",t),g=p=u=null;for(C in o)if(o.hasOwnProperty(C)&&(R=o[C],R!=null))switch(C){case"value":u=R;break;case"defaultValue":p=R;break;case"children":g=R;break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(a(91));break;default:Dt(t,r,C,R,o,null)}Pc(t,u,p,g);return;case"option":for(z in o)o.hasOwnProperty(z)&&(u=o[z],u!=null)&&(z==="selected"?t.selected=u&&typeof u!="function"&&typeof u!="symbol":Dt(t,r,z,u,o,null));return;case"dialog":st("beforetoggle",t),st("toggle",t),st("cancel",t),st("close",t);break;case"iframe":case"object":st("load",t);break;case"video":case"audio":for(u=0;u<Dl.length;u++)st(Dl[u],t);break;case"image":st("error",t),st("load",t);break;case"details":st("toggle",t);break;case"embed":case"source":case"link":st("error",t),st("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(X in o)if(o.hasOwnProperty(X)&&(u=o[X],u!=null))switch(X){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,r));default:Dt(t,r,X,u,o,null)}return;default:if(Fo(r)){for(ae in o)o.hasOwnProperty(ae)&&(u=o[ae],u!==void 0&&Bp(t,r,ae,u,o,void 0));return}}for(R in o)o.hasOwnProperty(R)&&(u=o[R],u!=null&&Dt(t,r,R,u,o,null))}function _T(t,r,o,u){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,g=null,C=null,R=null,z=null,X=null,ae=null;for(ne in o){var le=o[ne];if(o.hasOwnProperty(ne)&&le!=null)switch(ne){case"checked":break;case"value":break;case"defaultValue":z=le;default:u.hasOwnProperty(ne)||Dt(t,r,ne,null,u,le)}}for(var Q in u){var ne=u[Q];if(le=o[Q],u.hasOwnProperty(Q)&&(ne!=null||le!=null))switch(Q){case"type":g=ne;break;case"name":p=ne;break;case"checked":X=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!==le&&Dt(t,r,Q,ne,u,le)}}Cs(t,C,R,z,X,ae,g,p);return;case"select":ne=C=R=Q=null;for(g in o)if(z=o[g],o.hasOwnProperty(g)&&z!=null)switch(g){case"value":break;case"multiple":ne=z;default:u.hasOwnProperty(g)||Dt(t,r,g,null,u,z)}for(p in u)if(g=u[p],z=o[p],u.hasOwnProperty(p)&&(g!=null||z!=null))switch(p){case"value":Q=g;break;case"defaultValue":R=g;break;case"multiple":C=g;default:g!==z&&Dt(t,r,p,g,u,z)}r=R,o=C,u=ne,Q!=null?Pa(t,!!o,Q,!1):!!u!=!!o&&(r!=null?Pa(t,!!o,r,!0):Pa(t,!!o,o?[]:"",!1));return;case"textarea":ne=Q=null;for(R in o)if(p=o[R],o.hasOwnProperty(R)&&p!=null&&!u.hasOwnProperty(R))switch(R){case"value":break;case"children":break;default:Dt(t,r,R,null,u,p)}for(C in u)if(p=u[C],g=o[C],u.hasOwnProperty(C)&&(p!=null||g!=null))switch(C){case"value":Q=p;break;case"defaultValue":ne=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==g&&Dt(t,r,C,p,u,g)}Ba(t,Q,ne);return;case"option":for(var De in o)Q=o[De],o.hasOwnProperty(De)&&Q!=null&&!u.hasOwnProperty(De)&&(De==="selected"?t.selected=!1:Dt(t,r,De,null,u,Q));for(z in u)Q=u[z],ne=o[z],u.hasOwnProperty(z)&&Q!==ne&&(Q!=null||ne!=null)&&(z==="selected"?t.selected=Q&&typeof Q!="function"&&typeof Q!="symbol":Dt(t,r,z,Q,u,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 qe in o)Q=o[qe],o.hasOwnProperty(qe)&&Q!=null&&!u.hasOwnProperty(qe)&&Dt(t,r,qe,null,u,Q);for(X in u)if(Q=u[X],ne=o[X],u.hasOwnProperty(X)&&Q!==ne&&(Q!=null||ne!=null))switch(X){case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(a(137,r));break;default:Dt(t,r,X,Q,u,ne)}return;default:if(Fo(r)){for(var Ot in o)Q=o[Ot],o.hasOwnProperty(Ot)&&Q!==void 0&&!u.hasOwnProperty(Ot)&&Bp(t,r,Ot,void 0,u,Q);for(ae in u)Q=u[ae],ne=o[ae],!u.hasOwnProperty(ae)||Q===ne||Q===void 0&&ne===void 0||Bp(t,r,ae,Q,u,ne);return}}for(var K in o)Q=o[K],o.hasOwnProperty(K)&&Q!=null&&!u.hasOwnProperty(K)&&Dt(t,r,K,null,u,Q);for(le in u)Q=u[le],ne=o[le],!u.hasOwnProperty(le)||Q===ne||Q==null&&ne==null||Dt(t,r,le,Q,u,ne)}function HS(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function AT(){if(typeof performance.getEntriesByType=="function"){for(var t=0,r=0,o=performance.getEntriesByType("resource"),u=0;u<o.length;u++){var p=o[u],g=p.transferSize,C=p.initiatorType,R=p.duration;if(g&&R&&HS(C)){for(C=0,R=p.responseEnd,u+=1;u<o.length;u++){var z=o[u],X=z.startTime;if(X>R)break;var ae=z.transferSize,le=z.initiatorType;ae&&HS(le)&&(z=z.responseEnd,C+=ae*(z<R?1:(R-X)/(z-X)))}if(--u,r+=8*(g+C)/(p.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 qp=null,Gp=null;function Vu(t){return t.nodeType===9?t:t.ownerDocument}function zS(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 US(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 Fp(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 Vp=null;function xT(){var t=window.event;return t&&t.type==="popstate"?t===Vp?!1:(Vp=t,!0):(Vp=null,!1)}var PS=typeof setTimeout=="function"?setTimeout:void 0,TT=typeof clearTimeout=="function"?clearTimeout:void 0,BS=typeof Promise=="function"?Promise:void 0,kT=typeof queueMicrotask=="function"?queueMicrotask:typeof BS<"u"?function(t){return BS.resolve(null).then(t).catch(RT)}:PS;function RT(t){setTimeout(function(){throw t})}function li(t){return t==="head"}function qS(t,r){var o=r,u=0;do{var p=o.nextSibling;if(t.removeChild(o),p&&p.nodeType===8)if(o=p.data,o==="/$"||o==="/&"){if(u===0){t.removeChild(p),to(r);return}u--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")u++;else if(o==="html")Ll(t.ownerDocument.documentElement);else if(o==="head"){o=t.ownerDocument.head,Ll(o);for(var g=o.firstChild;g;){var C=g.nextSibling,R=g.nodeName;g[xi]||R==="SCRIPT"||R==="STYLE"||R==="LINK"&&g.rel.toLowerCase()==="stylesheet"||o.removeChild(g),g=C}}else o==="body"&&Ll(t.ownerDocument.body);o=p}while(o);to(r)}function GS(t,r){var o=t;t=0;do{var u=o.nextSibling;if(o.nodeType===1?r?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(r?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),u&&u.nodeType===8)if(o=u.data,o==="/$"){if(t===0)break;t--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||t++;o=u}while(o)}function Kp(t){var r=t.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var o=r;switch(r=r.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":Kp(o),qo(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}t.removeChild(o)}}function DT(t,r,o,u){for(;t.nodeType===1;){var p=o;if(t.nodeName.toLowerCase()!==r.toLowerCase()){if(!u&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(u){if(!t[xi])switch(r){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(g=t.getAttribute("rel"),g==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(g!==p.rel||t.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||t.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||t.getAttribute("title")!==(p.title==null?null:p.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(g=t.getAttribute("src"),(g!==(p.src==null?null:p.src)||t.getAttribute("type")!==(p.type==null?null:p.type)||t.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&g&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(r==="input"&&t.type==="hidden"){var g=p.name==null?null:""+p.name;if(p.type==="hidden"&&t.getAttribute("name")===g)return t}else return t;if(t=mr(t.nextSibling),t===null)break}return null}function OT(t,r,o){if(r==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!o||(t=mr(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=mr(t.nextSibling),t===null))return null;return t}function Wp(t){return t.data==="$?"||t.data==="$~"}function Yp(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function LT(t,r){var o=t.ownerDocument;if(t.data==="$~")t._reactRetry=r;else if(t.data!=="$?"||o.readyState!=="loading")r();else{var u=function(){r(),o.removeEventListener("DOMContentLoaded",u)};o.addEventListener("DOMContentLoaded",u),t._reactRetry=u}}function mr(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 Xp=null;function VS(t){t=t.nextSibling;for(var r=0;t;){if(t.nodeType===8){var o=t.data;if(o==="/$"||o==="/&"){if(r===0)return mr(t.nextSibling);r--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||r++}t=t.nextSibling}return null}function KS(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var o=t.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(r===0)return t;r--}else o!=="/$"&&o!=="/&"||r++}t=t.previousSibling}return null}function WS(t,r,o){switch(r=Vu(o),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 Ll(t){for(var r=t.attributes;r.length;)t.removeAttributeNode(r[0]);qo(t)}var yr=new Map,YS=new Set;function Ku(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var _a=ue.d;ue.d={f:MT,r:$T,D:NT,C:IT,L:jT,m:HT,X:UT,S:zT,M:PT};function MT(){var t=_a.f(),r=Hu();return t||r}function $T(t){var r=Vr(t);r!==null&&r.tag===5&&r.type==="form"?fv(r):_a.r(t)}var Qs=typeof document>"u"?null:document;function XS(t,r,o){var u=Qs;if(u&&typeof r=="string"&&r){var p=Un(r);p='link[rel="'+t+'"][href="'+p+'"]',typeof o=="string"&&(p+='[crossorigin="'+o+'"]'),YS.has(p)||(YS.add(p),t={rel:t,crossOrigin:o,href:r},u.querySelector(p)===null&&(r=u.createElement("link"),_n(r,"link",t),en(r),u.head.appendChild(r)))}}function NT(t){_a.D(t),XS("dns-prefetch",t,null)}function IT(t,r){_a.C(t,r),XS("preconnect",t,r)}function jT(t,r,o){_a.L(t,r,o);var u=Qs;if(u&&t&&r){var p='link[rel="preload"][as="'+Un(r)+'"]';r==="image"&&o&&o.imageSrcSet?(p+='[imagesrcset="'+Un(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(p+='[imagesizes="'+Un(o.imageSizes)+'"]')):p+='[href="'+Un(t)+'"]';var g=p;switch(r){case"style":g=Zs(t);break;case"script":g=eo(t)}yr.has(g)||(t=y({rel:"preload",href:r==="image"&&o&&o.imageSrcSet?void 0:t,as:r},o),yr.set(g,t),u.querySelector(p)!==null||r==="style"&&u.querySelector(Ml(g))||r==="script"&&u.querySelector($l(g))||(r=u.createElement("link"),_n(r,"link",t),en(r),u.head.appendChild(r)))}}function HT(t,r){_a.m(t,r);var o=Qs;if(o&&t){var u=r&&typeof r.as=="string"?r.as:"script",p='link[rel="modulepreload"][as="'+Un(u)+'"][href="'+Un(t)+'"]',g=p;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=eo(t)}if(!yr.has(g)&&(t=y({rel:"modulepreload",href:t},r),yr.set(g,t),o.querySelector(p)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector($l(g)))return}u=o.createElement("link"),_n(u,"link",t),en(u),o.head.appendChild(u)}}}function zT(t,r,o){_a.S(t,r,o);var u=Qs;if(u&&t){var p=Ha(u).hoistableStyles,g=Zs(t);r=r||"default";var C=p.get(g);if(!C){var R={loading:0,preload:null};if(C=u.querySelector(Ml(g)))R.loading=5;else{t=y({rel:"stylesheet",href:t,"data-precedence":r},o),(o=yr.get(g))&&Jp(t,o);var z=C=u.createElement("link");en(z),_n(z,"link",t),z._p=new Promise(function(X,ae){z.onload=X,z.onerror=ae}),z.addEventListener("load",function(){R.loading|=1}),z.addEventListener("error",function(){R.loading|=2}),R.loading|=4,Wu(C,r,u)}C={type:"stylesheet",instance:C,count:1,state:R},p.set(g,C)}}}function UT(t,r){_a.X(t,r);var o=Qs;if(o&&t){var u=Ha(o).hoistableScripts,p=eo(t),g=u.get(p);g||(g=o.querySelector($l(p)),g||(t=y({src:t,async:!0},r),(r=yr.get(p))&&Qp(t,r),g=o.createElement("script"),en(g),_n(g,"link",t),o.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},u.set(p,g))}}function PT(t,r){_a.M(t,r);var o=Qs;if(o&&t){var u=Ha(o).hoistableScripts,p=eo(t),g=u.get(p);g||(g=o.querySelector($l(p)),g||(t=y({src:t,async:!0,type:"module"},r),(r=yr.get(p))&&Qp(t,r),g=o.createElement("script"),en(g),_n(g,"link",t),o.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},u.set(p,g))}}function JS(t,r,o,u){var p=(p=ee.current)?Ku(p):null;if(!p)throw Error(a(446));switch(t){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(r=Zs(o.href),o=Ha(p).hoistableStyles,u=o.get(r),u||(u={type:"style",instance:null,count:0,state:null},o.set(r,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){t=Zs(o.href);var g=Ha(p).hoistableStyles,C=g.get(t);if(C||(p=p.ownerDocument||p,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(t,C),(g=p.querySelector(Ml(t)))&&!g._p&&(C.instance=g,C.state.loading=5),yr.has(t)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},yr.set(t,o),g||BT(p,t,o,C.state))),r&&u===null)throw Error(a(528,""));return C}if(r&&u!==null)throw Error(a(529,""));return null;case"script":return r=o.async,o=o.src,typeof o=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=eo(o),o=Ha(p).hoistableScripts,u=o.get(r),u||(u={type:"script",instance:null,count:0,state:null},o.set(r,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,t))}}function Zs(t){return'href="'+Un(t)+'"'}function Ml(t){return'link[rel="stylesheet"]['+t+"]"}function QS(t){return y({},t,{"data-precedence":t.precedence,precedence:null})}function BT(t,r,o,u){t.querySelector('link[rel="preload"][as="style"]['+r+"]")?u.loading=1:(r=t.createElement("link"),u.preload=r,r.addEventListener("load",function(){return u.loading|=1}),r.addEventListener("error",function(){return u.loading|=2}),_n(r,"link",o),en(r),t.head.appendChild(r))}function eo(t){return'[src="'+Un(t)+'"]'}function $l(t){return"script[async]"+t}function ZS(t,r,o){if(r.count++,r.instance===null)switch(r.type){case"style":var u=t.querySelector('style[data-href~="'+Un(o.href)+'"]');if(u)return r.instance=u,en(u),u;var p=y({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return u=(t.ownerDocument||t).createElement("style"),en(u),_n(u,"style",p),Wu(u,o.precedence,t),r.instance=u;case"stylesheet":p=Zs(o.href);var g=t.querySelector(Ml(p));if(g)return r.state.loading|=4,r.instance=g,en(g),g;u=QS(o),(p=yr.get(p))&&Jp(u,p),g=(t.ownerDocument||t).createElement("link"),en(g);var C=g;return C._p=new Promise(function(R,z){C.onload=R,C.onerror=z}),_n(g,"link",u),r.state.loading|=4,Wu(g,o.precedence,t),r.instance=g;case"script":return g=eo(o.src),(p=t.querySelector($l(g)))?(r.instance=p,en(p),p):(u=o,(p=yr.get(g))&&(u=y({},o),Qp(u,p)),t=t.ownerDocument||t,p=t.createElement("script"),en(p),_n(p,"link",u),t.head.appendChild(p),r.instance=p);case"void":return null;default:throw Error(a(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(u=r.instance,r.state.loading|=4,Wu(u,o.precedence,t));return r.instance}function Wu(t,r,o){for(var u=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=u.length?u[u.length-1]:null,g=p,C=0;C<u.length;C++){var R=u[C];if(R.dataset.precedence===r)g=R;else if(g!==p)break}g?g.parentNode.insertBefore(t,g.nextSibling):(r=o.nodeType===9?o.head:o,r.insertBefore(t,r.firstChild))}function Jp(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.title==null&&(t.title=r.title)}function Qp(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.integrity==null&&(t.integrity=r.integrity)}var Yu=null;function ew(t,r,o){if(Yu===null){var u=new Map,p=Yu=new Map;p.set(o,u)}else p=Yu,u=p.get(o),u||(u=new Map,p.set(o,u));if(u.has(t))return u;for(u.set(t,null),o=o.getElementsByTagName(t),p=0;p<o.length;p++){var g=o[p];if(!(g[xi]||g[Pt]||t==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var C=g.getAttribute(r)||"";C=t+C;var R=u.get(C);R?R.push(g):u.set(C,[g])}}return u}function tw(t,r,o){t=t.ownerDocument||t,t.head.insertBefore(o,r==="title"?t.querySelector("head > title"):null)}function qT(t,r,o){if(o===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 nw(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function GT(t,r,o,u){if(o.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var p=Zs(u.href),g=r.querySelector(Ml(p));if(g){r=g._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(t.count++,t=Xu.bind(t),r.then(t,t)),o.state.loading|=4,o.instance=g,en(g);return}g=r.ownerDocument||r,u=QS(u),(p=yr.get(p))&&Jp(u,p),g=g.createElement("link"),en(g);var C=g;C._p=new Promise(function(R,z){C.onload=R,C.onerror=z}),_n(g,"link",u),o.instance=g}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(o,r),(r=o.state.preload)&&(o.state.loading&3)===0&&(t.count++,o=Xu.bind(t),r.addEventListener("load",o),r.addEventListener("error",o))}}var Zp=0;function FT(t,r){return t.stylesheets&&t.count===0&&Qu(t,t.stylesheets),0<t.count||0<t.imgCount?function(o){var u=setTimeout(function(){if(t.stylesheets&&Qu(t,t.stylesheets),t.unsuspend){var g=t.unsuspend;t.unsuspend=null,g()}},6e4+r);0<t.imgBytes&&Zp===0&&(Zp=62500*AT());var p=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Qu(t,t.stylesheets),t.unsuspend)){var g=t.unsuspend;t.unsuspend=null,g()}},(t.imgBytes>Zp?50:800)+r);return t.unsuspend=o,function(){t.unsuspend=null,clearTimeout(u),clearTimeout(p)}}:null}function Xu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Qu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Ju=null;function Qu(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Ju=new Map,r.forEach(VT,t),Ju=null,Xu.call(t))}function VT(t,r){if(!(r.state.loading&4)){var o=Ju.get(t);if(o)var u=o.get(null);else{o=new Map,Ju.set(t,o);for(var p=t.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<p.length;g++){var C=p[g];(C.nodeName==="LINK"||C.getAttribute("media")!=="not all")&&(o.set(C.dataset.precedence,C),u=C)}u&&o.set(null,u)}p=r.instance,C=p.getAttribute("data-precedence"),g=o.get(C)||u,g===u&&o.set(null,p),o.set(C,p),this.count++,u=Xu.bind(this),p.addEventListener("load",u),p.addEventListener("error",u),g?g.parentNode.insertBefore(p,g.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(p,t.firstChild)),r.state.loading|=4}}var Nl={$$typeof:T,Provider:null,Consumer:null,_currentValue:Me,_currentValue2:Me,_threadCount:0};function KT(t,r,o,u,p,g,C,R,z){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=ke(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ke(0),this.hiddenUpdates=ke(null),this.identifierPrefix=u,this.onUncaughtError=p,this.onCaughtError=g,this.onRecoverableError=C,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=z,this.incompleteTransitions=new Map}function rw(t,r,o,u,p,g,C,R,z,X,ae,le){return t=new KT(t,r,o,C,z,X,ae,le,R),r=1,g===!0&&(r|=24),g=Jn(3,null,null,r),t.current=g,g.stateNode=t,r=Lh(),r.refCount++,t.pooledCache=r,r.refCount++,g.memoizedState={element:u,isDehydrated:o,cache:r},Ih(g),t}function aw(t){return t?(t=Os,t):Os}function iw(t,r,o,u,p,g){p=aw(p),u.context===null?u.context=p:u.pendingContext=p,u=Ja(r),u.payload={element:o},g=g===void 0?null:g,g!==null&&(u.callback=g),o=Qa(t,u,r),o!==null&&(Fn(o,t,r),hl(o,t,r))}function sw(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var o=t.retryLane;t.retryLane=o!==0&&o<r?o:r}}function eg(t,r){sw(t,r),(t=t.alternate)&&sw(t,r)}function ow(t){if(t.tag===13||t.tag===31){var r=Ui(t,67108864);r!==null&&Fn(r,t,67108864),eg(t,67108864)}}function lw(t){if(t.tag===13||t.tag===31){var r=nr();r=nt(r);var o=Ui(t,r);o!==null&&Fn(o,t,r),eg(t,r)}}var Zu=!0;function WT(t,r,o,u){var p=J.T;J.T=null;var g=ue.p;try{ue.p=2,tg(t,r,o,u)}finally{ue.p=g,J.T=p}}function YT(t,r,o,u){var p=J.T;J.T=null;var g=ue.p;try{ue.p=8,tg(t,r,o,u)}finally{ue.p=g,J.T=p}}function tg(t,r,o,u){if(Zu){var p=ng(u);if(p===null)Pp(t,r,u,ed,o),uw(t,u);else if(JT(p,t,r,o,u))u.stopPropagation();else if(uw(t,u),r&4&&-1<XT.indexOf(t)){for(;p!==null;){var g=Vr(p);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var C=Ce(g.pendingLanes);if(C!==0){var R=g;for(R.pendingLanes|=2,R.entangledLanes|=2;C;){var z=1<<31-dn(C);R.entanglements[1]|=z,C&=~z}Jr(g),(wt&6)===0&&(Iu=Kt()+500,Rl(0))}}break;case 31:case 13:R=Ui(g,2),R!==null&&Fn(R,g,2),Hu(),eg(g,2)}if(g=ng(u),g===null&&Pp(t,r,u,ed,o),g===p)break;p=g}p!==null&&u.stopPropagation()}else Pp(t,r,u,null,o)}}function ng(t){return t=Wo(t),rg(t)}var ed=null;function rg(t){if(ed=null,t=ja(t),t!==null){var r=l(t);if(r===null)t=null;else{var o=r.tag;if(o===13){if(t=c(r),t!==null)return t;t=null}else if(o===31){if(t=d(r),t!==null)return t;t=null}else if(o===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null)}}return ed=t,null}function cw(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(Ai()){case aa:return 2;case bn:return 8;case Ln:case at:return 32;case Hn:return 268435456;default:return 32}default:return 32}}var ag=!1,ci=null,ui=null,di=null,Il=new Map,jl=new Map,fi=[],XT="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 uw(t,r){switch(t){case"focusin":case"focusout":ci=null;break;case"dragenter":case"dragleave":ui=null;break;case"mouseover":case"mouseout":di=null;break;case"pointerover":case"pointerout":Il.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":jl.delete(r.pointerId)}}function Hl(t,r,o,u,p,g){return t===null||t.nativeEvent!==g?(t={blockedOn:r,domEventName:o,eventSystemFlags:u,nativeEvent:g,targetContainers:[p]},r!==null&&(r=Vr(r),r!==null&&ow(r)),t):(t.eventSystemFlags|=u,r=t.targetContainers,p!==null&&r.indexOf(p)===-1&&r.push(p),t)}function JT(t,r,o,u,p){switch(r){case"focusin":return ci=Hl(ci,t,r,o,u,p),!0;case"dragenter":return ui=Hl(ui,t,r,o,u,p),!0;case"mouseover":return di=Hl(di,t,r,o,u,p),!0;case"pointerover":var g=p.pointerId;return Il.set(g,Hl(Il.get(g)||null,t,r,o,u,p)),!0;case"gotpointercapture":return g=p.pointerId,jl.set(g,Hl(jl.get(g)||null,t,r,o,u,p)),!0}return!1}function dw(t){var r=ja(t.target);if(r!==null){var o=l(r);if(o!==null){if(r=o.tag,r===13){if(r=c(o),r!==null){t.blockedOn=r,Mn(t.priority,function(){lw(o)});return}}else if(r===31){if(r=d(o),r!==null){t.blockedOn=r,Mn(t.priority,function(){lw(o)});return}}else if(r===3&&o.stateNode.current.memoizedState.isDehydrated){t.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}t.blockedOn=null}function td(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var o=ng(t.nativeEvent);if(o===null){o=t.nativeEvent;var u=new o.constructor(o.type,o);Ko=u,o.target.dispatchEvent(u),Ko=null}else return r=Vr(o),r!==null&&ow(r),t.blockedOn=o,!1;r.shift()}return!0}function fw(t,r,o){td(t)&&o.delete(r)}function QT(){ag=!1,ci!==null&&td(ci)&&(ci=null),ui!==null&&td(ui)&&(ui=null),di!==null&&td(di)&&(di=null),Il.forEach(fw),jl.forEach(fw)}function nd(t,r){t.blockedOn===r&&(t.blockedOn=null,ag||(ag=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,QT)))}var rd=null;function hw(t){rd!==t&&(rd=t,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){rd===t&&(rd=null);for(var r=0;r<t.length;r+=3){var o=t[r],u=t[r+1],p=t[r+2];if(typeof u!="function"){if(rg(u||o)===null)continue;break}var g=Vr(o);g!==null&&(t.splice(r,3),r-=3,np(g,{pending:!0,data:p,method:o.method,action:u},u,p))}}))}function to(t){function r(z){return nd(z,t)}ci!==null&&nd(ci,t),ui!==null&&nd(ui,t),di!==null&&nd(di,t),Il.forEach(r),jl.forEach(r);for(var o=0;o<fi.length;o++){var u=fi[o];u.blockedOn===t&&(u.blockedOn=null)}for(;0<fi.length&&(o=fi[0],o.blockedOn===null);)dw(o),o.blockedOn===null&&fi.shift();if(o=(t.ownerDocument||t).$$reactFormReplay,o!=null)for(u=0;u<o.length;u+=3){var p=o[u],g=o[u+1],C=p[Rn]||null;if(typeof g=="function")C||hw(o);else if(C){var R=null;if(g&&g.hasAttribute("formAction")){if(p=g,C=g[Rn]||null)R=C.formAction;else if(rg(p)!==null)continue}else R=C.action;typeof R=="function"?o[u+1]=R:(o.splice(u,3),u-=3),hw(o)}}}function pw(){function t(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(C){return p=C})},focusReset:"manual",scroll:"manual"})}function r(){p!==null&&(p(),p=null),u||setTimeout(o,20)}function o(){if(!u&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,p=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(o,100),function(){u=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),p!==null&&(p(),p=null)}}}function ig(t){this._internalRoot=t}ad.prototype.render=ig.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(a(409));var o=r.current,u=nr();iw(o,u,t,r,null,null)},ad.prototype.unmount=ig.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;iw(t.current,2,null,t,null,null),Hu(),r[Ia]=null}};function ad(t){this._internalRoot=t}ad.prototype.unstable_scheduleHydration=function(t){if(t){var r=jt();t={blockedOn:null,target:t,priority:r};for(var o=0;o<fi.length&&r!==0&&r<fi[o].priority;o++);fi.splice(o,0,t),o===0&&dw(t)}};var gw=e.version;if(gw!=="19.2.8")throw Error(a(527,gw,"19.2.8"));ue.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=h(r),t=t!==null?m(t):null,t=t===null?null:t.stateNode,t};var ZT={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:J,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var id=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!id.isDisabled&&id.supportsFiber)try{lr=id.inject(ZT),un=id}catch{}}return no.createRoot=function(t,r){if(!i(t))throw Error(a(299));var o=!1,u="",p=Cv,g=Ev,C=_v;return r!=null&&(r.unstable_strictMode===!0&&(o=!0),r.identifierPrefix!==void 0&&(u=r.identifierPrefix),r.onUncaughtError!==void 0&&(p=r.onUncaughtError),r.onCaughtError!==void 0&&(g=r.onCaughtError),r.onRecoverableError!==void 0&&(C=r.onRecoverableError)),r=rw(t,1,!1,null,null,o,u,null,p,g,C,pw),t[Ia]=r.current,Up(t),new ig(r)},no.hydrateRoot=function(t,r,o){if(!i(t))throw Error(a(299));var u=!1,p="",g=Cv,C=Ev,R=_v,z=null;return o!=null&&(o.unstable_strictMode===!0&&(u=!0),o.identifierPrefix!==void 0&&(p=o.identifierPrefix),o.onUncaughtError!==void 0&&(g=o.onUncaughtError),o.onCaughtError!==void 0&&(C=o.onCaughtError),o.onRecoverableError!==void 0&&(R=o.onRecoverableError),o.formState!==void 0&&(z=o.formState)),r=rw(t,1,!0,r,o??null,u,p,z,g,C,R,pw),r.context=aw(null),o=r.current,u=nr(),u=nt(u),p=Ja(u),p.callback=null,Qa(o,p,u),o=u,r.current.lanes=o,tt(r,o),Jr(r),t[Ia]=r.current,Up(t),new ad(r)},no.version="19.2.8",no}var pg;function Ew(){if(pg)return ld.exports;pg=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(e){console.error(e)}}return s(),ld.exports=Cw(),ld.exports}var fd=Ew();const hd=Zr(fd),ro=[],_w=50;let pd=!1;function gg(){try{return window.G7Core?.devTools}catch{return}}function Zi(s,e,n){const a=gg();if(pd&&a?.isEnabled?.()){a.trackLog?.(s,e,n);return}pd||(s==="error"||s==="warn")&&ro.length<_w&&ro.push({level:s,prefix:e,args:n,timestamp:Date.now()})}function gd(){pd=!0;const s=gg();if(!s?.isEnabled?.()){ro.length=0;return}for(const e of ro)s.trackLog?.(e.level,e.prefix,e.args);ro.length=0}const Ci=class Ci{constructor(){$(this,"debug");$(this,"prefix","[TemplateEngine]");this.debug=!1}static getInstance(){return Ci.instance||(Ci.instance=new Ci),Ci.instance}setDebug(e){this.debug=e}isDebugEnabled(){return this.debug}log(...e){this.debug&&console.log(this.prefix,...e),Zi("log","TemplateEngine",e)}error(...e){this.debug&&console.error(this.prefix,...e),Zi("error","TemplateEngine",e)}warn(...e){this.debug&&console.warn(this.prefix,...e),Zi("warn","TemplateEngine",e)}};$(Ci,"instance");let ao=Ci;function pt(s){const e=`[${s}]`,n=ao.getInstance();return{log:(...a)=>{n.isDebugEnabled()&&console.log(e,...a),Zi("log",s,a)},warn:(...a)=>{n.isDebugEnabled()&&console.warn(e,...a),Zi("warn",s,a)},error:(...a)=>{n.isDebugEnabled()&&console.error(e,...a),Zi("error",s,a)}}}ao.getInstance();const es=pt("networkResilience"),mg=2,yg=300,bg=2e3,Aw=15e3;function md(s){return s?.name==="AbortError"}function vg(s){return md(s)?!1:s instanceof TypeError}let zl=!1,Sg=!1;function yd(){return zl}function xw(){typeof window>"u"||Sg||(Sg=!0,window.addEventListener("pagehide",()=>{zl=!0}),window.addEventListener("pageshow",s=>{s.persisted&&(zl=!1)}),window.addEventListener("beforeunload",()=>{zl=!0}))}function wg(s,e,n){const a=Math.min(e*Math.pow(2,s),n),i=a*.25*(Math.random()*2-1);return Math.max(0,Math.round(a+i))}function Cg(s){return new Promise(e=>setTimeout(e,s))}async function Ul(s,e={}){const{retries:n=mg,baseDelayMs:a=yg,maxDelayMs:i=bg,timeoutMs:l=Aw,label:c=s,init:d}=e,f=n+1;let h;for(let m=0;m<f;m++){let y=!1,S;const v=l>0?new AbortController:null;try{const _={...d};if(v){const x=d?.signal;x&&(x.aborted?v.abort():x.addEventListener("abort",()=>v.abort(),{once:!0})),_.signal=v.signal,S=setTimeout(()=>{y=!0,v.abort()},l)}return await fetch(s,_)}catch(_){if(h=_,md(_)&&!y||!(y||vg(_)))throw _;if(yd())throw es.warn(`Document unloading, aborting retries: ${c}`),_;if(m===f-1)throw es.warn(`All ${f} attempts failed: ${c}`,_),_;const D=wg(m,a,i);es.warn(`Network failure (attempt ${m+1}/${f}), retrying in ${D}ms: ${c}`),await Cg(D)}finally{S!==void 0&&clearTimeout(S)}}throw h}async function Eg(s,e={},n={}){const{retries:a=mg,baseDelayMs:i=yg,maxDelayMs:l=bg,label:c=s}=n,d=a+1;for(let f=0;f<d;f++)try{await Tw(s,e);return}catch(h){if(e.id&&document.getElementById(e.id)?.remove(),yd())throw es.warn(`Document unloading, aborting script retries: ${c}`),h;if(f===d-1)throw es.warn(`All ${d} script attempts failed: ${c}`),h;const y=wg(f,i,l);es.warn(`Script load failed (attempt ${f+1}/${d}), retrying in ${y}ms: ${c}`),await Cg(y)}}function Tw(s,e){return new Promise((n,a)=>{const i=document.createElement("script");i.src=s,i.async=!1;for(const[l,c]of Object.entries(e))l==="id"?i.id=c:i.setAttribute(l,c);i.onload=()=>n(),i.onerror=()=>a(new Error(`Failed to load script: ${s}`)),document.head.appendChild(i)})}const _g="extension",ts="extensionless",kw="file";function Rw(){const s=globalThis?.G7Config;if(globalThis?.__g7AssetUrlMode===ts)return ts;const n=s?.assetUrlMode;return n===ts||n===_g?n:s?.settings?.general?.asset_url_mode===ts?ts:_g}function Ag(){return Rw()===ts}function jr(s,e,n,a){const i=s.replace(/\/+$/,""),l=e.replace(/^\.+/,""),c=Ag()?i:`${i}.${l}`,d=[];return a&&d.push(a.replace(/^[?&]+/,"")),n!=null&&n!==""&&d.push(`v=${n}`),d.length>0?`${c}?${d.join("&")}`:c}function Aa(s){if(!s||!Ag())return s;const e=globalThis?.location?.origin,n=e&&s.startsWith(e)?s.slice(e.length):s;if(!n.startsWith("/api/"))return s;const[a,i]=Dw(n),l=a.match(/^\/api\/(modules|plugins)\/bundle\.(js|css)$/);if(l)return xg(`/api/${l[1]}/bundle/${l[2]}`,i);const c=a.match(/^\/api\/(templates|modules|plugins)\/assets\/([^/]+)\/(.+)$/);if(c){const[,f,h,m]=c,y=`${kw}=${encodeURIComponent(decodeURIComponent(m))}`;return`/api/${f}/assets/${h}?${y}${i?`&${i}`:""}`}const d=a.match(/^(\/api\/.+)\.(json|js|css)$/);return d?xg(d[1],i):s}function Dw(s){const e=s.indexOf("?");return e===-1?[s,""]:[s.slice(0,e),s.slice(e+1)]}function xg(s,e){return e?`${s}?${e}`:s}const Hr=pt("ComponentRegistry");class pn extends Error{constructor(n,a,i){super(n);$(this,"code");$(this,"details");this.code=a,this.details=i,this.name="ComponentRegistryError"}}const Yn=class Yn{constructor(){$(this,"registry",{});$(this,"manifest",null);$(this,"loadingState","idle");$(this,"error",null);$(this,"templateId",null);$(this,"templateType",null)}static getInstance(){return Yn.instance||(Yn.instance=new Yn),Yn.instance}static createIsolatedInstance(){return new Yn}static resetInstance(){Yn.instance=null}async loadComponents(e,n){if(this.loadingState==="loading")throw new pn("Components are already being loaded","LOADING_IN_PROGRESS");if(this.loadingState==="loaded"&&this.templateId===e&&this.templateType===n){Hr.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",Hr.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 pn(`Failed to load components: ${this.error.message}`,"LOAD_FAILED",{originalError:this.error})}}async loadManifest(){try{if(!this.templateId)throw new pn("Template ID not set","TEMPLATE_ID_NOT_SET");const e=`${this.templateId}:${this.templateType}`;if(Yn.manifestCache.has(e)){this.manifest=Yn.manifestCache.get(e),Hr.log("Manifest loaded from cache:",this.manifest.templateId);return}const n=jr(`/api/templates/${this.templateId}/components`,"json"),a=await Ul(n,{label:"components.json"});if(!a.ok)throw new pn(`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,Yn.manifestCache.set(e,i),Hr.log("Manifest loaded and cached:",i.templateId)}catch(e){throw e instanceof pn?e:new pn("Failed to load component manifest","MANIFEST_LOAD_FAILED",{originalError:e})}}validateManifest(e){if(!e.version)throw new pn("Manifest missing required field: version","MANIFEST_INVALID",{field:"version"});if(!e.templateId)throw new pn("Manifest missing required field: templateId","MANIFEST_INVALID",{field:"templateId"});if(!e.components||typeof e.components!="object")throw new pn("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 pn(`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 pn(`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 pn(`Invalid component metadata at ${a}[${l}]: missing or invalid 'type'`,"MANIFEST_INVALID",{type:a,index:l,metadata:i})})}Hr.log("Manifest validation passed")}async loadComponentBundle(){try{if(!this.templateId)throw new pn("Template ID not set","TEMPLATE_ID_NOT_SET");const e=this.getGlobalVariableName(),n=window[e];if(!n||typeof n!="object")throw new pn(`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),Hr.log("Component bundle loaded from global variable:",e)}catch(e){throw e instanceof pn?e:new pn("Failed to load component bundle","BUNDLE_LOAD_FAILED",{originalError:e})}}getGlobalVariableName(){if(!this.templateId)throw new pn("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 pn("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 c=l.name,d=e[c];if(!d){Hr.warn(`Component '${c}' not found in bundle`);continue}this.registerComponent(c,d,l)}}}registerComponent(e,n,a){this.registry[e]&&Hr.warn(`Component '${e}' already registered, overwriting`);const i=Xe.memo(n);this.registry[e]={component:i,metadata:a},Hr.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,Hr.log("Registry cleared")}};$(Yn,"instance",null),$(Yn,"manifestCache",new Map);let br=Yn;const Tg=pt("TranslationEngine");class bd extends Error{constructor(n,a,i){super(n);$(this,"key");$(this,"locale");this.key=a,this.locale=i,this.name="TranslationError"}}const jn=class jn{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 jn.instance||(jn.instance=new jn(e)),jn.instance}static resetInstance(){jn.instance=null}setCacheVersion(e){this.cacheVersion!==e&&(Tg.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 c=this.getFromCache(l);if(c)return this.translations.set(l,c),c}try{const c=[];i&&c.push(`_=${Date.now()}`);const d=jr(`${a}/templates/${e}/lang/${n}`,"json",this.cacheVersion>0?this.cacheVersion:null,c.length>0?c.join("&"):void 0),f=await fetch(d);if(!f.ok)throw new bd(`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(c){throw new bd(`Failed to fetch translations for ${n}: ${c instanceof Error?c.message:String(c)}`,void 0,n)}}resolveTranslations(e,n,a){let i=e;const l=5;let c=0;for(;c<l&&i.includes("=$t:");){const d=i;if(i=i.replace(jn.NESTED_TRANSLATION_PARAM_PATTERN,(f,h,m)=>"="+this.translate(m,n,void 0,a)),i===d)break;c++}return i.replace(jn.TRANSLATION_PATTERN,(d,f,h)=>{const{cleanedParams:m,trailing:y}=this.separateTrailingText(h);return this.translate(f,n,m,a)+y})}translate(e,n,a,i){const l=this.getTranslation(e,n),c=a&&this.cleanParamsStr(a);if(c){const d=this.parseParams(c,i);return this.replaceParams(l,d)}return l}getTranslation(e,n){const{templateId:a,locale:i}=n,l=`${a}:${i}`,c=this.translations.get(l);if(c){const d=this.getNestedValue(c,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 h=this.getNestedValue(f,e);if(h!==null)return h}}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}`,c=this.translations.get(l)??{},d=a.split(".");let f=c;for(let h=0;h<d.length-1;h+=1){const m=d[h],y=f[m];(y==null||typeof y!="object"||Array.isArray(y))&&(f[m]={}),f=f[m]}f[d[d.length-1]]=i,this.translations.set(l,c)}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(jn.PARAM_PATTERN);for(const f of d){const[,h,m]=f,y=m.replace(/__PLACEHOLDER_(\d+)__/g,(S,v)=>l[parseInt(v,10)]);a[h.trim()]=this.resolveParamValue(y.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 l=$d.evaluateExpression(a,n);return String(l??"")}catch(l){return Tg.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 c=new RegExp(`\\{\\{${i}\\}\\}`,"g");a=a.replace(c,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}}};$(jn,"instance",null),$(jn,"TRANSLATION_PATTERN",/\$t:(?:defer:)?([a-zA-Z0-9._-]+)(\|(?:(?!\$t:).)+)?/g),$(jn,"NESTED_TRANSLATION_PARAM_PATTERN",/=(\$t:([a-zA-Z0-9._-]+))(?=[|&\s]|$)/g),$(jn,"PARAM_PATTERN",/([^=|&]+)=([^|&]+)/g);let xa=jn,vd=null;function Ow(s){return vd||(vd=new xa(s)),vd}const kg=Object.freeze(Object.defineProperty({__proto__:null,TranslationEngine:xa,TranslationError:bd,getTranslationEngine:Ow},Symbol.toStringTag,{value:"Module"})),ns=pt("PipeRegistry");function Rg(s,e){const n=s.getFullYear(),a=String(s.getMonth()+1).padStart(2,"0"),i=String(s.getDate()).padStart(2,"0"),l=String(s.getHours()).padStart(2,"0"),c=String(s.getMinutes()).padStart(2,"0"),d=String(s.getSeconds()).padStart(2,"0");return e.replace("YYYY",String(n)).replace("YY",String(n).slice(-2)).replace("MM",a).replace("M",String(s.getMonth()+1)).replace("DD",i).replace("D",String(s.getDate())).replace("HH",l).replace("H",String(s.getHours())).replace("mm",c).replace("m",String(s.getMinutes())).replace("ss",d).replace("s",String(s.getSeconds()))}function Lw(s,e="ko"){const a=new Date().getTime()-s.getTime(),i=Math.floor(a/1e3),l=Math.floor(i/60),c=Math.floor(l/60),d=Math.floor(c/24),f=Math.floor(d/7),h=Math.floor(d/30),m=Math.floor(d/365);return e==="ko"?i<60?"방금 전":l<60?`${l}분 전`:c<24?`${c}시간 전`:d<7?`${d}일 전`:f<4?`${f}주 전`:h<12?`${h}개월 전`:`${m}년 전`:i<60?"just now":l<60?`${l} minute${l===1?"":"s"} ago`:c<24?`${c} hour${c===1?"":"s"} ago`:d<7?`${d} day${d===1?"":"s"} ago`:f<4?`${f} week${f===1?"":"s"} ago`:h<12?`${h} month${h===1?"":"s"} ago`:`${m} year${m===1?"":"s"} ago`}function Sd(s){if(s==null)return null;if(s instanceof Date)return s;if(typeof s=="number")return new Date(s);if(typeof s=="string"){const e=new Date(s);return isNaN(e.getTime())?null:e}return null}const io={date:{fn:(s,e="YYYY-MM-DD")=>{const n=Sd(s);return n?Rg(n,e):""},description:"날짜 포맷 (기본: YYYY-MM-DD)"},datetime:{fn:(s,e="YYYY-MM-DD HH:mm")=>{const n=Sd(s);return n?Rg(n,e):""},description:"날짜+시간 포맷 (기본: YYYY-MM-DD HH:mm)"},relativeTime:{fn:(s,e="ko")=>{const n=Sd(s);return n?Lw(n,e):""},description:'상대 시간 표시 (예: "3분 전")'},number:{fn:(s,e)=>{const n=Number(s);if(isNaN(n))return String(s??"");const a={};return e!==void 0&&(a.minimumFractionDigits=e,a.maximumFractionDigits=e),n.toLocaleString(void 0,a)},description:"숫자 포맷 (천단위 구분, 선택적 소수점)"},truncate:{fn:(s,e=100,n="...")=>typeof s!="string"?String(s??""):s.length<=e?s:s.slice(0,e)+n,description:'문자열 자르기 (기본: 100자, 접미사: "...")'},uppercase:{fn:s=>typeof s!="string"?String(s??""):s.toUpperCase(),description:"대문자 변환"},lowercase:{fn:s=>typeof s!="string"?String(s??""):s.toLowerCase(),description:"소문자 변환"},stripHtml:{fn:s=>typeof s!="string"?String(s??""):s.replace(/<[^>]*>/g,""),description:"HTML 태그 제거"},default:{fn:(s,e="")=>s==null||s===""?e:s,description:"기본값 설정 (null, undefined, 빈문자열 시)"},fallback:{fn:(s,e)=>s??e,description:"폴백 값 설정 (null, undefined 시만)"},first:{fn:s=>{if(Array.isArray(s))return s[0]},description:"배열의 첫 번째 요소"},last:{fn:s=>{if(Array.isArray(s))return s[s.length-1]},description:"배열의 마지막 요소"},join:{fn:(s,e=", ")=>Array.isArray(s)?s.join(e):"",description:'배열을 문자열로 결합 (기본 구분자: ", ")'},length:{fn:s=>Array.isArray(s)||typeof s=="string"?s.length:0,description:"배열/문자열 길이"},filterBy:{fn:(s,e,n)=>Array.isArray(s)?Array.isArray(e)?s.filter(a=>{const i=n?a?.[n]:a;return e.includes(i)}):s:[],description:"배열 필터링 (allowList에 포함된 항목만 반환)"},keys:{fn:s=>s==null||typeof s!="object"?[]:Object.keys(s),description:"객체의 키 배열"},values:{fn:s=>s==null||typeof s!="object"?[]:Object.values(s),description:"객체의 값 배열"},json:{fn:(s,e)=>{try{return JSON.stringify(s,null,e)}catch{return""}},description:"JSON 문자열로 변환"},localized:{fn:(s,e)=>s==null?"":typeof s=="string"?s:typeof s!="object"?String(s):s[e||"ko"]||s.ko||s.en||Object.values(s)[0]||"",description:"다국어 객체에서 로케일에 맞는 값 추출"}},rs=new Map,Ei=class Ei{static getInstance(){return Ei.instance||(Ei.instance=new Ei),Ei.instance}register(e,n,a){if(io[e]){ns.warn(`[PipeRegistry] 내장 파이프를 덮어쓸 수 없습니다: ${e}`);return}rs.set(e,{fn:n,description:a}),ns.log(`[PipeRegistry] 커스텀 파이프 등록됨: ${e}`)}unregister(e){if(io[e])return ns.warn(`[PipeRegistry] 내장 파이프는 해제할 수 없습니다: ${e}`),!1;const n=rs.delete(e);return n&&ns.log(`[PipeRegistry] 커스텀 파이프 해제됨: ${e}`),n}get(e){const n=io[e];return n?n.fn:rs.get(e)?.fn}has(e){return!!io[e]||rs.has(e)}execute(e,n,a=[]){const i=this.get(e);if(!i)return ns.warn(`[PipeRegistry] 알 수 없는 파이프: ${e}`),n;try{return i(n,...a)}catch(l){return ns.error(`[PipeRegistry] 파이프 실행 오류 (${e}):`,l),n}}list(){const e=[];for(const[n,a]of Object.entries(io))e.push({name:n,description:a.description,type:"built-in"});for(const[n,a]of rs.entries())e.push({name:n,description:a.description,type:"custom"});return e.sort((n,a)=>n.name.localeCompare(a.name))}clearCustomPipes(){rs.clear()}};$(Ei,"instance",null);let Pl=Ei;Pl.getInstance();function Mw(s){const e=s.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 c="",d=null,f=0;for(let h=0;h<i.length;h++){const m=i[h];if((h>0?i[h-1]:"")==="\\"){c+=m;continue}if((m==='"'||m==="'")&&!d){d=m;continue}if(m===d){d=null;continue}if(d){c+=m;continue}if(m==="("||m==="["||m==="{"){f++,c+=m;continue}if(m===")"||m==="]"||m==="}"){f--,c+=m;continue}if(m===","&&f===0){l.push(Dg(c.trim())),c="";continue}c+=m}return c.trim()&&l.push(Dg(c.trim())),{name:a,args:l}}function Dg(s){if(s==="null")return null;if(s==="undefined")return;if(s==="true")return!0;if(s==="false")return!1;const e=Number(s);return!isNaN(e)&&s!==""?e:s}function $w(s){const e=[];let n="",a=null,i=0;for(let l=0;l<s.length;l++){const c=s[l],d=l>0?s[l-1]:"",f=l<s.length-1?s[l+1]:"";if(d==="\\"){n+=c;continue}if((c==='"'||c==="'")&&!a){a=c,n+=c;continue}if(c===a){a=null,n+=c;continue}if(a){n+=c;continue}if(c==="("||c==="["||c==="{"){i++,n+=c;continue}if(c===")"||c==="]"||c==="}"){i--,n+=c;continue}if(c==="|"&&f!=="|"&&d!=="|"&&i===0){e.push(n.trim()),n="";continue}n+=c}return n.trim()&&e.push(n.trim()),e.length===0?[s,[]]:[e[0],e.slice(1)]}function Vn(s){let e=null,n=0;for(let a=0;a<s.length;a++){const i=s[a],l=a>0?s[a-1]:"",c=a<s.length-1?s[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==="|"&&c!=="|"&&l!=="|"&&n===0)return!0}}}return!1}function Nw(s,e){const n=Pl.getInstance();let a=s;for(const i of e){const l=Mw(i);a=n.execute(l.name,a,l.args)}return a}const wd=new Map([["true",!0],["false",!1],["null",null],["undefined",void 0]]);function Ta(s){if(typeof s!="string"||!s.startsWith("{{")||!s.endsWith("}}")||s.length<4)return null;const e=s.slice(2,-2);let n=null,a=0;for(let i=0;i<e.length;i++){const l=e[i];if(n!==null){if(l==="\\"){i++;continue}l===n&&(n=null);continue}if(l==='"'||l==="'"||l==="`"){n=l;continue}if(l==="{"){a++;continue}if(l==="}"){if(a>0){a--;continue}return null}}return a===0?e.trim():null}function Iw(s){const e=[];if(typeof s!="string")return e;for(let n=0;n<s.length-1;n++){if(s[n]!=="{"||s[n+1]!=="{")continue;let a=null,i=0,l=-1;for(let c=n+2;c<s.length;c++){const d=s[c];if(a!==null){if(d==="\\"){c++;continue}d===a&&(a=null);continue}if(d==='"'||d==="'"||d==="`"){a=d;continue}if(d==="{"){i++;continue}if(d==="}"){if(i>0){i--;continue}if(s[c+1]==="}"){l=c;break}break}}l!==-1&&(e.push({start:n,end:l+2,expr:s.slice(n+2,l)}),n=l+1)}return e}function so(s){return/[?:|&!+\-*/<>=()[\]{}]/.test(s)}function Og(s){const e=typeof s=="string"?s.trim():"";return e===""?"empty":wd.has(e)?"literal":Vn(e)?"pipe":so(e)?"expression":"path"}function Cd(s,e,n,a){const i=typeof s=="string"?s.trim():"",l=Og(i),c=a?.skipCache?{skipCache:!0}:void 0;if(l==="empty"){a?.onEmpty?.(s);return}if(l==="literal")return wd.get(i);try{return l==="pipe"?n.evaluatePipeExpression(i,e,c,a?.trackingInfo):l==="expression"?n.evaluateExpression(i,e,a?.trackingInfo):n.resolve(i,e,c,a?.trackingInfo)}catch(d){if(a?.onError)return a.onError(d,i);throw d}}const rr="raw:";function Lg(s){return s.startsWith(rr)?s.slice(rr.length):s}const oo="",pi="",ka="";function lo(s){return oo+s+pi}function Bl(s){return s.length>=2&&s.charCodeAt(0)===64976&&s.charCodeAt(s.length-1)===64977}function ql(s){return s.includes(oo)}function Ed(s){return s.slice(1,-1)}function as(s){if(typeof s=="string")return lo(s);if(Array.isArray(s))return s.map(as);if(s&&typeof s=="object"){const e={};for(const[n,a]of Object.entries(s))e[n]=as(a);return e}return s}function Ra(s){if(typeof s=="string")return Bl(s)?Ed(s):ql(s)||s.includes(pi)?s.split(oo).join("").split(pi).join(""):s;if(Array.isArray(s)){let e=!1;const n=s.map(a=>{const i=Ra(a);return i!==a&&(e=!0),i});return e?n:s}if(s&&typeof s=="object"){if(s.$$typeof!==void 0)return s;let e=!1;const n={};for(const[a,i]of Object.entries(s)){const l=Ra(i);l!==i&&(e=!0),n[a]=l}return e?n:s}return s}const co=new Set(["constructor","__proto__","prototype","__lookupGetter__","__lookupSetter__","__defineGetter__","__defineSetter__"]),jw=new Set(["Function","eval","globalThis","window","self","document","require","module","process","Reflect","Proxy","WebAssembly","import","constructor"]);function Mg(s,e){if(s!==null&&(typeof s=="object"||typeof s=="function")&&$g.has(s))throw new Error(`Object.${e} on a built-in global object is not allowed`);return s}const Hw=Object.freeze({keys:Object.keys,values:Object.values,entries:Object.entries,assign:(s,...e)=>{const n=Mg(s,"assign");for(const a of e)if(a!=null)for(const i of Object.keys(a)){if(co.has(i))throw new Error(`Access to "${i}" is forbidden`);Od(n,i,a[i])}return n},freeze:s=>Object.freeze(Mg(s,"freeze")),fromEntries:Object.fromEntries,create:Object.create,isFrozen:Object.isFrozen}),_d={Math,JSON,Date,Array,Object:Hw,Number,String,Boolean,Set,Map,WeakSet,WeakMap,parseInt,parseFloat,isNaN,isFinite},Ad={Date,Set,Map,WeakSet,WeakMap,Array,Number,String,Boolean,Object},$g=new Set([...Object.values(_d),...Object.values(Ad)].filter(s=>s!==null&&(typeof s=="object"||typeof s=="function"))),Gl=new Set(["function"]),vr=Symbol("short-circuit");class xd{constructor(e){$(this,"value");this.value=e}}class Td{}class kd{}function zw(s){return/[A-Za-z_$]/.test(s)}function Uw(s){return/[A-Za-z0-9_$]/.test(s)}function gi(s){return s>="0"&&s<="9"}function Pw(s,e,n){let a=e+1;for(;a<s.length;){if(s[a]==="\\"){a+=2;continue}if(s[a]===n)return a+1;a++}throw new Error(`Unterminated string literal at position ${e}`)}function Ng(s,e){let n=e+1;const a=[],i=[];let l="";for(;n<s.length;){const c=s[n];if(c==="\\"){const d=s[n+1];switch(d){case"n":l+=`
|
||
`;break;case"t":l+=" ";break;case"r":l+="\r";break;case"b":l+="\b";break;case"f":l+="\f";break;case"v":l+="\v";break;case"0":l+="\0";break;case"\\":l+="\\";break;case"`":l+="`";break;case"$":l+="$";break;default:l+=d;break}n+=2;continue}if(c==="`")return a.push(l),{quasis:a,exprs:i,end:n+1};if(c==="$"&&s[n+1]==="{"){a.push(l),l="",n+=2;const d=n;let f=1;for(;n<s.length&&f>0;){const h=s[n];if(h==="{")f++,n++;else if(h==="}"){if(f--,f===0)break;n++}else h==='"'||h==="'"?n=Pw(s,n,h):h==="`"?n=Ng(s,n).end:n++}if(f!==0)throw new Error("Unterminated ${...} in template literal");i.push(s.slice(d,n)),n++;continue}l+=c,n++}throw new Error(`Unterminated template literal at position ${e}`)}function Bw(s){const e=[];let n=0;const a=s.length,i=l=>n+l<a?s[n+l]:"";for(;n<a;){const l=s[n];if(l===" "||l===" "||l===`
|
||
`||l==="\r"||l==="\f"||l==="\v"){n++;continue}if(gi(l)||l==="."&&gi(i(1))){const h=n;for(;n<a&&gi(s[n]);)n++;if(s[n]===".")for(n++;n<a&&gi(s[n]);)n++;if(s[n]==="e"||s[n]==="E"){if(n++,(s[n]==="+"||s[n]==="-")&&n++,!gi(s[n]))throw new Error(`Invalid number literal at position ${h}`);for(;n<a&&gi(s[n]);)n++}const m=s.slice(h,n);e.push({type:"num",value:Number(m),pos:h});continue}if(l==='"'||l==="'"){const h=n,m=l;n++;let y="";for(;n<a&&s[n]!==m;)if(s[n]==="\\"){n++;const S=s[n];switch(S){case"n":y+=`
|
||
`;break;case"t":y+=" ";break;case"r":y+="\r";break;case"b":y+="\b";break;case"f":y+="\f";break;case"v":y+="\v";break;case"0":y+="\0";break;case"\\":y+="\\";break;case"'":y+="'";break;case'"':y+='"';break;case"`":y+="`";break;default:y+=S;break}n++}else y+=s[n],n++;if(n>=a)throw new Error(`Unterminated string literal at position ${h}`);n++,e.push({type:"str",value:y,pos:h});continue}if(zw(l)){const h=n;for(n++;n<a&&Uw(s[n]);)n++;e.push({type:"ident",value:s.slice(h,n),pos:h});continue}if(l==="`"){const h=Ng(s,n);e.push({type:"template",value:"",pos:n,quasis:h.quasis,exprs:h.exprs}),n=h.end;continue}const c=n,d=s.substr(n,2);if(s.substr(n,3)==="..."){e.push({type:"punct",value:"...",pos:c}),n+=3;continue}switch(l){case"=":{i(1)===">"?(e.push({type:"punct",value:"=>",pos:c}),n+=2):i(1)==="="?i(2)==="="?(e.push({type:"punct",value:"===",pos:c}),n+=3):(e.push({type:"punct",value:"==",pos:c}),n+=2):(e.push({type:"punct",value:"=",pos:c}),n+=1);continue}case"!":{i(1)==="="?i(2)==="="?(e.push({type:"punct",value:"!==",pos:c}),n+=3):(e.push({type:"punct",value:"!=",pos:c}),n+=2):(e.push({type:"punct",value:"!",pos:c}),n+=1);continue}case"<":{if(i(1)==="=")e.push({type:"punct",value:"<=",pos:c}),n+=2;else{if(i(1)==="<")throw new Error("Bitwise/shift operators are not allowed");e.push({type:"punct",value:"<",pos:c}),n+=1}continue}case">":{if(i(1)==="=")e.push({type:"punct",value:">=",pos:c}),n+=2;else{if(i(1)===">")throw new Error("Bitwise/shift operators are not allowed");e.push({type:"punct",value:">",pos:c}),n+=1}continue}case"&":{if(i(1)==="&")e.push({type:"punct",value:"&&",pos:c}),n+=2;else throw new Error("Bitwise operators are not allowed");continue}case"|":{if(i(1)==="|")e.push({type:"punct",value:"||",pos:c}),n+=2;else throw new Error("Bitwise operators are not allowed");continue}case"?":{i(1)==="."&&!gi(i(2))?(e.push({type:"punct",value:"?.",pos:c}),n+=2):i(1)==="?"?(e.push({type:"punct",value:"??",pos:c}),n+=2):(e.push({type:"punct",value:"?",pos:c}),n+=1);continue}case"+":{if(i(1)==="+")throw new Error("Increment operator is not allowed");if(i(1)==="=")throw new Error("Assignment operators are not allowed");e.push({type:"punct",value:"+",pos:c}),n+=1;continue}case"-":{if(i(1)==="-")throw new Error("Decrement operator is not allowed");if(i(1)==="=")throw new Error("Assignment operators are not allowed");e.push({type:"punct",value:"-",pos:c}),n+=1;continue}case"*":{if(i(1)==="=")throw new Error("Assignment operators are not allowed");if(i(1)==="*")throw new Error("Exponentiation operator is not supported");e.push({type:"punct",value:"*",pos:c}),n+=1;continue}case"/":{if(i(1)==="=")throw new Error("Assignment operators are not allowed");e.push({type:"punct",value:"/",pos:c}),n+=1;continue}case"%":{if(i(1)==="=")throw new Error("Assignment operators are not allowed");e.push({type:"punct",value:"%",pos:c}),n+=1;continue}case"~":case"^":throw new Error("Bitwise operators are not allowed");case".":case":":case"(":case")":case"[":case"]":case"{":case"}":case",":e.push({type:"punct",value:l,pos:c}),n+=1;continue;case";":e.push({type:"punct",value:";",pos:c}),n+=1;continue;default:throw new Error(`Unexpected character "${l}" at position ${c}`)}}return e}const qw={"??":1,"||":1,"&&":2,"===":3,"!==":3,"==":3,"!=":3,"<":4,">":4,"<=":4,">=":4,"+":5,"-":5,"*":6,"/":6,"%":6},Gw=new Set(["??","||","&&"]);class Fw{constructor(e){$(this,"tokens");$(this,"pos",0);this.tokens=e}atEnd(){return this.pos>=this.tokens.length}peek(e=0){const n=this.pos+e;return n<this.tokens.length?this.tokens[n]:null}next(){if(this.atEnd())throw new Error("Unexpected end of expression");return this.tokens[this.pos++]}isPunct(e,n=0){const a=this.peek(n);return!!a&&a.type==="punct"&&a.value===e}expectPunct(e){const n=this.peek();if(!n||n.type!=="punct"||n.value!==e)throw new Error(`Expected "${e}" but found "${n?n.value:"<end>"}"`);this.pos++}parseExpression(){const e=this.tryParseArrow();return e||this.parseTernary()}tryParseArrow(){const e=this.pos,n=this.peek();if(!n)return null;if(n.type==="ident"&&this.isPunct("=>",1)&&!Gl.has(String(n.value))){this.pos+=1,this.pos+=1;const{body:a,isBlock:i}=this.parseArrowBody();return{type:"Arrow",params:[{name:String(n.value),default:null}],body:a,isBlock:i}}if(n.type==="punct"&&n.value==="("){this.pos+=1;const a=this.tryParseParamList();if(a&&this.isPunct(")")&&(this.pos+=1,this.isPunct("=>"))){this.pos+=1;const{body:i,isBlock:l}=this.parseArrowBody();return{type:"Arrow",params:a,body:i,isBlock:l}}return this.pos=e,null}return this.pos=e,null}tryParseParamList(){const e=[];if(this.isPunct(")"))return e;for(;;){const n=this.peek();let a=null,i;if(n&&n.type==="punct"&&n.value==="["){const c=this.tryParseArrayPattern();if(!c)return null;i=c}else if(n&&n.type==="ident"&&!Gl.has(String(n.value)))a=String(n.value),this.pos+=1;else return null;let l=null;if(this.isPunct("=")&&(this.pos+=1,l=this.parseExpression()),e.push(i?{name:a,elements:i,default:l}:{name:a,default:l}),this.isPunct(",")){this.pos+=1;continue}break}return e}tryParseArrayPattern(){const e=this.pos;this.pos+=1;const n=[];for(;;){if(this.isPunct("]"))return this.pos+=1,n;if(this.isPunct(",")){n.push(null),this.pos+=1;continue}const a=this.peek();if(!a||a.type!=="ident"||Gl.has(String(a.value)))return this.pos=e,null;if(n.push(String(a.value)),this.pos+=1,this.isPunct(",")){this.pos+=1;continue}return this.isPunct("]")?(this.pos+=1,n):(this.pos=e,null)}}parseArrowBody(){return this.isPunct("{")?{body:this.parseBlock(),isBlock:!0}:{body:this.parseExpression(),isBlock:!1}}parseBlock(){this.expectPunct("{");const e=[];for(;!this.isPunct("}");){if(this.atEnd())throw new Error("Unterminated block");e.push(this.parseStatement())}return this.expectPunct("}"),{type:"Block",body:e}}parseStatement(){const e=this.peek();if(!e)throw new Error("Unexpected end of statement");if(e.type==="punct"&&e.value==="{")return this.parseBlock();if(e.type==="punct"&&e.value===";")return this.pos+=1,{type:"Empty"};if(e.type==="ident")switch(String(e.value)){case"const":case"let":return this.parseVarDecl();case"if":return this.parseIf();case"for":return this.parseForOf();case"return":return this.parseReturn();case"try":return this.parseTry();case"break":return this.pos+=1,this.consumeSemicolon(),{type:"Break"};case"continue":return this.pos+=1,this.consumeSemicolon(),{type:"Continue"}}const n=this.parseExpression();return this.consumeSemicolon(),{type:"ExprStmt",expression:n}}consumeSemicolon(){this.isPunct(";")&&(this.pos+=1)}parseVarDecl(){this.pos+=1;const e=[];for(;;){const n=this.peek();if(!n||n.type!=="ident")throw new Error("Expected variable name in declaration");const a=String(n.value);this.pos+=1,this.expectPunct("=");const i=this.parseExpression();if(e.push({name:a,init:i}),this.isPunct(",")){this.pos+=1;continue}break}return this.consumeSemicolon(),{type:"VarDecl",declarations:e}}parseIf(){this.pos+=1,this.expectPunct("(");const e=this.parseExpression();this.expectPunct(")");const n=this.parseStatement();let a=null;const i=this.peek();return i&&i.type==="ident"&&i.value==="else"&&(this.pos+=1,a=this.parseStatement()),{type:"If",test:e,consequent:n,alternate:a}}parseForOf(){this.pos+=1,this.expectPunct("(");const e=this.peek();if(!e||e.type!=="ident"||e.value!=="const"&&e.value!=="let")throw new Error('Only "for (const x of …)" / "for (let x of …)" loops are supported');this.pos+=1;const n=this.peek();if(!n||n.type!=="ident")throw new Error("Expected loop variable name");const a=String(n.value);this.pos+=1;const i=this.peek();if(!i||i.type!=="ident"||i.value!=="of")throw new Error("Only for-of loops are supported (for-in / C-style for are not allowed)");this.pos+=1;const l=this.parseExpression();this.expectPunct(")");const c=this.parseStatement();return{type:"ForOf",name:a,iterable:l,body:c}}parseReturn(){if(this.pos+=1,this.isPunct(";")||this.isPunct("}")||this.atEnd())return this.consumeSemicolon(),{type:"Return",argument:null};const e=this.parseExpression();return this.consumeSemicolon(),{type:"Return",argument:e}}parseTry(){this.pos+=1;const e=this.parseBlock();let n=null,a=null,i=null;const l=this.peek();if(l&&l.type==="ident"&&l.value==="catch"){if(this.pos+=1,this.isPunct("(")){this.pos+=1;const d=this.peek();d&&d.type==="ident"&&(n=String(d.value),this.pos+=1),this.expectPunct(")")}a=this.parseBlock()}const c=this.peek();if(c&&c.type==="ident"&&c.value==="finally"&&(this.pos+=1,i=this.parseBlock()),!a&&!i)throw new Error("Missing catch or finally after try");return{type:"Try",block:e,handlerParam:n,handler:a,finalizer:i}}parseFunctionExpression(){this.pos+=1;let e=null;const n=this.peek();n&&n.type==="ident"&&n.value!==void 0&&!this.isPunct("(")&&(e=String(n.value),this.pos+=1),this.expectPunct("(");const a=this.tryParseParamList();if(!a)throw new Error("Invalid function parameter list");this.expectPunct(")");const i=this.parseBlock();return{type:"Function",name:e,params:a,body:i}}parseTernary(){const e=this.parseBinary(0);if(this.isPunct("?")){this.pos+=1;const n=this.parseExpression();this.expectPunct(":");const a=this.parseExpression();return{type:"Conditional",test:e,consequent:n,alternate:a}}return e}parseBinary(e){let n=this.parseUnary();for(;;){const a=this.peek();if(!a||a.type!=="punct")break;const i=String(a.value),l=qw[i];if(l===void 0||l<e)break;this.pos+=1;const c=this.parseBinary(l+1);Gw.has(i)?n={type:"Logical",operator:i,left:n,right:c}:n={type:"Binary",operator:i,left:n,right:c}}return n}parseUnary(){const e=this.peek();if(e){if(e.type==="punct"&&(e.value==="!"||e.value==="-"||e.value==="+")){this.pos+=1;const n=this.parseUnary();return{type:"Unary",operator:String(e.value),argument:n}}if(e.type==="ident"&&e.value==="typeof")return this.pos+=1,{type:"Unary",operator:"typeof",argument:this.parseUnary()};if(e.type==="ident"&&e.value==="delete"){this.pos+=1;const n=this.parseUnary();if(n.type!=="Member")throw new Error("delete is only allowed on a property reference");return{type:"Delete",argument:n}}}return this.parsePostfix()}parsePostfix(){let e=this.parsePrimary();for(;;){const n=this.peek();if(!n||n.type!=="punct")break;if(n.value==="."){this.pos+=1;const a=this.next();if(a.type!=="ident")throw new Error(`Expected property name after "." but found "${a.value}"`);const i=String(a.value);if(co.has(i))throw new Error(`Access to "${i}" is forbidden`);e={type:"Member",object:e,property:{type:"Literal",value:i},computed:!1,optional:!1}}else if(n.value==="?.")if(this.pos+=1,this.isPunct("[")){this.pos+=1;const a=this.parseExpression();this.expectPunct("]"),this.assertComputedKeyNotBlocked(a),e={type:"Member",object:e,property:a,computed:!0,optional:!0}}else if(this.isPunct("(")){const a=this.parseArguments();e={type:"Call",callee:e,args:a,optional:!0}}else{const a=this.next();if(a.type!=="ident")throw new Error(`Expected property name after "?." but found "${a.value}"`);const i=String(a.value);if(co.has(i))throw new Error(`Access to "${i}" is forbidden`);e={type:"Member",object:e,property:{type:"Literal",value:i},computed:!1,optional:!0}}else if(n.value==="["){this.pos+=1;const a=this.parseExpression();this.expectPunct("]"),this.assertComputedKeyNotBlocked(a),e={type:"Member",object:e,property:a,computed:!0,optional:!1}}else if(n.value==="("){const a=this.parseArguments();e={type:"Call",callee:e,args:a,optional:!1}}else break}return e}assertComputedKeyNotBlocked(e){if(e.type==="Literal"&&typeof e.value=="string"&&co.has(e.value))throw new Error(`Access to "${e.value}" is forbidden`)}parseArguments(){this.expectPunct("(");const e=[];if(!this.isPunct(")"))for(;;){if(this.isPunct("...")?(this.pos+=1,e.push({type:"Spread",argument:this.parseExpression()})):e.push(this.parseExpression()),this.isPunct(",")){this.pos+=1;continue}break}return this.expectPunct(")"),e}parseNew(){this.expectIdent("new");const e=this.peek();if(!e||e.type!=="ident")throw new Error("new is only allowed on whitelisted built-in constructors");const n=String(e.value);if(!Object.prototype.hasOwnProperty.call(Ad,n))throw new Error("new is only allowed on whitelisted built-in constructors");this.pos+=1;let a=[];return this.isPunct("(")&&(a=this.parseArguments()),{type:"New",ctor:n,args:a}}expectIdent(e){const n=this.peek();if(!n||n.type!=="ident"||n.value!==e)throw new Error(`Expected "${e}"`);this.pos+=1}parsePrimary(){const e=this.peek();if(!e)throw new Error("Unexpected end of expression");if(e.type==="num")return this.pos+=1,{type:"Literal",value:e.value};if(e.type==="str")return this.pos+=1,{type:"Literal",value:e.value};if(e.type==="template"){this.pos+=1;const n=e.quasis||[""],i=(e.exprs||[]).map(l=>Ig(l));return{type:"Template",quasis:n,expressions:i}}if(e.type==="ident"&&e.value==="new")return this.parseNew();if(e.type==="ident"&&e.value==="function")return this.parseFunctionExpression();if(e.type==="ident"){const n=String(e.value);if(Gl.has(n))throw new Error(`Keyword "${n}" is not allowed`);switch(this.pos+=1,n){case"true":return{type:"Literal",value:!0};case"false":return{type:"Literal",value:!1};case"null":return{type:"Literal",value:null};case"undefined":return{type:"Literal",value:void 0};default:return{type:"Identifier",name:n}}}if(e.type==="punct"){if(e.value==="("){this.pos+=1;const n=this.parseExpression();return this.expectPunct(")"),n}if(e.value==="[")return this.parseArrayLiteral();if(e.value==="{")return this.parseObjectLiteral()}throw new Error(`Unexpected token "${e.value}"`)}parseArrayLiteral(){this.expectPunct("[");const e=[];for(;!this.isPunct("]");){if(this.isPunct(",")){this.pos+=1,e.push({type:"Literal",value:void 0});continue}if(this.isPunct("...")?(this.pos+=1,e.push({type:"Spread",argument:this.parseExpression()})):e.push(this.parseExpression()),this.isPunct(",")){this.pos+=1;continue}break}return this.expectPunct("]"),{type:"Array",elements:e}}parseObjectLiteral(){this.expectPunct("{");const e=[];for(;!this.isPunct("}");){if(this.isPunct("..."))this.pos+=1,e.push({kind:"spread",value:this.parseExpression()});else{let n,a=!1;const i=this.peek();if(!i)throw new Error("Unexpected end of expression in object literal");if(i.type==="punct"&&i.value==="[")this.pos+=1,n=this.parseExpression(),this.expectPunct("]"),a=!0;else if(i.type==="str")this.pos+=1,n={type:"Literal",value:i.value};else if(i.type==="num")this.pos+=1,n={type:"Literal",value:String(i.value)};else if(i.type==="ident")this.pos+=1,n={type:"Literal",value:String(i.value)};else throw new Error(`Unexpected token "${i.value}" in object literal`);if(this.isPunct(":")){this.pos+=1;const l=this.parseExpression();e.push({kind:"init",key:n,computed:a,value:l})}else{if(a||n.type!=="Literal"||typeof n.value!="string")throw new Error("Invalid shorthand property in object literal");if(i.type!=="ident")throw new Error("Invalid shorthand property in object literal");e.push({kind:"init",key:n,computed:!1,value:{type:"Identifier",name:n.value}})}}if(this.isPunct(",")){this.pos+=1;continue}break}return this.expectPunct("}"),{type:"Object",properties:e}}}function Ig(s){const e=Bw(s),n=new Fw(e),a=n.parseExpression();if(!n.atEnd()){const i=n.peek();throw i&&i.type==="punct"&&i.value===","?new Error("The comma/sequence operator is not allowed"):new Error(`Unexpected token "${i?i.value:"<end>"}" after expression`)}return a}function Vw(s,e){let n=e;for(;n;){if(Object.prototype.hasOwnProperty.call(n.vars,s))return n.vars[s];n=n.parent}if(Object.prototype.hasOwnProperty.call(_d,s))return _d[s];if(jw.has(s))throw new Error(`Reference to forbidden global "${s}" is not allowed`)}function Rd(s){const e=typeof s=="symbol"?s:String(s);if(typeof e=="string"&&co.has(e))throw new Error(`Access to "${e}" is forbidden`);return e}function Dd(s,e){return s.type==="Member"?jg(s,e):s.type==="Call"?Hg(s,e):Ze(s,e)}function jg(s,e){const n=Dd(s.object,e);if(n===vr||s.optional&&n==null)return vr;let a;s.computed?a=Ze(s.property,e):a=s.property.value;const i=Rd(a);if(n!=null)return n[i]}function Hg(s,e){let n,a;if(s.callee.type==="Member"){const l=s.callee,c=Dd(l.object,e);if(c===vr||l.optional&&c==null)return vr;let d;l.computed?d=Ze(l.property,e):d=l.property.value;const f=Rd(d);c==null?n=void 0:(n=c[f],a=c)}else if(n=Dd(s.callee,e),n===vr)return vr;if(s.optional&&n==null)return vr;if(typeof n!="function")throw new Error("Attempted to call a non-function value");const i=zg(s.args,e);return n.apply(a,i)}function zg(s,e){const n=[];for(const a of s)if(a.type==="Spread"){const i=Ze(a.argument,e);if(i!=null)for(const l of i)n.push(l)}else n.push(Ze(a,e));return n}function Ug(s,e,n){for(let a=0;a<s.length;a++){const i=s[a];let l=e[a];if(l===void 0&&i.default&&(l=Ze(i.default,n)),i.elements){if(l==null)throw new TypeError(`Cannot destructure ${String(l)}: value is not iterable`);const c=Array.isArray(l)?l:Array.from(l);for(let d=0;d<i.elements.length;d++){const f=i.elements[d];f!==null&&(n.vars[f]=c[d])}}else i.name!==null&&(n.vars[i.name]=l)}}function Pg(s,e){try{Ze(s,e)}catch(n){if(n instanceof xd)return n.value;throw n}}function Ze(s,e){switch(s.type){case"Literal":return s.value;case"Identifier":return Vw(s.name,e);case"Member":{const n=jg(s,e);return n===vr?void 0:n}case"Call":{const n=Hg(s,e);return n===vr?void 0:n}case"Unary":{const n=Ze(s.argument,e);switch(s.operator){case"!":return!n;case"-":return-n;case"+":return+n;case"typeof":return typeof n;default:throw new Error(`Unknown unary operator "${s.operator}"`)}}case"Binary":{const n=Ze(s.left,e),a=Ze(s.right,e);switch(s.operator){case"+":return n+a;case"-":return n-a;case"*":return n*a;case"/":return n/a;case"%":return n%a;case"===":return n===a;case"!==":return n!==a;case"==":return n==a;case"!=":return n!=a;case"<":return n<a;case">":return n>a;case"<=":return n<=a;case">=":return n>=a;default:throw new Error(`Unknown binary operator "${s.operator}"`)}}case"Logical":{const n=Ze(s.left,e);switch(s.operator){case"&&":return n&&Ze(s.right,e);case"||":return n||Ze(s.right,e);case"??":return n??Ze(s.right,e);default:throw new Error(`Unknown logical operator "${s.operator}"`)}}case"Conditional":return Ze(s.test,e)?Ze(s.consequent,e):Ze(s.alternate,e);case"Array":{const n=[];for(const a of s.elements)if(a.type==="Spread"){const i=Ze(a.argument,e);if(i!=null)for(const l of i)n.push(l)}else n.push(Ze(a,e));return n}case"Object":{const n={};for(const a of s.properties)if(a.kind==="spread"){const i=Ze(a.value,e);if(i!=null&&typeof i=="object")for(const l of Object.keys(i))Od(n,l,i[l])}else{let i;a.computed?i=Ze(a.key,e):i=a.key.value;const l=Ze(a.value,e);Od(n,String(i),l)}return n}case"Arrow":{const n=e,a=s.params,i=s.body,l=s.isBlock;return function(...d){const f={vars:{},parent:n};return Ug(a,d,f),l?Pg(i,f):Ze(i,f)}}case"Function":{const n=e,a=s.params,i=s.body,l=s.name,c=function(...f){const h={vars:{},parent:n};return l&&(h.vars[l]=c),Ug(a,f,h),Pg(i,h)};return c}case"Delete":{const n=s.argument,a=Ze(n.object,e);let i;n.computed?i=Ze(n.property,e):i=n.property.value;const l=Rd(i);if(a==null||typeof a!="object"&&typeof a!="function")return!0;if($g.has(a))throw new Error("delete on a built-in global object is not allowed");return delete a[l]}case"Block":{const n={vars:{},parent:e};for(const a of s.body)Ze(a,n);return}case"VarDecl":{for(const n of s.declarations)e.vars[n.name]=Ze(n.init,e);return}case"If":{Ze(s.test,e)?Ze(s.consequent,e):s.alternate&&Ze(s.alternate,e);return}case"ForOf":{const n=Ze(s.iterable,e);if(n!=null)for(const a of n){const i={vars:{},parent:e};i.vars[s.name]=a;try{Ze(s.body,i)}catch(l){if(l instanceof kd)continue;if(l instanceof Td)break;throw l}}return}case"Return":throw new xd(s.argument?Ze(s.argument,e):void 0);case"ExprStmt":Ze(s.expression,e);return;case"Break":throw new Td;case"Continue":throw new kd;case"Empty":return;case"Try":{try{try{Ze(s.block,e)}catch(n){if(n instanceof xd||n instanceof Td||n instanceof kd)throw n;if(s.handler){const a={vars:{},parent:e};s.handlerParam&&(a.vars[s.handlerParam]=n),Ze(s.handler,a)}else throw n}}finally{s.finalizer&&Ze(s.finalizer,e)}return}case"New":{const n=Ad[s.ctor];if(typeof n!="function")throw new Error("new on non-whitelisted constructor");const a=zg(s.args,e);return new n(...a)}case"Template":{let n=s.quasis[0]??"";for(let a=0;a<s.expressions.length;a++)n+=String(Ze(s.expressions[a],e)),n+=s.quasis[a+1]??"";return n}case"Spread":throw new Error("Unexpected spread element");default:throw new Error(`Unknown node type "${s.type}"`)}}function Od(s,e,n){Object.defineProperty(s,e,{value:n,enumerable:!0,writable:!0,configurable:!0})}function Ld(s,e){if(typeof s!="string")throw new Error("Expression must be a string");const n=Ig(s);return Ze(n,{vars:e||{},parent:null})}const Da=pt("DataBindingEngine");function uo(){try{return window.G7Core?.devTools}catch{return}}class Md extends Error{constructor(n,a,i){super(n);$(this,"path");$(this,"context");this.path=a,this.context=i,this.name="DataBindingError"}}const ra=class ra{constructor(e){$(this,"cache",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},c=uo(),d=n._computed&&!n.$computed?{...n,$computed:n._computed}:n,f=(S,v)=>{const _=v.trim();let A=!1,x=_;if(_.startsWith(rr)&&(A=!0,x=_.slice(rr.length)),Vn(x))try{const B=this.evaluatePipeExpression(x,d,l,{...i,method:"resolveBindings",displayExpression:`{{${_}}}`}),W=this.formatValue(B);return A?lo(W):W}catch(B){return Da.error("Pipe expression evaluation failed:",x,B),S}if(so(x)){const B=c?.isEnabled()?performance.now():0;try{let W,he=!1;if(l.skipCache)W=this.evaluateExpression(x,d);else{const be=`expr:${x}`,Ue=this.getFromRenderCycleCache(be);Ue!==void 0?(W=Ue,he=!0):(W=this.evaluateExpression(x,d),this.saveToRenderCycleCache(be,W))}if(c?.isEnabled()){const be=performance.now()-B;c.trackExpressionEval({expression:`{{${_}}}`,result:this.sanitizeResultForTracking(W),resultType:this.getResultType(W),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:he,duration:be,method:"resolveBindings",skipCache:l.skipCache})}const Se=this.formatValue(W);return A?lo(Se):Se}catch(W){return Da.error("Expression evaluation failed:",x,W),S}}if(l.skipCache){const B=c?.isEnabled()?performance.now():0,W=this.resolvePath(x,d,l);if(c?.isEnabled()){const Se=performance.now()-B;c.trackExpressionEval({expression:`{{${_}}}`,result:this.sanitizeResultForTracking(W),resultType:this.getResultType(W),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:!1,duration:Se,method:"resolveBindings",skipCache:!0})}const he=this.formatValue(W);return A?lo(he):he}const M=x.startsWith("_global")||x.startsWith("_local")||x.startsWith("_isolated")||x.startsWith("$parent"),T=c?.isEnabled()?performance.now():0;let L,q=!1;if(M){const B=this.getFromRenderCycleCache(x);B!==void 0?(L=B,q=!0):(L=this.resolvePath(x,d,l),this.saveToRenderCycleCache(x,L))}else{const B=this.getFromCache(x);B!==void 0?(L=B,q=!0):(L=this.resolvePath(x,d,l),this.saveToCache(x,L))}if(c?.isEnabled()){const B=performance.now()-T;c.trackExpressionEval({expression:`{{${_}}}`,result:this.sanitizeResultForTracking(L),resultType:this.getResultType(L),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:q,duration:B,method:"resolveBindings",skipCache:l.skipCache})}const P=this.formatValue(L);return A?lo(P):P},h=Iw(e);if(h.length===0)return e;let m="",y=0;for(const S of h)m+=e.slice(y,S.start),m+=f(e.slice(S.start,S.end),S.expr),y=S.end;return m+e.slice(y)}evaluatePipeExpression(e,n,a,i){const l={...this.defaultOptions,...a},c=uo(),d=c?.isEnabled()?performance.now():0,f=n._computed&&!n.$computed?{...n,$computed:n._computed}:n,[h,m]=$w(e);let y,S=!1;const v=so(h),_=h.startsWith("_global")||h.startsWith("_local")||h.startsWith("_isolated")||h.startsWith("$parent");if(l.skipCache)v?y=this.evaluateExpression(h,f):y=this.resolvePath(h,f,l);else if(v){const x=this.getFromRenderCycleCache(`expr:${h}`);x!==void 0?(y=x,S=!0):(y=this.evaluateExpression(h,f),this.saveToRenderCycleCache(`expr:${h}`,y))}else if(_){const x=this.getFromRenderCycleCache(h);x!==void 0?(y=x,S=!0):(y=this.resolvePath(h,f,l),this.saveToRenderCycleCache(h,y))}else{const x=this.getFromCache(h);x!==void 0?(y=x,S=!0):(y=this.resolvePath(h,f,l),this.saveToCache(h,y))}const A=Nw(y,m);if(c?.isEnabled()){const x=performance.now()-d;c.trackExpressionEval({expression:i?.displayExpression??`{{${e}}}`,result:this.sanitizeResultForTracking(A),resultType:this.getResultType(A),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:S,duration:x,method:i?.method??"evaluatePipeExpression",skipCache:l.skipCache})}return A}resolve(e,n,a,i){const l={...this.defaultOptions,...a},c=uo(),d=c?.isEnabled()?performance.now():0;if(l.skipCache){const y=this.resolvePath(e,n,l);return c?.isEnabled()&&c.trackExpressionEval({expression:e,result:this.sanitizeResultForTracking(y),resultType:this.getResultType(y),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:!1,duration:performance.now()-d,method:"resolve",skipCache:!0}),y}const f=e.startsWith("_global")||e.startsWith("_local")||e.startsWith("_isolated")||e.startsWith("$parent");let h=!1;if(f){const y=this.getFromRenderCycleCache(e);if(y!==void 0)return h=!0,c?.isEnabled()&&c.trackExpressionEval({expression:e,result:this.sanitizeResultForTracking(y),resultType:this.getResultType(y),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:!0,duration:performance.now()-d,method:"resolve",skipCache:l.skipCache}),y}else{const y=this.getFromCache(e);if(y!==void 0)return h=!0,c?.isEnabled()&&c.trackExpressionEval({expression:e,result:this.sanitizeResultForTracking(y),resultType:this.getResultType(y),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:!0,duration:performance.now()-d,method:"resolve",skipCache:l.skipCache}),y}const m=this.resolvePath(e,n,l);return f?this.saveToRenderCycleCache(e,m):this.saveToCache(e,m),c?.isEnabled()&&c.trackExpressionEval({expression:e,result:this.sanitizeResultForTracking(m),resultType:this.getResultType(m),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:h,duration:performance.now()-d,method:"resolve",skipCache:l.skipCache}),m}resolvePath(e,n,a,i=0,l=new WeakSet){if(typeof e!="string"||e.trim()===""){Da.warn("resolvePath: 빈 경로가 전달되었습니다 — undefined 로 해석합니다.");return}if(a.maxDepth&&i>a.maxDepth){if(a.detectCircular)throw new Md(`Maximum depth exceeded (${a.maxDepth}). Possible circular reference.`,e,n);return a.defaultValue}const c=this.parsePath(e);let d=n;for(let f=0;f<c.length;f++){const h=c[f];if(d==null){if(a.nullSafe)return a.defaultValue;throw new Md(`Cannot read property '${h}' of ${d}`,e,n)}if(a.detectCircular&&typeof d=="object"){if(l.has(d))throw new Md(`Circular reference detected at path: ${c.slice(0,f+1).join(".")}`,e,n);l.add(d)}d=d[h],e==="_global.toasts"&&Da.log(`[DataBindingEngine] segment: ${h}, current:`,d)}return d!==void 0?d:a.defaultValue}parsePath(e){const n=[];let a;for(ra.PATH_SEGMENT_PATTERN.lastIndex=0;(a=ra.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=uo();if(!n){a?.isEnabled()&&a.recordCacheMiss();return}if(Date.now()-n.timestamp>ra.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}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={},c=[...["cellChildren","expandChildren","expandContext","render"],...a?.skipBindingKeys||[]];for(const[d,f]of Object.entries(e)){if(c.includes(d)){i[d]=f;continue}try{this.resolveObjectEntry(i,d,f,n,a)}catch(h){Da.warn(`resolveObject: 값 해석 실패 (key: ${d}):`,h),i[d]=void 0}}return i}resolveObjectEntry(e,n,a,i,l){if(typeof a=="string"){const c=Ta(a);if(c!==null){const d=c.trim();let f=!1,h=d;d.startsWith(rr)&&(f=!0,h=d.slice(rr.length));let m;switch(Og(h)){case"empty":Da.warn(`resolveObject: 빈 바인딩 \`{{}}\` (key: ${n}) — undefined 로 해석합니다.`),m=void 0;break;case"literal":m=wd.get(h);break;case"pipe":m=this.evaluatePipeExpression(h,i,l);break;case"expression":m=this.evaluateExpression(h,i,l);break;default:m=this.resolve(h,i,l)}e[n]=f&&m!=null?as(m):m}else e[n]=this.resolveBindings(a,i,l)}else Array.isArray(a)?e[n]=a.map(c=>typeof c=="string"?this.resolveBindings(c,i,l):typeof c=="object"&&c!==null?this.resolveObject(c,i,l):c):a&&typeof a=="object"?e[n]=this.resolveObject(a,i,l):e[n]=a}clearCache(){this.cache.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>ra.CACHE_EXPIRY&&this.cache.delete(n)}getCacheStats(){const e=Date.now();let n=0;for(const a of this.cache.values())e-a.timestamp>ra.CACHE_EXPIRY&&n++;return{size:this.cache.size,expired:n}}evaluateExpression(e,n,a){const i=uo(),l=i?.isEnabled()?performance.now():0;i?.isEnabled()&&i.trackBindingEval();try{let c=this.preprocessOptionalChaining(e);c=this.preprocessTranslationTokens(c);const d=this.extractVariablesFromExpression(c),f={...n};for(const x of d)x in f||(f[x]=void 0);n._computed&&!f.$computed&&(f.$computed=n._computed);let h=n.$templateId,m=n.$locale;if(typeof window<"u"&&(!h||!m)){const x=window.__templateApp?.getConfig?.();h??(h=x?.templateId),m??(m=x?.locale)}const y=m||"ko";f.$localized=(x,D)=>{if(x==null&&!D)return"";if(typeof x=="string")return x;if(x&&typeof x=="object"&&x[y])return x[y];if(D&&typeof D=="string"){const M=f.$t?f.$t(D):D;if(M&&M!==D)return M}return x&&typeof x=="object"?x.ko||x.en||Object.values(x)[0]||"":x==null?"":String(x)};const S=typeof window<"u"?window.G7Core:void 0;f.$uuid=()=>S?.uuid?S.uuid():typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,x=>{const D=Math.random()*16|0;return(x==="x"?D:D&3|8).toString(16)});const v={templateId:h||"",locale:y};f.$t=x=>{if(!x||typeof x!="string")return"";try{return xa.getInstance().translate(x,v)}catch(D){return Da.warn("$t() translation failed for key:",x,D),x}},f.$get=(x,D,M=void 0)=>{if(x==null)return M;const T=Array.isArray(D)?D:[D];if(T.length===0)return x;let L=x;for(const q of T){if(L==null||q==null)return M;L=L[q]}return L??M};const _=!1,A=Ld(c,f);if(i?.isEnabled()){const x=performance.now()-l;i.trackExpressionEval({expression:e,result:this.sanitizeResultForTracking(A),resultType:this.getResultType(A),componentId:a?.componentId,componentName:a?.componentName,propName:a?.propName,fromCache:_,duration:x,method:"evaluateExpression",skipCache:a?.skipCache})}return A}catch(c){throw new Error(`Failed to evaluate expression "${e}": ${c instanceof Error?c.message:String(c)}`)}}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,c)=>i[parseInt(c,10)]),a=a.replace(/__STRING_LITERAL_(\d+)__/g,(l,c)=>n[parseInt(c,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 c=l[1];n.has(c)||i.add(c)}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){Da.warn("resolveSwitch: $switch 키 평가 실패:",e.$switch,d),l=""}let c;if(l&&e.$cases&&l in e.$cases)c=e.$cases[l];else if("$default"in e)c=e.$default;else return;return typeof c=="string"?c.includes("{{")?this.resolveBindings(c,n,i):c:c!==null&&typeof c=="object"?this.resolveObject(c,n,i):c}};$(ra,"PATH_SEGMENT_PATTERN",/([^.[\]]+)|\[(\d+)\]/g),$(ra,"CACHE_EXPIRY",3e4);let On=ra;const $d=new On,Fl={mobile:{min:0,max:767},tablet:{min:768,max:1023},desktop:{min:1024,max:1/0},portable:{min:0,max:1023}},Vl=new Map;function Kw(s,e){let n=null;return((...a)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{s(...a)},e)})}class Ww{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=Kw(()=>{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(Vl.has(e))return Vl.get(e)??null;let n=null;if(Fl[e])n={...Fl[e]};else{const a=e.match(/^(-?\d*)-(-?\d*)$/);if(a){const[,i,l]=a,c=i===""?0:parseInt(i,10),d=l===""?1/0:parseInt(l,10);!isNaN(c)&&!isNaN(d)&&c<=d&&(n={min:c,max:d})}}return Vl.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:!!Fl[i]})}return a.length===0?null:(a.sort((i,l)=>{if(i.isPreset!==l.isPreset)return i.isPreset?1:-1;const c=i.range.max-i.range.min,d=l.range.max-l.range.min;return c-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(),Vl.clear()}_setWidthForTesting(e){this.currentWidth=e,this.notifySubscribers()}}const mi=new Ww,fo=pt("ConditionEvaluator");function Yw(s,e,n,a){return Cd(Lg(s),e,n,{skipCache:!0,onEmpty:()=>{fo.warn(`${a}: 빈 바인딩 \`{{}}\` — undefined 로 해석합니다.`)}})}function Bg(s,e,n){if(!s)return!0;try{const a=Ta(s);let i;if(a!==null?i=Yw(a,e,n,"evaluateStringCondition"):i=n.resolveBindings(s,e,{skipCache:!0}),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 fo.warn(`evaluateStringCondition: 조건 평가 실패: ${s}`,a),!1}}function Kl(s,e,n){if(typeof s=="string")return Bg(s,e,n);if("and"in s){if(!Array.isArray(s.and)||s.and.length===0)return fo.warn("evaluateConditionExpression: AND 그룹이 비어있습니다"),!0;for(const a of s.and)if(!Kl(a,e,n))return!1;return!0}if("or"in s){if(!Array.isArray(s.or)||s.or.length===0)return fo.warn("evaluateConditionExpression: OR 그룹이 비어있습니다"),!1;for(const a of s.or)if(Kl(a,e,n))return!0;return!1}return fo.warn("evaluateConditionExpression: 알 수 없는 조건 형식",s),!1}function qg(s,e,n){if(!Array.isArray(s)||s.length===0)return{matched:!1,branchIndex:-1};for(let a=0;a<s.length;a++){const i=s[a];if(i.if===void 0)return{matched:!0,branchIndex:a};if(Kl(i.if,e,n))return{matched:!0,branchIndex:a}}return{matched:!1,branchIndex:-1}}function Xw(s){return typeof s=="string"?!0:s&&typeof s=="object"?"and"in s||"or"in s:!1}function Jw(s){if(!Array.isArray(s)||s.length===0)return!1;const e=s[0];return!e||typeof e!="object"?!1:"if"in e||"then"in e}const ar=pt("RenderHelpers");function Gg(){try{return window.G7Core?.devTools}catch{return}}const Fg=new On,Qw=so,Vg=Ta;function Nd(s,e,n){let a=s;if(s.startsWith("{{")&&s.endsWith("}}")&&(a=s.slice(2,-2).trim()),Vn(a))try{return n.evaluatePipeExpression(a,e,{skipCache:!0})}catch(i){ar.warn(`resolveIterationSource: 파이프 표현식 평가 실패: ${s}`,i);return}if(Qw(a))try{return n.evaluateExpression(a,e)}catch(i){ar.warn(`resolveIterationSource: 표현식 평가 실패: ${s}`,i);return}return n.resolve(a,e,{skipCache:!0})}function Zw(s,e){const n={...s};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 Id(s,e,n,a){if(!e||!Array.isArray(e)||e.length===0)return s;const i=a?.actionDispatcher??Bm(),l={...s,actions:e},c=i.bindActionsToProps(l,n,a?.componentContext);return delete c.actions,c}function Kg(s,e,n,a){if(typeof s=="boolean")return s;if(!s)return!0;try{const i=Vg(s);let l;if(i!==null?l=Cd(Lg(i),e,n,{skipCache:!0,onEmpty:()=>{ar.warn(`evaluateIfCondition: 빈 바인딩 \`{{}}\` (컴포넌트: ${a||"unknown"}) — undefined 로 해석합니다.`)}}):l=n.resolveBindings(s,e,{skipCache:!0}),typeof l=="string"){const c=l.toLowerCase().trim();if(c==="false"||c==="0"||c===""||c==="null"||c==="undefined")return!1}return!!l}catch(i){return ar.warn(`evaluateIfCondition: 조건 평가 실패 (컴포넌트: ${a||"unknown"}):`,i),!1}}function is(s,e,n,a){if(s.if!==void 0)return Kg(s.if,e,n,a);if(s.condition!==void 0)return Kg(s.condition,e,n,a);if(s.conditions===void 0)return!0;const i=s.conditions;try{return Xw(i)?Kl(i,e,n):Jw(i)?qg(i,e,n).matched:(ar.warn(`evaluateRenderCondition: 알 수 없는 conditions 형식 (컴포넌트: ${a||"unknown"})`),!0)}catch(l){return ar.warn(`evaluateRenderCondition: conditions 평가 실패 (컴포넌트: ${a||"unknown"}):`,l),!1}}function Wg(s){if(!s.responsive)return s;const e=mi.getWidth(),n=mi.getMatchingKey(s.responsive,e);if(!n)return s;const a=s.responsive[n];return{...s,props:{...s.props,...a.props},children:a.children??s.children,text:a.text??s.text,if:a.if??s.if,iteration:a.iteration??s.iteration}}function ho(s,e,n,a,i){if(!s||s.length===0)return[];const l=i?.bindingEngine??new On,c=i?.translationEngine??xa.getInstance(),d=i?.translationContext??{templateId:"",locale:"ko"},f=Zw(e,i?.componentContext),h=(v,_)=>{if(typeof v=="string")return Bl(v)||ql(v)||!/\$t:[a-zA-Z0-9._-]+/.test(v)?v:c.resolveTranslations(v,d,_);if(Array.isArray(v))return v.map(A=>h(A,_));if(v&&typeof v=="object"){const A={};for(const[x,D]of Object.entries(v))A[x]=h(D,_);return A}return v},m=(v,_)=>{if(typeof v=="string"){if(Bl(v))return Ed(v);if(ql(v)){const x=[],D=v.replace(new RegExp(`${oo}([^${pi}]*)${pi}`,"g"),(T,L)=>(x.push(L),`${ka}${x.length-1}${ka}`));let M=D;return/\$t:[a-zA-Z0-9._-]+/.test(D)&&(M=c.resolveTranslations(D,d,_)),M.replace(new RegExp(`${ka}(\\d+)${ka}`,"g"),(T,L)=>x[parseInt(L)])}if(v.startsWith("$t:defer:")){const x="$t:"+v.slice(9);return c.resolveTranslations(x,d,_)}if(v.startsWith("$t:"))return c.resolveTranslations(v,d,_);if(/\$t:[a-zA-Z0-9._-]+/.test(v)){const x=v.trim();if(!(x.startsWith("{")&&x.endsWith("}")||x.startsWith("[")&&x.endsWith("]"))&&!v.includes("{{"))return c.resolveTranslations(v,d,_)}const A=Vg(v);if(A!==null){let x=!1,D=A;A.startsWith(rr)&&(x=!0,D=A.slice(rr.length));let M=!1,T=Cd(D,_,l,{skipCache:!0,onError:L=>{ar.warn("renderItemChildren: 표현식 평가 실패:",L),M=!0},onEmpty:()=>{ar.warn("renderItemChildren: 빈 바인딩 `{{}}` 은 해석하지 않습니다.")}});return M?void 0:(x||(T=h(T,_)),x&&T!=null?as(T):T)}if(v.includes("{{")){const x=l.resolveBindings(v,_,{skipCache:!0});return typeof x=="string"&&/\$t:[a-zA-Z0-9._-]+/.test(x)?c.resolveTranslations(x,d,_):x}return v}if(Array.isArray(v))return v.map(A=>m(A,_));if(v&&typeof v=="object"){if(l.isSwitchExpression(v))return l.resolveSwitch(v,_,{skipCache:!0});if(l.isActionDefinition(v))return{...v};const A={};for(const[x,D]of Object.entries(v))A[x]=m(D,_);return A}return v},y=(v,_)=>{if(!v)return{};const A={};for(const[x,D]of Object.entries(v))A[x]=m(D,_);return A},S=(v,_,A)=>{const x=Wg(v),D=x.iteration;if(!D)return[];const M=Nd(D.source,A,l);if(!Array.isArray(M))return ar.warn(`renderItemChildren: iteration.source가 배열이 아닙니다: ${D.source}`),[];const T=Gg();if(T?.isEnabled()){const q=`${_}-iteration`;T.trackIteration(q,D.source,D.item_var,D.index_var,M.length)}const L=n[x.name];return L?M.flatMap((q,P)=>{const B={...A,[D.item_var]:q,[`${D.item_var}_index`]:P,...D.index_var?{[D.index_var]:P}:{}},W=is({if:x.if,condition:x.condition,conditions:x.conditions},B,l,x.id);if(x.if&&T?.isEnabled()){const Ct=`${_}-iter-${P}-if`;T.trackIfCondition(Ct,x.if,W,x.name)}if(!W)return[];const he=x.id?String(Ra(m(x.id,B))):void 0,Se=`${_}-iter-${P}`,be=i?.getRemountKey?i.getRemountKey(he,Se):Se,Ue=y(x.props,B),Ve=Id(Ue,x.actions,B,{actionDispatcher:i?.actionDispatcher,componentContext:i?.componentContext});let Ge=null;return x.text!==void 0?Ge=m(x.text,B):x.children&&x.children.length>0&&(Ge=ho(x.children,B,n,be,i)),T?.isEnabled()&&T.trackRender(x.name),[Xe.createElement(L,{key:be,...Ra(Ve)},Ra(Ge))]}):(ar.warn(`renderItemChildren: 컴포넌트를 찾을 수 없습니다: ${x.name}`),[])};return s.flatMap((v,_)=>{const A=Wg(v),x=A.id?String(Ra(m(A.id,f))):void 0,D=a?`${a}-${x||_}`:x||`child-${_}`,M=i?.getRemountKey?i.getRemountKey(x,D):D;if(A.iteration)return S(A,M,f);const T=is({if:A.if,condition:A.condition,conditions:A.conditions},f,l,A.id),L=Gg();if(A.if&&L?.isEnabled()){const he=`${M}-if`;L.trackIfCondition(he,A.if,T,A.name)}if(!T)return[];const q=n[A.name];if(!q)return ar.warn(`renderItemChildren: 컴포넌트를 찾을 수 없습니다: ${A.name}`),[];const P=y(A.props,f),B=Id(P,A.actions,f,{actionDispatcher:i?.actionDispatcher,componentContext:i?.componentContext});let W=null;return A.text!==void 0?W=m(A.text,f):A.children&&A.children.length>0&&(W=ho(A.children,f,n,M,i)),L?.isEnabled()&&L.trackRender(A.name),[Xe.createElement(q,{key:M,...Ra(B)},Ra(W))]})}function ss(s,e,n,a){let i,l;return n instanceof On?(i=n,l=a):(i=Fg,l=n),i.resolveBindings(s,e,l)}function e0(s,e,n,a){const i=n??Fg,l={skipCache:!0,...a};let c;try{c=i.resolveBindings(s.key,e,{skipCache:l.skipCache})?.toString()?.trim()??""}catch(h){ar.warn("resolveClassMap: key 평가 실패:",s.key,h),c=""}let d="";c&&s.variants&&c in s.variants?d=s.variants[c]:s.default&&(d=s.default);const f=[];return s.base?.trim()&&f.push(s.base.trim()),d?.trim()&&f.push(d.trim()),f.join(" ")}function Yg(s,e){return function(){return s.apply(e,arguments)}}const{toString:t0}=Object.prototype,{getPrototypeOf:os}=Object,{iterator:po,toStringTag:Xg}=Symbol,Wl=(({hasOwnProperty:s})=>(e,n)=>s.call(e,n))(Object.prototype),go=(s,e)=>{let n=s;const a=[];for(;n!=null&&n!==Object.prototype;){if(a.indexOf(n)!==-1)return!1;if(a.push(n),Wl(n,e))return!0;n=os(n)}return!1},n0=(s,e)=>s!=null&&go(s,e)?s[e]:void 0,jd=(s=>e=>{const n=t0.call(e);return s[n]||(s[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Sr=s=>(s=s.toLowerCase(),e=>jd(e)===s),Yl=s=>e=>typeof e===s,{isArray:yi}=Array,ls=Yl("undefined");function cs(s){return s!==null&&!ls(s)&&s.constructor!==null&&!ls(s.constructor)&&Nn(s.constructor.isBuffer)&&s.constructor.isBuffer(s)}const Jg=Sr("ArrayBuffer");function r0(s){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(s):e=s&&s.buffer&&Jg(s.buffer),e}const a0=Yl("string"),Nn=Yl("function"),Qg=Yl("number"),us=s=>s!==null&&typeof s=="object",i0=s=>s===!0||s===!1,Xl=s=>{if(!us(s))return!1;const e=os(s);return(e===null||e===Object.prototype||os(e)===null)&&!go(s,Xg)&&!go(s,po)},s0=s=>{if(!us(s)||cs(s))return!1;try{return Object.keys(s).length===0&&Object.getPrototypeOf(s)===Object.prototype}catch{return!1}},o0=Sr("Date"),l0=Sr("File"),c0=s=>!!(s&&typeof s.uri<"u"),u0=s=>s&&typeof s.getParts<"u",d0=Sr("Blob"),f0=Sr("FileList"),h0=s=>us(s)&&Nn(s.pipe);function p0(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const Zg=p0(),em=typeof Zg.FormData<"u"?Zg.FormData:void 0,g0=s=>{if(!s)return!1;if(em&&s instanceof em)return!0;const e=os(s);if(!e||e===Object.prototype||!Nn(s.append))return!1;const n=jd(s);return n==="formdata"||n==="object"&&Nn(s.toString)&&s.toString()==="[object FormData]"},m0=Sr("URLSearchParams"),[y0,b0,v0,S0]=["ReadableStream","Request","Response","Headers"].map(Sr),w0=s=>s.trim?s.trim():s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function mo(s,e,{allOwnKeys:n=!1}={}){if(s===null||typeof s>"u")return;let a,i;if(typeof s!="object"&&(s=[s]),yi(s))for(a=0,i=s.length;a<i;a++)e.call(null,s[a],a,s);else{if(cs(s))return;const l=n?Object.getOwnPropertyNames(s):Object.keys(s),c=l.length;let d;for(a=0;a<c;a++)d=l[a],e.call(null,s[d],d,s)}}function tm(s,e){if(cs(s))return null;e=e.toLowerCase();const n=Object.keys(s);let a=n.length,i;for(;a-- >0;)if(i=n[a],e===i.toLowerCase())return i;return null}const bi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,nm=s=>!ls(s)&&s!==bi;function Hd(...s){const{caseless:e,skipUndefined:n}=nm(this)&&this||{},a={},i=(l,c)=>{if(c==="__proto__"||c==="constructor"||c==="prototype")return;const d=e&&typeof c=="string"&&tm(a,c)||c,f=Wl(a,d)?a[d]:void 0;Xl(f)&&Xl(l)?a[d]=Hd(f,l):Xl(l)?a[d]=Hd({},l):yi(l)?a[d]=l.slice():(!n||!ls(l))&&(a[d]=l)};for(let l=0,c=s.length;l<c;l++){const d=s[l];if(!d||cs(d)||(mo(d,i),typeof d!="object"||yi(d)))continue;const f=Object.getOwnPropertySymbols(d);for(let h=0;h<f.length;h++){const m=f[h];M0.call(d,m)&&i(d[m],m)}}return a}const C0=(s,e,n,{allOwnKeys:a}={})=>(mo(e,(i,l)=>{n&&Nn(i)?Object.defineProperty(s,l,{__proto__:null,value:Yg(i,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(s,l,{__proto__:null,value:i,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:a}),s),E0=s=>(s.charCodeAt(0)===65279&&(s=s.slice(1)),s),_0=(s,e,n,a)=>{s.prototype=Object.create(e.prototype,a),Object.defineProperty(s.prototype,"constructor",{__proto__:null,value:s,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(s,"super",{__proto__:null,value:e.prototype}),n&&Object.assign(s.prototype,n)},A0=(s,e,n,a)=>{let i,l,c;const d={};if(e=e||{},s==null)return e;do{for(i=Object.getOwnPropertyNames(s),l=i.length;l-- >0;)c=i[l],(!a||a(c,s,e))&&!d[c]&&(e[c]=s[c],d[c]=!0);s=n!==!1&&os(s)}while(s&&(!n||n(s,e))&&s!==Object.prototype);return e},x0=(s,e,n)=>{s=String(s),(n===void 0||n>s.length)&&(n=s.length),n-=e.length;const a=s.indexOf(e,n);return a!==-1&&a===n},T0=s=>{if(!s)return null;if(yi(s))return s;let e=s.length;if(!Qg(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=s[e];return n},k0=(s=>e=>s&&e instanceof s)(typeof Uint8Array<"u"&&os(Uint8Array)),R0=(s,e)=>{const a=(s&&s[po]).call(s);let i;for(;(i=a.next())&&!i.done;){const l=i.value;e.call(s,l[0],l[1])}},D0=(s,e)=>{let n;const a=[];for(;(n=s.exec(e))!==null;)a.push(n);return a},O0=Sr("HTMLFormElement"),L0=s=>s.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,a,i){return a.toUpperCase()+i}),{propertyIsEnumerable:M0}=Object.prototype,$0=Sr("RegExp"),rm=(s,e)=>{const n=Object.getOwnPropertyDescriptors(s),a={};mo(n,(i,l)=>{let c;(c=e(i,l,s))!==!1&&(a[l]=c||i)}),Object.defineProperties(s,a)},N0=s=>{rm(s,(e,n)=>{if(Nn(s)&&["arguments","caller","callee"].includes(n))return!1;const a=s[n];if(Nn(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+"'")})}})},I0=(s,e)=>{const n={},a=i=>{i.forEach(l=>{n[l]=!0})};return yi(s)?a(s):a(String(s).split(e)),n},j0=()=>{},H0=(s,e)=>s!=null&&Number.isFinite(s=+s)?s:e;function z0(s){return!!(s&&Nn(s.append)&&s[Xg]==="FormData"&&s[po])}const U0=s=>{const e=new WeakSet,n=a=>{if(us(a)){if(e.has(a))return;if(cs(a))return a;if(!("toJSON"in a)){e.add(a);const i=yi(a)?[]:{};return mo(a,(l,c)=>{const d=n(l);!ls(d)&&(i[c]=d)}),e.delete(a),i}}return a};return n(s)},P0=Sr("AsyncFunction"),B0=s=>s&&(us(s)||Nn(s))&&Nn(s.then)&&Nn(s.catch),am=((s,e)=>s?setImmediate:e?((n,a)=>(bi.addEventListener("message",({source:i,data:l})=>{i===bi&&l===n&&a.length&&a.shift()()},!1),i=>{a.push(i),bi.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Nn(bi.postMessage)),q0=typeof queueMicrotask<"u"?queueMicrotask.bind(bi):typeof process<"u"&&process.nextTick||am,im=s=>s!=null&&Nn(s[po]),V={isArray:yi,isArrayBuffer:Jg,isBuffer:cs,isFormData:g0,isArrayBufferView:r0,isString:a0,isNumber:Qg,isBoolean:i0,isObject:us,isPlainObject:Xl,isEmptyObject:s0,isReadableStream:y0,isRequest:b0,isResponse:v0,isHeaders:S0,isUndefined:ls,isDate:o0,isFile:l0,isReactNativeBlob:c0,isReactNative:u0,isBlob:d0,isRegExp:$0,isFunction:Nn,isStream:h0,isURLSearchParams:m0,isTypedArray:k0,isFileList:f0,forEach:mo,merge:Hd,extend:C0,trim:w0,stripBOM:E0,inherits:_0,toFlatObject:A0,kindOf:jd,kindOfTest:Sr,endsWith:x0,toArray:T0,forEachEntry:R0,matchAll:D0,isHTMLForm:O0,hasOwnProperty:Wl,hasOwnProp:Wl,hasOwnInPrototypeChain:go,getSafeProp:n0,reduceDescriptors:rm,freezeMethods:N0,toObjectSet:I0,toCamelCase:L0,noop:j0,toFiniteNumber:H0,findKey:tm,global:bi,isContextDefined:nm,isSpecCompliantForm:z0,toJSONObject:U0,isAsyncFn:P0,isThenable:B0,setImmediate:am,asap:q0,isIterable:im,isSafeIterable:s=>s!=null&&go(s,po)&&im(s)},G0=V.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"]),F0=s=>{const e={};let n,a,i;return s&&s.split(`
|
||
`).forEach(function(c){i=c.indexOf(":"),n=c.substring(0,i).trim().toLowerCase(),a=c.substring(i+1).trim(),!(!n||e[n]&&G0[n])&&(n==="set-cookie"?e[n]?e[n].push(a):e[n]=[a]:e[n]=e[n]?e[n]+", "+a:a)}),e};function V0(s){let e=0,n=s.length;for(;e<n;){const a=s.charCodeAt(e);if(a!==9&&a!==32)break;e+=1}for(;n>e;){const a=s.charCodeAt(n-1);if(a!==9&&a!==32)break;n-=1}return e===0&&n===s.length?s:s.slice(e,n)}const K0=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),W0=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function zd(s,e){return V.isArray(s)?s.map(n=>zd(n,e)):V0(String(s).replace(e,""))}const Y0=s=>zd(s,K0),X0=s=>zd(s,W0);function sm(s){const e=Object.create(null);return V.forEach(s.toJSON(),(n,a)=>{e[a]=X0(n)}),e}const om=Symbol("internals");function yo(s){return s&&String(s).trim().toLowerCase()}function Jl(s){return s===!1||s==null?s:V.isArray(s)?s.map(Jl):Y0(String(s))}function J0(s){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let a;for(;a=n.exec(s);)e[a[1]]=a[2];return e}const Q0=s=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(s.trim());function Ud(s,e,n,a,i){if(V.isFunction(a))return a.call(this,e,n);if(i&&(e=n),!!V.isString(e)){if(V.isString(a))return e.indexOf(a)!==-1;if(V.isRegExp(a))return a.test(e)}}function Z0(s){return s.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,a)=>n.toUpperCase()+a)}function eC(s,e){const n=V.toCamelCase(" "+e);["get","set","has"].forEach(a=>{Object.defineProperty(s,a+n,{__proto__:null,value:function(i,l,c){return this[a].call(this,e,i,l,c)},configurable:!0})})}let xn=class{constructor(e){e&&this.set(e)}set(e,n,a){const i=this;function l(d,f,h){const m=yo(f);if(!m)return;const y=V.findKey(i,m);(!y||i[y]===void 0||h===!0||h===void 0&&i[y]!==!1)&&(i[y||f]=Jl(d))}const c=(d,f)=>V.forEach(d,(h,m)=>l(h,m,f));if(V.isPlainObject(e)||e instanceof this.constructor)c(e,n);else if(V.isString(e)&&(e=e.trim())&&!Q0(e))c(F0(e),n);else if(V.isObject(e)&&V.isSafeIterable(e)){let d=Object.create(null),f,h;for(const m of e){if(!V.isArray(m))throw new TypeError("Object iterator must return a key-value pair");h=m[0],V.hasOwnProp(d,h)?(f=d[h],d[h]=V.isArray(f)?[...f,m[1]]:[f,m[1]]):d[h]=m[1]}c(d,n)}else e!=null&&l(n,e,a);return this}get(e,n){if(e=yo(e),e){const a=V.findKey(this,e);if(a){const i=this[a];if(!n)return i;if(n===!0)return J0(i);if(V.isFunction(n))return n.call(this,i,a);if(V.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=yo(e),e){const a=V.findKey(this,e);return!!(a&&this[a]!==void 0&&(!n||Ud(this,this[a],a,n)))}return!1}delete(e,n){const a=this;let i=!1;function l(c){if(c=yo(c),c){const d=V.findKey(a,c);d&&(!n||Ud(a,a[d],d,n))&&(delete a[d],i=!0)}}return V.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||Ud(this,this[l],l,e,!0))&&(delete this[l],i=!0)}return i}normalize(e){const n=this,a={};return V.forEach(this,(i,l)=>{const c=V.findKey(a,l);if(c){n[c]=Jl(i),delete n[l];return}const d=e?Z0(l):String(l).trim();d!==l&&delete n[l],n[d]=Jl(i),a[d]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return V.forEach(this,(a,i)=>{a!=null&&a!==!1&&(n[i]=e&&V.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[om]=this[om]={accessors:{}}).accessors,i=this.prototype;function l(c){const d=yo(c);a[d]||(eC(i,c),a[d]=!0)}return V.isArray(e)?e.forEach(l):l(e),this}};xn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),V.reduceDescriptors(xn.prototype,({value:s},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>s,set(a){this[n]=a}}}),V.freezeMethods(xn);const tC="[REDACTED ****]";function nC(s){if(V.hasOwnProp(s,"toJSON"))return!0;let e=Object.getPrototypeOf(s);for(;e&&e!==Object.prototype;){if(V.hasOwnProp(e,"toJSON"))return!0;e=Object.getPrototypeOf(e)}return!1}function rC(s,e){const n=new Set(e.map(l=>String(l).toLowerCase())),a=[],i=l=>{if(l===null||typeof l!="object"||V.isBuffer(l))return l;if(a.indexOf(l)!==-1)return;l instanceof xn&&(l=l.toJSON()),a.push(l);let c;if(V.isArray(l))c=[],l.forEach((d,f)=>{const h=i(d);V.isUndefined(h)||(c[f]=h)});else{if(!V.isPlainObject(l)&&nC(l))return a.pop(),l;c=Object.create(null);for(const[d,f]of Object.entries(l)){const h=n.has(d.toLowerCase())?tC:i(f);V.isUndefined(h)||(c[d]=h)}}return a.pop(),c};return i(s)}let Ee=class mw extends Error{static from(e,n,a,i,l,c){const d=new mw(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),c&&Object.assign(d,c),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&&V.hasOwnProp(e,"redact")?e.redact:void 0,a=V.isArray(n)&&n.length>0?rC(e,n):V.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}}};Ee.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",Ee.ERR_BAD_OPTION="ERR_BAD_OPTION",Ee.ECONNABORTED="ECONNABORTED",Ee.ETIMEDOUT="ETIMEDOUT",Ee.ECONNREFUSED="ECONNREFUSED",Ee.ERR_NETWORK="ERR_NETWORK",Ee.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",Ee.ERR_DEPRECATED="ERR_DEPRECATED",Ee.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",Ee.ERR_BAD_REQUEST="ERR_BAD_REQUEST",Ee.ERR_CANCELED="ERR_CANCELED",Ee.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",Ee.ERR_INVALID_URL="ERR_INVALID_URL",Ee.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const aC=null,lm=100;function Pd(s){return V.isPlainObject(s)||V.isArray(s)}function cm(s){return V.endsWith(s,"[]")?s.slice(0,-2):s}function Bd(s,e,n){return s?s.concat(e).map(function(i,l){return i=cm(i),!n&&l?"["+i+"]":i}).join(n?".":""):e}function iC(s){return V.isArray(s)&&!s.some(Pd)}const sC=V.toFlatObject(V,{},null,function(e){return/^is[A-Z]/.test(e)});function Ql(s,e,n){if(!V.isObject(s))throw new TypeError("target must be an object");e=e||new FormData,n=V.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(M,T){return!V.isUndefined(T[M])});const a=n.metaTokens,i=n.visitor||_,l=n.dots,c=n.indexes,d=n.Blob||typeof Blob<"u"&&Blob,f=n.maxDepth===void 0?lm:n.maxDepth,h=d&&V.isSpecCompliantForm(e),m=[];if(!V.isFunction(i))throw new TypeError("visitor must be a function");function y(D){if(D===null)return"";if(V.isDate(D))return D.toISOString();if(V.isBoolean(D))return D.toString();if(!h&&V.isBlob(D))throw new Ee("Blob is not supported. Use a Buffer instead.");if(V.isArrayBuffer(D)||V.isTypedArray(D)){if(h&&typeof d=="function")return new d([D]);if(typeof Buffer<"u")return Buffer.from(D);throw new Ee("Blob is not supported. Use a Buffer instead.",Ee.ERR_NOT_SUPPORT)}return D}function S(D){if(D>f)throw new Ee("Object is too deeply nested ("+D+" levels). Max depth: "+f,Ee.ERR_FORM_DATA_DEPTH_EXCEEDED)}function v(D,M){if(f===1/0)return JSON.stringify(D);const T=[];return JSON.stringify(D,function(q,P){if(!V.isObject(P))return P;for(;T.length&&T[T.length-1]!==this;)T.pop();return T.push(P),S(M+T.length-1),P})}function _(D,M,T){let L=D;if(V.isReactNative(e)&&V.isReactNativeBlob(D))return e.append(Bd(T,M,l),y(D)),!1;if(D&&!T&&typeof D=="object"){if(V.endsWith(M,"{}"))M=a?M:M.slice(0,-2),D=v(D,1);else if(V.isArray(D)&&iC(D)||(V.isFileList(D)||V.endsWith(M,"[]"))&&(L=V.toArray(D)))return M=cm(M),L.forEach(function(P,B){!(V.isUndefined(P)||P===null)&&e.append(c===!0?Bd([M],B,l):c===null?M:M+"[]",y(P))}),!1}return Pd(D)?!0:(e.append(Bd(T,M,l),y(D)),!1)}const A=Object.assign(sC,{defaultVisitor:_,convertValue:y,isVisitable:Pd});function x(D,M,T=0){if(!V.isUndefined(D)){if(S(T),m.indexOf(D)!==-1)throw new Error("Circular reference detected in "+M.join("."));m.push(D),V.forEach(D,function(q,P){(!(V.isUndefined(q)||q===null)&&i.call(e,q,V.isString(P)?P.trim():P,M,A))===!0&&x(q,M?M.concat(P):[P],T+1)}),m.pop()}}if(!V.isObject(s))throw new TypeError("data must be an object");return x(s),e}function um(s){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(s).replace(/[!'()~]|%20/g,function(a){return e[a]})}function qd(s,e){this._pairs=[],s&&Ql(s,this,e)}const dm=qd.prototype;dm.append=function(e,n){this._pairs.push([e,n])},dm.toString=function(e){const n=e?a=>e.call(this,a,um):um;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function oC(s){return encodeURIComponent(s).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function fm(s,e,n){if(!e)return s;s=s||"";const a=V.isFunction(n)?{serialize:n}:n,i=V.getSafeProp(a,"encode")||oC,l=V.getSafeProp(a,"serialize");let c;if(l?c=l(e,a):c=V.isURLSearchParams(e)?e.toString():new qd(e,a).toString(i),c){const d=s.indexOf("#");d!==-1&&(s=s.slice(0,d)),s+=(s.indexOf("?")===-1?"?":"&")+c}return s}class hm{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){V.forEach(this.handlers,function(a){a!==null&&e(a)})}}const Gd={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},lC={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:qd,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Fd=typeof window<"u"&&typeof document<"u",Vd=typeof navigator=="object"&&navigator||void 0,cC=Fd&&(!Vd||["ReactNative","NativeScript","NS"].indexOf(Vd.product)<0),uC=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",dC=Fd&&window.location.href||"http://localhost",yn={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Fd,hasStandardBrowserEnv:cC,hasStandardBrowserWebWorkerEnv:uC,navigator:Vd,origin:dC},Symbol.toStringTag,{value:"Module"})),...lC};function fC(s,e){return Ql(s,new yn.classes.URLSearchParams,{visitor:function(n,a,i,l){return yn.isNode&&V.isBuffer(n)?(this.append(a,n.toString("base64")),!1):l.defaultVisitor.apply(this,arguments)},...e})}const pm=lm;function gm(s){if(s>pm)throw new Ee("FormData field is too deeply nested ("+s+" levels). Max depth: "+pm,Ee.ERR_FORM_DATA_DEPTH_EXCEEDED)}function hC(s){const e=[],n=/\w+|\[(\w*)]/g;let a;for(;(a=n.exec(s))!==null;)gm(e.length),e.push(a[0]==="[]"?"":a[1]||a[0]);return e}function pC(s){const e={},n=Object.keys(s);let a;const i=n.length;let l;for(a=0;a<i;a++)l=n[a],e[l]=s[l];return e}function mm(s){function e(n,a,i,l){gm(l);let c=n[l++];if(c==="__proto__")return!0;const d=Number.isFinite(+c),f=l>=n.length;return c=!c&&V.isArray(i)?i.length:c,f?(V.hasOwnProp(i,c)?i[c]=V.isArray(i[c])?i[c].concat(a):[i[c],a]:i[c]=a,!d):((!V.hasOwnProp(i,c)||!V.isObject(i[c]))&&(i[c]=[]),e(n,a,i[c],l)&&V.isArray(i[c])&&(i[c]=pC(i[c])),!d)}if(V.isFormData(s)&&V.isFunction(s.entries)){const n={};return V.forEachEntry(s,(a,i)=>{e(hC(a),i,n,0)}),n}return null}const ds=(s,e)=>s!=null&&V.hasOwnProp(s,e)?s[e]:void 0;function gC(s,e,n){if(V.isString(s))try{return(e||JSON.parse)(s),V.trim(s)}catch(a){if(a.name!=="SyntaxError")throw a}return(n||JSON.stringify)(s)}const bo={transitional:Gd,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const a=n.getContentType()||"",i=a.indexOf("application/json")>-1,l=V.isObject(e);if(l&&V.isHTMLForm(e)&&(e=new FormData(e)),V.isFormData(e))return i?JSON.stringify(mm(e)):e;if(V.isArrayBuffer(e)||V.isBuffer(e)||V.isStream(e)||V.isFile(e)||V.isBlob(e)||V.isReadableStream(e))return e;if(V.isArrayBufferView(e))return e.buffer;if(V.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let d;if(l){const f=ds(this,"formSerializer");if(a.indexOf("application/x-www-form-urlencoded")>-1)return fC(e,f).toString();if((d=V.isFileList(e))||a.indexOf("multipart/form-data")>-1){const h=ds(this,"env"),m=h&&h.FormData;return Ql(d?{"files[]":e}:e,m&&new m,f)}}return l||i?(n.setContentType("application/json",!1),gC(e)):e}],transformResponse:[function(e){const n=ds(this,"transitional")||bo.transitional,a=n&&n.forcedJSONParsing,i=ds(this,"responseType"),l=i==="json";if(V.isResponse(e)||V.isReadableStream(e))return e;if(e&&V.isString(e)&&(a&&!i||l)){const d=!(n&&n.silentJSONParsing)&&l;try{return JSON.parse(e,ds(this,"parseReviver"))}catch(f){if(d)throw f.name==="SyntaxError"?Ee.from(f,Ee.ERR_BAD_RESPONSE,this,null,ds(this,"response")):f}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:yn.classes.FormData,Blob:yn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};V.forEach(["delete","get","head","post","put","patch","query"],s=>{bo.headers[s]={}});function Kd(s,e){const n=this||bo,a=e||n,i=xn.from(a.headers);let l=a.data;return V.forEach(s,function(d){l=d.call(n,l,i.normalize(),e?e.status:void 0)}),i.normalize(),l}function ym(s){return!!(s&&s.__CANCEL__)}let vo=class extends Ee{constructor(e,n,a){super(e??"canceled",Ee.ERR_CANCELED,n,a),this.name="CanceledError",this.__CANCEL__=!0}};function bm(s,e,n){const a=n.config.validateStatus;!n.status||!a||a(n.status)?s(n):e(new Ee("Request failed with status code "+n.status,n.status>=400&&n.status<500?Ee.ERR_BAD_REQUEST:Ee.ERR_BAD_RESPONSE,n.config,n.request,n))}function mC(s){const e=/^([-+\w]{1,25}):(?:\/\/)?/.exec(s);return e&&e[1]||""}function yC(s,e){s=s||10;const n=new Array(s),a=new Array(s);let i=0,l=0,c;return e=e!==void 0?e:1e3,function(f){const h=Date.now(),m=a[l];c||(c=h),n[i]=f,a[i]=h;let y=l,S=0;for(;y!==i;)S+=n[y++],y=y%s;if(i=(i+1)%s,i===l&&(l=(l+1)%s),h-c<e)return;const v=m&&h-m;return v?Math.round(S*1e3/v):void 0}}function bC(s,e){let n=0,a=1e3/e,i,l;const c=(h,m=Date.now())=>{n=m,i=null,l&&(clearTimeout(l),l=null),s(...h)};return[(...h)=>{const m=Date.now(),y=m-n;y>=a?c(h,m):(i=h,l||(l=setTimeout(()=>{l=null,c(i)},a-y)))},()=>i&&c(i)]}const Zl=(s,e,n=3)=>{let a=0;const i=yC(50,250);return bC(l=>{if(!l||typeof l.loaded!="number")return;const c=l.loaded,d=l.lengthComputable?l.total:void 0,f=d!=null?Math.min(c,d):c,h=Math.max(0,f-a),m=i(h);a=Math.max(a,f);const y={loaded:f,total:d,progress:d?f/d:void 0,bytes:h,rate:m||void 0,estimated:m&&d?(d-f)/m:void 0,event:l,lengthComputable:d!=null,[e?"download":"upload"]:!0};s(y)},n)},vm=(s,e)=>{const n=s!=null;return[a=>e[0]({lengthComputable:n,total:s,loaded:a}),e[1]]},Sm=s=>(...e)=>V.asap(()=>s(...e)),vC=yn.hasStandardBrowserEnv?((s,e)=>n=>(n=new URL(n,yn.origin),s.protocol===n.protocol&&s.host===n.host&&(e||s.port===n.port)))(new URL(yn.origin),yn.navigator&&/(msie|trident)/i.test(yn.navigator.userAgent)):()=>!0,SC=yn.hasStandardBrowserEnv?{write(s,e,n,a,i,l,c){if(typeof document>"u")return;const d=[`${s}=${encodeURIComponent(e)}`];V.isNumber(n)&&d.push(`expires=${new Date(n).toUTCString()}`),V.isString(a)&&d.push(`path=${a}`),V.isString(i)&&d.push(`domain=${i}`),l===!0&&d.push("secure"),V.isString(c)&&d.push(`SameSite=${c}`),document.cookie=d.join("; ")},read(s){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)===s)try{return decodeURIComponent(a.slice(i+1))}catch{return a.slice(i+1)}}return null},remove(s){this.write(s,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function wC(s){return typeof s!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(s)}function CC(s,e){return e?s.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):s}const EC=/^https?:(?!\/\/)/i,_C=/[\t\n\r]/g;function AC(s){let e=0;for(;e<s.length&&s.charCodeAt(e)<=32;)e++;return s.slice(e)}function xC(s){return AC(s).replace(_C,"")}function wm(s,e){if(typeof s=="string"&&EC.test(xC(s)))throw new Ee('Invalid URL: missing "//" after protocol',Ee.ERR_INVALID_URL,e)}function Cm(s,e,n,a){wm(e,a);let i=!wC(e);return s&&(i||n===!1)?(wm(s,a),CC(s,e)):e}const Em=s=>s instanceof xn?{...s}:s;function vi(s,e){s=s||{},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,y,S,v){return V.isPlainObject(m)&&V.isPlainObject(y)?V.merge.call({caseless:v},m,y):V.isPlainObject(y)?V.merge({},y):V.isArray(y)?y.slice():y}function i(m,y,S,v){if(V.isUndefined(y)){if(!V.isUndefined(m))return a(void 0,m,S,v)}else return a(m,y,S,v)}function l(m,y){if(!V.isUndefined(y))return a(void 0,y)}function c(m,y){if(V.isUndefined(y)){if(!V.isUndefined(m))return a(void 0,m)}else return a(void 0,y)}function d(m){const y=V.hasOwnProp(e,"transitional")?e.transitional:void 0;if(!V.isUndefined(y))if(V.isPlainObject(y)){if(V.hasOwnProp(y,m))return y[m]}else return;const S=V.hasOwnProp(s,"transitional")?s.transitional:void 0;if(V.isPlainObject(S)&&V.hasOwnProp(S,m))return S[m]}function f(m,y,S){if(V.hasOwnProp(e,S))return a(m,y);if(V.hasOwnProp(s,S))return a(void 0,m)}const h={url:l,method:l,data:l,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,withXSRFToken:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,allowedSocketPaths:c,responseEncoding:c,validateStatus:f,headers:(m,y,S)=>i(Em(m),Em(y),S,!0)};return V.forEach(Object.keys({...s,...e}),function(y){if(y==="__proto__"||y==="constructor"||y==="prototype")return;const S=V.hasOwnProp(h,y)?h[y]:i,v=V.hasOwnProp(s,y)?s[y]:void 0,_=V.hasOwnProp(e,y)?e[y]:void 0,A=S(v,_,y);V.isUndefined(A)&&S!==f||(n[y]=A)}),V.hasOwnProp(e,"validateStatus")&&V.isUndefined(e.validateStatus)&&d("validateStatusUndefinedResolves")===!1&&(V.hasOwnProp(s,"validateStatus")?n.validateStatus=a(void 0,s.validateStatus):delete n.validateStatus),n}const TC=["content-type","content-length"];function kC(s,e,n){if(n!=="content-only"){s.set(e);return}Object.entries(e||{}).forEach(([a,i])=>{TC.includes(a.toLowerCase())&&s.set(a,i)})}const RC=s=>encodeURIComponent(s).replace(/%([0-9A-F]{2})/gi,(e,n)=>String.fromCharCode(parseInt(n,16)));function _m(s){const e=vi({},s),n=S=>V.hasOwnProp(e,S)?e[S]:void 0,a=n("data");let i=n("withXSRFToken");const l=n("xsrfHeaderName"),c=n("xsrfCookieName");let d=n("headers");const f=n("auth"),h=n("baseURL"),m=n("allowAbsoluteUrls"),y=n("url");if(e.headers=d=xn.from(d),e.url=fm(Cm(h,y,m,e),n("params"),n("paramsSerializer")),f){const S=V.getSafeProp(f,"username")||"",v=V.getSafeProp(f,"password")||"";try{d.set("Authorization","Basic "+btoa(S+":"+(v?RC(v):"")))}catch(_){throw Ee.from(_,Ee.ERR_BAD_OPTION_VALUE,s)}}if(V.isFormData(a)&&(yn.hasStandardBrowserEnv||yn.hasStandardBrowserWebWorkerEnv||V.isReactNative(a)?d.setContentType(void 0):V.isFunction(a.getHeaders)&&kC(d,a.getHeaders(),n("formDataHeaderPolicy"))),yn.hasStandardBrowserEnv&&(V.isFunction(i)&&(i=i(e)),i===!0||i==null&&vC(e.url))){const v=l&&c&&SC.read(c);v&&d.set(l,v)}return e}const DC=typeof XMLHttpRequest<"u"&&function(s){return new Promise(function(n,a){const i=_m(s);let l=i.data;const c=xn.from(i.headers).normalize();let{responseType:d,onUploadProgress:f,onDownloadProgress:h}=i,m,y,S,v,_;function A(){v&&v(),_&&_(),i.cancelToken&&i.cancelToken.unsubscribe(m),i.signal&&i.signal.removeEventListener("abort",m)}let x=new XMLHttpRequest;x.open(i.method.toUpperCase(),i.url,!0),x.timeout=i.timeout;function D(){if(!x)return;const T=xn.from("getAllResponseHeaders"in x&&x.getAllResponseHeaders()),q={data:!d||d==="text"||d==="json"?x.responseText:x.response,status:x.status,statusText:x.statusText,headers:T,config:s,request:x};bm(function(B){n(B),A()},function(B){a(B),A()},q),x=null}"onloadend"in x?x.onloadend=D:x.onreadystatechange=function(){!x||x.readyState!==4||x.status===0&&!(x.responseURL&&x.responseURL.startsWith("file:"))||setTimeout(D)},x.onabort=function(){x&&(a(new Ee("Request aborted",Ee.ECONNABORTED,s,x)),A(),x=null)},x.onerror=function(L){const q=L&&L.message?L.message:"Network Error",P=new Ee(q,Ee.ERR_NETWORK,s,x);P.event=L||null,a(P),A(),x=null},x.ontimeout=function(){let L=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const q=i.transitional||Gd;i.timeoutErrorMessage&&(L=i.timeoutErrorMessage),a(new Ee(L,q.clarifyTimeoutError?Ee.ETIMEDOUT:Ee.ECONNABORTED,s,x)),A(),x=null},l===void 0&&c.setContentType(null),"setRequestHeader"in x&&V.forEach(sm(c),function(L,q){x.setRequestHeader(q,L)}),V.isUndefined(i.withCredentials)||(x.withCredentials=!!i.withCredentials),d&&d!=="json"&&(x.responseType=i.responseType),h&&([S,_]=Zl(h,!0),x.addEventListener("progress",S)),f&&x.upload&&([y,v]=Zl(f),x.upload.addEventListener("progress",y),x.upload.addEventListener("loadend",v)),(i.cancelToken||i.signal)&&(m=T=>{x&&(a(!T||T.type?new vo(null,s,x):T),x.abort(),A(),x=null)},i.cancelToken&&i.cancelToken.subscribe(m),i.signal&&(i.signal.aborted?m():i.signal.addEventListener("abort",m)));const M=mC(i.url);if(M&&!yn.protocols.includes(M)){a(new Ee("Unsupported protocol "+M+":",Ee.ERR_BAD_REQUEST,s)),A();return}x.send(l||null)})},OC=(s,e)=>{if(s=s?s.filter(Boolean):[],!e&&!s.length)return;const n=new AbortController;let a=!1;const i=function(f){if(!a){a=!0,c();const h=f instanceof Error?f:this.reason;n.abort(h instanceof Ee?h:new vo(h instanceof Error?h.message:h))}};let l=e&&setTimeout(()=>{l=null,i(new Ee(`timeout of ${e}ms exceeded`,Ee.ETIMEDOUT))},e);const c=()=>{s&&(l&&clearTimeout(l),l=null,s.forEach(f=>{f.unsubscribe?f.unsubscribe(i):f.removeEventListener("abort",i)}),s=null)};s.forEach(f=>f.addEventListener("abort",i,{once:!0}));const{signal:d}=n;return d.unsubscribe=()=>V.asap(c),d},LC=function*(s,e){let n=s.byteLength;if(n<e){yield s;return}let a=0,i;for(;a<n;)i=a+e,yield s.slice(a,i),a=i},MC=async function*(s,e){for await(const n of $C(s))yield*LC(n,e)},$C=async function*(s){if(s[Symbol.asyncIterator]){yield*s;return}const e=s.getReader();try{for(;;){const{done:n,value:a}=await e.read();if(n)break;yield a}}finally{await e.cancel()}},Am=(s,e,n,a)=>{const i=MC(s,e);let l=0,c,d=f=>{c||(c=!0,a&&a(f))};return new ReadableStream({async pull(f){try{const{done:h,value:m}=await i.next();if(h){d(),f.close();return}let y=m.byteLength;if(n){let S=l+=y;n(S)}f.enqueue(new Uint8Array(m))}catch(h){throw d(h),h}},cancel(f){return d(f),i.return()}},{highWaterMark:2})},ec=s=>s>=48&&s<=57||s>=65&&s<=70||s>=97&&s<=102,NC=(s,e,n)=>e+2<n&&ec(s.charCodeAt(e+1))&&ec(s.charCodeAt(e+2));function IC(s){if(!s||typeof s!="string"||!s.startsWith("data:"))return 0;const e=s.indexOf(",");if(e<0)return 0;const n=s.slice(5,e),a=s.slice(e+1);if(/;base64/i.test(n)){let c=a.length;const d=a.length;for(let v=0;v<d;v++)if(a.charCodeAt(v)===37&&v+2<d){const _=a.charCodeAt(v+1),A=a.charCodeAt(v+2);ec(_)&&ec(A)&&(c-=2,v+=2)}let f=0,h=d-1;const m=v=>v>=2&&a.charCodeAt(v-2)===37&&a.charCodeAt(v-1)===51&&(a.charCodeAt(v)===68||a.charCodeAt(v)===100);h>=0&&(a.charCodeAt(h)===61?(f++,h--):m(h)&&(f++,h-=3)),f===1&&h>=0&&(a.charCodeAt(h)===61||m(h))&&f++;const S=Math.floor(c/4)*3-(f||0);return S>0?S:0}let l=0;for(let c=0,d=a.length;c<d;c++){const f=a.charCodeAt(c);if(f===37&&NC(a,c,d))l+=1,c+=2;else if(f<128)l+=1;else if(f<2048)l+=2;else if(f>=55296&&f<=56319&&c+1<d){const h=a.charCodeAt(c+1);h>=56320&&h<=57343?(l+=4,c++):l+=3}else l+=3}return l}const Wd="1.18.1",xm=64*1024,{isFunction:tc}=V,jC=s=>encodeURIComponent(s).replace(/%([0-9A-F]{2})/gi,(e,n)=>String.fromCharCode(parseInt(n,16))),Tm=s=>{if(!V.isString(s))return s;try{return decodeURIComponent(s)}catch{return s}},km=(s,...e)=>{try{return!!s(...e)}catch{return!1}},HC=s=>{const e=s.indexOf("://");let n=s;return e!==-1&&(n=n.slice(e+3)),n.includes("@")||n.includes(":")},zC=s=>{const e=V.global!==void 0&&V.global!==null?V.global:globalThis,{ReadableStream:n,TextEncoder:a}=e;s=V.merge.call({skipUndefined:!0},{Request:e.Request,Response:e.Response},s);const{fetch:i,Request:l,Response:c}=s,d=i?tc(i):typeof fetch=="function",f=tc(l),h=tc(c);if(!d)return!1;const m=d&&tc(n),y=d&&(typeof a=="function"?(D=>M=>D.encode(M))(new a):async D=>new Uint8Array(await new l(D).arrayBuffer())),S=f&&m&&km(()=>{let D=!1;const M=new l(yn.origin,{body:new n,method:"POST",get duplex(){return D=!0,"half"}}),T=M.headers.has("Content-Type");return M.body!=null&&M.body.cancel(),D&&!T}),v=h&&m&&km(()=>V.isReadableStream(new c("").body)),_={stream:v&&(D=>D.body)};d&&["text","arrayBuffer","blob","formData","stream"].forEach(D=>{!_[D]&&(_[D]=(M,T)=>{let L=M&&M[D];if(L)return L.call(M);throw new Ee(`Response type '${D}' is not supported`,Ee.ERR_NOT_SUPPORT,T)})});const A=async D=>{if(D==null)return 0;if(V.isBlob(D))return D.size;if(V.isSpecCompliantForm(D))return(await new l(yn.origin,{method:"POST",body:D}).arrayBuffer()).byteLength;if(V.isArrayBufferView(D)||V.isArrayBuffer(D))return D.byteLength;if(V.isURLSearchParams(D)&&(D=D+""),V.isString(D))return(await y(D)).byteLength},x=async(D,M)=>{const T=V.toFiniteNumber(D.getContentLength());return T??A(M)};return async D=>{let{url:M,method:T,data:L,signal:q,cancelToken:P,timeout:B,onDownloadProgress:W,onUploadProgress:he,responseType:Se,headers:be,withCredentials:Ue="same-origin",fetchOptions:Ve,maxContentLength:Ge,maxBodyLength:Ct}=_m(D);const J=V.isNumber(Ge)&&Ge>-1,ue=V.isNumber(Ct)&&Ct>-1,Me=ee=>V.hasOwnProp(D,ee)?D[ee]:void 0;let te=i||fetch;Se=Se?(Se+"").toLowerCase():"text";let ge=OC([q,P&&P.toAbortSignal()],B),N=null;const k=ge&&ge.unsubscribe&&(()=>{ge.unsubscribe()});let de,fe=null;const xe=()=>new Ee("Request body larger than maxBodyLength limit",Ee.ERR_BAD_REQUEST,D,N);try{let ee;const _e=Me("auth");if(_e){const Oe=V.getSafeProp(_e,"username")||"",rt=V.getSafeProp(_e,"password")||"";ee={username:Oe,password:rt}}if(HC(M)){const Oe=new URL(M,yn.origin);if(!ee&&(Oe.username||Oe.password)){const rt=Tm(Oe.username),on=Tm(Oe.password);ee={username:rt,password:on}}(Oe.username||Oe.password)&&(Oe.username="",Oe.password="",M=Oe.href)}if(ee&&(be.delete("authorization"),be.set("Authorization","Basic "+btoa(jC((ee.username||"")+":"+(ee.password||""))))),J&&typeof M=="string"&&M.startsWith("data:")&&IC(M)>Ge)throw new Ee("maxContentLength size of "+Ge+" exceeded",Ee.ERR_BAD_RESPONSE,D,N);if(ue&&T!=="get"&&T!=="head"){const Oe=await A(L);if(typeof Oe=="number"&&isFinite(Oe)&&(de=Oe,Oe>Ct))throw xe()}const Be=ue&&(V.isReadableStream(L)||V.isStream(L)),Re=(Oe,rt,on)=>Am(Oe,xm,$t=>{if(ue&&$t>Ct)throw fe=xe();rt&&rt($t)},on);if(S&&T!=="get"&&T!=="head"&&(he||Be)){if(de=de??await x(be,L),de!==0||Be){let Oe=new l(M,{method:"POST",body:L,duplex:"half"}),rt;if(V.isFormData(L)&&(rt=Oe.headers.get("content-type"))&&be.setContentType(rt),Oe.body){const[on,$t]=he&&vm(de,Zl(Sm(he)))||[];L=Re(Oe.body,on,$t)}}}else if(Be&&!f&&m&&T!=="get"&&T!=="head")L=Re(L);else if(Be&&f&&!S&&T!=="get"&&T!=="head")throw new Ee("Stream request bodies are not supported by the current fetch implementation",Ee.ERR_NOT_SUPPORT,D,N);V.isString(Ue)||(Ue=Ue?"include":"omit");const Ie=f&&"credentials"in l.prototype;if(V.isFormData(L)){const Oe=be.getContentType();Oe&&/^multipart\/form-data/i.test(Oe)&&!/boundary=/i.test(Oe)&&be.delete("content-type")}be.set("User-Agent","axios/"+Wd,!1);const Et={...Ve,signal:ge,method:T.toUpperCase(),headers:sm(be.normalize()),body:L,duplex:"half",credentials:Ie?Ue:void 0};N=f&&new l(M,Et);let lt=await(f?te(N,Ve):te(M,Et));const Lt=xn.from(lt.headers);if(J){const Oe=V.toFiniteNumber(Lt.getContentLength());if(Oe!=null&&Oe>Ge)throw new Ee("maxContentLength size of "+Ge+" exceeded",Ee.ERR_BAD_RESPONSE,D,N)}const St=v&&(Se==="stream"||Se==="response");if(v&<.body&&(W||J||St&&k)){const Oe={};["status","statusText","headers"].forEach(cn=>{Oe[cn]=lt[cn]});const rt=V.toFiniteNumber(Lt.getContentLength()),[on,$t]=W&&vm(rt,Zl(Sm(W),!0))||[];let Vt=0;const ln=cn=>{if(J&&(Vt=cn,Vt>Ge))throw new Ee("maxContentLength size of "+Ge+" exceeded",Ee.ERR_BAD_RESPONSE,D,N);on&&on(cn)};lt=new c(Am(lt.body,xm,ln,()=>{$t&&$t(),k&&k()}),Oe)}Se=Se||"text";let At=await _[V.findKey(_,Se)||"text"](lt,D);if(J&&!v&&!St){let Oe;if(At!=null&&(typeof At.byteLength=="number"?Oe=At.byteLength:typeof At.size=="number"?Oe=At.size:typeof At=="string"&&(Oe=typeof a=="function"?new a().encode(At).byteLength:At.length)),typeof Oe=="number"&&Oe>Ge)throw new Ee("maxContentLength size of "+Ge+" exceeded",Ee.ERR_BAD_RESPONSE,D,N)}return!St&&k&&k(),await new Promise((Oe,rt)=>{bm(Oe,rt,{data:At,headers:xn.from(lt.headers),status:lt.status,statusText:lt.statusText,config:D,request:N})})}catch(ee){if(k&&k(),ge&&ge.aborted&&ge.reason instanceof Ee){const _e=ge.reason;throw _e.config=D,N&&(_e.request=N),ee!==_e&&Object.defineProperty(_e,"cause",{__proto__:null,value:ee,writable:!0,enumerable:!1,configurable:!0}),_e}if(fe)throw N&&!fe.request&&(fe.request=N),fe;if(ee instanceof Ee)throw N&&!ee.request&&(ee.request=N),ee;if(ee&&ee.name==="TypeError"&&/Load failed|fetch/i.test(ee.message)){const _e=new Ee("Network Error",Ee.ERR_NETWORK,D,N,ee&&ee.response);throw Object.defineProperty(_e,"cause",{__proto__:null,value:ee.cause||ee,writable:!0,enumerable:!1,configurable:!0}),_e}throw Ee.from(ee,ee&&ee.code,D,N,ee&&ee.response)}}},UC=new Map,Rm=s=>{let e=s&&s.env||{};const{fetch:n,Request:a,Response:i}=e,l=[a,i,n];let c=l.length,d=c,f,h,m=UC;for(;d--;)f=l[d],h=m.get(f),h===void 0&&m.set(f,h=d?new Map:zC(e)),m=h;return h};Rm();const Yd={http:aC,xhr:DC,fetch:{get:Rm}};V.forEach(Yd,(s,e)=>{if(s){try{Object.defineProperty(s,"name",{__proto__:null,value:e})}catch{}Object.defineProperty(s,"adapterName",{__proto__:null,value:e})}});const Dm=s=>`- ${s}`,PC=s=>V.isFunction(s)||s===null||s===!1;function BC(s,e){s=V.isArray(s)?s:[s];const{length:n}=s;let a,i;const l={};for(let c=0;c<n;c++){a=s[c];let d;if(i=a,!PC(a)&&(i=Yd[(d=String(a)).toLowerCase()],i===void 0))throw new Ee(`Unknown adapter '${d}'`);if(i&&(V.isFunction(i)||(i=i.get(e))))break;l[d||"#"+c]=i}if(!i){const c=Object.entries(l).map(([f,h])=>`adapter ${f} `+(h===!1?"is not supported by the environment":"is not available in the build"));let d=n?c.length>1?`since :
|
||
`+c.map(Dm).join(`
|
||
`):" "+Dm(c[0]):"as no adapter specified";throw new Ee("There is no suitable adapter to dispatch the request "+d,Ee.ERR_NOT_SUPPORT)}return i}const Om={getAdapter:BC,adapters:Yd};function Xd(s){if(s.cancelToken&&s.cancelToken.throwIfRequested(),s.signal&&s.signal.aborted)throw new vo(null,s)}function Lm(s){return Xd(s),s.headers=xn.from(s.headers),s.data=Kd.call(s,s.transformRequest),["post","put","patch"].indexOf(s.method)!==-1&&s.headers.setContentType("application/x-www-form-urlencoded",!1),Om.getAdapter(s.adapter||bo.adapter,s)(s).then(function(a){Xd(s),s.response=a;try{a.data=Kd.call(s,s.transformResponse,a)}finally{delete s.response}return a.headers=xn.from(a.headers),a},function(a){if(!ym(a)&&(Xd(s),a&&a.response)){s.response=a.response;try{a.response.data=Kd.call(s,s.transformResponse,a.response)}finally{delete s.response}a.response.headers=xn.from(a.response.headers)}return Promise.reject(a)})}const nc={};["object","boolean","number","function","string","symbol"].forEach((s,e)=>{nc[s]=function(a){return typeof a===s||"a"+(e<1?"n ":" ")+s}});const Mm={};nc.transitional=function(e,n,a){function i(l,c){return"[Axios v"+Wd+"] Transitional option '"+l+"'"+c+(a?". "+a:"")}return(l,c,d)=>{if(e===!1)throw new Ee(i(c," has been removed"+(n?" in "+n:"")),Ee.ERR_DEPRECATED);return n&&!Mm[c]&&(Mm[c]=!0,console.warn(i(c," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(l,c,d):!0}},nc.spelling=function(e){return(n,a)=>(console.warn(`${a} is likely a misspelling of ${e}`),!0)};function qC(s,e,n){if(typeof s!="object"||s===null)throw new Ee("options must be an object",Ee.ERR_BAD_OPTION_VALUE);const a=Object.keys(s);let i=a.length;for(;i-- >0;){const l=a[i],c=Object.prototype.hasOwnProperty.call(e,l)?e[l]:void 0;if(c){const d=s[l],f=d===void 0||c(d,l,s);if(f!==!0)throw new Ee("option "+l+" must be "+f,Ee.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Ee("Unknown option "+l,Ee.ERR_BAD_OPTION)}}const rc={assertOptions:qC,validators:nc},Tn=rc.validators;let Si=class{constructor(e){this.defaults=e||{},this.interceptors={request:new hm,response:new hm}}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 c=i.stack.indexOf(`
|
||
`);return c===-1?"":i.stack.slice(c+1)})();try{if(!a.stack)a.stack=l;else if(l){const c=l.indexOf(`
|
||
`),d=c===-1?-1:l.indexOf(`
|
||
`,c+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=vi(this.defaults,n);const{transitional:a,paramsSerializer:i,headers:l}=n;a!==void 0&&rc.assertOptions(a,{silentJSONParsing:Tn.transitional(Tn.boolean),forcedJSONParsing:Tn.transitional(Tn.boolean),clarifyTimeoutError:Tn.transitional(Tn.boolean),legacyInterceptorReqResOrdering:Tn.transitional(Tn.boolean),advertiseZstdAcceptEncoding:Tn.transitional(Tn.boolean),validateStatusUndefinedResolves:Tn.transitional(Tn.boolean)},!1),i!=null&&(V.isFunction(i)?n.paramsSerializer={serialize:i}:rc.assertOptions(i,{encode:Tn.function,serialize:Tn.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),rc.assertOptions(n,{baseUrl:Tn.spelling("baseURL"),withXsrfToken:Tn.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let c=l&&V.merge(l.common,l[n.method]);l&&V.forEach(["delete","get","head","post","put","patch","query","common"],_=>{delete l[_]}),n.headers=xn.concat(c,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 x=n.transitional||Gd;x&&x.legacyInterceptorReqResOrdering?d.unshift(A.fulfilled,A.rejected):d.push(A.fulfilled,A.rejected)});const h=[];this.interceptors.response.forEach(function(A){h.push(A.fulfilled,A.rejected)});let m,y=0,S;if(!f){const _=[Lm.bind(this),void 0];for(_.unshift(...d),_.push(...h),S=_.length,m=Promise.resolve(n);y<S;)m=m.then(_[y++],_[y++]);return m}S=d.length;let v=n;for(;y<S;){const _=d[y++],A=d[y++];try{v=_(v)}catch(x){A.call(this,x);break}}try{m=Lm.call(this,v)}catch(_){return Promise.reject(_)}for(y=0,S=h.length;y<S;)m=m.then(h[y++],h[y++]);return m}getUri(e){e=vi(this.defaults,e);const n=Cm(e.baseURL,e.url,e.allowAbsoluteUrls,e);return fm(n,e.params,e.paramsSerializer)}};V.forEach(["delete","get","head","options"],function(e){Si.prototype[e]=function(n,a){return this.request(vi(a||{},{method:e,url:n,data:a&&V.hasOwnProp(a,"data")?a.data:void 0}))}}),V.forEach(["post","put","patch","query"],function(e){function n(a){return function(l,c,d){return this.request(vi(d||{},{method:e,headers:a?{"Content-Type":"multipart/form-data"}:{},url:l,data:c}))}}Si.prototype[e]=n(),e!=="query"&&(Si.prototype[e+"Form"]=n(!0))});let GC=class yw{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 c=new Promise(d=>{a.subscribe(d),l=d}).then(i);return c.cancel=function(){a.unsubscribe(l)},c},e(function(l,c,d){a.reason||(a.reason=new vo(l,c,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 yw(function(i){e=i}),cancel:e}}};function FC(s){return function(n){return s.apply(null,n)}}function VC(s){return V.isObject(s)&&s.isAxiosError===!0}const Jd={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(Jd).forEach(([s,e])=>{Jd[e]=s});function $m(s){const e=new Si(s),n=Yg(Si.prototype.request,e);return V.extend(n,Si.prototype,e,{allOwnKeys:!0}),V.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return $m(vi(s,i))},n}const Xt=$m(bo);Xt.Axios=Si,Xt.CanceledError=vo,Xt.CancelToken=GC,Xt.isCancel=ym,Xt.VERSION=Wd,Xt.toFormData=Ql,Xt.AxiosError=Ee,Xt.Cancel=Xt.CanceledError,Xt.all=function(e){return Promise.all(e)},Xt.spread=FC,Xt.isAxiosError=VC,Xt.mergeConfig=vi,Xt.AxiosHeaders=xn,Xt.formToJSON=s=>mm(V.isHTMLForm(s)?new FormData(s):s),Xt.getAdapter=Om.getAdapter,Xt.HttpStatusCode=Jd,Xt.default=Xt;const{Axios:ck,AxiosError:uk,CanceledError:dk,isCancel:fk,CancelToken:hk,VERSION:pk,all:gk,Cancel:mk,isAxiosError:yk,spread:bk,toFormData:vk,AxiosHeaders:Sk,HttpStatusCode:wk,formToJSON:Ck,getAdapter:Ek,mergeConfig:_k,create:Ak}=Xt,Qd="g7.identity.redirectStash",ac=pt("IdentityGuardInterceptor");class _t{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){ac.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??WC,c=!!(a&&(a.email||a.phone))?{...e.verification,target:a}:e.verification,d=await i(c);if(d.status!=="verified")return null;const f=c.return_request;if(!f)return null;const h=KC(f.url,d.token);return fetch(h,{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 ac.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(Qd,JSON.stringify(a))}catch(i){ac.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}}$(_t,"launcher",null),$(_t,"deferredResolver",null),$(_t,"domainNoticeShown",!1);function KC(s,e){if(!e)return s;try{const n=typeof window<"u"?window.location.origin:"http://localhost",a=new URL(s,n);return a.searchParams.set("verification_token",e),/^https?:\/\//i.test(s)?a.toString():`${a.pathname}${a.search}${a.hash}`}catch{const n=s.includes("?")?"&":"?";return`${s}${n}verification_token=${encodeURIComponent(e)}`}}const WC=async s=>{if(typeof window>"u")return{status:"cancelled"};if(s.render_hint==="external_redirect"||s.redirect_url)return _t.redirectExternally(s);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:s,stashed_at:Date.now()};try{window.sessionStorage?.setItem(Qd,JSON.stringify(a))}catch{}const i=`/identity/challenge?return=${encodeURIComponent(n)}`;try{await e.dispatch({handler:"navigate",params:{path:i}})}catch(l){ac.warn("navigate 실패 — window.location 으로 폴백",l),window.location.href=i}return new Promise(()=>{})},YC=pt("ApiClient");function Zd(){return typeof window<"u"&&window.__G7_DEVTOOLS__?window.__G7_DEVTOOLS__:null}class XC{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=Xt.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 c=i.endsWith("[]")?i:`${i}[]`;for(const d of l)a.push(`${encodeURIComponent(c)}=${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&&!this.isCrossOriginRequest(e.url)&&(e.headers.Authorization=`Bearer ${n}`),typeof window<"u"&&e.headers){const i=localStorage.getItem("g7_locale");i&&(e.headers["Accept-Language"]=i)}const a=Zd();if(a?.isEnabled()){const i=this.buildFullUrl(e),l=(e.method||"GET").toUpperCase(),c=a.trackRequest(i,l,{requestBody:e.data});e._devToolsRequestId=c}return e},e=>Promise.reject(e)),this.client.interceptors.response.use(e=>{const n=e.config,a=n._devToolsRequestId;if(a){const i=Zd();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(c=>a.includes(c));if(e.response?.status===401&&!n?._retry&&!l){if(n._retry=!0,await wr.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(_t.isIdentityRequired(e.response?.status,e.response?.data)){this.completeDevToolsRequest(n,e);const c={},d=n?.headers??{};for(const[S,v]of Object.entries(d))typeof v=="string"&&(c[S]=v);let f;n?.data!==void 0&&n?.data!==null&&(f=typeof n.data=="string"?n.data:JSON.stringify(n.data),c["Content-Type"]=c["Content-Type"]??"application/json");const h=n?.identity_target,m=await _t.handle(e.response.data,{headers:c,body:f,credentials:"same-origin"},h);if(!m)return Promise.reject(e);let y=null;try{y=await m.json()}catch{y=null}return m.ok?{...e.response,status:m.status,data:y}:Promise.reject(Object.assign(new Error("replay failed"),{response:{status:m.status,data:y}}))}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=Zd();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")}isCrossOriginRequest(e){if(!e||typeof window>"u"||!window.location||!/^(https?:)?\/\//i.test(e))return!1;try{return new URL(e,window.location.href).origin!==window.location.origin}catch{return!1}}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,c]of Object.entries(a))if(c!=null)if(Array.isArray(c)){const d=l.endsWith("[]")?l:`${l}[]`;for(const f of c)i.push(`${encodeURIComponent(d)}=${encodeURIComponent(String(f))}`)}else i.push(`${encodeURIComponent(l)}=${encodeURIComponent(String(c))}`);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){YC.error("Error in onError handler:",a)}}}let ef=null;function zr(){return ef||(ef=new XC),ef}const So=pt("AuthManager");function fs(s,e,n,a){try{window.G7Core?.devTools?.trackAuthEvent?.(s,e,n,a)}catch{}}const ic={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"}},kr=class kr{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",ic.admin),this.config.set("user",ic.user)}static getInstance(){return kr.instance||(kr.instance=new kr),kr.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=zr();if(!n.getToken())return this.clearState(),!1;const i=this.config.get(e);if(!i)return So.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 So.warn(`Preload auth failed for type ${e}:`,n),!1}}async login(e,n,a){const i=zr();if(!this.config.get(e))throw new Error(`Unknown auth type: ${e}`);const c=e==="admin"?ic.admin.loginEndpoint:ic.user.loginEndpoint;try{const d=a?.headers?{headers:a.headers}:void 0,f=await i.post(c,n,d);if(f.success&&f.data){i.setToken(f.data.token);const h=f.data.user.language,m=localStorage.getItem(kr.LOCALE_STORAGE_KEY),y=h&&h!==m;if(h)try{localStorage.setItem(kr.LOCALE_STORAGE_KEY,h)}catch(S){So.warn("Failed to save user language to localStorage:",S)}return this.state={isAuthenticated:!0,user:f.data.user,type:e},this.emit("login",this.state),this.emit("authStateChange",this.state),fs("login",!0,void 0,{userId:f.data.user.uuid,email:f.data.user.email,type:e}),y&&window.__templateApp&&window.__templateApp.changeLocale(h),f.data.user}throw new Error("Login failed")}catch(d){this.clearState();const f=d.response?.data?.message,h=new Error(f||d.message||"Login failed");throw h.response=d.response,h.status=d.response?.status,fs("login",!1,h.message,{type:e,status:d.response?.status}),h}}async logout(){const e=zr(),n=this.state.type?this.config.get(this.state.type):null;try{n&&await e.post(n.logoutEndpoint)}catch(a){So.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),fs("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=zr();try{const i=await a.post(n.refreshEndpoint);return i.success&&i.data?.token?(a.setToken(i.data.token),this.emit("tokenRefreshed"),fs("token-refresh",!0,void 0,{type:e}),!0):(fs("token-refresh",!1,"No token in response",{type:e}),!1)}catch(i){return So.error("Token refresh failed:",i),fs("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 c=`${i.loginPath}?redirect=${l}`;return a&&(c+=`&reason=${encodeURIComponent(a)}`),c}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 c=decodeURIComponent(l);if(c.startsWith("/"))return c}catch{}return a}getConfig(e){return this.config.get(e)}clearState(){this.state={isAuthenticated:!1,user:null,type:null}}static resetInstance(){kr.instance=null}};$(kr,"instance"),$(kr,"LOCALE_STORAGE_KEY","g7_locale");let wr=kr;const Nm={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}}"}}},ea={findHandler(s,e){if(s){if(s[e])return s[e];if(s[String(e)])return s[String(e)];if(s.default)return s.default}},normalizeOnError(s){return s?Array.isArray(s)?s:[s]:[]},injectErrorCode(s,e,n){if(s.handler!=="showErrorPage"||s.params?.errorCode!==void 0)return s;const a=typeof e=="string"?parseInt(e,10):e,i=isNaN(a)?n:a;return i===void 0?s:{...s,params:{...s.params,errorCode:i}}}},Cr=pt("ErrorHandlingResolver"),Na=class Na{constructor(){$(this,"templateErrorHandling",null);$(this,"layoutErrorHandling",null);$(this,"executeAction",null)}static getInstance(){return Na.instance||(Na.instance=new Na),Na.instance}static resetInstance(){Na.instance=null}setTemplateConfig(e){this.templateErrorHandling=e,Cr.log("Template config set:",e)}setLayoutConfig(e){this.layoutErrorHandling=e,Cr.log("Layout config set:",e)}setActionExecutor(e){this.executeAction=e}resolve(e,n={}){const{errorHandling:a,onError:i}=n;Cr.log("Resolving error:",e,{hasActionErrorHandling:!!a,hasActionOnError:!!i,hasLayoutConfig:!!this.layoutErrorHandling,hasTemplateConfig:!!this.templateErrorHandling});let l=ea.findHandler(a,e);if(l){const c=this.getMatchedKey(a,e);return{handler:ea.injectErrorCode(l,c,e),level:"action",matchedKey:c}}if(i){const c=ea.normalizeOnError(i);if(c.length>0)return{handler:c.length===1?c[0]:{handler:"sequence",actions:c},level:"action",matchedKey:"onError"}}if(l=ea.findHandler(this.layoutErrorHandling||void 0,e),l){const c=this.getMatchedKey(this.layoutErrorHandling,e);return{handler:ea.injectErrorCode(l,c,e),level:"layout",matchedKey:c}}if(l=ea.findHandler(this.templateErrorHandling||void 0,e),l){const c=this.getMatchedKey(this.templateErrorHandling,e);return{handler:ea.injectErrorCode(l,c,e),level:"template",matchedKey:c}}if(l=ea.findHandler(Nm,e),l){const c=this.getMatchedKey(Nm,e);return{handler:ea.injectErrorCode(l,c,e),level:"system",matchedKey:c}}return{handler:null,level:null,matchedKey:null}}async execute(e,n){if(!this.executeAction){Cr.error("Action executor is not set");return}Cr.log("Executing handler:",e.handler,{errorContext:n});try{return await this.executeAction(e,{error:n})}catch(a){throw Cr.error("Failed to execute handler:",a),a}}async resolveAndExecute(e,n,a={}){const i=this.resolve(e,a);if(Cr.log("Resolve result:",{errorCode:e,handler:i.handler?.handler,level:i.level,matchedKey:i.matchedKey}),!i.handler)return Cr.warn("No handler found for error:",e),{handled:!1};try{return{handled:!0,result:await this.execute(i.handler,n)}}catch(l){return Cr.error("Handler execution failed:",l),{handled:!1}}}getMatchedKey(e,n){return e[n]?n:e[String(n)]?String(n):"default"}clearLayoutConfig(){this.layoutErrorHandling=null,Cr.log("Layout config cleared")}clearAllConfig(){this.templateErrorHandling=null,this.layoutErrorHandling=null,Cr.log("All config cleared")}getConfigStatus(){return{hasTemplate:this.templateErrorHandling!==null,hasLayout:this.layoutErrorHandling!==null,hasExecutor:this.executeAction!==null}}};$(Na,"instance",null);let tf=Na;function Er(){return tf.getInstance()}var nf={exports:{}},wo={};var Im;function JC(){if(Im)return wo;Im=1;var s=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(a,i,l){var c=null;if(l!==void 0&&(c=""+l),i.key!==void 0&&(c=""+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:s,type:a,key:c,ref:i!==void 0?i:null,props:l}}return wo.Fragment=e,wo.jsx=n,wo.jsxs=n,wo}var jm;function QC(){return jm||(jm=1,nf.exports=JC()),nf.exports}var gt=QC();const ZC=Qr({__proto__:null,default:Zr(gt)},[gt]),rf=pt("ParentContextProvider"),Hm=j.createContext(null);let sc=null;function af(){sc?(rf.log("[triggerModalParentUpdate] 모달 부모 컨텍스트 업데이트 트리거"),sc()):rf.warn("[triggerModalParentUpdate] Provider가 아직 마운트되지 않음")}const zm=({children:s})=>{const[e,n]=j.useState(0),a=j.useRef(!0),i=j.useCallback(()=>{const c=window.__g7LayoutContextStack||[];return c[c.length-1]?.dataContext},[]);j.useEffect(()=>(a.current=!0,sc=()=>{a.current&&(n(c=>c+1),rf.log("[ParentContextProvider] 버전 업데이트됨"))},()=>{a.current=!1,sc=null}),[]);const l={version:e,getParentDataContext:i};return gt.jsx(Hm.Provider,{value:l,children:s})};function eE(){return j.useContext(Hm)}const H=pt("ActionDispatcher");function tE(s,e,n,a){return n||(vg(s)||md(s)?"$t:core.errors.network_request_failed":a||`Failed to execute action: ${e}`)}const Um=new Set(["navigate","navigateBack","navigateForward","replaceUrl","refresh","logout"]),nE=new Set(["redirect"]);function Kn(){try{return window.G7Core?.devTools}catch{return}}class qt 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 Pm={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"},ws=class ws{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=Kn();n?.isEnabled?.()&&n.setNamedActionDefinitions?.(this.namedActions),H.log("[setNamedActions] registered:",Object.keys(this.namedActions))}getNamedActions(){return this.namedActions}setPreviewMode(e){this.previewMode=e,H.log("Preview mode:",e?"enabled":"disabled")}isPreviewMode(){return this.previewMode}static getPreviewSuppressedHandlers(){return Um}static getPreviewSuppressedLayoutFeatures(){return nE}resolveActionRef(e){if(!e.actionRef)return e;const n=this.namedActions[e.actionRef];if(!n)return H.warn(`[resolveActionRef] named action not found: "${e.actionRef}"`),e;const a=Kn();a?.isEnabled?.()&&a.trackNamedActionRef?.({actionRefName:e.actionRef,resolvedHandler:n.handler,timestamp:Date.now()});const{actionRef:i,type:l,key:c,event:d,...f}=e,h={...n,...Object.fromEntries(Object.entries(f).filter(([,m])=>m!==void 0)),type:l??n.type};return c!==void 0&&(h.key=c),d!==void 0&&(h.event=d),h}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,c])=>{const d=ss(c,n,{skipCache:!0});d!=null&&d!==""&&(a[l]=String(d))});return a}setupErrorHandling(){if(this.errorHandlingSetup)return;Er().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){H.warn("refetchDataSource: dataSourceId is required");return}if(typeof window<"u"&&window.G7Core?.dataSource?.refetch){const c=window.G7Core?.state?.get?.()||{},d={...a.state?._global,...c},f=window.G7Core?.state?.getLocal?.()||{},h=a.data?._local||a.state||{},m={...f,...h},y=a.isolatedContext?.state;H.log("[refetchDataSource] localStateOverride:",m),await window.G7Core.dataSource.refetch(i,{...l?{sync:!0}:{},...d?{globalStateOverride:d}:{},...m?{localStateOverride:m}:{},...y?{isolatedStateOverride:y}:{}})}else H.warn("refetchDataSource: G7Core.dataSource.refetch is not available")}),this.registerHandler("appendDataSource",async(n,a)=>{const{dataSourceId:i,dataPath:l,newData:c}=n.params||{};if(!i){H.warn("appendDataSource: dataSourceId is required");return}if(c===void 0){H.warn("appendDataSource: newData is required");return}if(typeof window<"u"&&window.G7Core?.dataSource?.updateData){if(!Array.isArray(c)){H.warn("appendDataSource: newData must be an array, got:",typeof c,c);return}await window.G7Core.dataSource.updateData(i,l||null,c,"append")}else H.warn("appendDataSource: G7Core.dataSource.updateData is not available")}),this.registerHandler("updateDataSource",async(n,a)=>{const{dataSourceId:i,data:l,merge:c=!1}=n.params||{};if(!i){H.warn("updateDataSource: dataSourceId is required");return}if(l===void 0){H.warn("updateDataSource: data is required");return}typeof window<"u"&&window.G7Core?.dataSource?.set?(H.log(`[updateDataSource] Updating dataSource '${i}' with:`,l),window.G7Core.dataSource.set(i,l,{merge:c})):H.warn("updateDataSource: G7Core.dataSource.set is not available")}),this.registerHandler("scrollIntoView",async(n,a)=>{const{selector:i,behavior:l="smooth",block:c="nearest",inline:d="nearest",waitForElement:f=!1,timeout:h=2e3,delay:m=0,retryCount:y=0,retryInterval:S=50,scrollContainer:v}=n.params||{};if(!i){H.warn("scrollIntoView: selector is required");return}if(typeof window>"u"||typeof document>"u"){H.warn("scrollIntoView: window/document is not available");return}let _=null;if(f){if(_=await new Promise(A=>{const x=document.querySelector(i);if(x){A(x);return}const D=setTimeout(()=>{M.disconnect(),A(null)},h),M=new MutationObserver(()=>{const T=document.querySelector(i);T&&(clearTimeout(D),M.disconnect(),A(T))});M.observe(document.body,{childList:!0,subtree:!0})}),!_){H.warn(`scrollIntoView: element not found for selector "${i}" after ${h}ms timeout`);return}}else{m>0&&await new Promise(x=>setTimeout(x,m)),_=document.querySelector(i);let A=0;for(;!_&&A<y;)await new Promise(x=>setTimeout(x,S)),_=document.querySelector(i),A++;if(!_){H.warn(`scrollIntoView: element not found for selector "${i}" after ${A+1} attempts`);return}}if(v){const A=document.querySelector(v);if(!A){H.warn(`scrollIntoView: container not found for selector "${v}"`);return}const x=_.getBoundingClientRect(),D=A.getBoundingClientRect(),M=x.top-D.top+A.scrollTop,T=M+x.height;let L;switch(c){case"start":L=M;break;case"center":L=M-A.clientHeight/2+x.height/2;break;case"end":L=T-A.clientHeight;break;default:const q=x.top<D.top,P=x.bottom>D.bottom;if(q)L=M;else if(P)L=T-A.clientHeight;else return;break}A.scrollTo({top:Math.max(0,L),behavior:l});return}_.scrollIntoView({behavior:l,block:c,inline:d})}),this.registerHandler("reloadExtensions",async(n,a)=>{if(typeof window>"u"){H.warn("reloadExtensions: window is not available");return}const i=window.__templateApp;if(!i){H.warn("reloadExtensions: TemplateApp not initialized");return}if(typeof i.reloadExtensionState=="function")try{await i.reloadExtensionState()}catch(d){throw H.error("reloadExtensions: reloadExtensionState failed",d),d}else H.warn("reloadExtensions: TemplateApp.reloadExtensionState unavailable");const{moduleInfo:l,pluginInfo:c}=n.params||{};if(l)try{await this.executeAction({handler:"reloadModuleHandlers",params:n.params},a)}catch(d){H.error("reloadExtensions: reloadModuleHandlers failed",d)}if(c)try{await this.executeAction({handler:"reloadPluginHandlers",params:n.params},a)}catch(d){H.error("reloadExtensions: reloadPluginHandlers failed",d)}H.log("reloadExtensions: done")}),this.registerHandler("reloadRoutes",async(n,a)=>{if(typeof window>"u"){H.warn("reloadRoutes: window is not available");return}const i=window.__templateApp;if(!i){H.warn("reloadRoutes: TemplateApp not initialized");return}if(typeof i.reloadExtensionState=="function")try{await i.reloadExtensionState(),H.log("reloadRoutes: delegated to reloadExtensionState")}catch(l){throw H.error("reloadRoutes: Failed to reload routes",l),l}else{const l=i.getRouter?.();l&&(await l.loadRoutes(),H.log("reloadRoutes: Routes reloaded (legacy fallback)"))}}),this.registerHandler("refresh",async(n,a)=>{if(typeof window>"u"){H.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){H.warn("remount: componentId parameter is required");return}if(!this.globalStateUpdater){H.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}}),H.log(`remount: ${i} key incremented to ${f+1}`)}),this.registerHandler("reloadTranslations",async(n,a)=>{if(typeof window>"u"){H.warn("reloadTranslations: window is not available");return}const i=window.__templateApp;if(!i){H.warn("reloadTranslations: TemplateApp not initialized");return}if(typeof i.reloadExtensionState=="function")try{await i.reloadExtensionState(),H.log("reloadTranslations: delegated to reloadExtensionState")}catch(l){throw H.error("reloadTranslations: Failed to reload translations",l),l}}),this.registerHandler("reloadModuleHandlers",async(n,a)=>{if(typeof window>"u"){H.warn("reloadModuleHandlers: window is not available");return}const{moduleInfo:i,action:l}=n.params||{};if(!i){H.warn("reloadModuleHandlers: moduleInfo is required");return}const c=i.data||i;if(!c.identifier){H.warn("reloadModuleHandlers: moduleInfo with identifier is required");return}if(!l||l!=="add"&&l!=="remove"){H.warn('reloadModuleHandlers: action must be "add" or "remove"');return}const d=window.G7Config;if(!d){H.warn("reloadModuleHandlers: G7Config not available");return}const f=c.identifier;try{if(l==="add"){if(c.assets&&(d.moduleAssets=d.moduleAssets||{},d.moduleAssets[f]=c.assets,H.log(`reloadModuleHandlers: Added assets for ${f}`),c.assets.js)){const h=c.assets.js,m=`module-${f}`;if(document.getElementById(m)){H.warn(`reloadModuleHandlers: Script ${m} already loaded`);return}const y=document.createElement("script");if(y.id=m,y.src=h,y.async=!0,await new Promise((S,v)=>{y.onload=()=>{H.log(`reloadModuleHandlers: Script loaded successfully for ${f}`),S()},y.onerror=()=>{H.error(`reloadModuleHandlers: Failed to load script for ${f}`),v(new Error(`Failed to load module script: ${h}`))},document.head.appendChild(y)}),c.assets.css){const S=c.assets.css,v=`module-css-${f}`;if(!document.getElementById(v)){const _=document.createElement("link");_.id=v,_.rel="stylesheet",_.href=S,document.head.appendChild(_),H.log(`reloadModuleHandlers: CSS loaded for ${f}`)}}}}else if(l==="remove"){d.moduleAssets&&d.moduleAssets[f]&&(delete d.moduleAssets[f],H.log(`reloadModuleHandlers: Removed assets for ${f}`));const h=`module-${f}`,m=document.getElementById(h);m&&(m.remove(),H.log(`reloadModuleHandlers: Removed script for ${f}`));const y=`module-css-${f}`,S=document.getElementById(y);S&&(S.remove(),H.log(`reloadModuleHandlers: Removed CSS for ${f}`))}}catch(h){throw H.error(`reloadModuleHandlers: Failed to ${l} module assets`,h),h}}),this.registerHandler("reloadPluginHandlers",async(n,a)=>{if(typeof window>"u"){H.warn("reloadPluginHandlers: window is not available");return}const{pluginInfo:i,action:l}=n.params||{};if(!i){H.warn("reloadPluginHandlers: pluginInfo is required");return}const c=i.data||i;if(!c.identifier){H.warn("reloadPluginHandlers: pluginInfo with identifier is required");return}if(!l||l!=="add"&&l!=="remove"){H.warn('reloadPluginHandlers: action must be "add" or "remove"');return}const d=window.G7Config;if(!d){H.warn("reloadPluginHandlers: G7Config not available");return}const f=c.identifier;try{if(l==="add"){if(c.assets&&(d.pluginAssets=d.pluginAssets||{},d.pluginAssets[f]=c.assets,H.log(`reloadPluginHandlers: Added assets for ${f}`),c.assets.js)){const h=c.assets.js,m=`plugin-${f}`;if(document.getElementById(m)){H.warn(`reloadPluginHandlers: Script ${m} already loaded`);return}const y=document.createElement("script");if(y.id=m,y.src=h,y.async=!0,await new Promise((S,v)=>{y.onload=()=>{H.log(`reloadPluginHandlers: Script loaded successfully for ${f}`),S()},y.onerror=()=>{H.error(`reloadPluginHandlers: Failed to load script for ${f}`),v(new Error(`Failed to load plugin script: ${h}`))},document.head.appendChild(y)}),c.assets.css){const S=c.assets.css,v=`plugin-css-${f}`;if(!document.getElementById(v)){const _=document.createElement("link");_.id=v,_.rel="stylesheet",_.href=S,document.head.appendChild(_),H.log(`reloadPluginHandlers: CSS loaded for ${f}`)}}}}else if(l==="remove"){d.pluginAssets&&d.pluginAssets[f]&&(delete d.pluginAssets[f],H.log(`reloadPluginHandlers: Removed assets for ${f}`));const h=`plugin-${f}`,m=document.getElementById(h);m&&(m.remove(),H.log(`reloadPluginHandlers: Removed script for ${f}`));const y=`plugin-css-${f}`,S=document.getElementById(y);S&&(S.remove(),H.log(`reloadPluginHandlers: Removed CSS for ${f}`))}}catch(h){throw H.error(`reloadPluginHandlers: Failed to ${l} plugin assets`,h),h}});let e=!1;this.registerHandler("showErrorPage",async(n,a)=>{if(e){H.log("showErrorPage: Already active, skipping duplicate call");return}if(e=!0,typeof window>"u"){e=!1,H.warn("showErrorPage: window is not available");return}const i=window.__templateApp;if(!i){e=!1,H.warn("showErrorPage: TemplateApp not initialized");return}const l=i.getErrorPageHandler?.();if(!l){e=!1,H.warn("showErrorPage: ErrorPageHandler not available");return}const c=n.params?.errorCode||500,d=n.params?.target||"content";let f=n.params?.containerId;f||(f=d==="full"?"app":"main_content"),H.log("showErrorPage:",{errorCode:c,target:d,containerId:f});const h=(m,y=6e4)=>new Promise((S,v)=>{const _=document.getElementById(m);if(_){S(_);return}H.log(`showErrorPage: Waiting for container #${m}...`);let A;const x=new MutationObserver((D,M)=>{const T=document.getElementById(m);T&&(H.log(`showErrorPage: Container #${m} found`),M.disconnect(),clearTimeout(A),S(T))});x.observe(document.body,{childList:!0,subtree:!0}),A=setTimeout(()=>{x.disconnect(),v(new Error(`Container #${m} not found within ${y}ms`))},y)});try{await h(f);const m=Er(),y=m.layoutErrorHandling;m.clearLayoutConfig();try{await l.renderError(c,f)||H.warn(`showErrorPage: Failed to render error page for code ${c}`)}finally{m.setLayoutConfig(y)}}catch(m){throw H.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){H.warn("emitEvent: event parameter is required");return}if(typeof window>"u"){H.warn("emitEvent: window is not available");return}const c=window.G7Core;if(!c?.componentEvent?.emit){H.warn("emitEvent: G7Core.componentEvent is not available");return}try{H.log(`emitEvent: Emitting "${i}"`,l);const d={...l,_context:{data:a.data,state:a.state}},f=await c.componentEvent.emit(i,d);if(!f||f.length===0?H.warn(`emitEvent: No listeners found for "${i}"`):H.log(`emitEvent: Event "${i}" completed with ${f.length} listener(s)`,f),this.globalStateUpdater){const h=(c?.state?.get()||{})._local||{},m={event:i,success:!0,data:f.length===1?f[0]:f,listeners:f.length};this.globalStateUpdater({_local:{...h,_eventResult:m}});const y=a.state&&typeof a.state=="object"&&!Array.isArray(a.state)?a.state:h;window.__g7SequenceLocalSync={...y,_eventResult:m}}}catch(d){if(H.error(`emitEvent: Event "${i}" failed`,d),this.globalStateUpdater){const f=c?.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:c}=n.params||{};if(!i||!l){H.warn("updateProductField: productId and field are required");return}if(typeof window>"u"){H.warn("updateProductField: window is not available");return}const d=window.G7Core;if(!d?.state?.get||!this.globalStateUpdater){H.warn("updateProductField: G7Core.state or globalStateUpdater is not available");return}try{const f=d.state.get()||{},m=(f.products?.data?.data||[]).map(S=>S.id===i?{...S,[l]:c,_modified:!0}:S),y=new Set(f._local?.modifiedProductIds||[]);y.add(i),this.globalStateUpdater({products:{...f.products,data:{...f.products?.data,data:m}},_local:{...f._local,modifiedProductIds:Array.from(y)}}),H.log(`updateProductField: Updated product ${i}, field: ${l}, value:`,c)}catch(f){throw H.error("updateProductField: Error updating product field",f),f}}),this.registerHandler("updateOptionField",async(n,a)=>{const{productId:i,optionId:l,field:c,value:d}=n.params||{};if(!i||!l||!c){H.warn("updateOptionField: productId, optionId and field are required");return}if(typeof window>"u"){H.warn("updateOptionField: window is not available");return}const f=window.G7Core;if(!f?.state?.get||!this.globalStateUpdater){H.warn("updateOptionField: G7Core.state or globalStateUpdater is not available");return}try{const h=f.state.get()||{},y=(h.products?.data?.data||[]).map(v=>{if(v.id===i&&v.options){const _=v.options.map(A=>A.id===l?{...A,[c]:d,_modified:!0}:A);return{...v,options:_,_modified:!0}}return v}),S=new Set(h._local?.modifiedProductIds||[]);S.add(i),this.globalStateUpdater({products:{...h.products,data:{...h.products?.data,data:y}},_local:{...h._local,modifiedProductIds:Array.from(S)}}),H.log(`updateOptionField: Updated product ${i} option ${l}, field: ${c}, value:`,d)}catch(h){throw H.error("updateOptionField: Error updating option field",h),h}}),this.registerHandler("setLocale",async(n,a)=>{const i=n.target;if(!i||typeof i!="string"){H.warn("setLocale: Invalid locale:",i);return}const l=window.__templateApp;if(l&&typeof l.changeLocale=="function")try{await l.changeLocale(i),H.log("setLocale: Locale changed to",i)}catch(c){H.error("setLocale: Failed to change locale:",c),window.location.reload()}else{H.warn("setLocale: TemplateApp not found, falling back to page reload");try{localStorage.setItem("g7_locale",i)}catch{}window.location.reload()}}),this.registerHandler("suppress",async()=>{H.log("suppress: Error intentionally suppressed")}),this.registerBuiltInHandlerMetadata()}registerBuiltInHandlerMetadata(){const e=Kn();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){H.log("createHandler called for:",e.handler,e.type);const i=window.__g7DevTools,l=Date.now(),c=a?.state?{...a.state}:null,d=`handler_${e.handler}_${l}`;return async f=>{if(H.log("Handler invoked for:",e.handler,"event:",f.type),i?.isEnabled?.()&&c){const m=window.G7Core?.state?.getLocal?.()??a?.state??{},y=Date.now()-l;for(const S of Object.keys(c)){const v=c[S],_=m[S];v!==_&&y>100&&(i.trackStaleClosureWarning?.({type:"event-handler-stale",location:`createHandler(${e.handler})`,capturedPath:`_local.${S}`,capturedValue:v,capturedAt:l,currentValue:_,actionId:d,stackTrace:new Error().stack}),H.warn(`[Stale Closure] _local.${S} changed after handler creation:`,`captured="${v}" → current="${_}" (${y}ms ago)`))}}try{f.type!=="change"&&f.preventDefault();let h={};if(f.type==="submit"&&f.target instanceof HTMLFormElement){const S=f.target;new FormData(S).forEach((_,A)=>{h[A]=_})}const m={...this.defaultContext,data:{...n,form:h,_local:a?.state||{},$event:f},event:f,...a&&{state:a.state,setState:a.setState},isolatedContext:a?.isolatedContext};if(e.confirm){let S=this.resolveValue(e.confirm,m.data);if(this.translationEngine&&this.translationContext&&S.startsWith("$t:")&&(S=this.translationEngine.resolveTranslations(S,this.translationContext,m.data)),!confirm(S))return}const y=window.__g7ActionContext;window.__g7ActionContext={...a,data:m.data};try{await this.executeAction(e,m)}finally{window.__g7ActionContext=y}}catch(h){if(H.error("Action execution failed:",h),e.onError){const m=h instanceof qt&&h.originalError?h.originalError:h,y={...this.defaultContext,data:{...n,error:m,_local:a?.state||{},$event:f},event:f,...a&&{state:a.state,setState:a.setState}},S=Array.isArray(e.onError)?e.onError:[e.onError];for(const v of S)await this.executeAction(v,y)}}}}generateActionId(e,n){const a=e.handler,i=n||"no-target",l=Date.now(),c=Math.random().toString(36).substring(2,9);return`${a}_${i.replace(/[^a-zA-Z0-9]/g,"_")}_${l}_${c}`}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=Kn(),i=a?.isEnabled()?`action_${Date.now()}_${Math.random().toString(36).substring(2,11)}`:void 0,l=performance.now();let c;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),h=f===!0||f==="true"||f&&f!=="false"&&f!=="0"&&f!==!1;if(H.log("[executeAction] if condition result:",e.handler,h),!h)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 H.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&&(c=this.sanitizeForDevTools(f));const h=e.target?this.resolveValue(e.target,n.data):void 0;if(e.handler==="apiCall"&&n.setState){d=this.generateActionId(e,h);const y=n.state?.loadingActions||{};n.setState({loadingActions:{...y,[d]:!0}})}if(this.previewMode&&Um.has(e.handler))return H.warn(`Preview mode: "${e.handler}" suppressed`,h||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 y=f.path||h;m=await this.handleNavigate(y,f,n);break;case"navigateBack":m=await this.handleNavigateBack();break;case"navigateForward":m=await this.handleNavigateForward();break;case"openWindow":{const _=f.path||h;m=await this.handleOpenWindow(_,f);break}case"replaceUrl":{const _=f.path||h||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 x=_.state.get();A._global=x}n.state&&(A._local=n.state),a.registerStateCaptureForHandler?.(i,["_global","_local"],A)}const S=e.auth_mode??(e.auth_required?"required":"none"),v=e.identity_target?this.resolveParams(e.identity_target,n.data):void 0;m=await this.handleApiCall(h,f,n,S,v);break;case"login":m=await this.handleLogin(h,f,n);break;case"logout":m=await this.handleLogout(h,n);break;case"setState":H.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(h,f,n);break;case"openModal":m=await this.handleOpenModal(h,n);break;case"closeModal":m=await this.handleCloseModal(n);break;case"showAlert":m=await this.handleShowAlert(h,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:h,params:f},n);break}if(e.resultTo&&m!==void 0){const{target:y,key:S,merge:v}=e.resultTo,_=this.resolveValue(S,n.data),A=v==="replace"?"replace":v==="shallow"?"shallow":"deep";if(y==="_local"&&n.setState){const x=this.buildNestedUpdate(_,m),D=A!=="deep"?{...x,__mergeMode:A}:x;n.setState(D),H.log(`[resultTo] Saved to _local.${_} (merge=${A}):`,m)}else if(y==="_local"&&this.globalStateUpdater){const M=(window.G7Core?.state?.get()||{})._local||{},T=this.buildNestedUpdate(_,m);let L;A==="replace"?L=T:A==="shallow"?L={...M,...T}:L=this.deepMergeWithState(T,M),this.globalStateUpdater({_local:L}),H.log(`[resultTo] Saved to _local.${_} via globalStateUpdater (merge=${A}):`,m)}else if(y==="_global"&&this.globalStateUpdater){const x=this.buildNestedUpdate(_,m);this.globalStateUpdater(x),H.log(`[resultTo] Saved to _global.${_}:`,m)}else if(y==="_isolated"&&n.isolatedContext){const x=this.buildNestedUpdate(_,m);n.isolatedContext.mergeState(x,A),H.log(`[resultTo] Saved to _isolated.${_} (merge=${A}):`,m)}else H.warn(`[resultTo] Cannot save result: target=${y}, setState=${!!n.setState}, globalStateUpdater=${!!this.globalStateUpdater}, isolatedContext=${!!n.isolatedContext}`)}if(e.onSuccess){if(a?.isEnabled()&&i&&e.handler==="apiCall"){const v=window.G7Core,_={};v?.state?.get&&(_._global=v.state.get()),n.state&&(_._local=n.state),a.detectStaleClosure?.(i,`${e.handler} → onSuccess`,_,"callback-state-capture",i)}const y={...n,data:{...n.data,result:m,response:m}},S=Array.isArray(e.onSuccess)?e.onSuccess:[e.onSuccess];S.length>1?await this.handleSequence({handler:"sequence",type:"click",actions:S},y):S.length===1&&await this.executeAction(S[0],y)}return i&&a&&a.logAction({id:i,type:e.handler,params:this.sanitizeForDevTools(e.params),resolvedParams:c,startTime:l,endTime:performance.now(),duration:performance.now()-l,status:"success",result:this.sanitizeForDevTools(m)}),{success:!0,data:m}}catch(f){const h=f instanceof qt?f:new qt(`Failed to execute action: ${e.handler}`,e,f instanceof Error?f:void 0),m=h.originalError?.response||{},y=m.data||{},S=h.originalError?.status||m.status||500;let v=tE(h.originalError??f,e.handler,y.message,h.message);this.translationEngine&&this.translationContext&&v.startsWith("$t:")&&(v=this.translationEngine.resolveTranslations(v,this.translationContext));const _={status:S,message:v,errors:y.errors||m.errors,data:y,statusText:h.originalError?.statusText,error_code:y.error_code??m.error_code};if(h.unknownHandler)throw H.warn(`Unknown action handler "${e.handler}" — skipped (extension not loaded?). Not surfaced to the user.`),h;const x=Er().resolve(S,{errorHandling:e.errorHandling,onError:e.onError});if(x.handler){if(a?.isEnabled()&&i&&e.handler==="apiCall"){const M=window.G7Core,T={};M?.state?.get&&(T._global=M.state.get()),n.state&&(T._local=n.state),a.detectStaleClosure?.(i,`${e.handler} → onError`,T,"callback-state-capture",i)}const D={...n,data:{...n.data,error:_}};try{const M={type:"click",handler:x.handler.handler,target:x.handler.target,params:x.handler.params,actions:x.handler.actions};return await this.executeAction(M,D),{success:!1,error:h}}catch(M){return H.error("Error executing error handler:",M),{success:!1,error:h}}}throw i&&a&&a.logAction({id:i,type:e.handler,params:this.sanitizeForDevTools(e.params),resolvedParams:c,startTime:l,endTime:performance.now(),duration:performance.now()-l,status:"error",error:{name:h.name,message:h.message,stack:h.stack}}),h}finally{if(e.handler==="apiCall"&&n.setState&&d){const f=n.state?.loadingActions||{},{[d]:h,...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 c=new URLSearchParams;for(const[f,h]of Object.entries(n.query))if(h!=null&&h!=="")if(Array.isArray(h)){const m=f.endsWith("[]")?f:`${f}[]`;for(const y of h)y!=null&&y!==""&&c.append(m,String(y))}else c.set(f,String(h));const d=c.toString();d&&(i=`${e}?${d}`)}if(H.log("handleNavigate:",{target:e,params:n,finalPath:i,replace:n.replace,windowLocationSearch:window.location.search}),n.replace===!0){const c=window.G7Core;if(c?.updateQueryParams){const d=typeof n.transition_overlay_target=="string"?n.transition_overlay_target:void 0;await c.updateQueryParams(i,d?{transitionOverlayTarget:d}:void 0),H.log("handleNavigate: Used updateQueryParams for replace mode",d?{transitionOverlayTarget:d}:void 0),this.applyScrollOption(n.scroll,n.scrollBehavior,"top");return}H.warn("handleNavigate: G7Core.updateQueryParams not available, falling back to React Router")}const l=this.resolveNavigateFallbackAction(i,n);if(l){H.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 qt("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 c=e.split("?")[0];return l.match(c)?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||{}}}:(H.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",c=y=>{if(typeof y!="object"||y===null)return!1;const S=y;return"container"in S||"to"in S||"block"in S||"offset"in S},d=(y,S,v=0)=>{y===window?window.scrollTo({top:S,left:v,behavior:l}):y.scrollTo({top:S,left:v,behavior:l})},f=(y,S,v,_)=>{if(S===window){y.scrollIntoView({behavior:l,block:v}),_&&window.scrollBy({top:-_,left:0,behavior:l});return}const A=S,x=y.getBoundingClientRect(),D=A.getBoundingClientRect(),M=A.scrollTop+(x.top-D.top);let T;v==="center"?T=M-(A.clientHeight-y.clientHeight)/2:v==="end"?T=M-(A.clientHeight-y.clientHeight):T=M,T-=_,A.scrollTo({top:Math.max(0,T),left:0,behavior:l})},h=()=>{window.scrollTo({top:0,left:0,behavior:l});const y=document.getElementById("app")??document.body;if(!y)return;y.querySelectorAll("*").forEach(v=>{if(v.scrollTop===0&&v.scrollLeft===0)return;const _=window.getComputedStyle(v),A=_.overflowY,x=_.overflowX;(A==="auto"||A==="scroll"||x==="auto"||x==="scroll")&&v.scrollTo({top:0,left:0,behavior:l})})},m=()=>{try{if(c(i)){const y=i,S=y.block??"start",v=typeof y.offset=="number"?y.offset:0;let _=window;if(typeof y.container=="string"&&y.container.length>0){const x=document.querySelector(y.container);if(!x){H.warn(`applyScrollOption: container not found: ${y.container}`);return}_=x}const A=y.to??"top";if(A==="top"){_===window?h():d(_,0);return}if(typeof A=="number"){d(_,A-v);return}if(typeof A=="object"&&A!==null&&("x"in A||"y"in A)){const{x=0,y:D=0}=A;d(_,D-v,x);return}if(typeof A=="string"&&(A.startsWith("#")||A.startsWith("."))){const x=document.querySelector(A);x?f(x,_,S,v):H.warn(`applyScrollOption: target element not found: ${A}`);return}H.warn('applyScrollOption: invalid "to" value in extended form',A);return}if(i==="top"){h();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:y=0,y:S=0}=i;window.scrollTo({top:S,left:y,behavior:l});return}if(typeof i=="string"&&(i.startsWith("#")||i.startsWith("."))){const y=document.querySelector(i);y&&y.scrollIntoView({behavior:l,block:"start"});return}}catch(y){H.warn("applyScrollOption: failed to apply scroll",y)}};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 c=l.toString();c&&(a=`${e}?${c}`)}const i=n.target==="_self"?"_self":"_blank";H.log("handleOpenWindow:",{target:e,params:n,finalPath:a,windowTarget:i}),i==="_self"?window.location.assign(a):window.open(a,"_blank")}async handleNavigateBack(){H.log("handleNavigateBack"),window.history.back()}async handleNavigateForward(){H.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[c,d]of Object.entries(n.query))if(d!=null&&d!=="")if(Array.isArray(d)){const f=c.endsWith("[]")?c:`${c}[]`;for(const h of d)h!=null&&h!==""&&i.append(f,String(h))}else i.set(c,String(d));const l=i.toString();l&&(a=`${e}?${l}`)}H.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[c,d]of Object.entries(n))if(d==null||d==="")a.delete(c);else if(Array.isArray(d)){const f=c.endsWith("[]")?c:`${c}[]`;a.delete(c),a.delete(f);for(const h of d)h!=null&&h!==""&&a.append(f,String(h))}else a.set(c,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 qt("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 _t.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){H.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){H.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 _t.resolveDeferred(a),!0}async handleApiCall(e,n,a,i="none",l){const{method:c="GET",body:d,headers:f,contentType:h}=n;c!=="GET"&&c!=="HEAD"&&await this.ensureCsrfToken();const m=this.getCsrfTokenFromCookie();let y={};if(i==="required"||i==="optional"){const W=zr().getToken();W&&(y={Authorization:`Bearer ${W}`})}let S=e;const v=n.query||(c==="GET"?d:null);if(v&&typeof v=="object"){const B=this.buildQueryString(v);if(B){const W=e.includes("?")?"&":"?";S=`${e}${W}${B}`}}const _=window.G7Core?.state?.getGlobal?.()||a.state?._global||{},A=window.G7Core?.state?.getLocal?.()||a.state?._local||{},x={_global:_,_local:A},D=this.getMatchingGlobalHeaders(e,x),M={};if(typeof window<"u"){const B=localStorage.getItem("g7_locale");B&&(M["Accept-Language"]=B)}const T=h==="multipart/form-data",L={method:c,headers:{...T?{}:{"Content-Type":"application/json"},Accept:"application/json",...M,...m&&{"X-XSRF-TOKEN":m},...y,...D,...f},credentials:"include"};if(d&&c!=="GET")if(T){const B=new FormData;for(const[W,he]of Object.entries(d))he instanceof File||he instanceof Blob?B.append(W,he):he!=null&&B.append(W,typeof he=="object"?JSON.stringify(he):String(he));L.body=B}else L.body=JSON.stringify(d);const q=Kn();let P=null;q?.isEnabled()&&(P=q.trackRequest(S,c));try{let B=await fetch(S,L),W;try{W=await B.json()}catch{W=null}if(_t.isIdentityRequired(B.status,W)){const he=await _t.handle(W,{body:L.body,headers:L.headers,credentials:L.credentials},l);if(he){B=he;try{W=await B.json()}catch{W=null}}}if(P&&q?.isEnabled()&&(q.completeRequest(P,B.status,W),P=null),!B.ok){const he=W||{},Se=new Error(he.message||`API call failed: ${B.statusText}`);throw Se.response=he,Se.status=B.status,Se.statusText=B.statusText,new qt(he.message||`API call failed: ${B.statusText}`,void 0,Se)}return W}catch(B){throw P&&q?.isEnabled()&&q.failRequest(P,B instanceof Error?B.message:String(B)),B}}async handleLogin(e,n,a){const{body:i}=n;if(!i||!i.email||!i.password)throw new qt("Login requires email and password in body params");const l=e==="user"?"user":"admin",c=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||{},h={_global:d,_local:f},m=this.getMatchingGlobalHeaders(c,h),y=wr.getInstance();try{const S=Object.keys(m).length>0?{headers:m}:void 0;return{user:await y.login(l,{email:i.email,password:i.password},S)}}catch(S){const v=S.message||"Login failed",_=new Error(v);throw _.response=S.response?.data||{},_.status=S.status||S.response?.status||500,new qt(v,void 0,_)}}async handleLogout(e,n){await wr.getInstance().logout()}async handleSetState(e,n){H.log("[handleSetState] START, params:",e);const{target:a="component",scope:i,merge:l,__render:c,...d}=e,f=Kn(),h=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:h?.state?.get()||{},y=a==="global"?"_global":a.startsWith("_local.")?a:"_local",S=y==="_global"?m._global:y.startsWith("_local.")?this.getNestedProperty(m._local||{},y.slice(7)):m._local,v=f?.isEnabled()?f.startStateChange(y,S,d,{actionId:n.actionId,handlerType:"setState",source:`target=${a}`}):void 0,_=l==="replace"?"replace":l==="shallow"?"shallow":"deep",A=_!=="deep"?{...d,__mergeMode:_,...v?{__setStateId:v}:{}}:{...d,...v?{__setStateId:v}:{}};if(a==="global"){if(!this.globalStateUpdater){H.warn("Global state updater is not set"),v&&f&&f.completeStateChange(v);return}const x=h?.state?.get()||{},{__setStateId:D,__mergeMode:M,...T}=A,L=_==="deep"?this.deepMergeWithState(T,x):T,q={...L,...v?{__setStateId:v}:{},..._!=="deep"?{__mergeMode:_}:{}};return H.log("setState global:",q),this.globalStateUpdater(q,{render:c}),v&&f&&setTimeout(()=>f.completeStateChange(v),0),{__target:"global",..._!=="deep"?{__mergeMode:_}:{},...L}}else if(a==="isolated"){const x=n.isolatedContext;if(x){const{__mergeMode:D,__setStateId:M,...T}=A;return x.mergeState(T,_),H.log("[handleSetState] isolated state updated:",T,"mergeMode:",_),v&&f&&setTimeout(()=>f.completeStateChange(v),0),{__target:"isolated",...T}}else if(H.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||{},T=_==="deep"?this.deepMergeWithState(A,M):A;return n.setState(T),v&&f&&setTimeout(()=>f.completeStateChange(v),0),T}else throw v&&f&&f.completeStateChange(v),new qt("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 D=window.__g7LayoutContextStack||[];if(D.length>0){const M=i==="parent"?D[D.length-1]:D[0];if(M?.setState){const{__mergeMode:T,__setStateId:L,...q}=A,P=_==="deep"?this.deepMergeWithState(q,M.state||{}):q;return H.log(`[handleSetState] scope=${i}: 타겟 컨텍스트에 상태 업데이트`,P),M.setState(P),v&&f&&setTimeout(()=>f.completeStateChange(v),0),P}}H.warn(`[handleSetState] scope=${i}: 레이아웃 컨텍스트 스택이 비어있습니다. current로 폴백합니다.`)}const x=n.setState&&!n._isDispatchFallbackContext;if(H.log("[handleSetState] isRealComponentContext:",x,"context.setState:",!!n.setState,"_isDispatchFallbackContext:",n._isDispatchFallbackContext),x){H.log("[handleSetState] Using COMPONENT setState path"),H.log("[handleSetState] resolvedPayload:",A),H.log("[handleSetState] context.state:",n.state),H.log("[handleSetState] mergeMode:",_);const M=window.__g7PendingLocalState||n.state||{},T=_==="deep"?this.deepMergeWithState(A,{}):A;H.log("[handleSetState] convertedPayload (변경 필드만, dot notation 변환):",T),n.setState(T);const L=_==="deep"?this.deepMergeWithState(A,M):_==="shallow"?{...n.state||{},...A}:A,{__mergeMode:q,__setStateId:P,...B}=L;window.__g7PendingLocalState=B,H.log("[handleSetState] __g7PendingLocalState updated:",B),this.globalStateUpdater&&(this.globalStateUpdater({_local:B},{render:!1}),H.log("[handleSetState] _global._local synced (render:false):",B));const{__mergeMode:W,__setStateId:he,...Se}=A;if(_==="replace")window.__g7ForcedLocalFields=Se;else{const be=window.__g7ForcedLocalFields||{};window.__g7ForcedLocalFields=this.deepMergeWithState(Se,be)}return H.log("[handleSetState] __g7ForcedLocalFields updated:",Se),v&&f&&setTimeout(()=>f.completeStateChange(v),0),{__target:"local",...L}}else if(this.globalStateUpdater){H.log("[handleSetState] Using GLOBAL STATE UPDATER path for _local");const M=window.__g7PendingLocalState||m._local||{};H.log("[handleSetState] currentLocal (with pending):",M);const T=_==="deep"?this.deepMergeWithState(A,M):A;return H.log("[handleSetState] finalLocal (merged):",T),this.globalStateUpdater({_local:T},{render:c}),window.__g7PendingLocalState=T,H.log("[handleSetState] __g7PendingLocalState updated for globalStateUpdater path"),v&&f&&setTimeout(()=>f.completeStateChange(v),0),{__target:"local",...T}}else throw v&&f&&f.completeStateChange(v),new qt("setState function is not provided in context and globalStateUpdater is not set")}else if(a.startsWith("_local.")){const x=a.slice(7),{__mergeMode:D,__setStateId:M,...T}=A,L=T.value!==void 0?T.value:Object.values(T)[0];if(n.setState){const P=window.__g7PendingLocalState||n.state||{},B=this.createNestedUpdate(x,L,P),W={...P,...B};if(n.setState(B),this.globalStateUpdater&&i!=="parent"&&i!=="root"){const he=window.__templateApp?.getGlobalState?.()?._local,Se=he&&typeof he=="object"?{...he,...B}:W;this.globalStateUpdater({_local:Se},{render:!1}),H.log("[handleSetState] _global._local synced for dot notation (render:false):",Se)}return v&&f&&setTimeout(()=>f.completeStateChange(v),0),W}else throw v&&f&&f.completeStateChange(v),new qt("setState function is not provided in context")}else{if(!n.setState)throw v&&f&&f.completeStateChange(v),new qt("setState function is not provided in context");const D=window.__g7PendingLocalState||n.state||{},M=_==="deep"?this.deepMergeWithState(A,D):A;return n.setState(M),v&&f&&setTimeout(()=>f.completeStateChange(v),0),M}}async handleParentScopeSetState(e,n,a,i){const l=Kn(),c=window.G7Core,d=a==="replace"?"replace":a==="shallow"?"shallow":"deep",f=e.startsWith("$parent."),h=f?"$parent.":"$root.",m=e.slice(h.length);let y,S;if(m==="_local"||m==="_global")y=m,S=void 0;else if(m.startsWith("_local."))y="_local",S=m.slice(7);else if(m.startsWith("_global."))y="_global",S=m.slice(8);else{H.warn(`[handleParentScopeSetState] 지원하지 않는 타겟 형식: ${e}. _local 또는 _global으로 시작해야 합니다.`);return}const v=window.__g7LayoutContextStack||[];if(v.length===0){H.warn(`[handleParentScopeSetState] 레이아웃 컨텍스트 스택이 비어있습니다. target=${e}`);return}const _=f?v[v.length-1]:v[0];if(!_){H.warn(`[handleParentScopeSetState] 타겟 컨텍스트를 찾을 수 없습니다. target=${e}`);return}const A=y==="_global"?_.state?._global:_.state?._local,x=l?.isEnabled()?l.startStateChange(e,A,n,{actionId:i.actionId,handlerType:"setState",source:`target=${e}`}):void 0,{__mergeMode:D,__setStateId:M,...T}=n;if(y==="_global"){if(!this.globalStateUpdater){H.warn("[handleParentScopeSetState] globalStateUpdater가 설정되지 않았습니다."),x&&l&&l.completeStateChange(x);return}const L=c?.state?.get()||{};if(S){const q=T.value!==void 0?T.value:Object.values(T)[0],P=this.createNestedUpdate(S,q,L),B={...L,...P};H.log(`[handleParentScopeSetState] ${e}: 전역 상태 중첩 경로 업데이트`,B),this.globalStateUpdater(B)}else{const q=d==="deep"?this.deepMergeWithState(T,L):T;H.log(`[handleParentScopeSetState] ${e}: 전역 상태 업데이트 (mergeMode=${d})`,q),this.globalStateUpdater(d!=="deep"?{...q,__mergeMode:d}:q)}return x&&l&&setTimeout(()=>l.completeStateChange(x),0),{__target:e,...T}}else{if(!_.setState){H.warn(`[handleParentScopeSetState] 타겟 컨텍스트에 setState가 없습니다. target=${e}`),x&&l&&l.completeStateChange(x);return}const L=_.state||{};if(S){const q=T.value!==void 0?T.value:Object.values(T)[0],P=this.createNestedUpdate(S,q,L),B={...L,...P};return H.log(`[handleParentScopeSetState] ${e}: 로컬 상태 중첩 경로 업데이트`,P),_.setState(P),_.state=B,_.dataContext&&(_.dataContext._local=B),af(),x&&l&&setTimeout(()=>l.completeStateChange(x),0),B}else{const q=d!=="deep"?{...T,__mergeMode:d}:T,P=d==="replace"?T:d==="shallow"?{...L,...T}:this.deepMergeWithState(T,L);return H.log(`[handleParentScopeSetState] ${e}: 로컬 상태 업데이트 (mergeMode=${d})`,P),_.setState(q),_.state=P,_.dataContext&&(_.dataContext._local=P),af(),x&&l&&setTimeout(()=>l.completeStateChange(x),0),P}}}deepMergeWithState(e,n){const a=["errors"];let i=e;if("..."in e){const c=e["..."];if(c&&typeof c=="object"&&!Array.isArray(c)){const{"...":d,...f}=e;i={...c,...f}}else{const{"...":d,...f}=e;i=f}}const l={...n};for(const[c,d]of Object.entries(i)){if(a.includes(c)){l[c]=d;continue}if(c.includes(".")&&c!=="..."){const f=this.createNestedUpdate(c,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[c]=d;continue}d!==null&&typeof d=="object"&&!Array.isArray(d)&&n[c]!==null&&typeof n[c]=="object"&&!Array.isArray(n[c])?l[c]=this.deepMergeWithState(d,n[c]):l[c]=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 c=l,d=a;for(let f=0;f<i.length-1;f++){const h=i[f],m=d?.[h],y=m!=null&&typeof m=="object"&&!Array.isArray(m);y?c[h]={...m}:c[h]={},c=c[h],d=y?m:{}}return c[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 c=0;c<a.length-1;c++)l[a[c]]={},l=l[a[c]];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}),H.log("[handleSetError] Error set to isolated state:",i)):l==="global"&&this.globalStateUpdater?(this.globalStateUpdater({apiError:i}),H.log("[handleSetError] Error set to global state:",i)):a.setState?(a.setState({apiError:i}),H.log("[handleSetError] Error set to local state:",i)):H.warn("[handleSetError] Cannot set error: no state updater available")}async handleOpenModal(e,n){if(!this.globalStateUpdater){H.warn("Global state updater is not set for openModal");return}const a=n.data?._global?.modalStack||[];if(a.includes(e)){H.warn(`Modal "${e}" is already open`);return}const i=window.G7Core,l=n.setState&&n.state!==void 0,c=l?void 0:i?.state?.getLocal?.()||{},d=!l&&c!==void 0&&this.globalStateUpdater;if(l||d){const m=window.__g7LayoutContextStack||[],y=l?n.state:c,S=l?n.setState:v=>{this.globalStateUpdater({_local:v})};m.push({state:y,setState:S,dataContext:{_local:y||n.data?._local,_global:l?n.data?._global:n.data?._global||i?.state?.get?.(),_computed:n.data?._computed}}),window.__g7LayoutContextStack=m,H.log(`[handleOpenModal] 레이아웃 컨텍스트 스택에 push, 스택 크기: ${m.length}, state:`,y,l?"(direct)":"(fallback via G7Core)")}else H.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 h=Kn();if(h?.isEnabled()){const m=a.length>0?a[a.length-1]:void 0;h.trackModalOpen?.({modalId:e,modalName:e,scopeType:"isolated",parentModalId:m,initialState:n.state?{...n.state}:{}})}}async handleCloseModal(e){if(!this.globalStateUpdater){H.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,c=window.__g7LayoutContextStack||[];if(c.length>0){const d=c[c.length-1];d&&(d.dataContext=void 0),c.pop(),window.__g7LayoutContextStack=c,H.log(`[handleCloseModal] 레이아웃 컨텍스트 스택에서 pop, 스택 크기: ${c.length}`)}if(a){const d=Kn();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:c}=e;if(a==="error"){const f=n.data?.error;if((f?.error_code==="identity_verification_required"||f?.data?.error_code==="identity_verification_required")&&_t.consumeDomainNoticeShown()){H.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 h={id:`toast_${Date.now()}_${Math.random().toString(36).substring(2,9)}`,type:a,message:d,...l&&{icon:l},...c&&{duration:c}},v=[...window.G7Core?.state?.get()?.toasts||[],h];this.globalStateUpdater({toasts:v})}else H.log(`[Toast ${a}] ${d}`)}async handleSwitch(e,n){const{cases:a}=e;if(!a){H.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,H.log("switch handler: using params.value as case key:",l)):(l=n.data?.$args?.[0],H.log("switch handler: using $args[0] as case key:",l)),l==null){if(a.default)return H.log("switch handler: case key is undefined, using default case"),await this.executeAction(a.default,n);H.warn("switch handler: case key is not defined and no default case");return}const c=String(l);let d=a[c];if(!d&&a.default&&(H.log(`switch handler: no case found for key "${c}", using default case`),d=a.default),!d){H.warn(`switch handler: no case found for key "${c}" and no default case`);return}return await this.executeAction(d,n)}async handleConditions(e,n){const{conditions:a}=e;if(!a||!Array.isArray(a)){H.warn("conditions handler requires conditions array");return}const i=n.data||{},l=qg(a,i,this.bindingEngine);if(!l.matched){H.log("conditions handler: no matching branch found");return}const c=a[l.branchIndex];if(H.log(`conditions handler: matched branch ${l.branchIndex}`),!c.then){H.warn('conditions handler: matched branch has no "then" action');return}return Array.isArray(c.then)?await this.handleSequence({...e,actions:c.then},n):await this.executeAction(c.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 H.warn("startInterval requires non-empty id, positive intervalMs, and actions array"),{success:!1};const c=this.intervals.get(a);c&&(clearInterval(c),this.intervals.delete(a));const d=setInterval(()=>{for(const f of l)this.executeAction(f,n).catch(h=>{H.error(`[startInterval:${a}] tick action failed`,h)})},i);return this.intervals.set(a,d),{success:!0,id:a}}handleStopInterval(e){const n=typeof e.id=="string"?e.id:"";if(n==="")return H.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 H.warn("sequence handler requires non-empty actions array"),[];const i=Kn(),l=i?.isEnabled()&&i.startSequenceExecution?.({eventType:e.type})||"";window.__g7SequenceLocalSync=void 0;const c=[];let d,f=n.state?{...n.state}:{},h=n.isolatedContext?.state?{...n.isolatedContext.state}:{},m=n.data?._computed||{};const y=window.G7Core,S=()=>({_global:y?.state?.get()||{},_local:{...f},_isolated:Object.keys(h).length>0?{...h}:void 0});for(let v=0;v<a.length;v++){const _=a[v],A=Date.now();l&&i?.isEnabled()&&i.captureSequenceActionBefore?.(l,v,_.handler||"unknown",_.params||{},S());const x={...n,state:f,data:{...n.data,_local:f,_computed:m,$computed:m,$prev:d,$results:[...c],_isolated:h},isolatedContext:n.isolatedContext?{...n.isolatedContext,state:h}:null};try{const D=await this.executeAction(_,x);if(d=D.data,c.push(D.data),_.handler==="setState"&&D.data!==void 0){if(D.data.__target==="global"){const{__target:T,__mergeMode:L,...q}=D.data;L==="replace"?f={...f,_global:q}:f={...f,_global:{...f._global||{},...q}},H.log("[handleSequence] global state synchronized (mergeMode=%s):",L||"deep",f._global)}else if(D.data.__target==="isolated"){const{__target:T,__mergeMode:L,...q}=D.data;L==="replace"?h=q:h={...h,...q},H.log("[handleSequence] isolated state synchronized (mergeMode=%s):",L||"deep",h)}else if(D.data.__target==="local"){const{__target:T,__mergeMode:L,__setStateId:q,...P}=D.data;L==="replace"?f=P:f={...f,...P},H.log("[handleSequence] local state synchronized (mergeMode=%s):",L||"deep",f)}else f=D.data,H.log("[handleSequence] state synchronized (legacy):",f);const M=n.data?._computedDefinitions;if(M&&Object.keys(M).length>0){const T={},L={...n.data,_local:f,_computed:T,$computed:T,_isolated:h};for(const[q,P]of Object.entries(M))if(typeof P=="string"){const B=P.trim();if(B.startsWith("{{")&&B.endsWith("}}"))try{const W=B.slice(2,-2).trim();T[q]=Vn(W)?this.bindingEngine.evaluatePipeExpression(W,L,{skipCache:!0}):this.bindingEngine.evaluateExpression(W,L,{skipCache:!0})}catch{T[q]=m[q]}}m=T,H.log("[handleSequence] _computed recalculated after setState:",m)}}if(_.handler!=="setState"){const M=window.__g7SequenceLocalSync;if(M&&M!==f){f=M,window.__g7SequenceLocalSync=void 0,H.log("[handleSequence] currentState synchronized from __g7SequenceLocalSync after custom handler:",_.handler);const T=n.data?._computedDefinitions;if(T&&Object.keys(T).length>0){const L={},q={...n.data,_local:f,_computed:L,$computed:L,_isolated:h};for(const[P,B]of Object.entries(T))if(typeof B=="string"){const W=B.trim();if(W.startsWith("{{")&&W.endsWith("}}"))try{const he=W.slice(2,-2).trim();L[P]=Vn(he)?this.bindingEngine.evaluatePipeExpression(he,q,{skipCache:!0}):this.bindingEngine.evaluateExpression(he,q,{skipCache:!0})}catch{L[P]=m[P]}}m=L,H.log("[handleSequence] _computed recalculated after custom handler:",m)}}}l&&i?.isEnabled()&&i.captureSequenceActionAfter?.(l,v,S(),Date.now()-A,D.data)}catch(D){throw l&&i?.isEnabled()&&(i.captureSequenceActionAfter?.(l,v,S(),Date.now()-A,void 0,D),i.endSequenceExecution?.(l,D)),H.error(`sequence handler: action[${v}] failed:`,D),D}}return window.__g7SequenceLocalSync=void 0,l&&i?.isEnabled()&&i.endSequenceExecution?.(l),c}async handleParallel(e,n){const a=e.actions||e.params?.actions;if(!a||!Array.isArray(a)||a.length===0)return H.warn("parallel handler requires non-empty actions array"),[];H.log(`parallel handler: executing ${a.length} actions in parallel`);const i=n.isolatedContext?{...n.isolatedContext,state:{...n.isolatedContext.state}}:null,l=a.map((f,h)=>{const m={...n,isolatedContext:i};return this.executeAction(f,m).catch(y=>{throw H.error(`parallel handler: action[${h}] failed:`,y),y})}),c=await Promise.allSettled(l),d=c.filter(f=>f.status==="rejected").length;return d>0&&H.warn(`parallel handler: ${d}/${a.length} actions failed`),c}async handleLoadScript(e,n,a){const{src:i,id:l,async:c=!0,defer:d=!1}=e;if(!i)throw new qt('loadScript handler requires "src" parameter',n);const f=l||`script_${i.replace(/[^a-zA-Z0-9]/g,"_")}`;return ws.loadedScripts.has(f)?(H.log(`loadScript: script already loaded, skipping: ${f}`),n.onLoad&&await this.executeAction(n.onLoad,a),!0):document.getElementById(f)?(H.log(`loadScript: script element already exists: ${f}`),ws.loadedScripts.add(f),n.onLoad&&await this.executeAction(n.onLoad,a),!0):(H.log(`loadScript: loading script: ${i}`),new Promise((m,y)=>{const S=document.createElement("script");S.id=f,S.src=i,S.async=c,S.defer=d,S.onload=async()=>{if(H.log(`loadScript: script loaded successfully: ${f}`),ws.loadedScripts.add(f),n.onLoad)try{await this.executeAction(n.onLoad,a)}catch(v){H.error("loadScript: onLoad action failed:",v)}m(!0)},S.onerror=v=>{H.error(`loadScript: failed to load script: ${i}`,v),y(new qt(`Failed to load script: ${i}`,n))},document.head.appendChild(S)}))}async handleCallExternal(e,n,a){const i=e.constructor,l=e.args||{},c=e.method,d=e.methodArgs||[],f=e.callbackEvent,h=e.embedTarget,m=e.callbackSetState,y=e.callbackAction;if(!i)throw new qt('callExternal handler requires "constructor" parameter',n);const S=this.getNestedProperty(window,i);if(!S||typeof S!="function")throw new qt(`Constructor not found or not a function: ${i}. Make sure the script is loaded first using loadScript handler.`,n);H.log(`callExternal: calling constructor ${i}`);const v={...l};for(const[A,x]of Object.entries(l))x===!0&&(v[A]=D=>{if(H.log(`callExternal: callback triggered for ${A}`,D),f&&typeof window<"u"&&window.G7Core?.componentEvent&&window.G7Core.componentEvent.emit(f,D),m&&a.setState){const M=q=>{const P={};for(const[B,W]of Object.entries(q))typeof W=="string"?P[B]=this.getNestedProperty(D,W):typeof W=="object"&&W!==null&&(P[B]=M(W));return P},T=M(m);H.log("callExternal: callbackSetState mapping result",T);const L=this.deepMergeWithState(T,a.state||{});H.log("callExternal: merged with existing state",L),a.setState(L)}else f&&a.setState&&a.setState({[`${f.replace(/:/g,"_")}_result`]:D});if(y){const M={...a,data:{...a.data,$event:D}},T=Array.isArray(y)?y:[y];for(const L of T)try{this.executeAction(L,M)}catch(q){H.error("callExternal: callbackAction failed:",q)}}});const _=new S(v);if(c&&typeof _[c]=="function"){if(H.log(`callExternal: calling method ${c}`),c==="embed"&&h){const A=document.querySelector(h);if(A)return _[c](A,...d);throw new qt(`Embed target element not found: ${h}`,n)}return _[c](...d)}return _}async handleCallExternalEmbed(e,n,a){const i=e.constructor,l=e.args||{},c=e.callbackSetState,d=e.callbackEvent,f=e.layerClassName,h=e.callbackAction;if(!i)throw new qt('callExternalEmbed handler requires "constructor" parameter',n);const m=this.getNestedProperty(window,i);if(!m||typeof m!="function")throw new qt(`Constructor not found or not a function: ${i}. Make sure the script is loaded first.`,n);H.log(`callExternalEmbed: creating layer for ${i}`);const{layer:y,closeLayer:S}=this.createEmbedLayer(f),v={...l};for(const[A,x]of Object.entries(l))x===!0&&(v[A]=D=>{if(H.log(`callExternalEmbed: callback triggered for ${A}`,D),S(),d&&typeof window<"u"&&window.G7Core?.componentEvent&&window.G7Core.componentEvent.emit(d,D),c&&a.setState){const M=q=>{const P={};for(const[B,W]of Object.entries(q))typeof W=="string"?P[B]=this.getNestedProperty(D,W):typeof W=="object"&&W!==null&&(P[B]=M(W));return P},T=M(c);H.log("callExternalEmbed: callbackSetState mapping result",T);const L=this.deepMergeWithState(T,a.state||{});H.log("callExternalEmbed: merged with existing state",L),a.setState(L)}if(h){const M={...a,data:{...a.data,$event:D}},T=Array.isArray(h)?h:[h];for(const L of T)try{this.executeAction(L,M)}catch(q){H.error("callExternalEmbed: callbackAction failed:",q)}}});const _=new m(v);if(typeof _.embed=="function")_.embed(y),H.log("callExternalEmbed: embedded in layer");else throw S(),new qt(`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 c=d=>{this.isImeComposing(d)||d.key==="Escape"&&(l(),document.removeEventListener("keydown",c))};return document.addEventListener("keydown",c),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 H.error("saveToLocalStorage: key parameter is required"),!1;try{const l=typeof i=="string"?i:JSON.stringify(i);return localStorage.setItem(a,l),H.log(`saveToLocalStorage: saved ${a}`,i),!0}catch(l){return H.error("saveToLocalStorage: failed to save",{key:a,error:l}),!1}}async handleLoadFromLocalStorage(e,n){const{key:a,target:i,stateKey:l,defaultValue:c}=e;if(!a)return H.error("loadFromLocalStorage: key parameter is required"),c;try{const d=localStorage.getItem(a);if(d===null)return H.log(`loadFromLocalStorage: no value found for ${a}, using default`),l&&n.setState&&n.setState({[l]:c}),c;let f;try{f=JSON.parse(d)}catch{f=d}return H.log(`loadFromLocalStorage: loaded ${a}`,f),l&&n.setState&&n.setState({[l]:f}),f}catch(d){return H.error("loadFromLocalStorage: failed to load",{key:a,error:d}),c}}async handleCustomAction(e,n){const a=this.customHandlers.get(e.handler);if(!a){if(this.previewMode){H.warn(`[Preview] Unknown action handler "${e.handler}" — skipped (preview mode)`);return}const i=new qt(`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("{{")&&H.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(c=>typeof c=="string"&&c.includes("{{")?this.evaluateExpression(c,n):c):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 c=l;typeof l=="string"&&l.includes("{{")&&(c=this.evaluateExpression(l,n)),c&&typeof c=="object"&&!Array.isArray(c)&&(a={...a,...c})}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=Ta(e);if(a===null){let c=n;if(e.includes("_global")){const f=window.G7Core?.state?.get()?._global;f&&(c={...n,_global:f})}if(e.includes("_computed")||e.includes("$computed")){const f=window.__g7ActionContext?.computedRef?.current;f&&Object.keys(f).length>0&&(c={...c,_computed:f,$computed:f})}return this.bindingEngine.resolveBindings(e,c,{skipCache:!0})}let i=a;i=i.replace(/\$args\.(\d+)/g,"$args[$1]");let l=n;if(i.includes("_global")){const d=window.G7Core?.state?.get()?._global;d&&(l={...n,_global:d})}if(i.includes("_computed")||i.includes("$computed")){const d=window.__g7ActionContext?.computedRef?.current;d&&Object.keys(d).length>0&&(l={...l,_computed:d,$computed:d})}i.includes("_global.modules")&&(H.log("[evaluateExpression] expression:",i),H.log("[evaluateExpression] dataContext._global:",l._global),H.log("[evaluateExpression] dataContext._global?.modules:",l._global?.modules));try{const c=Vn(i)?this.bindingEngine.evaluatePipeExpression(i,l,{skipCache:!0}):this.bindingEngine.evaluateExpression(i,l);return i.includes("_global.modules")&&H.log("[evaluateExpression] result:",c),typeof c=="string"&&c.startsWith("$t:")&&this.translationEngine&&this.translationContext?this.translationEngine.resolveTranslations(c,this.translationContext,n):c}catch(c){return H.error("Expression evaluation failed:",e,c),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(H.error("dispatchAction failed:",i),e.onError){const l=i instanceof qt&&i.originalError?{message:i.originalError.message,response:i.originalError.response}:{message:i instanceof Error?i.message:String(i)},c={...a,data:{...a.data,error:l}},d=Array.isArray(e.onError)?e.onError:[e.onError];for(const f of d)await this.executeAction(f,c)}return{success:!1,error:i instanceof Error?i:new Error(String(i))}}}registerHandler(e,n,a){this.customHandlers.set(e,n);const i=Kn();i?.isEnabled()&&i.trackHandlerRegistration(e,a?.category??"custom",a?.description,a?.source)}unregisterHandler(e){this.customHandlers.delete(e);const n=Kn();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 c={...a,$event:n,$args:l},d={type:n.type,target:n.target,preventDefault:()=>{},stopPropagation:()=>{}};this.createHandler(e,c,i)(d)}handleDebouncedAction(e,n,a,i,l,c){const d=this.normalizeDebounceConfig(e.debounce),f=l||`default-${e.handler}-${Date.now()}`,h=this.extractEventData(n),m=h._changedKeys;if(m&&Array.isArray(m)&&h?.target?.value&&typeof h.target.value=="object"&&!Array.isArray(h.target.value)){const _=this.debounceAccumulatedValues.get(f);if(_){const A={..._};for(const x of m)A[x]=h.target.value[x];h.target.value=A}this.debounceAccumulatedValues.set(f,h.target.value)}const y=this.debounceTimers.get(f);y&&(clearTimeout(y),this.debounceTimers.delete(f));const S=Kn();S?.isEnabled()&&S.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 v=!this.debounceTimers.has(f+"_leading");if(d.leading&&v&&(this.debounceTimers.set(f+"_leading",setTimeout(()=>{},0)),this.executeDebouncedAction(e,h,a,i,c),S?.isEnabled()&&S.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,h,a,i,c),S?.isEnabled()&&S.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 y=this.resolveActionRef(m),S=y.event?this.normalizeEventPropName(y.event):this.getEventHandlerName(y.type);l.has(S)||l.set(S,[]),l.get(S).push(y)}const c=e.name||e.id||"unknown",d=l.has("onDrop"),f=l.has("onDragOver"),h=l.has("onDragEnter");d&&!f&&(i.onDragOver=m=>{m.preventDefault()}),d&&!h&&(i.onDragEnter=m=>{m.preventDefault()});for(const[m,y]of l)i[m]=(...S)=>{for(const v of y){const _=S[0],A=_&&typeof _=="object"&&"preventDefault"in _;if(A&&(m==="onDragOver"||m==="onDrop")&&_.preventDefault(),A&&v.key&&"key"in _){if(this.isImeComposing(_)){H.log("Key filter skipped (IME composing):",v.key);continue}if(_.key!==v.key){H.log("Key filter not matched:",v.key,"actual:",_.key);continue}H.log("Key filter matched:",v.key)}if(v.debounce){const x=`${c}-${v.handler}-${m}`,D=_&&typeof _=="object"&&!("preventDefault"in _)&&"target"in _&&_.target!==null;let M;if(A)M=_;else if(D){const L={type:"custom",target:_.target,preventDefault:()=>{},stopPropagation:()=>{}};_._changedKeys&&(L._changedKeys=_._changedKeys),M=L}else M=new Event("custom");const T=v.event?{...n,$args:S}:n;this.handleDebouncedAction(v,M,T,a,x,S)}else if(this.flushPendingDebounceTimers(),v.event){const x={...n,$args:S},D=this.resolveEventForHandler(_,A);this.createHandler(v,x,a)(D)}else if(A)this.createHandler(v,n,a)(_);else if(_&&typeof _=="object"&&!("preventDefault"in _)&&"target"in _&&_.target!==null){const D={type:"custom",target:_.target,preventDefault:()=>{},stopPropagation:()=>{}};this.createHandler(v,n,a)(D)}}}}return i}getEventHandlerName(e){return Pm[e]||`on${e.charAt(0).toUpperCase()}${e.slice(1)}`}normalizeEventPropName(e){return Pm[e]??e}resolveEventForHandler(e,n){if(n)return e;if(!(e&&typeof e=="object"&&!("preventDefault"in e)&&"target"in e&&e.target!==null))return new Event("custom");const i={type:"custom",target:e.target,preventDefault:()=>{},stopPropagation:()=>{}};return e._changedKeys&&(i._changedKeys=e._changedKeys),i}sanitizeForDevTools(e,n=5){const a=new WeakSet,i=(l,c)=>{if(l==null||typeof l=="string"||typeof l=="number"||typeof l=="boolean")return l;if(c>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,c+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),h=f.slice(0,20);for(const m of h)try{d[m]=i(l[m],c+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)}};$(ws,"loadedScripts",new Set);let Co=ws,oc=null;function Bm(s){return oc||(oc=new Co(s)),oc}function rE(s){oc=s}const qm=pt("TransitionManager");class aE{constructor(){$(this,"isPending",!1);$(this,"subscribers",new Set)}setPending(e){this.isPending!==e&&(qm.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(){qm.log("notifySubscribers:",{isPending:this.isPending,subscriberCount:this.subscribers.size}),this.subscribers.forEach(e=>{e(this.isPending)})}clearSubscribers(){this.subscribers.clear()}}const Ur=new aE,lc=pt("TransitionContext"),Gm=j.createContext({isTransitioning:!1}),sf=({children:s})=>{const[e,n]=j.useState(()=>{const i=Ur.getIsPending();return lc.log("Initial state:",i),i});j.useEffect(()=>{lc.log("Subscribing to TransitionManager");const i=Ur.subscribe(l=>{lc.log("Received isPending update:",l),n(l)});return()=>{lc.log("Unsubscribing from TransitionManager"),i()}},[]);const a=j.useMemo(()=>({isTransitioning:e}),[e]);return gt.jsx(Gm.Provider,{value:a,children:s})},Fm=()=>j.useContext(Gm),cc="__g7LocalInitTracking";function of(){const s=globalThis;return s[cc]||(s[cc]={hash:"",timestamp:void 0,consumed:void 0}),s[cc]}function iE(){const s=globalThis;s[cc]={hash:"",timestamp:void 0,consumed:void 0}}function sE(s){of().consumed=s}function oE(s){return of().consumed===s}function lE(s){return s.globalTrackedKey!==s.trackingKey?"apply":s.instanceHandledKey===s.trackingKey?"skip":"prune"}function cE(s,e){return typeof s=="number"&&typeof e=="number"?Math.max(s,e):e??s}function uE(s,e){if(e===void 0)return s;if(!(s!==null&&typeof s=="object"&&e!==null&&typeof e=="object"&&!oE(s)))return e;const{_forceLocalInit:a,...i}=s,{_forceLocalInit:l,...c}=e,d={...i,...c},f=cE(a,l);return f!==void 0&&(d._forceLocalInit=f),d}function dE(s){return s<768?"mobile":s<1024?"tablet":"desktop"}function Vm(s){const e=dE(s);return{width:s,isMobile:e==="mobile",isTablet:e==="tablet",isDesktop:e==="desktop",matchedPreset:e}}const lf=j.createContext(Vm(1024)),uc=({children:s,overrideWidth:e})=>{const[n,a]=j.useState(()=>mi.getWidth());j.useEffect(()=>{const c=mi.subscribe(d=>{a(d)});return()=>{c()}},[]);const i=e??n,l=j.useMemo(()=>Vm(i),[i]);return gt.jsx(lf.Provider,{value:l,children:s})},cf=()=>j.useContext(lf);window.G7Core?.createLogger?.("Core:State");function fE(s,e,n,a){const{syncOnControlledChange:i=!0,isEqual:l}=a??{},c=s!==void 0;j.useRef(c);const[d,f]=j.useState(s!==void 0?s:e),h=d,m=j.useRef(s),y=j.useRef(!1);j.useEffect(()=>{if(y.current){m.current=s;return}i&&c&&s!==m.current&&(l?!l(d,s):d!==s)&&f(s),m.current=s},[s,c,i,l,d]);const S=j.useCallback(v=>{const _=typeof v=="function"?v(h):v;(l?l(h,_):h===_)||(y.current=!0,f(_),n?.(_),requestAnimationFrame(()=>{y.current=!1}))},[h,c,n,l]);return[h,S]}function hE(s,e){return s===e?!0:s.length!==e.length?!1:s.every((n,a)=>n===e[a])}function Km(s,e){if(s===e)return!0;const n=Object.keys(s),a=Object.keys(e);return n.length!==a.length?!1:n.every(i=>s[i]===e[i])}const Wm=j.createContext({}),pE=({children:s,value:e})=>gt.jsx(Wm.Provider,{value:e,children:s}),gE=()=>j.useContext(Wm),mE=(s,e)=>{if(!s)return;const n=e.split(".");let a=s;for(const i of n){if(a==null)return;a=a[i]}return a},yE=(s,e,n)=>{const a=e.split(".");if(a.length===1)return{...s,[a[0]]:n};const i={...s};let l=i;for(let c=0;c<a.length-1;c++){const d=a[c],f=a[c+1],h=/^\d+$/.test(f);Array.isArray(l[d])&&!h?l[d]={...l[d]}:Array.isArray(l[d])?l[d]=[...l[d]]:h?l[d]=Array.isArray(l[d])?[...l[d]]:[]:l[d]={...l[d]||{}},l=l[d]}return l[a[a.length-1]]=n,i},hs=pt("IsolatedStateContext"),bE={state:{},setState:()=>{hs.warn("IsolatedStateContext not available: setState called outside IsolatedStateProvider")},getState:()=>{},mergeState:()=>{hs.warn("IsolatedStateContext not available: mergeState called outside IsolatedStateProvider")},stateRef:{current:{}},scopeId:""},Ym=j.createContext(bE);let vE=0;function SE(){return`isolated-${++vE}-${Date.now().toString(36)}`}function Xm(s,e){if(e==null)return s;if(typeof e!="object"||Array.isArray(e))return e;const n={...s};for(const a of Object.keys(e)){const i=e[a],l=s?.[a];i!==null&&typeof i=="object"&&!Array.isArray(i)&&l!==null&&typeof l=="object"&&!Array.isArray(l)?n[a]=Xm(l,i):n[a]=i}return n}function wE(s,e){return e?e.split(".").reduce((n,a)=>n?.[a],s):s}function CE(s,e,n){const a=e.split("."),i={...s};let l=i;for(let c=0;c<a.length-1;c++){const d=a[c];l[d]={...l[d]},l=l[d]}return l[a[a.length-1]]=n,i}const EE=({initialState:s={},scopeId:e,children:n})=>{const i=j.useRef(e||SE()).current,[l,c]=j.useState(s),d=j.useRef(l);d.current=l;const f=j.useCallback(v=>wE(d.current,v),[]),h=j.useCallback((v,_)=>{c(A=>{const x=CE(A,v,_);return hs.log(`[${i}] setState: ${v} =`,_),x})},[i]),m=j.useCallback((v,_="deep")=>{c(A=>{let x;return _==="replace"?x=v:_==="shallow"?x={...A,...v}:x=Xm(A,v),hs.log(`[${i}] mergeState (${_}):`,v),x})},[i]),y=j.useMemo(()=>({state:l,setState:h,getState:f,mergeState:m,stateRef:d,scopeId:i}),[l,h,f,m,i]),S=j.useMemo(()=>({state:d.current,setState:h,getState:f,mergeState:m}),[h,f,m]);return j.useEffect(()=>{const v=window.G7Core,_=window.__g7IsolatedStates||{};return window.__g7IsolatedStates||(window.__g7IsolatedStates=_),_[i]=S,v&&(v._isolatedStates||(v._isolatedStates={}),v._isolatedStates[i]=l),v?.devTools?.isEnabled?.()&&v.devTools.emit?.("isolated:created",{id:i,state:l}),hs.log(`[${i}] IsolatedStateProvider mounted with initial state:`,l),()=>{delete _[i],v?._isolatedStates&&delete v._isolatedStates[i],v?.devTools?.isEnabled?.()&&v.devTools.emit?.("isolated:destroyed",{id:i}),hs.log(`[${i}] IsolatedStateProvider unmounted`)}},[i,S]),j.useEffect(()=>{const v=window.G7Core,_=window.__g7IsolatedStates;_?.[i]&&(_[i].state=l),v?._isolatedStates&&(v._isolatedStates[i]=l),v?.devTools?.isEnabled?.()&&v.devTools.emit?.("isolated:updated",{id:i,state:l})},[l,i]),gt.jsx(Ym.Provider,{value:y,children:n})},_E=()=>{const s=j.useContext(Ym);return s.scopeId?s:null};var Oa=fg();function AE(){for(var s=arguments.length,e=new Array(s),n=0;n<s;n++)e[n]=arguments[n];return j.useMemo(()=>a=>{e.forEach(i=>i(a))},e)}const dc=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ps(s){const e=Object.prototype.toString.call(s);return e==="[object Window]"||e==="[object global]"}function uf(s){return"nodeType"in s}function In(s){var e,n;return s?ps(s)?s:uf(s)&&(e=(n=s.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function df(s){const{Document:e}=In(s);return s instanceof e}function Eo(s){return ps(s)?!1:s instanceof In(s).HTMLElement}function Jm(s){return s instanceof In(s).SVGElement}function gs(s){return s?ps(s)?s.document:uf(s)?df(s)?s:Eo(s)||Jm(s)?s.ownerDocument:document:document:document}const Pr=dc?j.useLayoutEffect:j.useEffect;function ff(s){const e=j.useRef(s);return Pr(()=>{e.current=s}),j.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 xE(){const s=j.useRef(null),e=j.useCallback((a,i)=>{s.current=setInterval(a,i)},[]),n=j.useCallback(()=>{s.current!==null&&(clearInterval(s.current),s.current=null)},[]);return[e,n]}function _o(s,e){e===void 0&&(e=[s]);const n=j.useRef(s);return Pr(()=>{n.current!==s&&(n.current=s)},e),n}function Ao(s,e){const n=j.useRef();return j.useMemo(()=>{const a=s(n.current);return n.current=a,a},[...e])}function fc(s){const e=ff(s),n=j.useRef(null),a=j.useCallback(i=>{i!==n.current&&e?.(i,n.current),n.current=i},[]);return[n,a]}function hf(s){const e=j.useRef();return j.useEffect(()=>{e.current=s},[s]),e.current}let pf={};function xo(s,e){return j.useMemo(()=>{if(e)return e;const n=pf[s]==null?0:pf[s]+1;return pf[s]=n,s+"-"+n},[s,e])}function Qm(s){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,c)=>{const d=Object.entries(c);for(const[f,h]of d){const m=l[f];m!=null&&(l[f]=m+s*h)}return l},{...e})}}const ms=Qm(1),To=Qm(-1);function TE(s){return"clientX"in s&&"clientY"in s}function gf(s){if(!s)return!1;const{KeyboardEvent:e}=In(s.target);return e&&s instanceof e}function kE(s){if(!s)return!1;const{TouchEvent:e}=In(s.target);return e&&s instanceof e}function mf(s){if(kE(s)){if(s.touches&&s.touches.length){const{clientX:e,clientY:n}=s.touches[0];return{x:e,y:n}}else if(s.changedTouches&&s.changedTouches.length){const{clientX:e,clientY:n}=s.changedTouches[0];return{x:e,y:n}}}return TE(s)?{x:s.clientX,y:s.clientY}:null}const ko=Object.freeze({Translate:{toString(s){if(!s)return;const{x:e,y:n}=s;return"translate3d("+(e?Math.round(e):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(s){if(!s)return;const{scaleX:e,scaleY:n}=s;return"scaleX("+e+") scaleY("+n+")"}},Transform:{toString(s){if(s)return[ko.Translate.toString(s),ko.Scale.toString(s)].join(" ")}},Transition:{toString(s){let{property:e,duration:n,easing:a}=s;return e+" "+n+"ms "+a}}}),Zm="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function RE(s){return s.matches(Zm)?s:s.querySelector(Zm)}const DE={display:"none"};function OE(s){let{id:e,value:n}=s;return Xe.createElement("div",{id:e,style:DE},n)}function LE(s){let{id:e,announcement:n,ariaLiveType:a="assertive"}=s;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 ME(){const[s,e]=j.useState("");return{announce:j.useCallback(a=>{a!=null&&e(a)},[]),announcement:s}}const ey=j.createContext(null);function $E(s){const e=j.useContext(ey);j.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(s)},[s,e])}function NE(){const[s]=j.useState(()=>new Set),e=j.useCallback(a=>(s.add(a),()=>s.delete(a)),[s]);return[j.useCallback(a=>{let{type:i,event:l}=a;s.forEach(c=>{var d;return(d=c[i])==null?void 0:d.call(c,l)})},[s]),e]}const IE={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.
|
||
`},jE={onDragStart(s){let{active:e}=s;return"Picked up draggable item "+e.id+"."},onDragOver(s){let{active:e,over:n}=s;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(s){let{active:e,over:n}=s;return n?"Draggable item "+e.id+" was dropped over droppable area "+n.id:"Draggable item "+e.id+" was dropped."},onDragCancel(s){let{active:e}=s;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function HE(s){let{announcements:e=jE,container:n,hiddenTextDescribedById:a,screenReaderInstructions:i=IE}=s;const{announce:l,announcement:c}=ME(),d=xo("DndLiveRegion"),[f,h]=j.useState(!1);if(j.useEffect(()=>{h(!0)},[]),$E(j.useMemo(()=>({onDragStart(y){let{active:S}=y;l(e.onDragStart({active:S}))},onDragMove(y){let{active:S,over:v}=y;e.onDragMove&&l(e.onDragMove({active:S,over:v}))},onDragOver(y){let{active:S,over:v}=y;l(e.onDragOver({active:S,over:v}))},onDragEnd(y){let{active:S,over:v}=y;l(e.onDragEnd({active:S,over:v}))},onDragCancel(y){let{active:S,over:v}=y;l(e.onDragCancel({active:S,over:v}))}}),[l,e])),!f)return null;const m=Xe.createElement(Xe.Fragment,null,Xe.createElement(OE,{id:a,value:i.draggable}),Xe.createElement(LE,{id:d,announcement:c}));return n?Oa.createPortal(m,n):m}var sn;(function(s){s.DragStart="dragStart",s.DragMove="dragMove",s.DragEnd="dragEnd",s.DragCancel="dragCancel",s.DragOver="dragOver",s.RegisterDroppable="registerDroppable",s.SetDroppableDisabled="setDroppableDisabled",s.UnregisterDroppable="unregisterDroppable"})(sn||(sn={}));function hc(){}function ty(s,e){return j.useMemo(()=>({sensor:s,options:e??{}}),[s,e])}function zE(){for(var s=arguments.length,e=new Array(s),n=0;n<s;n++)e[n]=arguments[n];return j.useMemo(()=>[...e].filter(a=>a!=null),[...e])}const _r=Object.freeze({x:0,y:0});function ny(s,e){return Math.sqrt(Math.pow(s.x-e.x,2)+Math.pow(s.y-e.y,2))}function ry(s,e){let{data:{value:n}}=s,{data:{value:a}}=e;return n-a}function UE(s,e){let{data:{value:n}}=s,{data:{value:a}}=e;return a-n}function ay(s){let{left:e,top:n,height:a,width:i}=s;return[{x:e,y:n},{x:e+i,y:n},{x:e,y:n+a},{x:e+i,y:n+a}]}function iy(s,e){if(!s||s.length===0)return null;const[n]=s;return n[e]}function sy(s,e,n){return e===void 0&&(e=s.left),n===void 0&&(n=s.top),{x:e+s.width*.5,y:n+s.height*.5}}const PE=s=>{let{collisionRect:e,droppableRects:n,droppableContainers:a}=s;const i=sy(e,e.left,e.top),l=[];for(const c of a){const{id:d}=c,f=n.get(d);if(f){const h=ny(sy(f),i);l.push({id:d,data:{droppableContainer:c,value:h}})}}return l.sort(ry)},BE=s=>{let{collisionRect:e,droppableRects:n,droppableContainers:a}=s;const i=ay(e),l=[];for(const c of a){const{id:d}=c,f=n.get(d);if(f){const h=ay(f),m=i.reduce((S,v,_)=>S+ny(h[_],v),0),y=Number((m/4).toFixed(4));l.push({id:d,data:{droppableContainer:c,value:y}})}}return l.sort(ry)};function qE(s,e){const n=Math.max(e.top,s.top),a=Math.max(e.left,s.left),i=Math.min(e.left+e.width,s.left+s.width),l=Math.min(e.top+e.height,s.top+s.height),c=i-a,d=l-n;if(a<i&&n<l){const f=e.width*e.height,h=s.width*s.height,m=c*d,y=m/(f+h-m);return Number(y.toFixed(4))}return 0}const GE=s=>{let{collisionRect:e,droppableRects:n,droppableContainers:a}=s;const i=[];for(const l of a){const{id:c}=l,d=n.get(c);if(d){const f=qE(d,e);f>0&&i.push({id:c,data:{droppableContainer:l,value:f}})}}return i.sort(UE)};function FE(s,e,n){return{...s,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function oy(s,e){return s&&e?{x:s.left-e.left,y:s.top-e.top}:_r}function VE(s){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((c,d)=>({...c,top:c.top+s*d.y,bottom:c.bottom+s*d.y,left:c.left+s*d.x,right:c.right+s*d.x}),{...n})}}const KE=VE(1);function WE(s){if(s.startsWith("matrix3d(")){const e=s.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(s.startsWith("matrix(")){const e=s.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function YE(s,e,n){const a=WE(e);if(!a)return s;const{scaleX:i,scaleY:l,x:c,y:d}=a,f=s.left-c-(1-i)*parseFloat(n),h=s.top-d-(1-l)*parseFloat(n.slice(n.indexOf(" ")+1)),m=i?s.width/i:s.width,y=l?s.height/l:s.height;return{width:m,height:y,top:h,right:f+m,bottom:h+y,left:f}}const XE={ignoreTransform:!1};function ys(s,e){e===void 0&&(e=XE);let n=s.getBoundingClientRect();if(e.ignoreTransform){const{transform:h,transformOrigin:m}=In(s).getComputedStyle(s);h&&(n=YE(n,h,m))}const{top:a,left:i,width:l,height:c,bottom:d,right:f}=n;return{top:a,left:i,width:l,height:c,bottom:d,right:f}}function ly(s){return ys(s,{ignoreTransform:!0})}function JE(s){const e=s.innerWidth,n=s.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function QE(s,e){return e===void 0&&(e=In(s).getComputedStyle(s)),e.position==="fixed"}function ZE(s,e){e===void 0&&(e=In(s).getComputedStyle(s));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const l=e[i];return typeof l=="string"?n.test(l):!1})}function pc(s,e){const n=[];function a(i){if(e!=null&&n.length>=e||!i)return n;if(df(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!Eo(i)||Jm(i)||n.includes(i))return n;const l=In(s).getComputedStyle(i);return i!==s&&ZE(i,l)&&n.push(i),QE(i,l)?n:a(i.parentNode)}return s?a(s):n}function cy(s){const[e]=pc(s,1);return e??null}function yf(s){return!dc||!s?null:ps(s)?s:uf(s)?df(s)||s===gs(s).scrollingElement?window:Eo(s)?s:null:null}function uy(s){return ps(s)?s.scrollX:s.scrollLeft}function dy(s){return ps(s)?s.scrollY:s.scrollTop}function bf(s){return{x:uy(s),y:dy(s)}}var gn;(function(s){s[s.Forward=1]="Forward",s[s.Backward=-1]="Backward"})(gn||(gn={}));function fy(s){return!dc||!s?!1:s===document.scrollingElement}function hy(s){const e={x:0,y:0},n=fy(s)?{height:window.innerHeight,width:window.innerWidth}:{height:s.clientHeight,width:s.clientWidth},a={x:s.scrollWidth-n.width,y:s.scrollHeight-n.height},i=s.scrollTop<=e.y,l=s.scrollLeft<=e.x,c=s.scrollTop>=a.y,d=s.scrollLeft>=a.x;return{isTop:i,isLeft:l,isBottom:c,isRight:d,maxScroll:a,minScroll:e}}const e_={x:.2,y:.2};function t_(s,e,n,a,i){let{top:l,left:c,right:d,bottom:f}=n;a===void 0&&(a=10),i===void 0&&(i=e_);const{isTop:h,isBottom:m,isLeft:y,isRight:S}=hy(s),v={x:0,y:0},_={x:0,y:0},A={height:e.height*i.y,width:e.width*i.x};return!h&&l<=e.top+A.height?(v.y=gn.Backward,_.y=a*Math.abs((e.top+A.height-l)/A.height)):!m&&f>=e.bottom-A.height&&(v.y=gn.Forward,_.y=a*Math.abs((e.bottom-A.height-f)/A.height)),!S&&d>=e.right-A.width?(v.x=gn.Forward,_.x=a*Math.abs((e.right-A.width-d)/A.width)):!y&&c<=e.left+A.width&&(v.x=gn.Backward,_.x=a*Math.abs((e.left+A.width-c)/A.width)),{direction:v,speed:_}}function n_(s){if(s===document.scrollingElement){const{innerWidth:l,innerHeight:c}=window;return{top:0,left:0,right:l,bottom:c,width:l,height:c}}const{top:e,left:n,right:a,bottom:i}=s.getBoundingClientRect();return{top:e,left:n,right:a,bottom:i,width:s.clientWidth,height:s.clientHeight}}function py(s){return s.reduce((e,n)=>ms(e,bf(n)),_r)}function r_(s){return s.reduce((e,n)=>e+uy(n),0)}function a_(s){return s.reduce((e,n)=>e+dy(n),0)}function i_(s,e){if(e===void 0&&(e=ys),!s)return;const{top:n,left:a,bottom:i,right:l}=e(s);cy(s)&&(i<=0||l<=0||n>=window.innerHeight||a>=window.innerWidth)&&s.scrollIntoView({block:"center",inline:"center"})}const s_=[["x",["left","right"],r_],["y",["top","bottom"],a_]];class vf{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=pc(n),i=py(a);this.rect={...e},this.width=e.width,this.height=e.height;for(const[l,c,d]of s_)for(const f of c)Object.defineProperty(this,f,{get:()=>{const h=d(a),m=i[l]-h;return this.rect[f]+m},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ro{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 o_(s){const{EventTarget:e}=In(s);return s instanceof e?s:gs(s)}function Sf(s,e){const n=Math.abs(s.x),a=Math.abs(s.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 ir;(function(s){s.Click="click",s.DragStart="dragstart",s.Keydown="keydown",s.ContextMenu="contextmenu",s.Resize="resize",s.SelectionChange="selectionchange",s.VisibilityChange="visibilitychange"})(ir||(ir={}));function gy(s){s.preventDefault()}function l_(s){s.stopPropagation()}var dt;(function(s){s.Space="Space",s.Down="ArrowDown",s.Right="ArrowRight",s.Left="ArrowLeft",s.Up="ArrowUp",s.Esc="Escape",s.Enter="Enter",s.Tab="Tab"})(dt||(dt={}));const my={start:[dt.Space,dt.Enter],cancel:[dt.Esc],end:[dt.Space,dt.Enter,dt.Tab]},c_=(s,e)=>{let{currentCoordinates:n}=e;switch(s.code){case dt.Right:return{...n,x:n.x+25};case dt.Left:return{...n,x:n.x-25};case dt.Down:return{...n,y:n.y+25};case dt.Up:return{...n,y:n.y-25}}};class wf{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 Ro(gs(n)),this.windowListeners=new Ro(In(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(ir.Resize,this.handleCancel),this.windowListeners.add(ir.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(ir.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,a=e.node.current;a&&i_(a),n(_r)}handleKeyDown(e){if(gf(e)){const{active:n,context:a,options:i}=this.props,{keyboardCodes:l=my,coordinateGetter:c=c_,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:h}=a.current,m=h?{x:h.left,y:h.top}:_r;this.referenceCoordinates||(this.referenceCoordinates=m);const y=c(e,{active:n,context:a.current,currentCoordinates:m});if(y){const S=To(y,m),v={x:0,y:0},{scrollableAncestors:_}=a.current;for(const A of _){const x=e.code,{isTop:D,isRight:M,isLeft:T,isBottom:L,maxScroll:q,minScroll:P}=hy(A),B=n_(A),W={x:Math.min(x===dt.Right?B.right-B.width/2:B.right,Math.max(x===dt.Right?B.left:B.left+B.width/2,y.x)),y:Math.min(x===dt.Down?B.bottom-B.height/2:B.bottom,Math.max(x===dt.Down?B.top:B.top+B.height/2,y.y))},he=x===dt.Right&&!M||x===dt.Left&&!T,Se=x===dt.Down&&!L||x===dt.Up&&!D;if(he&&W.x!==y.x){const be=A.scrollLeft+S.x,Ue=x===dt.Right&&be<=q.x||x===dt.Left&&be>=P.x;if(Ue&&!S.y){A.scrollTo({left:be,behavior:d});return}Ue?v.x=A.scrollLeft-be:v.x=x===dt.Right?A.scrollLeft-q.x:A.scrollLeft-P.x,v.x&&A.scrollBy({left:-v.x,behavior:d});break}else if(Se&&W.y!==y.y){const be=A.scrollTop+S.y,Ue=x===dt.Down&&be<=q.y||x===dt.Up&&be>=P.y;if(Ue&&!S.x){A.scrollTo({top:be,behavior:d});return}Ue?v.y=A.scrollTop-be:v.y=x===dt.Down?A.scrollTop-q.y:A.scrollTop-P.y,v.y&&A.scrollBy({top:-v.y,behavior:d});break}}this.handleMove(e,ms(To(y,this.referenceCoordinates),v))}}}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()}}wf.activators=[{eventName:"onKeyDown",handler:(s,e,n)=>{let{keyboardCodes:a=my,onActivation:i}=e,{active:l}=n;const{code:c}=s.nativeEvent;if(a.start.includes(c)){const d=l.activatorNode.current;return d&&s.target!==d?!1:(s.preventDefault(),i?.({event:s.nativeEvent}),!0)}return!1}}];function yy(s){return!!(s&&"distance"in s)}function by(s){return!!(s&&"delay"in s)}class Cf{constructor(e,n,a){var i;a===void 0&&(a=o_(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:c}=l;this.props=e,this.events=n,this.document=gs(c),this.documentListeners=new Ro(this.document),this.listeners=new Ro(a),this.windowListeners=new Ro(In(c)),this.initialCoordinates=(i=mf(l))!=null?i:_r,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(ir.Resize,this.handleCancel),this.windowListeners.add(ir.DragStart,gy),this.windowListeners.add(ir.VisibilityChange,this.handleCancel),this.windowListeners.add(ir.ContextMenu,gy),this.documentListeners.add(ir.Keydown,this.handleKeydown),n){if(a!=null&&a({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(by(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(yy(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(ir.Click,l_,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(ir.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:a,initialCoordinates:i,props:l}=this,{onMove:c,options:{activationConstraint:d}}=l;if(!i)return;const f=(n=mf(e))!=null?n:_r,h=To(i,f);if(!a&&d){if(yy(d)){if(d.tolerance!=null&&Sf(h,d.tolerance))return this.handleCancel();if(Sf(h,d.distance))return this.handleStart()}if(by(d)&&Sf(h,d.tolerance))return this.handleCancel();this.handlePending(d,h);return}e.cancelable&&e.preventDefault(),c(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===dt.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const u_={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Ef extends Cf{constructor(e){const{event:n}=e,a=gs(n.target);super(e,u_,a)}}Ef.activators=[{eventName:"onPointerDown",handler:(s,e)=>{let{nativeEvent:n}=s,{onActivation:a}=e;return!n.isPrimary||n.button!==0?!1:(a?.({event:n}),!0)}}];const d_={move:{name:"mousemove"},end:{name:"mouseup"}};var _f;(function(s){s[s.RightClick=2]="RightClick"})(_f||(_f={}));class f_ extends Cf{constructor(e){super(e,d_,gs(e.event.target))}}f_.activators=[{eventName:"onMouseDown",handler:(s,e)=>{let{nativeEvent:n}=s,{onActivation:a}=e;return n.button===_f.RightClick?!1:(a?.({event:n}),!0)}}];const Af={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class h_ extends Cf{constructor(e){super(e,Af)}static setup(){return window.addEventListener(Af.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Af.move.name,e)};function e(){}}}h_.activators=[{eventName:"onTouchStart",handler:(s,e)=>{let{nativeEvent:n}=s,{onActivation:a}=e;const{touches:i}=n;return i.length>1?!1:(a?.({event:n}),!0)}}];var Do;(function(s){s[s.Pointer=0]="Pointer",s[s.DraggableRect=1]="DraggableRect"})(Do||(Do={}));var gc;(function(s){s[s.TreeOrder=0]="TreeOrder",s[s.ReversedTreeOrder=1]="ReversedTreeOrder"})(gc||(gc={}));function p_(s){let{acceleration:e,activator:n=Do.Pointer,canScroll:a,draggingRect:i,enabled:l,interval:c=5,order:d=gc.TreeOrder,pointerCoordinates:f,scrollableAncestors:h,scrollableAncestorRects:m,delta:y,threshold:S}=s;const v=m_({delta:y,disabled:!l}),[_,A]=xE(),x=j.useRef({x:0,y:0}),D=j.useRef({x:0,y:0}),M=j.useMemo(()=>{switch(n){case Do.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case Do.DraggableRect:return i}},[n,i,f]),T=j.useRef(null),L=j.useCallback(()=>{const P=T.current;if(!P)return;const B=x.current.x*D.current.x,W=x.current.y*D.current.y;P.scrollBy(B,W)},[]),q=j.useMemo(()=>d===gc.TreeOrder?[...h].reverse():h,[d,h]);j.useEffect(()=>{if(!l||!h.length||!M){A();return}for(const P of q){if(a?.(P)===!1)continue;const B=h.indexOf(P),W=m[B];if(!W)continue;const{direction:he,speed:Se}=t_(P,W,M,e,S);for(const be of["x","y"])v[be][he[be]]||(Se[be]=0,he[be]=0);if(Se.x>0||Se.y>0){A(),T.current=P,_(L,c),x.current=Se,D.current=he;return}}x.current={x:0,y:0},D.current={x:0,y:0},A()},[e,L,a,A,l,c,JSON.stringify(M),JSON.stringify(v),_,h,q,m,JSON.stringify(S)])}const g_={x:{[gn.Backward]:!1,[gn.Forward]:!1},y:{[gn.Backward]:!1,[gn.Forward]:!1}};function m_(s){let{delta:e,disabled:n}=s;const a=hf(e);return Ao(i=>{if(n||!a||!i)return g_;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 y_(s,e){const n=e!=null?s.get(e):void 0,a=n?n.node.current:null;return Ao(i=>{var l;return e==null?null:(l=a??i)!=null?l:null},[a,e])}function b_(s,e){return j.useMemo(()=>s.reduce((n,a)=>{const{sensor:i}=a,l=i.activators.map(c=>({eventName:c.eventName,handler:e(c.handler,a)}));return[...n,...l]},[]),[s,e])}var Oo;(function(s){s[s.Always=0]="Always",s[s.BeforeDragging=1]="BeforeDragging",s[s.WhileDragging=2]="WhileDragging"})(Oo||(Oo={}));var xf;(function(s){s.Optimized="optimized"})(xf||(xf={}));const vy=new Map;function v_(s,e){let{dragging:n,dependencies:a,config:i}=e;const[l,c]=j.useState(null),{frequency:d,measure:f,strategy:h}=i,m=j.useRef(s),y=x(),S=_o(y),v=j.useCallback(function(D){D===void 0&&(D=[]),!S.current&&c(M=>M===null?D:M.concat(D.filter(T=>!M.includes(T))))},[S]),_=j.useRef(null),A=Ao(D=>{if(y&&!n)return vy;if(!D||D===vy||m.current!==s||l!=null){const M=new Map;for(let T of s){if(!T)continue;if(l&&l.length>0&&!l.includes(T.id)&&T.rect.current){M.set(T.id,T.rect.current);continue}const L=T.node.current,q=L?new vf(f(L),L):null;T.rect.current=q,q&&M.set(T.id,q)}return M}return D},[s,l,n,y,f]);return j.useEffect(()=>{m.current=s},[s]),j.useEffect(()=>{y||v()},[n,y]),j.useEffect(()=>{l&&l.length>0&&c(null)},[JSON.stringify(l)]),j.useEffect(()=>{y||typeof d!="number"||_.current!==null||(_.current=setTimeout(()=>{v(),_.current=null},d))},[d,y,v,...a]),{droppableRects:A,measureDroppableContainers:v,measuringScheduled:l!=null};function x(){switch(h){case Oo.Always:return!1;case Oo.BeforeDragging:return n;default:return!n}}}function Sy(s,e){return Ao(n=>s?n||(typeof e=="function"?e(s):s):null,[e,s])}function S_(s,e){return Sy(s,e)}function w_(s){let{callback:e,disabled:n}=s;const a=ff(e),i=j.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:l}=window;return new l(a)},[a,n]);return j.useEffect(()=>()=>i?.disconnect(),[i]),i}function mc(s){let{callback:e,disabled:n}=s;const a=ff(e),i=j.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:l}=window;return new l(a)},[n]);return j.useEffect(()=>()=>i?.disconnect(),[i]),i}function C_(s){return new vf(ys(s),s)}function wy(s,e,n){e===void 0&&(e=C_);const[a,i]=j.useState(null);function l(){i(f=>{if(!s)return null;if(s.isConnected===!1){var h;return(h=f??n)!=null?h:null}const m=e(s);return JSON.stringify(f)===JSON.stringify(m)?f:m})}const c=w_({callback(f){if(s)for(const h of f){const{type:m,target:y}=h;if(m==="childList"&&y instanceof HTMLElement&&y.contains(s)){l();break}}}}),d=mc({callback:l});return Pr(()=>{l(),s?(d?.observe(s),c?.observe(document.body,{childList:!0,subtree:!0})):(d?.disconnect(),c?.disconnect())},[s]),a}function E_(s){const e=Sy(s);return oy(s,e)}const Cy=[];function __(s){const e=j.useRef(s),n=Ao(a=>s?a&&a!==Cy&&s&&e.current&&s.parentNode===e.current.parentNode?a:pc(s):Cy,[s]);return j.useEffect(()=>{e.current=s},[s]),n}function A_(s){const[e,n]=j.useState(null),a=j.useRef(s),i=j.useCallback(l=>{const c=yf(l.target);c&&n(d=>d?(d.set(c,bf(c)),new Map(d)):null)},[]);return j.useEffect(()=>{const l=a.current;if(s!==l){c(l);const d=s.map(f=>{const h=yf(f);return h?(h.addEventListener("scroll",i,{passive:!0}),[h,bf(h)]):null}).filter(f=>f!=null);n(d.length?new Map(d):null),a.current=s}return()=>{c(s),c(l)};function c(d){d.forEach(f=>{const h=yf(f);h?.removeEventListener("scroll",i)})}},[i,s]),j.useMemo(()=>s.length?e?Array.from(e.values()).reduce((l,c)=>ms(l,c),_r):py(s):_r,[s,e])}function Ey(s,e){e===void 0&&(e=[]);const n=j.useRef(null);return j.useEffect(()=>{n.current=null},e),j.useEffect(()=>{const a=s!==_r;a&&!n.current&&(n.current=s),!a&&n.current&&(n.current=null)},[s]),n.current?To(s,n.current):_r}function x_(s){j.useEffect(()=>{if(!dc)return;const e=s.map(n=>{let{sensor:a}=n;return a.setup==null?void 0:a.setup()});return()=>{for(const n of e)n?.()}},s.map(e=>{let{sensor:n}=e;return n}))}function T_(s,e){return j.useMemo(()=>s.reduce((n,a)=>{let{eventName:i,handler:l}=a;return n[i]=c=>{l(c,e)},n},{}),[s,e])}function _y(s){return j.useMemo(()=>s?JE(s):null,[s])}const Ay=[];function k_(s,e){e===void 0&&(e=ys);const[n]=s,a=_y(n?In(n):null),[i,l]=j.useState(Ay);function c(){l(()=>s.length?s.map(f=>fy(f)?a:new vf(e(f),f)):Ay)}const d=mc({callback:c});return Pr(()=>{d?.disconnect(),c(),s.forEach(f=>d?.observe(f))},[s]),i}function R_(s){if(!s)return null;if(s.children.length>1)return s;const e=s.children[0];return Eo(e)?e:s}function D_(s){let{measure:e}=s;const[n,a]=j.useState(null),i=j.useCallback(h=>{for(const{target:m}of h)if(Eo(m)){a(y=>{const S=e(m);return y?{...y,width:S.width,height:S.height}:S});break}},[e]),l=mc({callback:i}),c=j.useCallback(h=>{const m=R_(h);l?.disconnect(),m&&l?.observe(m),a(m?e(m):null)},[e,l]),[d,f]=fc(c);return j.useMemo(()=>({nodeRef:d,rect:n,setRef:f}),[n,d,f])}const O_=[{sensor:Ef,options:{}},{sensor:wf,options:{}}],L_={current:{}},yc={draggable:{measure:ly},droppable:{measure:ly,strategy:Oo.WhileDragging,frequency:xf.Optimized},dragOverlay:{measure:ys}};class Lo 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 M_={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Lo,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:hc},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:yc,measureDroppableContainers:hc,windowRect:null,measuringScheduled:!1},$_={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:hc,draggableNodes:new Map,over:null,measureDroppableContainers:hc},bc=j.createContext($_),xy=j.createContext(M_);function N_(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Lo}}}function I_(s,e){switch(e.type){case sn.DragStart:return{...s,draggable:{...s.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case sn.DragMove:return s.draggable.active==null?s:{...s,draggable:{...s.draggable,translate:{x:e.coordinates.x-s.draggable.initialCoordinates.x,y:e.coordinates.y-s.draggable.initialCoordinates.y}}};case sn.DragEnd:case sn.DragCancel:return{...s,draggable:{...s.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case sn.RegisterDroppable:{const{element:n}=e,{id:a}=n,i=new Lo(s.droppable.containers);return i.set(a,n),{...s,droppable:{...s.droppable,containers:i}}}case sn.SetDroppableDisabled:{const{id:n,key:a,disabled:i}=e,l=s.droppable.containers.get(n);if(!l||a!==l.key)return s;const c=new Lo(s.droppable.containers);return c.set(n,{...l,disabled:i}),{...s,droppable:{...s.droppable,containers:c}}}case sn.UnregisterDroppable:{const{id:n,key:a}=e,i=s.droppable.containers.get(n);if(!i||a!==i.key)return s;const l=new Lo(s.droppable.containers);return l.delete(n),{...s,droppable:{...s.droppable,containers:l}}}default:return s}}function j_(s){let{disabled:e}=s;const{active:n,activatorEvent:a,draggableNodes:i}=j.useContext(bc),l=hf(a),c=hf(n?.id);return j.useEffect(()=>{if(!e&&!a&&l&&c!=null){if(!gf(l)||document.activeElement===l.target)return;const d=i.get(c);if(!d)return;const{activatorNode:f,node:h}=d;if(!f.current&&!h.current)return;requestAnimationFrame(()=>{for(const m of[f.current,h.current]){if(!m)continue;const y=RE(m);if(y){y.focus();break}}})}},[a,e,i,c,l]),null}function H_(s,e){let{transform:n,...a}=e;return s!=null&&s.length?s.reduce((i,l)=>l({transform:i,...a}),n):n}function z_(s){return j.useMemo(()=>({draggable:{...yc.draggable,...s?.draggable},droppable:{...yc.droppable,...s?.droppable},dragOverlay:{...yc.dragOverlay,...s?.dragOverlay}}),[s?.draggable,s?.droppable,s?.dragOverlay])}function U_(s){let{activeNode:e,measure:n,initialRect:a,config:i=!0}=s;const l=j.useRef(!1),{x:c,y:d}=typeof i=="boolean"?{x:i,y:i}:i;Pr(()=>{if(!c&&!d||!e){l.current=!1;return}if(l.current||!a)return;const h=e?.node.current;if(!h||h.isConnected===!1)return;const m=n(h),y=oy(m,a);if(c||(y.x=0),d||(y.y=0),l.current=!0,Math.abs(y.x)>0||Math.abs(y.y)>0){const S=cy(h);S&&S.scrollBy({top:y.y,left:y.x})}},[e,c,d,a,n])}const Ty=j.createContext({..._r,scaleX:1,scaleY:1});var La;(function(s){s[s.Uninitialized=0]="Uninitialized",s[s.Initializing=1]="Initializing",s[s.Initialized=2]="Initialized"})(La||(La={}));const P_=j.memo(function(e){var n,a,i,l;let{id:c,accessibility:d,autoScroll:f=!0,children:h,sensors:m=O_,collisionDetection:y=GE,measuring:S,modifiers:v,..._}=e;const A=j.useReducer(I_,void 0,N_),[x,D]=A,[M,T]=NE(),[L,q]=j.useState(La.Uninitialized),P=L===La.Initialized,{draggable:{active:B,nodes:W,translate:he},droppable:{containers:Se}}=x,be=B!=null?W.get(B):null,Ue=j.useRef({initial:null,translated:null}),Ve=j.useMemo(()=>{var pe;return B!=null?{id:B,data:(pe=be?.data)!=null?pe:L_,rect:Ue}:null},[B,be]),Ge=j.useRef(null),[Ct,J]=j.useState(null),[ue,Me]=j.useState(null),te=_o(_,Object.values(_)),ge=xo("DndDescribedBy",c),N=j.useMemo(()=>Se.getEnabled(),[Se]),k=z_(S),{droppableRects:de,measureDroppableContainers:fe,measuringScheduled:xe}=v_(N,{dragging:P,dependencies:[he.x,he.y],config:k.droppable}),ee=y_(W,B),_e=j.useMemo(()=>ue?mf(ue):null,[ue]),Be=ve(),Re=S_(ee,k.draggable.measure);U_({activeNode:B!=null?W.get(B):null,config:Be.layoutShiftCompensation,initialRect:Re,measure:k.draggable.measure});const Ie=wy(ee,k.draggable.measure,Re),Et=wy(ee?ee.parentElement:null),lt=j.useRef({activatorEvent:null,active:null,activeNode:ee,collisionRect:null,collisions:null,droppableRects:de,draggableNodes:W,draggingNode:null,draggingNodeRect:null,droppableContainers:Se,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Lt=Se.getNodeFor((n=lt.current.over)==null?void 0:n.id),St=D_({measure:k.dragOverlay.measure}),At=(a=St.nodeRef.current)!=null?a:ee,Oe=P?(i=St.rect)!=null?i:Ie:null,rt=!!(St.nodeRef.current&&St.rect),on=E_(rt?null:Ie),$t=_y(At?In(At):null),Vt=__(P?Lt??ee:null),ln=k_(Vt),cn=H_(v,{transform:{x:he.x-on.x,y:he.y-on.y,scaleX:1,scaleY:1},activatorEvent:ue,active:Ve,activeNodeRect:Ie,containerNodeRect:Et,draggingNodeRect:Oe,over:lt.current.over,overlayNodeRect:St.rect,scrollableAncestors:Vt,scrollableAncestorRects:ln,windowRect:$t}),Gr=_e?ms(_e,he):null,Kt=A_(Vt),Ai=Ey(Kt),aa=Ey(Kt,[Ie]),bn=ms(cn,Ai),Ln=Oe?KE(Oe,cn):null,at=Ve&&Ln?y({active:Ve,collisionRect:Ln,droppableRects:de,droppableContainers:N,pointerCoordinates:Gr}):null,Hn=iy(at,"id"),[vn,ia]=j.useState(null),lr=rt?cn:ms(cn,aa),un=FE(lr,(l=vn?.rect)!=null?l:null,Ie),kn=j.useRef(null),dn=j.useCallback((pe,Ce)=>{let{sensor:Ae,options:Ke}=Ce;if(Ge.current==null)return;const Te=W.get(Ge.current);if(!Te)return;const $e=pe.nativeEvent,ke=new Ae({active:Ge.current,activeNode:Te,event:$e,options:Ke,context:lt,onAbort(He){if(!W.get(He))return;const{onDragAbort:we}=te.current,je={id:He};we?.(je),M({type:"onDragAbort",event:je})},onPending(He,Fe,we,je){if(!W.get(He))return;const{onDragPending:kt}=te.current,jt={id:He,constraint:Fe,initialCoordinates:we,offset:je};kt?.(jt),M({type:"onDragPending",event:jt})},onStart(He){const Fe=Ge.current;if(Fe==null)return;const we=W.get(Fe);if(!we)return;const{onDragStart:je}=te.current,nt={activatorEvent:$e,active:{id:Fe,data:we.data,rect:Ue}};Oa.unstable_batchedUpdates(()=>{je?.(nt),q(La.Initializing),D({type:sn.DragStart,initialCoordinates:He,active:Fe}),M({type:"onDragStart",event:nt}),J(kn.current),Me($e)})},onMove(He){D({type:sn.DragMove,coordinates:He})},onEnd:tt(sn.DragEnd),onCancel:tt(sn.DragCancel)});kn.current=ke;function tt(He){return async function(){const{active:we,collisions:je,over:nt,scrollAdjustedTranslate:kt}=lt.current;let jt=null;if(we&&kt){const{cancelDrop:Mn}=te.current;jt={activatorEvent:$e,active:we,collisions:je,delta:kt,over:nt},He===sn.DragEnd&&typeof Mn=="function"&&await Promise.resolve(Mn(jt))&&(He=sn.DragCancel)}Ge.current=null,Oa.unstable_batchedUpdates(()=>{D({type:He}),q(La.Uninitialized),ia(null),J(null),Me(null),kn.current=null;const Mn=He===sn.DragEnd?"onDragEnd":"onDragCancel";if(jt){const Ut=te.current[Mn];Ut?.(jt),M({type:Mn,event:jt})}})}}},[W]),F=j.useCallback((pe,Ce)=>(Ae,Ke)=>{const Te=Ae.nativeEvent,$e=W.get(Ke);if(Ge.current!==null||!$e||Te.dndKit||Te.defaultPrevented)return;const ke={active:$e};pe(Ae,Ce.options,ke)===!0&&(Te.dndKit={capturedBy:Ce.sensor},Ge.current=Ke,dn(Ae,Ce))},[W,dn]),se=b_(m,F);x_(m),Pr(()=>{Ie&&L===La.Initializing&&q(La.Initialized)},[Ie,L]),j.useEffect(()=>{const{onDragMove:pe}=te.current,{active:Ce,activatorEvent:Ae,collisions:Ke,over:Te}=lt.current;if(!Ce||!Ae)return;const $e={active:Ce,activatorEvent:Ae,collisions:Ke,delta:{x:bn.x,y:bn.y},over:Te};Oa.unstable_batchedUpdates(()=>{pe?.($e),M({type:"onDragMove",event:$e})})},[bn.x,bn.y]),j.useEffect(()=>{const{active:pe,activatorEvent:Ce,collisions:Ae,droppableContainers:Ke,scrollAdjustedTranslate:Te}=lt.current;if(!pe||Ge.current==null||!Ce||!Te)return;const{onDragOver:$e}=te.current,ke=Ke.get(Hn),tt=ke&&ke.rect.current?{id:ke.id,rect:ke.rect.current,data:ke.data,disabled:ke.disabled}:null,He={active:pe,activatorEvent:Ce,collisions:Ae,delta:{x:Te.x,y:Te.y},over:tt};Oa.unstable_batchedUpdates(()=>{ia(tt),$e?.(He),M({type:"onDragOver",event:He})})},[Hn]),Pr(()=>{lt.current={activatorEvent:ue,active:Ve,activeNode:ee,collisionRect:Ln,collisions:at,droppableRects:de,draggableNodes:W,draggingNode:At,draggingNodeRect:Oe,droppableContainers:Se,over:vn,scrollableAncestors:Vt,scrollAdjustedTranslate:bn},Ue.current={initial:Oe,translated:Ln}},[Ve,ee,at,Ln,W,At,Oe,de,Se,vn,Vt,bn]),p_({...Be,delta:he,draggingRect:Ln,pointerCoordinates:Gr,scrollableAncestors:Vt,scrollableAncestorRects:ln});const ce=j.useMemo(()=>({active:Ve,activeNode:ee,activeNodeRect:Ie,activatorEvent:ue,collisions:at,containerNodeRect:Et,dragOverlay:St,draggableNodes:W,droppableContainers:Se,droppableRects:de,over:vn,measureDroppableContainers:fe,scrollableAncestors:Vt,scrollableAncestorRects:ln,measuringConfiguration:k,measuringScheduled:xe,windowRect:$t}),[Ve,ee,Ie,ue,at,Et,St,W,Se,de,vn,fe,Vt,ln,k,xe,$t]),Z=j.useMemo(()=>({activatorEvent:ue,activators:se,active:Ve,activeNodeRect:Ie,ariaDescribedById:{draggable:ge},dispatch:D,draggableNodes:W,over:vn,measureDroppableContainers:fe}),[ue,se,Ve,Ie,D,ge,W,vn,fe]);return Xe.createElement(ey.Provider,{value:T},Xe.createElement(bc.Provider,{value:Z},Xe.createElement(xy.Provider,{value:ce},Xe.createElement(Ty.Provider,{value:un},h)),Xe.createElement(j_,{disabled:d?.restoreFocus===!1})),Xe.createElement(HE,{...d,hiddenTextDescribedById:ge}));function ve(){const pe=Ct?.autoScrollEnabled===!1,Ce=typeof f=="object"?f.enabled===!1:f===!1,Ae=P&&!pe&&!Ce;return typeof f=="object"?{...f,enabled:Ae}:{enabled:Ae}}}),B_=j.createContext(null),ky="button",q_="Draggable";function G_(s){let{id:e,data:n,disabled:a=!1,attributes:i}=s;const l=xo(q_),{activators:c,activatorEvent:d,active:f,activeNodeRect:h,ariaDescribedById:m,draggableNodes:y,over:S}=j.useContext(bc),{role:v=ky,roleDescription:_="draggable",tabIndex:A=0}=i??{},x=f?.id===e,D=j.useContext(x?Ty:B_),[M,T]=fc(),[L,q]=fc(),P=T_(c,e),B=_o(n);Pr(()=>(y.set(e,{id:e,key:l,node:M,activatorNode:L,data:B}),()=>{const he=y.get(e);he&&he.key===l&&y.delete(e)}),[y,e]);const W=j.useMemo(()=>({role:v,tabIndex:A,"aria-disabled":a,"aria-pressed":x&&v===ky?!0:void 0,"aria-roledescription":_,"aria-describedby":m.draggable}),[a,v,A,x,_,m.draggable]);return{active:f,activatorEvent:d,activeNodeRect:h,attributes:W,isDragging:x,listeners:a?void 0:P,node:M,over:S,setNodeRef:T,setActivatorNodeRef:q,transform:D}}function F_(){return j.useContext(xy)}const V_="Droppable",K_={timeout:25};function W_(s){let{data:e,disabled:n=!1,id:a,resizeObserverConfig:i}=s;const l=xo(V_),{active:c,dispatch:d,over:f,measureDroppableContainers:h}=j.useContext(bc),m=j.useRef({disabled:n}),y=j.useRef(!1),S=j.useRef(null),v=j.useRef(null),{disabled:_,updateMeasurementsFor:A,timeout:x}={...K_,...i},D=_o(A??a),M=j.useCallback(()=>{if(!y.current){y.current=!0;return}v.current!=null&&clearTimeout(v.current),v.current=setTimeout(()=>{h(Array.isArray(D.current)?D.current:[D.current]),v.current=null},x)},[x]),T=mc({callback:M,disabled:_||!c}),L=j.useCallback((W,he)=>{T&&(he&&(T.unobserve(he),y.current=!1),W&&T.observe(W))},[T]),[q,P]=fc(L),B=_o(e);return j.useEffect(()=>{!T||!q.current||(T.disconnect(),y.current=!1,T.observe(q.current))},[q,T]),j.useEffect(()=>(d({type:sn.RegisterDroppable,element:{id:a,key:l,disabled:n,node:q,rect:S,data:B}}),()=>d({type:sn.UnregisterDroppable,key:l,id:a})),[a]),j.useEffect(()=>{n!==m.current.disabled&&(d({type:sn.SetDroppableDisabled,id:a,key:l,disabled:n}),m.current.disabled=n)},[a,l,n,d]),{active:c,rect:S,isOver:f?.id===a,node:q,over:f,setNodeRef:P}}function Tf(s,e,n){const a=s.slice();return a.splice(n<0?a.length+n:n,0,a.splice(e,1)[0]),a}function Y_(s,e){return s.reduce((n,a,i)=>{const l=e.get(a);return l&&(n[i]=l),n},Array(s.length))}function vc(s){return s!==null&&s>=0}function X_(s,e){if(s===e)return!0;if(s.length!==e.length)return!1;for(let n=0;n<s.length;n++)if(s[n]!==e[n])return!1;return!0}function J_(s){return typeof s=="boolean"?{draggable:s,droppable:s}:s}const Sc={scaleX:1,scaleY:1},Q_=s=>{var e;let{rects:n,activeNodeRect:a,activeIndex:i,overIndex:l,index:c}=s;const d=(e=n[i])!=null?e:a;if(!d)return null;const f=Z_(n,c,i);if(c===i){const h=n[l];return h?{x:i<l?h.left+h.width-(d.left+d.width):h.left-d.left,y:0,...Sc}:null}return c>i&&c<=l?{x:-d.width-f,y:0,...Sc}:c<i&&c>=l?{x:d.width+f,y:0,...Sc}:{x:0,y:0,...Sc}};function Z_(s,e,n){const a=s[e],i=s[e-1],l=s[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 kf=s=>{let{rects:e,activeIndex:n,overIndex:a,index:i}=s;const l=Tf(e,a,n),c=e[i],d=l[i];return!d||!c?null:{x:d.left-c.left,y:d.top-c.top,scaleX:d.width/c.width,scaleY:d.height/c.height}},wc={scaleX:1,scaleY:1},eA=s=>{var e;let{activeIndex:n,activeNodeRect:a,index:i,rects:l,overIndex:c}=s;const d=(e=l[n])!=null?e:a;if(!d)return null;if(i===n){const h=l[c];return h?{x:0,y:n<c?h.top+h.height-(d.top+d.height):h.top-d.top,...wc}:null}const f=tA(l,i,n);return i>n&&i<=c?{x:0,y:-d.height-f,...wc}:i<n&&i>=c?{x:0,y:d.height+f,...wc}:{x:0,y:0,...wc}};function tA(s,e,n){const a=s[e],i=s[e-1],l=s[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 Ry="Sortable",Dy=Xe.createContext({activeIndex:-1,containerId:Ry,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:kf,disabled:{draggable:!1,droppable:!1}});function nA(s){let{children:e,id:n,items:a,strategy:i=kf,disabled:l=!1}=s;const{active:c,dragOverlay:d,droppableRects:f,over:h,measureDroppableContainers:m}=F_(),y=xo(Ry,n),S=d.rect!==null,v=j.useMemo(()=>a.map(P=>typeof P=="object"&&"id"in P?P.id:P),[a]),_=c!=null,A=c?v.indexOf(c.id):-1,x=h?v.indexOf(h.id):-1,D=j.useRef(v),M=!X_(v,D.current),T=x!==-1&&A===-1||M,L=J_(l);Pr(()=>{M&&_&&m(v)},[M,v,_,m]),j.useEffect(()=>{D.current=v},[v]);const q=j.useMemo(()=>({activeIndex:A,containerId:y,disabled:L,disableTransforms:T,items:v,overIndex:x,useDragOverlay:S,sortedRects:Y_(v,f),strategy:i}),[A,y,L.draggable,L.droppable,T,v,x,f,S,i]);return Xe.createElement(Dy.Provider,{value:q},e)}const rA=s=>{let{id:e,items:n,activeIndex:a,overIndex:i}=s;return Tf(n,a,i).indexOf(e)},aA=s=>{let{containerId:e,isSorting:n,wasDragging:a,index:i,items:l,newIndex:c,previousItems:d,previousContainerId:f,transition:h}=s;return!h||!a||d!==l&&i===c?!1:n?!0:c!==i&&e===f},iA={duration:200,easing:"ease"},Oy="transform",sA=ko.Transition.toString({property:Oy,duration:0,easing:"linear"}),oA={roleDescription:"sortable"};function lA(s){let{disabled:e,index:n,node:a,rect:i}=s;const[l,c]=j.useState(null),d=j.useRef(n);return Pr(()=>{if(!e&&n!==d.current&&a.current){const f=i.current;if(f){const h=ys(a.current,{ignoreTransform:!0}),m={x:f.left-h.left,y:f.top-h.top,scaleX:f.width/h.width,scaleY:f.height/h.height};(m.x||m.y)&&c(m)}}n!==d.current&&(d.current=n)},[e,n,a,i]),j.useEffect(()=>{l&&c(null)},[l]),l}function cA(s){let{animateLayoutChanges:e=aA,attributes:n,disabled:a,data:i,getNewIndex:l=rA,id:c,strategy:d,resizeObserverConfig:f,transition:h=iA}=s;const{items:m,containerId:y,activeIndex:S,disabled:v,disableTransforms:_,sortedRects:A,overIndex:x,useDragOverlay:D,strategy:M}=j.useContext(Dy),T=uA(a,v),L=m.indexOf(c),q=j.useMemo(()=>({sortable:{containerId:y,index:L,items:m},...i}),[y,i,L,m]),P=j.useMemo(()=>m.slice(m.indexOf(c)),[m,c]),{rect:B,node:W,isOver:he,setNodeRef:Se}=W_({id:c,data:q,disabled:T.droppable,resizeObserverConfig:{updateMeasurementsFor:P,...f}}),{active:be,activatorEvent:Ue,activeNodeRect:Ve,attributes:Ge,setNodeRef:Ct,listeners:J,isDragging:ue,over:Me,setActivatorNodeRef:te,transform:ge}=G_({id:c,data:q,attributes:{...oA,...n},disabled:T.draggable}),N=AE(Se,Ct),k=!!be,de=k&&!_&&vc(S)&&vc(x),fe=!D&&ue,xe=fe&&de?ge:null,_e=de?xe??(d??M)({rects:A,activeNodeRect:Ve,activeIndex:S,overIndex:x,index:L}):null,Be=vc(S)&&vc(x)?l({id:c,items:m,activeIndex:S,overIndex:x}):L,Re=be?.id,Ie=j.useRef({activeId:Re,items:m,newIndex:Be,containerId:y}),Et=m!==Ie.current.items,lt=e({active:be,containerId:y,isDragging:ue,isSorting:k,id:c,index:L,items:m,newIndex:Ie.current.newIndex,previousItems:Ie.current.items,previousContainerId:Ie.current.containerId,transition:h,wasDragging:Ie.current.activeId!=null}),Lt=lA({disabled:!lt,index:L,node:W,rect:B});return j.useEffect(()=>{k&&Ie.current.newIndex!==Be&&(Ie.current.newIndex=Be),y!==Ie.current.containerId&&(Ie.current.containerId=y),m!==Ie.current.items&&(Ie.current.items=m)},[k,Be,y,m]),j.useEffect(()=>{if(Re===Ie.current.activeId)return;if(Re!=null&&Ie.current.activeId==null){Ie.current.activeId=Re;return}const At=setTimeout(()=>{Ie.current.activeId=Re},50);return()=>clearTimeout(At)},[Re]),{active:be,activeIndex:S,attributes:Ge,data:q,rect:B,index:L,newIndex:Be,items:m,isOver:he,isSorting:k,isDragging:ue,listeners:J,node:W,overIndex:x,over:Me,setNodeRef:N,setActivatorNodeRef:te,setDroppableNodeRef:Se,setDraggableNodeRef:Ct,transform:Lt??_e,transition:St()};function St(){if(Lt||Et&&Ie.current.newIndex===L)return sA;if(!(fe&&!gf(Ue)||!h)&&(k||lt))return ko.Transition.toString({...h,property:Oy})}}function uA(s,e){var n,a;return typeof s=="boolean"?{draggable:s,droppable:!1}:{draggable:(n=s?.draggable)!=null?n:e.draggable,droppable:(a=s?.droppable)!=null?a:e.droppable}}function Cc(s){if(!s)return!1;const e=s.data.current;return!!(e&&"sortable"in e&&typeof e.sortable=="object"&&"containerId"in e.sortable&&"items"in e.sortable&&"index"in e.sortable)}const dA=[dt.Down,dt.Right,dt.Up,dt.Left],fA=(s,e)=>{let{context:{active:n,collisionRect:a,droppableRects:i,droppableContainers:l,over:c,scrollableAncestors:d}}=e;if(dA.includes(s.code)){if(s.preventDefault(),!n||!a)return;const f=[];l.getEnabled().forEach(y=>{if(!y||y!=null&&y.disabled)return;const S=i.get(y.id);if(S)switch(s.code){case dt.Down:a.top<S.top&&f.push(y);break;case dt.Up:a.top>S.top&&f.push(y);break;case dt.Left:a.left>S.left&&f.push(y);break;case dt.Right:a.left<S.left&&f.push(y);break}});const h=BE({collisionRect:a,droppableRects:i,droppableContainers:f});let m=iy(h,"id");if(m===c?.id&&h.length>1&&(m=h[1].id),m!=null){const y=l.get(n.id),S=l.get(m),v=S?i.get(S.id):null,_=S?.node.current;if(_&&v&&y&&S){const x=pc(_).some((P,B)=>d[B]!==P),D=Ly(y,S),M=hA(y,S),T=x||!D?{x:0,y:0}:{x:M?a.width-v.width:0,y:M?a.height-v.height:0},L={x:v.left,y:v.top};return T.x&&T.y?L:To(L,T)}}}};function Ly(s,e){return!Cc(s)||!Cc(e)?!1:s.data.current.sortable.containerId===e.data.current.sortable.containerId}function hA(s,e){return!Cc(s)||!Cc(e)||!Ly(s,e)?!1:s.data.current.sortable.index<e.data.current.sortable.index}const pA={verticalList:eA,horizontalList:Q_,rectSorting:kf},gA=({items:s,itemKey:e,strategy:n,children:a,onSortEnd:i,onSortStart:l,sortVersion:c})=>{const d=j.useId(),f=j.useRef({inProgress:!1,lastSortTime:0,lastActiveId:null}),h=zE(ty(Ef,{activationConstraint:{distance:5}}),ty(wf,{coordinateGetter:fA})),m=j.useCallback(v=>{f.current={inProgress:!0,lastSortTime:Date.now(),lastActiveId:v.active.id},l?.({activeId:v.active.id})},[l]),y=j.useCallback(v=>{const{active:_,over:A}=v,x=Date.now();if(!A||_.id===A.id){f.current.inProgress=!1;return}const{lastSortTime:D,lastActiveId:M,inProgress:T}=f.current;if(M===_.id&&x-D<500&&!T)return;f.current={inProgress:!1,lastSortTime:x,lastActiveId:_.id};const L=s.findIndex(P=>String(P[e])===String(_.id)),q=s.findIndex(P=>String(P[e])===String(A.id));if(L!==-1&&q!==-1&&L!==q){const P=Tf(s,L,q);i?.(P,{oldIndex:L,newIndex:q})}},[s,e,i]),S=s.map(v=>String(v[e]));return gt.jsx(P_,{id:d,sensors:h,collisionDetection:PE,onDragStart:m,onDragEnd:y,children:gt.jsx(nA,{items:S,strategy:pA[n],children:a})},c!==void 0?`${d}-v${c}`:d)},My=j.createContext(null),mA=({value:s,children:e})=>gt.jsx(My.Provider,{value:s,children:e}),yA=()=>j.useContext(My),bA=({id:s,handle:e,as:n="div",children:a})=>{const{attributes:i,listeners:l,setNodeRef:c,transform:d,transition:f,isDragging:h}=cA({id:s}),m={transform:ko.Transform.toString(d),transition:f,opacity:h?.5:1,position:"relative"};return gt.jsx(n,{ref:c,style:m,...i,...e?{}:l,"data-sortable-item":!0,"data-sortable-id":String(s),"data-dragging":h,children:gt.jsx(mA,{value:{listeners:l,handle:e,isDragging:h},children:a})})},ot=pt("DynamicRenderer");function ta(){try{return window.G7Core?.devTools}catch{return}}function Rf(s,e,n,a){if(typeof s=="string"){if(/\$t:[a-zA-Z_][a-zA-Z0-9_.\-]*/.test(s))try{return e.resolveTranslations(s,n,a)}catch{return s}return s}if(Array.isArray(s))return s.map(i=>Rf(i,e,n,a));if(s&&typeof s=="object"){const i={};for(const[l,c]of Object.entries(s))i[l]=Rf(c,e,n,a);return i}return s}function vA(s){const e=Object.keys(s);return e.length>0&&e.every(n=>/^\d+$/.test(n))}const Ar=(s,e)=>{const n=["errors"],a={...s};for(const i of Object.keys(e)){const l=e[i],c=s[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(c)&&l!==null&&typeof l=="object"&&!Array.isArray(l)&&vA(l)){const d=Object.keys(l).map(h=>parseInt(h,10));if((d.length>0?Math.max(...d):0)>=c.length+d.length+10)a[i]={...l};else{const h=[...c];for(const[m,y]of Object.entries(l)){const S=parseInt(m,10);S>=0&&S<h.length?y!==null&&typeof y=="object"&&!Array.isArray(y)&&h[S]!==null&&typeof h[S]=="object"?h[S]=Ar(h[S],y):h[S]=y:S>=h.length&&(h[S]=y)}a[i]=h}}else l!==null&&typeof l=="object"&&c!==null&&typeof c=="object"&&!Array.isArray(c)?a[i]=Ar(c,l):a[i]=l}return a},Ec=(s,e)=>{let n=null;const a=()=>(n===null&&(n={...s}),n);for(const i of Object.keys(e)){if(!(i in s))continue;const l=e[i],c=s[i];if(l!==null&&typeof l=="object"&&!Array.isArray(l)&&c!==null&&typeof c=="object"&&!Array.isArray(c)){const d=Ec(c,l);if(d===c)continue;Object.keys(d).length===0?delete a()[i]:a()[i]=d}else delete a()[i]}return n??s},SA=s=>{const e={},n=s.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(),c=a.substring(i+1).trim();if(l&&c){const d=l.replace(/-([a-z])/g,(f,h)=>h.toUpperCase());e[d]=c}}return e};class wA extends j.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,n){ot.error(`컴포넌트 렌더링 에러 (ID: ${this.props.componentId}, Name: ${this.props.componentName}):`,e,n)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:gt.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:[gt.jsx("div",{className:"font-semibold mb-1",children:"컴포넌트 로드 실패"}),gt.jsxs("div",{className:"text-xs opacity-80",children:[this.props.componentName&&`[${this.props.componentName}] `,"데이터를 표시할 수 없습니다."]}),this.state.error&>.jsxs("details",{className:"mt-2",children:[gt.jsx("summary",{className:"cursor-pointer text-xs opacity-70 hover:opacity-100",children:"상세 정보"}),gt.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 Br=j.memo(({componentDef:s,dataContext:e,translationContext:n,registry:a,bindingEngine:i,translationEngine:l,actionDispatcher:c,parentComponentContext:d,parentFormContextProp:f,parentDataContext:h,isRootRenderer:m=!1,isInsideIteration:y=!1,isEditMode:S=!1,onComponentSelect:v,onComponentHover:_,onDragStart:A,onDragEnd:x,componentPath:D,layoutKey:M})=>{const[T,L]=j.useState({loadingActions:{}});j.useLayoutEffect(()=>{d||(i.startRenderCycle(),window.__g7SetLocalOverrideKeys||(window.__g7ForcedLocalFields=void 0),window.__g7PendingLocalState=null)});const q=j.useRef(null);j.useLayoutEffect(()=>{if(!d&&e._localInit&&typeof e._localInit=="object"){const{_forceLocalInit:F,_merge:se,...ce}=e._localInit,Z=`${JSON.stringify(ce)}:${F||"no-force"}`;if(q.current!==Z){q.current=Z;const ve=se||"shallow",Ce=window.G7Core?.state?.get?.()?._local||{},Ae=window.__g7PendingLocalState||{},Ke={...Ce,...Ae};ve==="replace"?window.__g7PendingLocalState={loadingActions:Ke.loadingActions||{},...ce,hasChanges:!1}:ve==="deep"?window.__g7PendingLocalState=Ar(Ke,{...ce,hasChanges:!1}):window.__g7PendingLocalState={...Ke,...ce,hasChanges:!1};const Te=window.__g7SetLocalOverrideKeys;Te&&typeof Te=="object"&&(ve==="replace"?window.__g7SetLocalOverrideKeys={...ce,hasChanges:!1}:window.__g7SetLocalOverrideKeys=Ar(Te,{...ce,hasChanges:!1}))}}}),j.useLayoutEffect(()=>{if(!d){const F=window.__g7SetLocalOverrideKeys;if(F){L(ve=>Ec(ve,F));const se=F,ce=window.__g7ForcedLocalFields,Z=window.__g7LastSetLocalSnapshot;queueMicrotask(()=>{window.__g7SetLocalOverrideKeys===se&&(window.__g7SetLocalOverrideKeys=void 0),window.__g7ForcedLocalFields===ce&&(window.__g7ForcedLocalFields=void 0),window.__g7LastSetLocalSnapshot===Z&&(window.__g7LastSetLocalSnapshot=void 0)})}}},[e._local]);const P=j.useRef(M);j.useEffect(()=>{s._fromBase&&M&&P.current!==M&&(P.current=M,L({loadingActions:{}}))},[M,s._fromBase]);const B=j.useRef(""),W=j.useRef(!1),he=j.useRef(null),Se=j.useRef(null),be=j.useRef({}),Ue=j.useRef({}),Ve=j.useRef(h),Ge=_E(),Ct=eE(),J=Ct?.getParentDataContext()??h;j.useEffect(()=>{if(e._localInit&&typeof e._localInit=="object"){const{_forceLocalInit:F,...se}=e._localInit,ce=JSON.stringify(se),Z=F!==void 0,ve=of(),pe=`${ce}:${F||"no-force"}`,Ce=lE({globalTrackedKey:ve.hash,instanceHandledKey:Se.current,trackingKey:pe});if(Ce==="apply"){Se.current=pe,ve.hash=pe,ve.timestamp=F,B.current=ce,Z&&(W.current=!0);const{_merge:Ke,...Te}=se,$e=Ke||"shallow";L(ke=>$e==="replace"?{loadingActions:ke.loadingActions||{},...Te,hasChanges:!1}:$e==="deep"?Ar(ke,{...Te,hasChanges:!1}):{...ke,...Te,hasChanges:!1}),e._globalSetState&&e._globalSetState(ke=>{const tt=ke?._local||{};let He;return $e==="replace"?He={...Te,hasChanges:!1}:$e==="deep"?He=Ar(tt,{...Te,hasChanges:!1}):He={...tt,...Te,hasChanges:!1},{...ke,_local:He}}),i.invalidateCacheByKeys(["_local"]),ot.log("_localInit applied (data changed):",Object.keys(se))}else if(Ce==="prune"){Se.current=pe;const{_merge:Ke,...Te}=se;L(ke=>Ec(ke,Te)),Ec(T,Te)!==T&&(i.invalidateCacheByKeys(["_local"]),ot.log("_localInit pruned (applied by another renderer):",Object.keys(Te)))}he.current=e._localInit,sE(e._localInit)}},[e._localInit,h,i]);const{isTransitioning:ue}=Fm(),Me=gE(),te=f??Me,{width:ge}=cf(),N=yA(),k=j.useMemo(()=>{let F=s;if(s.type==="iterator"&&s.data){const{data:Z,itemName:ve,indexName:pe,...Ce}=s;F={...Ce,iteration:{source:Z,item_var:ve||"item",index_var:pe}}}if(!F.responsive)return F;const se=mi.getMatchingKey(F.responsive,ge);if(!se)return F;const ce=F.responsive[se];return{...F,props:{...F.props,...ce.props},children:ce.children??F.children,text:ce.text??F.text,if:ce.if??F.if,iteration:ce.iteration??F.iteration,__responsiveChildrenKey:ce.children!==void 0?se:void 0}},[s,ge]),de=j.useCallback(F=>{const se=F?.__setStateId;if(L(ce=>{const Z=window.__g7PendingLocalState,pe=window.__g7SetLocalOverrideKeys||Z,Ce=pe?Ar(ce,pe):ce;if(typeof F=="function"){const ke=F(Ce);return Ar(Ce,ke)}const{__mergeMode:Ae,__setStateId:Ke,...Te}=F;let $e;if(Ae==="replace"?$e=Te:Ae==="shallow"?$e={...Ce,...Te}:$e=Ar(Ce,Te),Ae!==void 0){const ke=window.__g7ForcedLocalFields;ke&&(window.__g7ForcedLocalFields={...ke,...Te})}return $e}),se){const ce=ta();if(ce?.isEnabled()){const Z=k.id||"unknown",ve=k.name||"Unknown";setTimeout(()=>{ce.trackComponentRender?.(Z,ve,0,["_local"],[]),ce.completeStateChange?.(se)},0)}}},[k.id,k.name]),fe=d?.state??T,xe=d?.setState??de,ee=j.useMemo(()=>{const F=e._localInit&&e._localInit!==he.current;let se;F&&e._local?se=e._local:se=e._local?Ar(e._local,fe):fe;const ce=window.__g7ForcedLocalFields;ce&&(se=Ar(se,ce));const Z={...e,_local:se},ve=e._computedDefinitions;if(ve&&Object.keys(ve).length>0){const pe=new On,Ce={...Z,...Ge?{_isolated:Ge.state}:{}},Ae={},Ke=ta(),Te=Ke?.isEnabled()??!1;for(const[$e,ke]of Object.entries(ve)){const tt=Te?Date.now():0,He=Te?e._computed?.[$e]:void 0;let Fe;try{if(typeof ke=="string")if(ke.startsWith("{{")&&ke.endsWith("}}")){const we=ke.slice(2,-2).trim(),je=Vn(we)?pe.evaluatePipeExpression(we,Ce,{skipCache:!0}):pe.evaluateExpression(we,Ce,{skipCache:!0});Ae[$e]=je}else Ae[$e]=ke;else if(ke&&typeof ke=="object"&&"$switch"in ke){const we=pe.resolveSwitch(ke,Ce,{skipCache:!0});Ae[$e]=we}}catch(we){ot.warn(`Failed to recalculate computed value: ${$e}`,we),Ae[$e]=e._computed?.[$e],Fe=we instanceof Error?we.message:String(we)}if(Te&&(Fe||He!==Ae[$e])){const je=Date.now()-tt;Ke.trackComputedProperty?.($e,typeof ke=="string"?ke:JSON.stringify(ke),[{type:"_local",path:"_local",value:Z._local}],Ae[$e],je,k.id,Fe),He!==Ae[$e]&&Ke.trackComputedRecalc?.($e,"dependency-change",He,Ae[$e],je,{type:"_local",path:"_local"},k.id)}}Z._computed=Ae}if(Ge&&(Z._isolated=Ge.state),J&&(Z.$parent=J),s.extensionPointProps){const pe=i.resolveObject(s.extensionPointProps,Z,y?{skipCache:!0}:void 0);Z.extensionPointProps=S&&l?Rf(pe,l,n,Z):pe}return s.extensionPointCallbacks&&(Z.extensionPointCallbacks=s.extensionPointCallbacks),S&&(Z.$templateId===void 0&&n?.templateId&&(Z.$templateId=n.templateId),Z.$locale===void 0&&n?.locale&&(Z.$locale=n.locale)),Z},[e,fe,Ge?.state,J,Ct?.version,s.extensionPointProps,s.extensionPointCallbacks]);be.current=ee._local,Ue.current=ee._computed||{},Ve.current=J,j.useEffect(()=>{const F=ta();if(!F?.isEnabled())return;const se=ee._local;se&&F.updateLocalState(se);const ce=ee._computed;ce&&F.updateComputedState(ce),J&&F.updateParentContext?.(J);const Z=k.id||`comp-${Date.now()}`,ve=k.name||"Unknown",pe={global:Object.keys(e._global||{}),local:Object.keys(se||{}),context:d?Object.keys(d.state||{}):[]},Ce={type:d?"componentContext":"dynamicState",hasComponentContext:!!d,parentId:d?"parent":void 0};F.trackComponentStateSource?.(Z,ve,pe,Ce),fe&&Object.keys(fe).length>0&&F.trackDynamicState?.(Z,fe);const Ae=!!(k.expandChildren||k.props?.expandChildren);F.trackContextFlow?.(Z,ve,!!d,Ae,!0)},[ee._local,e,k.id,k.name,d,fe,k.expandChildren,k.props?.expandChildren,J]);const _e=j.useMemo(()=>({state:{...ee._local},setState:xe,stateRef:be,computedRef:Ue,isolatedContext:Ge,parentDataContext:ee}),[ee._local,xe,T,Ge,ee]),Be=j.useMemo(()=>{const F=is({if:k.if,condition:k.condition,conditions:k.conditions},ee,i,k.id);if(k.if||k.condition!==void 0||k.conditions){const ce=ta();ce?.isEnabled()&&k.if&&ce.trackIfCondition(k.id||`if-${Date.now()}`,k.if,F)}return F},[k.if,k.conditions,ee,i,k.id]),Re=j.useMemo(()=>{if(!k.slot)return null;const F=k.slot;if(F.startsWith("{{")&&F.endsWith("}}")){const se=F.slice(2,-2).trim();try{const ce={componentId:k.id,componentName:k.name,propName:"slot"},Z=Vn(se)?i.evaluatePipeExpression(se,ee,void 0,ce):i.evaluateExpression(se,ee,ce);return ot.log(`[Slot] 표현식 평가: "${se}" => "${Z}" (컴포넌트: ${k.id})`),typeof Z=="string"?Z:null}catch(ce){return ot.warn(`slot 표현식 평가 실패 (컴포넌트: ${k.id}):`,ce),null}}return ot.log(`[Slot] 정적 슬롯 ID: "${F}" (컴포넌트: ${k.id})`),F},[k.slot,k.id,ee,i]),Ie=j.useMemo(()=>!Re||!k.id?"":`${k.id}-${Re}-${JSON.stringify(k.slotOrder??0)}`,[Re,k.id,k.slotOrder]),Et=j.useRef(null);j.useEffect(()=>{const F=window.__slotContextValue,se=F?.isEnabled??!1;if(k.slot&&ot.log(`[Slot Registration] 컴포넌트: ${k.id}, isSlotEnabled: ${se}, shouldRender: ${Be}, resolvedSlotId: ${Re}`),!se||!Be){k.slot&&ot.log(`[Slot Registration] 등록 스킵 - isSlotEnabled: ${se}, shouldRender: ${Be}`),Et.current&&k.id&&F&&(F.unregisterFromSlot(Et.current,k.id),Et.current=null);return}if(!Re||!k.id){k.slot&&ot.log(`[Slot Registration] 등록 스킵 - resolvedSlotId: ${Re}, id: ${k.id}`),Et.current&&k.id&&F&&(F.unregisterFromSlot(Et.current,k.id),Et.current=null);return}Et.current&&Et.current!==Re&&F.unregisterFromSlot(Et.current,k.id);const ce={...k,slot:void 0,slotOrder:void 0};return F.registerToSlot(Re,k.id,{componentDef:ce,dataContext:e,order:k.slotOrder??0,parentFormContext:f??null,getParentComponentContext:()=>_e,translationContext:n,registrationKey:Ie}),Et.current=Re,()=>{const Z=window.__slotContextValue;Re&&k.id&&Z&&Z.unregisterFromSlot(Re,k.id)}},[Be,Re,k,e,f,_e,n,Ie]);const lt=j.useCallback(F=>{if(typeof F=="string"){if(Bl(F))return Ed(F);if(ql(F)){const se=[],ce=F.replace(new RegExp(`${oo}([^${pi}]*)${pi}`,"g"),(ve,pe)=>(se.push(pe),`${ka}${se.length-1}${ka}`));let Z=ce;return/\$t:[a-zA-Z0-9._-]+/.test(ce)&&(Z=l.resolveTranslations(ce,n,ee)),Z.replace(new RegExp(`${ka}(\\d+)${ka}`,"g"),(ve,pe)=>se[parseInt(pe)])}if(F.startsWith("$t:defer:"))return F;if(/\$t:[a-zA-Z0-9._-]+/.test(F)){const se=F.trim();return se.startsWith("{")&&se.endsWith("}")||se.startsWith("[")&&se.endsWith("]")?F:l.resolveTranslations(F,n,ee)}return F}if(Array.isArray(F))return F.map(se=>lt(se));if(F&&typeof F=="object"){const se={};for(const[ce,Z]of Object.entries(F))se[ce]=lt(Z);return se}return F},[l,n,ee]),Lt=j.useCallback(F=>so(F),[]),St=j.useCallback(F=>Ta(F),[]),At=j.useMemo(()=>{let F={...k.props||{}};const se=["cellChildren","expandChildren","expandContext","render"],Z=a.getMetadata(k.name)?.skipBindingKeys||[],ve=[...new Set([...se,...Z])],pe=y?{skipCache:!0}:void 0,Ce={...pe??{},skipBindingKeys:ve},Ae=we=>{if(pe)return pe;if(we.startsWith("_computed")||we.startsWith("$computed"))return{skipCache:!0}};for(const[we,je]of Object.entries(F))if(!ve.includes(we))if(typeof je=="string"){const nt=St(je);if(nt!==null){let kt=!1,jt=nt;nt.startsWith(rr)&&(kt=!0,jt=nt.slice(rr.length));const Mn={componentId:k.id,componentName:k.name,propName:we};let Ut;if(Vn(jt))try{Ut=i.evaluatePipeExpression(jt,ee,Ae(jt),Mn)}catch(Pt){ot.warn(`파이프 표현식 평가 실패 (컴포넌트: ${k.id}, prop: ${we}):`,Pt),Ut=void 0}else if(Lt(jt))try{Ut=i.evaluateExpression(jt,ee,Mn)}catch(Pt){ot.warn(`표현식 평가 실패 (컴포넌트: ${k.id}, prop: ${we}):`,Pt),Ut=void 0}else Ut=i.resolve(jt,ee,Ae(jt),Mn);F[we]=kt&&Ut!=null?as(Ut):Ut}else{const kt={componentId:k.id,componentName:k.name,propName:we};F[we]=i.resolveBindings(je,ee,pe,kt)}}else Array.isArray(je)?F[we]=je.map(nt=>typeof nt=="string"?i.resolveBindings(nt,ee,pe):typeof nt=="object"&&nt!==null?i.resolveObject(nt,ee,Ce):nt):je&&typeof je=="object"&&(F[we]=i.resolveObject(je,ee,Ce));for(const[we,je]of Object.entries(F))F[we]=lt(je);if(typeof F.style=="string"&&(F.style=SA(F.style)),F=Id(F,S?void 0:k.actions,ee,{componentContext:_e,actionDispatcher:c}),k.classMap){const we=e0(k.classMap,ee,i,{skipCache:!0});if(we){const je=F.className||"";F.className=je?`${je} ${we}`:we}}k.style&&(F.style=k.style),k.actions&&k.actions.length>0&&k.type==="composite"&&Object.assign(F,fe),k.component_layout&&(F.__componentLayoutDefs=k.component_layout);const Ke=k.expandChildren||k.props?.expandChildren,Te=k.props?.cellChildren,$e=k.children&&k.children.length>0,ke=k.component_layout,tt=k.slot,He=k.props?.modalId,Fe=k.type==="composite";return(Ke||Te||$e||ke||tt||He||Fe)&&(F.__componentContext=_e),F},[k.props,k.actions,k.style,k.classMap,k.id,ee,n,i,l,_e,fe,lt,Lt,St,y]),Oe=j.useRef(null),rt=j.useMemo(()=>Oe.current&&Km(Oe.current,At)?Oe.current:(Oe.current=At,At),[At]),on=j.useMemo(()=>{const F=k.id;if(typeof F!="string"||!F.includes("{{"))return F;const se=i.resolveBindings(F,ee,{skipCache:!0});return typeof se=="string"?se:F},[k.id,ee,i]),$t=j.useMemo(()=>{const F=k.dataKey,se=k.trackChanges,ce=k.debounce;if(F){const Z=F.startsWith("_global."),ve=Z?F.slice(8):F,pe=Z?e._global:ee._local;return{dataKey:ve,trackChanges:se??!1,debounce:ce,setState:Z?Ae=>{e._globalSetState?e._globalSetState(Ae):ot.warn("_global.formData 사용 시 _globalSetState가 필요합니다.")}:xe,state:pe??{},_isGlobal:Z}}if(te.dataKey)return te},[k.dataKey,k.trackChanges,k.debounce,k.id,xe,ee._local,e._global,e._globalSetState,te]),Vt=j.useRef(new Set);j.useEffect(()=>{Vt.current.clear()},[e._global?._remountKeys]);const ln=j.useCallback((F,se)=>{const ce=e._global?._remountKeys;return F&&ce?.[F]&&!Vt.current.has(F)?(Vt.current.add(F),`${F}-remount-${ce[F]}`):F||se},[e._global?._remountKeys]),cn=j.useMemo(()=>{if(k.text!==void 0){if(typeof k.text=="string"){const F=k.text;let se=F;const ce={componentId:k.id,componentName:k.name,propName:"text",skipCache:!0},Z=St(F);if(Z!==null){let ve=!1,pe=Z;if(Z.startsWith(rr)&&(ve=!0,pe=Z.slice(rr.length)),Vn(pe))try{se=i.evaluatePipeExpression(pe,ee,{skipCache:!0},ce)}catch(Ce){ot.warn(`text 파이프 표현식 평가 실패 (컴포넌트: ${k.id}):`,Ce),se=""}else if(Lt(pe))try{se=i.evaluateExpression(pe,ee,ce)}catch(Ce){ot.warn(`text 표현식 평가 실패 (컴포넌트: ${k.id}):`,Ce),se=""}else se=i.resolve(pe,ee,{skipCache:!0},ce);ve&&se!=null&&(se=as(se))}else F.includes("{{")&&(se=i.resolveBindings(F,ee,{skipCache:!0},ce));return se=lt(se),se??""}return k.text}return!k.children||k.children.length===0?null:k.children.map((F,se)=>{if(typeof F=="string")return F;const ce=k.__responsiveChildrenKey,Z=ce?`responsive.${ce}.children`:"children",ve=D?`${D}.${Z}.${se}`:`${se}`,pe=F._fromBase?F.id||`child-${se}`:ln(F.id,`child-${se}`),Ce=!F._fromBase&&M?`${pe}_${M}`:pe;return gt.jsx(Br,{componentDef:F,dataContext:ee,translationContext:n,registry:a,bindingEngine:i,translationEngine:l,actionDispatcher:c,parentComponentContext:_e,parentFormContextProp:$t,isInsideIteration:y,isEditMode:S,onComponentSelect:v,onComponentHover:_,componentPath:ve,onDragStart:A,onDragEnd:x,layoutKey:M},Ce)})},[k.text,k.children,k.id,e,ee,n,a,i,l,c,_e,$t,St,Lt,lt,ln,y,S,v,_,D,A,x,M]),Gr=j.useMemo(()=>{if(!k.iteration)return null;try{const F=Nd(k.iteration.source,ee,i);if(!Array.isArray(F))return ot.warn(`iteration source가 배열이 아닙니다 (컴포넌트: ${k.id}):`,F),null;const se=ta();return se?.isEnabled()&&se.trackIteration(k.id||`iteration-${Date.now()}`,k.iteration.source,k.iteration.item_var,k.iteration.index_var,F.length),F.map((ce,Z)=>{const ve={...ee,[k.iteration.item_var]:ce,[`${k.iteration.item_var}_index`]:Z};k.iteration.index_var&&(ve[k.iteration.index_var]=Z);const pe=Z===0||Z===F.length-1;se?.isEnabled()&&pe&&se.trackNestedContext?.({componentId:`${k.id||"unknown"}-iter-${Z}`,componentType:"iteration",parentContext:{available:Object.keys(ee),values:{}},ownContext:{added:[k.iteration.item_var,...k.iteration.index_var?[k.iteration.index_var]:[]],values:{[k.iteration.item_var]:ce,...k.iteration.index_var?{[k.iteration.index_var]:Z}:{}}},depth:1});const Ce={...k,iteration:void 0,responsive:void 0},Ae=D?`${D}.iteration.${Z}`:`iteration.${Z}`,Ke=`${ln(k.id,"item")}-${Z}`;return gt.jsx(Br,{componentDef:Ce,dataContext:ve,translationContext:n,registry:a,bindingEngine:i,translationEngine:l,actionDispatcher:c,parentComponentContext:_e,parentFormContextProp:$t,isInsideIteration:!0,isEditMode:S,onComponentSelect:v,onComponentHover:_,componentPath:Ae,onDragStart:A,onDragEnd:x,layoutKey:M},Ke)})}catch(F){return ot.error(`iteration 렌더링 실패 (컴포넌트: ${k.id}):`,F),null}},[k.iteration,k.children,k.id,e,ee,n,a,i,l,c,_e,$t,ln,S,v,_,D,A,x,M]),[Kt,Ai]=j.useState(0),aa=j.useMemo(()=>{if(!k.sortable||!k.itemTemplate)return null;const{sortable:F,itemTemplate:se}=k;try{const ce=Nd(F.source,ee,i);if(!Array.isArray(ce))return ot.warn(`sortable source가 배열이 아닙니다 (컴포넌트: ${k.id}):`,ce),null;if(ce.length===0)return null;const Z=F.itemKey||"id",ve=F.strategy||"verticalList",pe=F.itemVar||"$item",Ce=F.indexVar||"$index",Ae=F.handle,Ke=F.wrapperElement,Te=(tt,He)=>{const Fe=k.actions?.filter(we=>we.event==="onSortEnd"||we.type==="onSortEnd");if(Ai(we=>we+1),Fe&&Fe.length>0&&c){const we={...ee,$sortedItems:tt,$sortEvent:He};Fe.forEach(je=>{try{const nt=c.createHandler(je,we,_e),kt=new Event("sortend");nt(kt)}catch(nt){ot.error(`onSortEnd action failed: ${je.handler}`,nt)}})}},$e=tt=>{const He=k.actions?.filter(Fe=>Fe.event==="onSortStart"||Fe.type==="onSortStart");if(He&&He.length>0&&c){const Fe={...ee,$activeId:tt.activeId};He.forEach(we=>{try{const je=c.createHandler(we,Fe,_e),nt=new Event("sortstart");je(nt)}catch(je){ot.error(`onSortStart action failed: ${we.handler}`,je)}})}},ke=ce.map((tt,He)=>{const Fe=String(tt[Z]),we={...ee,[pe]:tt,[Ce]:He},je=D?`${D}.sortable.${He}`:`sortable.${He}`,nt=`${ln(k.id,"sortable-item")}-v${Kt}-${Fe}`;return gt.jsx(bA,{id:Fe,handle:Ae,...Ke?{as:Ke}:{},children:(Ke&&se.children?se.children:[se]).map((kt,jt)=>gt.jsx(Br,{componentDef:kt,dataContext:we,translationContext:n,registry:a,bindingEngine:i,translationEngine:l,actionDispatcher:c,parentComponentContext:_e,parentFormContextProp:void 0,isInsideIteration:!0,isEditMode:S,onComponentSelect:v,onComponentHover:_,componentPath:je,onDragStart:A,onDragEnd:x,layoutKey:M},`${nt}-child-${jt}`))},nt)});return gt.jsx(gA,{items:ce,itemKey:Z,strategy:ve,onSortEnd:Te,onSortStart:$e,sortVersion:Kt,children:ke})}catch(ce){return ot.error(`sortable 렌더링 실패 (컴포넌트: ${k.id}):`,ce),null}},[k.sortable,k.itemTemplate,k.actions,k.id,e,ee,n,a,i,l,c,_e,ln,S,v,_,D,A,x,Kt,M]),bn=j.useRef(!1);j.useEffect(()=>{if(bn.current)return;bn.current=!0;const F=ta();if(F?.isEnabled()&&F.trackMount(s.id,{name:s.name,type:s.type||"component",props:rt}),s.lifecycle?.onMount&&s.lifecycle.onMount.length>0)for(const ce of s.lifecycle.onMount)try{const Z=c.createHandler(ce,ee,_e),ve=new Event("mount");Z(ve),ot.log(`Lifecycle onMount executed: ${ce.handler} (Component: ${s.id})`)}catch(Z){ot.error(`Lifecycle onMount failed: ${ce.handler} (Component: ${s.id})`,Z)}const se=[];if(s.onComponentEvent&&s.onComponentEvent.length>0){const ce=window.G7Core;if(ce?.componentEvent?.on)for(const Z of s.onComponentEvent){if(!Z.event){ot.warn(`onComponentEvent: event name is required (Component: ${s.id})`);continue}const ve=async Ce=>{try{const Ae={...ee,_eventData:Ce},Te=await c.createHandler({handler:Z.handler,params:Z.params,onSuccess:Z.onSuccess,onError:Z.onError},Ae,_e)(new CustomEvent(Z.event,{detail:Ce}));return ot.log(`onComponentEvent "${Z.event}" handled: ${Z.handler} (Component: ${s.id})`,{eventData:Ce,result:Te}),Te}catch(Ae){throw ot.error(`onComponentEvent "${Z.event}" failed: ${Z.handler} (Component: ${s.id})`,Ae),Ae}},pe=ce.componentEvent.on(Z.event,ve);se.push(pe),ot.log(`onComponentEvent: Subscribed to "${Z.event}" (Component: ${s.id})`)}else ot.warn(`onComponentEvent: G7Core.componentEvent is not available (Component: ${s.id})`)}return()=>{const ce=ta();ce?.isEnabled()&&ce.trackUnmount(s.id);for(const Z of se)try{Z()}catch(ve){ot.error(`onComponentEvent: Failed to unsubscribe (Component: ${s.id})`,ve)}if(se.length>0&&ot.log(`onComponentEvent: Unsubscribed ${se.length} event(s) (Component: ${s.id})`),s.lifecycle?.onUnmount&&s.lifecycle.onUnmount.length>0)for(const Z of s.lifecycle.onUnmount)try{const ve=c.createHandler(Z,ee,_e),pe=new Event("unmount");ve(pe),ot.log(`Lifecycle onUnmount executed: ${Z.handler} (Component: ${s.id})`)}catch(ve){ot.error(`Lifecycle onUnmount failed: ${Z.handler} (Component: ${s.id})`,ve)}}},[]);const Ln=j.useMemo(()=>{const F=rt.dataKey,se=rt.trackChanges,ce=rt.debounce;return F?{dataKey:F,trackChanges:se??!1,debounce:ce,setState:xe,state:fe}:null},[rt.dataKey,rt.trackChanges,rt.debounce,xe,fe]);j.useEffect(()=>{const F=k.dataKey||rt.dataKey;if(!F)return;const se=ta();if(!se?.isEnabled())return;const ce=[],Z=pe=>{if(pe)for(const Ce of pe){const Ae=Ce?.props?.name;if(Ae&&ce.push({name:Ae,type:Ce.name||Ce.type||"unknown"}),Ce?.children&&Z(Ce.children),Ce?.slots)for(const Ke of Object.values(Ce.slots))Array.isArray(Ke)&&Z(Ke)}};if(s.children&&Z(s.children),s.slots)for(const pe of Object.values(s.slots))Array.isArray(pe)&&Z(pe);const ve=s.id||`form-${F}`;return se.trackForm(ve,F,ce),()=>{se.untrackForm(ve)}},[k,rt.dataKey,s.id,s.children]);const at=j.useRef(null),Hn=j.useRef(void 0);j.useEffect(()=>{const F=rt?.name;if(!F||!te.dataKey||!te.setState||rt?.autoBinding===!1)return;const se=`${te.dataKey}.${F}`,ce=window.__g7AutoBindingPaths??new Map;return window.__g7AutoBindingPaths=ce,ce.set(se,(ce.get(se)??0)+1),()=>{const Z=ce.get(se)??0;Z<=1?ce.delete(se):ce.set(se,Z-1)}},[rt?.name,rt?.autoBinding,te.dataKey,te.setState]);const vn=j.useMemo(()=>{const{dataKey:F,trackChanges:se,debounce:ce,...Z}=rt,ve=Z.name;if(!ve||!te.dataKey||!te.setState)return Z;if(Z.autoBinding===!1){const{autoBinding:Fe,...we}=Z;return we}const pe=`${te.dataKey}.${ve}`,Ce=mE(te.state,pe),Ae=Ce!==void 0?Ce:Z.value,Te=a.getMetadata(s.name)?.bindingType,$e=typeof Ae=="boolean"&&(Te==="checked"||Te==="checkable"&&["checkbox","radio"].includes(Z?.type)),ke=te.debounce,tt=Fe=>{const we=te.state||{},je=yE(we,pe,Fe);if(te.trackChanges&&(je.hasChanges=!0),window.__g7PendingLocalState=je,te.setState(je),te._isGlobal)return;const nt=window.G7Core,kt={[pe]:Fe};te.trackChanges&&(kt.hasChanges=!0),nt?.state?.setLocal?.(kt,{render:!1})},He=(Fe,we)=>{ke&&ke>0?(at.current&&clearTimeout(at.current),at.current=setTimeout(()=>{tt(Fe),at.current=null,we&&(we(),window.__g7PendingLocalState=null)},ke)):(tt(Fe),we&&(we(),window.__g7PendingLocalState=null))};if($e)return{...Z,checked:Ae,onChange:we=>{const je=we.target.checked;tt(je),Z.onChange&&Z.onChange(we)}};{const Fe=je=>{const nt=je?.target?.value!==void 0?je.target.value:je;ke&&ke>0&&(Hn.current=nt);const kt=je?.target?{target:{value:nt,name:je.target.name,type:je.target.type,checked:je.target.checked},currentTarget:je.currentTarget?{value:nt,name:je.currentTarget.name}:void 0}:je;He(nt,()=>{Z.onChange&&Z.onChange(kt)})};let we;return Hn.current!==void 0?at.current!==null?we=Hn.current:String(Ae??"")===String(Hn.current)?(Hn.current=void 0,we=Ae??""):we=Hn.current:we=Ae??"",{...Z,value:we,onChange:Fe}}},[rt,te,te.state,te.debounce]),ia=j.useMemo(()=>{const F=ta();if(F?.isEnabled()&&F.trackRender(s.name),!Be)return k.iteration?Gr:null;if(k.sortable&&k.itemTemplate)return aa;if(k.iteration)return Gr;if(k.type==="extension_point"){const{layout:Te,columns:$e,gap:ke,className:tt,...He}=k.props||{};let Fe=tt||"";return Te==="grid"&&$e?Fe=`${Fe} grid grid-cols-${$e} gap-${ke||4}`.trim():Te==="flex"&&(Fe=`${Fe} flex flex-col gap-${ke||4}`.trim()),gt.jsx("div",{id:on,className:Fe||void 0,...He,children:cn})}const se=a.getComponent(k.name);if(!se)return ot.error(`컴포넌트를 찾을 수 없습니다: ${k.name} (ID: ${k.id})`,"componentDef:",JSON.stringify(k,null,2)),null;const ce=e._global?._remountKeys,Z={...vn,id:vn.id??on,...ce&&Object.keys(ce).length>0&&{__remountTrigger:JSON.stringify(ce)}};if(N?.listeners&&N.handle&&vn["data-drag-handle"]!==void 0&&(Object.assign(Z,N.listeners),Z.style={...Z.style,cursor:N.isDragging?"grabbing":"grab"}),S){const Te=k.id||`auto_${k.name||k.type||"unknown"}_${Math.random().toString(36).substring(2,8)}`,$e=He=>{typeof He.preventDefault=="function"&&He.preventDefault(),v&&(He.stopPropagation(),v(Te,He))},ke={"data-editor-id":Te,"data-editor-name":k.name,"data-editor-type":k.type,onClick:$e};D&&(ke["data-editor-path"]=D);const tt=k.__editorSlotName??k.slot;typeof tt=="string"&&(ke["data-editor-slot"]=tt),_&&(ke.onMouseMove=He=>{He.stopPropagation(),_(Te,He)},ke.onMouseLeave=He=>{_(null,He)}),Object.assign(Z,ke),Z.editorAttrs=ke}const ve=k.type==="basic",pe=k.type==="layout",Ae=ve||pe?(()=>{const Te={};for(const[$e,ke]of Object.entries(Z))$e.startsWith("__")||$e==="editorAttrs"&&ve||(Te[$e]=ke);return Te})():Z;let Ke=gt.jsx(se,{...Ae,children:cn});if($t&&(Ke=gt.jsx(pE,{value:$t,children:Ke})),k.isolatedState){const Te=typeof k.isolatedState=="object"?k.isolatedState:{},$e=e?._isolatedInit,ke=$e?{...Te,...$e}:Te;Ke=gt.jsx(EE,{initialState:ke,scopeId:k.isolatedScopeId,children:Ke})}return Ke},[Be,k.iteration,k.sortable,k.itemTemplate,k.type,k.name,k.id,k.props,k.isolatedState,k.isolatedScopeId,a,vn,cn,Gr,aa,N,Ln,S,v,_,A,x,D,e._global?._remountKeys]),lr=j.useMemo(()=>{const F=k.blur_until_loaded;if(!F||e?._global?.__isPreview)return!1;if(typeof F=="string"){const Z=St(F);if(Z!==null)try{const ve={componentId:k.id,componentName:k.name,propName:"blur_until_loaded"};return!!i.evaluateExpression(Z,ee,ve)}catch(ve){return ot.warn(`blur_until_loaded 표현식 평가 실패 (컴포넌트: ${k.id}):`,ve),!1}return!1}if(typeof F=="object"&&F!==null){if(!F.enabled)return!1;if(F.data_sources)return(Array.isArray(F.data_sources)?F.data_sources:[F.data_sources]).some(Ce=>e[Ce]===void 0);if(ue)return!0;const Z=["route","query","_global","_local","_dataSourceErrors"];return Object.keys(e).filter(pe=>!Z.includes(pe)&&!pe.startsWith("_")).some(pe=>e[pe]===void 0)}if(ue)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)},[k.blur_until_loaded,k.id,ue,e,ee,i,St]);if(lr){const F=k.blur_until_loaded;if(typeof F=="object"&&F?.data_sources){const ce=(Array.isArray(F.data_sources)?F.data_sources:[F.data_sources]).reduce((ve,pe)=>(ve[pe]=e[pe]===void 0?"UNDEFINED":"LOADED",ve),{}),Z=Object.keys(e).filter(ve=>!ve.startsWith("_"));ot.log(`[BLUR APPLIED] Component: ${k.id}, data_sources status:`,ce,"Available keys:",Z)}else ot.log(`[BLUR APPLIED] Component: ${k.id}, blur_until_loaded:`,F)}const un=j.useMemo(()=>{if(!k.blur_until_loaded)return{wrapperClasses:"",innerClasses:""};const F=At?.className||"";if(!F)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-)/],ce=F.split(/\s+/).filter(Boolean),Z=[],ve=[];for(const pe of ce)se.some(Ae=>Ae.test(pe))?Z.push(pe):ve.push(pe);return{wrapperClasses:Z.join(" "),innerClasses:ve.join(" ")}},[k.blur_until_loaded,At?.className]),kn=window.__slotContextValue;return Re&&kn?.isEnabled?null:gt.jsx(wA,{componentId:s.id,componentName:s.name,children:k.blur_until_loaded?gt.jsx("div",{className:[un.wrapperClasses,lr?"opacity-50 blur-sm transition-all duration-300 pointer-events-none":void 0].filter(Boolean).join(" ")||void 0,children:ia}):ia})});Br.displayName="DynamicRenderer",typeof window<"u"&&(window.__DynamicRenderer=Br);function CA(s){const e={};try{const a=new URL(s,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 c=a.getAll(l);c.length>1||l.endsWith("[]")?e[l]=c:e[l]=c[0]}}catch{}return e}function EA(s){try{return new URL(s,typeof window<"u"?window.location.origin:"http://localhost").pathname}catch{return s.split("?")[0]}}const _i=class _i{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 _i.instance||(_i.instance=new _i),_i.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 c of l){const d=a?`${a}.${c}`:c,f=e?.[c],h=n?.[c],m=f&&typeof f=="object"&&!Array.isArray(f),y=h&&typeof h=="object"&&!Array.isArray(h);if(m&&y)i.push(...this.findMismatchedLeafPaths(f,h,d));else{const S=f===void 0?"__undefined__":JSON.stringify(f),v=h===void 0?"__undefined__":JSON.stringify(h);S!==v&&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)),c=new Set(Object.keys(n));for(const d of c){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;c.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,c)=>l+(c.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 c={},d={};for(const h of e)h.decision==="cache_hit"?n++:h.decision==="cache_miss"?a++:h.decision==="skip_cache"?i++:h.decision==="invalidate"&&l++,c[h.reason]=(c[h.reason]||0)+1,h.context.componentId&&(d[h.context.componentId]=(d[h.context.componentId]||0)+1);const f=n+a+i;return{totalDecisions:e.length,cacheHits:n,cacheMisses:a,skipCacheCount:i,invalidateCount:l,byReason:c,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 c=Object.keys(l);c.length<=3?n[i]=`{${c.join(", ")}}`:n[i]=`{${c.slice(0,3).join(", ")}, ... +${c.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(c){console.error("[G7DevTools] Mount watcher error:",c)}})}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(h=>h.type==="render"),a=this.profilingData.filter(h=>h.type==="binding"),i=this.profilingData.filter(h=>h.type==="action"),l={};for(const h of n)h.component&&(l[h.component]||(l[h.component]={count:0,durations:[]}),l[h.component].count++,h.duration&&l[h.component].durations.push(h.duration));const c=Object.entries(l).map(([h,m])=>({name:h,renderCount:m.count,avgDuration:m.durations.length>0?m.durations.reduce((y,S)=>y+S,0)/m.durations.length:0})).sort((h,m)=>m.renderCount-h.renderCount).slice(0,10),d={};for(const h of a)h.expression&&(d[h.expression]=(d[h.expression]||0)+1);const f=Object.entries(d).sort(([,h],[,m])=>m-h).slice(0,10).map(([h])=>h);return{duration:e,entries:this.profilingData,summary:{totalRenders:n.length,totalBindings:a.length,totalActions:i.length,slowestComponents:c,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=EA(e),c=CA(e);return this.activeRequests.set(i,{id:i,url:l,fullUrl:e,queryParams:c,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 h=[];let m=!0;return f.name||(h.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||(h.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:h}});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 c={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]=c:this.formBindingValidations.push(c),c}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,c,d){if(!this.config.enabled)return;const f=`computed-${e}-${c||"global"}`,h={id:f,name:e,expression:n,componentId:c,dependencies:a,currentValue:this.safeClone(i),lastComputedAt:Date.now(),computationTime:l,error:d};this.computedProperties.set(f,h)}trackComputedRecalc(e,n,a,i,l,c,d){if(!this.config.enabled)return;const f=`computed-${e}-${d||"global"}`,h=JSON.stringify(a)!==JSON.stringify(i),m={id:`recalc-${++this.computedRecalcIdCounter}`,computedId:f,computedName:e,timestamp:Date.now(),trigger:n,triggeredBy:c,previousValue:this.safeClone(a),newValue:this.safeClone(i),valueChanged:h,computationTime:l,cascadeCount:0};this.computedRecalcLogs.push(m),this.computedRecalcLogs.length>this.maxComputedRecalcLogs&&this.computedRecalcLogs.shift();const y=this.computedProperties.get(f);y&&(y.currentValue=this.safeClone(i),y.lastComputedAt=Date.now(),y.computationTime=l)}analyzeComputedDependencyChain(e,n){const a=new Set,i=[];let l=!1,c,d=0;const f=(m,y)=>{if(d=Math.max(d,y),a.has(m))return l=!0,c=[...i,m],{name:m,type:"computed",children:[],depth:y};a.add(m),i.push(m);const S=this.computedProperties.get(`computed-${m}-${n||"global"}`),v=[];if(S)for(const _ of S.dependencies)_.type==="computed"?v.push(f(_.path,y+1)):v.push({name:_.path,type:_.type,children:[],depth:y+1});return i.pop(),a.delete(m),{name:m,type:"computed",children:v,depth:y}},h=f(e,0);return{root:e,tree:h,hasCycle:l,cyclePath:c,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 h of this.computedRecalcLogs)e[h.trigger]++,h.valueChanged||l++,n[h.computedName]=(n[h.computedName]||0)+1,a[h.computedName]||(a[h.computedName]=[]),a[h.computedName].push(h.computationTime),i+=h.computationTime;const c=Object.entries(n).sort((h,m)=>m[1]-h[1]).slice(0,5).map(([h,m])=>({name:h,count:m})),d=Object.entries(a).map(([h,m])=>({name:h,avgTime:m.reduce((y,S)=>y+S,0)/m.length})).sort((h,m)=>m.avgTime-h.avgTime).slice(0,5);let f=0;for(const h of this.computedProperties.values())this.analyzeComputedDependencyChain(h.name,h.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:c,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:c}=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(h=>h.itemVar!=="item"))return{type:"wrong-iteration-var",message:"'item'/'index' 대신 iteration에서 정의한 변수명을 사용해야 합니다",suggestion:"iteration의 item_var/index_var에 정의된 변수명을 확인하세요"};if(c&&c>10)return{type:"slow-evaluation",message:`표현식 평가에 ${c.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),c={};for(const f of e)c[f.resultType]=(c[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,h)=>f+h,0)/l.length:0,byType:c,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(c=>{if(typeof c=="string")return c;try{return JSON.stringify(c)}catch{return String(c)}}).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,c=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"&&c++);return{totalLogs:this.logHistory.length,byLevel:a,byPrefix:i,recentErrors:l,recentWarnings:c}}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,c,d=a;n&&(Array.isArray(n)?(l=n.length,c=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,c=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,c=n.items.length>0&&typeof n.items[0]=="object"?Object.keys(n.items[0]):void 0):c=Object.keys(n))),this.dataSources.set(e,{...i,status:"loaded",dataPath:d,itemCount:l,keys:c,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 c of e){n[c.dataSourceId]=(n[c.dataSourceId]||0)+1,a+=c.warnings.length;for(const d of c.warnings)i[d]=(i[d]||0)+1}const l=Object.entries(i).map(([c,d])=>({warning:c,count:d})).sort((c,d)=>d.count-c.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 c=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:c}}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 c={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(c),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 c={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(c),this.stateRenderingLogs.length>this.maxStateRenderingLogs&&this.stateRenderingLogs.shift(),l}trackComponentRender(e,n,a,i=[],l=[],c){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:c};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(c=>c.setStateId===e);if(l>=0){const c=this.stateRenderingLogs[l];c.renderedComponents=n.renderedComponents,c.totalRenderDuration=i,c.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})),c=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:c}}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,c){if(!this.config.enabled)return;const d={component:n,componentId:e,contextReceived:a,passedToChildren:i,usedInRender:l};if(this.contextFlowNodes.set(e,d),c){const f=this.contextFlowNodes.get(c);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(c=>({...c,values:this.summarizeValues(c.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 c=Object.keys(e);return`{${c.slice(0,5).join(", ")}${c.length>5?`, ... +${c.length-5}`:""}}`}if(Array.isArray(e))return e.length<=3?e.map(c=>this.summarizeValues(c,n,a+1)):{__type:"array",__length:e.length,__preview:e.slice(0,3).map(c=>this.summarizeValues(c,n,a+1))};const i={},l=Object.keys(e);for(const c of l)i[c]=this.summarizeValues(e[c],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,c]of this.dynamicStates)c&&Object.keys(c).length>0&&e.push({name:`DynamicState (${l})`,type:"dynamicState",componentId:l,values:c,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 c=l.values._local||l.values;for(const[d,f]of Object.entries(c)){const h=a.values[d];if(JSON.stringify(h)!==JSON.stringify(f)){const m=[],y=[];for(const S of this.componentStateSources.values())S.stateSource.local.some(_=>_===`_local.${d}`||_===d)&&(S.stateProvider.type==="dynamicState"?m.push(S.componentName):S.stateProvider.type==="globalState"&&y.push(S.componentName));n.push({path:`_local.${d}`,globalValue:h,dynamicStateValue:f,effectiveValue:f,usedBy:m,notUsedBy:y,severity:y.length>0?"warning":"info",description:y.length>0?`${y.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),c={componentId:e,componentName:n,classes:a,computedStyles:i,tailwindAnalysis:l};this.componentStyles.set(e,c),this.detectStyleIssues(c)}analyzeTailwindClasses(e){const n=[],a=[],i=[],l=[],c=["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 h of c)if(f.startsWith(h)){a.push(f);break}for(const h of d)if(h.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 c=l.usedClasses.filter(f=>f.startsWith("bg-")&&!f.startsWith("dark:")),d=l.darkClasses.filter(f=>f.includes("bg-"));c.length>0&&d.length===0&&this.addStyleIssue({id:this.generateId(),type:"dark-mode-missing",componentId:n,componentName:a,property:"background-color",currentValue:c.join(", "),expectedValue:"dark:bg-* 클래스 필요",severity:"info",description:"다크 모드 배경색 클래스가 누락되었습니다.",suggestion:`${c[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 c={url:e,hasAuthHeader:n,headerType:a,tokenValid:i??!1,responseStatus:l,timestamp:Date.now()};this.authHeaderHistory.push(c),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 c="unknown",d=a?.getUser?.();if(d&&(c="AuthManager"),!d){const v=e?.state?.get?.();d=v?._global?.user||v?._global?.currentUser||v?.user||v?.currentUser,d&&(c="G7Core.state")}const f=a?.isAuthenticated?.()??!1;let h="memory";localStorage.getItem("auth_token")||localStorage.getItem("access_token")?h="localStorage":(sessionStorage.getItem("auth_token")||sessionStorage.getItem("access_token"))&&(h="sessionStorage");const m=!!i&&(!!d||f);let y;i&&typeof i=="string"&&i.length>20?y=`${i.substring(0,10)}...${i.substring(i.length-6)}`:i&&(y="***");const S=d?{id:d.id,email:d.email,name:d.name,roles:d.roles?.map(v=>typeof v=="string"?{name:v}:{id:v.id,name:v.name,guard_name:v.guard_name}),permissions:d.permissions?.map(v=>typeof v=="string"?{name:v}:{id:v.id,name:v.name,guard_name:v.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:S,tokens:{hasAccessToken:!!i,hasRefreshToken:!!l,storage:h,accessTokenPreview:y},lastActivity:Date.now(),source:c}}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 c={id:`layout-${++this.layoutIdCounter}`,layoutPath:e,templateId:n,loadedAt:l,source:i,version:a.version};this.layoutHistory.push(c),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(c=>this.executionDetails.delete(c))}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 c=this.changeExpectations.get(e);c&&(l.expectedChanges=c,this.checkExpectations(e,l,c),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 c={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(c),e){const d=this.executionDetails.get(e);d&&d.stateChanges.push(c)}this.stateChangeHistory.length>this.maxStateChangeHistory&&this.stateChangeHistory.splice(0,this.stateChangeHistory.length-this.maxStateChangeHistory),c.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 c={dataSourceId:n,changeType:a,timestamp:Date.now(),previousStatus:i,newStatus:l,executionId:e};if(this.dataSourceChangeHistory.push(c),e){const d=this.executionDetails.get(e);d&&d.dataSourceChanges.push(c)}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(c=>c.path)),l=new Set(n.dataSourceChanges.map(c=>c.dataSourceId));for(const c of a.expectedStatePaths)i.has(c)||this.addChangeAlert(e,{type:"expected-not-fulfilled",severity:"error",message:`기대한 상태 변경 "${c}"가 발생하지 않음`,description:`핸들러 "${n.handlerName}"이(가) "${c}" 변경을 예고했지만 실제로 변경되지 않았습니다.`,handlerName:n.handlerName,statePath:c,suggestion:"핸들러 내부 로직을 확인하세요. early return이나 조건부 분기로 인해 변경이 생략되었을 수 있습니다.",docLink:"troubleshooting-state.md"});for(const c of a.expectedDataSources)l.has(c)||this.addChangeAlert(e,{type:"expected-not-fulfilled",severity:"error",message:`기대한 데이터소스 갱신 "${c}"가 발생하지 않음`,description:`핸들러 "${n.handlerName}"이(가) "${c}" 갱신을 예고했지만 실제로 갱신되지 않았습니다.`,handlerName:n.handlerName,dataSourceId:c,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 c=!1,d;return!l&&(a==="object"||a==="array")?(c=this.deepEqual(e,n),!c&&a==="object"&&(d=this.getChangedKeys(e,n))):c=e===n,{typeChanged:l,oldType:a,newType:i,isDeepEqual:c,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 c=this.findExecutionInStack(e);if(!c)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"};c.actions.push(d)}captureSequenceActionAfter(e,n,a,i,l,c){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 h=window.__g7PendingLocalState;h&&(f.pendingState=this.safeClone(h)),c&&(f.status="error",f.error={name:c.name,message:c.message,stack:c.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(c=>c.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=[],c=new Set(Object.keys(e)),d=new Set(Object.keys(n));for(const f of d)c.has(f)||a.push(f);for(const f of c)d.has(f)||i.push(f);for(const f of c)if(d.has(f)){const h=e[f],m=n[f];JSON.stringify(h)!==JSON.stringify(m)&&l.push({path:f,oldValue:h,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(h=>h.status==="success").length,i=e.filter(h=>h.status==="error").length,l=e.reduce((h,m)=>h+m.actions.length,0),c=n>0?e.reduce((h,m)=>h+m.totalDuration,0)/n:0,d={};for(const h of e)for(const m of h.actions)d[m.handler]=(d[m.handler]||0)+1;const f=Object.entries(d).sort(([,h],[,m])=>m-h).slice(0,5).map(([h,m])=>({handler:h,count:m}));return{totalExecutions:n,successCount:a,errorCount:i,totalActions:l,avgDuration:c,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 c of n)i.set(c,{value:this.safeClone(a[c]),capturedAt:l});this.stateCaptureRegistry.set(e,i)}detectStaleClosure(e,n,a,i,l){if(!this.config.enabled)return[];const c=this.stateCaptureRegistry.get(e);if(!c)return[];const d=Date.now(),f=[];for(const[h,m]of c){const y=this.getValueByPath(a,h),S=d-m.capturedAt;if(!this.isDeepEqual(m.value,y)&&S>0){const v=this.createStaleClosureWarning(i,n,h,m.value,m.capturedAt,y,d,S,l);f.push(v),this.addStaleClosureWarning(v)}}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,c,d,f,h,m){const y=this.getStaleClosureSeverity(e,f),{description:S,suggestion:v,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(c),retrievedAt:d},timeDiff:f,severity:y,description:S,suggestion:v,docLink:_,actionId:h,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],[,h])=>h-f).slice(0,5).map(([f,h])=>({location:f,count:h})),c={};for(const f of e)c[f.capturedState.path]=(c[f.capturedState.path]||0)+1;const d=Object.entries(c).sort(([,f],[,h])=>h-f).slice(0,5).map(([f,h])=>({path:f,count:h}));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}}};$(_i,"instance");let Ma=_i;const Wn=pt("LayoutLoader");class xr extends Error{constructor(n,a,i){super(n);$(this,"code");$(this,"details");this.code=a,this.details=i,this.name="LayoutLoaderError"}}class Df{constructor(e){$(this,"componentRegistry");$(this,"currentLayout",null);$(this,"layoutCache",new Map);$(this,"cacheVersion",0);this.componentRegistry=e}setCacheVersion(e){this.cacheVersion!==e&&(Wn.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)){Wn.log("Loading layout from cache:",n);const l=await this.layoutCache.get(a),c=JSON.parse(JSON.stringify(l));return this.currentLayout=c,Ma.getInstance().trackLayoutLoad(n,e,c,"cache"),c}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 S=n.replace("__preview__/","");l=jr(`/api/layouts/preview/${S}`,"json",i)}else l=jr(`/api/layouts/${e}/${n}`,"json",i);Wn.log("Fetching layout from API:",l);const c=zr(),d=a?null:c.getToken(),f={Accept:"application/json"};d&&(f.Authorization=`Bearer ${d}`);const h=await Ul(l,{init:{headers:f},label:`layout: ${n}`});let m;try{m=await h.json()}catch{m=null}if(!h.ok){if(h.status===401&&!a&&d){Wn.log("Token invalid, removing and retrying without token"),c.removeToken();try{return await this.fetchLayout(e,n,!0)}catch(v){throw v instanceof xr&&v.details?.status===401?new xr(v.message,v.code,{...v.details,hadToken:!0}):v}}const S=m?.message||m?.error;throw new xr(`Failed to fetch layout: ${h.status} ${h.statusText}`,"FETCH_FAILED",{status:h.status,statusText:h.statusText,url:l,apiMessage:S})}const y=m.data||m;return this.validateLayoutData(y),this.currentLayout=y,Ma.getInstance().trackLayoutLoad(n,e,y,"api"),Wn.log("Layout fetched and cached successfully:",y.layout_name),y}catch(i){const l=`${e}:${n}`;throw this.layoutCache.delete(l),i instanceof xr?i:new xr("Failed to load layout","LOAD_FAILED",{originalError:i})}}prefetchLayout(e,n){return this.loadLayout(e,n)}validateLayoutData(e){if(!e.version)throw new xr("Layout data missing required field: version","VALIDATION_FAILED",{field:"version"});if(!e.layout_name)throw new xr("Layout data missing required field: layout_name","VALIDATION_FAILED",{field:"layout_name"});if(!Array.isArray(e.components))throw new xr('Layout data field "components" must be an array',"VALIDATION_FAILED",{field:"components",value:e.components});Wn.log("Layout data validation passed")}renderLayout(e,n){try{const a=n||this.currentLayout;if(!a)throw new xr("No layout data to render","NO_LAYOUT_DATA");Wn.log("Rendering layout:",a.layout_name),e.innerHTML="",this.renderComponents(e,a.components),Wn.log("Layout rendered successfully")}catch(a){Wn.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 Wn.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 Wn.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 xr?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>
|
||
`,Wn.error("Error state rendered:",i,a)}getCurrentLayout(){return this.currentLayout}clear(){this.currentLayout=null,this.layoutCache.clear(),Wn.log("Layout data and cache cleared")}}const _A=pt("TranslationContext"),Of=j.createContext(null),_c=({children:s,translationEngine:e,translationContext:n})=>{const a=j.useMemo(()=>(l,c)=>{if(c){const d="|"+Object.entries(c).map(([f,h])=>`${f}=${h}`).join("|");return e.translate(l,n,d)}return e.translate(l,n)},[e,n]),i=j.useMemo(()=>({translationEngine:e,translationContext:n,t:a}),[e,n,a]);return gt.jsx(Of.Provider,{value:i,children:s})},$y=()=>{const s=j.useContext(Of);return s||(_A.warn("TranslationProvider 외부에서 호출되었습니다. 키를 그대로 반환합니다."),{t:e=>e,translationEngine:null,translationContext:null})},$a=pt("SlotContext"),AA={registerToSlot:()=>{$a.warn("SlotContext not available: registerToSlot called outside SlotProvider")},unregisterFromSlot:()=>{$a.warn("SlotContext not available: unregisterFromSlot called outside SlotProvider")},getSlotComponents:()=>[],subscribeToSlot:()=>()=>{},clearAllSlots:()=>{},isEnabled:!1},xA=j.createContext(AA),Lf=({children:s})=>{const e=j.useRef(new Map),n=j.useRef(new Map),a=j.useCallback(m=>{const y=n.current.get(m);y&&y.forEach(S=>{try{S()}catch(v){$a.error(`Slot subscriber error (slotId: ${m}):`,v)}})},[]),i=j.useCallback((m,y,S)=>{if(!m||!y){$a.warn("registerToSlot: slotId and componentId are required");return}e.current.has(m)||e.current.set(m,new Map);const v=e.current.get(m),_=v.get(y);_&&_.registrationKey===S.registrationKey||(v.set(y,S),$a.log(`Component registered to slot: ${y} -> ${m} (order: ${S.order})`),a(m))},[a]),l=j.useCallback((m,y)=>{const S=e.current.get(m);S&&S.has(y)&&(S.delete(y),$a.log(`Component unregistered from slot: ${y} <- ${m}`),S.size===0&&e.current.delete(m),a(m))},[a]),c=j.useCallback(m=>{const y=e.current.get(m);return y?Array.from(y.values()).sort((S,v)=>S.order-v.order):[]},[]),d=j.useCallback((m,y)=>{n.current.has(m)||n.current.set(m,new Set);const S=n.current.get(m);return S.add(y),()=>{S.delete(y),S.size===0&&n.current.delete(m)}},[]),f=j.useCallback(()=>{e.current.forEach((m,y)=>{a(y)}),e.current.clear(),n.current.clear(),$a.log("All slots cleared")},[a]),h=j.useMemo(()=>({registerToSlot:i,unregisterFromSlot:l,getSlotComponents:c,subscribeToSlot:d,clearAllSlots:f,isEnabled:!0}),[i,l,c,d,f]);return j.useLayoutEffect(()=>{typeof window<"u"&&(window.__slotContextValue=h,$a.log("SlotContext exposed to window.__slotContextValue"))},[h]),gt.jsx(xA.Provider,{value:h,children:s})};class Mf{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 Ny{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 TA(s){try{return Reflect.construct(String,[],s),!0}catch{return!1}}class $f extends Mf{constructor(e,n,a){super(),this.name=n,this.pusher=e,this.options=a,this.eventFormatter=new Ny(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 Iy extends $f{whisper(e,n){return this.pusher.channels.channels[this.name].trigger(`client-${e}`,n),this}}class kA extends $f{whisper(e,n){return this.pusher.channels.channels[this.name].trigger(`client-${e}`,n),this}}class RA extends Iy{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 jy extends Mf{constructor(e,n,a){super(),this.events={},this.listeners={},this.name=n,this.socket=e,this.options=a,this.eventFormatter=new Ny(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 Hy extends jy{whisper(e,n){return this.socket.emit("client event",{channel:this.name,event:`client-${e}`,data:n}),this}}class DA extends Hy{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 Ac extends Mf{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 zy extends Ac{whisper(e,n){return this}}class OA extends Ac{whisper(e,n){return this}}class LA extends zy{here(e){return this}joining(e){return this}whisper(e,n){return this}leaving(e){return this}}const Lc=class Lc{constructor(e){this.setOptions(e),this.connect()}setOptions(e){this.options={...Lc._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}};Lc._defaultOptions={auth:{headers:{}},authEndpoint:"/broadcasting/auth",userAuthentication:{endpoint:"/broadcasting/user-auth",headers:{}},csrfToken:null,bearerToken:null,host:null,key:null,namespace:"App.Events"};let Mo=Lc;class xc extends Mo{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 $f(this.pusher,e,this.options)),this.channels[e]}privateChannel(e){return this.channels["private-"+e]||(this.channels["private-"+e]=new Iy(this.pusher,"private-"+e,this.options)),this.channels["private-"+e]}encryptedPrivateChannel(e){return this.channels["private-encrypted-"+e]||(this.channels["private-encrypted-"+e]=new kA(this.pusher,"private-encrypted-"+e,this.options)),this.channels["private-encrypted-"+e]}presenceChannel(e){return this.channels["presence-"+e]||(this.channels["presence-"+e]=new RA(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 MA extends Mo{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 jy(this.socket,e,this.options)),this.channels[e]}privateChannel(e){return this.channels["private-"+e]||(this.channels["private-"+e]=new Hy(this.socket,"private-"+e,this.options)),this.channels["private-"+e]}presenceChannel(e){return this.channels["presence-"+e]||(this.channels["presence-"+e]=new DA(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 Uy extends Mo{constructor(){super(...arguments),this.channels={}}connect(){}listen(e,n,a){return new Ac}channel(e){return new Ac}privateChannel(e){return new zy}encryptedPrivateChannel(e){return new OA}presenceChannel(e){return new LA}leave(e){}leaveChannel(e){}socketId(){return"fake-socket-id"}connectionStatus(){return"connected"}onConnectionChange(e){return()=>{}}disconnect(){}}class $A{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 xc({...this.options,cluster:""});else if(this.options.broadcaster==="pusher")this.connector=new xc(this.options);else if(this.options.broadcaster==="ably")this.connector=new xc({...this.options,cluster:"",broadcaster:"pusher"});else if(this.options.broadcaster==="socket.io")this.connector=new MA(this.options);else if(this.options.broadcaster==="null")this.connector=new Uy(this.options);else if(typeof this.options.broadcaster=="function"&&TA(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 xc||e instanceof Uy}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 Nf={exports:{}};var Py;function NA(){return Py||(Py=1,(function(s,e){(function(a,i){s.exports=i()})(self,()=>(()=>{var n={594(c,d){var f=this&&this.__extends||(function(){var M=function(T,L){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(q,P){q.__proto__=P}||function(q,P){for(var B in P)P.hasOwnProperty(B)&&(q[B]=P[B])},M(T,L)};return function(T,L){M(T,L);function q(){this.constructor=T}T.prototype=L===null?Object.create(L):(q.prototype=L.prototype,new q)}})();Object.defineProperty(d,"__esModule",{value:!0});var h=256,m=(function(){function M(T){T===void 0&&(T="="),this._paddingCharacter=T}return M.prototype.encodedLength=function(T){return this._paddingCharacter?(T+2)/3*4|0:(T*8+5)/6|0},M.prototype.encode=function(T){for(var L="",q=0;q<T.length-2;q+=3){var P=T[q]<<16|T[q+1]<<8|T[q+2];L+=this._encodeByte(P>>>18&63),L+=this._encodeByte(P>>>12&63),L+=this._encodeByte(P>>>6&63),L+=this._encodeByte(P>>>0&63)}var B=T.length-q;if(B>0){var P=T[q]<<16|(B===2?T[q+1]<<8:0);L+=this._encodeByte(P>>>18&63),L+=this._encodeByte(P>>>12&63),B===2?L+=this._encodeByte(P>>>6&63):L+=this._paddingCharacter||"",L+=this._paddingCharacter||""}return L},M.prototype.maxDecodedLength=function(T){return this._paddingCharacter?T/4*3|0:(T*6+7)/8|0},M.prototype.decodedLength=function(T){return this.maxDecodedLength(T.length-this._getPaddingLength(T))},M.prototype.decode=function(T){if(T.length===0)return new Uint8Array(0);for(var L=this._getPaddingLength(T),q=T.length-L,P=new Uint8Array(this.maxDecodedLength(q)),B=0,W=0,he=0,Se=0,be=0,Ue=0,Ve=0;W<q-4;W+=4)Se=this._decodeChar(T.charCodeAt(W+0)),be=this._decodeChar(T.charCodeAt(W+1)),Ue=this._decodeChar(T.charCodeAt(W+2)),Ve=this._decodeChar(T.charCodeAt(W+3)),P[B++]=Se<<2|be>>>4,P[B++]=be<<4|Ue>>>2,P[B++]=Ue<<6|Ve,he|=Se&h,he|=be&h,he|=Ue&h,he|=Ve&h;if(W<q-1&&(Se=this._decodeChar(T.charCodeAt(W)),be=this._decodeChar(T.charCodeAt(W+1)),P[B++]=Se<<2|be>>>4,he|=Se&h,he|=be&h),W<q-2&&(Ue=this._decodeChar(T.charCodeAt(W+2)),P[B++]=be<<4|Ue>>>2,he|=Ue&h),W<q-3&&(Ve=this._decodeChar(T.charCodeAt(W+3)),P[B++]=Ue<<6|Ve,he|=Ve&h),he!==0)throw new Error("Base64Coder: incorrect characters for decoding");return P},M.prototype._encodeByte=function(T){var L=T;return L+=65,L+=25-T>>>8&6,L+=51-T>>>8&-75,L+=61-T>>>8&-15,L+=62-T>>>8&3,String.fromCharCode(L)},M.prototype._decodeChar=function(T){var L=h;return L+=(42-T&T-44)>>>8&-h+T-43+62,L+=(46-T&T-48)>>>8&-h+T-47+63,L+=(47-T&T-58)>>>8&-h+T-48+52,L+=(64-T&T-91)>>>8&-h+T-65+0,L+=(96-T&T-123)>>>8&-h+T-97+26,L},M.prototype._getPaddingLength=function(T){var L=0;if(this._paddingCharacter){for(var q=T.length-1;q>=0&&T[q]===this._paddingCharacter;q--)L++;if(T.length<4||L>2)throw new Error("Base64Coder: incorrect padding")}return L},M})();d.Coder=m;var y=new m;function S(M){return y.encode(M)}d.encode=S;function v(M){return y.decode(M)}d.decode=v;var _=(function(M){f(T,M);function T(){return M!==null&&M.apply(this,arguments)||this}return T.prototype._encodeByte=function(L){var q=L;return q+=65,q+=25-L>>>8&6,q+=51-L>>>8&-75,q+=61-L>>>8&-13,q+=62-L>>>8&49,String.fromCharCode(q)},T.prototype._decodeChar=function(L){var q=h;return q+=(44-L&L-46)>>>8&-h+L-45+62,q+=(94-L&L-96)>>>8&-h+L-95+63,q+=(47-L&L-58)>>>8&-h+L-48+52,q+=(64-L&L-91)>>>8&-h+L-65+0,q+=(96-L&L-123)>>>8&-h+L-97+26,q},T})(m);d.URLSafeCoder=_;var A=new _;function x(M){return A.encode(M)}d.encodeURLSafe=x;function D(M){return A.decode(M)}d.decodeURLSafe=D,d.encodedLength=function(M){return y.encodedLength(M)},d.maxDecodedLength=function(M){return y.maxDecodedLength(M)},d.decodedLength=function(M){return y.decodedLength(M)}},978(c,d){var f="utf8: invalid source encoding";function h(m){for(var y=[],S=0;S<m.length;S++){var v=m[S];if(v&128){var _=void 0;if(v<224){if(S>=m.length)throw new Error(f);var A=m[++S];if((A&192)!==128)throw new Error(f);v=(v&31)<<6|A&63,_=128}else if(v<240){if(S>=m.length-1)throw new Error(f);var A=m[++S],x=m[++S];if((A&192)!==128||(x&192)!==128)throw new Error(f);v=(v&15)<<12|(A&63)<<6|x&63,_=2048}else if(v<248){if(S>=m.length-2)throw new Error(f);var A=m[++S],x=m[++S],D=m[++S];if((A&192)!==128||(x&192)!==128||(D&192)!==128)throw new Error(f);v=(v&15)<<18|(A&63)<<12|(x&63)<<6|D&63,_=65536}else throw new Error(f);if(v<_||v>=55296&&v<=57343)throw new Error(f);if(v>=65536){if(v>1114111)throw new Error(f);v-=65536,y.push(String.fromCharCode(55296|v>>10)),v=56320|v&1023}}y.push(String.fromCharCode(v))}return y.join("")}d.D4=h},721(c,d,f){c.exports=f(207).default},207(c,d,f){f.d(d,{default:()=>Ts});class h{constructor(b,w){this.lastId=0,this.prefix=b,this.name=w}create(b){this.lastId++;var w=this.lastId,O=this.prefix+w,I=this.name+"["+w+"]",re=!1,me=function(){re||(b.apply(null,arguments),re=!0)};return this[w]=me,{number:w,id:O,name:I,callback:me}}remove(b){delete this[b.number]}}var m=new h("_pusher_script_","Pusher.ScriptReceivers"),y={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 S=y;class v{constructor(b){this.options=b,this.receivers=b.receivers||m,this.loading={}}load(b,w,O){var I=this;if(I.loading[b]&&I.loading[b].length>0)I.loading[b].push(O);else{I.loading[b]=[O];var re=ze.createScriptRequest(I.getPath(b,w)),me=I.receivers.create(function(Le){if(I.receivers.remove(me),I.loading[b]){var We=I.loading[b];delete I.loading[b];for(var ft=function(Bt){Bt||re.cleanup()},mt=0;mt<We.length;mt++)We[mt](Le,ft)}});re.send(me)}}getRoot(b){var w,O=ze.getDocument().location.protocol;return b&&b.useTLS||O==="https:"?w=this.options.cdn_https:w=this.options.cdn_http,w.replace(/\/*$/,"")+"/"+this.options.version}getPath(b,w){return this.getRoot(w)+"/"+b+this.options.suffix+".js"}}var _=new h("_pusher_dependencies","Pusher.DependenciesReceivers"),A=new v({cdn_http:S.cdn_http,cdn_https:S.cdn_https,version:S.VERSION,suffix:S.dependency_suffix,receivers:_});const x={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 b="See:",w=x.urls[E];if(!w)return"";let O;return w.fullUrl?O=w.fullUrl:w.path&&(O=x.baseUrl+w.path),O?`${b} ${O}`:""}};var T;(function(E){E.UserAuthentication="user-authentication",E.ChannelAuthorization="channel-authorization"})(T||(T={}));class L extends Error{constructor(b){super(b),Object.setPrototypeOf(this,new.target.prototype)}}class q extends Error{constructor(b){super(b),Object.setPrototypeOf(this,new.target.prototype)}}class P extends Error{constructor(b){super(b),Object.setPrototypeOf(this,new.target.prototype)}}class B extends Error{constructor(b){super(b),Object.setPrototypeOf(this,new.target.prototype)}}class W extends Error{constructor(b){super(b),Object.setPrototypeOf(this,new.target.prototype)}}class he extends Error{constructor(b){super(b),Object.setPrototypeOf(this,new.target.prototype)}}class Se extends Error{constructor(b){super(b),Object.setPrototypeOf(this,new.target.prototype)}}class be extends Error{constructor(b){super(b),Object.setPrototypeOf(this,new.target.prototype)}}class Ue extends Error{constructor(b,w){super(w),this.status=b,Object.setPrototypeOf(this,new.target.prototype)}}const Ge=function(E,b,w,O,I){const re=ze.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 Le=w.headersProvider();for(var me in Le)re.setRequestHeader(me,Le[me])}return re.onreadystatechange=function(){if(re.readyState===4)if(re.status===200){let Le,We=!1;try{Le=JSON.parse(re.responseText),We=!0}catch{I(new Ue(200,`JSON returned from ${O.toString()} endpoint was invalid, yet status code was 200. Data was: ${re.responseText}`),null)}We&&I(null,Le)}else{let Le="";switch(O){case T.UserAuthentication:Le=M.buildLogSuffix("authenticationEndpoint");break;case T.ChannelAuthorization:Le=`Clients must be authorized to join private or presence channels. ${M.buildLogSuffix("authorizationEndpoint")}`;break}I(new Ue(re.status,`Unable to retrieve auth string from ${O.toString()} endpoint - received status: ${re.status} from ${w.endpoint}. ${Le}`),null)}},re.send(b),re};function Ct(E){return N(te(E))}var J=String.fromCharCode,ue="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Me=function(E){var b=E.charCodeAt(0);return b<128?E:b<2048?J(192|b>>>6)+J(128|b&63):J(224|b>>>12&15)+J(128|b>>>6&63)+J(128|b&63)},te=function(E){return E.replace(/[^\x00-\x7F]/g,Me)},ge=function(E){var b=[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),O=[ue.charAt(w>>>18),ue.charAt(w>>>12&63),b>=2?"=":ue.charAt(w>>>6&63),b>=1?"=":ue.charAt(w&63)];return O.join("")},N=typeof window<"u"&&window.btoa||function(E){return E.replace(/[\s\S]{1,3}/g,ge)};class k{constructor(b,w,O,I){this.clear=w,this.timer=b(()=>{this.timer&&(this.timer=I(this.timer))},O)}isRunning(){return this.timer!==null}ensureAborted(){this.timer&&(this.clear(this.timer),this.timer=null)}}const de=k;function fe(E){window.clearTimeout(E)}function xe(E){window.clearInterval(E)}class ee extends de{constructor(b,w){super(setTimeout,fe,b,function(O){return w(),null})}}class _e extends de{constructor(b,w){super(setInterval,xe,b,function(O){return w(),O})}}var Be={now(){return Date.now?Date.now():new Date().valueOf()},defer(E){return new ee(0,E)},method(E,...b){var w=Array.prototype.slice.call(arguments,1);return function(O){return O[E].apply(O,w.concat(arguments))}}};const Re=Be;function Ie(E,...b){for(var w=0;w<b.length;w++){var O=b[w];for(var I in O)I==="__proto__"||I==="constructor"||I==="prototype"||(O[I]&&O[I].constructor&&O[I].constructor===Object?E[I]=Ie(E[I]||{},O[I]):E[I]=O[I])}return E}function Et(){for(var E=["Pusher"],b=0;b<arguments.length;b++)typeof arguments[b]=="string"?E.push(arguments[b]):E.push(bn(arguments[b]));return E.join(" : ")}function lt(E,b){var w=Array.prototype.indexOf;if(E===null)return-1;if(w&&E.indexOf===w)return E.indexOf(b);for(var O=0,I=E.length;O<I;O++)if(E[O]===b)return O;return-1}function Lt(E,b){for(var w in E)Object.prototype.hasOwnProperty.call(E,w)&&b(E[w],w,E)}function St(E){var b=[];return Lt(E,function(w,O){b.push(O)}),b}function At(E){var b=[];return Lt(E,function(w){b.push(w)}),b}function Oe(E,b,w){for(var O=0;O<E.length;O++)b.call(w||window,E[O],O,E)}function rt(E,b){for(var w=[],O=0;O<E.length;O++)w.push(b(E[O],O,E,w));return w}function on(E,b){var w={};return Lt(E,function(O,I){w[I]=b(O)}),w}function $t(E,b){b=b||function(I){return!!I};for(var w=[],O=0;O<E.length;O++)b(E[O],O,E,w)&&w.push(E[O]);return w}function Vt(E,b){var w={};return Lt(E,function(O,I){(b&&b(O,I,E,w)||O)&&(w[I]=O)}),w}function ln(E){var b=[];return Lt(E,function(w,O){b.push([O,w])}),b}function cn(E,b){for(var w=0;w<E.length;w++)if(b(E[w],w,E))return!0;return!1}function Gr(E,b){for(var w=0;w<E.length;w++)if(!b(E[w],w,E))return!1;return!0}function Kt(E){return on(E,function(b){return b===null?"":(typeof b=="object"&&(b=bn(b)),encodeURIComponent(Ct(b.toString())))})}function Ai(E){var b=Vt(E,function(O){return O!==void 0}),w=rt(ln(Kt(b)),Re.method("join","=")).join("&");return w}function aa(E){var b=[],w=[];return(function O(I,re){var me,Le,We;switch(typeof I){case"object":if(!I)return null;for(me=0;me<b.length;me+=1)if(b[me]===I)return{$ref:w[me]};if(b.push(I),w.push(re),Object.prototype.toString.apply(I)==="[object Array]")for(We=[],me=0;me<I.length;me+=1)We[me]=O(I[me],re+"["+me+"]");else{We={};for(Le in I)Object.prototype.hasOwnProperty.call(I,Le)&&(We[Le]=O(I[Le],re+"["+JSON.stringify(Le)+"]"))}return We;case"number":case"string":case"boolean":return I}})(E,"$")}function bn(E){try{return JSON.stringify(E)}catch{return JSON.stringify(aa(E))}}class Ln{constructor(){this.globalLog=b=>{window.console&&window.console.log&&window.console.log(b)}}debug(...b){this.log(this.globalLog,b)}warn(...b){this.log(this.globalLogWarn,b)}error(...b){this.log(this.globalLogError,b)}globalLogWarn(b){window.console&&window.console.warn?window.console.warn(b):this.globalLog(b)}globalLogError(b){window.console&&window.console.error?window.console.error(b):this.globalLogWarn(b)}log(b,...w){var O=Et.apply(this,arguments);Ts.log?Ts.log(O):Ts.logToConsole&&b.bind(this)(O)}}const at=new Ln;var Hn=function(E,b,w,O,I){(w.headers!==void 0||w.headersProvider!=null)&&at.warn(`To send headers with the ${O.toString()} request, you must use AJAX, rather than JSONP.`);var re=E.nextAuthCallbackID.toString();E.nextAuthCallbackID++;var me=E.getDocument(),Le=me.createElement("script");E.auth_callbacks[re]=function(mt){I(null,mt)};var We="Pusher.auth_callbacks['"+re+"']";Le.src=w.endpoint+"?callback="+encodeURIComponent(We)+"&"+b;var ft=me.getElementsByTagName("head")[0]||me.documentElement;ft.insertBefore(Le,ft.firstChild)};const vn=Hn;class ia{constructor(b){this.src=b}send(b){var w=this,O="Error loading "+w.src;w.script=document.createElement("script"),w.script.id=b.id,w.script.src=w.src,w.script.type="text/javascript",w.script.charset="UTF-8",w.script.addEventListener?(w.script.onerror=function(){b.callback(O)},w.script.onload=function(){b.callback(null)}):w.script.onreadystatechange=function(){(w.script.readyState==="loaded"||w.script.readyState==="complete")&&b.callback(null)},w.script.async===void 0&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(w.errorScript=document.createElement("script"),w.errorScript.id=b.id+"_error",w.errorScript.text=b.name+"('"+O+"');",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 lr{constructor(b,w){this.url=b,this.data=w}send(b){if(!this.request){var w=Ai(this.data),O=this.url+"/"+b.number+"?"+w;this.request=ze.createScriptRequest(O),this.request.send(b)}}cleanup(){this.request&&this.request.cleanup()}}var un=function(E,b){return function(w,O){var I="http"+(b?"s":"")+"://",re=I+(E.host||E.options.host)+E.options.path,me=ze.createJSONPRequest(re,w),Le=ze.ScriptReceivers.create(function(We,ft){m.remove(Le),me.cleanup(),ft&&ft.host&&(E.host=ft.host),O&&O(We,ft)});me.send(Le)}},kn={name:"jsonp",getAgent:un};const dn=kn;function F(E,b,w){var O=E+(b.useTLS?"s":""),I=b.useTLS?b.hostTLS:b.hostNonTLS;return O+"://"+I+w}function se(E,b){var w="/app/"+E,O="?protocol="+S.PROTOCOL+"&client=js&version="+S.VERSION+(b?"&"+b:"");return w+O}var ce={getInitial:function(E,b){var w=(b.httpPath||"")+se(E,"flash=false");return F("ws",b,w)}},Z={getInitial:function(E,b){var w=(b.httpPath||"/pusher")+se(E);return F("http",b,w)}},ve={getInitial:function(E,b){return F("http",b,b.httpPath||"/pusher")},getPath:function(E,b){return se(E)}};class pe{constructor(){this._callbacks={}}get(b){return this._callbacks[Ce(b)]}add(b,w,O){var I=Ce(b);this._callbacks[I]=this._callbacks[I]||[],this._callbacks[I].push({fn:w,context:O})}remove(b,w,O){if(!b&&!w&&!O){this._callbacks={};return}var I=b?[Ce(b)]:St(this._callbacks);w||O?this.removeCallback(I,w,O):this.removeAllCallbacks(I)}removeCallback(b,w,O){Oe(b,function(I){this._callbacks[I]=$t(this._callbacks[I]||[],function(re){return w&&w!==re.fn||O&&O!==re.context}),this._callbacks[I].length===0&&delete this._callbacks[I]},this)}removeAllCallbacks(b){Oe(b,function(w){delete this._callbacks[w]},this)}}function Ce(E){return"_"+E}class Ae{constructor(b){this.callbacks=new pe,this.global_callbacks=[],this.failThrough=b}bind(b,w,O){return this.callbacks.add(b,w,O),this}bind_global(b){return this.global_callbacks.push(b),this}unbind(b,w,O){return this.callbacks.remove(b,w,O),this}unbind_global(b){return b?(this.global_callbacks=$t(this.global_callbacks||[],w=>w!==b),this):(this.global_callbacks=[],this)}unbind_all(){return this.unbind(),this.unbind_global(),this}emit(b,w,O){for(var I=0;I<this.global_callbacks.length;I++)this.global_callbacks[I](b,w);var re=this.callbacks.get(b),me=[];if(O?me.push(w,O):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(b,w);return this}}class Ke extends Ae{constructor(b,w,O,I,re){super(),this.initialize=ze.transportConnectionInitializer,this.hooks=b,this.name=w,this.priority=O,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 b=this.hooks.urls.getInitial(this.key,this.options);try{this.socket=this.hooks.getSocket(b,this.options)}catch(w){return Re.defer(()=>{this.onError(w),this.changeState("closed")}),!1}return this.bindListeners(),at.debug("Connecting",{transport:this.name,url:b}),this.changeState("connecting"),!0}close(){return this.socket?(this.socket.close(),!0):!1}send(b){return this.state==="open"?(Re.defer(()=>{this.socket&&this.socket.send(b)}),!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(b){this.emit("error",{type:"WebSocketError",error:b}),this.timeline.error(this.buildTimelineMessage({error:b.toString()}))}onClose(b){b?this.changeState("closed",{code:b.code,reason:b.reason,wasClean:b.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0}onMessage(b){this.emit("message",b)}onActivity(){this.emit("activity")}bindListeners(){this.socket.onopen=()=>{this.onOpen()},this.socket.onerror=b=>{this.onError(b)},this.socket.onclose=b=>{this.onClose(b)},this.socket.onmessage=b=>{this.onMessage(b)},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(b,w){this.state=b,this.timeline.info(this.buildTimelineMessage({state:b,params:w})),this.emit(b,w)}buildTimelineMessage(b){return Ie({cid:this.id},b)}}class Te{constructor(b){this.hooks=b}isSupported(b){return this.hooks.isSupported(b)}createConnection(b,w,O,I){return new Ke(this.hooks,b,w,O,I)}}var $e=new Te({urls:ce,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!ze.getWebSocketAPI()},isSupported:function(){return!!ze.getWebSocketAPI()},getSocket:function(E){return ze.createWebSocket(E)}}),ke={urls:Z,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},tt=Ie({getSocket:function(E){return ze.HTTPFactory.createStreamingSocket(E)}},ke),He=Ie({getSocket:function(E){return ze.HTTPFactory.createPollingSocket(E)}},ke),Fe={isSupported:function(){return ze.isXHRSupported()}},we=new Te(Ie({},tt,Fe)),je=new Te(Ie({},He,Fe)),nt={ws:$e,xhr_streaming:we,xhr_polling:je};const kt=nt;var jt=new Te({file:"sockjs",urls:ve,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return window.SockJS!==void 0},getSocket:function(E,b){return new window.SockJS(E,null,{js_path:A.getPath("sockjs",{useTLS:b.useTLS}),ignore_null_origin:b.ignoreNullOrigin})},beforeOpen:function(E,b){E.send(JSON.stringify({path:b}))}}),Mn={isSupported:function(E){var b=ze.isXDRSupported(E.useTLS);return b}},Ut=new Te(Ie({},tt,Mn)),Pt=new Te(Ie({},He,Mn));kt.xdr_streaming=Ut,kt.xdr_polling=Pt,kt.sockjs=jt;const Rn=kt;class Ia extends Ae{constructor(){super();var b=this;typeof window<"u"&&window.addEventListener!==void 0&&(window.addEventListener("online",function(){b.emit("online")},!1),window.addEventListener("offline",function(){b.emit("offline")},!1))}isOnline(){return window.navigator.onLine===void 0?!0:window.navigator.onLine}}var Bo=new Ia;class Bf{constructor(b,w,O){this.manager=b,this.transport=w,this.minPingDelay=O.minPingDelay,this.maxPingDelay=O.maxPingDelay,this.pingDelay=void 0}createConnection(b,w,O,I){I=Ie({},I,{activityTimeout:this.pingDelay});var re=this.transport.createConnection(b,w,O,I),me=null,Le=function(){re.unbind("open",Le),re.bind("closed",We),me=Re.now()},We=ft=>{if(re.unbind("closed",We),ft.code===1002||ft.code===1003)this.manager.reportDeath();else if(!ft.wasClean&&me){var mt=Re.now()-me;mt<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(mt/2,this.minPingDelay))}};return re.bind("open",Le),re}isSupported(b){return this.manager.isAlive()&&this.transport.isSupported(b)}}const $c={decodeMessage:function(E){try{var b=JSON.parse(E.data),w=b.data;if(typeof w=="string")try{w=JSON.parse(b.data)}catch{}var O={event:b.event,channel:b.channel,data:w};return b.user_id&&(O.user_id=b.user_id),O}catch(I){throw{type:"MessageParseError",error:I,data:E.data}}},encodeMessage:function(E){return JSON.stringify(E)},processHandshake:function(E){var b=$c.decodeMessage(E);if(b.event==="pusher:connection_established"){if(!b.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",id:b.data.socket_id,activityTimeout:b.data.activity_timeout*1e3}}else{if(b.event==="pusher:error")return{action:this.getCloseAction(b.data),error:this.getCloseError(b.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}},Fr=$c;class xi extends Ae{constructor(b,w){super(),this.id=b,this.transport=w,this.activityTimeout=w.activityTimeout,this.bindListeners()}handlesActivityChecks(){return this.transport.handlesActivityChecks()}send(b){return this.transport.send(b)}send_event(b,w,O){var I={event:b,data:w};return O&&(I.channel=O),at.debug("Event sent",I),this.send(Fr.encodeMessage(I))}ping(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})}close(){this.transport.close()}bindListeners(){var b={message:O=>{var I;try{I=Fr.decodeMessage(O)}catch(re){this.emit("error",{type:"MessageParseError",error:re,data:O.data})}if(I!==void 0){switch(at.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:O=>{this.emit("error",O)},closed:O=>{w(),O&&O.code&&this.handleCloseEvent(O),this.transport=null,this.emit("closed")}},w=()=>{Lt(b,(O,I)=>{this.transport.unbind(I,O)})};Lt(b,(O,I)=>{this.transport.bind(I,O)})}handleCloseEvent(b){var w=Fr.getCloseAction(b),O=Fr.getCloseError(b);O&&this.emit("error",O),w&&this.emit(w,{action:w,error:O})}}class qo{constructor(b,w){this.transport=b,this.callback=w,this.bindListeners()}close(){this.unbindListeners(),this.transport.close()}bindListeners(){this.onMessage=b=>{this.unbindListeners();var w;try{w=Fr.processHandshake(b)}catch(O){this.finish("error",{error:O}),this.transport.close();return}w.action==="connected"?this.finish("connected",{connection:new xi(w.id,this.transport),activityTimeout:w.activityTimeout}):(this.finish(w.action,{error:w.error}),this.transport.close())},this.onClosed=b=>{this.unbindListeners();var w=Fr.getCloseAction(b)||"backoff",O=Fr.getCloseError(b);this.finish(w,{error:O})},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(b,w){this.callback(Ie({transport:this.transport,action:b},w))}}class ja{constructor(b,w){this.timeline=b,this.options=w||{}}send(b,w){this.timeline.isEmpty()||this.timeline.send(ze.TimelineTransport.getAgent(this,b),w)}}class Vr extends Ae{constructor(b,w){super(function(O,I){at.debug("No callbacks on "+b+" for "+O)}),this.name=b,this.pusher=w,this.subscribed=!1,this.subscriptionPending=!1,this.subscriptionCancelled=!1}authorize(b,w){return w(null,{auth:""})}trigger(b,w){if(b.indexOf("client-")!==0)throw new L("Event '"+b+"' does not start with 'client-'");if(!this.subscribed){var O=M.buildLogSuffix("triggeringClientEvents");at.warn(`Client event triggered before channel 'subscription_succeeded' event . ${O}`)}return this.pusher.send_event(b,w,this.name)}disconnect(){this.subscribed=!1,this.subscriptionPending=!1}handleEvent(b){var w=b.event,O=b.data;if(w==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(b);else if(w==="pusher_internal:subscription_count")this.handleSubscriptionCountEvent(b);else if(w.indexOf("pusher_internal:")!==0){var I={};this.emit(w,O,I)}}handleSubscriptionSucceededEvent(b){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",b.data)}handleSubscriptionCountEvent(b){b.data.subscription_count&&(this.subscriptionCount=b.data.subscription_count),this.emit("pusher:subscription_count",b.data)}subscribe(){this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(b,w)=>{b?(this.subscriptionPending=!1,at.error(b.toString()),this.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:b.message},b instanceof Ue?{status:b.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 sa extends Vr{authorize(b,w){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:b},w)}}class Ha{constructor(){this.reset()}get(b){return Object.prototype.hasOwnProperty.call(this.members,b)?{id:b,info:this.members[b]}:null}each(b){Lt(this.members,(w,O)=>{b(this.get(O))})}setMyID(b){this.myID=b}onSubscription(b){this.members=b.presence.hash,this.count=b.presence.count,this.me=this.get(this.myID)}addMember(b){return this.get(b.user_id)===null&&this.count++,this.members[b.user_id]=b.user_info,this.get(b.user_id)}removeMember(b){var w=this.get(b.user_id);return w&&(delete this.members[b.user_id],this.count--),w}reset(){this.members={},this.count=0,this.myID=null,this.me=null}}var en=function(E,b,w,O){function I(re){return re instanceof w?re:new w(function(me){me(re)})}return new(w||(w=Promise))(function(re,me){function Le(mt){try{ft(O.next(mt))}catch(Bt){me(Bt)}}function We(mt){try{ft(O.throw(mt))}catch(Bt){me(Bt)}}function ft(mt){mt.done?re(mt.value):I(mt.value).then(Le,We)}ft((O=O.apply(E,b||[])).next())})};class Nc extends sa{constructor(b,w){super(b,w),this.members=new Ha}authorize(b,w){super.authorize(b,(O,I)=>en(this,void 0,void 0,function*(){if(!O)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");at.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(O,I)}))}handleEvent(b){var w=b.event;if(w.indexOf("pusher_internal:")===0)this.handleInternalEvent(b);else{var O=b.data,I={};b.user_id&&(I.user_id=b.user_id),this.emit(w,O,I)}}handleInternalEvent(b){var w=b.event,O=b.data;switch(w){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(b);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(b);break;case"pusher_internal:member_added":var I=this.members.addMember(O);this.emit("pusher:member_added",I);break;case"pusher_internal:member_removed":var re=this.members.removeMember(O);re&&this.emit("pusher:member_removed",re);break}}handleSubscriptionSucceededEvent(b){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(b.data),this.emit("pusher:subscription_succeeded",this.members))}disconnect(){this.members.reset(),super.disconnect()}}var Ic=f(978),Rr=f(594);class za extends sa{constructor(b,w,O){super(b,w),this.key=null,this.nacl=O}authorize(b,w){super.authorize(b,(O,I)=>{if(O){w(O,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,Rr.decode)(re),delete I.shared_secret,w(null,I)})}trigger(b,w){throw new he("Client events are not currently supported for encrypted channels")}handleEvent(b){var w=b.event,O=b.data;if(w.indexOf("pusher_internal:")===0||w.indexOf("pusher:")===0){super.handleEvent(b);return}this.handleEncryptedEvent(w,O)}handleEncryptedEvent(b,w){if(!this.key){at.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!w.ciphertext||!w.nonce){at.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+w);return}let O=(0,Rr.decode)(w.ciphertext);if(O.length<this.nacl.secretbox.overheadLength){at.error(`Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${O.length}`);return}let I=(0,Rr.decode)(w.nonce);if(I.length<this.nacl.secretbox.nonceLength){at.error(`Expected encrypted event nonce length to be ${this.nacl.secretbox.nonceLength}, got: ${I.length}`);return}let re=this.nacl.secretbox.open(O,I,this.key);if(re===null){at.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,Le)=>{if(me){at.error(`Failed to make a request to the authEndpoint: ${Le}. Unable to fetch new key, so dropping encrypted event`);return}if(re=this.nacl.secretbox.open(O,I,this.key),re===null){at.error("Failed to decrypt event with new key. Dropping encrypted event");return}this.emit(b,this.getDataToEmit(re))});return}this.emit(b,this.getDataToEmit(re))}getDataToEmit(b){let w=(0,Ic.D4)(b);try{return JSON.parse(w)}catch{return w}}}class qf extends Ae{constructor(b,w){super(),this.state="initialized",this.connection=null,this.key=b,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 O=ze.getNetwork();O.bind("online",()=>{this.timeline.info({netinfo:"online"}),(this.state==="connecting"||this.state==="unavailable")&&this.retryIn(0)}),O.bind("offline",()=>{this.timeline.info({netinfo:"offline"}),this.connection&&this.sendActivityCheck()}),this.updateStrategy()}switchCluster(b){this.key=b,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(b){return this.connection?this.connection.send(b):!1}send_event(b,w,O){return this.connection?this.connection.send_event(b,w,O):!1}disconnect(){this.disconnectInternally(),this.updateState("disconnected")}isUsingTLS(){return this.usingTLS}startConnecting(){var b=(w,O)=>{w?this.runner=this.strategy.connect(0,b):O.action==="error"?(this.emit("error",{type:"HandshakeError",error:O.error}),this.timeline.error({handshakeError:O.error})):(this.abortConnecting(),this.handshakeCallbacks[O.action](O))};this.runner=this.strategy.connect(0,b)}abortConnecting(){this.runner&&(this.runner.abort(),this.runner=null)}disconnectInternally(){if(this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection){var b=this.abandonConnection();b.close()}}updateStrategy(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})}retryIn(b){this.timeline.info({action:"retry",delay:b}),b>0&&this.emit("connecting_in",Math.round(b/1e3)),this.retryTimer=new ee(b||0,()=>{this.disconnectInternally(),this.connect()})}clearRetryTimer(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)}setUnavailableTimer(){this.unavailableTimer=new ee(this.options.unavailableTimeout,()=>{this.updateState("unavailable")})}clearUnavailableTimer(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()}sendActivityCheck(){this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new ee(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 ee(this.activityTimeout,()=>{this.sendActivityCheck()}))}stopActivityCheck(){this.activityTimer&&this.activityTimer.ensureAborted()}buildConnectionCallbacks(b){return Ie({},b,{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(b){return Ie({},b,{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 b=w=>O=>{O.error&&this.emit("error",{type:"WebSocketError",error:O.error}),w(O)};return{tls_only:b(()=>{this.usingTLS=!0,this.updateStrategy(),this.retryIn(0)}),refused:b(()=>{this.disconnect()}),backoff:b(()=>{this.retryIn(1e3)}),retry:b(()=>{this.retryIn(0)})}}setConnection(b){this.connection=b;for(var w in this.connectionCallbacks)this.connection.bind(w,this.connectionCallbacks[w]);this.resetActivityCheck()}abandonConnection(){if(this.connection){this.stopActivityCheck();for(var b in this.connectionCallbacks)this.connection.unbind(b,this.connectionCallbacks[b]);var w=this.connection;return this.connection=null,w}}updateState(b,w){var O=this.state;if(this.state=b,O!==b){var I=b;I==="connected"&&(I+=" with new socket ID "+w.socket_id),at.debug("State changed",O+" -> "+I),this.timeline.info({state:b,params:w}),this.emit("state_change",{previous:O,current:b}),this.emit(b,w)}}shouldRetry(){return this.state==="connecting"||this.state==="connected"}}class jc{constructor(){this.channels={}}add(b,w){return this.channels[b]||(this.channels[b]=Hc(b,w)),this.channels[b]}all(){return At(this.channels)}find(b){return this.channels[b]}remove(b){var w=this.channels[b];return delete this.channels[b],w}disconnect(){Lt(this.channels,function(b){b.disconnect()})}}function Hc(E,b){if(E.indexOf("private-encrypted-")===0){if(b.config.nacl)return zn.createEncryptedChannel(E,b,b.config.nacl);let w="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",O=M.buildLogSuffix("encryptedChannelSupport");throw new he(`${w}. ${O}`)}else{if(E.indexOf("private-")===0)return zn.createPrivateChannel(E,b);if(E.indexOf("presence-")===0)return zn.createPresenceChannel(E,b);if(E.indexOf("#")===0)throw new q('Cannot create a channel with name "'+E+'".');return zn.createChannel(E,b)}}var Gf={createChannels(){return new jc},createConnectionManager(E,b){return new qf(E,b)},createChannel(E,b){return new Vr(E,b)},createPrivateChannel(E,b){return new sa(E,b)},createPresenceChannel(E,b){return new Nc(E,b)},createEncryptedChannel(E,b,w){return new za(E,b,w)},createTimelineSender(E,b){return new ja(E,b)},createHandshake(E,b){return new qo(E,b)},createAssistantToTheTransportManager(E,b,w){return new Bf(E,b,w)}};const zn=Gf;class Ti{constructor(b){this.options=b||{},this.livesLeft=this.options.lives||1/0}getAssistant(b){return zn.createAssistantToTheTransportManager(this,b,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}isAlive(){return this.livesLeft>0}reportDeath(){this.livesLeft-=1}}class Sn{constructor(b,w){this.strategies=b,this.loop=!!w.loop,this.failFast=!!w.failFast,this.timeout=w.timeout,this.timeoutLimit=w.timeoutLimit}isSupported(){return cn(this.strategies,Re.method("isSupported"))}connect(b,w){var O=this.strategies,I=0,re=this.timeout,me=null,Le=(We,ft)=>{ft?w(null,ft):(I=I+1,this.loop&&(I=I%O.length),I<O.length?(re&&(re=re*2,this.timeoutLimit&&(re=Math.min(re,this.timeoutLimit))),me=this.tryStrategy(O[I],b,{timeout:re,failFast:this.failFast},Le)):w(!0))};return me=this.tryStrategy(O[I],b,{timeout:re,failFast:this.failFast},Le),{abort:function(){me.abort()},forceMinPriority:function(We){b=We,me&&me.forceMinPriority(We)}}}tryStrategy(b,w,O,I){var re=null,me=null;return O.timeout>0&&(re=new ee(O.timeout,function(){me.abort(),I(!0)})),me=b.connect(w,function(Le,We){Le&&re&&re.isRunning()&&!O.failFast||(re&&re.ensureAborted(),I(Le,We))}),{abort:function(){re&&re.ensureAborted(),me.abort()},forceMinPriority:function(Le){me.forceMinPriority(Le)}}}}class Dn{constructor(b){this.strategies=b}isSupported(){return cn(this.strategies,Re.method("isSupported"))}connect(b,w){return zc(this.strategies,b,function(O,I){return function(re,me){if(I[O].error=re,re){Ff(I)&&w(!0);return}Oe(I,function(Le){Le.forceMinPriority(me.transport.priority)}),w(null,me)}})}}function zc(E,b,w){var O=rt(E,function(I,re,me,Le){return I.connect(b,w(re,Le))});return{abort:function(){Oe(O,Go)},forceMinPriority:function(I){Oe(O,function(re){re.forceMinPriority(I)})}}}function Ff(E){return Gr(E,function(b){return!!b.error})}function Go(E){!E.error&&!E.aborted&&(E.abort(),E.aborted=!0)}class Uc{constructor(b,w,O){this.strategy=b,this.transports=w,this.ttl=O.ttl||18e5,this.usingTLS=O.useTLS,this.timeline=O.timeline}isSupported(){return this.strategy.isSupported()}connect(b,w){var O=this.usingTLS,I=Vf(O),re=I&&I.cacheSkipCount?I.cacheSkipCount:0,me=[this.strategy];if(I&&I.timestamp+this.ttl>=Re.now()){var Le=this.transports[I.transport];Le&&(["ws","wss"].includes(I.transport)||re>3?(this.timeline.info({cached:!0,transport:I.transport,latency:I.latency}),me.push(new Sn([Le],{timeout:I.latency*2+1e3,failFast:!0}))):re++)}var We=Re.now(),ft=me.pop().connect(b,function mt(Bt,Mr){Bt?(Cs(O),me.length>0?(We=Re.now(),ft=me.pop().connect(b,mt)):w(Bt)):(Un(O,Mr.transport.name,Re.now()-We,re),w(null,Mr))});return{abort:function(){ft.abort()},forceMinPriority:function(mt){b=mt,ft&&ft.forceMinPriority(mt)}}}}function Ua(E){return"pusherTransport"+(E?"TLS":"NonTLS")}function Vf(E){var b=ze.getLocalStorage();if(b)try{var w=b[Ua(E)];if(w)return JSON.parse(w)}catch{Cs(E)}return null}function Un(E,b,w,O){var I=ze.getLocalStorage();if(I)try{I[Ua(E)]=bn({timestamp:Re.now(),transport:b,latency:w,cacheSkipCount:O})}catch{}}function Cs(E){var b=ze.getLocalStorage();if(b)try{delete b[Ua(E)]}catch{}}class ki{constructor(b,{delay:w}){this.strategy=b,this.options={delay:w}}isSupported(){return this.strategy.isSupported()}connect(b,w){var O=this.strategy,I,re=new ee(this.options.delay,function(){I=O.connect(b,w)});return{abort:function(){re.ensureAborted(),I&&I.abort()},forceMinPriority:function(me){b=me,I&&I.forceMinPriority(me)}}}}class oa{constructor(b,w,O){this.test=b,this.trueBranch=w,this.falseBranch=O}isSupported(){var b=this.test()?this.trueBranch:this.falseBranch;return b.isSupported()}connect(b,w){var O=this.test()?this.trueBranch:this.falseBranch;return O.connect(b,w)}}class Pa{constructor(b){this.strategy=b}isSupported(){return this.strategy.isSupported()}connect(b,w){var O=this.strategy.connect(b,function(I,re){re&&O.abort(),w(I,re)});return O}}function Ba(E){return function(){return E.isSupported()}}var Pc=function(E,b,w){var O={};function I(al,tu,nu,hh,ph){var ru=w(E,al,tu,nu,hh,ph);return O[al]=ru,ru}var re=Object.assign({},b,{hostNonTLS:E.wsHost+":"+E.wsPort,hostTLS:E.wsHost+":"+E.wssPort,httpPath:E.wsPath}),me=Object.assign({},re,{useTLS:!0}),Le=Object.assign({},b,{hostNonTLS:E.httpHost+":"+E.httpPort,hostTLS:E.httpHost+":"+E.httpsPort,httpPath:E.httpPath}),We={loop:!0,timeout:15e3,timeoutLimit:6e4},ft=new Ti({minPingDelay:1e4,maxPingDelay:E.activityTimeout}),mt=new Ti({lives:2,minPingDelay:1e4,maxPingDelay:E.activityTimeout}),Bt=I("ws","ws",3,re,ft),Mr=I("wss","ws",3,me,ft),uh=I("sockjs","sockjs",1,Le),Zc=I("xhr_streaming","xhr_streaming",1,Le,mt),dh=I("xdr_streaming","xdr_streaming",1,Le,mt),tl=I("xhr_polling","xhr_polling",1,Le),eu=I("xdr_polling","xdr_polling",1,Le),Fa=new Sn([Bt],We),$i=new Sn([Mr],We),fh=new Sn([uh],We),Ni=new Sn([new oa(Ba(Zc),Zc,dh)],We),nl=new Sn([new oa(Ba(tl),tl,eu)],We),rl=new Sn([new oa(Ba(Ni),new Dn([Ni,new ki(nl,{delay:4e3})]),nl)],We),Ii=new oa(Ba(rl),rl,fh),ji;return b.useTLS?ji=new Dn([Fa,new ki(Ii,{delay:2e3})]):ji=new Dn([Fa,new ki($i,{delay:2e3}),new ki(Ii,{delay:5e3})]),new Uc(new Pa(new oa(Ba(Bt),ji,Ii)),O,{ttl:18e5,timeline:b.timeline,useTLS:b.useTLS})};const qa=Pc;function Kf(){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(b,w){E.hooks.isInitialized()?(E.changeState("initialized"),w(!0)):(b&&E.onError(b),E.onClose(),w(!1))})):E.onClose()}var Bc={getRequest:function(E){var b=new window.XDomainRequest;return b.ontimeout=function(){E.emit("error",new P),E.close()},b.onerror=function(w){E.emit("error",w),E.close()},b.onprogress=function(){b.responseText&&b.responseText.length>0&&E.onChunk(200,b.responseText)},b.onload=function(){b.responseText&&b.responseText.length>0&&E.onChunk(200,b.responseText),E.emit("finished",200),E.close()},b},abortRequest:function(E){E.ontimeout=E.onerror=E.onprogress=E.onload=null,E.abort()}};const qc=Bc,Fo=256*1024;class Wf extends Ae{constructor(b,w,O){super(),this.hooks=b,this.method=w,this.url=O}start(b){this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=()=>{this.close()},ze.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(b)}close(){this.unloader&&(ze.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)}onChunk(b,w){for(;;){var O=this.advanceBuffer(w);if(O)this.emit("chunk",{status:b,data:O});else break}this.isBufferTooLong(w)&&this.emit("buffer_too_long")}advanceBuffer(b){var w=b.slice(this.position),O=w.indexOf(`
|
||
`);return O!==-1?(this.position+=O+1,w.slice(0,O)):null}isBufferTooLong(b){return this.position===b.length&&b.length>Fo}}var Vo;(function(E){E[E.CONNECTING=0]="CONNECTING",E[E.OPEN=1]="OPEN",E[E.CLOSED=3]="CLOSED"})(Vo||(Vo={}));const cr=Vo;var Dr=1;class Ko{constructor(b,w){this.hooks=b,this.session=Es(1e3)+"/"+Fc(8),this.location=Wo(w),this.readyState=cr.CONNECTING,this.openStream()}send(b){return this.sendRaw(JSON.stringify([b]))}ping(){this.hooks.sendHeartbeat(this)}close(b,w){this.onClose(b,w,!0)}sendRaw(b){if(this.readyState===cr.OPEN)try{return ze.createSocketRequest("POST",la(Ga(this.location,this.session))).start(b),!0}catch{return!1}else return!1}reconnect(){this.closeStream(),this.openStream()}onClose(b,w,O){this.closeStream(),this.readyState=cr.CLOSED,this.onclose&&this.onclose({code:b,reason:w,wasClean:O})}onChunk(b){if(b.status===200){this.readyState===cr.OPEN&&this.onActivity();var w,O=b.data.slice(0,1);switch(O){case"o":w=JSON.parse(b.data.slice(1)||"{}"),this.onOpen(w);break;case"a":w=JSON.parse(b.data.slice(1)||"[]");for(var I=0;I<w.length;I++)this.onEvent(w[I]);break;case"m":w=JSON.parse(b.data.slice(1)||"null"),this.onEvent(w);break;case"h":this.hooks.onHeartbeat(this);break;case"c":w=JSON.parse(b.data.slice(1)||"[]"),this.onClose(w[0],w[1],!0);break}}}onOpen(b){this.readyState===cr.CONNECTING?(b&&b.hostname&&(this.location.base=Gc(this.location.base,b.hostname)),this.readyState=cr.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)}onEvent(b){this.readyState===cr.OPEN&&this.onmessage&&this.onmessage({data:b})}onActivity(){this.onactivity&&this.onactivity()}onError(b){this.onerror&&this.onerror(b)}openStream(){this.stream=ze.createSocketRequest("POST",la(this.hooks.getReceiveURL(this.location,this.session))),this.stream.bind("chunk",b=>{this.onChunk(b)}),this.stream.bind("finished",b=>{this.hooks.onFinished(this,b)}),this.stream.bind("buffer_too_long",()=>{this.reconnect()});try{this.stream.start()}catch(b){Re.defer(()=>{this.onError(b),this.onClose(1006,"Could not start streaming",!1)})}}closeStream(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)}}function Wo(E){var b=/([^\?]*)\/*(\??.*)/.exec(E);return{base:b[1],queryString:b[2]}}function Ga(E,b){return E.base+"/"+b+"/xhr_send"}function la(E){var b=E.indexOf("?")===-1?"?":"&";return E+b+"t="+ +new Date+"&n="+Dr++}function Gc(E,b){var w=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(E);return w[1]+b+w[3]}function Es(E){return ze.randomInt(E)}function Fc(E){for(var b=[],w=0;w<E;w++)b.push(Es(32).toString(32));return b.join("")}const Ri=Ko;var Or={getReceiveURL:function(E,b){return E.base+"/"+b+"/xhr_streaming"+E.queryString},onHeartbeat:function(E){E.sendRaw("[]")},sendHeartbeat:function(E){E.sendRaw("[]")},onFinished:function(E,b){E.onClose(1006,"Connection interrupted ("+b+")",!1)}};const Yo=Or;var Di={getReceiveURL:function(E,b){return E.base+"/"+b+"/xhr"+E.queryString},onHeartbeat:function(){},sendHeartbeat:function(E){E.sendRaw("[]")},onFinished:function(E,b){b===200?E.reconnect():E.onClose(1006,"Connection interrupted ("+b+")",!1)}};const Kr=Di;var Xo={getRequest:function(E){var b=ze.getXHRAPI(),w=new b;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 _s=Xo;var Vc={createStreamingSocket(E){return this.createSocket(Yo,E)},createPollingSocket(E){return this.createSocket(Kr,E)},createSocket(E,b){return new Ri(E,b)},createXHR(E,b){return this.createRequest(_s,E,b)},createRequest(E,b,w){return new Wf(E,b,w)}};const Oi=Vc;Oi.createXDR=function(E,b){return this.createRequest(qc,E,b)};var Kc={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:m,DependenciesReceivers:_,getDefaultStrategy:qa,Transports:Rn,transportConnectionInitializer:Kf,HTTPFactory:Oi,TimelineTransport:dn,getXHRAPI(){return window.XMLHttpRequest},getWebSocketAPI(){return window.WebSocket||window.MozWebSocket},setup(E){if(typeof window<"u"){window.Pusher=E;var b=()=>{this.onDocumentBody(E.ready)};window.JSON?b():A.load("json2",{},b)}},getDocument(){return document},getProtocol(){return this.getDocument().location.protocol},getAuthorizers(){return{ajax:Ge,jsonp:vn}},onDocumentBody(E){document.body?E():setTimeout(()=>{this.onDocumentBody(E)},0)},createJSONPRequest(E,b){return new lr(E,b)},createScriptRequest(E){return new ia(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 Bo},createWebSocket(E){var b=this.getWebSocketAPI();return new b(E)},createSocketRequest(E,b){if(this.isXHRSupported())return this.HTTPFactory.createXHR(E,b);if(this.isXDRSupported(b.indexOf("https:")===0))return this.HTTPFactory.createXDR(E,b);throw"Cross-origin HTTP requests are not supported"},isXHRSupported(){var E=this.getXHRAPI();return!!E&&new E().withCredentials!==void 0},isXDRSupported(E){var b=E?"https:":"http:",w=this.getProtocol();return!!window.XDomainRequest&&w===b},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 b=window.crypto||window.msCrypto,w=Math.floor(Math.pow(2,32)/E)*E;let O;do O=b.getRandomValues(new Uint32Array(1))[0];while(O>=w);return O%E}};const ze=Kc;var Lr;(function(E){E[E.ERROR=3]="ERROR",E[E.INFO=6]="INFO",E[E.DEBUG=7]="DEBUG"})(Lr||(Lr={}));const ca=Lr;class Li{constructor(b,w,O){this.key=b,this.session=w,this.events=[],this.options=O||{},this.sent=0,this.uniqueID=0}log(b,w){b<=this.options.level&&(this.events.push(Ie({},w,{timestamp:Re.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}error(b){this.log(ca.ERROR,b)}info(b){this.log(ca.INFO,b)}debug(b){this.log(ca.DEBUG,b)}isEmpty(){return this.events.length===0}send(b,w){var O=Ie({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=[],b(O,(I,re)=>{I||this.sent++,w&&w(I,re)}),!0}generateUniqueID(){return this.uniqueID++,this.uniqueID}}class Yf{constructor(b,w,O,I){this.name=b,this.priority=w,this.transport=O,this.options=I||{}}isSupported(){return this.transport.isSupported({useTLS:this.options.useTLS})}connect(b,w){if(this.isSupported()){if(this.priority<b)return As(new B,w)}else return As(new be,w);var O=!1,I=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),re=null,me=function(){I.unbind("initialized",me),I.connect()},Le=function(){re=zn.createHandshake(I,function(Bt){O=!0,mt(),w(null,Bt)})},We=function(Bt){mt(),w(Bt)},ft=function(){mt();var Bt;Bt=bn(I),w(new W(Bt))},mt=function(){I.unbind("initialized",me),I.unbind("open",Le),I.unbind("error",We),I.unbind("closed",ft)};return I.bind("initialized",me),I.bind("open",Le),I.bind("error",We),I.bind("closed",ft),I.initialize(),{abort:()=>{O||(mt(),re?re.close():I.close())},forceMinPriority:Bt=>{O||this.priority<Bt&&(re?re.close():I.close())}}}}function As(E,b){return Re.defer(function(){b(E)}),{abort:function(){},forceMinPriority:function(){}}}const{Transports:Qo}=ze;var Mi=function(E,b,w,O,I,re){var me=Qo[w];if(!me)throw new Se(w);var Le=(!E.enabledTransports||lt(E.enabledTransports,b)!==-1)&&(!E.disabledTransports||lt(E.disabledTransports,b)===-1),We;return Le?(I=Object.assign({ignoreNullOrigin:E.ignoreNullOrigin},I),We=new Yf(b,O,re?re.getAssistant(me):me,I)):We=xs,We},xs={isSupported:function(){return!1},connect:function(E,b){var w=Re.defer(function(){b(new be)});return{abort:function(){w.ensureAborted()},forceMinPriority:function(){}}}};function Wc(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&&at.warn("The disableStats option is deprecated in favor of enableStats")}const Xf=(E,b)=>{var w="socket_id="+encodeURIComponent(E.socketId);for(var O in b.params)w+="&"+encodeURIComponent(O)+"="+encodeURIComponent(b.params[O]);if(b.paramsProvider!=null){let I=b.paramsProvider();for(var O in I)w+="&"+encodeURIComponent(O)+"="+encodeURIComponent(I[O])}return w},Jf=E=>{if(typeof ze.getAuthorizers()[E.transport]>"u")throw`'${E.transport}' is not a recognized auth transport`;return(b,w)=>{const O=Xf(b,E);ze.getAuthorizers()[E.transport](ze,O,E,T.UserAuthentication,w)}},Zo=(E,b)=>{var w="socket_id="+encodeURIComponent(E.socketId);w+="&channel_name="+encodeURIComponent(E.channelName);for(var O in b.params)w+="&"+encodeURIComponent(O)+"="+encodeURIComponent(b.params[O]);if(b.paramsProvider!=null){let I=b.paramsProvider();for(var O in I)w+="&"+encodeURIComponent(O)+"="+encodeURIComponent(I[O])}return w},Qf=E=>{if(typeof ze.getAuthorizers()[E.transport]>"u")throw`'${E.transport}' is not a recognized auth transport`;return(b,w)=>{const O=Zo(b,E);ze.getAuthorizers()[E.transport](ze,O,E,T.ChannelAuthorization,w)}},Zf=(E,b,w)=>{const O={authTransport:b.transport,authEndpoint:b.endpoint,auth:{params:b.params,headers:b.headers}};return(I,re)=>{const me=E.channel(I.channelName);w(me,O).authorize(I.socketId,re)}};function Yc(E,b){let w={activityTimeout:E.activityTimeout||S.activityTimeout,cluster:E.cluster,httpPath:E.httpPath||S.httpPath,httpPort:E.httpPort||S.httpPort,httpsPort:E.httpsPort||S.httpsPort,pongTimeout:E.pongTimeout||S.pongTimeout,statsHost:E.statsHost||S.stats_host,unavailableTimeout:E.unavailableTimeout||S.unavailableTimeout,wsPath:E.wsPath||S.wsPath,wsPort:E.wsPort||S.wsPort,wssPort:E.wssPort||S.wssPort,enableStats:rh(E),httpHost:eh(E),useTLS:nh(E),wsHost:Xc(E),userAuthenticator:el(E),channelAuthorizer:ih(E,b)};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 eh(E){return E.httpHost?E.httpHost:E.cluster?`sockjs-${E.cluster}.pusher.com`:S.httpHost}function Xc(E){return E.wsHost?E.wsHost:th(E.cluster)}function th(E){return`ws-${E}.pusher.com`}function nh(E){return ze.getProtocol()==="https:"?!0:E.forceTLS!==!1}function rh(E){return"enableStats"in E?E.enableStats:"disableStats"in E?!E.disableStats:!1}const Jc=E=>"customHandler"in E&&E.customHandler!=null;function el(E){const b=Object.assign(Object.assign({},S.userAuthentication),E.userAuthentication);return Jc(b)?b.customHandler:Jf(b)}function ah(E,b){let w;return"channelAuthorization"in E?w=Object.assign(Object.assign({},S.channelAuthorization),E.channelAuthorization):(w={transport:E.authTransport||S.authTransport,endpoint:E.authEndpoint||S.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=Zf(b,w,E.authorizer))),w}function ih(E,b){const w=ah(E,b);return Jc(w)?w.customHandler:Qf(w)}class sh extends Ae{constructor(b){super(function(w,O){at.debug(`No callbacks on watchlist events for ${w}`)}),this.pusher=b,this.bindWatchlistInternalEvent()}handleEvent(b){b.data.events.forEach(w=>{this.emit(w.name,w)})}bindWatchlistInternalEvent(){this.pusher.connection.bind("message",b=>{var w=b.event;w==="pusher_internal:watchlist_events"&&this.handleEvent(b)})}}function Qc(){let E,b;return{promise:new Promise((O,I)=>{E=O,b=I}),resolve:E,reject:b}}const oh=Qc;class lh extends Ae{constructor(b){super(function(w,O){at.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,O)=>{if(w){at.warn(`Error during signin: ${w}`),this.emit("pusher:signin_error",Object.assign({},{type:"AuthError",error:w.message},w instanceof Ue?{status:w.status}:{})),this._cleanup();return}this.pusher.send_event("pusher:signin",{auth:O.auth,user_data:O.user_data})},this.pusher=b,this.pusher.connection.bind("state_change",({previous:w,current:O})=>{w!=="connected"&&O==="connected"&&this._signin(),w==="connected"&&O!=="connected"&&(this._cleanup(),this._newSigninPromiseIfNeeded())}),this.watchlist=new sh(b),this.pusher.connection.bind("message",w=>{var O=w.event;O==="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(b){try{this.user_data=JSON.parse(b.user_data)}catch{at.error(`Failed parsing user data after signin: ${b.user_data}`),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){at.error(`user_data doesn't contain an id. user_data: ${this.user_data}`),this._cleanup();return}this._signinDoneResolve(),this._subscribeChannels()}_subscribeChannels(){const b=w=>{w.subscriptionPending&&w.subscriptionCancelled?w.reinstateSubscription():!w.subscriptionPending&&this.pusher.connection.state==="connected"&&w.subscribe()};this.serverToUserChannel=new Vr(`#server-to-user-${this.user_data.id}`,this.pusher),this.serverToUserChannel.bind_global((w,O)=>{w.indexOf("pusher_internal:")===0||w.indexOf("pusher:")===0||this.emit(w,O)}),b(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:b,resolve:w}=oh();b.done=!1;const O=()=>{b.done=!0};b.then(O).catch(O),this.signinDonePromise=b,this._signinDoneResolve=w}}class fn{static ready(){fn.isReady=!0;for(var b=0,w=fn.instances.length;b<w;b++)fn.instances[b].connect()}static getClientFeatures(){return St(Vt({ws:ze.Transports.ws},function(b){return b.isSupported({})}))}constructor(b,w){ch(b),Wc(w),this.key=b,this.options=w,this.config=Yc(this.options,this),this.channels=zn.createChannels(),this.global_emitter=new Ae,this.sessionID=ze.randomInt(1e9),this.timeline=new Li(this.key,this.sessionID,{cluster:this.config.cluster,features:fn.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:ca.INFO,version:S.VERSION}),this.config.enableStats&&(this.timelineSender=zn.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+ze.TimelineTransport.name}));var O=I=>ze.getDefaultStrategy(this.config,I,Mi);this.connection=zn.createConnectionManager(this.key,{getStrategy:O,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 Le=this.channel(I.channel);Le&&Le.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=>{at.warn(I)}),fn.instances.push(this),this.timeline.info({instances:fn.instances.length}),this.user=new lh(this),fn.isReady&&this.connect()}switchCluster(b){const{appKey:w,cluster:O}=b;this.key=w,this.options=Object.assign(Object.assign({},this.options),{cluster:O}),this.config=Yc(this.options,this),this.connection.switchCluster(this.key)}channel(b){return this.channels.find(b)}allChannels(){return this.channels.all()}connect(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var b=this.connection.isUsingTLS(),w=this.timelineSender;this.timelineSenderTimer=new _e(6e4,function(){w.send(b)})}}disconnect(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)}bind(b,w,O){return this.global_emitter.bind(b,w,O),this}unbind(b,w,O){return this.global_emitter.unbind(b,w,O),this}bind_global(b){return this.global_emitter.bind_global(b),this}unbind_global(b){return this.global_emitter.unbind_global(b),this}unbind_all(b){return this.global_emitter.unbind_all(),this}subscribeAll(){var b;for(b in this.channels.channels)this.channels.channels.hasOwnProperty(b)&&this.subscribe(b)}subscribe(b){var w=this.channels.add(b,this);return w.subscriptionPending&&w.subscriptionCancelled?w.reinstateSubscription():!w.subscriptionPending&&this.connection.state==="connected"&&w.subscribe(),w}unsubscribe(b){var w=this.channels.find(b);w&&w.subscriptionPending?w.cancelSubscription():(w=this.channels.remove(b),w&&w.subscribed&&w.unsubscribe())}send_event(b,w,O){return this.connection.send_event(b,w,O)}shouldUseTLS(){return this.config.useTLS}signin(){this.user.signin()}}fn.instances=[],fn.isReady=!1,fn.logToConsole=!1,fn.Runtime=ze,fn.ScriptReceivers=ze.ScriptReceivers,fn.DependenciesReceivers=ze.DependenciesReceivers,fn.auth_callbacks=ze.auth_callbacks;const Ts=fn;function ch(E){if(E==null)throw"You must pass your app key when you instantiate Pusher."}ze.setup(fn)}},a={};function i(c){var d=a[c];if(d!==void 0)return d.exports;var f=a[c]={exports:{}};return n[c].call(f.exports,f,f.exports,i),f.exports}i.d=(c,d)=>{for(var f in d)i.o(d,f)&&!i.o(c,f)&&Object.defineProperty(c,f,{enumerable:!0,get:d[f]})},i.o=(c,d)=>Object.prototype.hasOwnProperty.call(c,d);var l=i(721);return l})())})(Nf)),Nf.exports}var IA=NA();const By=Zr(IA),Gt=pt("WebSocketManager");class jA{constructor(){$(this,"echo",null);$(this,"subscriptions",new Map);$(this,"initialized",!1);$(this,"config",null)}configure(e){if(this.initialized){Gt.warn("[WebSocketManager] 이미 초기화되어 설정을 변경할 수 없습니다.");return}this.config=e,Gt.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){Gt.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,c=Number(a)||80,d=i==="https";Gt.log("[WebSocketManager] 연결 설정:",{host:n,port:c,scheme:i,useTLS:d,authEndpoint:l}),window.Pusher=By;const f=localStorage.getItem("auth_token"),h={wsHost:n,wsPort:c,wssPort:c,forceTLS:d,disableStats:!0,enabledTransports:["ws","wss"],cluster:"mt1",authEndpoint:l,auth:{headers:{Authorization:f?`Bearer ${f}`:"",Accept:"application/json"}}};Gt.log("[WebSocketManager] Pusher 옵션:",h);const m=new By(e,h);m.connection.bind("connecting",()=>{Gt.log("[WebSocketManager] 연결 시도 중...")}),m.connection.bind("connected",()=>{Gt.log("[WebSocketManager] 연결 성공! Socket ID:",m.connection.socket_id)}),m.connection.bind("failed",()=>{Gt.error("[WebSocketManager] 연결 실패 - WebSocket을 사용할 수 없습니다.")}),m.connection.bind("error",y=>{Gt.error("[WebSocketManager] 연결 오류:",y)}),m.connection.bind("state_change",y=>{Gt.log(`[WebSocketManager] 상태 변경: ${y.previous} → ${y.current}`)}),m.connection.bind("unavailable",()=>{Gt.error("[WebSocketManager] WebSocket 사용 불가 - 연결할 수 없습니다.")}),m.connection.bind("disconnected",()=>{Gt.warn("[WebSocketManager] 연결이 끊어졌습니다.")}),Gt.log("[WebSocketManager] 초기 연결 상태:",m.connection.state),this.echo=new $A({broadcaster:"reverb",client:m}),Gt.log("[WebSocketManager] 연결 시작 시도..."),m.connect(),window.Echo=this.echo,this.initialized=!0,Gt.log("[WebSocketManager] Echo 초기화 완료")}subscribe(e,n,a,i={}){if(this.initialize(),!this.echo)return Gt.warn("[WebSocketManager] Echo가 초기화되지 않았습니다."),"";const{channelType:l="private"}=i,c=`${e}:${n}`;if(this.subscriptions.has(c))return Gt.log(`[WebSocketManager] 이미 구독 중: ${c}`),c;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(c,d),Gt.log(`[WebSocketManager] 구독 완료: ${c} (${l})`),c}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){Gt.warn(`[WebSocketManager] stopListening 실패: ${e}`,l)}this.subscriptions.delete(e),Gt.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)),Gt.log(`[WebSocketManager] 채널 구독 해제: ${e}`)}disconnect(){this.echo&&(this.echo.disconnect(),this.subscriptions.clear(),this.initialized=!1,Gt.log("[WebSocketManager] 연결 종료"))}getEcho(){return this.echo}isInitialized(){return this.initialized}isConfigured(){return this.config!==null&&!!this.config.appKey}getSubscriptionCount(){return this.subscriptions.size}}const Tc=new jA,vt=pt("DataSourceManager"),qy=new On;function kc(s,e){const n=Ta(s);if(n!==null)try{return Vn(n)?qy.evaluatePipeExpression(n,e,{skipCache:!0}):qy.evaluateExpression(n,e)}catch(a){return vt.error("Failed to evaluate param expression:",n,a),s}return ss(s,e,{skipCache:!0})}function Gy(s){const e={};for(const n of s.keys()){if(n in e)continue;const a=s.getAll(n);a.length>1?e[n]=a:a.length===1&&(n.endsWith("[]")?e[n]=a:e[n]=a[0])}return e}function HA(){try{return window.G7Core?.devTools}catch{return}}const Mc=class Mc{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,c])=>{const d=kc(c,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}is({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(is({if:e.errorCondition.if},a,this.bindingEngine,`errorCondition:${e.id}`))return vt.log(`errorCondition matched for ${e.id}, triggering error ${e.errorCondition.errorCode}`),e.errorCondition.errorCode}catch(a){vt.error(`Failed to evaluate errorCondition for ${e.id}:`,a)}return null}async fetchDataSources(e,n={},a=new URLSearchParams,i,l){const c={},d=!!this.options.sampleProvider,f=e.filter(h=>(d||h.auto_fetch!==!1)&&h.type!=="websocket");return await Promise.all(f.map(async h=>{try{const m=await this.fetchDataSource(h,n,a,i,l);c[h.id]=m,this.dataCache.set(h.id,{data:m,timestamp:Date.now()});const y=this.checkErrorCondition(h,m);if(y!==null){const S={status:y,message:`Error condition matched for ${h.id}`,data:m},v=Er(),_=v.resolve(y,{errorHandling:h.errorHandling,onError:h.onError});if(_.handler)try{await v.execute(_.handler,S)}catch(A){vt.error(`Error executing errorCondition handler for ${h.id}:`,A)}h.fallback!==void 0&&(c[h.id]=h.fallback,this.dataCache.set(h.id,{data:h.fallback,timestamp:Date.now()}),vt.log(`Using fallback data for ${h.id} (errorCondition)`));return}if(h.onSuccess)try{const S={data:m,sourceId:h.id};await this.executeOnSuccessHandler(h.onSuccess,S)}catch(S){vt.error(`Error executing onSuccess handler for ${h.id}:`,S)}}catch(m){vt.error(`Failed to fetch data source: ${h.id}`,m);const y=m?.response?.status||m?.status||500,S=m?.response?.data,v=S?.message||m.message||"Unknown error",_={status:y,message:v,errors:S?.errors,data:S,statusText:m?.response?.statusText},A=Er(),x=A.resolve(y,{errorHandling:h.errorHandling,onError:h.onError});if(x.handler)try{await A.execute(x.handler,_)}catch(D){vt.error(`Error executing error handler for ${h.id}:`,D)}h.fallback!==void 0&&(c[h.id]=h.fallback,this.dataCache.set(h.id,{data:h.fallback,timestamp:Date.now()}),vt.log(`Using fallback data for ${h.id}`)),this.options.onError&&this.options.onError(m,h)}})),c}async fetchDataSourcesWithResults(e,n={},a=new URLSearchParams,i,l,c){if(e.some(m=>m.type==="websocket")){const m=e.filter(y=>y.type==="websocket").map(y=>y.id).join(", ");vt.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=c?.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 y=await this.fetchDataSource(m,n,a,i,l);this.dataCache.set(m.id,{data:y,timestamp:Date.now()});const S=this.checkErrorCondition(m,y);if(S!==null){const v={status:S,message:`Error condition matched for ${m.id}`,data:y},_=Er(),A=_.resolve(S,{errorHandling:m.errorHandling,onError:m.onError});let x=!1;if(A.handler)if(m.loading_strategy==="blocking")_.execute(A.handler,v).catch(D=>{vt.error(`Error executing errorCondition handler for ${m.id}:`,D)}),x=!0;else try{await _.execute(A.handler,v),x=!0}catch(D){vt.error(`Error executing errorCondition handler for ${m.id}:`,D)}return m.fallback!==void 0?(this.dataCache.set(m.id,{data:m.fallback,timestamp:Date.now()}),vt.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: ${S}`),errorCode:S,errorHandled:x}}if(m.onSuccess)try{const v={data:y,sourceId:m.id};await this.executeOnSuccessHandler(m.onSuccess,v)}catch(v){vt.error(`Error executing onSuccess handler for ${m.id}:`,v)}return{id:m.id,state:"success",data:y}}catch(y){vt.error(`Failed to fetch data source: ${m.id}`,y);const S=y?.response?.status||y?.status||500,v=y?.response?.data,_=v?.message||y.message||"Unknown error",A={status:S,message:_,errors:v?.errors,data:v,statusText:y?.response?.statusText},x=Er(),D=x.resolve(S,{errorHandling:m.errorHandling,onError:m.onError});let M=!1;if(D.handler)if(m.loading_strategy==="blocking")x.execute(D.handler,A).catch(T=>{vt.error(`Error executing error handler for ${m.id}:`,T)}),M=!0;else try{await x.execute(D.handler,A),M=!0}catch(T){vt.error(`Error executing error handler for ${m.id}:`,T)}return m.fallback!==void 0?(this.dataCache.set(m.id,{data:m.fallback,timestamp:Date.now()}),vt.log(`Using fallback data for ${m.id}`),{id:m.id,state:"success",data:m.fallback}):(this.options.onError&&this.options.onError(y,m),{id:m.id,state:"error",error:y,errorCode:S,errorHandled:M})}}))}fetchDataSourcesInBackground(e,n={},a=new URLSearchParams,i){e.filter(c=>c.auto_fetch!==!1&&c.loading_strategy==="background"&&c.type!=="websocket").forEach(c=>{this.fetchDataSource(c,n,a).then(async d=>{this.dataCache.set(c.id,{data:d,timestamp:Date.now()});const f=this.checkErrorCondition(c,d);if(f!==null){const h={status:f,message:`Error condition matched for ${c.id}`,data:d},m=Er(),y=m.resolve(f,{errorHandling:c.errorHandling,onError:c.onError});if(y.handler)try{await m.execute(y.handler,h)}catch(S){vt.error(`Error executing errorCondition handler for ${c.id}:`,S)}c.fallback!==void 0&&(this.dataCache.set(c.id,{data:c.fallback,timestamp:Date.now()}),vt.log(`Using fallback data for ${c.id} (errorCondition)`),i&&i(c.id,c.fallback));return}if(c.onSuccess)try{const h={data:d,sourceId:c.id};await this.executeOnSuccessHandler(c.onSuccess,h)}catch(h){vt.error(`Error executing onSuccess handler for ${c.id}:`,h)}i&&i(c.id,d)}).catch(async d=>{vt.error(`Background fetch failed: ${c.id}`,d);const f=d?.response?.status||d?.status||500,h=d?.response?.data,m=h?.message||d.message||"Unknown error",y={status:f,message:m,errors:h?.errors,data:h,statusText:d?.response?.statusText},S=Er(),v=S.resolve(f,{errorHandling:c.errorHandling,onError:c.onError});if(v.handler)try{await S.execute(v.handler,y)}catch(_){vt.error(`Error executing error handler for ${c.id}:`,_)}if(c.fallback!==void 0){this.dataCache.set(c.id,{data:c.fallback,timestamp:Date.now()}),vt.log(`Using fallback data for ${c.id}`),i&&i(c.id,c.fallback);return}this.options.onError&&this.options.onError(d,c)})})}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 Gy(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 c={route:n,query:Gy(a)};i&&(c._global=i),l&&(c._local=l);let d=ss(e.endpoint,c,{skipCache:!0});const f=e.method||"GET",m=(e.contentType?typeof e.contentType=="string"&&e.contentType.includes("{{")?ss(e.contentType,c,{skipCache:!0}):e.contentType:"application/json")==="multipart/form-data";let y=m?{...e.params||{}}:JSON.parse(JSON.stringify(e.params||{}));Object.entries(y).forEach(([_,A])=>{typeof A=="string"&&(y[_]=kc(A,c))}),Object.keys(y).forEach(_=>{y[_]===""&&delete y[_]});const S=HA();let v=null;if(S?.isEnabled()){S.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(y).length>0){const A=new URLSearchParams;Object.entries(y).forEach(([D,M])=>{Array.isArray(M)?M.forEach(T=>A.append(D,String(T))):M!=null&&A.append(D,String(M))});const x=A.toString();_=x?`${d}?${x}`:d}v=S.trackRequest(_,f,{requestBody:f!=="GET"?y:void 0,dataSourceId:e.id}),S.trackDataSourceLoading(e.id)}try{let _;const A=e.auth_mode??(e.auth_required===!0?"required":"none"),x=wr.getInstance().isAuthenticated();if(A==="required"&&!x){vt.log(`[DataSourceManager] Skipping ${e.id}: auth_mode is 'required' but no token available`),S?.isEnabled()&&(S.trackDataSourceError(e.id,"Skipped: auth_mode required but not authenticated"),v&&S.failRequest(v,"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 D=A==="required"||A==="optional"&&x;if(D){const M=zr(),T=d.startsWith("/api/")?d.substring(4):d.startsWith("/api")?d.substring(4)||"/":d;this.options.onError&&vt.log(`[DataSourceManager] Normalized endpoint: ${d} -> ${T}`);const L=this.getMatchingGlobalHeaders(d,c),q={};e.headers&&Object.entries(e.headers).forEach(([he,Se])=>{const be=kc(Se,c);be!=null&&be!==""&&(q[he]=String(be))});const P={...L,...q},B=Object.keys(P).length>0,W=m?this.toFormData(y):y;switch(f){case"GET":_=await M.get(T,{params:y,...B&&{headers:P}});break;case"POST":B?_=await M.post(T,W,{headers:P}):_=await M.post(T,W);break;case"PUT":B?_=await M.put(T,W,{headers:P}):_=await M.put(T,W);break;case"PATCH":B?_=await M.patch(T,W,{headers:P}):_=await M.patch(T,W);break;case"DELETE":_=await M.delete(T,{params:y,...B&&{headers:P}});break;default:throw new Error(`Unsupported HTTP method: ${f}`)}}else{let M=d;if(f==="GET"){const W=new URLSearchParams(y).toString();M=W?`${d}?${W}`:d}const T={...m?{}:{"Content-Type":"application/json"},Accept:"application/json"};if(typeof window<"u"){const W=localStorage.getItem("g7_locale");W&&(T["Accept-Language"]=W)}const L=this.getMatchingGlobalHeaders(d,c);Object.assign(T,L),e.headers&&Object.entries(e.headers).forEach(([W,he])=>{const Se=kc(he,c);Se!=null&&Se!==""&&(T[W]=String(Se))});let q;f!=="GET"&&(m?(q=this.toFormData(y),delete T["Content-Type"]):q=JSON.stringify(y));const P=await fetch(M,{method:f,headers:T,body:q});let B;try{B=await P.json()}catch{B=null}if(v&&S?.isEnabled()&&(S.completeRequest(v,P.status,B),v=null),!P.ok){S?.isEnabled()&&S.trackDataSourceError(e.id,`HTTP ${P.status}: ${P.statusText}`);const W=new Error(`HTTP error! status: ${P.status}`);throw W.response={status:P.status,statusText:P.statusText,data:B},W.status=P.status,W}_=B,S?.isEnabled()&&S.trackDataSourceLoaded(e.id,_)}return D&&v&&S?.isEnabled()&&(S.completeRequest(v,200,_),S.trackDataSourceLoaded(e.id,_)),_}catch(_){if(v&&S?.isEnabled()){const A=_;A?.response?S.completeRequest(v,A.response.status,A.response.data):S.failRequest(v,_ instanceof Error?_.message:String(_)),S.trackDataSourceError(e.id,_ instanceof Error?_.message:String(_))}throw _}}getCachedData(e){const n=this.dataCache.get(e);if(!n)return;if(Date.now()-n.timestamp>Mc.DATA_CACHE_TTL){this.dataCache.delete(e);return}return n.data}clearCache(){this.dataCache.clear()}subscribeWebSockets(e,n,a={}){const i=[],l=e.filter(c=>c.type==="websocket");return l.length===0||l.forEach(c=>{if(!c.channel||!c.event){vt.warn(`WebSocket source ${c.id} missing channel or event`);return}let d,f;try{d=ss(c.channel,a,{skipCache:!0}),f=ss(c.event,a,{skipCache:!0})}catch(y){vt.error(`Failed to resolve WebSocket channel/event for source ${c.id}:`,y);return}const h=y=>!!(!y||y.trim()===""||y.includes("{{")||y.endsWith(".")||y.endsWith(":")||y.startsWith(".")||y.startsWith(":")||y.includes("..")||y.includes("::"));if(h(d)||h(f)){vt.warn(`WebSocket source ${c.id} has invalid channel/event after expression resolution, skipping. Original channel="${c.channel}", resolved="${d}". Original event="${c.event}", resolved="${f}". Available context keys: [${Object.keys(a).join(", ")}]`);return}const m=Tc.subscribe(d,f,y=>{const S=c.target_source||c.id;this.dataCache.set(S,{data:y,timestamp:Date.now()}),n(S,y)},{channelType:c.channel_type||"private"});m&&i.push(m)}),i}unsubscribeWebSockets(e){e.length!==0&&e.forEach(n=>{Tc.unsubscribe(n)})}async executeOnSuccessHandler(e,n){const a=this.options.actionDispatcher??Bm();if(!a){vt.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(c){throw vt.error("Failed to execute onSuccess handler:",c),c}}};$(Mc,"DATA_CACHE_TTL",3e5);let Tr=Mc;const zA=new Tr,wi=pt("ModalDataSourceWrapper");function UA(s,e){if(!s||!e)return s;const a=e.replace(/\?\./g,".").split(/\.(?![^\[]*\])/).flatMap(l=>{const c=l.match(/^([^\[]*)((?:\[\d+\])*)$/);if(c){const[,d,f]=c,h=[];d&&h.push(d);const m=f.match(/\[\d+\]/g);return m&&h.push(...m),h}return[l]}).filter(l=>l!=="");let i=s;for(const l of a){if(i==null)return;if(l.startsWith("[")&&l.endsWith("]")){const c=parseInt(l.slice(1,-1),10);i=i[c]}else i=i[l]}return i}const Fy=({isOpen:s,modalId:e,dataSources:n,dataContext:a,globalStateUpdater:i,bindingEngine:l,debug:c=!1,children:d})=>{const[f,h]=j.useState(!1),[m,y]=j.useState(!1),S=j.useRef(!1),v=j.useRef(null);v.current||(v.current=new Tr);const _=j.useCallback(async()=>{if(!(!n||n.length===0)&&v.current){h(!0);try{const A=a.route||{},x=new URLSearchParams(window.location.search),D=n.map(T=>{let L={...T};if(T.endpoint&&l){const q=l.resolveBindings(T.endpoint,a,{skipCache:!0});L.endpoint=q}if(T.params&&l){const q={};Object.entries(T.params).forEach(([P,B])=>{typeof B=="string"?q[P]=l.resolveBindings(B,a,{skipCache:!0}):q[P]=B}),L.params=q}return L});c&&wi.log(`[ModalDataSourceWrapper] Modal "${e}" fetching data sources:`,D.map(T=>({id:T.id,endpoint:T.endpoint})));const M=await v.current.fetchDataSourcesWithResults(D,A,x);i&&M.forEach(T=>{if(T.state==="success"&&T.data!==void 0){const L=D.find(q=>q.id===T.id);if(L?.initGlobal){const q=T.data?.data??T.data,P=Array.isArray(L.initGlobal)?L.initGlobal:[L.initGlobal];for(const B of P)if(typeof B=="string")i({[B]:q}),c&&wi.log(`[ModalDataSourceWrapper] Modal "${e}" initGlobal: ${T.id}.data -> _global.${B}`);else if(typeof B=="object"&&B.key){const{key:W,path:he}=B,Se=he?UA(q,he):q;i({[W]:Se}),c&&wi.log(`Modal "${e}" initGlobal: ${T.id}.data${he?"."+he:""} -> _global.${W}`)}}}else T.state==="error"&&wi.error(`Modal "${e}" data source error:`,T.id,T.error)}),c&&wi.log(`Modal "${e}" data sources fetched successfully`)}catch(A){wi.error(`Modal "${e}" data source fetch error:`,A)}finally{h(!1),y(!0)}}},[n,a,i,l,e,c]);return j.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]),j.useEffect(()=>{!s&&S.current&&(y(!1),c&&wi.log(`[ModalDataSourceWrapper] Modal "${e}" closed, reset fetch state`)),s&&!S.current&&n&&n.length>0&&!m&&_(),S.current=s},[s,n,m,_,e,c]),gt.jsx(gt.Fragment,{children:d})};class Rc 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 PA extends Rc{constructor(){super("TEMPLATE_NOT_FOUND","$t:core.errors.template_not_found",{showStack:!1,icon:"fa-paint-brush",recoverable:!1}),this.name="TemplateNotFoundError"}}function Vy(s){if(s instanceof Rc)return s;if(s instanceof Error){const e=new Rc("TEMPLATE_INIT_ERROR",s.message||"$t:core.errors.template_init_error",{showStack:!0,icon:"fa-circle-exclamation",recoverable:!0});return e.stack=s.stack,e}return new Rc("TEMPLATE_INIT_ERROR","$t:core.errors.template_init_error",{showStack:!1,icon:"fa-circle-exclamation",recoverable:!0})}const BA=pt("ErrorDisplay");class If{static render(e,n){const a=document.getElementById(e);if(!a){BA.error(`Container #${e} not found`);return}const i=n.debug&&n.showStack&&n.stackTrace,l=window.matchMedia("(prefers-color-scheme: dark)").matches,c={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="${c.container}">
|
||
<div style="${c.card}">
|
||
<!-- 아이콘 -->
|
||
<div style="${c.iconContainer}">
|
||
<i class="fa-solid ${n.icon}" style="${c.icon}"></i>
|
||
</div>
|
||
|
||
<!-- 제목 -->
|
||
<h1 style="${c.title}">
|
||
${this.escapeHtml(n.title)}
|
||
</h1>
|
||
|
||
<!-- 사용자 메시지 -->
|
||
<p style="${c.message}">
|
||
${this.escapeHtml(n.message)}
|
||
</p>
|
||
|
||
<!-- 상세 메시지 (API 응답 등) -->
|
||
${n.detailMessage?`
|
||
<p style="${c.detailMessage}">
|
||
${this.escapeHtml(n.detailMessage)}
|
||
</p>
|
||
`:`<div style="${c.spacer}"></div>`}
|
||
|
||
<!-- Stack Trace (디버그 모드일 때만) -->
|
||
${i?`
|
||
<div style="${c.stackContainer}">
|
||
<p style="${c.stackTitle}">
|
||
Stack Trace:
|
||
</p>
|
||
<pre style="${c.stackTrace}">${this.escapeHtml(n.stackTrace)}</pre>
|
||
</div>
|
||
`:""}
|
||
|
||
<!-- 새로고침 버튼 (복구 가능할 때만) -->
|
||
${n.showReloadButton?`
|
||
<div style="${c.buttonContainer}">
|
||
<button
|
||
onclick="window.location.reload()"
|
||
style="${c.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,c,d){let f,h;if(n.userMessageKey.startsWith("$t:"))if(c&&l)try{f=c.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?h=m.details.apiMessage:m.response?.data?.message&&(h=m.response.data.message)}this.render(e,{title:a,message:f,detailMessage:h,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 bs=pt("Router");class qA{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(jr(`/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,bs.log(`Loaded ${this.routes.length} routes${e?` (v=${e})`:""}`);else throw new Error("Invalid routes data format")}catch(n){throw bs.error("Error loading routes:",n),n}}setRoutes(e){this.routes=e,bs.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,h)=>(a.push(h),"([^/]+)"));i.startsWith("*/")&&(i="(?:/[^/]+)?"+i.slice(1)),i=i.replace(/\//g,"\\/");const l=new RegExp(`^${i}$`),c=n.match(l);if(!c)return null;const d={};return a.forEach((f,h)=>{d[f]=c[h+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){bs.warn(`No route matched for path: ${e}`),this.emit("routeNotFound",e);return}if(a.route.redirect){bs.log(`Redirecting from ${e} to ${a.route.redirect}`),this.navigate(a.route.redirect);return}if(a.route.auth_required){const c=this.getAuthType(a.route,e),d=wr.getInstance();let f=d.isAuthenticated()&&d.getAuthType()===c;if(f||(f=await d.checkAuth(c)),!f){const h=d.getLoginRedirectUrl(c,e+n);bs.log(`Not authenticated, redirecting to: ${h}`),window.location.href=h;return}}const i=new URLSearchParams(n),l={};for(const c of i.keys()){if(c in l)continue;const d=i.getAll(c);d.length>1?l[c]=d:d.length===1&&(c.endsWith("[]")?l[c]=d:l[c]=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 GA=/^\/admin\/layout-editor\/([^/?#]+)\/?$/;function Ky(s){const e=GA.exec(s);return e?{templateIdentifier:e[1]}:null}const Ft=pt("ErrorPageHandler");class FA{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(jr(`/api/templates/${this.templateId}/config`,"json"));if(!e.ok)return this.debug&&Ft.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&&Ft.warn("Invalid template config response"),this.configLoaded=!0,null;const a=n.data;return!a.error_config||!a.error_config.layouts?(this.debug&&Ft.warn("No error_config found in template.json"),this.configLoaded=!0,null):(this.errorConfig=a.error_config,this.configLoaded=!0,this.debug&&Ft.log("Error config loaded:",this.errorConfig),this.errorConfig)}catch(e){return Ft.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&&Ft.warn("No error config available, cannot render error page"),!1;const i=a.layouts[e]||a.layouts[String(e)];if(!i)return this.debug&&Ft.warn(`No layout defined for error code: ${e}`),!1;this.debug&&Ft.log(`Loading error layout: ${i} for code: ${e}`);const l=await this.layoutLoader.loadLayout(this.templateId,i);if(!l)return this.debug&&Ft.error(`Failed to load error layout: ${i}`),!1;this.debug&&Ft.log("Error layout loaded:",l);let c={};const d=l.data_sources||[];if(d.length>0){this.debug&&Ft.log("Fetching data sources:",d.map(v=>v.id));const m=d.filter(v=>v.loading_strategy==="blocking"),y=d.filter(v=>!v.loading_strategy||v.loading_strategy==="progressive"),S=[...m,...y];if(S.length>0)try{c=await this.dataSourceManager.fetchDataSources(S,{},new URLSearchParams),this.debug&&Ft.log("Data sources fetched:",Object.keys(c))}catch(v){Ft.error("Failed to fetch data sources:",v)}}const f={};d.length>0&&(this.processInitOptions(d,c,f),this.debug&&Ft.log("initOptions processed:",{globalKeys:Object.keys(this.globalState),localKeys:Object.keys(f)}));const h={...c,errorCode:e,_global:{...this.globalState},_local:{...f}};return await this.renderFunction({containerId:n,layoutJson:l,dataContext:h,translationContext:{templateId:this.templateId,locale:this.locale}}),this.debug&&Ft.log(`Error page ${e} rendered successfully`),!0}catch(a){return Ft.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 c=l?.data??l;if(i.initLocal){if(typeof i.initLocal=="string")a[i.initLocal]=c,Ft.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(c,f):c,Ft.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]=c,Ft.log(`initGlobal: ${i.id}.data -> _global.${f}`);else if(typeof f=="object"&&f!==null&&"key"in f){const{key:h,path:m}=f;this.globalState[h]=m?this.getValueByPath(c,m):c,Ft.log(`initGlobal: ${i.id}.data${m?"."+m:""} -> _global.${h}`)}}}}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&&Ft.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&&Ft.log("Config cache cleared")}}const zt=pt("ModuleAssetLoader");class VA{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){zt.log("No module assets to load");return}const n=[...e].sort((d,f)=>d.priority-f.priority);zt.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]),c=l.filter(d=>d.status==="rejected");if(c.length>0){zt.warn(`Some module assets failed to load (${c.length}/${l.length}); continuing with the rest`,this.getFailedJsAssets());return}zt.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){zt.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)){zt.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=()=>{zt.log(`Bundle CSS loaded: ${e}`),this.registerLoadedAsset(`bundle-${e}`,{type:"css",element:l}),i()},l.onerror=()=>{zt.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)){zt.log(`Bundle JS already loaded: ${e}`);return}const i=this.loadingPromises.get(a);if(i)return zt.log(`Bundle JS already loading: ${e}`),i;const l=Eg(n,{id:a},{label:`bundle JS: ${e}`}).then(()=>{zt.log(`Bundle JS loaded: ${e}`);const c=document.getElementById(a);c&&this.registerLoadedAsset(`bundle-${e}`,{type:"js",element:c}),this.loadingPromises.delete(a)}).catch(c=>{throw zt.warn(`Failed to load bundle JS: ${e} (${n})`,c),this.failedJsAssets.add(e),this.loadingPromises.delete(a),c});return this.loadingPromises.set(a,l),l}async loadCSS(e,n){const a=`module-css-${e}`;if(document.getElementById(a)){zt.log(`CSS already loaded: ${e}`);return}return new Promise((i,l)=>{const c=document.createElement("link");c.rel="stylesheet",c.href=n,c.id=a,c.onload=()=>{zt.log(`CSS loaded: ${e}`),this.registerLoadedAsset(e,{type:"css",element:c}),i()},c.onerror=()=>{zt.warn(`Failed to load CSS: ${e} (${n})`),i()},document.head.appendChild(c)})}async loadJS(e,n){const a=`module-js-${e}`;if(document.getElementById(a)){zt.log(`JS already loaded: ${e}`);return}const i=this.loadingPromises.get(e);if(i)return zt.log(`JS already loading: ${e}`),i;const l=Eg(n,{id:a},{label:`JS: ${e}`}).then(()=>{zt.log(`JS loaded: ${e}`);const c=document.getElementById(a);c&&this.registerLoadedAsset(e,{type:"js",element:c}),this.loadingPromises.delete(e)}).catch(c=>{throw zt.warn(`Failed to load JS: ${e} (${n})`,c),this.failedJsAssets.add(e),this.loadingPromises.delete(e),c});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){zt.log(`No assets to unload for: ${e}`);return}n.forEach(a=>{a.element.parentNode&&(a.element.parentNode.removeChild(a.element),zt.log(`${a.type.toUpperCase()} unloaded: ${e}`))}),this.loadedAssets.delete(e),zt.log(`All assets unloaded for: ${e}`)}unloadAllAssets(){Array.from(this.loadedAssets.keys()).forEach(n=>{this.unloadExtensionAsset(n)}),zt.log("All module assets unloaded")}isLoaded(e){return this.loadedAssets.has(e)}getLoadedModules(){return Array.from(this.loadedAssets.keys())}}let jf=null;function Hf(){return jf||(jf=new VA),jf}function KA(){if(typeof window>"u")return[];const s=window.G7Config;if(!s?.moduleAssets)return[];const e=[];for(const[n,a]of Object.entries(s.moduleAssets)){const i=a;e.push({identifier:n,js:i.js?Aa(i.js):i.js,css:i.css?Aa(i.css):i.css,priority:i.priority,external:i.external})}return e}function WA(){if(typeof window>"u")return null;const s=window.G7Config;if(!s?.bundleUrls)return null;const e=s.bundleUrls;return{moduleJs:e.moduleJs?Aa(e.moduleJs):e.moduleJs,moduleCss:e.moduleCss?Aa(e.moduleCss):e.moduleCss,pluginJs:e.pluginJs?Aa(e.pluginJs):e.pluginJs,pluginCss:e.pluginCss?Aa(e.pluginCss):e.pluginCss}}function YA(){if(typeof window>"u")return[];const s=window.G7Config;if(!s?.pluginAssets)return[];const e=[];for(const[n,a]of Object.entries(s.pluginAssets)){const i=a;e.push({identifier:n,js:i.js?Aa(i.js):i.js,css:i.css?Aa(i.css):i.css,priority:i.priority,external:i.external})}return e}const zf=pt("SystemBannerManager");class Dc{static show(e){this.banners.set(e.id,e),this.render(),zf.log(`Banner shown: ${e.id}`)}static hide(e){this.banners.delete(e)&&(this.render(),zf.log(`Banner hidden: ${e}`))}static hideAll(){this.banners.clear(),this.render(),zf.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),c=i.background||"#f59e0b",d=i.color||"white";return`<div data-banner-id="${i.id}" style="background:${c};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`:"")}}$(Dc,"banners",new Map),$(Dc,"containerId","g7-system-banners");const U=pt("TemplateApp");function Wy(s){const e={};for(const n of s.keys()){if(n in e)continue;const a=s.getAll(n);a.length>1?e[n]=a:a.length===1&&(n.endsWith("[]")?e[n]=a:e[n]=a[0])}return e}const or=class or{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,U.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,U.log("Loaded plugin settings from G7Config:",Object.keys(e.plugins))),e.modules&&(this.globalState.modules=e.modules,U.log("Loaded module settings from G7Config:",Object.keys(e.modules))),e.appConfig&&(this.globalState.appConfig=e.appConfig,U.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 c=l.path;l.path=n.resolveBindings(l.path,a),l.path=l.path.replace(/\/\/+/g,"/")||"/",l.path.includes("{{")&&(U.warn("Route expression resolution failed, using fallback:",c),l.path=c.replace(/\{\{[^}]+\}\}/g,"").replace(/\/\/+/g,"/")||"/")}if(l.redirect&&l.redirect.includes("{{")){const c=l.redirect;l.redirect=n.resolveBindings(l.redirect,a),l.redirect=l.redirect.replace(/\/\/+/g,"/")||"/",l.redirect.includes("{{")&&(U.warn("Route redirect expression resolution failed:",c),l.redirect=c.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(or.LOCALE_STORAGE_KEY)&&(localStorage.setItem(or.LOCALE_STORAGE_KEY,a),U.log(`Migrated locale from '${n}' to '${or.LOCALE_STORAGE_KEY}'`)),localStorage.removeItem(n)}catch(a){U.warn(`Failed to migrate locale key '${n}':`,a)}}async init(){try{ao.getInstance().setDebug(this.config.debug),U.log("Initializing with config:",this.config),xw();const e=br.getInstance(),n=wr.getInstance(),a=this.loadCacheVersionFromStorage()||0,[i,l,c,d,f]=await Promise.all([zo({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),Ul(jr(`/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 U.error("Error loading routes:",A),A}),n.preloadAuth(this.config.templateType==="admin"?"admin":"user"),fetch(jr(`/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=>(U.warn("Error loading template config:",A),null))]);if(U.log("Template Engine initialized"),U.log("ComponentRegistry loaded"),U.log("Routes data loaded"),U.log("User info preloaded"),U.log("Template config loaded:",f),f?.cache_version!==void 0){const A=this.loadCacheVersionFromStorage();if(this.extensionCacheVersion=f.cache_version,this.saveCacheVersionToStorage(this.extensionCacheVersion),U.log("Extension cache version:",this.extensionCacheVersion),A!==null&&A!==this.extensionCacheVersion){U.log("Cache version changed, reloading routes...");const x=await Ul(jr(`/api/templates/${this.config.templateId}/routes`,"json",this.extensionCacheVersion),{label:"routes.json (reload)"}).then(D=>{if(!D.ok)throw new Error(`Failed to reload routes: ${D.statusText}`);return D.json()}).then(D=>{if(!D.success)throw new Error("Failed to reload routes from API");return D.data});Array.isArray(x.routes)&&(x.routes=this.resolveRouteExpressions(x.routes),Object.assign(c,x),U.log("Routes reloaded with new cache version"));try{const{TranslationEngine:D}=await Promise.resolve().then(()=>kg),M=D.getInstance();M.setCacheVersion(this.extensionCacheVersion);const T=this.config.locale||"ko",L="en";await M.loadTranslations(this.config.templateId,T,"/api",!0),T!==L&&await M.loadTranslations(this.config.templateId,L,"/api",!0),U.log("Translations reloaded with new cache version")}catch(D){U.error("Failed to reload translations:",D)}}}f?.errorHandling&&(this.templateErrorHandling=f.errorHandling,Er().setTemplateConfig(this.templateErrorHandling),U.log("Template errorHandling registered:",this.templateErrorHandling)),n.on("logout",()=>{U.log("User logged out")}),n.on("authStateChange",A=>{U.log("Auth state changed:",A)}),U.log("AuthManager event handlers registered");const h=zr(),m=this.config.templateType==="admin"?"admin":"user",y=n.getConfig(m);h.setOnUnauthorized(()=>{U.log("Unauthorized - redirecting to login page"),h.removeToken();const A=window.location.pathname+window.location.search,x=n.getLoginRedirectUrl(m,A,"session_expired");window.location.href=x}),U.log("ApiClient onUnauthorized callback registered"),this.layoutLoader=new Df(e),this.extensionCacheVersion>0&&this.layoutLoader.setCacheVersion(this.extensionCacheVersion),U.log("LayoutLoader initialized:",this.layoutLoader);const S=new Tr({onUnauthorized:()=>{U.warn("Unauthorized request in error page")}});if(this.errorPageHandler=new FA({templateId:this.config.templateId,layoutLoader:this.layoutLoader,locale:this.config.locale,debug:this.config.debug,renderFunction:vs,dataSourceManager:S,globalState:this.globalState}),U.log("ErrorPageHandler initialized with DataSourceManager"),await this.handleServerError()){U.log("Server error handled, skipping normal initialization");return}if(this.router=new qA(this.config.templateId),Array.isArray(c.routes)){const A=this.resolveRouteExpressions(c.routes);this.router.setRoutes(A)}else throw new Error("Invalid routes data format");U.log("Router initialized:",this.router),U.log("Routes set:",this.router.getRoutes());const{getActionDispatcher:v}=await Promise.resolve().then(()=>qr),_=v();if(_&&(_.setDefaultContext({navigate:A=>this.router?.navigate(A)}),_.setGlobalStateUpdater((A,x)=>this.setGlobalState(A,x)),U.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"&&Ky(window.location.pathname)){U.log("Layout editor mode detected — skipping router match"),await vs({containerId:"app",layoutJson:{components:[]},dataContext:{},translationContext:{templateId:this.config.templateId,locale:this.config.locale}}),U.log("Template App initialized in layout editor mode");return}this.router.navigateToCurrentPath(),U.log("Template App initialized successfully")}catch(e){U.error("Initialization failed:",e),this.showInitError(e)}}async loadExtensionAssets(){try{const e=Hf(),n=WA();if(!n){await this.loadExtensionAssetsIndividually();return}await e.loadBundle("module",n.moduleJs,n.moduleCss),await e.loadBundle("plugin",n.pluginJs,n.pluginCss),U.log("Extension bundle assets loaded successfully")}catch(e){U.warn("Failed to load extension assets:",e)}}async loadExtensionAssetsIndividually(){const e=Hf(),n=KA();n.length>0&&(U.log("Loading module assets (individual fallback):",n.map(i=>i.identifier)),await e.loadActiveExtensionAssets(n));const a=YA();a.length>0&&(U.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(U.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){U.log("Route change cancelled (newer request exists):",n);return}U.log("Layout loaded:",l);const c=Er();l.errorHandling?(c.setLayoutConfig(l.errorHandling),U.log("Layout errorHandling registered:",l.errorHandling)):c.clearLayoutConfig();const d=l.data_sources||[],f=e.query||{},h=new URLSearchParams;for(const[te,ge]of Object.entries(f))if(Array.isArray(ge))for(const N of ge)h.append(te,N);else h.set(te,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:y,getActionDispatcher:S}=await Promise.resolve().then(()=>qr),v=new y;if(i){const te=S();te&&te.setPreviewMode(!0),this.setGlobalState({__isPreview:!0}),Dc.show({id:"preview-mode",message:{ko:"⚠ 미리보기 모드 — 페이지 이동이 비활성화됩니다",en:"⚠ Preview Mode — Navigation is disabled"},background:"linear-gradient(90deg, #f59e0b, #d97706)",color:"white"}),U.log("Preview mode activated")}else{const te=S();te?.isPreviewMode()&&(te.setPreviewMode(!1),Dc.hide("preview-mode"))}if(this.currentGlobalHeaders=l.globalHeaders||[],this.currentGlobalHeaders.length>0){v.setGlobalHeaders(this.currentGlobalHeaders);const te=S();te&&te.setGlobalHeaders(this.currentGlobalHeaders),U.log("globalHeaders set:",this.currentGlobalHeaders.map(ge=>ge.pattern))}if(l.named_actions&&Object.keys(l.named_actions).length>0){const te=S();te&&te.setNamedActions(l.named_actions)}const _=v.filterByCondition(d,m);d.length!==_.length&&U.log("Data sources filtered by condition:",{before:d.map(te=>te.id),after:_.map(te=>te.id)});const A=_.filter(te=>te.loading_strategy==="blocking"),x=_.filter(te=>(te.loading_strategy||"progressive")!=="blocking"&&te.type!=="websocket"),D=Array.isArray(l.transition_overlay?.wait_for)?l.transition_overlay.wait_for:[],M=D.length>0&&_.some(te=>D.includes(te.id)&&te.type!=="websocket"&&(te.loading_strategy||"progressive")!=="background");if((A.length>0||M)&&l.transition_overlay){const te=typeof l.transition_overlay=="boolean"?{enabled:l.transition_overlay,style:"opaque"}:l.transition_overlay;te.enabled&&te.style==="skeleton"&&te.skeleton?.component&&te.target?this.renderSkeletonOverlay(te.target,te.skeleton,l,te.fallback_target):te.enabled&&te.style==="spinner"&&te.target&&this.renderSpinnerOverlay(te.target,te.spinner,te.fallback_target)}let T={},L={},q={},P={};this.currentWebSocketSubscriptions.length>0&&(U.log("Unsubscribing previous WebSocket subscriptions:",this.currentWebSocketSubscriptions),v.unsubscribeWebSockets(this.currentWebSocketSubscriptions),this.currentWebSocketSubscriptions=[]),this.currentDataSources=_,this.currentRawDataSources=d,this.currentRouteParams=e.params||{},this.currentQueryParams=h,U.log(`handleRouteChange #${n} - queryObject:`,f),U.log(`handleRouteChange #${n} - queryParams:`,h.toString()),A.length>0&&(U.log("Fetching blocking data sources:",A.map(ge=>ge.id)),(await v.fetchDataSourcesWithResults(A,e.params||{},h)).forEach(ge=>{if(ge.state==="success"&&ge.data!==void 0)T[ge.id]=ge.data;else if(ge.state==="error"&&ge.error){const N=ge.error,k=N.response?.data?.message;L[ge.id]={message:k||ge.error.message,status:N.response?.status||N.status}}}),this.processInitOptions(A,T,q,P),this.currentFetchedData={...T},U.log("Blocking data loaded:",Object.keys(T)),Object.keys(L).length>0&&U.log("Data source errors:",L),Object.keys(q).length>0&&U.log("Local state init (blocking):",Object.keys(q)),Object.keys(P).length>0&&U.log("Isolated state init (blocking):",Object.keys(P)));const B=x.length>0;if(B&&(Ur.setPending(!0),U.log("Transition started before rendering")),n!==this.currentRouteChangeId){U.log("Route change cancelled after blocking data (newer request exists):",n);return}const{getState:W}=await Promise.resolve().then(()=>qr),he=W().currentDataContext||{},Se=x.map(te=>te.id),be={};if(B){Se.forEach(ge=>{he[ge]!==void 0?be[ge]=he[ge]:be[ge]=void 0});const te=Object.keys(be).filter(ge=>be[ge]!==void 0);te.length>0&&U.log("Preserving previous progressive data:",te),U.log("Progressive data sources initialized:",Se)}const Ue=l.defines||{},Ve={...be,...e.params,...T,route:{...e.params||{},path:e.path},query:f,_global:{...this.globalState},_globalSetState:te=>this.setGlobalState(te),_dataSourceErrors:Object.keys(L).length>0?L:void 0,_localInit:Object.keys(q).length>0?q:void 0,_isolatedInit:Object.keys(P).length>0?P:void 0,_defines:Object.keys(Ue).length>0?Ue:void 0};if(l.computed&&Object.keys(l.computed).length>0){const te=this.calculateComputed(l.computed,Ve);Object.keys(te).length>0&&(Ve._computed=te,this.globalState._computed=te,U.log("Computed values calculated:",Object.keys(te))),Ve._computedDefinitions=l.computed}const Ge=l.layout_name||e.layout;this.currentLayoutName!==""&&this.currentLayoutName!==Ge&&(U.log("_local reset due to layout change:",{from:this.currentLayoutName,to:Ge}),this.globalState._local={},iE()),this.currentLayoutName=Ge;const J=l.initLocal||l.state;if(J&&Object.keys(J).length>0){this.globalState._local||(this.globalState._local={});for(const[te,ge]of Object.entries(J))this.globalState._local[te]===void 0&&(this.globalState._local[te]=JSON.parse(JSON.stringify(ge)));Ve._local={...this.globalState._local},U.log("initLocal applied to _local:",Object.keys(J))}if(l.initGlobal&&Object.keys(l.initGlobal).length>0){for(const[te,ge]of Object.entries(l.initGlobal))this.globalState[te]===void 0&&(this.globalState[te]=JSON.parse(JSON.stringify(ge)));U.log("initGlobal applied to _global:",Object.keys(l.initGlobal))}if(l.initIsolated&&Object.keys(l.initIsolated).length>0){for(const[te,ge]of Object.entries(l.initIsolated))P[te]===void 0&&(P[te]=JSON.parse(JSON.stringify(ge)));U.log("initIsolated applied:",Object.keys(l.initIsolated))}Ve._global={...this.globalState,layoutWarnings:l.warnings||[]};const ue=l.initActions||l.init_actions;if(ue&&ue.length>0){await this.executeInitActions(ue,Ve),U.log("initActions executed before render");const te=this.globalState;if(te._local){if(Object.keys(q).length>0){for(const[ge,N]of Object.entries(q))te._local[ge]!==void 0?te._local[ge]=this.deepMerge(te._local[ge],N):te._local[ge]=N;U.log("localInit merged into _local after initActions:",Object.keys(q))}Ve._local=te._local,U.log("_local merged into dataContext:",te._local)}if(Ve._global={...this.globalState,layoutWarnings:l.warnings||[]},U.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,U.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;U.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 vs({containerId:"app",layoutJson:l,dataContext:Ve,translationContext:{templateId:this.config.templateId,locale:this.config.locale}}),U.log("Initial render complete with blocking data"),this.reattachSpinnerOverlay(),x.length>0){if(n!==this.currentRouteChangeId){U.log("Route change cancelled before progressive fetch (newer request exists):",n),Ur.setPending(!1),this.hideTransitionOverlay();return}U.log("Fetching progressive/background data sources:",x.map(N=>N.id));const{updateTemplateData:te,getState:ge}=await Promise.resolve().then(()=>qr);try{const N=x.map(async k=>{try{const fe=(await v.fetchDataSourcesWithResults([k],e.params||{},h,this.globalState))[0];if(!fe){U.log(`Data source ${k.id} skipped (no fetch result)`);return}if(n!==this.currentRouteChangeId){U.log(`Data source ${k.id} fetch cancelled (newer request exists)`);return}if(fe.state==="success"&&fe.data!==void 0){U.log(`Progressive data source loaded: ${k.id}`),this.currentFetchedData[k.id]=fe.data;const xe={};this.processInitOptions([k],{[k.id]:fe.data},xe);const ee=ge();if(ee.bindingEngine){const Be=[k.id];k.initGlobal&&Be.push("_global"),k.initLocal&&Be.push("_local"),ee.bindingEngine.invalidateCacheByKeys(Be)}const _e={[k.id]:fe.data};Object.keys(xe).length>0&&(_e._localInit=xe,Object.assign(q,xe)),k.initGlobal&&(_e._global={...this.globalState}),te(_e)}else if(fe.state==="error"&&fe.error){const xe=fe.error,ee=xe.response?.data?.message;L[k.id]={message:ee||fe.error.message,status:xe.response?.status||xe.status},U.log(`Progressive data source error: ${k.id}`,L[k.id]),te({[k.id]:null,_dataSourceErrors:{...L}})}}catch(de){U.error(`Failed to fetch data source: ${k.id}`,de)}});if(await Promise.all(N),n!==this.currentRouteChangeId){U.log("Route change cancelled after progressive fetch (newer request exists):",n);return}U.log("All progressive data sources loaded")}finally{Ur.setPending(!1),this.hideTransitionOverlay()}}else this.hideTransitionOverlay();const Me=_.filter(te=>te.type==="websocket");if(Me.length>0){U.log("Subscribing WebSocket data sources:",Me.map(k=>k.id));const{updateTemplateData:te,getState:ge}=await Promise.resolve().then(()=>qr),N={...this.currentFetchedData,...e.params,route:{...e.params||{},path:e.path},query:f,_global:{...this.globalState}};U.log("WebSocket binding context keys:",Object.keys(N)),this.currentWebSocketSubscriptions=v.subscribeWebSockets(_,(k,de)=>{U.log(`WebSocket data received for: ${k}`,de),this.currentFetchedData[k]=de;const fe=_.find(Be=>Be.id===k),xe=ge();if(xe.bindingEngine){const Be=[k];fe?.initGlobal&&Be.push("_global"),fe?.initLocal&&Be.push("_local"),xe.bindingEngine.invalidateCacheByKeys(Be)}te({[k]:de});const _e=_.find(Be=>Be.type==="websocket"&&(Be.target_source||Be.id)===k)?.onReceive;Array.isArray(_e)&&_e.length>0&&window.G7Core?.dispatch&&(async()=>{for(const Re of _e)try{const Ie=this.getActionDispatcher?.();Ie&&await Ie.dispatchAction(Re,{navigate:this.getRouter?.()?(Et,lt)=>this.getRouter().navigate(Et,lt):void 0,setState:Et=>this.setGlobalState(Et),state:this.globalState,data:{...this.globalState,$args:[de],$event:de},_isDispatchFallbackContext:!0})}catch(Ie){U.error(`WebSocket onReceive action failed for ${k}:`,Ie)}})()},N),U.log("WebSocket subscriptions established:",this.currentWebSocketSubscriptions)}U.log("Layout rendered successfully")}catch(a){U.error("Route change handling failed:",a),this.hideTransitionOverlay(),this.showRouteError(a)}}processInitOptions(e,n,a,i){e.some(c=>c.refetchOnMount===!0&&c.initLocal)&&(a._forceLocalInit=Date.now(),U.log("refetchOnMount detected, forcing local state init")),e.forEach(c=>{const d=n[c.id];if(!d)return;const f=d.data??d;if(c.initLocal){if(typeof c.initLocal=="string"){let h=f;if(c.initLocalDefaults&&typeof c.initLocalDefaults=="object"){const y=this.evaluateDefaults(c.initLocalDefaults,n);h={...y,...f},U.log(`initLocalDefaults applied for ${c.initLocal}:`,Object.keys(y))}const m=this.globalState._local?.[c.initLocal];m!==void 0&&typeof m=="object"&&typeof h=="object"?(a[c.initLocal]=this.deepMerge(m,h),U.log(`initLocal (merged): ${c.id}.data -> _local.${c.initLocal}`)):(a[c.initLocal]=h,U.log(`initLocal: ${c.id}.data -> _local.${c.initLocal}`))}else if(typeof c.initLocal=="object"&&c.initLocal.key){const{key:h,path:m}=c.initLocal;let y=m?this.extractValueByPathOrExpression(f,m,c.id):f;if(c.initLocalDefaults&&typeof c.initLocalDefaults=="object"){const v=this.evaluateDefaults(c.initLocalDefaults,n);y={...v,...y},U.log(`initLocalDefaults applied for ${h}:`,Object.keys(v))}const S=this.globalState._local?.[h];S!==void 0&&typeof S=="object"&&typeof y=="object"?(a[h]=this.deepMerge(S,y),U.log(`initLocal (merged): ${c.id}.data${m?"."+m:""} -> _local.${h}`)):(a[h]=y,U.log(`initLocal: ${c.id}.data${m?"."+m:""} -> _local.${h}`))}else if(typeof c.initLocal=="object"){const h=c.initLocal._merge||"deep",m=this.flattenNestedObjectToMappings(c.initLocal);for(const{targetPath:y,sourcePath:S}of m){const v=this.extractValueByPathOrExpression(f,S,c.id);if(y.includes(".")){const _=y.split(".")[0];a[_]===void 0&&this.globalState._local?.[_]!==void 0&&(a[_]=JSON.parse(JSON.stringify(this.globalState._local[_]))),this.setValueAtPath(a,y,v,h),U.log(`initLocal map (${h}): ${c.id} ${S} -> _local.${y}`)}else{const _=this.globalState._local?.[y];h==="replace"?(a[y]=v,U.log(`initLocal map (replace): ${c.id} ${S} -> _local.${y}`)):h==="shallow"?_!==void 0&&typeof _=="object"&&typeof v=="object"?(a[y]={..._,...v},U.log(`initLocal map (shallow): ${c.id} ${S} -> _local.${y}`)):(a[y]=v,U.log(`initLocal map: ${c.id} ${S} -> _local.${y}`)):_!==void 0&&typeof _=="object"&&typeof v=="object"?(a[y]=this.deepMerge(_,v),U.log(`initLocal map (deep): ${c.id} ${S} -> _local.${y}`)):(a[y]=v,U.log(`initLocal map: ${c.id} ${S} -> _local.${y}`))}}}}if(c.initGlobal)if(typeof c.initGlobal=="object"&&!Array.isArray(c.initGlobal)&&!("key"in c.initGlobal))for(const[m,y]of Object.entries(c.initGlobal)){if(typeof y!="string"){U.warn(`initGlobal map value must be string, got ${typeof y} for key ${m}`);continue}const S=this.extractValueByPathOrExpression(f,y,c.id),v=this.globalState[m];v!==void 0&&typeof v=="object"&&typeof S=="object"?(this.globalState[m]=this.deepMerge(v,S),U.log(`initGlobal map (merged): ${c.id} ${y} -> _global.${m}`)):(this.globalState[m]=S,U.log(`initGlobal map: ${c.id} ${y} -> _global.${m}`))}else{const m=Array.isArray(c.initGlobal)?c.initGlobal:[c.initGlobal];for(const y of m)if(typeof y=="string"){const S=this.globalState[y];S!==void 0&&typeof S=="object"&&typeof f=="object"?(this.globalState[y]=this.deepMerge(S,f),U.log(`initGlobal (merged): ${c.id}.data -> _global.${y}`)):(this.globalState[y]=f,U.log(`initGlobal: ${c.id}.data -> _global.${y}`))}else if(typeof y=="object"&&y.key){const{key:S,path:v}=y,_=v?this.extractValueByPathOrExpression(f,v,c.id):f,A=this.globalState[S];A!==void 0&&typeof A=="object"&&typeof _=="object"?(this.globalState[S]=this.deepMerge(A,_),U.log(`initGlobal (merged): ${c.id}.data${v?"."+v:""} -> _global.${S}`)):(this.globalState[S]=_,U.log(`initGlobal: ${c.id}.data${v?"."+v:""} -> _global.${S}`))}}if(i&&c.initIsolated){if(typeof c.initIsolated=="string"){const h=i[c.initIsolated];h!==void 0&&typeof h=="object"&&typeof f=="object"?(i[c.initIsolated]=this.deepMerge(h,f),U.log(`initIsolated (merged): ${c.id}.data -> _isolated.${c.initIsolated}`)):(i[c.initIsolated]=f,U.log(`initIsolated: ${c.id}.data -> _isolated.${c.initIsolated}`))}else if(typeof c.initIsolated=="object"&&c.initIsolated.key){const{key:h,path:m}=c.initIsolated,y=m?this.extractValueByPathOrExpression(f,m,c.id):f,S=i[h];S!==void 0&&typeof S=="object"&&typeof y=="object"?(i[h]=this.deepMerge(S,y),U.log(`initIsolated (merged): ${c.id}.data${m?"."+m:""} -> _isolated.${h}`)):(i[h]=y,U.log(`initIsolated: ${c.id}.data${m?"."+m:""} -> _isolated.${h}`))}else if(typeof c.initIsolated=="object")for(const[h,m]of Object.entries(c.initIsolated)){if(typeof m!="string"){U.warn(`initIsolated map value must be string, got ${typeof m} for key ${h}`);continue}const y=this.extractValueByPathOrExpression(f,m,c.id),S=i[h];S!==void 0&&typeof S=="object"&&typeof y=="object"?(i[h]=this.deepMerge(S,y),U.log(`initIsolated map (merged): ${c.id} ${m} -> _isolated.${h}`)):(i[h]=y,U.log(`initIsolated map: ${c.id} ${m} -> _isolated.${h}`))}}})}evaluateDefaults(e,n){const a={};for(const[i,l]of Object.entries(e))if(typeof l=="string"&&l.startsWith("{{")&&l.endsWith("}}")){const c=l.slice(2,-2).trim();a[i]=this.evaluateExpression(c,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){U.warn(`Expression evaluation failed: ${e}`,a);return}}getNestedValue(e,n){const a=n.replace(/\?\./g,".");let i=e;const l=a.split(/\.(?![^\[]*\])/).flatMap(c=>{const d=c.match(/^([^\[]*)((?:\[\d+\])*)$/);if(d){const[,f,h]=d,m=[];f&&m.push(f);const y=h.match(/\[\d+\]/g);return y&&m.push(...y),m}return[c]}).filter(c=>c!=="");for(const c of l){if(i==null)return;if(c.startsWith("[")&&c.endsWith("]")){const d=parseInt(c.slice(1,-1),10);i=i[d]}else i=i[c]}return i}extractValueByPathOrExpression(e,n,a){const i=Ta(n);if(i!==null){const l=new On,c={data:e,_global:this.globalState,_local:this.globalState._local||{}};try{const d=Vn(i)?l.evaluatePipeExpression(i,c,{skipCache:!0}):l.evaluateExpression(i,c);return U.log(`initLocal/initGlobal expression evaluated: ${n} -> `,d),d}catch(d){U.warn(`initLocal/initGlobal expression evaluation failed for ${a}:`,n,d);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)&&!is({if:i.if,conditions:i.conditions},n,this.bindingEngine,`script:${i.id}`)){U.log(`Script skipped (condition not met): ${i.id}`);continue}if(document.getElementById(i.id)){U.log(`Script already loaded: ${i.id}`);continue}if(!this.isAllowedScriptSrc(i.src)){U.warn(`Blocked untrusted external script src (same-origin path or declared trusted host required): ${i.id} (${i.src})`);continue}const c=new Promise((d,f)=>{const h=document.createElement("script");h.src=i.src,h.id=i.id,h.async=i.async??!0,h.onload=()=>{U.log(`Script loaded successfully: ${i.id}`),d()},h.onerror=()=>{U.warn(`Failed to load script: ${i.id} (${i.src})`),d()},document.head.appendChild(h)});a.push(c)}a.length>0&&(await Promise.all(a),U.log(`All scripts loaded: ${e.filter(i=>!document.getElementById(i.id)||a.length>0).map(i=>i.id).join(", ")}`))}isAllowedScriptSrc(e){if(typeof e!="string")return!1;const n=e.trim();if(n==="")return!1;const a=or.normalizeScriptSrcForOriginCheck(n),i=a.startsWith("//"),l=/^[a-z][a-z0-9+.-]*:/i.test(a);if(!i&&!l&&a.startsWith("/"))return!0;const c=this.extractScriptHost(a);return c!==null&&this.getTrustedScriptHosts().includes(c)}static normalizeScriptSrcForOriginCheck(e){return e.replace(/[\t\n\r]/g,"").replace(/\\/g,"/").replace(/^([a-z][a-z0-9+.\-]*:)?\/{2,}/i,"$1//")}extractScriptHost(e){try{const n=e.startsWith("//")?`${window.location.protocol}${e}`:e,a=new URL(n,window.location.origin);return a.protocol!=="http:"&&a.protocol!=="https:"?null:a.hostname.toLowerCase()}catch{return null}}getTrustedScriptHosts(){const e=window.G7Config?.trustedScriptHosts;return Array.isArray(e)?e.map(n=>String(n).toLowerCase()):[]}evaluateScriptCondition(e,n){try{if(e.startsWith("{{")&&e.endsWith("}}")){const a=e.slice(2,-2).trim();return!!Ld(a,n)}return!!e}catch(a){return U.warn(`Failed to evaluate script condition: ${e}`,a),!1}}showInitError(e){if(yd()){U.warn("Init failed while document is unloading — skipping error screen",e);return}const n=Vy(e);If.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,c="";switch(a.style){case"blur":l=i?"rgba(17,24,39,0.3)":"rgba(255,255,255,0.3)",c="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};${c}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 c.split(";")){const h=f.indexOf(":");h!==-1&&d.style.setProperty(f.slice(0,h).trim(),f.slice(h+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 c=br.getInstance().getComponent(n.component);if(!c){U.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){U.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)",y=f==="fullpage"?"app":f==="fallback"?i:e,S=`#${CSS.escape(y)}`,v=document.createElement("style");v.id="g7-skeleton-overlay-style",v.textContent=`${S}{position:relative;z-index:0;}${S}::after{content:'';position:absolute;inset:0;background:${m};z-index:2147483646;pointer-events:none;}`,document.head.appendChild(v),this.transitionOverlayEl=v;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 T=d.getBoundingClientRect(),L=window.scrollX||document.documentElement.scrollLeft,q=window.scrollY||document.documentElement.scrollTop;_.style.cssText=["position:absolute",`top:${T.top+q}px`,`left:${T.left+L}px`,`width:${T.width}px`,`height:${T.height}px`,"z-index:20","overflow:hidden","pointer-events:none",`background:${m}`].join(";")+";"}document.body.appendChild(_),this.skeletonOverlayContainer=_;const A=a.components||[];let x;if(f==="fullpage")x=A;else{const T=f==="fallback"?i:e;x=this.findComponentChildrenById(A,T)}const D=fd.createRoot(_);this.skeletonOverlayRoot=D,Oa.flushSync(()=>{D.render(Xe.createElement(c,{components:x,options:{animation:n.animation||"pulse",iteration_count:n.iteration_count||5}}))});const M=f==="fullpage"?"fullpage (#app)":f==="fallback"?`fallback (#${i})`:`target (#${e})`;U.log(`Skeleton overlay rendered [${M}] with "${n.component}" (${x.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 c=a(l.children);if(c!==null)return c}}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){U.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 c=l==="fullpage"?"app":l==="fallback"?a:e,d=`#${CSS.escape(c)}`,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 h=n?.text||window.G7Core?.t?.("nav.loading")||"";this._spinnerState={target:e,fallbackTarget:a,spinnerConfig:n,resolvedText:h},this._mountSpinnerInTarget(i);const m=l==="fullpage"?"fullpage (#app)":l==="fallback"?`fallback (#${a})`:`target (#${e})`,y=n?.component||"default spinner";U.log(`Spinner overlay rendered [${m}] with "${y}"`)}_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 c=br.getInstance().getComponent(n.component);if(c){const d=fd.createRoot(i);this.skeletonOverlayRoot=d,Oa.flushSync(()=>{d.render(Xe.createElement(c,{options:{text:a}}))});return}U.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),U.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 xr&&e.details?.status===401){const a=this.config.templateId||"",i=window.location.pathname,l=a.includes("admin")||i.startsWith("/admin")?"admin":"user",c=i+window.location.search,d=!!zr().getToken()||e.details?.hadToken===!0,f=wr.getInstance().getLoginRedirectUrl(l,c,d?"session_expired":void 0);window.location.href=f;return}const n=Vy(e);If.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;U.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"))?(U.log(`${e.code} error page rendered successfully`),!0):(U.log(`Falling back to ErrorDisplay for ${e.code}`),this.showInitError(new Error(`Service unavailable (${e.code})`)),!0)}catch(n){return U.error(`Failed to render ${e.code} page:`,n),this.showInitError(new Error(`Service unavailable (${e.code})`)),!0}}async handleRouteNotFound(e){U.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"))){U.log("404 error page rendered successfully");return}U.log("Falling back to ErrorDisplay for 404"),this.showRouteError(new Error(`Page not found: ${e}`))}catch(n){U.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(){U.log("reloadExtensionState: start");let e;try{const n=await fetch(jr(`/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){U.warn("reloadExtensionState: failed to fetch config.json",n)}e!==void 0&&e!==this.extensionCacheVersion&&(U.log(`reloadExtensionState: cache version ${this.extensionCacheVersion} -> ${e}`),this.extensionCacheVersion=e,this.saveCacheVersionToStorage(e));try{this.router&&(await this.router.loadRoutes(this.extensionCacheVersion),U.log("reloadExtensionState: routes reloaded"))}catch(n){U.error("reloadExtensionState: routes reload failed",n)}try{this.layoutLoader&&(this.extensionCacheVersion>0&&this.layoutLoader.setCacheVersion(this.extensionCacheVersion),this.layoutLoader.clear(),U.log("reloadExtensionState: layout cache cleared"))}catch(n){U.error("reloadExtensionState: layout cache clear failed",n)}try{const{TranslationEngine:n}=await Promise.resolve().then(()=>kg),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),U.log("reloadExtensionState: translations reloaded")}catch(n){U.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}}),U.log("reloadExtensionState: supportedLocales refreshed",i)}}}catch(n){U.warn("reloadExtensionState: supportedLocales refresh failed",n)}U.log("reloadExtensionState: done")}getActionDispatcher(){return na().actionDispatcher}async changeLocale(e){try{if(U.log("Changing locale to:",e),this.config.locale===e){U.log("Locale is already",e);return}this.config.locale=e,this.saveLocaleToStorage(e),await this.saveLocaleToDatabase(e),this.layoutLoader&&(this.layoutLoader.clear(),U.log("Layout cache cleared")),this.errorPageHandler&&(this.errorPageHandler.updateLocale(e),U.log("ErrorPageHandler locale updated")),Oc(),await zo({templateId:this.config.templateId,templateType:this.config.templateType,locale:e,debug:this.config.debug,cacheVersion:this.extensionCacheVersion}),U.log("Template Engine re-initialized with new locale");const{getActionDispatcher:n}=await Promise.resolve().then(()=>qr),a=n();a&&(a.setDefaultContext({navigate:i=>this.router?.navigate(i)}),a.setGlobalStateUpdater((i,l)=>this.setGlobalState(i,l)),U.log("Navigate function and setGlobalState re-injected to ActionDispatcher")),this.reinitializeModuleHandlers(),U.log("Module handlers re-initialized"),this.reinitializeTemplateHandlers(),U.log("Template handlers re-initialized"),this.reinitializePluginHandlers(),U.log("Plugin handlers re-initialized"),this.router&&this.router.navigateToCurrentPath(),U.log("Locale changed successfully to",e)}catch(n){throw U.error("Failed to change locale:",n),n}}loadLocaleFromStorage(){try{return localStorage.getItem(or.LOCALE_STORAGE_KEY)}catch(e){return U.warn("Failed to load locale from storage:",e),null}}saveLocaleToStorage(e){try{localStorage.setItem(or.LOCALE_STORAGE_KEY,e)}catch(n){U.warn("Failed to save locale to storage:",n)}}async saveLocaleToDatabase(e){const n=localStorage.getItem("auth_token");if(!n){U.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(),c=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})});c.ok?U.log("Locale saved to DB:",e):U.warn("Failed to save locale to DB (UI will still change):",c.statusText)}catch(l){U.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(or.CACHE_VERSION_STORAGE_KEY);return e?parseInt(e,10):null}catch(e){return U.warn("Failed to load cache version from storage:",e),null}}saveCacheVersionToStorage(e){try{localStorage.setItem(or.CACHE_VERSION_STORAGE_KEY,String(e))}catch(n){U.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(),U.log(`Module handler re-initialized: ${a}`)}catch(i){U.warn(`Failed to re-initialize module handlers for ${a}:`,i)}})}reinitializeTemplateHandlers(){if(typeof window>"u")return;const e=window.G7TemplateHandlers;if(!e){U.warn("Template handlers not found on window.G7TemplateHandlers");return}const n=this.getActionDispatcher();if(!n){U.warn("ActionDispatcher not available for template handler registration");return}Object.entries(e).forEach(([a,i])=>{n.registerHandler(a,i)}),U.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(),U.log(`Plugin handler re-initialized: ${a}`)}catch(i){U.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},U.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(()=>qr).then(({updateTemplateData:l,getState:c})=>{const d=c();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(c=>c.id===e);if(l){a=l;break}}if(!a){U.warn(`Data source not found: ${e}`);return}U.log(`Refetching data source: ${e}`,n?.sync?"(sync mode)":"",n?.globalStateOverride?"(with global override)":"",n?.localStateOverride?"(with local override)":""),Ur.setPending(!0);try{const i=new Tr;this.currentGlobalHeaders.length>0&&i.setGlobalHeaders(this.currentGlobalHeaders);const l=na(),c=l.currentDataContext?._global||{},d=n?.globalStateOverride?{...c,...n.globalStateOverride}:c,f=l.currentDataContext?._local||{},h=n?.localStateOverride?{...f,...n.localStateOverride}:f,y=(await i.fetchDataSourcesWithResults([a],this.currentRouteParams,this.currentQueryParams,d,h,{ignoreAutoFetch:!0}))[0];if(y.state==="success"&&y.data!==void 0){this.currentFetchedData[e]=y.data;const S={};this.processInitOptions([a],{[e]:y.data},S);const v=na();if(v.bindingEngine){const A=[e];a.initGlobal&&A.push("_global"),a.initLocal&&A.push("_local"),v.bindingEngine.invalidateCacheByKeys(A)}const _={[e]:y.data};return Object.keys(S).length>0&&(_._localInit=S),a.initGlobal&&(_._global={...this.globalState}),Ss(_,n?.sync?{sync:!0}:void 0),U.log(`Data source refetched successfully: ${e}`),y.data}else if(y.state==="error"){U.error(`Failed to refetch data source: ${e}`,y.error);return}}catch(i){U.error(`Error refetching data source: ${e}`,i);return}finally{Ur.setPending(!1)}}registerModalDataSources(e,n){this.modalDataSources.set(e,n),U.log(`Modal data sources registered: ${e} (${n.length} sources)`)}unregisterModalDataSources(e){this.modalDataSources.delete(e),U.log(`Modal data sources unregistered: ${e}`)}getDataSource(e){return this.currentFetchedData[e]}setDataSource(e,n,a){if(!e){U.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(()=>qr).then(({updateTemplateData:c})=>{c({[e]:this.currentFetchedData[e]},l?{sync:!0}:void 0)}),U.log(`setDataSource: Updated ${e}`,i?"(merged)":"(replaced)")}updateDataSourceItem(e,n,a,i,l){const{idField:c="id",merge:d=!0,skipRender:f=!1}=l||{},h=this.currentFetchedData[e];if(!h)return U.warn(`updateDataSourceItem: DataSource '${e}' not found`),!1;const m=this.parseItemPath(n);let y=h;for(const _ of m)if(y=y?.[_],y===void 0)return U.warn(`updateDataSourceItem: Path '${n}' not found in dataSource`),!1;if(!Array.isArray(y))return U.warn(`updateDataSourceItem: Target at '${n}' is not an array`),!1;const S=y.findIndex(_=>String(_[c])===String(a));if(S===-1)return U.warn(`updateDataSourceItem: Item with ${c}='${a}' not found`),!1;d?y[S]=this.deepMerge(y[S],i):y[S]={...y[S],...i};const v=window.G7Core?.devTools;return v?.isEnabled?.()&&v.trackDataSourceUpdate?.({dataSourceId:e,updateType:"partial",itemPath:n,itemId:a,updates:i,timestamp:Date.now()}),f||Promise.resolve().then(()=>qr).then(({updateTemplateData:_})=>{_({[e]:this.currentFetchedData[e]},{sync:!1})}),U.log(`updateDataSourceItem: Updated ${e}.${n}[${c}=${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 c=e;for(let h=0;h<l.length-1;h++){const m=l[h];(c[m]===void 0||c[m]===null||typeof c[m]!="object")&&(c[m]={}),c=c[m]}const d=l[l.length-1],f=c[d];i==="replace"||f===void 0?c[d]=a:i==="shallow"?typeof f=="object"&&typeof a=="object"&&!Array.isArray(a)?c[d]={...f,...a}:c[d]=a:typeof f=="object"&&typeof a=="object"&&!Array.isArray(a)?c[d]=this.deepMerge(f,a):c[d]=a}flattenNestedObjectToMappings(e,n=""){const a=[];for(const[i,l]of Object.entries(e)){if(i==="_merge")continue;const c=n?`${n}.${i}`:i;typeof l=="string"?a.push({targetPath:c,sourcePath:l}):typeof l=="object"&&l!==null&&!Array.isArray(l)&&a.push(...this.flattenNestedObjectToMappings(l,c))}return a}async updateQueryParams(e,n){U.log("updateQueryParams:",e);const a=new URL(e,window.location.origin),i=new URLSearchParams(a.search);window.history.replaceState(null,"",e),U.log("URL updated via replaceState"),this.currentQueryParams=i,U.log("currentQueryParams updated:",Object.fromEntries(i.entries()));const l=new Tr,c=na().currentDataContext?._global||this.globalState||{},d={route:this.currentRouteParams||{},query:Wy(this.currentQueryParams),_global:c},f=Array.isArray(this.currentRawDataSources)&&this.currentRawDataSources.length>0?l.filterByCondition(this.currentRawDataSources,d):this.currentDataSources;this.currentDataSources=f;const h=f.filter(A=>A.auto_fetch!==!1&&A.type!=="websocket");if(h.length===0){U.log("No auto_fetch data sources to refetch");return}U.log(`Refetching ${h.length} auto_fetch data sources`),Ur.setPending(!0);const m=na().currentLayoutJson,y=m?.transition_overlay,S=Array.isArray(y?.wait_for)?y.wait_for:[],v=h.some(A=>(A.loading_strategy||"progressive")==="blocking"),_=S.length>0&&h.some(A=>S.includes(A.id)&&A.type!=="websocket"&&(A.loading_strategy||"progressive")!=="background");if((v||_)&&y&&typeof y=="object"){const A=n?.transitionOverlayTarget||y.target;y.enabled&&y.style==="skeleton"&&y.skeleton?.component&&A?this.renderSkeletonOverlay(A,y.skeleton,m,y.fallback_target):y.enabled&&y.style==="spinner"&&A&&this.renderSpinnerOverlay(A,y.spinner,y.fallback_target)}try{const A=new Tr;this.currentGlobalHeaders.length>0&&A.setGlobalHeaders(this.currentGlobalHeaders);const x=na(),D=x.currentDataContext?._global||{},M=await A.fetchDataSourcesWithResults(h,this.currentRouteParams,this.currentQueryParams,D,void 0,{ignoreAutoFetch:!1}),T={},L={},q=new Map(h.map(P=>[P.id,P]));for(const P of M){const B=q.get(P.id);if(!B){U.warn(`Refetch result id not found in autoFetchDataSources: ${P.id}`);continue}const W=P.id;P.state==="success"&&P.data!==void 0?(this.currentFetchedData[W]=P.data,T[W]=P.data,this.processInitOptions([B],{[W]:P.data},L),U.log(`Data source refetched: ${W}`)):P.state==="error"&&U.error(`Failed to refetch data source: ${W}`,P.error)}if(x.bindingEngine){const P=Object.keys(T);P.push("query"),x.bindingEngine.invalidateCacheByKeys(P)}if(Object.keys(L).length>0&&(T._localInit=L),Object.keys(T).length>0){if(T.query=Wy(this.currentQueryParams),x.currentLayoutJson?.computed&&Object.keys(x.currentLayoutJson.computed).length>0){const P={...x.currentDataContext,...T,query:T.query},B=this.calculateComputed(x.currentLayoutJson.computed,P);Object.keys(B).length>0&&(T._computed=B,this.globalState._computed=B,U.log("Computed values recalculated in updateQueryParams:",Object.keys(B)))}Ss(T,{sync:!0}),U.log("Template data updated with new query params")}}catch(A){U.error("Error in updateQueryParams:",A)}finally{Ur.setPending(!1),this.hideTransitionOverlay()}}calculateComputed(e,n){const a={},i=new On;for(const[l,c]of Object.entries(e))try{let d;if(this.isComputedSwitchDefinition(c))d=i.resolveSwitch(c,n,{skipCache:!0});else if(typeof c=="string")if(c.startsWith("{{")&&c.endsWith("}}")){const f=c.slice(2,-2).trim();d=this.evaluateComputedExpression(f,n)}else d=c;a[l]=d,U.log(`Computed ${l}:`,d)}catch(d){U.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 Ld(e,n)}catch(a){U.warn(`Expression evaluation failed: ${e}`,a);return}}async executeInitActions(e,n={}){const{getActionDispatcher:a}=await Promise.resolve().then(()=>qr),i=a();if(!i){U.warn("ActionDispatcher not available for init_actions");return}U.log("Executing init_actions:",e.map(d=>d.handler)),U.log("Init actions dataContext:",n),U.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 c={...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},h=i.createHandler(f,c),m=new Event("init");await h(m),U.log(`Init action executed: ${d.handler}`);const y=this.globalState;c={...c,_global:{...y},_local:y._local||c._local||{}},U.log(`Data context refreshed after ${d.handler}:`,{cartKey:c._global?.cartKey})}catch(f){U.error(`Failed to execute init action: ${d.handler}`,f)}}async waitForHandlers(e,n,a=5e3){const i=Date.now(),l=50,c=()=>n.every(f=>e.customHandlers?.has(f));if(c()){U.log("All module handlers already registered");return}const d=Hf().getFailedJsAssets();if(d.length>0){const f=d.some(y=>y==="module"||y==="plugin"),h=n.filter(y=>!e.customHandlers?.has(y)),m=h.length>0&&h.every(y=>d.some(S=>y.startsWith(`${S}.`)));if(f||m){U.warn("Extension asset load failed — not waiting for handlers that will never register:",{pending:h,failedAssets:d});return}}return U.log("Waiting for module handlers:",n),new Promise(f=>{const h=()=>{if(c()){U.log("All module handlers now registered"),f();return}if(Date.now()-i>=a){const m=n.filter(y=>!e.customHandlers?.has(y));U.warn("Timeout waiting for handlers:",m),f();return}setTimeout(h,l)};h()})}};$(or,"LOCALE_STORAGE_KEY","g7_locale"),$(or,"CACHE_VERSION_STORAGE_KEY","g7_cache_version");let $o=or;function Uf(s){const e=new $o(s);return s.websocket&&(Tc.configure(s.websocket),U.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=Uf,window.G7Core.dataSource={refetch:async(s,e)=>{const n=window.__templateApp;if(!n){U.warn("TemplateApp not initialized (G7Core.dataSource.refetch)");return}return n.refetchDataSource(s,e)},get:s=>{const e=window.__templateApp;if(!e){U.warn("TemplateApp not initialized (G7Core.dataSource.get)");return}return e.getDataSource(s)}});function XA(s={}){const{checked:e,value:n,name:a,type:i="checkbox"}=s,c=n!==void 0?n:i==="checkbox"||i==="radio"?e??!1:String(e??""),d={checked:e??!1,value:c,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 JA(s={}){const{button:e=0,clientX:n=0,clientY:a=0}=s;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 QA(){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 ZA(s,e="keydown"){return{key:s,code:s.length===1?`Key${s.toUpperCase()}`:s,preventDefault:()=>{},stopPropagation:()=>{},nativeEvent:new KeyboardEvent(e,{key:s}),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 ex={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 Yy(s){const e=s.replace(/^(dark:|hover:|focus:|active:|disabled:|group-hover:|sm:|md:|lg:|xl:|2xl:)+/,"");for(const[n,a]of Object.entries(ex))if(a.test(e))return n;return null}function Xy(s){const e=s.match(/^((dark:|hover:|focus:|active:|disabled:|group-hover:|sm:|md:|lg:|xl:|2xl:)+)/);return e?e[1]:""}function tx(s,e){if(!e||e.trim()==="")return s;if(!s||s.trim()==="")return e;const n=s.split(/\s+/).filter(Boolean),a=e.split(/\s+/).filter(Boolean),i=new Map;for(const c of a){const d=Yy(c);if(d){const f=Xy(c),h=`${d}:${f}`;i.set(h,c)}}return[...n.filter(c=>{const d=Yy(c);if(!d)return!0;const f=Xy(c),h=`${d}:${f}`;return!i.has(h)}),...a].join(" ")}function nx(s){return Object.entries(s).filter(([,e])=>e).map(([e])=>e).join(" ")}function rx(...s){return s.filter(e=>typeof e=="string"&&e.length>0).join(" ")}const ye=pt("G7CoreGlobals");function ax(){window.React=Xe,window.ReactDOM={...hd,createPortal:Oa.createPortal,unstable_batchedUpdates:s=>s()},window.ReactJSXRuntime=ZC,ye.log("전역 객체 window.React, window.ReactDOM, window.ReactJSXRuntime에 노출됨")}function ix(s){const e=new Map,n=Ma.getInstance();s.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),c=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 h=>{try{return await h(i)}catch(m){throw ye.error(`componentEvent: Error in listener for "${a}":`,m),m}}))}catch(h){d=h instanceof Error?h:new Error(String(h))}if(n.trackEventEmit(a,i,c,f,d),d)throw d;return f},off:a=>{e.delete(a),n.trackEventOff(a)},clear:()=>{e.clear(),n.trackEventClear()}},ye.log("전역 객체 window.G7Core.componentEvent에 노출됨")}function sx(s){s.__runtime||(s.__runtime={DynamicRenderer:Br,ComponentRegistry:br,TranslationEngine:xa,DataSourceManager:Tr,dataSourceManager:zA,DataBindingEngine:On,dataBindingEngine:$d,ActionDispatcher:Co,TranslationReactContext:Of,TranslationProvider:_c,useTranslation:$y,ResponsiveContext:lf,ResponsiveProvider:uc,useResponsive:cf,responsiveManager:mi,BREAKPOINT_PRESETS:Fl,AuthManager:wr,createLogger:pt,G7DevToolsCore:Ma},ye.log("전역 객체 window.G7Core.__runtime(코어 런타임 표면)에 노출됨"))}function ox(s){if(s.layoutEditor&&s.layoutEditor.__isStub!==!0||s.layoutEditor&&s.layoutEditor.__isStub===!0)return;const e=[],n=[];s.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)}},ye.log("전역 객체 window.G7Core.layoutEditor 예약 접수함(stub) 노출됨")}function lx(s,e){s.useTranslation=$y,s.t=(n,a)=>{const i=e.getState();if(!i.translationEngine||!i.translationContext)return n;if(a){const l="|"+Object.entries(a).map(([c,d])=>`${c}=${d}`).join("|");return i.translationEngine.translate(n,i.translationContext,l)}return i.translationEngine.translate(n,i.translationContext)},ye.log("전역 객체 window.G7Core.useTranslation에 노출됨")}function cx(s,e){s.createChangeEvent=XA,s.createClickEvent=JA,s.createSubmitEvent=QA,s.createKeyboardEvent=ZA,s.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)}),s.createLogger=pt,ye.log("전역 객체 window.G7Core.createLogger에 노출됨"),s.renderItemChildren=(n,a,i,l,c)=>{const d=e.getState(),m={_global:window.__templateApp?.getGlobalState?.()||{},_local:a._local||{},_computed:a._computed||{},...a},y=new Set,S=(_,A)=>{const x=m._global?._remountKeys;return _&&x?.[_]&&!y.has(_)?(y.add(_),`${_}-remount-${x[_]}`):_||A},v={translationContext:d.translationContext,translationEngine:d.translationEngine,bindingEngine:d.bindingEngine,actionDispatcher:d.actionDispatcher,getRemountKey:S,...c};return ho(n,m,i,l,v)},s.evaluateCondition=(n,a)=>{if(!n)return!0;const i=e.getState(),c=window.__templateApp?.getGlobalState?.()||{},d={_global:c,_local:c._local||{},_computed:c._computed||{},...a||{}},f=i.bindingEngine??$d;return Bg(n,d,f)},s.getComponentMap=()=>br.getInstance().getComponentMap(),s.renderComponentLayout=(n,a,i)=>{if(!n||!Array.isArray(n)||n.length===0)return null;const l=br.getInstance().getComponentMap(),c=e.getState(),f=window.__templateApp?.getGlobalState?.()||{},h={_global:f._global||{},_local:f._local||{},_computed:f._computed||{},...a},m=new Set,y=(S,v)=>{const _=h._global?._remountKeys;return S&&_?.[S]&&!m.has(S)?(m.add(S),`${S}-remount-${_[S]}`):S||v};return ho(n,h,l,i,{translationContext:c.translationContext,translationEngine:c.translationEngine,bindingEngine:c.bindingEngine,actionDispatcher:c.actionDispatcher,getRemountKey:y})},s.renderExpandContent=n=>{const{children:a,row:i,expandContext:l,componentContext:c,keyPrefix:d}=n;if(!a||!Array.isArray(a)||a.length===0)return null;const f=n.componentMap||br.getInstance().getComponentMap(),h=e.getState(),m=s.state?.get?.()||{},y=c?.stateRef?.current??c?.state??{},S={...m._local||{},...y},v=c?.computedRef?.current??m._computed??{},_=h.bindingEngine??s.getDataBindingEngine?.(),A={...m,_local:S,_computed:v,row:i,item:i,$item:i};let x={};if(l&&typeof l=="object"&&_)try{for(const[L,q]of Object.entries(l))if(typeof q=="string"){const P=Ta(q);if(P!==null)try{x[L]=Vn(P)?_.evaluatePipeExpression(P,A,{skipCache:!0}):_.evaluateExpression(P,A,{skipCache:!0})}catch{x[L]=void 0}else x[L]=_.resolveBindings(q,A,{skipCache:!0})}else x[L]=q}catch(L){ye.warn("renderExpandContent: expandContext 평가 오류:",L)}const D={row:i,item:i,$item:i,_local:S,_global:m._global||{},_computed:m._computed||{},...x},M=new Set,T=(L,q)=>{const P=D._global?._remountKeys;return L&&P?.[L]&&!M.has(L)?(M.add(L),`${L}-remount-${P[L]}`):L||q};return ho(a,D,f,d,{translationContext:h.translationContext,translationEngine:h.translationEngine??void 0,bindingEngine:h.bindingEngine??void 0,actionDispatcher:h.actionDispatcher,componentContext:c,getRemountKey:T})},s.$get=function(a,i,l=void 0){if(a==null)return l;const c=Array.isArray(i)?i:[i];if(c.length===0)return a;let d=a;for(const f of c){if(d==null||f==null)return l;d=d[f]}return d??l},ye.log("전역 객체 window.G7Core.renderItemChildren에 노출됨"),ye.log("전역 객체 window.G7Core.renderComponentLayout에 노출됨"),ye.log("전역 객체 window.G7Core.renderExpandContent에 노출됨"),ye.log("전역 객체 window.G7Core.$get에 노출됨")}function ux(s){s.dispatch=async(e,n)=>{const a=window.__templateApp;if(!a)return ye.warn("G7Core.dispatch: TemplateApp이 초기화되지 않았습니다."),{success:!1,error:new Error("TemplateApp이 초기화되지 않았습니다.")};const i=a.getActionDispatcher?.();if(!i)return ye.warn("G7Core.dispatch: ActionDispatcher를 찾을 수 없습니다."),{success:!1,error:new Error("ActionDispatcher를 찾을 수 없습니다.")};const l=a.getRouter?.(),c=a.getGlobalState?.(),d=a.setGlobalState?.bind(a),h=n?.componentContext||window.__g7ActionContext,m=window.__g7PendingLocalState;let y=h?.state??c;m&&h&&(y=m,ye.log("[dispatch] Using __g7PendingLocalState for context.state:",m));let S=h?.data??c;m&&h?.data?._local&&(S={...h.data,_local:m},ye.log("[dispatch] Updated context.data._local with pendingLocalState"));const v={navigate:l?(_,A)=>l.navigate(_,A):void 0,setState:h?.setState??d,state:y,data:S,_isDispatchFallbackContext:!h?.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:x,debounceKey:D,...M}=e;i.dispatchAction(M,v)}),{success:!0,debounced:!0}}try{return await i.dispatchAction(e,v)}catch(_){return ye.error("G7Core.dispatch: 액션 실행 오류:",_),{success:!1,error:_ instanceof Error?_:new Error(String(_))}}},ye.log("전역 객체 window.G7Core.dispatch에 노출됨")}function No(s){const e={};for(const[n,a]of Object.entries(s))if(n.includes(".")){const i=n.split(".");let l=e;for(let c=0;c<i.length-1;c++){const d=i[c];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 Jy(s,e=""){const n=[];if(!s||typeof s!="object")return n;for(const a of Object.keys(s)){const i=e?`${e}.${a}`:a,l=s[a];l&&typeof l=="object"&&!Array.isArray(l)?n.push(...Jy(l,i)):n.push(i)}return n}function dx(s){const e=Object.keys(s);return e.length>0&&e.every(n=>/^\d+$/.test(n))}function Qy(s,e){const n={...s};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]=Qy(n[a],e[a])):n[a]=e[a];return n}function sr(s,e){if(Array.isArray(s)&&!Array.isArray(e)&&dx(e)){const a=Object.keys(e).map(l=>parseInt(l,10));if(!((a.length>0?Math.max(...a):0)>=s.length+a.length+10)){const l=[...s];for(const[c,d]of Object.entries(e)){const f=parseInt(c,10);f>=0&&f<l.length?d!==null&&typeof d=="object"&&!Array.isArray(d)&&l[f]!==null&&typeof l[f]=="object"?l[f]=sr(l[f],d):l[f]=d:f>=l.length&&(l[f]=d)}return l}}const n={...s};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]=sr(n[a],i):n[a]={...i}:n[a]=i;return n}function fx(s){s.state={get:()=>window.__templateApp?.getGlobalState?.()||{},set:(e,n)=>{const a=window.__templateApp;if(a?.setGlobalState&&a?.getGlobalState){const i=n?.merge||"deep",l=No(e);let c;if(i==="replace")c=l;else if(i==="shallow")c={...a.getGlobalState(),...l};else{const d=a.getGlobalState();c=sr(d,l)}a.setGlobalState(c,{render:n?.render})}else ye.warn("G7Core.state.set: TemplateApp이 초기화되지 않았습니다.")},setLocal:(e,n)=>{const a=window.__templateApp;if(n?.render===!1&&!n?.selfManaged){const x=window.__g7AutoBindingPaths;x&&x.size>0&&Jy(No(e)).some(M=>x.has(M))&&(ye.log("[setLocal] render:false + 자동바인딩 경로 겹침 감지 → render:true 자동 승격 (engine-v1.43.0)"),n={...n,render:!0})}if(n?.debounce){const x=a?.getActionDispatcher?.();if(x){const D=n.debounceKey||`setLocal-${Object.keys(e).join(",")}`,{debounce:M,debounceKey:T,...L}=n;x.debouncedCall(D,n.debounce,()=>{s.state.setLocal(e,L)});return}}const i=n?.scope??"current",l=n?.merge||"deep",c=window.__g7ActionContext,d=No(e);if(i==="parent"||i==="root"){const x=window.__g7LayoutContextStack||[];if(x.length>0){const D=i==="parent"?x[x.length-1]:x[0];if(D?.setState){D.setState(M=>l==="replace"?d:l==="shallow"?{...M||{},...d}:sr(M||{},d)),ye.log(`[setLocal] scope=${i}: 타겟 컨텍스트에 상태 업데이트 (mergeMode=${l})`,d);return}}ye.warn(`[setLocal] scope=${i}: 레이아웃 컨텍스트 스택이 비어있습니다. current로 폴백합니다.`)}const f=window.__g7PendingLocalState,h=a?.getGlobalState?.()?._local||{},S=!((window.__g7LayoutContextStack||[]).length>0)&&c?.state?c.state:void 0,v=S?Qy(h,S):h,_=f||v;let A;if(l==="replace"?A=d:l==="shallow"?A={..._,...d}:A=sr(_,d),a?.setGlobalState&&(a.setGlobalState({_local:A},{render:n?.render}),ye.log(`[setLocal] globalLocal updated via setGlobalState (mergeMode=${l}, render=${n?.render??!0}):`,d)),window.__g7PendingLocalState=A,ye.log("[setLocal] __g7PendingLocalState updated:",A),window.__g7SequenceLocalSync=A,window.__g7LastSetLocalSnapshot=A,l==="replace")window.__g7ForcedLocalFields=d;else{const x=window.__g7ForcedLocalFields||{};window.__g7ForcedLocalFields=sr(x,d)}if(ye.log("[setLocal] __g7ForcedLocalFields updated:",d),l==="replace")window.__g7SetLocalOverrideKeys=d;else{const x=window.__g7SetLocalOverrideKeys||{};window.__g7SetLocalOverrideKeys=sr(x,d)}ye.log("[setLocal] __g7SetLocalOverrideKeys updated:",d),c?.setState&&c.setState(x=>l==="replace"?d:l==="shallow"?{...x||{},...d}:sr(x||{},d)),a?.setGlobalState||ye.warn("G7Core.state.setLocal: TemplateApp이 없습니다.")},getLocal:()=>{const a=(window.__templateApp?.getGlobalState?.()||{})._local||{},i=window.__g7PendingLocalState;if(i)return sr(a,i);const l=window.__g7LastSetLocalSnapshot;return l&&l!==a?sr(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 ye.warn("G7Core.state.update: TemplateApp이 초기화되지 않았습니다.")},subscribe:e=>{const n=window.__templateApp;return n?.onGlobalStateChange?n.onGlobalStateChange(e):(ye.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,c;typeof e=="string"?(i=e,l=n||{},c=a):(l=e,c=n&&typeof n=="object"&&"merge"in n?n:a);const d=c?.merge||"deep",f=No(l);if(i){const y=window.__g7IsolatedStates?.[i];y?.mergeState?y.mergeState(f,d):ye.warn(`G7Core.state.setIsolated: scopeId '${i}'를 찾을 수 없습니다.`);return}const h=window.__g7ActionContext;h?.isolatedContext?.mergeState?h.isolatedContext.mergeState(f,d):ye.warn("G7Core.state.setIsolated: 액션 컨텍스트에 isolatedContext가 없습니다.")},getParent:()=>{const e=window.__g7LayoutContextStack||[];if(e.length===0)return ye.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||s.state.get()||{},setState:n.setState}},setParentLocal:(e,n,a)=>{const i=window.__g7LayoutContextStack||[];if(i.length===0){ye.warn("[setParentLocal] 레이아웃 컨텍스트 스택이 비어있습니다.");return}const l=i[i.length-1];if(!l?.setState){ye.warn("[setParentLocal] 부모 컨텍스트에 setState가 없습니다.");return}let c,d;typeof e=="string"?(c={[e]:n},d=a):(c=e,d=n&&typeof n=="object"&&"merge"in n?n:a);const f=d?.merge||"deep",h=No(c),m=l.state?._local!==void 0,y=m?l.state._local:l.state||{};let S;f==="replace"?S=h:f==="shallow"?S={...y,...h}:S=sr(y,h),window.__g7PendingLocalState=S;const v=window.__templateApp;if(v?.setGlobalState&&v.setGlobalState({_local:S}),l.setState(S),m?l.state._local=S:l.state=S,l.dataContext&&(l.dataContext._local=S),f==="replace")window.__g7ForcedLocalFields=h;else{const _=window.__g7ForcedLocalFields||{};window.__g7ForcedLocalFields=sr(_,h)}af()},setParentGlobal:(e,n)=>{let a;typeof e=="string"?a={[e]:n}:a=e,s.state.set(a),ye.log("[setParentGlobal] 전역 상태 업데이트:",a)}},window.__g7IsolatedStates||(window.__g7IsolatedStates={}),s.state.getGlobal=s.state.get,s.state.setGlobal=s.state.set,ye.log("전역 객체 window.G7Core.state에 노출됨")}function hx(s){s.dataSource={get:e=>window.__templateApp?.getDataSource?.(e),set:(e,n,a)=>{const i=window.__templateApp;i?.setDataSource?i.setDataSource(e,n,a):ye.warn("G7Core.dataSource.set: TemplateApp이 초기화되지 않았습니다.")},refetch:async(e,n)=>{const a=window.__templateApp;if(a?.refetchDataSource)return a.refetchDataSource(e,n);ye.warn("G7Core.dataSource.refetch: TemplateApp이 초기화되지 않았습니다.")},updateItem:(e,n,a,i,l)=>{const c=window.__templateApp;return c?.updateDataSourceItem?c.updateDataSourceItem(e,n,a,i,l):(ye.warn("G7Core.dataSource.updateItem: TemplateApp이 초기화되지 않았습니다."),!1)},updateData:(e,n,a,i="append")=>{const l=window.__templateApp;if(!l?.getDataSource||!l?.setDataSource)return ye.warn("G7Core.dataSource.updateData: TemplateApp이 초기화되지 않았습니다."),!1;const c=l.getDataSource(e);if(!c)return ye.warn(`G7Core.dataSource.updateData: 데이터 소스 '${e}'를 찾을 수 없습니다.`),!1;let d,f=c,h=null;if(n){const y=n.split(".");h=y.pop();for(const S of y)if(f&&typeof f=="object"&&S in f)f=f[S];else return ye.warn(`G7Core.dataSource.updateData: 경로 '${n}'를 찾을 수 없습니다.`),!1;d=f[h]}else d=c;if(!Array.isArray(d))return ye.warn("G7Core.dataSource.updateData: 대상 경로의 데이터가 배열이 아닙니다."),!1;if(!Array.isArray(a))return ye.warn("G7Core.dataSource.updateData: newData가 배열이 아닙니다."),!1;const m=i==="prepend"?[...a,...d]:[...d,...a];return n&&h?(f[h]=m,l.setDataSource(e,c,{merge:!1})):l.setDataSource(e,m,{merge:!1}),ye.log(`G7Core.dataSource.updateData: '${e}'에 ${a.length}개 항목 ${i==="prepend"?"앞에":"뒤에"} 추가됨`),!0}},ye.log("전역 객체 window.G7Core.dataSource에 노출됨")}function px(s,e){s.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):ye.warn("G7Core.locale.change: TemplateApp이 초기화되지 않았습니다.")}},ye.log("전역 객체 window.G7Core.locale에 노출됨")}function gx(s){s.toast={show:(e,n)=>{s.dispatch({handler:"toast",params:{message:e,type:n?.type||"info",...n?.duration&&{duration:n.duration}}})},success:(e,n)=>{s.toast.show(e,{type:"success",duration:n})},error:(e,n)=>{s.toast.show(e,{type:"error",duration:n})},warning:(e,n)=>{s.toast.show(e,{type:"warning",duration:n})},info:(e,n)=>{s.toast.show(e,{type:"info",duration:n})}},ye.log("전역 객체 window.G7Core.toast에 노출됨")}function mx(s){s.modal={open:e=>{s.dispatch({handler:"openModal",target:e})},close:e=>{s.dispatch({handler:"closeModal",...e&&{target:e}})},closeAll:()=>{s.dispatch({handler:"closeAllModals"})},isOpen:e=>{const n=s.state.get();return n._global?.activeModal===e||n._global?.modalStack?.includes(e)||!1},getStack:()=>s.state.get()._global?.modalStack||[]},ye.log("전역 객체 window.G7Core.modal에 노출됨")}function yx(s){s.style={mergeClasses:tx,conditionalClass:nx,joinClasses:rx},ye.log("전역 객체 window.G7Core.style에 노출됨")}function bx(s,e){const{webSocketManager:n}=e;s.websocket={manager:n,subscribe:(a,i,l,c)=>n.subscribe(a,i,l,c),unsubscribe:a=>n.unsubscribe(a),leaveChannel:a=>n.leaveChannel(a),disconnect:()=>n.disconnect(),isInitialized:()=>n.isInitialized(),getSubscriptionCount:()=>n.getSubscriptionCount()},ye.log("전역 객체 window.G7Core.websocket에 노출됨")}function vx(s,e){const{transitionManager:n}=e;s.navigation={isPending:()=>n?.getIsPending?.()||!1,onComplete:a=>{if(!n)return a(),()=>{};let i=n.getIsPending();const l=n.subscribe(c=>{c?i=!0:i&&(a(),l())});return l}},ye.log("전역 객체 window.G7Core.navigation에 노출됨")}function Sx(s){s.plugin={getSettings:e=>window.G7Config?.plugins?.[e],get:(e,n,a)=>window.G7Config?.plugins?.[e]?.[n]??a,getAll:()=>window.G7Config?.plugins??{}},ye.log("전역 객체 window.G7Core.plugin에 노출됨")}function wx(s){s.module={getSettings:e=>window.G7Config?.modules?.[e],get:(e,n,a)=>window.G7Config?.modules?.[e]?.[n]??a,getAll:()=>window.G7Config?.modules??{}},ye.log("전역 객체 window.G7Core.module에 노출됨")}function Cx(s,e){const{transitionManager:n,responsiveManager:a}=e;s.AuthManager=wr,s.api=zr(),s.TransitionManager=n,s.useTransitionState=Fm,s.ResponsiveManager=a,s.useResponsive=cf,s.useControllableState=fE,s.shallowArrayEqual=hE,s.shallowObjectEqual=Km,s.updateQueryParams=async(i,l)=>{const c=window.__templateApp;if(c?.updateQueryParams)return c.updateQueryParams(i,l);ye.warn("G7Core.updateQueryParams: TemplateApp이 초기화되지 않았습니다.")},ye.log("전역 객체 window.G7Core.AuthManager에 노출됨"),ye.log("전역 객체 window.G7Core.api에 노출됨"),ye.log("전역 객체 window.G7Core.ResponsiveManager에 노출됨"),ye.log("전역 객체 window.G7Core.useResponsive에 노출됨"),ye.log("전역 객체 window.G7Core.useControllableState에 노출됨"),ye.log("전역 객체 window.G7Core.updateQueryParams에 노출됨")}function Ex(s,e){s.getSlotContext=()=>window.__slotContextValue??null,s.getDynamicRenderer=()=>window.__DynamicRenderer??null,s.getComponentRegistry=()=>e.getComponentRegistry?.()??br.getInstance(),s.getDataBindingEngine=()=>e.getDataBindingEngine?.()??e.getState().bindingEngine,s.getTranslationEngine=()=>e.getTranslationEngine?.()??e.getState().translationEngine,s.getActionDispatcher=()=>e.getActionDispatcher?.()??e.getState().actionDispatcher,ye.log("전역 객체 window.G7Core 슬롯 API에 노출됨 (getSlotContext, getDynamicRenderer 등)")}function _x(s){s.identity={setLauncher:_t.setLauncher.bind(_t),handle:_t.handle.bind(_t),isIdentityRequired:_t.isIdentityRequired.bind(_t),hasLauncher:_t.hasLauncher.bind(_t),markDomainNoticeShown:_t.markDomainNoticeShown.bind(_t),redirectExternally:_t.redirectExternally.bind(_t),createDeferred:_t.createDeferred.bind(_t),resolveDeferred:_t.resolveDeferred.bind(_t),reset:_t.reset.bind(_t),redirectStashKey:Qd},ye.log("전역 객체 window.G7Core 본인인증(IDV) API에 노출됨 (identity)")}function Ax(s){if(typeof window>"u")return;ax(),window.G7Core||(window.G7Core={});const e=window.G7Core;sx(e),ix(e),ox(e),Cx(e,s),lx(e,s),cx(e,s),ux(e),fx(e),hx(e),px(e,s),gx(e),mx(e),yx(e),bx(e,s),vx(e,s),Sx(e),wx(e),Ex(e,s),_x(e),ye.log("G7Core 전역 객체 초기화 완료")}function xx(){const s=window.G7Core;if(!s){ye.warn("G7Core가 초기화되지 않았습니다.");return}const e=()=>Ma.getInstance(),n={isEnabled:()=>{try{return e().isEnabled()}catch{return!1}},trackRender:a=>{try{e().isEnabled()&&e().trackRender(a)}catch{}},trackIteration:(a,i,l,c,d)=>{try{e().isEnabled()&&e().trackIteration(a,{source:i,itemVar:l,indexVar:c,sourceLength:d})}catch{}},trackIfCondition:(a,i,l,c)=>{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,c)=>{try{e().isEnabled()&&e().trackHandlerRegistration(a,i,l,c)}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,c)=>{try{return e().isEnabled()?e().startStateChange(a,i,l,c):""}catch{return""}},completeStateChange:a=>{try{e().isEnabled()&&e().completeStateChange(a)}catch{}},trackComponentRender:(a,i,l,c,d,f)=>{try{e().isEnabled()&&e().trackComponentRender(a,i,l,c,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,c)=>{try{e().isEnabled()&&e().trackComponentStateSource(a,i,l,c)}catch{}},trackDynamicState:(a,i)=>{try{e().isEnabled()&&e().trackDynamicState(a,i)}catch{}},trackContextFlow:(a,i,l,c,d,f)=>{try{e().isEnabled()&&e().trackContextFlow(a,i,l,c,d,f)}catch{}},trackComponentStyle:(a,i,l,c)=>{try{e().isEnabled()&&e().trackComponentStyle(a,i,l,c)}catch{}},trackAuthEvent:(a,i,l,c)=>{try{e().isEnabled()&&e().trackAuthEvent(a,i,l,c)}catch{}},trackAuthHeader:(a,i,l,c,d)=>{try{e().isEnabled()&&e().trackAuthHeader(a,i,l,c,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,c,d)=>{try{e().isEnabled()&&e().captureSequenceActionBefore(a,i,l,c,d)}catch{}},captureSequenceActionAfter:(a,i,l,c,d,f)=>{try{e().isEnabled()&&e().captureSequenceActionAfter(a,i,l,c,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,c,d)=>{try{return e().isEnabled()?e().detectStaleClosure(a,i,l,c,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,c,d,f,h)=>{try{e().isEnabled()&&e().trackComputedProperty(a,i,l,c,d,f,h)}catch{}},trackComputedRecalc:(a,i,l,c,d,f,h)=>{try{e().isEnabled()&&e().trackComputedRecalc(a,i,l,c,d,f,h)}catch{}},setNamedActionDefinitions:a=>{try{e().isEnabled()&&e().setNamedActionDefinitions(a)}catch{}},trackNamedActionRef:a=>{try{e().isEnabled()&&e().trackNamedActionRef(a)}catch{}}};s.devTools=n,ye.log("G7Core.devTools 인터페이스 초기화 완료")}let Io=null;function Tx(){const s=window.G7Core;return s?.__devtools?Promise.resolve(s.__devtools):Io||(Io=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 c=document.getElementById(i);if(c){c.addEventListener("load",l,{once:!0}),c.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",()=>{Io=null,n(new Error(`DevTools 번들 로드 실패: ${a}`))},{once:!0}),document.head.appendChild(d)}),Io)}function kx(){const s=window.G7Core;if(!s){ye.warn("G7Core가 초기화되지 않았습니다.");return}const e=Ma.getInstance();if(e.initialize(),!e.isEnabled()){window.G7DevTools={isEnabled:()=>!1,enable:()=>{ye.log("환경설정 > 고급 설정 > 디버그 모드를 켜세요")}},gd(),ye.log("G7DevTools 비활성화됨 (디버그 모드 꺼짐)");return}Rx(s,e)}async function Rx(s,e){let n;try{n=await Tx()}catch(h){ye.warn("DevTools 번들 로드 실패 — 최소 API 로 폴백:",h),window.G7DevTools={isEnabled:()=>!1,enable:()=>{}},gd();return}const{DiagnosticEngine:a,getServerConnector:i,getStyleTracker:l}=n;xx(),gd();try{l().enable(),ye.log("StyleTracker 활성화됨")}catch(h){ye.warn("StyleTracker 활성화 실패:",h)}const c=new a,d=i(),f={isEnabled:()=>e.isEnabled(),state:{get:()=>e.getState(),getHistory:()=>e.getStateHistory(),watch:(h,m)=>e.watchState(h,m)},actions:{getHistory:()=>e.getActionHistory(),watch:h=>e.watchActions(h),getMetrics:()=>e.getActionMetrics()},binding:{evaluate:h=>{const m=s.getDataBindingEngine?.();if(!m){ye.warn("DataBindingEngine이 없습니다.");return}return m.evaluateExpression(h,e.getState())},getCacheStats:()=>e.getCacheStats(),clearStats:()=>{e.resetCacheStats(),ye.log("캐시 통계 초기화됨")}},diagnose:{analyze:h=>c.analyze(h),suggestFix:h=>c.suggestFix(h),getCommonIssues:()=>c.getCommonIssues(),getRulesByCategory:h=>c.getRulesByCategory(h)},server:{dumpState:h=>d.dumpState(h),sendLog:h=>d.sendLog(h),sendError:(h,m)=>d.sendError(h,m),isConnected:()=>d.isConnected(),testConnection:()=>d.testConnection()},config:{isDebugMode:()=>e.isEnabled(),setLogLevel:h=>e.setLogLevel(h),setMaxHistory:h=>e.setMaxHistory(h)},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,s.devtools=f,ye.log("G7DevTools 전역 객체 초기화 완료 (window.G7DevTools)"),Dx(n.DevToolsPanel)}function Dx(s){if(document.getElementById("g7-devtools-root")){ye.log("DevToolsPanel 이미 렌더링됨");return}const e=document.createElement("div");e.id="g7-devtools-root",document.body.appendChild(e);try{hd.createRoot(e).render(Xe.createElement(s)),ye.log("DevToolsPanel UI 렌더링 완료")}catch(n){ye.error("DevToolsPanel UI 렌더링 실패:",n)}}const et=pt("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 jo=!1;const Ho=[];async function Ox(s){try{et.log("템플릿 메타데이터 로드 중...",s);const e=s.split("-").map(a=>a.split("_").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join("")).join(""),n=window[e];return n?.templateMetadata?(et.log("템플릿 메타데이터 로드 완료 (전역 변수)",n.templateMetadata),n.templateMetadata):(et.warn(`템플릿 번들에 메타데이터가 없습니다. 전역 변수: ${e}`),{identifier:s,locales:["ko","en"],name:{ko:s,en:s},description:{ko:"",en:""},version:"1.0.0",type:"admin"})}catch(e){return et.error("템플릿 메타데이터 로드 실패",e),{identifier:s,locales:["ko","en"],name:{ko:s,en:s},description:{ko:"",en:""},version:"1.0.0",type:"admin"}}}function Zy(){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 zo(s){try{if(et.log("템플릿 엔진 초기화 시작",s),ie.isInitialized)throw new Error("템플릿 엔진이 이미 초기화되었습니다. destroyTemplate()을 먼저 호출하세요.");if(!s.templateId)throw new PA;jo=s.debug??!1,typeof window<"u"&&(window.G7Config||(window.G7Config={}),window.G7Config.debug=jo),kx(),ie.templateId=s.templateId,ie.locale=s.locale||"ko",et.log("엔진 인스턴스 생성 중..."),ie.registry=br.getInstance(),ie.bindingEngine=new On,ie.translationEngine=xa.getInstance(),s.cacheVersion!==void 0&&s.cacheVersion>0&&ie.translationEngine.setCacheVersion(s.cacheVersion),ie.translationContext={templateId:s.templateId,locale:ie.locale},ie.actionDispatcher=new Co({},ie.translationEngine,ie.translationContext),rE(ie.actionDispatcher),et.log("다국어 파일 로드 중...",s.templateId,ie.locale);const e="en",n=[ie.translationEngine.loadTranslations(s.templateId,ie.locale).then(()=>{et.log(`다국어 파일 로드 완료: ${ie.locale}`)}).catch(a=>{et.warn(`다국어 파일 로드 실패 (${ie.locale}):`,a instanceof Error?a.message:a)})];ie.locale!==e&&n.push(ie.translationEngine.loadTranslations(s.templateId,e).then(()=>{et.log(`폴백 다국어 파일 로드 완료: ${e}`)}).catch(a=>{et.warn(`폴백 다국어 파일 로드 실패 (${e}):`,a instanceof Error?a.message:a)})),await Promise.allSettled(n),et.log("템플릿 메타데이터 로드 중...",s.templateId),ie.templateMetadata=await Ox(s.templateId),ie.isInitialized=!0,et.log("템플릿 엔진 초기화 완료 (ComponentRegistry는 별도 로드)")}catch(e){throw et.error("템플릿 엔진 초기화 실패",e),ie.isInitialized=!1,ie.registry=null,ie.bindingEngine=null,ie.translationEngine=null,ie.actionDispatcher=null,e}}let Uo=null;function Pf(){const s=window.G7Core;return s?.__LayoutEditorChrome?Promise.resolve(s.__LayoutEditorChrome):Uo||(Uo=new Promise((e,n)=>{const a=window.G7Config?.coreEditorAsset||"/build/core/layout-editor.min.js",i="g7-layout-editor-bundle",l=document.getElementById(i),c=()=>{const f=window.G7Core?.__LayoutEditorChrome;f?e(f):n(new Error("편집기 번들 로드됨 — 그러나 __LayoutEditorChrome 미노출"))};if(window.G7Core=window.G7Core||{},window.G7Core.__onChromeReady=c,l){l.addEventListener("load",c,{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",c,{once:!0}),d.addEventListener("error",()=>{Uo=null,n(new Error(`편집기 번들 로드 실패: ${a}`))},{once:!0}),document.head.appendChild(d)}),Uo)}async function vs(s){try{if(et.log("템플릿 렌더링 시작",s),!ie.isInitialized)throw new Error("템플릿 엔진이 초기화되지 않았습니다. initTemplateEngine()을 먼저 호출하세요.");if(!s.containerId)throw new Error("containerId는 필수입니다.");if(!s.layoutJson)throw new Error("layoutJson은 필수입니다.");const e=document.getElementById(s.containerId);if(!e)throw new Error(`컨테이너를 찾을 수 없습니다: #${s.containerId}`);const n=Zy();if(ie.containerId=s.containerId,ie.currentLayoutJson=s.layoutJson,ie.currentDataContext={...n,...s.dataContext||{}},ie.translationContext=s.translationContext||{templateId:ie.templateId||"",locale:ie.locale},ie.reactRoot||(et.log("React Root 생성"),ie.reactRoot=hd.createRoot(e)),typeof window<"u"){const l=Ky(window.location.pathname);if(l){et.log("레이아웃 편집기 모드 진입",l);let c;try{c=await Pf()}catch(f){et.error("레이아웃 편집기 번들 로드 실패",f),If.render(s.containerId,{title:"레이아웃 편집기 로드 실패",message:f instanceof Error?f.message:"편집기 번들을 불러오지 못했습니다.",icon:"fas fa-triangle-exclamation",showStack:!1,showReloadButton:!0,debug:jo});return}const d=Xe.createElement(c,{templateIdentifier:l.templateIdentifier,initialLocale:ie.locale});ie.reactRoot.render(Xe.createElement(_c,{translationEngine:ie.translationEngine,translationContext:ie.translationContext,children:Xe.createElement(sf,{children:Xe.createElement(uc,{children:Xe.createElement(Lf,{children:d})})})}));return}}const a=s.layoutJson.components||[];if(a.length===0){et.warn("렌더링할 컴포넌트가 없습니다.");return}const i=s.layoutJson.modals||[];if(et.log("modals 배열:",i),et.log("modals 개수:",i.length),et.log("DynamicRenderer로 렌더링 시작"),ie.reactRoot.render(Xe.createElement(_c,{translationEngine:ie.translationEngine,translationContext:ie.translationContext},Xe.createElement(sf,null,Xe.createElement(uc,null,Xe.createElement(Lf,null,[...a.map((l,c)=>{const d=ie.currentLayoutJson?.layout_name||"";return Xe.createElement(Br,{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:c===0,layoutKey:d})}),Xe.createElement(zm,{key:"__modal_parent_context_provider"},i.map(l=>{const c=ie.currentDataContext._global?.modalStack||[],f=c.includes(l.id)||ie.currentDataContext._global?.activeModal===l.id,h=c.indexOf(l.id),m=h>=0?50+h:50,y=window.__g7LayoutContextStack||[],v=y[y.length-1]?.dataContext,_=Xe.createElement(Br,{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:v});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:jo,children:_}):_}))]))))),et.log("템플릿 렌더링 완료"),Ho.length>0){et.log(`대기 중인 데이터 업데이트 ${Ho.length}건 적용`);const l=[...Ho];Ho.length=0;for(const{data:c,options:d}of l)Ss(c,d)}}catch(e){throw et.error("템플릿 렌더링 실패",e),e}}function Ss(s,e){try{if(et.log("템플릿 데이터 업데이트 시작",Object.keys(s)),!ie.isInitialized)throw new Error("템플릿 엔진이 초기화되지 않았습니다.");if(!ie.reactRoot||!ie.currentLayoutJson){et.log("React 미준비 - 데이터 업데이트 큐잉:",Object.keys(s)),Ho.push({data:s,options:e});return}const n=Zy(),a={...ie.currentDataContext._global||{},...s._global||{}},i=uE(ie.currentDataContext._localInit,s._localInit);ie.currentDataContext={...n,...ie.currentDataContext,...s,_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||[],c=ie.currentLayoutJson.modals||[];et.log("updateTemplateData - modals 배열:",c),et.log("updateTemplateData - modals 개수:",c.length),et.log("updateTemplateData - activeModal:",ie.currentDataContext._global?.activeModal);const d=()=>{ie.reactRoot.render(Xe.createElement(_c,{translationEngine:ie.translationEngine,translationContext:ie.translationContext},Xe.createElement(sf,null,Xe.createElement(uc,null,Xe.createElement(Lf,null,[...l.map((f,h)=>{const m=ie.currentLayoutJson?.layout_name||"";return Xe.createElement(Br,{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:h===0,layoutKey:m})}),Xe.createElement(zm,{key:"__modal_parent_context_provider_update"},c.map(f=>{const h=ie.currentDataContext._global?.modalStack||[],y=h.includes(f.id)||ie.currentDataContext._global?.activeModal===f.id,S=h.indexOf(f.id),v=S>=0?50+S:50,_=window.__g7LayoutContextStack||[],x=_[_.length-1]?.dataContext,D=Xe.createElement(Br,{key:`modal_${f.id}_renderer`,componentDef:{...f,props:{...f.props,isOpen:y,style:{...f.props?.style,zIndex:v},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:x});return f.data_sources&&f.data_sources.length>0?Xe.createElement(Fy,{key:`modal_${f.id}`,isOpen:y,modalId:f.id,dataSources:f.data_sources,dataContext:ie.currentDataContext,globalStateUpdater:ie.actionDispatcher?.getGlobalStateUpdater(),bindingEngine:ie.bindingEngine,debug:jo,children:D}):D}))])))))};e?.sync?(et.log("재렌더링 시작 (sync mode - 즉시 렌더링)"),d()):(et.log("재렌더링 시작 (with startTransition)"),j.startTransition(()=>{d()})),et.log("템플릿 데이터 업데이트 완료")}catch(n){throw et.error("템플릿 데이터 업데이트 실패",n),n}}function Oc(){try{et.log("템플릿 정리 시작"),ie.reactRoot&&(et.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,et.log("템플릿 정리 완료")}catch(s){throw et.error("템플릿 정리 실패",s),s}}function na(){return Object.freeze({...ie})}function eb(){return ie.actionDispatcher}const Po={initTemplateEngine:zo,renderTemplate:vs,updateTemplateData:Ss,destroyTemplate:Oc,getState:na};typeof window<"u"&&(window.G7Core||(window.G7Core={}),window.G7Core.TemplateEngine=Po,Ax({getState:()=>({translationEngine:ie.translationEngine,translationContext:ie.translationContext,bindingEngine:ie.bindingEngine,actionDispatcher:ie.actionDispatcher,templateMetadata:ie.templateMetadata}),transitionManager:Ur,responsiveManager:mi,webSocketManager:Tc}),et.log("전역 객체 window.G7Core.TemplateEngine에 노출됨"));const qr=Object.freeze(Object.defineProperty({__proto__:null,DataSourceManager:Tr,LayoutLoader:Df,TemplateApp:$o,TemplateEngine:Po,default:Po,destroyTemplate:Oc,getActionDispatcher:eb,getState:na,initTemplateApp:Uf,initTemplateEngine:zo,loadLayoutEditorBundle:Pf,renderTemplate:vs,updateTemplateData:Ss},Symbol.toStringTag,{value:"Module"}));Zt.DataSourceManager=Tr,Zt.LayoutLoader=Df,Zt.TemplateApp=$o,Zt.TemplateEngine=Po,Zt.default=Po,Zt.destroyTemplate=Oc,Zt.getActionDispatcher=eb,Zt.getState=na,Zt.initTemplateApp=Uf,Zt.initTemplateEngine=zo,Zt.loadLayoutEditorBundle=Pf,Zt.renderTemplate=vs,Zt.updateTemplateData=Ss,Object.defineProperties(Zt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})})(this.G7Core=this.G7Core||{});
|