Files
Gnuboard7/public/build/core/template-engine.min.js
T
HeuJung 32251b2a1d perf(core): 코어 번들 3분할로 초기 로딩 최적화
레이아웃 편집기·개발자 진단도구를 코어 번들에서 분리해 각각
편집 화면 진입 시·디버그 모드 시에만 지연 로드하도록 변경.
초기 접속 gzip payload 458KB → 221KB (52% 감소).

lazy 번들은 window.G7Core.__runtime 으로 코어 런타임을 공유해
React/컨텍스트/싱글톤 단일 인스턴스를 보장(재번들 0중복).
코어 7.0.1 bump.
2026-07-01 17:05:15 +09:00

288 lines
731 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
var ex=Object.defineProperty;var tx=(Gt,Ka,Wa)=>Ka in Gt?ex(Gt,Ka,{enumerable:!0,configurable:!0,writable:!0,value:Wa}):Gt[Ka]=Wa;var $=(Gt,Ka,Wa)=>tx(Gt,typeof Ka!="symbol"?Ka+"":Ka,Wa);(function(Gt){"use strict";function Ka(l,e){for(var a=0;a<e.length;a++){const r=e[a];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in l)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(l,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}))}function Wa(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var zu={exports:{}},Fe={};/**
* @license React
* react.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var dg;function rS(){if(dg)return Fe;dg=1;var l=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),v=Symbol.iterator;function E(x){return x===null||typeof x!="object"?null:(x=v&&x[v]||x["@@iterator"],typeof x=="function"?x:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,T={};function D(x,F,ue){this.props=x,this.context=F,this.refs=T,this.updater=ue||S}D.prototype.isReactComponent={},D.prototype.setState=function(x,F){if(typeof x!="object"&&typeof x!="function"&&x!=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,x,F,"setState")},D.prototype.forceUpdate=function(x){this.updater.enqueueForceUpdate(this,x,"forceUpdate")};function M(){}M.prototype=D.prototype;function O(x,F,ue){this.props=x,this.context=F,this.refs=T,this.updater=ue||S}var L=O.prototype=new M;L.constructor=O,A(L,D.prototype),L.isPureReactComponent=!0;var P=Array.isArray;function U(){}var B={H:null,A:null,T:null,S:null},Y=Object.prototype.hasOwnProperty;function ge(x,F,ue){var fe=ue.ref;return{$$typeof:l,type:x,key:F,ref:fe!==void 0?fe:null,props:ue}}function Ae(x,F){return ge(x.type,F,x.props)}function Oe(x){return typeof x=="object"&&x!==null&&x.$$typeof===l}function Ne(x){var F={"=":"=0",":":"=2"};return"$"+x.replace(/[=:]/g,function(ue){return F[ue]})}var He=/\/+/g;function Ze(x,F){return typeof x=="object"&&x!==null&&x.key!=null?Ne(""+x.key):F.toString(36)}function pt(x){switch(x.status){case"fulfilled":return x.value;case"rejected":throw x.reason;default:switch(typeof x.status=="string"?x.then(U,U):(x.status="pending",x.then(function(F){x.status==="pending"&&(x.status="fulfilled",x.value=F)},function(F){x.status==="pending"&&(x.status="rejected",x.reason=F)})),x.status){case"fulfilled":return x.value;case"rejected":throw x.reason}}throw x}function J(x,F,ue,fe,te){var ye=typeof x;(ye==="undefined"||ye==="boolean")&&(x=null);var je=!1;if(x===null)je=!0;else switch(ye){case"bigint":case"string":case"number":je=!0;break;case"object":switch(x.$$typeof){case l:case e:je=!0;break;case m:return je=x._init,J(je(x._payload),F,ue,fe,te)}}if(je)return te=te(x),je=fe===""?"."+Ze(x,0):fe,P(te)?(ue="",je!=null&&(ue=je.replace(He,"$&/")+"/"),J(te,F,ue,"",function(Ie){return Ie})):te!=null&&(Oe(te)&&(te=Ae(te,ue+(te.key==null||x&&x.key===te.key?"":(""+te.key).replace(He,"$&/")+"/")+je)),F.push(te)),1;je=0;var Me=fe===""?".":fe+":";if(P(x))for(var Pe=0;Pe<x.length;Pe++)fe=x[Pe],ye=Me+Ze(fe,Pe),je+=J(fe,F,ue,ye,te);else if(Pe=E(x),typeof Pe=="function")for(x=Pe.call(x),Pe=0;!(fe=x.next()).done;)fe=fe.value,ye=Me+Ze(fe,Pe++),je+=J(fe,F,ue,ye,te);else if(ye==="object"){if(typeof x.then=="function")return J(pt(x),F,ue,fe,te);throw F=String(x),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(x).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.")}return je}function de(x,F,ue){if(x==null)return x;var fe=[],te=0;return J(x,fe,"","",function(ye){return F.call(ue,ye,te++)}),fe}function me(x){if(x._status===-1){var F=x._result;F=F(),F.then(function(ue){(x._status===0||x._status===-1)&&(x._status=1,x._result=ue)},function(ue){(x._status===0||x._status===-1)&&(x._status=2,x._result=ue)}),x._status===-1&&(x._status=0,x._result=F)}if(x._status===1)return x._result.default;throw x._result}var ne=typeof reportError=="function"?reportError:function(x){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var F=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof x=="object"&&x!==null&&typeof x.message=="string"?String(x.message):String(x),error:x});if(!window.dispatchEvent(F))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",x);return}console.error(x)},pe={map:de,forEach:function(x,F,ue){de(x,function(){F.apply(this,arguments)},ue)},count:function(x){var F=0;return de(x,function(){F++}),F},toArray:function(x){return de(x,function(F){return F})||[]},only:function(x){if(!Oe(x))throw Error("React.Children.only expected to receive a single React element child.");return x}};return Fe.Activity=b,Fe.Children=pe,Fe.Component=D,Fe.Fragment=a,Fe.Profiler=i,Fe.PureComponent=O,Fe.StrictMode=r,Fe.Suspense=f,Fe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,Fe.__COMPILER_RUNTIME={__proto__:null,c:function(x){return B.H.useMemoCache(x)}},Fe.cache=function(x){return function(){return x.apply(null,arguments)}},Fe.cacheSignal=function(){return null},Fe.cloneElement=function(x,F,ue){if(x==null)throw Error("The argument must be a React element, but you passed "+x+".");var fe=A({},x.props),te=x.key;if(F!=null)for(ye in F.key!==void 0&&(te=""+F.key),F)!Y.call(F,ye)||ye==="key"||ye==="__self"||ye==="__source"||ye==="ref"&&F.ref===void 0||(fe[ye]=F[ye]);var ye=arguments.length-2;if(ye===1)fe.children=ue;else if(1<ye){for(var je=Array(ye),Me=0;Me<ye;Me++)je[Me]=arguments[Me+2];fe.children=je}return ge(x.type,te,fe)},Fe.createContext=function(x){return x={$$typeof:u,_currentValue:x,_currentValue2:x,_threadCount:0,Provider:null,Consumer:null},x.Provider=x,x.Consumer={$$typeof:o,_context:x},x},Fe.createElement=function(x,F,ue){var fe,te={},ye=null;if(F!=null)for(fe in F.key!==void 0&&(ye=""+F.key),F)Y.call(F,fe)&&fe!=="key"&&fe!=="__self"&&fe!=="__source"&&(te[fe]=F[fe]);var je=arguments.length-2;if(je===1)te.children=ue;else if(1<je){for(var Me=Array(je),Pe=0;Pe<je;Pe++)Me[Pe]=arguments[Pe+2];te.children=Me}if(x&&x.defaultProps)for(fe in je=x.defaultProps,je)te[fe]===void 0&&(te[fe]=je[fe]);return ge(x,ye,te)},Fe.createRef=function(){return{current:null}},Fe.forwardRef=function(x){return{$$typeof:d,render:x}},Fe.isValidElement=Oe,Fe.lazy=function(x){return{$$typeof:m,_payload:{_status:-1,_result:x},_init:me}},Fe.memo=function(x,F){return{$$typeof:g,type:x,compare:F===void 0?null:F}},Fe.startTransition=function(x){var F=B.T,ue={};B.T=ue;try{var fe=x(),te=B.S;te!==null&&te(ue,fe),typeof fe=="object"&&fe!==null&&typeof fe.then=="function"&&fe.then(U,ne)}catch(ye){ne(ye)}finally{F!==null&&ue.types!==null&&(F.types=ue.types),B.T=F}},Fe.unstable_useCacheRefresh=function(){return B.H.useCacheRefresh()},Fe.use=function(x){return B.H.use(x)},Fe.useActionState=function(x,F,ue){return B.H.useActionState(x,F,ue)},Fe.useCallback=function(x,F){return B.H.useCallback(x,F)},Fe.useContext=function(x){return B.H.useContext(x)},Fe.useDebugValue=function(){},Fe.useDeferredValue=function(x,F){return B.H.useDeferredValue(x,F)},Fe.useEffect=function(x,F){return B.H.useEffect(x,F)},Fe.useEffectEvent=function(x){return B.H.useEffectEvent(x)},Fe.useId=function(){return B.H.useId()},Fe.useImperativeHandle=function(x,F,ue){return B.H.useImperativeHandle(x,F,ue)},Fe.useInsertionEffect=function(x,F){return B.H.useInsertionEffect(x,F)},Fe.useLayoutEffect=function(x,F){return B.H.useLayoutEffect(x,F)},Fe.useMemo=function(x,F){return B.H.useMemo(x,F)},Fe.useOptimistic=function(x,F){return B.H.useOptimistic(x,F)},Fe.useReducer=function(x,F,ue){return B.H.useReducer(x,F,ue)},Fe.useRef=function(x){return B.H.useRef(x)},Fe.useState=function(x){return B.H.useState(x)},Fe.useSyncExternalStore=function(x,F,ue){return B.H.useSyncExternalStore(x,F,ue)},Fe.useTransition=function(){return B.H.useTransition()},Fe.version="19.2.0",Fe}var fg;function Iu(){return fg||(fg=1,zu.exports=rS()),zu.exports}var N=Iu();const We=Wa(N);var ju={exports:{}},qs={},Uu={exports:{}},Bu={};/**
* @license React
* scheduler.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var hg;function iS(){return hg||(hg=1,(function(l){function e(J,de){var me=J.length;J.push(de);e:for(;0<me;){var ne=me-1>>>1,pe=J[ne];if(0<i(pe,de))J[ne]=de,J[me]=pe,me=ne;else break e}}function a(J){return J.length===0?null:J[0]}function r(J){if(J.length===0)return null;var de=J[0],me=J.pop();if(me!==de){J[0]=me;e:for(var ne=0,pe=J.length,x=pe>>>1;ne<x;){var F=2*(ne+1)-1,ue=J[F],fe=F+1,te=J[fe];if(0>i(ue,me))fe<pe&&0>i(te,ue)?(J[ne]=te,J[fe]=me,ne=fe):(J[ne]=ue,J[F]=me,ne=F);else if(fe<pe&&0>i(te,me))J[ne]=te,J[fe]=me,ne=fe;else break e}}return de}function i(J,de){var me=J.sortIndex-de.sortIndex;return me!==0?me:J.id-de.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;l.unstable_now=function(){return o.now()}}else{var u=Date,d=u.now();l.unstable_now=function(){return u.now()-d}}var f=[],g=[],m=1,b=null,v=3,E=!1,S=!1,A=!1,T=!1,D=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function L(J){for(var de=a(g);de!==null;){if(de.callback===null)r(g);else if(de.startTime<=J)r(g),de.sortIndex=de.expirationTime,e(f,de);else break;de=a(g)}}function P(J){if(A=!1,L(J),!S)if(a(f)!==null)S=!0,U||(U=!0,Ne());else{var de=a(g);de!==null&&pt(P,de.startTime-J)}}var U=!1,B=-1,Y=5,ge=-1;function Ae(){return T?!0:!(l.unstable_now()-ge<Y)}function Oe(){if(T=!1,U){var J=l.unstable_now();ge=J;var de=!0;try{e:{S=!1,A&&(A=!1,M(B),B=-1),E=!0;var me=v;try{t:{for(L(J),b=a(f);b!==null&&!(b.expirationTime>J&&Ae());){var ne=b.callback;if(typeof ne=="function"){b.callback=null,v=b.priorityLevel;var pe=ne(b.expirationTime<=J);if(J=l.unstable_now(),typeof pe=="function"){b.callback=pe,L(J),de=!0;break t}b===a(f)&&r(f),L(J)}else r(f);b=a(f)}if(b!==null)de=!0;else{var x=a(g);x!==null&&pt(P,x.startTime-J),de=!1}}break e}finally{b=null,v=me,E=!1}de=void 0}}finally{de?Ne():U=!1}}}var Ne;if(typeof O=="function")Ne=function(){O(Oe)};else if(typeof MessageChannel<"u"){var He=new MessageChannel,Ze=He.port2;He.port1.onmessage=Oe,Ne=function(){Ze.postMessage(null)}}else Ne=function(){D(Oe,0)};function pt(J,de){B=D(function(){J(l.unstable_now())},de)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(J){J.callback=null},l.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"):Y=0<J?Math.floor(1e3/J):5},l.unstable_getCurrentPriorityLevel=function(){return v},l.unstable_next=function(J){switch(v){case 1:case 2:case 3:var de=3;break;default:de=v}var me=v;v=de;try{return J()}finally{v=me}},l.unstable_requestPaint=function(){T=!0},l.unstable_runWithPriority=function(J,de){switch(J){case 1:case 2:case 3:case 4:case 5:break;default:J=3}var me=v;v=J;try{return de()}finally{v=me}},l.unstable_scheduleCallback=function(J,de,me){var ne=l.unstable_now();switch(typeof me=="object"&&me!==null?(me=me.delay,me=typeof me=="number"&&0<me?ne+me:ne):me=ne,J){case 1:var pe=-1;break;case 2:pe=250;break;case 5:pe=1073741823;break;case 4:pe=1e4;break;default:pe=5e3}return pe=me+pe,J={id:m++,callback:de,priorityLevel:J,startTime:me,expirationTime:pe,sortIndex:-1},me>ne?(J.sortIndex=me,e(g,J),a(f)===null&&J===a(g)&&(A?(M(B),B=-1):A=!0,pt(P,me-ne))):(J.sortIndex=pe,e(f,J),S||E||(S=!0,U||(U=!0,Ne()))),J},l.unstable_shouldYield=Ae,l.unstable_wrapCallback=function(J){var de=v;return function(){var me=v;v=de;try{return J.apply(this,arguments)}finally{v=me}}}})(Bu)),Bu}var gg;function sS(){return gg||(gg=1,Uu.exports=iS()),Uu.exports}var qu={exports:{}},gn={};/**
* @license React
* react-dom.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var pg;function oS(){if(pg)return gn;pg=1;var l=Iu();function e(f){var g="https://react.dev/errors/"+f;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)g+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+f+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var r={d:{f:a,r:function(){throw Error(e(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},i=Symbol.for("react.portal");function o(f,g,m){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:b==null?null:""+b,children:f,containerInfo:g,implementation:m}}var u=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(f,g){if(f==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return gn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,gn.createPortal=function(f,g){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(e(299));return o(f,g,null,m)},gn.flushSync=function(f){var g=u.T,m=r.p;try{if(u.T=null,r.p=2,f)return f()}finally{u.T=g,r.p=m,r.d.f()}},gn.preconnect=function(f,g){typeof f=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,r.d.C(f,g))},gn.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},gn.preinit=function(f,g){if(typeof f=="string"&&g&&typeof g.as=="string"){var m=g.as,b=d(m,g.crossOrigin),v=typeof g.integrity=="string"?g.integrity:void 0,E=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;m==="style"?r.d.S(f,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:b,integrity:v,fetchPriority:E}):m==="script"&&r.d.X(f,{crossOrigin:b,integrity:v,fetchPriority:E,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},gn.preinitModule=function(f,g){if(typeof f=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var m=d(g.as,g.crossOrigin);r.d.M(f,{crossOrigin:m,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&r.d.M(f)},gn.preload=function(f,g){if(typeof f=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var m=g.as,b=d(m,g.crossOrigin);r.d.L(f,m,{crossOrigin:b,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},gn.preloadModule=function(f,g){if(typeof f=="string")if(g){var m=d(g.as,g.crossOrigin);r.d.m(f,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:m,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else r.d.m(f)},gn.requestFormReset=function(f){r.d.r(f)},gn.unstable_batchedUpdates=function(f,g){return f(g)},gn.useFormState=function(f,g,m){return u.H.useFormState(f,g,m)},gn.useFormStatus=function(){return u.H.useHostTransitionStatus()},gn.version="19.2.0",gn}var mg;function yg(){if(mg)return qu.exports;mg=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(e){console.error(e)}}return l(),qu.exports=oS(),qu.exports}/**
* @license React
* react-dom-client.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var bg;function lS(){if(bg)return qs;bg=1;var l=sS(),e=Iu(),a=yg();function r(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)n+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+t+"; visit "+n+" 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 o(t){var n=t,s=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(s=n.return),t=n.return;while(t)}return n.tag===3?s:null}function u(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function d(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function f(t){if(o(t)!==t)throw Error(r(188))}function g(t){var n=t.alternate;if(!n){if(n=o(t),n===null)throw Error(r(188));return n!==t?null:t}for(var s=t,c=n;;){var h=s.return;if(h===null)break;var p=h.alternate;if(p===null){if(c=h.return,c!==null){s=c;continue}break}if(h.child===p.child){for(p=h.child;p;){if(p===s)return f(h),t;if(p===c)return f(h),n;p=p.sibling}throw Error(r(188))}if(s.return!==c.return)s=h,c=p;else{for(var w=!1,k=h.child;k;){if(k===s){w=!0,s=h,c=p;break}if(k===c){w=!0,c=h,s=p;break}k=k.sibling}if(!w){for(k=p.child;k;){if(k===s){w=!0,s=p,c=h;break}if(k===c){w=!0,c=p,s=h;break}k=k.sibling}if(!w)throw Error(r(189))}}if(s.alternate!==c)throw Error(r(190))}if(s.tag!==3)throw Error(r(188));return s.stateNode.current===s?t:n}function m(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=m(t),n!==null)return n;t=t.sibling}return null}var b=Object.assign,v=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),O=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),Y=Symbol.for("react.lazy"),ge=Symbol.for("react.activity"),Ae=Symbol.for("react.memo_cache_sentinel"),Oe=Symbol.iterator;function Ne(t){return t===null||typeof t!="object"?null:(t=Oe&&t[Oe]||t["@@iterator"],typeof t=="function"?t:null)}var He=Symbol.for("react.client.reference");function Ze(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===He?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case A:return"Fragment";case D:return"Profiler";case T:return"StrictMode";case P:return"Suspense";case U:return"SuspenseList";case ge:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case S:return"Portal";case O:return t.displayName||"Context";case M:return(t._context.displayName||"Context")+".Consumer";case L:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case B:return n=t.displayName||null,n!==null?n:Ze(t.type)||"Memo";case Y:n=t._payload,t=t._init;try{return Ze(t(n))}catch{}}return null}var pt=Array.isArray,J=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,de=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,me={pending:!1,data:null,method:null,action:null},ne=[],pe=-1;function x(t){return{current:t}}function F(t){0>pe||(t.current=ne[pe],ne[pe]=null,pe--)}function ue(t,n){pe++,ne[pe]=t.current,t.current=n}var fe=x(null),te=x(null),ye=x(null),je=x(null);function Me(t,n){switch(ue(ye,n),ue(te,t),ue(fe,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?Av(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=Av(n),t=xv(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}F(fe),ue(fe,t)}function Pe(){F(fe),F(te),F(ye)}function Ie(t){t.memoizedState!==null&&ue(je,t);var n=fe.current,s=xv(n,t.type);n!==s&&(ue(te,t),ue(fe,s))}function Lt(t){te.current===t&&(F(fe),F(te)),je.current===t&&(F(je),Al._currentValue=me)}var At,Zt;function Tt(t){if(At===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);At=n&&n[1]||"",Zt=-1<s.stack.indexOf(`
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
`+At+t+Zt}var on=!1;function vt(t,n){if(!t||on)return"";on=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(n){var ce=function(){throw Error()};if(Object.defineProperty(ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ce,[])}catch(ee){var X=ee}Reflect.construct(t,[],ce)}else{try{ce.call()}catch(ee){X=ee}t.call(ce.prototype)}}else{try{throw Error()}catch(ee){X=ee}(ce=t())&&typeof ce.catch=="function"&&ce.catch(function(){})}}catch(ee){if(ee&&X&&typeof ee.stack=="string")return[ee.stack,X.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var p=c.DetermineComponentFrameRoot(),w=p[0],k=p[1];if(w&&k){var I=w.split(`
`),W=k.split(`
`);for(h=c=0;c<I.length&&!I[c].includes("DetermineComponentFrameRoot");)c++;for(;h<W.length&&!W[h].includes("DetermineComponentFrameRoot");)h++;if(c===I.length||h===W.length)for(c=I.length-1,h=W.length-1;1<=c&&0<=h&&I[c]!==W[h];)h--;for(;1<=c&&0<=h;c--,h--)if(I[c]!==W[h]){if(c!==1||h!==1)do if(c--,h--,0>h||I[c]!==W[h]){var ae=`
`+I[c].replace(" at new "," at ");return t.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",t.displayName)),ae}while(1<=c&&0<=h);break}}}finally{on=!1,Error.prepareStackTrace=s}return(s=t?t.displayName||t.name:"")?Tt(s):""}function Za(t,n){switch(t.tag){case 26:case 27:case 5:return Tt(t.type);case 16:return Tt("Lazy");case 13:return t.child!==n&&n!==null?Tt("Suspense Fallback"):Tt("Suspense");case 19:return Tt("SuspenseList");case 0:case 15:return vt(t.type,!1);case 11:return vt(t.type.render,!1);case 1:return vt(t.type,!0);case 31:return Tt("Activity");default:return""}}function Sn(t){try{var n="",s=null;do n+=Za(t,s),s=t,t=t.return;while(t);return n}catch(c){return`
Error generating stack: `+c.message+`
`+c.stack}}var qn=Object.prototype.hasOwnProperty,Ut=l.unstable_scheduleCallback,Rn=l.unstable_cancelCallback,_a=l.unstable_shouldYield,Pn=l.unstable_requestPaint,Vt=l.unstable_now,yt=l.unstable_getCurrentPriorityLevel,er=l.unstable_ImmediatePriority,Gn=l.unstable_UserBlockingPriority,en=l.unstable_NormalPriority,mn=l.unstable_LowPriority,ta=l.unstable_IdlePriority,wn=l.log,tr=l.unstable_setDisableYieldValue,Vn=null,Bt=null;function Cn(t){if(typeof wn=="function"&&tr(t),Bt&&typeof Bt.setStrictMode=="function")try{Bt.setStrictMode(Vn,t)}catch{}}var q=Math.clz32?Math.clz32:Q,le=Math.log,oe=Math.LN2;function Q(t){return t>>>=0,t===0?32:31-(le(t)/oe|0)|0}var he=256,ve=262144,we=4194304;function _e(t){var n=t&42;if(n!==0)return n;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 Be(t,n,s){var c=t.pendingLanes;if(c===0)return 0;var h=0,p=t.suspendedLanes,w=t.pingedLanes;t=t.warmLanes;var k=c&134217727;return k!==0?(c=k&~p,c!==0?h=_e(c):(w&=k,w!==0?h=_e(w):s||(s=k&~t,s!==0&&(h=_e(s))))):(k=c&~p,k!==0?h=_e(k):w!==0?h=_e(w):s||(s=c&~t,s!==0&&(h=_e(s)))),h===0?0:n!==0&&n!==h&&(n&p)===0&&(p=h&-h,s=n&-n,p>=s||p===32&&(s&4194048)!==0)?n:h}function $e(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function Re(t,n){switch(t){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 xe(){var t=we;return we<<=1,(we&62914560)===0&&(we=4194304),t}function Ke(t){for(var n=[],s=0;31>s;s++)n.push(t);return n}function qe(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Ce(t,n,s,c,h,p){var w=t.pendingLanes;t.pendingLanes=s,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=s,t.entangledLanes&=s,t.errorRecoveryDisabledLanes&=s,t.shellSuspendCounter=0;var k=t.entanglements,I=t.expirationTimes,W=t.hiddenUpdates;for(s=w&~s;0<s;){var ae=31-q(s),ce=1<<ae;k[ae]=0,I[ae]=-1;var X=W[ae];if(X!==null)for(W[ae]=null,ae=0;ae<X.length;ae++){var ee=X[ae];ee!==null&&(ee.lane&=-536870913)}s&=~ce}c!==0&&Ee(t,c,0),p!==0&&h===0&&t.tag!==0&&(t.suspendedLanes|=p&~(w&~n))}function Ee(t,n,s){t.pendingLanes|=n,t.suspendedLanes&=~n;var c=31-q(n);t.entangledLanes|=n,t.entanglements[c]=t.entanglements[c]|1073741824|s&261930}function Le(t,n){var s=t.entangledLanes|=n;for(t=t.entanglements;s;){var c=31-q(s),h=1<<c;h&n|t[c]&n&&(t[c]|=n),s&=~h}}function nt(t,n){var s=n&-n;return s=(s&42)!==0?1:kt(s),(s&(t.suspendedLanes|n))!==0?0:s}function kt(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 yn(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Ft(){var t=de.p;return t!==0?t:(t=window.event,t===void 0?32:Yv(t.type))}function na(t,n){var s=de.p;try{return de.p=t,n()}finally{de.p=s}}var Dn=Math.random().toString(36).slice(2),tn="__reactFiber$"+Dn,cn="__reactProps$"+Dn,On="__reactContainer$"+Dn,_o="__reactEvents$"+Dn,Jd="__reactListeners$"+Dn,Zd="__reactHandles$"+Dn,as="__reactResources$"+Dn,nr="__reactMarker$"+Dn;function Ao(t){delete t[tn],delete t[cn],delete t[_o],delete t[Jd],delete t[Zd]}function Dr(t){var n=t[tn];if(n)return n;for(var s=t.parentNode;s;){if(n=s[On]||s[tn]){if(s=n.alternate,n.child!==null||s!==null&&s.child!==null)for(t=Mv(t);t!==null;){if(s=t[tn])return s;t=Mv(t)}return n}t=s,s=t.parentNode}return null}function Or(t){if(t=t[tn]||t[On]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function yi(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(r(33))}function ja(t){var n=t[as];return n||(n=t[as]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Kt(t){t[nr]=!0}var vc=new Set,Sc={};function ar(t,n){Lr(t,n),Lr(t+"Capture",n)}function Lr(t,n){for(Sc[t]=n,t=0;t<n.length;t++)vc.add(n[t])}var Aa=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]*$"),xo={},Ua={};function To(t){return qn.call(Ua,t)?!0:qn.call(xo,t)?!1:Aa.test(t)?Ua[t]=!0:(xo[t]=!0,!1)}function rs(t,n,s){if(To(n))if(s===null)t.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var c=n.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){t.removeAttribute(n);return}}t.setAttribute(n,""+s)}}function is(t,n,s){if(s===null)t.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttribute(n,""+s)}}function xa(t,n,s,c){if(c===null)t.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(s);return}t.setAttributeNS(n,s,""+c)}}function Ln(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ss(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function ef(t,n,s){var c=Object.getOwnPropertyDescriptor(t.constructor.prototype,n);if(!t.hasOwnProperty(n)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var h=c.get,p=c.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return h.call(this)},set:function(w){s=""+w,p.call(this,w)}}),Object.defineProperty(t,n,{enumerable:c.enumerable}),{getValue:function(){return s},setValue:function(w){s=""+w},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function ko(t){if(!t._valueTracker){var n=ss(t)?"checked":"value";t._valueTracker=ef(t,n,""+t[n])}}function Ro(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var s=n.getValue(),c="";return t&&(c=ss(t)?t.checked?"true":"false":t.value),t=c,t!==s?(n.setValue(t),!0):!1}function rr(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 bi=/[\n"\\]/g;function Mn(t){return t.replace(bi,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function ir(t,n,s,c,h,p,w,k){t.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?t.type=w:t.removeAttribute("type"),n!=null?w==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+Ln(n)):t.value!==""+Ln(n)&&(t.value=""+Ln(n)):w!=="submit"&&w!=="reset"||t.removeAttribute("value"),n!=null?Do(t,w,Ln(n)):s!=null?Do(t,w,Ln(s)):c!=null&&t.removeAttribute("value"),h==null&&p!=null&&(t.defaultChecked=!!p),h!=null&&(t.checked=h&&typeof h!="function"&&typeof h!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?t.name=""+Ln(k):t.removeAttribute("name")}function wc(t,n,s,c,h,p,w,k){if(p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(t.type=p),n!=null||s!=null){if(!(p!=="submit"&&p!=="reset"||n!=null)){ko(t);return}s=s!=null?""+Ln(s):"",n=n!=null?""+Ln(n):s,k||n===t.value||(t.value=n),t.defaultValue=n}c=c??h,c=typeof c!="function"&&typeof c!="symbol"&&!!c,t.checked=k?t.checked:!!c,t.defaultChecked=!!c,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(t.name=w),ko(t)}function Do(t,n,s){n==="number"&&rr(t.ownerDocument)===t||t.defaultValue===""+s||(t.defaultValue=""+s)}function Mr(t,n,s,c){if(t=t.options,n){n={};for(var h=0;h<s.length;h++)n["$"+s[h]]=!0;for(s=0;s<t.length;s++)h=n.hasOwnProperty("$"+t[s].value),t[s].selected!==h&&(t[s].selected=h),h&&c&&(t[s].defaultSelected=!0)}else{for(s=""+Ln(s),n=null,h=0;h<t.length;h++){if(t[h].value===s){t[h].selected=!0,c&&(t[h].defaultSelected=!0);return}n!==null||t[h].disabled||(n=t[h])}n!==null&&(n.selected=!0)}}function Cc(t,n,s){if(n!=null&&(n=""+Ln(n),n!==t.value&&(t.value=n),s==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=s!=null?""+Ln(s):""}function Ec(t,n,s,c){if(n==null){if(c!=null){if(s!=null)throw Error(r(92));if(pt(c)){if(1<c.length)throw Error(r(93));c=c[0]}s=c}s==null&&(s=""),n=s}s=Ln(n),t.defaultValue=s,c=t.textContent,c===s&&c!==""&&c!==null&&(t.value=c),ko(t)}function $r(t,n){if(n){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=n;return}}t.textContent=n}var tf=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 os(t,n,s){var c=n.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?c?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":c?t.setProperty(n,s):typeof s!="number"||s===0||tf.has(n)?n==="float"?t.cssFloat=s:t[n]=(""+s).trim():t[n]=s+"px"}function Ba(t,n,s){if(n!=null&&typeof n!="object")throw Error(r(62));if(t=t.style,s!=null){for(var c in s)!s.hasOwnProperty(c)||n!=null&&n.hasOwnProperty(c)||(c.indexOf("--")===0?t.setProperty(c,""):c==="float"?t.cssFloat="":t[c]="");for(var h in n)c=n[h],n.hasOwnProperty(h)&&s[h]!==c&&os(t,h,c)}else for(var p in n)n.hasOwnProperty(p)&&os(t,p,n[p])}function Oo(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 nf=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"]]),af=/^[\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 ls(t){return af.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function aa(){}var Lo=null;function cs(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Nr=null,Hr=null;function _c(t){var n=Or(t);if(n&&(t=n.stateNode)){var s=t[cn]||null;e:switch(t=n.stateNode,n.type){case"input":if(ir(t,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),n=s.name,s.type==="radio"&&n!=null){for(s=t;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Mn(""+n)+'"][type="radio"]'),n=0;n<s.length;n++){var c=s[n];if(c!==t&&c.form===t.form){var h=c[cn]||null;if(!h)throw Error(r(90));ir(c,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(n=0;n<s.length;n++)c=s[n],c.form===t.form&&Ro(c)}break e;case"textarea":Cc(t,s.value,s.defaultValue);break e;case"select":n=s.value,n!=null&&Mr(t,!!s.multiple,n,!1)}}}var Mo=!1;function Ac(t,n,s){if(Mo)return t(n,s);Mo=!0;try{var c=t(n);return c}finally{if(Mo=!1,(Nr!==null||Hr!==null)&&(pu(),Nr&&(n=Nr,t=Hr,Hr=Nr=null,_c(n),t)))for(n=0;n<t.length;n++)_c(t[n])}}function vi(t,n){var s=t.stateNode;if(s===null)return null;var c=s[cn]||null;if(c===null)return null;s=c[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(t=t.type,c=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!c;break e;default:t=!1}if(t)return null;if(s&&typeof s!="function")throw Error(r(231,n,typeof s));return s}var Ta=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),$o=!1;if(Ta)try{var Si={};Object.defineProperty(Si,"passive",{get:function(){$o=!0}}),window.addEventListener("test",Si,Si),window.removeEventListener("test",Si,Si)}catch{$o=!1}var ka=null,No=null,us=null;function Ge(){if(us)return us;var t,n=No,s=n.length,c,h="value"in ka?ka.value:ka.textContent,p=h.length;for(t=0;t<s&&n[t]===h[t];t++);var w=s-t;for(c=1;c<=w&&n[s-c]===h[p-c];c++);return us=h.slice(t,1<c?1-c:void 0)}function zr(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function sr(){return!0}function xc(){return!1}function bn(t){function n(s,c,h,p,w){this._reactName=s,this._targetInst=h,this.type=c,this.nativeEvent=p,this.target=w,this.currentTarget=null;for(var k in t)t.hasOwnProperty(k)&&(s=t[k],this[k]=s?s(p):p[k]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?sr:xc,this.isPropagationStopped=xc,this}return b(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=sr)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=sr)},persist:function(){},isPersistent:sr}),n}var qa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ds=bn(qa),wi=b({},qa,{view:0,detail:0}),rf=bn(wi),Ho,zo,fs,hs=b({},wi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jo,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!==fs&&(fs&&t.type==="mousemove"?(Ho=t.screenX-fs.screenX,zo=t.screenY-fs.screenY):zo=Ho=0,fs=t),Ho)},movementY:function(t){return"movementY"in t?t.movementY:zo}}),Tc=bn(hs),Um=b({},hs,{dataTransfer:0}),sf=bn(Um),of=b({},wi,{relatedTarget:0}),Io=bn(of),lf=b({},qa,{animationName:0,elapsedTime:0,pseudoElement:0}),cf=bn(lf),uf=b({},qa,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),df=bn(uf),ff=b({},qa,{data:0}),kc=bn(ff),hf={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},gf={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"},pf={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function mf(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=pf[t])?!!n[t]:!1}function jo(){return mf}var yf=b({},wi,{key:function(t){if(t.key){var n=hf[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=zr(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?gf[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jo,charCode:function(t){return t.type==="keypress"?zr(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?zr(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),nn=bn(yf),Uo=b({},hs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Rc=bn(Uo),_=b({},wi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jo}),y=bn(_),C=b({},qa,{propertyName:0,elapsedTime:0,pseudoElement:0}),R=bn(C),H=b({},hs,{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}),ie=bn(H),be=b({},qa,{newState:0,oldState:0}),ke=bn(be),Ve=[9,13,27,32],at=Ta&&"CompositionEvent"in window,ot=null;Ta&&"documentMode"in document&&(ot=document.documentMode);var Ht=Ta&&"TextEvent"in window&&!ot,Ci=Ta&&(!at||ot&&8<ot&&11>=ot),Dc=" ",Bo=!1;function Oc(t,n){switch(t){case"keyup":return Ve.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qo(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ir=!1;function Lc(t,n){switch(t){case"compositionend":return qo(n);case"keypress":return n.which!==32?null:(Bo=!0,Dc);case"textInput":return t=n.data,t===Dc&&Bo?null:t;default:return null}}function bf(t,n){if(Ir)return t==="compositionend"||!at&&Oc(t,n)?(t=Ge(),us=No=ka=null,Ir=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Ci&&n.locale!=="ko"?null:n.data;default:return null}}var vf={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 Po(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!vf[t.type]:n==="textarea"}function Go(t,n,s,c){Nr?Hr?Hr.push(c):Hr=[c]:Nr=c,n=Cu(n,"onChange"),0<n.length&&(s=new ds("onChange","change",null,s,c),t.push({event:s,listeners:n}))}var jr=null,or=null;function Vo(t){vv(t,0)}function Ei(t){var n=yi(t);if(Ro(n))return t}function Mc(t,n){if(t==="change")return n}var $c=!1;if(Ta){var Fo;if(Ta){var Ko="oninput"in document;if(!Ko){var Wo=document.createElement("div");Wo.setAttribute("oninput","return;"),Ko=typeof Wo.oninput=="function"}Fo=Ko}else Fo=!1;$c=Fo&&(!document.documentMode||9<document.documentMode)}function Bm(){jr&&(jr.detachEvent("onpropertychange",qm),or=jr=null)}function qm(t){if(t.propertyName==="value"&&Ei(or)){var n=[];Go(n,or,t,cs(t)),Ac(Vo,n)}}function k_(t,n,s){t==="focusin"?(Bm(),jr=n,or=s,jr.attachEvent("onpropertychange",qm)):t==="focusout"&&Bm()}function R_(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Ei(or)}function D_(t,n){if(t==="click")return Ei(n)}function O_(t,n){if(t==="input"||t==="change")return Ei(n)}function L_(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var Fn=typeof Object.is=="function"?Object.is:L_;function Yo(t,n){if(Fn(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var s=Object.keys(t),c=Object.keys(n);if(s.length!==c.length)return!1;for(c=0;c<s.length;c++){var h=s[c];if(!qn.call(n,h)||!Fn(t[h],n[h]))return!1}return!0}function Pm(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Gm(t,n){var s=Pm(t);t=0;for(var c;s;){if(s.nodeType===3){if(c=t+s.textContent.length,t<=n&&c>=n)return{node:s,offset:n-t};t=c}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Pm(s)}}function Vm(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?Vm(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function Fm(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=rr(t.document);n instanceof t.HTMLIFrameElement;){try{var s=typeof n.contentWindow.location.href=="string"}catch{s=!1}if(s)t=n.contentWindow;else break;n=rr(t.document)}return n}function Sf(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var M_=Ta&&"documentMode"in document&&11>=document.documentMode,gs=null,wf=null,Xo=null,Cf=!1;function Km(t,n,s){var c=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Cf||gs==null||gs!==rr(c)||(c=gs,"selectionStart"in c&&Sf(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Xo&&Yo(Xo,c)||(Xo=c,c=Cu(wf,"onSelect"),0<c.length&&(n=new ds("onSelect","select",null,n,s),t.push({event:n,listeners:c}),n.target=gs)))}function _i(t,n){var s={};return s[t.toLowerCase()]=n.toLowerCase(),s["Webkit"+t]="webkit"+n,s["Moz"+t]="moz"+n,s}var ps={animationend:_i("Animation","AnimationEnd"),animationiteration:_i("Animation","AnimationIteration"),animationstart:_i("Animation","AnimationStart"),transitionrun:_i("Transition","TransitionRun"),transitionstart:_i("Transition","TransitionStart"),transitioncancel:_i("Transition","TransitionCancel"),transitionend:_i("Transition","TransitionEnd")},Ef={},Wm={};Ta&&(Wm=document.createElement("div").style,"AnimationEvent"in window||(delete ps.animationend.animation,delete ps.animationiteration.animation,delete ps.animationstart.animation),"TransitionEvent"in window||delete ps.transitionend.transition);function Ai(t){if(Ef[t])return Ef[t];if(!ps[t])return t;var n=ps[t],s;for(s in n)if(n.hasOwnProperty(s)&&s in Wm)return Ef[t]=n[s];return t}var Ym=Ai("animationend"),Xm=Ai("animationiteration"),Qm=Ai("animationstart"),$_=Ai("transitionrun"),N_=Ai("transitionstart"),H_=Ai("transitioncancel"),Jm=Ai("transitionend"),Zm=new Map,_f="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(" ");_f.push("scrollEnd");function Ra(t,n){Zm.set(t,n),ar(n,[t])}var Nc=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=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(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},ra=[],ms=0,Af=0;function Hc(){for(var t=ms,n=Af=ms=0;n<t;){var s=ra[n];ra[n++]=null;var c=ra[n];ra[n++]=null;var h=ra[n];ra[n++]=null;var p=ra[n];if(ra[n++]=null,c!==null&&h!==null){var w=c.pending;w===null?h.next=h:(h.next=w.next,w.next=h),c.pending=h}p!==0&&ey(s,h,p)}}function zc(t,n,s,c){ra[ms++]=t,ra[ms++]=n,ra[ms++]=s,ra[ms++]=c,Af|=c,t.lanes|=c,t=t.alternate,t!==null&&(t.lanes|=c)}function xf(t,n,s,c){return zc(t,n,s,c),Ic(t)}function xi(t,n){return zc(t,null,null,n),Ic(t)}function ey(t,n,s){t.lanes|=s;var c=t.alternate;c!==null&&(c.lanes|=s);for(var h=!1,p=t.return;p!==null;)p.childLanes|=s,c=p.alternate,c!==null&&(c.childLanes|=s),p.tag===22&&(t=p.stateNode,t===null||t._visibility&1||(h=!0)),t=p,p=p.return;return t.tag===3?(p=t.stateNode,h&&n!==null&&(h=31-q(s),t=p.hiddenUpdates,c=t[h],c===null?t[h]=[n]:c.push(n),n.lane=s|536870912),p):null}function Ic(t){if(50<bl)throw bl=0,Nh=null,Error(r(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var ys={};function z_(t,n,s,c){this.tag=t,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kn(t,n,s,c){return new z_(t,n,s,c)}function Tf(t){return t=t.prototype,!(!t||!t.isReactComponent)}function lr(t,n){var s=t.alternate;return s===null?(s=Kn(t.tag,n,t.key,t.mode),s.elementType=t.elementType,s.type=t.type,s.stateNode=t.stateNode,s.alternate=t,t.alternate=s):(s.pendingProps=n,s.type=t.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=t.flags&65011712,s.childLanes=t.childLanes,s.lanes=t.lanes,s.child=t.child,s.memoizedProps=t.memoizedProps,s.memoizedState=t.memoizedState,s.updateQueue=t.updateQueue,n=t.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},s.sibling=t.sibling,s.index=t.index,s.ref=t.ref,s.refCleanup=t.refCleanup,s}function ty(t,n){t.flags&=65011714;var s=t.alternate;return s===null?(t.childLanes=0,t.lanes=n,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=s.childLanes,t.lanes=s.lanes,t.child=s.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=s.memoizedProps,t.memoizedState=s.memoizedState,t.updateQueue=s.updateQueue,t.type=s.type,n=s.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t}function jc(t,n,s,c,h,p){var w=0;if(c=t,typeof t=="function")Tf(t)&&(w=1);else if(typeof t=="string")w=qA(t,s,fe.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case ge:return t=Kn(31,s,n,h),t.elementType=ge,t.lanes=p,t;case A:return Ti(s.children,h,p,n);case T:w=8,h|=24;break;case D:return t=Kn(12,s,n,h|2),t.elementType=D,t.lanes=p,t;case P:return t=Kn(13,s,n,h),t.elementType=P,t.lanes=p,t;case U:return t=Kn(19,s,n,h),t.elementType=U,t.lanes=p,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case O:w=10;break e;case M:w=9;break e;case L:w=11;break e;case B:w=14;break e;case Y:w=16,c=null;break e}w=29,s=Error(r(130,t===null?"null":typeof t,"")),c=null}return n=Kn(w,s,n,h),n.elementType=t,n.type=c,n.lanes=p,n}function Ti(t,n,s,c){return t=Kn(7,t,c,n),t.lanes=s,t}function kf(t,n,s){return t=Kn(6,t,null,n),t.lanes=s,t}function ny(t){var n=Kn(18,null,null,0);return n.stateNode=t,n}function Rf(t,n,s){return n=Kn(4,t.children!==null?t.children:[],t.key,n),n.lanes=s,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var ay=new WeakMap;function ia(t,n){if(typeof t=="object"&&t!==null){var s=ay.get(t);return s!==void 0?s:(n={value:t,source:n,stack:Sn(n)},ay.set(t,n),n)}return{value:t,source:n,stack:Sn(n)}}var bs=[],vs=0,Uc=null,Qo=0,sa=[],oa=0,Ur=null,Pa=1,Ga="";function cr(t,n){bs[vs++]=Qo,bs[vs++]=Uc,Uc=t,Qo=n}function ry(t,n,s){sa[oa++]=Pa,sa[oa++]=Ga,sa[oa++]=Ur,Ur=t;var c=Pa;t=Ga;var h=32-q(c)-1;c&=~(1<<h),s+=1;var p=32-q(n)+h;if(30<p){var w=h-h%5;p=(c&(1<<w)-1).toString(32),c>>=w,h-=w,Pa=1<<32-q(n)+h|s<<h|c,Ga=p+t}else Pa=1<<p|s<<h|c,Ga=t}function Df(t){t.return!==null&&(cr(t,1),ry(t,1,0))}function Of(t){for(;t===Uc;)Uc=bs[--vs],bs[vs]=null,Qo=bs[--vs],bs[vs]=null;for(;t===Ur;)Ur=sa[--oa],sa[oa]=null,Ga=sa[--oa],sa[oa]=null,Pa=sa[--oa],sa[oa]=null}function iy(t,n){sa[oa++]=Pa,sa[oa++]=Ga,sa[oa++]=Ur,Pa=n.id,Ga=n.overflow,Ur=t}var un=null,Rt=null,lt=!1,Br=null,la=!1,Lf=Error(r(519));function qr(t){var n=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Jo(ia(n,t)),Lf}function sy(t){var n=t.stateNode,s=t.type,c=t.memoizedProps;switch(n[tn]=t,n[cn]=c,s){case"dialog":tt("cancel",n),tt("close",n);break;case"iframe":case"object":case"embed":tt("load",n);break;case"video":case"audio":for(s=0;s<Sl.length;s++)tt(Sl[s],n);break;case"source":tt("error",n);break;case"img":case"image":case"link":tt("error",n),tt("load",n);break;case"details":tt("toggle",n);break;case"input":tt("invalid",n),wc(n,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":tt("invalid",n);break;case"textarea":tt("invalid",n),Ec(n,c.value,c.defaultValue,c.children)}s=c.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||n.textContent===""+s||c.suppressHydrationWarning===!0||Ev(n.textContent,s)?(c.popover!=null&&(tt("beforetoggle",n),tt("toggle",n)),c.onScroll!=null&&tt("scroll",n),c.onScrollEnd!=null&&tt("scrollend",n),c.onClick!=null&&(n.onclick=aa),n=!0):n=!1,n||qr(t,!0)}function oy(t){for(un=t.return;un;)switch(un.tag){case 5:case 31:case 13:la=!1;return;case 27:case 3:la=!0;return;default:un=un.return}}function Ss(t){if(t!==un)return!1;if(!lt)return oy(t),lt=!0,!1;var n=t.tag,s;if((s=n!==3&&n!==27)&&((s=n===5)&&(s=t.type,s=!(s!=="form"&&s!=="button")||Xh(t.type,t.memoizedProps)),s=!s),s&&Rt&&qr(t),oy(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));Rt=Lv(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));Rt=Lv(t)}else n===27?(n=Rt,ni(t.type)?(t=tg,tg=null,Rt=t):Rt=n):Rt=un?ua(t.stateNode.nextSibling):null;return!0}function ki(){Rt=un=null,lt=!1}function Mf(){var t=Br;return t!==null&&(zn===null?zn=t:zn.push.apply(zn,t),Br=null),t}function Jo(t){Br===null?Br=[t]:Br.push(t)}var $f=x(null),Ri=null,ur=null;function Pr(t,n,s){ue($f,n._currentValue),n._currentValue=s}function dr(t){t._currentValue=$f.current,F($f)}function Nf(t,n,s){for(;t!==null;){var c=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,c!==null&&(c.childLanes|=n)):c!==null&&(c.childLanes&n)!==n&&(c.childLanes|=n),t===s)break;t=t.return}}function Hf(t,n,s,c){var h=t.child;for(h!==null&&(h.return=t);h!==null;){var p=h.dependencies;if(p!==null){var w=h.child;p=p.firstContext;e:for(;p!==null;){var k=p;p=h;for(var I=0;I<n.length;I++)if(k.context===n[I]){p.lanes|=s,k=p.alternate,k!==null&&(k.lanes|=s),Nf(p.return,s,t),c||(w=null);break e}p=k.next}}else if(h.tag===18){if(w=h.return,w===null)throw Error(r(341));w.lanes|=s,p=w.alternate,p!==null&&(p.lanes|=s),Nf(w,s,t),w=null}else w=h.child;if(w!==null)w.return=h;else for(w=h;w!==null;){if(w===t){w=null;break}if(h=w.sibling,h!==null){h.return=w.return,w=h;break}w=w.return}h=w}}function ws(t,n,s,c){t=null;for(var h=n,p=!1;h!==null;){if(!p){if((h.flags&524288)!==0)p=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var w=h.alternate;if(w===null)throw Error(r(387));if(w=w.memoizedProps,w!==null){var k=h.type;Fn(h.pendingProps.value,w.value)||(t!==null?t.push(k):t=[k])}}else if(h===je.current){if(w=h.alternate,w===null)throw Error(r(387));w.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(t!==null?t.push(Al):t=[Al])}h=h.return}t!==null&&Hf(n,t,s,c),n.flags|=262144}function Bc(t){for(t=t.firstContext;t!==null;){if(!Fn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Di(t){Ri=t,ur=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function dn(t){return ly(Ri,t)}function qc(t,n){return Ri===null&&Di(t),ly(t,n)}function ly(t,n){var s=n._currentValue;if(n={context:n,memoizedValue:s,next:null},ur===null){if(t===null)throw Error(r(308));ur=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else ur=ur.next=n;return s}var I_=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(s,c){t.push(c)}};this.abort=function(){n.aborted=!0,t.forEach(function(s){return s()})}},j_=l.unstable_scheduleCallback,U_=l.unstable_NormalPriority,Wt={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function zf(){return{controller:new I_,data:new Map,refCount:0}}function Zo(t){t.refCount--,t.refCount===0&&j_(U_,function(){t.controller.abort()})}var el=null,If=0,Cs=0,Es=null;function B_(t,n){if(el===null){var s=el=[];If=0,Cs=Bh(),Es={status:"pending",value:void 0,then:function(c){s.push(c)}}}return If++,n.then(cy,cy),n}function cy(){if(--If===0&&el!==null){Es!==null&&(Es.status="fulfilled");var t=el;el=null,Cs=0,Es=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function q_(t,n){var s=[],c={status:"pending",value:null,reason:null,then:function(h){s.push(h)}};return t.then(function(){c.status="fulfilled",c.value=n;for(var h=0;h<s.length;h++)(0,s[h])(n)},function(h){for(c.status="rejected",c.reason=h,h=0;h<s.length;h++)(0,s[h])(void 0)}),c}var uy=J.S;J.S=function(t,n){Kb=Vt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&B_(t,n),uy!==null&&uy(t,n)};var Oi=x(null);function jf(){var t=Oi.current;return t!==null?t:xt.pooledCache}function Pc(t,n){n===null?ue(Oi,Oi.current):ue(Oi,n.pool)}function dy(){var t=jf();return t===null?null:{parent:Wt._currentValue,pool:t}}var _s=Error(r(460)),Uf=Error(r(474)),Gc=Error(r(542)),Vc={then:function(){}};function fy(t){return t=t.status,t==="fulfilled"||t==="rejected"}function hy(t,n,s){switch(s=t[s],s===void 0?t.push(n):s!==n&&(n.then(aa,aa),n=s),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,py(t),t;default:if(typeof n.status=="string")n.then(aa,aa);else{if(t=xt,t!==null&&100<t.shellSuspendCounter)throw Error(r(482));t=n,t.status="pending",t.then(function(c){if(n.status==="pending"){var h=n;h.status="fulfilled",h.value=c}},function(c){if(n.status==="pending"){var h=n;h.status="rejected",h.reason=c}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,py(t),t}throw Mi=n,_s}}function Li(t){try{var n=t._init;return n(t._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Mi=s,_s):s}}var Mi=null;function gy(){if(Mi===null)throw Error(r(459));var t=Mi;return Mi=null,t}function py(t){if(t===_s||t===Gc)throw Error(r(483))}var As=null,tl=0;function Fc(t){var n=tl;return tl+=1,As===null&&(As=[]),hy(As,t,n)}function nl(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function Kc(t,n){throw n.$$typeof===v?Error(r(525)):(t=Object.prototype.toString.call(n),Error(r(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function my(t){function n(V,G){if(t){var K=V.deletions;K===null?(V.deletions=[G],V.flags|=16):K.push(G)}}function s(V,G){if(!t)return null;for(;G!==null;)n(V,G),G=G.sibling;return null}function c(V){for(var G=new Map;V!==null;)V.key!==null?G.set(V.key,V):G.set(V.index,V),V=V.sibling;return G}function h(V,G){return V=lr(V,G),V.index=0,V.sibling=null,V}function p(V,G,K){return V.index=K,t?(K=V.alternate,K!==null?(K=K.index,K<G?(V.flags|=67108866,G):K):(V.flags|=67108866,G)):(V.flags|=1048576,G)}function w(V){return t&&V.alternate===null&&(V.flags|=67108866),V}function k(V,G,K,se){return G===null||G.tag!==6?(G=kf(K,V.mode,se),G.return=V,G):(G=h(G,K),G.return=V,G)}function I(V,G,K,se){var ze=K.type;return ze===A?ae(V,G,K.props.children,se,K.key):G!==null&&(G.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===Y&&Li(ze)===G.type)?(G=h(G,K.props),nl(G,K),G.return=V,G):(G=jc(K.type,K.key,K.props,null,V.mode,se),nl(G,K),G.return=V,G)}function W(V,G,K,se){return G===null||G.tag!==4||G.stateNode.containerInfo!==K.containerInfo||G.stateNode.implementation!==K.implementation?(G=Rf(K,V.mode,se),G.return=V,G):(G=h(G,K.children||[]),G.return=V,G)}function ae(V,G,K,se,ze){return G===null||G.tag!==7?(G=Ti(K,V.mode,se,ze),G.return=V,G):(G=h(G,K),G.return=V,G)}function ce(V,G,K){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return G=kf(""+G,V.mode,K),G.return=V,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case E:return K=jc(G.type,G.key,G.props,null,V.mode,K),nl(K,G),K.return=V,K;case S:return G=Rf(G,V.mode,K),G.return=V,G;case Y:return G=Li(G),ce(V,G,K)}if(pt(G)||Ne(G))return G=Ti(G,V.mode,K,null),G.return=V,G;if(typeof G.then=="function")return ce(V,Fc(G),K);if(G.$$typeof===O)return ce(V,qc(V,G),K);Kc(V,G)}return null}function X(V,G,K,se){var ze=G!==null?G.key:null;if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return ze!==null?null:k(V,G,""+K,se);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case E:return K.key===ze?I(V,G,K,se):null;case S:return K.key===ze?W(V,G,K,se):null;case Y:return K=Li(K),X(V,G,K,se)}if(pt(K)||Ne(K))return ze!==null?null:ae(V,G,K,se,null);if(typeof K.then=="function")return X(V,G,Fc(K),se);if(K.$$typeof===O)return X(V,G,qc(V,K),se);Kc(V,K)}return null}function ee(V,G,K,se,ze){if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return V=V.get(K)||null,k(G,V,""+se,ze);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case E:return V=V.get(se.key===null?K:se.key)||null,I(G,V,se,ze);case S:return V=V.get(se.key===null?K:se.key)||null,W(G,V,se,ze);case Y:return se=Li(se),ee(V,G,K,se,ze)}if(pt(se)||Ne(se))return V=V.get(K)||null,ae(G,V,se,ze,null);if(typeof se.then=="function")return ee(V,G,K,Fc(se),ze);if(se.$$typeof===O)return ee(V,G,K,qc(G,se),ze);Kc(G,se)}return null}function Te(V,G,K,se){for(var ze=null,ft=null,De=G,Qe=G=0,it=null;De!==null&&Qe<K.length;Qe++){De.index>Qe?(it=De,De=null):it=De.sibling;var ht=X(V,De,K[Qe],se);if(ht===null){De===null&&(De=it);break}t&&De&&ht.alternate===null&&n(V,De),G=p(ht,G,Qe),ft===null?ze=ht:ft.sibling=ht,ft=ht,De=it}if(Qe===K.length)return s(V,De),lt&&cr(V,Qe),ze;if(De===null){for(;Qe<K.length;Qe++)De=ce(V,K[Qe],se),De!==null&&(G=p(De,G,Qe),ft===null?ze=De:ft.sibling=De,ft=De);return lt&&cr(V,Qe),ze}for(De=c(De);Qe<K.length;Qe++)it=ee(De,V,Qe,K[Qe],se),it!==null&&(t&&it.alternate!==null&&De.delete(it.key===null?Qe:it.key),G=p(it,G,Qe),ft===null?ze=it:ft.sibling=it,ft=it);return t&&De.forEach(function(oi){return n(V,oi)}),lt&&cr(V,Qe),ze}function Ue(V,G,K,se){if(K==null)throw Error(r(151));for(var ze=null,ft=null,De=G,Qe=G=0,it=null,ht=K.next();De!==null&&!ht.done;Qe++,ht=K.next()){De.index>Qe?(it=De,De=null):it=De.sibling;var oi=X(V,De,ht.value,se);if(oi===null){De===null&&(De=it);break}t&&De&&oi.alternate===null&&n(V,De),G=p(oi,G,Qe),ft===null?ze=oi:ft.sibling=oi,ft=oi,De=it}if(ht.done)return s(V,De),lt&&cr(V,Qe),ze;if(De===null){for(;!ht.done;Qe++,ht=K.next())ht=ce(V,ht.value,se),ht!==null&&(G=p(ht,G,Qe),ft===null?ze=ht:ft.sibling=ht,ft=ht);return lt&&cr(V,Qe),ze}for(De=c(De);!ht.done;Qe++,ht=K.next())ht=ee(De,V,Qe,ht.value,se),ht!==null&&(t&&ht.alternate!==null&&De.delete(ht.key===null?Qe:ht.key),G=p(ht,G,Qe),ft===null?ze=ht:ft.sibling=ht,ft=ht);return t&&De.forEach(function(ZA){return n(V,ZA)}),lt&&cr(V,Qe),ze}function _t(V,G,K,se){if(typeof K=="object"&&K!==null&&K.type===A&&K.key===null&&(K=K.props.children),typeof K=="object"&&K!==null){switch(K.$$typeof){case E:e:{for(var ze=K.key;G!==null;){if(G.key===ze){if(ze=K.type,ze===A){if(G.tag===7){s(V,G.sibling),se=h(G,K.props.children),se.return=V,V=se;break e}}else if(G.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===Y&&Li(ze)===G.type){s(V,G.sibling),se=h(G,K.props),nl(se,K),se.return=V,V=se;break e}s(V,G);break}else n(V,G);G=G.sibling}K.type===A?(se=Ti(K.props.children,V.mode,se,K.key),se.return=V,V=se):(se=jc(K.type,K.key,K.props,null,V.mode,se),nl(se,K),se.return=V,V=se)}return w(V);case S:e:{for(ze=K.key;G!==null;){if(G.key===ze)if(G.tag===4&&G.stateNode.containerInfo===K.containerInfo&&G.stateNode.implementation===K.implementation){s(V,G.sibling),se=h(G,K.children||[]),se.return=V,V=se;break e}else{s(V,G);break}else n(V,G);G=G.sibling}se=Rf(K,V.mode,se),se.return=V,V=se}return w(V);case Y:return K=Li(K),_t(V,G,K,se)}if(pt(K))return Te(V,G,K,se);if(Ne(K)){if(ze=Ne(K),typeof ze!="function")throw Error(r(150));return K=ze.call(K),Ue(V,G,K,se)}if(typeof K.then=="function")return _t(V,G,Fc(K),se);if(K.$$typeof===O)return _t(V,G,qc(V,K),se);Kc(V,K)}return typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint"?(K=""+K,G!==null&&G.tag===6?(s(V,G.sibling),se=h(G,K),se.return=V,V=se):(s(V,G),se=kf(K,V.mode,se),se.return=V,V=se),w(V)):s(V,G)}return function(V,G,K,se){try{tl=0;var ze=_t(V,G,K,se);return As=null,ze}catch(De){if(De===_s||De===Gc)throw De;var ft=Kn(29,De,null,V.mode);return ft.lanes=se,ft.return=V,ft}finally{}}}var $i=my(!0),yy=my(!1),Gr=!1;function Bf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function qf(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Vr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Fr(t,n,s){var c=t.updateQueue;if(c===null)return null;if(c=c.shared,(mt&2)!==0){var h=c.pending;return h===null?n.next=n:(n.next=h.next,h.next=n),c.pending=n,n=Ic(t),ey(t,null,s),n}return zc(t,c,n,s),Ic(t)}function al(t,n,s){if(n=n.updateQueue,n!==null&&(n=n.shared,(s&4194048)!==0)){var c=n.lanes;c&=t.pendingLanes,s|=c,n.lanes=s,Le(t,s)}}function Pf(t,n){var s=t.updateQueue,c=t.alternate;if(c!==null&&(c=c.updateQueue,s===c)){var h=null,p=null;if(s=s.firstBaseUpdate,s!==null){do{var w={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};p===null?h=p=w:p=p.next=w,s=s.next}while(s!==null);p===null?h=p=n:p=p.next=n}else h=p=n;s={baseState:c.baseState,firstBaseUpdate:h,lastBaseUpdate:p,shared:c.shared,callbacks:c.callbacks},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=n:t.next=n,s.lastBaseUpdate=n}var Gf=!1;function rl(){if(Gf){var t=Es;if(t!==null)throw t}}function il(t,n,s,c){Gf=!1;var h=t.updateQueue;Gr=!1;var p=h.firstBaseUpdate,w=h.lastBaseUpdate,k=h.shared.pending;if(k!==null){h.shared.pending=null;var I=k,W=I.next;I.next=null,w===null?p=W:w.next=W,w=I;var ae=t.alternate;ae!==null&&(ae=ae.updateQueue,k=ae.lastBaseUpdate,k!==w&&(k===null?ae.firstBaseUpdate=W:k.next=W,ae.lastBaseUpdate=I))}if(p!==null){var ce=h.baseState;w=0,ae=W=I=null,k=p;do{var X=k.lane&-536870913,ee=X!==k.lane;if(ee?(rt&X)===X:(c&X)===X){X!==0&&X===Cs&&(Gf=!0),ae!==null&&(ae=ae.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var Te=t,Ue=k;X=n;var _t=s;switch(Ue.tag){case 1:if(Te=Ue.payload,typeof Te=="function"){ce=Te.call(_t,ce,X);break e}ce=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=Ue.payload,X=typeof Te=="function"?Te.call(_t,ce,X):Te,X==null)break e;ce=b({},ce,X);break e;case 2:Gr=!0}}X=k.callback,X!==null&&(t.flags|=64,ee&&(t.flags|=8192),ee=h.callbacks,ee===null?h.callbacks=[X]:ee.push(X))}else ee={lane:X,tag:k.tag,payload:k.payload,callback:k.callback,next:null},ae===null?(W=ae=ee,I=ce):ae=ae.next=ee,w|=X;if(k=k.next,k===null){if(k=h.shared.pending,k===null)break;ee=k,k=ee.next,ee.next=null,h.lastBaseUpdate=ee,h.shared.pending=null}}while(!0);ae===null&&(I=ce),h.baseState=I,h.firstBaseUpdate=W,h.lastBaseUpdate=ae,p===null&&(h.shared.lanes=0),Qr|=w,t.lanes=w,t.memoizedState=ce}}function by(t,n){if(typeof t!="function")throw Error(r(191,t));t.call(n)}function vy(t,n){var s=t.callbacks;if(s!==null)for(t.callbacks=null,t=0;t<s.length;t++)by(s[t],n)}var xs=x(null),Wc=x(0);function Sy(t,n){t=Sr,ue(Wc,t),ue(xs,n),Sr=t|n.baseLanes}function Vf(){ue(Wc,Sr),ue(xs,xs.current)}function Ff(){Sr=Wc.current,F(xs),F(Wc)}var Wn=x(null),ca=null;function Kr(t){var n=t.alternate;ue(qt,qt.current&1),ue(Wn,t),ca===null&&(n===null||xs.current!==null||n.memoizedState!==null)&&(ca=t)}function Kf(t){ue(qt,qt.current),ue(Wn,t),ca===null&&(ca=t)}function wy(t){t.tag===22?(ue(qt,qt.current),ue(Wn,t),ca===null&&(ca=t)):Wr()}function Wr(){ue(qt,qt.current),ue(Wn,Wn.current)}function Yn(t){F(Wn),ca===t&&(ca=null),F(qt)}var qt=x(0);function Yc(t){for(var n=t;n!==null;){if(n.tag===13){var s=n.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Zh(s)||eg(s)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var fr=0,Xe=null,Ct=null,Yt=null,Xc=!1,Ts=!1,Ni=!1,Qc=0,sl=0,ks=null,P_=0;function zt(){throw Error(r(321))}function Wf(t,n){if(n===null)return!1;for(var s=0;s<n.length&&s<t.length;s++)if(!Fn(t[s],n[s]))return!1;return!0}function Yf(t,n,s,c,h,p){return fr=p,Xe=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,J.H=t===null||t.memoizedState===null?rb:uh,Ni=!1,p=s(c,h),Ni=!1,Ts&&(p=Ey(n,s,c,h)),Cy(t),p}function Cy(t){J.H=cl;var n=Ct!==null&&Ct.next!==null;if(fr=0,Yt=Ct=Xe=null,Xc=!1,sl=0,ks=null,n)throw Error(r(300));t===null||Xt||(t=t.dependencies,t!==null&&Bc(t)&&(Xt=!0))}function Ey(t,n,s,c){Xe=t;var h=0;do{if(Ts&&(ks=null),sl=0,Ts=!1,25<=h)throw Error(r(301));if(h+=1,Yt=Ct=null,t.updateQueue!=null){var p=t.updateQueue;p.lastEffect=null,p.events=null,p.stores=null,p.memoCache!=null&&(p.memoCache.index=0)}J.H=ib,p=n(s,c)}while(Ts);return p}function G_(){var t=J.H,n=t.useState()[0];return n=typeof n.then=="function"?ol(n):n,t=t.useState()[0],(Ct!==null?Ct.memoizedState:null)!==t&&(Xe.flags|=1024),n}function Xf(){var t=Qc!==0;return Qc=0,t}function Qf(t,n,s){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~s}function Jf(t){if(Xc){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}Xc=!1}fr=0,Yt=Ct=Xe=null,Ts=!1,sl=Qc=0,ks=null}function En(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Yt===null?Xe.memoizedState=Yt=t:Yt=Yt.next=t,Yt}function Pt(){if(Ct===null){var t=Xe.alternate;t=t!==null?t.memoizedState:null}else t=Ct.next;var n=Yt===null?Xe.memoizedState:Yt.next;if(n!==null)Yt=n,Ct=t;else{if(t===null)throw Xe.alternate===null?Error(r(467)):Error(r(310));Ct=t,t={memoizedState:Ct.memoizedState,baseState:Ct.baseState,baseQueue:Ct.baseQueue,queue:Ct.queue,next:null},Yt===null?Xe.memoizedState=Yt=t:Yt=Yt.next=t}return Yt}function Jc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ol(t){var n=sl;return sl+=1,ks===null&&(ks=[]),t=hy(ks,t,n),n=Xe,(Yt===null?n.memoizedState:Yt.next)===null&&(n=n.alternate,J.H=n===null||n.memoizedState===null?rb:uh),t}function Zc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return ol(t);if(t.$$typeof===O)return dn(t)}throw Error(r(438,String(t)))}function Zf(t){var n=null,s=Xe.updateQueue;if(s!==null&&(n=s.memoCache),n==null){var c=Xe.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(n={data:c.data.map(function(h){return h.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),s===null&&(s=Jc(),Xe.updateQueue=s),s.memoCache=n,s=n.data[n.index],s===void 0)for(s=n.data[n.index]=Array(t),c=0;c<t;c++)s[c]=Ae;return n.index++,s}function hr(t,n){return typeof n=="function"?n(t):n}function eu(t){var n=Pt();return eh(n,Ct,t)}function eh(t,n,s){var c=t.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=s;var h=t.baseQueue,p=c.pending;if(p!==null){if(h!==null){var w=h.next;h.next=p.next,p.next=w}n.baseQueue=h=p,c.pending=null}if(p=t.baseState,h===null)t.memoizedState=p;else{n=h.next;var k=w=null,I=null,W=n,ae=!1;do{var ce=W.lane&-536870913;if(ce!==W.lane?(rt&ce)===ce:(fr&ce)===ce){var X=W.revertLane;if(X===0)I!==null&&(I=I.next={lane:0,revertLane:0,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null}),ce===Cs&&(ae=!0);else if((fr&X)===X){W=W.next,X===Cs&&(ae=!0);continue}else ce={lane:0,revertLane:W.revertLane,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},I===null?(k=I=ce,w=p):I=I.next=ce,Xe.lanes|=X,Qr|=X;ce=W.action,Ni&&s(p,ce),p=W.hasEagerState?W.eagerState:s(p,ce)}else X={lane:ce,revertLane:W.revertLane,gesture:W.gesture,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},I===null?(k=I=X,w=p):I=I.next=X,Xe.lanes|=ce,Qr|=ce;W=W.next}while(W!==null&&W!==n);if(I===null?w=p:I.next=k,!Fn(p,t.memoizedState)&&(Xt=!0,ae&&(s=Es,s!==null)))throw s;t.memoizedState=p,t.baseState=w,t.baseQueue=I,c.lastRenderedState=p}return h===null&&(c.lanes=0),[t.memoizedState,c.dispatch]}function th(t){var n=Pt(),s=n.queue;if(s===null)throw Error(r(311));s.lastRenderedReducer=t;var c=s.dispatch,h=s.pending,p=n.memoizedState;if(h!==null){s.pending=null;var w=h=h.next;do p=t(p,w.action),w=w.next;while(w!==h);Fn(p,n.memoizedState)||(Xt=!0),n.memoizedState=p,n.baseQueue===null&&(n.baseState=p),s.lastRenderedState=p}return[p,c]}function _y(t,n,s){var c=Xe,h=Pt(),p=lt;if(p){if(s===void 0)throw Error(r(407));s=s()}else s=n();var w=!Fn((Ct||h).memoizedState,s);if(w&&(h.memoizedState=s,Xt=!0),h=h.queue,rh(Ty.bind(null,c,h,t),[t]),h.getSnapshot!==n||w||Yt!==null&&Yt.memoizedState.tag&1){if(c.flags|=2048,Rs(9,{destroy:void 0},xy.bind(null,c,h,s,n),null),xt===null)throw Error(r(349));p||(fr&127)!==0||Ay(c,n,s)}return s}function Ay(t,n,s){t.flags|=16384,t={getSnapshot:n,value:s},n=Xe.updateQueue,n===null?(n=Jc(),Xe.updateQueue=n,n.stores=[t]):(s=n.stores,s===null?n.stores=[t]:s.push(t))}function xy(t,n,s,c){n.value=s,n.getSnapshot=c,ky(n)&&Ry(t)}function Ty(t,n,s){return s(function(){ky(n)&&Ry(t)})}function ky(t){var n=t.getSnapshot;t=t.value;try{var s=n();return!Fn(t,s)}catch{return!0}}function Ry(t){var n=xi(t,2);n!==null&&In(n,t,2)}function nh(t){var n=En();if(typeof t=="function"){var s=t;if(t=s(),Ni){Cn(!0);try{s()}finally{Cn(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hr,lastRenderedState:t},n}function Dy(t,n,s,c){return t.baseState=s,eh(t,Ct,typeof c=="function"?c:hr)}function V_(t,n,s,c,h){if(au(t))throw Error(r(485));if(t=n.action,t!==null){var p={payload:h,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){p.listeners.push(w)}};J.T!==null?s(!0):p.isTransition=!1,c(p),s=n.pending,s===null?(p.next=n.pending=p,Oy(n,p)):(p.next=s.next,n.pending=s.next=p)}}function Oy(t,n){var s=n.action,c=n.payload,h=t.state;if(n.isTransition){var p=J.T,w={};J.T=w;try{var k=s(h,c),I=J.S;I!==null&&I(w,k),Ly(t,n,k)}catch(W){ah(t,n,W)}finally{p!==null&&w.types!==null&&(p.types=w.types),J.T=p}}else try{p=s(h,c),Ly(t,n,p)}catch(W){ah(t,n,W)}}function Ly(t,n,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(c){My(t,n,c)},function(c){return ah(t,n,c)}):My(t,n,s)}function My(t,n,s){n.status="fulfilled",n.value=s,$y(n),t.state=s,n=t.pending,n!==null&&(s=n.next,s===n?t.pending=null:(s=s.next,n.next=s,Oy(t,s)))}function ah(t,n,s){var c=t.pending;if(t.pending=null,c!==null){c=c.next;do n.status="rejected",n.reason=s,$y(n),n=n.next;while(n!==c)}t.action=null}function $y(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function Ny(t,n){return n}function Hy(t,n){if(lt){var s=xt.formState;if(s!==null){e:{var c=Xe;if(lt){if(Rt){t:{for(var h=Rt,p=la;h.nodeType!==8;){if(!p){h=null;break t}if(h=ua(h.nextSibling),h===null){h=null;break t}}p=h.data,h=p==="F!"||p==="F"?h:null}if(h){Rt=ua(h.nextSibling),c=h.data==="F!";break e}}qr(c)}c=!1}c&&(n=s[0])}}return s=En(),s.memoizedState=s.baseState=n,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ny,lastRenderedState:n},s.queue=c,s=tb.bind(null,Xe,c),c.dispatch=s,c=nh(!1),p=ch.bind(null,Xe,!1,c.queue),c=En(),h={state:n,dispatch:null,action:t,pending:null},c.queue=h,s=V_.bind(null,Xe,h,p,s),h.dispatch=s,c.memoizedState=t,[n,s,!1]}function zy(t){var n=Pt();return Iy(n,Ct,t)}function Iy(t,n,s){if(n=eh(t,n,Ny)[0],t=eu(hr)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var c=ol(n)}catch(w){throw w===_s?Gc:w}else c=n;n=Pt();var h=n.queue,p=h.dispatch;return s!==n.memoizedState&&(Xe.flags|=2048,Rs(9,{destroy:void 0},F_.bind(null,h,s),null)),[c,p,t]}function F_(t,n){t.action=n}function jy(t){var n=Pt(),s=Ct;if(s!==null)return Iy(n,s,t);Pt(),n=n.memoizedState,s=Pt();var c=s.queue.dispatch;return s.memoizedState=t,[n,c,!1]}function Rs(t,n,s,c){return t={tag:t,create:s,deps:c,inst:n,next:null},n=Xe.updateQueue,n===null&&(n=Jc(),Xe.updateQueue=n),s=n.lastEffect,s===null?n.lastEffect=t.next=t:(c=s.next,s.next=t,t.next=c,n.lastEffect=t),t}function Uy(){return Pt().memoizedState}function tu(t,n,s,c){var h=En();Xe.flags|=t,h.memoizedState=Rs(1|n,{destroy:void 0},s,c===void 0?null:c)}function nu(t,n,s,c){var h=Pt();c=c===void 0?null:c;var p=h.memoizedState.inst;Ct!==null&&c!==null&&Wf(c,Ct.memoizedState.deps)?h.memoizedState=Rs(n,p,s,c):(Xe.flags|=t,h.memoizedState=Rs(1|n,p,s,c))}function By(t,n){tu(8390656,8,t,n)}function rh(t,n){nu(2048,8,t,n)}function K_(t){Xe.flags|=4;var n=Xe.updateQueue;if(n===null)n=Jc(),Xe.updateQueue=n,n.events=[t];else{var s=n.events;s===null?n.events=[t]:s.push(t)}}function qy(t){var n=Pt().memoizedState;return K_({ref:n,nextImpl:t}),function(){if((mt&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}function Py(t,n){return nu(4,2,t,n)}function Gy(t,n){return nu(4,4,t,n)}function Vy(t,n){if(typeof n=="function"){t=t();var s=n(t);return function(){typeof s=="function"?s():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function Fy(t,n,s){s=s!=null?s.concat([t]):null,nu(4,4,Vy.bind(null,n,t),s)}function ih(){}function Ky(t,n){var s=Pt();n=n===void 0?null:n;var c=s.memoizedState;return n!==null&&Wf(n,c[1])?c[0]:(s.memoizedState=[t,n],t)}function Wy(t,n){var s=Pt();n=n===void 0?null:n;var c=s.memoizedState;if(n!==null&&Wf(n,c[1]))return c[0];if(c=t(),Ni){Cn(!0);try{t()}finally{Cn(!1)}}return s.memoizedState=[c,n],c}function sh(t,n,s){return s===void 0||(fr&1073741824)!==0&&(rt&261930)===0?t.memoizedState=n:(t.memoizedState=s,t=Yb(),Xe.lanes|=t,Qr|=t,s)}function Yy(t,n,s,c){return Fn(s,n)?s:xs.current!==null?(t=sh(t,s,c),Fn(t,n)||(Xt=!0),t):(fr&42)===0||(fr&1073741824)!==0&&(rt&261930)===0?(Xt=!0,t.memoizedState=s):(t=Yb(),Xe.lanes|=t,Qr|=t,n)}function Xy(t,n,s,c,h){var p=de.p;de.p=p!==0&&8>p?p:8;var w=J.T,k={};J.T=k,ch(t,!1,n,s);try{var I=h(),W=J.S;if(W!==null&&W(k,I),I!==null&&typeof I=="object"&&typeof I.then=="function"){var ae=q_(I,c);ll(t,n,ae,Jn(t))}else ll(t,n,c,Jn(t))}catch(ce){ll(t,n,{then:function(){},status:"rejected",reason:ce},Jn())}finally{de.p=p,w!==null&&k.types!==null&&(w.types=k.types),J.T=w}}function W_(){}function oh(t,n,s,c){if(t.tag!==5)throw Error(r(476));var h=Qy(t).queue;Xy(t,h,n,me,s===null?W_:function(){return Jy(t),s(c)})}function Qy(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:me,baseState:me,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hr,lastRenderedState:me},next:null};var s={};return n.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hr,lastRenderedState:s},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function Jy(t){var n=Qy(t);n.next===null&&(n=t.alternate.memoizedState),ll(t,n.next.queue,{},Jn())}function lh(){return dn(Al)}function Zy(){return Pt().memoizedState}function eb(){return Pt().memoizedState}function Y_(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var s=Jn();t=Vr(s);var c=Fr(n,t,s);c!==null&&(In(c,n,s),al(c,n,s)),n={cache:zf()},t.payload=n;return}n=n.return}}function X_(t,n,s){var c=Jn();s={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},au(t)?nb(n,s):(s=xf(t,n,s,c),s!==null&&(In(s,t,c),ab(s,n,c)))}function tb(t,n,s){var c=Jn();ll(t,n,s,c)}function ll(t,n,s,c){var h={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(au(t))nb(n,h);else{var p=t.alternate;if(t.lanes===0&&(p===null||p.lanes===0)&&(p=n.lastRenderedReducer,p!==null))try{var w=n.lastRenderedState,k=p(w,s);if(h.hasEagerState=!0,h.eagerState=k,Fn(k,w))return zc(t,n,h,0),xt===null&&Hc(),!1}catch{}finally{}if(s=xf(t,n,h,c),s!==null)return In(s,t,c),ab(s,n,c),!0}return!1}function ch(t,n,s,c){if(c={lane:2,revertLane:Bh(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},au(t)){if(n)throw Error(r(479))}else n=xf(t,s,c,2),n!==null&&In(n,t,2)}function au(t){var n=t.alternate;return t===Xe||n!==null&&n===Xe}function nb(t,n){Ts=Xc=!0;var s=t.pending;s===null?n.next=n:(n.next=s.next,s.next=n),t.pending=n}function ab(t,n,s){if((s&4194048)!==0){var c=n.lanes;c&=t.pendingLanes,s|=c,n.lanes=s,Le(t,s)}}var cl={readContext:dn,use:Zc,useCallback:zt,useContext:zt,useEffect:zt,useImperativeHandle:zt,useLayoutEffect:zt,useInsertionEffect:zt,useMemo:zt,useReducer:zt,useRef:zt,useState:zt,useDebugValue:zt,useDeferredValue:zt,useTransition:zt,useSyncExternalStore:zt,useId:zt,useHostTransitionStatus:zt,useFormState:zt,useActionState:zt,useOptimistic:zt,useMemoCache:zt,useCacheRefresh:zt};cl.useEffectEvent=zt;var rb={readContext:dn,use:Zc,useCallback:function(t,n){return En().memoizedState=[t,n===void 0?null:n],t},useContext:dn,useEffect:By,useImperativeHandle:function(t,n,s){s=s!=null?s.concat([t]):null,tu(4194308,4,Vy.bind(null,n,t),s)},useLayoutEffect:function(t,n){return tu(4194308,4,t,n)},useInsertionEffect:function(t,n){tu(4,2,t,n)},useMemo:function(t,n){var s=En();n=n===void 0?null:n;var c=t();if(Ni){Cn(!0);try{t()}finally{Cn(!1)}}return s.memoizedState=[c,n],c},useReducer:function(t,n,s){var c=En();if(s!==void 0){var h=s(n);if(Ni){Cn(!0);try{s(n)}finally{Cn(!1)}}}else h=n;return c.memoizedState=c.baseState=h,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:h},c.queue=t,t=t.dispatch=X_.bind(null,Xe,t),[c.memoizedState,t]},useRef:function(t){var n=En();return t={current:t},n.memoizedState=t},useState:function(t){t=nh(t);var n=t.queue,s=tb.bind(null,Xe,n);return n.dispatch=s,[t.memoizedState,s]},useDebugValue:ih,useDeferredValue:function(t,n){var s=En();return sh(s,t,n)},useTransition:function(){var t=nh(!1);return t=Xy.bind(null,Xe,t.queue,!0,!1),En().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,s){var c=Xe,h=En();if(lt){if(s===void 0)throw Error(r(407));s=s()}else{if(s=n(),xt===null)throw Error(r(349));(rt&127)!==0||Ay(c,n,s)}h.memoizedState=s;var p={value:s,getSnapshot:n};return h.queue=p,By(Ty.bind(null,c,p,t),[t]),c.flags|=2048,Rs(9,{destroy:void 0},xy.bind(null,c,p,s,n),null),s},useId:function(){var t=En(),n=xt.identifierPrefix;if(lt){var s=Ga,c=Pa;s=(c&~(1<<32-q(c)-1)).toString(32)+s,n="_"+n+"R_"+s,s=Qc++,0<s&&(n+="H"+s.toString(32)),n+="_"}else s=P_++,n="_"+n+"r_"+s.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:lh,useFormState:Hy,useActionState:Hy,useOptimistic:function(t){var n=En();n.memoizedState=n.baseState=t;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=s,n=ch.bind(null,Xe,!0,s),s.dispatch=n,[t,n]},useMemoCache:Zf,useCacheRefresh:function(){return En().memoizedState=Y_.bind(null,Xe)},useEffectEvent:function(t){var n=En(),s={impl:t};return n.memoizedState=s,function(){if((mt&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}},uh={readContext:dn,use:Zc,useCallback:Ky,useContext:dn,useEffect:rh,useImperativeHandle:Fy,useInsertionEffect:Py,useLayoutEffect:Gy,useMemo:Wy,useReducer:eu,useRef:Uy,useState:function(){return eu(hr)},useDebugValue:ih,useDeferredValue:function(t,n){var s=Pt();return Yy(s,Ct.memoizedState,t,n)},useTransition:function(){var t=eu(hr)[0],n=Pt().memoizedState;return[typeof t=="boolean"?t:ol(t),n]},useSyncExternalStore:_y,useId:Zy,useHostTransitionStatus:lh,useFormState:zy,useActionState:zy,useOptimistic:function(t,n){var s=Pt();return Dy(s,Ct,t,n)},useMemoCache:Zf,useCacheRefresh:eb};uh.useEffectEvent=qy;var ib={readContext:dn,use:Zc,useCallback:Ky,useContext:dn,useEffect:rh,useImperativeHandle:Fy,useInsertionEffect:Py,useLayoutEffect:Gy,useMemo:Wy,useReducer:th,useRef:Uy,useState:function(){return th(hr)},useDebugValue:ih,useDeferredValue:function(t,n){var s=Pt();return Ct===null?sh(s,t,n):Yy(s,Ct.memoizedState,t,n)},useTransition:function(){var t=th(hr)[0],n=Pt().memoizedState;return[typeof t=="boolean"?t:ol(t),n]},useSyncExternalStore:_y,useId:Zy,useHostTransitionStatus:lh,useFormState:jy,useActionState:jy,useOptimistic:function(t,n){var s=Pt();return Ct!==null?Dy(s,Ct,t,n):(s.baseState=t,[t,s.queue.dispatch])},useMemoCache:Zf,useCacheRefresh:eb};ib.useEffectEvent=qy;function dh(t,n,s,c){n=t.memoizedState,s=s(c,n),s=s==null?n:b({},n,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var fh={enqueueSetState:function(t,n,s){t=t._reactInternals;var c=Jn(),h=Vr(c);h.payload=n,s!=null&&(h.callback=s),n=Fr(t,h,c),n!==null&&(In(n,t,c),al(n,t,c))},enqueueReplaceState:function(t,n,s){t=t._reactInternals;var c=Jn(),h=Vr(c);h.tag=1,h.payload=n,s!=null&&(h.callback=s),n=Fr(t,h,c),n!==null&&(In(n,t,c),al(n,t,c))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var s=Jn(),c=Vr(s);c.tag=2,n!=null&&(c.callback=n),n=Fr(t,c,s),n!==null&&(In(n,t,s),al(n,t,s))}};function sb(t,n,s,c,h,p,w){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(c,p,w):n.prototype&&n.prototype.isPureReactComponent?!Yo(s,c)||!Yo(h,p):!0}function ob(t,n,s,c){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(s,c),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(s,c),n.state!==t&&fh.enqueueReplaceState(n,n.state,null)}function Hi(t,n){var s=n;if("ref"in n){s={};for(var c in n)c!=="ref"&&(s[c]=n[c])}if(t=t.defaultProps){s===n&&(s=b({},s));for(var h in t)s[h]===void 0&&(s[h]=t[h])}return s}function lb(t){Nc(t)}function cb(t){console.error(t)}function ub(t){Nc(t)}function ru(t,n){try{var s=t.onUncaughtError;s(n.value,{componentStack:n.stack})}catch(c){setTimeout(function(){throw c})}}function db(t,n,s){try{var c=t.onCaughtError;c(s.value,{componentStack:s.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function hh(t,n,s){return s=Vr(s),s.tag=3,s.payload={element:null},s.callback=function(){ru(t,n)},s}function fb(t){return t=Vr(t),t.tag=3,t}function hb(t,n,s,c){var h=s.type.getDerivedStateFromError;if(typeof h=="function"){var p=c.value;t.payload=function(){return h(p)},t.callback=function(){db(n,s,c)}}var w=s.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(t.callback=function(){db(n,s,c),typeof h!="function"&&(Jr===null?Jr=new Set([this]):Jr.add(this));var k=c.stack;this.componentDidCatch(c.value,{componentStack:k!==null?k:""})})}function Q_(t,n,s,c,h){if(s.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(n=s.alternate,n!==null&&ws(n,s,h,!0),s=Wn.current,s!==null){switch(s.tag){case 31:case 13:return ca===null?mu():s.alternate===null&&It===0&&(It=3),s.flags&=-257,s.flags|=65536,s.lanes=h,c===Vc?s.flags|=16384:(n=s.updateQueue,n===null?s.updateQueue=new Set([c]):n.add(c),Ih(t,c,h)),!1;case 22:return s.flags|=65536,c===Vc?s.flags|=16384:(n=s.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([c])},s.updateQueue=n):(s=n.retryQueue,s===null?n.retryQueue=new Set([c]):s.add(c)),Ih(t,c,h)),!1}throw Error(r(435,s.tag))}return Ih(t,c,h),mu(),!1}if(lt)return n=Wn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=h,c!==Lf&&(t=Error(r(422),{cause:c}),Jo(ia(t,s)))):(c!==Lf&&(n=Error(r(423),{cause:c}),Jo(ia(n,s))),t=t.current.alternate,t.flags|=65536,h&=-h,t.lanes|=h,c=ia(c,s),h=hh(t.stateNode,c,h),Pf(t,h),It!==4&&(It=2)),!1;var p=Error(r(520),{cause:c});if(p=ia(p,s),yl===null?yl=[p]:yl.push(p),It!==4&&(It=2),n===null)return!0;c=ia(c,s),s=n;do{switch(s.tag){case 3:return s.flags|=65536,t=h&-h,s.lanes|=t,t=hh(s.stateNode,c,t),Pf(s,t),!1;case 1:if(n=s.type,p=s.stateNode,(s.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(Jr===null||!Jr.has(p))))return s.flags|=65536,h&=-h,s.lanes|=h,h=fb(h),hb(h,t,s,c),Pf(s,h),!1}s=s.return}while(s!==null);return!1}var gh=Error(r(461)),Xt=!1;function fn(t,n,s,c){n.child=t===null?yy(n,null,s,c):$i(n,t.child,s,c)}function gb(t,n,s,c,h){s=s.render;var p=n.ref;if("ref"in c){var w={};for(var k in c)k!=="ref"&&(w[k]=c[k])}else w=c;return Di(n),c=Yf(t,n,s,w,p,h),k=Xf(),t!==null&&!Xt?(Qf(t,n,h),gr(t,n,h)):(lt&&k&&Df(n),n.flags|=1,fn(t,n,c,h),n.child)}function pb(t,n,s,c,h){if(t===null){var p=s.type;return typeof p=="function"&&!Tf(p)&&p.defaultProps===void 0&&s.compare===null?(n.tag=15,n.type=p,mb(t,n,p,c,h)):(t=jc(s.type,null,c,n,n.mode,h),t.ref=n.ref,t.return=n,n.child=t)}if(p=t.child,!Ch(t,h)){var w=p.memoizedProps;if(s=s.compare,s=s!==null?s:Yo,s(w,c)&&t.ref===n.ref)return gr(t,n,h)}return n.flags|=1,t=lr(p,c),t.ref=n.ref,t.return=n,n.child=t}function mb(t,n,s,c,h){if(t!==null){var p=t.memoizedProps;if(Yo(p,c)&&t.ref===n.ref)if(Xt=!1,n.pendingProps=c=p,Ch(t,h))(t.flags&131072)!==0&&(Xt=!0);else return n.lanes=t.lanes,gr(t,n,h)}return ph(t,n,s,c,h)}function yb(t,n,s,c){var h=c.children,p=t!==null?t.memoizedState:null;if(t===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((n.flags&128)!==0){if(p=p!==null?p.baseLanes|s:s,t!==null){for(c=n.child=t.child,h=0;c!==null;)h=h|c.lanes|c.childLanes,c=c.sibling;c=h&~p}else c=0,n.child=null;return bb(t,n,p,s,c)}if((s&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&Pc(n,p!==null?p.cachePool:null),p!==null?Sy(n,p):Vf(),wy(n);else return c=n.lanes=536870912,bb(t,n,p!==null?p.baseLanes|s:s,s,c)}else p!==null?(Pc(n,p.cachePool),Sy(n,p),Wr(),n.memoizedState=null):(t!==null&&Pc(n,null),Vf(),Wr());return fn(t,n,h,s),n.child}function ul(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function bb(t,n,s,c,h){var p=jf();return p=p===null?null:{parent:Wt._currentValue,pool:p},n.memoizedState={baseLanes:s,cachePool:p},t!==null&&Pc(n,null),Vf(),wy(n),t!==null&&ws(t,n,c,!0),n.childLanes=h,null}function iu(t,n){return n=ou({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function vb(t,n,s){return $i(n,t.child,null,s),t=iu(n,n.pendingProps),t.flags|=2,Yn(n),n.memoizedState=null,t}function J_(t,n,s){var c=n.pendingProps,h=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(lt){if(c.mode==="hidden")return t=iu(n,c),n.lanes=536870912,ul(null,t);if(Kf(n),(t=Rt)?(t=Ov(t,la),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Ur!==null?{id:Pa,overflow:Ga}:null,retryLane:536870912,hydrationErrors:null},s=ny(t),s.return=n,n.child=s,un=n,Rt=null)):t=null,t===null)throw qr(n);return n.lanes=536870912,null}return iu(n,c)}var p=t.memoizedState;if(p!==null){var w=p.dehydrated;if(Kf(n),h)if(n.flags&256)n.flags&=-257,n=vb(t,n,s);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(r(558));else if(Xt||ws(t,n,s,!1),h=(s&t.childLanes)!==0,Xt||h){if(c=xt,c!==null&&(w=nt(c,s),w!==0&&w!==p.retryLane))throw p.retryLane=w,xi(t,w),In(c,t,w),gh;mu(),n=vb(t,n,s)}else t=p.treeContext,Rt=ua(w.nextSibling),un=n,lt=!0,Br=null,la=!1,t!==null&&iy(n,t),n=iu(n,c),n.flags|=4096;return n}return t=lr(t.child,{mode:c.mode,children:c.children}),t.ref=n.ref,n.child=t,t.return=n,t}function su(t,n){var s=n.ref;if(s===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(r(284));(t===null||t.ref!==s)&&(n.flags|=4194816)}}function ph(t,n,s,c,h){return Di(n),s=Yf(t,n,s,c,void 0,h),c=Xf(),t!==null&&!Xt?(Qf(t,n,h),gr(t,n,h)):(lt&&c&&Df(n),n.flags|=1,fn(t,n,s,h),n.child)}function Sb(t,n,s,c,h,p){return Di(n),n.updateQueue=null,s=Ey(n,c,s,h),Cy(t),c=Xf(),t!==null&&!Xt?(Qf(t,n,p),gr(t,n,p)):(lt&&c&&Df(n),n.flags|=1,fn(t,n,s,p),n.child)}function wb(t,n,s,c,h){if(Di(n),n.stateNode===null){var p=ys,w=s.contextType;typeof w=="object"&&w!==null&&(p=dn(w)),p=new s(c,p),n.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=fh,n.stateNode=p,p._reactInternals=n,p=n.stateNode,p.props=c,p.state=n.memoizedState,p.refs={},Bf(n),w=s.contextType,p.context=typeof w=="object"&&w!==null?dn(w):ys,p.state=n.memoizedState,w=s.getDerivedStateFromProps,typeof w=="function"&&(dh(n,s,w,c),p.state=n.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(w=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),w!==p.state&&fh.enqueueReplaceState(p,p.state,null),il(n,c,p,h),rl(),p.state=n.memoizedState),typeof p.componentDidMount=="function"&&(n.flags|=4194308),c=!0}else if(t===null){p=n.stateNode;var k=n.memoizedProps,I=Hi(s,k);p.props=I;var W=p.context,ae=s.contextType;w=ys,typeof ae=="object"&&ae!==null&&(w=dn(ae));var ce=s.getDerivedStateFromProps;ae=typeof ce=="function"||typeof p.getSnapshotBeforeUpdate=="function",k=n.pendingProps!==k,ae||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(k||W!==w)&&ob(n,p,c,w),Gr=!1;var X=n.memoizedState;p.state=X,il(n,c,p,h),rl(),W=n.memoizedState,k||X!==W||Gr?(typeof ce=="function"&&(dh(n,s,ce,c),W=n.memoizedState),(I=Gr||sb(n,s,I,c,X,W,w))?(ae||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount()),typeof p.componentDidMount=="function"&&(n.flags|=4194308)):(typeof p.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=c,n.memoizedState=W),p.props=c,p.state=W,p.context=w,c=I):(typeof p.componentDidMount=="function"&&(n.flags|=4194308),c=!1)}else{p=n.stateNode,qf(t,n),w=n.memoizedProps,ae=Hi(s,w),p.props=ae,ce=n.pendingProps,X=p.context,W=s.contextType,I=ys,typeof W=="object"&&W!==null&&(I=dn(W)),k=s.getDerivedStateFromProps,(W=typeof k=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(w!==ce||X!==I)&&ob(n,p,c,I),Gr=!1,X=n.memoizedState,p.state=X,il(n,c,p,h),rl();var ee=n.memoizedState;w!==ce||X!==ee||Gr||t!==null&&t.dependencies!==null&&Bc(t.dependencies)?(typeof k=="function"&&(dh(n,s,k,c),ee=n.memoizedState),(ae=Gr||sb(n,s,ae,c,X,ee,I)||t!==null&&t.dependencies!==null&&Bc(t.dependencies))?(W||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(c,ee,I),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(c,ee,I)),typeof p.componentDidUpdate=="function"&&(n.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof p.componentDidUpdate!="function"||w===t.memoizedProps&&X===t.memoizedState||(n.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||w===t.memoizedProps&&X===t.memoizedState||(n.flags|=1024),n.memoizedProps=c,n.memoizedState=ee),p.props=c,p.state=ee,p.context=I,c=ae):(typeof p.componentDidUpdate!="function"||w===t.memoizedProps&&X===t.memoizedState||(n.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||w===t.memoizedProps&&X===t.memoizedState||(n.flags|=1024),c=!1)}return p=c,su(t,n),c=(n.flags&128)!==0,p||c?(p=n.stateNode,s=c&&typeof s.getDerivedStateFromError!="function"?null:p.render(),n.flags|=1,t!==null&&c?(n.child=$i(n,t.child,null,h),n.child=$i(n,null,s,h)):fn(t,n,s,h),n.memoizedState=p.state,t=n.child):t=gr(t,n,h),t}function Cb(t,n,s,c){return ki(),n.flags|=256,fn(t,n,s,c),n.child}var mh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function yh(t){return{baseLanes:t,cachePool:dy()}}function bh(t,n,s){return t=t!==null?t.childLanes&~s:0,n&&(t|=Qn),t}function Eb(t,n,s){var c=n.pendingProps,h=!1,p=(n.flags&128)!==0,w;if((w=p)||(w=t!==null&&t.memoizedState===null?!1:(qt.current&2)!==0),w&&(h=!0,n.flags&=-129),w=(n.flags&32)!==0,n.flags&=-33,t===null){if(lt){if(h?Kr(n):Wr(),(t=Rt)?(t=Ov(t,la),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Ur!==null?{id:Pa,overflow:Ga}:null,retryLane:536870912,hydrationErrors:null},s=ny(t),s.return=n,n.child=s,un=n,Rt=null)):t=null,t===null)throw qr(n);return eg(t)?n.lanes=32:n.lanes=536870912,null}var k=c.children;return c=c.fallback,h?(Wr(),h=n.mode,k=ou({mode:"hidden",children:k},h),c=Ti(c,h,s,null),k.return=n,c.return=n,k.sibling=c,n.child=k,c=n.child,c.memoizedState=yh(s),c.childLanes=bh(t,w,s),n.memoizedState=mh,ul(null,c)):(Kr(n),vh(n,k))}var I=t.memoizedState;if(I!==null&&(k=I.dehydrated,k!==null)){if(p)n.flags&256?(Kr(n),n.flags&=-257,n=Sh(t,n,s)):n.memoizedState!==null?(Wr(),n.child=t.child,n.flags|=128,n=null):(Wr(),k=c.fallback,h=n.mode,c=ou({mode:"visible",children:c.children},h),k=Ti(k,h,s,null),k.flags|=2,c.return=n,k.return=n,c.sibling=k,n.child=c,$i(n,t.child,null,s),c=n.child,c.memoizedState=yh(s),c.childLanes=bh(t,w,s),n.memoizedState=mh,n=ul(null,c));else if(Kr(n),eg(k)){if(w=k.nextSibling&&k.nextSibling.dataset,w)var W=w.dgst;w=W,c=Error(r(419)),c.stack="",c.digest=w,Jo({value:c,source:null,stack:null}),n=Sh(t,n,s)}else if(Xt||ws(t,n,s,!1),w=(s&t.childLanes)!==0,Xt||w){if(w=xt,w!==null&&(c=nt(w,s),c!==0&&c!==I.retryLane))throw I.retryLane=c,xi(t,c),In(w,t,c),gh;Zh(k)||mu(),n=Sh(t,n,s)}else Zh(k)?(n.flags|=192,n.child=t.child,n=null):(t=I.treeContext,Rt=ua(k.nextSibling),un=n,lt=!0,Br=null,la=!1,t!==null&&iy(n,t),n=vh(n,c.children),n.flags|=4096);return n}return h?(Wr(),k=c.fallback,h=n.mode,I=t.child,W=I.sibling,c=lr(I,{mode:"hidden",children:c.children}),c.subtreeFlags=I.subtreeFlags&65011712,W!==null?k=lr(W,k):(k=Ti(k,h,s,null),k.flags|=2),k.return=n,c.return=n,c.sibling=k,n.child=c,ul(null,c),c=n.child,k=t.child.memoizedState,k===null?k=yh(s):(h=k.cachePool,h!==null?(I=Wt._currentValue,h=h.parent!==I?{parent:I,pool:I}:h):h=dy(),k={baseLanes:k.baseLanes|s,cachePool:h}),c.memoizedState=k,c.childLanes=bh(t,w,s),n.memoizedState=mh,ul(t.child,c)):(Kr(n),s=t.child,t=s.sibling,s=lr(s,{mode:"visible",children:c.children}),s.return=n,s.sibling=null,t!==null&&(w=n.deletions,w===null?(n.deletions=[t],n.flags|=16):w.push(t)),n.child=s,n.memoizedState=null,s)}function vh(t,n){return n=ou({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function ou(t,n){return t=Kn(22,t,null,n),t.lanes=0,t}function Sh(t,n,s){return $i(n,t.child,null,s),t=vh(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function _b(t,n,s){t.lanes|=n;var c=t.alternate;c!==null&&(c.lanes|=n),Nf(t.return,n,s)}function wh(t,n,s,c,h,p){var w=t.memoizedState;w===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:c,tail:s,tailMode:h,treeForkCount:p}:(w.isBackwards=n,w.rendering=null,w.renderingStartTime=0,w.last=c,w.tail=s,w.tailMode=h,w.treeForkCount=p)}function Ab(t,n,s){var c=n.pendingProps,h=c.revealOrder,p=c.tail;c=c.children;var w=qt.current,k=(w&2)!==0;if(k?(w=w&1|2,n.flags|=128):w&=1,ue(qt,w),fn(t,n,c,s),c=lt?Qo:0,!k&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&_b(t,s,n);else if(t.tag===19)_b(t,s,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(h){case"forwards":for(s=n.child,h=null;s!==null;)t=s.alternate,t!==null&&Yc(t)===null&&(h=s),s=s.sibling;s=h,s===null?(h=n.child,n.child=null):(h=s.sibling,s.sibling=null),wh(n,!1,h,s,p,c);break;case"backwards":case"unstable_legacy-backwards":for(s=null,h=n.child,n.child=null;h!==null;){if(t=h.alternate,t!==null&&Yc(t)===null){n.child=h;break}t=h.sibling,h.sibling=s,s=h,h=t}wh(n,!0,s,null,p,c);break;case"together":wh(n,!1,null,null,void 0,c);break;default:n.memoizedState=null}return n.child}function gr(t,n,s){if(t!==null&&(n.dependencies=t.dependencies),Qr|=n.lanes,(s&n.childLanes)===0)if(t!==null){if(ws(t,n,s,!1),(s&n.childLanes)===0)return null}else return null;if(t!==null&&n.child!==t.child)throw Error(r(153));if(n.child!==null){for(t=n.child,s=lr(t,t.pendingProps),n.child=s,s.return=n;t.sibling!==null;)t=t.sibling,s=s.sibling=lr(t,t.pendingProps),s.return=n;s.sibling=null}return n.child}function Ch(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&Bc(t)))}function Z_(t,n,s){switch(n.tag){case 3:Me(n,n.stateNode.containerInfo),Pr(n,Wt,t.memoizedState.cache),ki();break;case 27:case 5:Ie(n);break;case 4:Me(n,n.stateNode.containerInfo);break;case 10:Pr(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Kf(n),null;break;case 13:var c=n.memoizedState;if(c!==null)return c.dehydrated!==null?(Kr(n),n.flags|=128,null):(s&n.child.childLanes)!==0?Eb(t,n,s):(Kr(n),t=gr(t,n,s),t!==null?t.sibling:null);Kr(n);break;case 19:var h=(t.flags&128)!==0;if(c=(s&n.childLanes)!==0,c||(ws(t,n,s,!1),c=(s&n.childLanes)!==0),h){if(c)return Ab(t,n,s);n.flags|=128}if(h=n.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),ue(qt,qt.current),c)break;return null;case 22:return n.lanes=0,yb(t,n,s,n.pendingProps);case 24:Pr(n,Wt,t.memoizedState.cache)}return gr(t,n,s)}function xb(t,n,s){if(t!==null)if(t.memoizedProps!==n.pendingProps)Xt=!0;else{if(!Ch(t,s)&&(n.flags&128)===0)return Xt=!1,Z_(t,n,s);Xt=(t.flags&131072)!==0}else Xt=!1,lt&&(n.flags&1048576)!==0&&ry(n,Qo,n.index);switch(n.lanes=0,n.tag){case 16:e:{var c=n.pendingProps;if(t=Li(n.elementType),n.type=t,typeof t=="function")Tf(t)?(c=Hi(t,c),n.tag=1,n=wb(null,n,t,c,s)):(n.tag=0,n=ph(null,n,t,c,s));else{if(t!=null){var h=t.$$typeof;if(h===L){n.tag=11,n=gb(null,n,t,c,s);break e}else if(h===B){n.tag=14,n=pb(null,n,t,c,s);break e}}throw n=Ze(t)||t,Error(r(306,n,""))}}return n;case 0:return ph(t,n,n.type,n.pendingProps,s);case 1:return c=n.type,h=Hi(c,n.pendingProps),wb(t,n,c,h,s);case 3:e:{if(Me(n,n.stateNode.containerInfo),t===null)throw Error(r(387));c=n.pendingProps;var p=n.memoizedState;h=p.element,qf(t,n),il(n,c,null,s);var w=n.memoizedState;if(c=w.cache,Pr(n,Wt,c),c!==p.cache&&Hf(n,[Wt],s,!0),rl(),c=w.element,p.isDehydrated)if(p={element:c,isDehydrated:!1,cache:w.cache},n.updateQueue.baseState=p,n.memoizedState=p,n.flags&256){n=Cb(t,n,c,s);break e}else if(c!==h){h=ia(Error(r(424)),n),Jo(h),n=Cb(t,n,c,s);break e}else{switch(t=n.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(Rt=ua(t.firstChild),un=n,lt=!0,Br=null,la=!0,s=yy(n,null,c,s),n.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(ki(),c===h){n=gr(t,n,s);break e}fn(t,n,c,s)}n=n.child}return n;case 26:return su(t,n),t===null?(s=zv(n.type,null,n.pendingProps,null))?n.memoizedState=s:lt||(s=n.type,t=n.pendingProps,c=Eu(ye.current).createElement(s),c[tn]=n,c[cn]=t,hn(c,s,t),Kt(c),n.stateNode=c):n.memoizedState=zv(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return Ie(n),t===null&&lt&&(c=n.stateNode=$v(n.type,n.pendingProps,ye.current),un=n,la=!0,h=Rt,ni(n.type)?(tg=h,Rt=ua(c.firstChild)):Rt=h),fn(t,n,n.pendingProps.children,s),su(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&lt&&((h=c=Rt)&&(c=RA(c,n.type,n.pendingProps,la),c!==null?(n.stateNode=c,un=n,Rt=ua(c.firstChild),la=!1,h=!0):h=!1),h||qr(n)),Ie(n),h=n.type,p=n.pendingProps,w=t!==null?t.memoizedProps:null,c=p.children,Xh(h,p)?c=null:w!==null&&Xh(h,w)&&(n.flags|=32),n.memoizedState!==null&&(h=Yf(t,n,G_,null,null,s),Al._currentValue=h),su(t,n),fn(t,n,c,s),n.child;case 6:return t===null&&lt&&((t=s=Rt)&&(s=DA(s,n.pendingProps,la),s!==null?(n.stateNode=s,un=n,Rt=null,t=!0):t=!1),t||qr(n)),null;case 13:return Eb(t,n,s);case 4:return Me(n,n.stateNode.containerInfo),c=n.pendingProps,t===null?n.child=$i(n,null,c,s):fn(t,n,c,s),n.child;case 11:return gb(t,n,n.type,n.pendingProps,s);case 7:return fn(t,n,n.pendingProps,s),n.child;case 8:return fn(t,n,n.pendingProps.children,s),n.child;case 12:return fn(t,n,n.pendingProps.children,s),n.child;case 10:return c=n.pendingProps,Pr(n,n.type,c.value),fn(t,n,c.children,s),n.child;case 9:return h=n.type._context,c=n.pendingProps.children,Di(n),h=dn(h),c=c(h),n.flags|=1,fn(t,n,c,s),n.child;case 14:return pb(t,n,n.type,n.pendingProps,s);case 15:return mb(t,n,n.type,n.pendingProps,s);case 19:return Ab(t,n,s);case 31:return J_(t,n,s);case 22:return yb(t,n,s,n.pendingProps);case 24:return Di(n),c=dn(Wt),t===null?(h=jf(),h===null&&(h=xt,p=zf(),h.pooledCache=p,p.refCount++,p!==null&&(h.pooledCacheLanes|=s),h=p),n.memoizedState={parent:c,cache:h},Bf(n),Pr(n,Wt,h)):((t.lanes&s)!==0&&(qf(t,n),il(n,null,null,s),rl()),h=t.memoizedState,p=n.memoizedState,h.parent!==c?(h={parent:c,cache:c},n.memoizedState=h,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=h),Pr(n,Wt,c)):(c=p.cache,Pr(n,Wt,c),c!==h.cache&&Hf(n,[Wt],s,!0))),fn(t,n,n.pendingProps.children,s),n.child;case 29:throw n.pendingProps}throw Error(r(156,n.tag))}function pr(t){t.flags|=4}function Eh(t,n,s,c,h){if((n=(t.mode&32)!==0)&&(n=!1),n){if(t.flags|=16777216,(h&335544128)===h)if(t.stateNode.complete)t.flags|=8192;else if(Zb())t.flags|=8192;else throw Mi=Vc,Uf}else t.flags&=-16777217}function Tb(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!qv(n))if(Zb())t.flags|=8192;else throw Mi=Vc,Uf}function lu(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?xe():536870912,t.lanes|=n,Ms|=n)}function dl(t,n){if(!lt)switch(t.tailMode){case"hidden":n=t.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t.tail=null:s.sibling=null;break;case"collapsed":s=t.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:c.sibling=null}}function Dt(t){var n=t.alternate!==null&&t.alternate.child===t.child,s=0,c=0;if(n)for(var h=t.child;h!==null;)s|=h.lanes|h.childLanes,c|=h.subtreeFlags&65011712,c|=h.flags&65011712,h.return=t,h=h.sibling;else for(h=t.child;h!==null;)s|=h.lanes|h.childLanes,c|=h.subtreeFlags,c|=h.flags,h.return=t,h=h.sibling;return t.subtreeFlags|=c,t.childLanes=s,n}function eA(t,n,s){var c=n.pendingProps;switch(Of(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Dt(n),null;case 1:return Dt(n),null;case 3:return s=n.stateNode,c=null,t!==null&&(c=t.memoizedState.cache),n.memoizedState.cache!==c&&(n.flags|=2048),dr(Wt),Pe(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(Ss(n)?pr(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Mf())),Dt(n),null;case 26:var h=n.type,p=n.memoizedState;return t===null?(pr(n),p!==null?(Dt(n),Tb(n,p)):(Dt(n),Eh(n,h,null,c,s))):p?p!==t.memoizedState?(pr(n),Dt(n),Tb(n,p)):(Dt(n),n.flags&=-16777217):(t=t.memoizedProps,t!==c&&pr(n),Dt(n),Eh(n,h,t,c,s)),null;case 27:if(Lt(n),s=ye.current,h=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==c&&pr(n);else{if(!c){if(n.stateNode===null)throw Error(r(166));return Dt(n),null}t=fe.current,Ss(n)?sy(n):(t=$v(h,c,s),n.stateNode=t,pr(n))}return Dt(n),null;case 5:if(Lt(n),h=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==c&&pr(n);else{if(!c){if(n.stateNode===null)throw Error(r(166));return Dt(n),null}if(p=fe.current,Ss(n))sy(n);else{var w=Eu(ye.current);switch(p){case 1:p=w.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:p=w.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":p=w.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":p=w.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":p=w.createElement("div"),p.innerHTML="<script><\/script>",p=p.removeChild(p.firstChild);break;case"select":p=typeof c.is=="string"?w.createElement("select",{is:c.is}):w.createElement("select"),c.multiple?p.multiple=!0:c.size&&(p.size=c.size);break;default:p=typeof c.is=="string"?w.createElement(h,{is:c.is}):w.createElement(h)}}p[tn]=n,p[cn]=c;e:for(w=n.child;w!==null;){if(w.tag===5||w.tag===6)p.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===n)break e;for(;w.sibling===null;){if(w.return===null||w.return===n)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}n.stateNode=p;e:switch(hn(p,h,c),h){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&pr(n)}}return Dt(n),Eh(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,s),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==c&&pr(n);else{if(typeof c!="string"&&n.stateNode===null)throw Error(r(166));if(t=ye.current,Ss(n)){if(t=n.stateNode,s=n.memoizedProps,c=null,h=un,h!==null)switch(h.tag){case 27:case 5:c=h.memoizedProps}t[tn]=n,t=!!(t.nodeValue===s||c!==null&&c.suppressHydrationWarning===!0||Ev(t.nodeValue,s)),t||qr(n,!0)}else t=Eu(t).createTextNode(c),t[tn]=n,n.stateNode=t}return Dt(n),null;case 31:if(s=n.memoizedState,t===null||t.memoizedState!==null){if(c=Ss(n),s!==null){if(t===null){if(!c)throw Error(r(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(557));t[tn]=n}else ki(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Dt(n),t=!1}else s=Mf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=s),t=!0;if(!t)return n.flags&256?(Yn(n),n):(Yn(n),null);if((n.flags&128)!==0)throw Error(r(558))}return Dt(n),null;case 13:if(c=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(h=Ss(n),c!==null&&c.dehydrated!==null){if(t===null){if(!h)throw Error(r(318));if(h=n.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(r(317));h[tn]=n}else ki(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Dt(n),h=!1}else h=Mf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=h),h=!0;if(!h)return n.flags&256?(Yn(n),n):(Yn(n),null)}return Yn(n),(n.flags&128)!==0?(n.lanes=s,n):(s=c!==null,t=t!==null&&t.memoizedState!==null,s&&(c=n.child,h=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(h=c.alternate.memoizedState.cachePool.pool),p=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(p=c.memoizedState.cachePool.pool),p!==h&&(c.flags|=2048)),s!==t&&s&&(n.child.flags|=8192),lu(n,n.updateQueue),Dt(n),null);case 4:return Pe(),t===null&&Vh(n.stateNode.containerInfo),Dt(n),null;case 10:return dr(n.type),Dt(n),null;case 19:if(F(qt),c=n.memoizedState,c===null)return Dt(n),null;if(h=(n.flags&128)!==0,p=c.rendering,p===null)if(h)dl(c,!1);else{if(It!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(p=Yc(t),p!==null){for(n.flags|=128,dl(c,!1),t=p.updateQueue,n.updateQueue=t,lu(n,t),n.subtreeFlags=0,t=s,s=n.child;s!==null;)ty(s,t),s=s.sibling;return ue(qt,qt.current&1|2),lt&&cr(n,c.treeForkCount),n.child}t=t.sibling}c.tail!==null&&Vt()>hu&&(n.flags|=128,h=!0,dl(c,!1),n.lanes=4194304)}else{if(!h)if(t=Yc(p),t!==null){if(n.flags|=128,h=!0,t=t.updateQueue,n.updateQueue=t,lu(n,t),dl(c,!0),c.tail===null&&c.tailMode==="hidden"&&!p.alternate&&!lt)return Dt(n),null}else 2*Vt()-c.renderingStartTime>hu&&s!==536870912&&(n.flags|=128,h=!0,dl(c,!1),n.lanes=4194304);c.isBackwards?(p.sibling=n.child,n.child=p):(t=c.last,t!==null?t.sibling=p:n.child=p,c.last=p)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=Vt(),t.sibling=null,s=qt.current,ue(qt,h?s&1|2:s&1),lt&&cr(n,c.treeForkCount),t):(Dt(n),null);case 22:case 23:return Yn(n),Ff(),c=n.memoizedState!==null,t!==null?t.memoizedState!==null!==c&&(n.flags|=8192):c&&(n.flags|=8192),c?(s&536870912)!==0&&(n.flags&128)===0&&(Dt(n),n.subtreeFlags&6&&(n.flags|=8192)):Dt(n),s=n.updateQueue,s!==null&&lu(n,s.retryQueue),s=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),c=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(c=n.memoizedState.cachePool.pool),c!==s&&(n.flags|=2048),t!==null&&F(Oi),null;case 24:return s=null,t!==null&&(s=t.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),dr(Wt),Dt(n),null;case 25:return null;case 30:return null}throw Error(r(156,n.tag))}function tA(t,n){switch(Of(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return dr(Wt),Pe(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return Lt(n),null;case 31:if(n.memoizedState!==null){if(Yn(n),n.alternate===null)throw Error(r(340));ki()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(Yn(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(r(340));ki()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return F(qt),null;case 4:return Pe(),null;case 10:return dr(n.type),null;case 22:case 23:return Yn(n),Ff(),t!==null&&F(Oi),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return dr(Wt),null;case 25:return null;default:return null}}function kb(t,n){switch(Of(n),n.tag){case 3:dr(Wt),Pe();break;case 26:case 27:case 5:Lt(n);break;case 4:Pe();break;case 31:n.memoizedState!==null&&Yn(n);break;case 13:Yn(n);break;case 19:F(qt);break;case 10:dr(n.type);break;case 22:case 23:Yn(n),Ff(),t!==null&&F(Oi);break;case 24:dr(Wt)}}function fl(t,n){try{var s=n.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var h=c.next;s=h;do{if((s.tag&t)===t){c=void 0;var p=s.create,w=s.inst;c=p(),w.destroy=c}s=s.next}while(s!==h)}}catch(k){wt(n,n.return,k)}}function Yr(t,n,s){try{var c=n.updateQueue,h=c!==null?c.lastEffect:null;if(h!==null){var p=h.next;c=p;do{if((c.tag&t)===t){var w=c.inst,k=w.destroy;if(k!==void 0){w.destroy=void 0,h=n;var I=s,W=k;try{W()}catch(ae){wt(h,I,ae)}}}c=c.next}while(c!==p)}}catch(ae){wt(n,n.return,ae)}}function Rb(t){var n=t.updateQueue;if(n!==null){var s=t.stateNode;try{vy(n,s)}catch(c){wt(t,t.return,c)}}}function Db(t,n,s){s.props=Hi(t.type,t.memoizedProps),s.state=t.memoizedState;try{s.componentWillUnmount()}catch(c){wt(t,n,c)}}function hl(t,n){try{var s=t.ref;if(s!==null){switch(t.tag){case 26:case 27:case 5:var c=t.stateNode;break;case 30:c=t.stateNode;break;default:c=t.stateNode}typeof s=="function"?t.refCleanup=s(c):s.current=c}}catch(h){wt(t,n,h)}}function Va(t,n){var s=t.ref,c=t.refCleanup;if(s!==null)if(typeof c=="function")try{c()}catch(h){wt(t,n,h)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(h){wt(t,n,h)}else s.current=null}function Ob(t){var n=t.type,s=t.memoizedProps,c=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":s.autoFocus&&c.focus();break e;case"img":s.src?c.src=s.src:s.srcSet&&(c.srcset=s.srcSet)}}catch(h){wt(t,t.return,h)}}function _h(t,n,s){try{var c=t.stateNode;EA(c,t.type,s,n),c[cn]=n}catch(h){wt(t,t.return,h)}}function Lb(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ni(t.type)||t.tag===4}function Ah(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Lb(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&ni(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function xh(t,n,s){var c=t.tag;if(c===5||c===6)t=t.stateNode,n?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(t,n):(n=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,n.appendChild(t),s=s._reactRootContainer,s!=null||n.onclick!==null||(n.onclick=aa));else if(c!==4&&(c===27&&ni(t.type)&&(s=t.stateNode,n=null),t=t.child,t!==null))for(xh(t,n,s),t=t.sibling;t!==null;)xh(t,n,s),t=t.sibling}function cu(t,n,s){var c=t.tag;if(c===5||c===6)t=t.stateNode,n?s.insertBefore(t,n):s.appendChild(t);else if(c!==4&&(c===27&&ni(t.type)&&(s=t.stateNode),t=t.child,t!==null))for(cu(t,n,s),t=t.sibling;t!==null;)cu(t,n,s),t=t.sibling}function Mb(t){var n=t.stateNode,s=t.memoizedProps;try{for(var c=t.type,h=n.attributes;h.length;)n.removeAttributeNode(h[0]);hn(n,c,s),n[tn]=t,n[cn]=s}catch(p){wt(t,t.return,p)}}var mr=!1,Qt=!1,Th=!1,$b=typeof WeakSet=="function"?WeakSet:Set,ln=null;function nA(t,n){if(t=t.containerInfo,Wh=Du,t=Fm(t),Sf(t)){if("selectionStart"in t)var s={start:t.selectionStart,end:t.selectionEnd};else e:{s=(s=t.ownerDocument)&&s.defaultView||window;var c=s.getSelection&&s.getSelection();if(c&&c.rangeCount!==0){s=c.anchorNode;var h=c.anchorOffset,p=c.focusNode;c=c.focusOffset;try{s.nodeType,p.nodeType}catch{s=null;break e}var w=0,k=-1,I=-1,W=0,ae=0,ce=t,X=null;t:for(;;){for(var ee;ce!==s||h!==0&&ce.nodeType!==3||(k=w+h),ce!==p||c!==0&&ce.nodeType!==3||(I=w+c),ce.nodeType===3&&(w+=ce.nodeValue.length),(ee=ce.firstChild)!==null;)X=ce,ce=ee;for(;;){if(ce===t)break t;if(X===s&&++W===h&&(k=w),X===p&&++ae===c&&(I=w),(ee=ce.nextSibling)!==null)break;ce=X,X=ce.parentNode}ce=ee}s=k===-1||I===-1?null:{start:k,end:I}}else s=null}s=s||{start:0,end:0}}else s=null;for(Yh={focusedElem:t,selectionRange:s},Du=!1,ln=n;ln!==null;)if(n=ln,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,ln=t;else for(;ln!==null;){switch(n=ln,p=n.alternate,t=n.flags,n.tag){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(s=0;s<t.length;s++)h=t[s],h.ref.impl=h.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&p!==null){t=void 0,s=n,h=p.memoizedProps,p=p.memoizedState,c=s.stateNode;try{var Te=Hi(s.type,h);t=c.getSnapshotBeforeUpdate(Te,p),c.__reactInternalSnapshotBeforeUpdate=t}catch(Ue){wt(s,s.return,Ue)}}break;case 3:if((t&1024)!==0){if(t=n.stateNode.containerInfo,s=t.nodeType,s===9)Jh(t);else if(s===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Jh(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(r(163))}if(t=n.sibling,t!==null){t.return=n.return,ln=t;break}ln=n.return}}function Nb(t,n,s){var c=s.flags;switch(s.tag){case 0:case 11:case 15:br(t,s),c&4&&fl(5,s);break;case 1:if(br(t,s),c&4)if(t=s.stateNode,n===null)try{t.componentDidMount()}catch(w){wt(s,s.return,w)}else{var h=Hi(s.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(h,n,t.__reactInternalSnapshotBeforeUpdate)}catch(w){wt(s,s.return,w)}}c&64&&Rb(s),c&512&&hl(s,s.return);break;case 3:if(br(t,s),c&64&&(t=s.updateQueue,t!==null)){if(n=null,s.child!==null)switch(s.child.tag){case 27:case 5:n=s.child.stateNode;break;case 1:n=s.child.stateNode}try{vy(t,n)}catch(w){wt(s,s.return,w)}}break;case 27:n===null&&c&4&&Mb(s);case 26:case 5:br(t,s),n===null&&c&4&&Ob(s),c&512&&hl(s,s.return);break;case 12:br(t,s);break;case 31:br(t,s),c&4&&Ib(t,s);break;case 13:br(t,s),c&4&&jb(t,s),c&64&&(t=s.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(s=dA.bind(null,s),OA(t,s))));break;case 22:if(c=s.memoizedState!==null||mr,!c){n=n!==null&&n.memoizedState!==null||Qt,h=mr;var p=Qt;mr=c,(Qt=n)&&!p?vr(t,s,(s.subtreeFlags&8772)!==0):br(t,s),mr=h,Qt=p}break;case 30:break;default:br(t,s)}}function Hb(t){var n=t.alternate;n!==null&&(t.alternate=null,Hb(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&Ao(n)),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 Ot=null,$n=!1;function yr(t,n,s){for(s=s.child;s!==null;)zb(t,n,s),s=s.sibling}function zb(t,n,s){if(Bt&&typeof Bt.onCommitFiberUnmount=="function")try{Bt.onCommitFiberUnmount(Vn,s)}catch{}switch(s.tag){case 26:Qt||Va(s,n),yr(t,n,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Qt||Va(s,n);var c=Ot,h=$n;ni(s.type)&&(Ot=s.stateNode,$n=!1),yr(t,n,s),Cl(s.stateNode),Ot=c,$n=h;break;case 5:Qt||Va(s,n);case 6:if(c=Ot,h=$n,Ot=null,yr(t,n,s),Ot=c,$n=h,Ot!==null)if($n)try{(Ot.nodeType===9?Ot.body:Ot.nodeName==="HTML"?Ot.ownerDocument.body:Ot).removeChild(s.stateNode)}catch(p){wt(s,n,p)}else try{Ot.removeChild(s.stateNode)}catch(p){wt(s,n,p)}break;case 18:Ot!==null&&($n?(t=Ot,Rv(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,s.stateNode),Bs(t)):Rv(Ot,s.stateNode));break;case 4:c=Ot,h=$n,Ot=s.stateNode.containerInfo,$n=!0,yr(t,n,s),Ot=c,$n=h;break;case 0:case 11:case 14:case 15:Yr(2,s,n),Qt||Yr(4,s,n),yr(t,n,s);break;case 1:Qt||(Va(s,n),c=s.stateNode,typeof c.componentWillUnmount=="function"&&Db(s,n,c)),yr(t,n,s);break;case 21:yr(t,n,s);break;case 22:Qt=(c=Qt)||s.memoizedState!==null,yr(t,n,s),Qt=c;break;default:yr(t,n,s)}}function Ib(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Bs(t)}catch(s){wt(n,n.return,s)}}}function jb(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Bs(t)}catch(s){wt(n,n.return,s)}}function aA(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new $b),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new $b),n;default:throw Error(r(435,t.tag))}}function uu(t,n){var s=aA(t);n.forEach(function(c){if(!s.has(c)){s.add(c);var h=fA.bind(null,t,c);c.then(h,h)}})}function Nn(t,n){var s=n.deletions;if(s!==null)for(var c=0;c<s.length;c++){var h=s[c],p=t,w=n,k=w;e:for(;k!==null;){switch(k.tag){case 27:if(ni(k.type)){Ot=k.stateNode,$n=!1;break e}break;case 5:Ot=k.stateNode,$n=!1;break e;case 3:case 4:Ot=k.stateNode.containerInfo,$n=!0;break e}k=k.return}if(Ot===null)throw Error(r(160));zb(p,w,h),Ot=null,$n=!1,p=h.alternate,p!==null&&(p.return=null),h.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Ub(n,t),n=n.sibling}var Da=null;function Ub(t,n){var s=t.alternate,c=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Nn(n,t),Hn(t),c&4&&(Yr(3,t,t.return),fl(3,t),Yr(5,t,t.return));break;case 1:Nn(n,t),Hn(t),c&512&&(Qt||s===null||Va(s,s.return)),c&64&&mr&&(t=t.updateQueue,t!==null&&(c=t.callbacks,c!==null&&(s=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=s===null?c:s.concat(c))));break;case 26:var h=Da;if(Nn(n,t),Hn(t),c&512&&(Qt||s===null||Va(s,s.return)),c&4){var p=s!==null?s.memoizedState:null;if(c=t.memoizedState,s===null)if(c===null)if(t.stateNode===null){e:{c=t.type,s=t.memoizedProps,h=h.ownerDocument||h;t:switch(c){case"title":p=h.getElementsByTagName("title")[0],(!p||p[nr]||p[tn]||p.namespaceURI==="http://www.w3.org/2000/svg"||p.hasAttribute("itemprop"))&&(p=h.createElement(c),h.head.insertBefore(p,h.querySelector("head > title"))),hn(p,c,s),p[tn]=t,Kt(p),c=p;break e;case"link":var w=Uv("link","href",h).get(c+(s.href||""));if(w){for(var k=0;k<w.length;k++)if(p=w[k],p.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&p.getAttribute("rel")===(s.rel==null?null:s.rel)&&p.getAttribute("title")===(s.title==null?null:s.title)&&p.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){w.splice(k,1);break t}}p=h.createElement(c),hn(p,c,s),h.head.appendChild(p);break;case"meta":if(w=Uv("meta","content",h).get(c+(s.content||""))){for(k=0;k<w.length;k++)if(p=w[k],p.getAttribute("content")===(s.content==null?null:""+s.content)&&p.getAttribute("name")===(s.name==null?null:s.name)&&p.getAttribute("property")===(s.property==null?null:s.property)&&p.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&p.getAttribute("charset")===(s.charSet==null?null:s.charSet)){w.splice(k,1);break t}}p=h.createElement(c),hn(p,c,s),h.head.appendChild(p);break;default:throw Error(r(468,c))}p[tn]=t,Kt(p),c=p}t.stateNode=c}else Bv(h,t.type,t.stateNode);else t.stateNode=jv(h,c,t.memoizedProps);else p!==c?(p===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):p.count--,c===null?Bv(h,t.type,t.stateNode):jv(h,c,t.memoizedProps)):c===null&&t.stateNode!==null&&_h(t,t.memoizedProps,s.memoizedProps)}break;case 27:Nn(n,t),Hn(t),c&512&&(Qt||s===null||Va(s,s.return)),s!==null&&c&4&&_h(t,t.memoizedProps,s.memoizedProps);break;case 5:if(Nn(n,t),Hn(t),c&512&&(Qt||s===null||Va(s,s.return)),t.flags&32){h=t.stateNode;try{$r(h,"")}catch(Te){wt(t,t.return,Te)}}c&4&&t.stateNode!=null&&(h=t.memoizedProps,_h(t,h,s!==null?s.memoizedProps:h)),c&1024&&(Th=!0);break;case 6:if(Nn(n,t),Hn(t),c&4){if(t.stateNode===null)throw Error(r(162));c=t.memoizedProps,s=t.stateNode;try{s.nodeValue=c}catch(Te){wt(t,t.return,Te)}}break;case 3:if(xu=null,h=Da,Da=_u(n.containerInfo),Nn(n,t),Da=h,Hn(t),c&4&&s!==null&&s.memoizedState.isDehydrated)try{Bs(n.containerInfo)}catch(Te){wt(t,t.return,Te)}Th&&(Th=!1,Bb(t));break;case 4:c=Da,Da=_u(t.stateNode.containerInfo),Nn(n,t),Hn(t),Da=c;break;case 12:Nn(n,t),Hn(t);break;case 31:Nn(n,t),Hn(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,uu(t,c)));break;case 13:Nn(n,t),Hn(t),t.child.flags&8192&&t.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(fu=Vt()),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,uu(t,c)));break;case 22:h=t.memoizedState!==null;var I=s!==null&&s.memoizedState!==null,W=mr,ae=Qt;if(mr=W||h,Qt=ae||I,Nn(n,t),Qt=ae,mr=W,Hn(t),c&8192)e:for(n=t.stateNode,n._visibility=h?n._visibility&-2:n._visibility|1,h&&(s===null||I||mr||Qt||zi(t)),s=null,n=t;;){if(n.tag===5||n.tag===26){if(s===null){I=s=n;try{if(p=I.stateNode,h)w=p.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{k=I.stateNode;var ce=I.memoizedProps.style,X=ce!=null&&ce.hasOwnProperty("display")?ce.display:null;k.style.display=X==null||typeof X=="boolean"?"":(""+X).trim()}}catch(Te){wt(I,I.return,Te)}}}else if(n.tag===6){if(s===null){I=n;try{I.stateNode.nodeValue=h?"":I.memoizedProps}catch(Te){wt(I,I.return,Te)}}}else if(n.tag===18){if(s===null){I=n;try{var ee=I.stateNode;h?Dv(ee,!0):Dv(I.stateNode,!1)}catch(Te){wt(I,I.return,Te)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===t)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break e;for(;n.sibling===null;){if(n.return===null||n.return===t)break e;s===n&&(s=null),n=n.return}s===n&&(s=null),n.sibling.return=n.return,n=n.sibling}c&4&&(c=t.updateQueue,c!==null&&(s=c.retryQueue,s!==null&&(c.retryQueue=null,uu(t,s))));break;case 19:Nn(n,t),Hn(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,uu(t,c)));break;case 30:break;case 21:break;default:Nn(n,t),Hn(t)}}function Hn(t){var n=t.flags;if(n&2){try{for(var s,c=t.return;c!==null;){if(Lb(c)){s=c;break}c=c.return}if(s==null)throw Error(r(160));switch(s.tag){case 27:var h=s.stateNode,p=Ah(t);cu(t,p,h);break;case 5:var w=s.stateNode;s.flags&32&&($r(w,""),s.flags&=-33);var k=Ah(t);cu(t,k,w);break;case 3:case 4:var I=s.stateNode.containerInfo,W=Ah(t);xh(t,W,I);break;default:throw Error(r(161))}}catch(ae){wt(t,t.return,ae)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function Bb(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;Bb(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),t=t.sibling}}function br(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Nb(t,n.alternate,n),n=n.sibling}function zi(t){for(t=t.child;t!==null;){var n=t;switch(n.tag){case 0:case 11:case 14:case 15:Yr(4,n,n.return),zi(n);break;case 1:Va(n,n.return);var s=n.stateNode;typeof s.componentWillUnmount=="function"&&Db(n,n.return,s),zi(n);break;case 27:Cl(n.stateNode);case 26:case 5:Va(n,n.return),zi(n);break;case 22:n.memoizedState===null&&zi(n);break;case 30:zi(n);break;default:zi(n)}t=t.sibling}}function vr(t,n,s){for(s=s&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var c=n.alternate,h=t,p=n,w=p.flags;switch(p.tag){case 0:case 11:case 15:vr(h,p,s),fl(4,p);break;case 1:if(vr(h,p,s),c=p,h=c.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(W){wt(c,c.return,W)}if(c=p,h=c.updateQueue,h!==null){var k=c.stateNode;try{var I=h.shared.hiddenCallbacks;if(I!==null)for(h.shared.hiddenCallbacks=null,h=0;h<I.length;h++)by(I[h],k)}catch(W){wt(c,c.return,W)}}s&&w&64&&Rb(p),hl(p,p.return);break;case 27:Mb(p);case 26:case 5:vr(h,p,s),s&&c===null&&w&4&&Ob(p),hl(p,p.return);break;case 12:vr(h,p,s);break;case 31:vr(h,p,s),s&&w&4&&Ib(h,p);break;case 13:vr(h,p,s),s&&w&4&&jb(h,p);break;case 22:p.memoizedState===null&&vr(h,p,s),hl(p,p.return);break;case 30:break;default:vr(h,p,s)}n=n.sibling}}function kh(t,n){var s=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==s&&(t!=null&&t.refCount++,s!=null&&Zo(s))}function Rh(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&Zo(t))}function Oa(t,n,s,c){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)qb(t,n,s,c),n=n.sibling}function qb(t,n,s,c){var h=n.flags;switch(n.tag){case 0:case 11:case 15:Oa(t,n,s,c),h&2048&&fl(9,n);break;case 1:Oa(t,n,s,c);break;case 3:Oa(t,n,s,c),h&2048&&(t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&Zo(t)));break;case 12:if(h&2048){Oa(t,n,s,c),t=n.stateNode;try{var p=n.memoizedProps,w=p.id,k=p.onPostCommit;typeof k=="function"&&k(w,n.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(I){wt(n,n.return,I)}}else Oa(t,n,s,c);break;case 31:Oa(t,n,s,c);break;case 13:Oa(t,n,s,c);break;case 23:break;case 22:p=n.stateNode,w=n.alternate,n.memoizedState!==null?p._visibility&2?Oa(t,n,s,c):gl(t,n):p._visibility&2?Oa(t,n,s,c):(p._visibility|=2,Ds(t,n,s,c,(n.subtreeFlags&10256)!==0||!1)),h&2048&&kh(w,n);break;case 24:Oa(t,n,s,c),h&2048&&Rh(n.alternate,n);break;default:Oa(t,n,s,c)}}function Ds(t,n,s,c,h){for(h=h&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var p=t,w=n,k=s,I=c,W=w.flags;switch(w.tag){case 0:case 11:case 15:Ds(p,w,k,I,h),fl(8,w);break;case 23:break;case 22:var ae=w.stateNode;w.memoizedState!==null?ae._visibility&2?Ds(p,w,k,I,h):gl(p,w):(ae._visibility|=2,Ds(p,w,k,I,h)),h&&W&2048&&kh(w.alternate,w);break;case 24:Ds(p,w,k,I,h),h&&W&2048&&Rh(w.alternate,w);break;default:Ds(p,w,k,I,h)}n=n.sibling}}function gl(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var s=t,c=n,h=c.flags;switch(c.tag){case 22:gl(s,c),h&2048&&kh(c.alternate,c);break;case 24:gl(s,c),h&2048&&Rh(c.alternate,c);break;default:gl(s,c)}n=n.sibling}}var pl=8192;function Os(t,n,s){if(t.subtreeFlags&pl)for(t=t.child;t!==null;)Pb(t,n,s),t=t.sibling}function Pb(t,n,s){switch(t.tag){case 26:Os(t,n,s),t.flags&pl&&t.memoizedState!==null&&PA(s,Da,t.memoizedState,t.memoizedProps);break;case 5:Os(t,n,s);break;case 3:case 4:var c=Da;Da=_u(t.stateNode.containerInfo),Os(t,n,s),Da=c;break;case 22:t.memoizedState===null&&(c=t.alternate,c!==null&&c.memoizedState!==null?(c=pl,pl=16777216,Os(t,n,s),pl=c):Os(t,n,s));break;default:Os(t,n,s)}}function Gb(t){var n=t.alternate;if(n!==null&&(t=n.child,t!==null)){n.child=null;do n=t.sibling,t.sibling=null,t=n;while(t!==null)}}function ml(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var c=n[s];ln=c,Fb(c,t)}Gb(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Vb(t),t=t.sibling}function Vb(t){switch(t.tag){case 0:case 11:case 15:ml(t),t.flags&2048&&Yr(9,t,t.return);break;case 3:ml(t);break;case 12:ml(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,du(t)):ml(t);break;default:ml(t)}}function du(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var c=n[s];ln=c,Fb(c,t)}Gb(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:Yr(8,n,n.return),du(n);break;case 22:s=n.stateNode,s._visibility&2&&(s._visibility&=-3,du(n));break;default:du(n)}t=t.sibling}}function Fb(t,n){for(;ln!==null;){var s=ln;switch(s.tag){case 0:case 11:case 15:Yr(8,s,n);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var c=s.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Zo(s.memoizedState.cache)}if(c=s.child,c!==null)c.return=s,ln=c;else e:for(s=t;ln!==null;){c=ln;var h=c.sibling,p=c.return;if(Hb(c),c===s){ln=null;break e}if(h!==null){h.return=p,ln=h;break e}ln=p}}}var rA={getCacheForType:function(t){var n=dn(Wt),s=n.data.get(t);return s===void 0&&(s=t(),n.data.set(t,s)),s},cacheSignal:function(){return dn(Wt).controller.signal}},iA=typeof WeakMap=="function"?WeakMap:Map,mt=0,xt=null,et=null,rt=0,St=0,Xn=null,Xr=!1,Ls=!1,Dh=!1,Sr=0,It=0,Qr=0,Ii=0,Oh=0,Qn=0,Ms=0,yl=null,zn=null,Lh=!1,fu=0,Kb=0,hu=1/0,gu=null,Jr=null,an=0,Zr=null,$s=null,wr=0,Mh=0,$h=null,Wb=null,bl=0,Nh=null;function Jn(){return(mt&2)!==0&&rt!==0?rt&-rt:J.T!==null?Bh():Ft()}function Yb(){if(Qn===0)if((rt&536870912)===0||lt){var t=ve;ve<<=1,(ve&3932160)===0&&(ve=262144),Qn=t}else Qn=536870912;return t=Wn.current,t!==null&&(t.flags|=32),Qn}function In(t,n,s){(t===xt&&(St===2||St===9)||t.cancelPendingCommit!==null)&&(Ns(t,0),ei(t,rt,Qn,!1)),qe(t,s),((mt&2)===0||t!==xt)&&(t===xt&&((mt&2)===0&&(Ii|=s),It===4&&ei(t,rt,Qn,!1)),Fa(t))}function Xb(t,n,s){if((mt&6)!==0)throw Error(r(327));var c=!s&&(n&127)===0&&(n&t.expiredLanes)===0||$e(t,n),h=c?lA(t,n):zh(t,n,!0),p=c;do{if(h===0){Ls&&!c&&ei(t,n,0,!1);break}else{if(s=t.current.alternate,p&&!sA(s)){h=zh(t,n,!1),p=!1;continue}if(h===2){if(p=n,t.errorRecoveryDisabledLanes&p)var w=0;else w=t.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){n=w;e:{var k=t;h=yl;var I=k.current.memoizedState.isDehydrated;if(I&&(Ns(k,w).flags|=256),w=zh(k,w,!1),w!==2){if(Dh&&!I){k.errorRecoveryDisabledLanes|=p,Ii|=p,h=4;break e}p=zn,zn=h,p!==null&&(zn===null?zn=p:zn.push.apply(zn,p))}h=w}if(p=!1,h!==2)continue}}if(h===1){Ns(t,0),ei(t,n,0,!0);break}e:{switch(c=t,p=h,p){case 0:case 1:throw Error(r(345));case 4:if((n&4194048)!==n)break;case 6:ei(c,n,Qn,!Xr);break e;case 2:zn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((n&62914560)===n&&(h=fu+300-Vt(),10<h)){if(ei(c,n,Qn,!Xr),Be(c,0,!0)!==0)break e;wr=n,c.timeoutHandle=Tv(Qb.bind(null,c,s,zn,gu,Lh,n,Qn,Ii,Ms,Xr,p,"Throttled",-0,0),h);break e}Qb(c,s,zn,gu,Lh,n,Qn,Ii,Ms,Xr,p,null,-0,0)}}break}while(!0);Fa(t)}function Qb(t,n,s,c,h,p,w,k,I,W,ae,ce,X,ee){if(t.timeoutHandle=-1,ce=n.subtreeFlags,ce&8192||(ce&16785408)===16785408){ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:aa},Pb(n,p,ce);var Te=(p&62914560)===p?fu-Vt():(p&4194048)===p?Kb-Vt():0;if(Te=GA(ce,Te),Te!==null){wr=p,t.cancelPendingCommit=Te(iv.bind(null,t,n,p,s,c,h,w,k,I,ae,ce,null,X,ee)),ei(t,p,w,!W);return}}iv(t,n,p,s,c,h,w,k,I)}function sA(t){for(var n=t;;){var s=n.tag;if((s===0||s===11||s===15)&&n.flags&16384&&(s=n.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var c=0;c<s.length;c++){var h=s[c],p=h.getSnapshot;h=h.value;try{if(!Fn(p(),h))return!1}catch{return!1}}if(s=n.child,n.subtreeFlags&16384&&s!==null)s.return=n,n=s;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function ei(t,n,s,c){n&=~Oh,n&=~Ii,t.suspendedLanes|=n,t.pingedLanes&=~n,c&&(t.warmLanes|=n),c=t.expirationTimes;for(var h=n;0<h;){var p=31-q(h),w=1<<p;c[p]=-1,h&=~w}s!==0&&Ee(t,s,n)}function pu(){return(mt&6)===0?(vl(0),!1):!0}function Hh(){if(et!==null){if(St===0)var t=et.return;else t=et,ur=Ri=null,Jf(t),As=null,tl=0,t=et;for(;t!==null;)kb(t.alternate,t),t=t.return;et=null}}function Ns(t,n){var s=t.timeoutHandle;s!==-1&&(t.timeoutHandle=-1,xA(s)),s=t.cancelPendingCommit,s!==null&&(t.cancelPendingCommit=null,s()),wr=0,Hh(),xt=t,et=s=lr(t.current,null),rt=n,St=0,Xn=null,Xr=!1,Ls=$e(t,n),Dh=!1,Ms=Qn=Oh=Ii=Qr=It=0,zn=yl=null,Lh=!1,(n&8)!==0&&(n|=n&32);var c=t.entangledLanes;if(c!==0)for(t=t.entanglements,c&=n;0<c;){var h=31-q(c),p=1<<h;n|=t[h],c&=~p}return Sr=n,Hc(),s}function Jb(t,n){Xe=null,J.H=cl,n===_s||n===Gc?(n=gy(),St=3):n===Uf?(n=gy(),St=4):St=n===gh?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Xn=n,et===null&&(It=1,ru(t,ia(n,t.current)))}function Zb(){var t=Wn.current;return t===null?!0:(rt&4194048)===rt?ca===null:(rt&62914560)===rt||(rt&536870912)!==0?t===ca:!1}function ev(){var t=J.H;return J.H=cl,t===null?cl:t}function tv(){var t=J.A;return J.A=rA,t}function mu(){It=4,Xr||(rt&4194048)!==rt&&Wn.current!==null||(Ls=!0),(Qr&134217727)===0&&(Ii&134217727)===0||xt===null||ei(xt,rt,Qn,!1)}function zh(t,n,s){var c=mt;mt|=2;var h=ev(),p=tv();(xt!==t||rt!==n)&&(gu=null,Ns(t,n)),n=!1;var w=It;e:do try{if(St!==0&&et!==null){var k=et,I=Xn;switch(St){case 8:Hh(),w=6;break e;case 3:case 2:case 9:case 6:Wn.current===null&&(n=!0);var W=St;if(St=0,Xn=null,Hs(t,k,I,W),s&&Ls){w=0;break e}break;default:W=St,St=0,Xn=null,Hs(t,k,I,W)}}oA(),w=It;break}catch(ae){Jb(t,ae)}while(!0);return n&&t.shellSuspendCounter++,ur=Ri=null,mt=c,J.H=h,J.A=p,et===null&&(xt=null,rt=0,Hc()),w}function oA(){for(;et!==null;)nv(et)}function lA(t,n){var s=mt;mt|=2;var c=ev(),h=tv();xt!==t||rt!==n?(gu=null,hu=Vt()+500,Ns(t,n)):Ls=$e(t,n);e:do try{if(St!==0&&et!==null){n=et;var p=Xn;t:switch(St){case 1:St=0,Xn=null,Hs(t,n,p,1);break;case 2:case 9:if(fy(p)){St=0,Xn=null,av(n);break}n=function(){St!==2&&St!==9||xt!==t||(St=7),Fa(t)},p.then(n,n);break e;case 3:St=7;break e;case 4:St=5;break e;case 7:fy(p)?(St=0,Xn=null,av(n)):(St=0,Xn=null,Hs(t,n,p,7));break;case 5:var w=null;switch(et.tag){case 26:w=et.memoizedState;case 5:case 27:var k=et;if(w?qv(w):k.stateNode.complete){St=0,Xn=null;var I=k.sibling;if(I!==null)et=I;else{var W=k.return;W!==null?(et=W,yu(W)):et=null}break t}}St=0,Xn=null,Hs(t,n,p,5);break;case 6:St=0,Xn=null,Hs(t,n,p,6);break;case 8:Hh(),It=6;break e;default:throw Error(r(462))}}cA();break}catch(ae){Jb(t,ae)}while(!0);return ur=Ri=null,J.H=c,J.A=h,mt=s,et!==null?0:(xt=null,rt=0,Hc(),It)}function cA(){for(;et!==null&&!_a();)nv(et)}function nv(t){var n=xb(t.alternate,t,Sr);t.memoizedProps=t.pendingProps,n===null?yu(t):et=n}function av(t){var n=t,s=n.alternate;switch(n.tag){case 15:case 0:n=Sb(s,n,n.pendingProps,n.type,void 0,rt);break;case 11:n=Sb(s,n,n.pendingProps,n.type.render,n.ref,rt);break;case 5:Jf(n);default:kb(s,n),n=et=ty(n,Sr),n=xb(s,n,Sr)}t.memoizedProps=t.pendingProps,n===null?yu(t):et=n}function Hs(t,n,s,c){ur=Ri=null,Jf(n),As=null,tl=0;var h=n.return;try{if(Q_(t,h,n,s,rt)){It=1,ru(t,ia(s,t.current)),et=null;return}}catch(p){if(h!==null)throw et=h,p;It=1,ru(t,ia(s,t.current)),et=null;return}n.flags&32768?(lt||c===1?t=!0:Ls||(rt&536870912)!==0?t=!1:(Xr=t=!0,(c===2||c===9||c===3||c===6)&&(c=Wn.current,c!==null&&c.tag===13&&(c.flags|=16384))),rv(n,t)):yu(n)}function yu(t){var n=t;do{if((n.flags&32768)!==0){rv(n,Xr);return}t=n.return;var s=eA(n.alternate,n,Sr);if(s!==null){et=s;return}if(n=n.sibling,n!==null){et=n;return}et=n=t}while(n!==null);It===0&&(It=5)}function rv(t,n){do{var s=tA(t.alternate,t);if(s!==null){s.flags&=32767,et=s;return}if(s=t.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!n&&(t=t.sibling,t!==null)){et=t;return}et=t=s}while(t!==null);It=6,et=null}function iv(t,n,s,c,h,p,w,k,I){t.cancelPendingCommit=null;do bu();while(an!==0);if((mt&6)!==0)throw Error(r(327));if(n!==null){if(n===t.current)throw Error(r(177));if(p=n.lanes|n.childLanes,p|=Af,Ce(t,s,p,w,k,I),t===xt&&(et=xt=null,rt=0),$s=n,Zr=t,wr=s,Mh=p,$h=h,Wb=c,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,hA(en,function(){return uv(),null})):(t.callbackNode=null,t.callbackPriority=0),c=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||c){c=J.T,J.T=null,h=de.p,de.p=2,w=mt,mt|=4;try{nA(t,n,s)}finally{mt=w,de.p=h,J.T=c}}an=1,sv(),ov(),lv()}}function sv(){if(an===1){an=0;var t=Zr,n=$s,s=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||s){s=J.T,J.T=null;var c=de.p;de.p=2;var h=mt;mt|=4;try{Ub(n,t);var p=Yh,w=Fm(t.containerInfo),k=p.focusedElem,I=p.selectionRange;if(w!==k&&k&&k.ownerDocument&&Vm(k.ownerDocument.documentElement,k)){if(I!==null&&Sf(k)){var W=I.start,ae=I.end;if(ae===void 0&&(ae=W),"selectionStart"in k)k.selectionStart=W,k.selectionEnd=Math.min(ae,k.value.length);else{var ce=k.ownerDocument||document,X=ce&&ce.defaultView||window;if(X.getSelection){var ee=X.getSelection(),Te=k.textContent.length,Ue=Math.min(I.start,Te),_t=I.end===void 0?Ue:Math.min(I.end,Te);!ee.extend&&Ue>_t&&(w=_t,_t=Ue,Ue=w);var V=Gm(k,Ue),G=Gm(k,_t);if(V&&G&&(ee.rangeCount!==1||ee.anchorNode!==V.node||ee.anchorOffset!==V.offset||ee.focusNode!==G.node||ee.focusOffset!==G.offset)){var K=ce.createRange();K.setStart(V.node,V.offset),ee.removeAllRanges(),Ue>_t?(ee.addRange(K),ee.extend(G.node,G.offset)):(K.setEnd(G.node,G.offset),ee.addRange(K))}}}}for(ce=[],ee=k;ee=ee.parentNode;)ee.nodeType===1&&ce.push({element:ee,left:ee.scrollLeft,top:ee.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<ce.length;k++){var se=ce[k];se.element.scrollLeft=se.left,se.element.scrollTop=se.top}}Du=!!Wh,Yh=Wh=null}finally{mt=h,de.p=c,J.T=s}}t.current=n,an=2}}function ov(){if(an===2){an=0;var t=Zr,n=$s,s=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||s){s=J.T,J.T=null;var c=de.p;de.p=2;var h=mt;mt|=4;try{Nb(t,n.alternate,n)}finally{mt=h,de.p=c,J.T=s}}an=3}}function lv(){if(an===4||an===3){an=0,Pn();var t=Zr,n=$s,s=wr,c=Wb;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?an=5:(an=0,$s=Zr=null,cv(t,t.pendingLanes));var h=t.pendingLanes;if(h===0&&(Jr=null),yn(s),n=n.stateNode,Bt&&typeof Bt.onCommitFiberRoot=="function")try{Bt.onCommitFiberRoot(Vn,n,void 0,(n.current.flags&128)===128)}catch{}if(c!==null){n=J.T,h=de.p,de.p=2,J.T=null;try{for(var p=t.onRecoverableError,w=0;w<c.length;w++){var k=c[w];p(k.value,{componentStack:k.stack})}}finally{J.T=n,de.p=h}}(wr&3)!==0&&bu(),Fa(t),h=t.pendingLanes,(s&261930)!==0&&(h&42)!==0?t===Nh?bl++:(bl=0,Nh=t):bl=0,vl(0)}}function cv(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,Zo(n)))}function bu(){return sv(),ov(),lv(),uv()}function uv(){if(an!==5)return!1;var t=Zr,n=Mh;Mh=0;var s=yn(wr),c=J.T,h=de.p;try{de.p=32>s?32:s,J.T=null,s=$h,$h=null;var p=Zr,w=wr;if(an=0,$s=Zr=null,wr=0,(mt&6)!==0)throw Error(r(331));var k=mt;if(mt|=4,Vb(p.current),qb(p,p.current,w,s),mt=k,vl(0,!1),Bt&&typeof Bt.onPostCommitFiberRoot=="function")try{Bt.onPostCommitFiberRoot(Vn,p)}catch{}return!0}finally{de.p=h,J.T=c,cv(t,n)}}function dv(t,n,s){n=ia(s,n),n=hh(t.stateNode,n,2),t=Fr(t,n,2),t!==null&&(qe(t,2),Fa(t))}function wt(t,n,s){if(t.tag===3)dv(t,t,s);else for(;n!==null;){if(n.tag===3){dv(n,t,s);break}else if(n.tag===1){var c=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Jr===null||!Jr.has(c))){t=ia(s,t),s=fb(2),c=Fr(n,s,2),c!==null&&(hb(s,c,n,t),qe(c,2),Fa(c));break}}n=n.return}}function Ih(t,n,s){var c=t.pingCache;if(c===null){c=t.pingCache=new iA;var h=new Set;c.set(n,h)}else h=c.get(n),h===void 0&&(h=new Set,c.set(n,h));h.has(s)||(Dh=!0,h.add(s),t=uA.bind(null,t,n,s),n.then(t,t))}function uA(t,n,s){var c=t.pingCache;c!==null&&c.delete(n),t.pingedLanes|=t.suspendedLanes&s,t.warmLanes&=~s,xt===t&&(rt&s)===s&&(It===4||It===3&&(rt&62914560)===rt&&300>Vt()-fu?(mt&2)===0&&Ns(t,0):Oh|=s,Ms===rt&&(Ms=0)),Fa(t)}function fv(t,n){n===0&&(n=xe()),t=xi(t,n),t!==null&&(qe(t,n),Fa(t))}function dA(t){var n=t.memoizedState,s=0;n!==null&&(s=n.retryLane),fv(t,s)}function fA(t,n){var s=0;switch(t.tag){case 31:case 13:var c=t.stateNode,h=t.memoizedState;h!==null&&(s=h.retryLane);break;case 19:c=t.stateNode;break;case 22:c=t.stateNode._retryCache;break;default:throw Error(r(314))}c!==null&&c.delete(n),fv(t,s)}function hA(t,n){return Ut(t,n)}var vu=null,zs=null,jh=!1,Su=!1,Uh=!1,ti=0;function Fa(t){t!==zs&&t.next===null&&(zs===null?vu=zs=t:zs=zs.next=t),Su=!0,jh||(jh=!0,pA())}function vl(t,n){if(!Uh&&Su){Uh=!0;do for(var s=!1,c=vu;c!==null;){if(t!==0){var h=c.pendingLanes;if(h===0)var p=0;else{var w=c.suspendedLanes,k=c.pingedLanes;p=(1<<31-q(42|t)+1)-1,p&=h&~(w&~k),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(s=!0,mv(c,p))}else p=rt,p=Be(c,c===xt?p:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(p&3)===0||$e(c,p)||(s=!0,mv(c,p));c=c.next}while(s);Uh=!1}}function gA(){hv()}function hv(){Su=jh=!1;var t=0;ti!==0&&AA()&&(t=ti);for(var n=Vt(),s=null,c=vu;c!==null;){var h=c.next,p=gv(c,n);p===0?(c.next=null,s===null?vu=h:s.next=h,h===null&&(zs=s)):(s=c,(t!==0||(p&3)!==0)&&(Su=!0)),c=h}an!==0&&an!==5||vl(t),ti!==0&&(ti=0)}function gv(t,n){for(var s=t.suspendedLanes,c=t.pingedLanes,h=t.expirationTimes,p=t.pendingLanes&-62914561;0<p;){var w=31-q(p),k=1<<w,I=h[w];I===-1?((k&s)===0||(k&c)!==0)&&(h[w]=Re(k,n)):I<=n&&(t.expiredLanes|=k),p&=~k}if(n=xt,s=rt,s=Be(t,t===n?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c=t.callbackNode,s===0||t===n&&(St===2||St===9)||t.cancelPendingCommit!==null)return c!==null&&c!==null&&Rn(c),t.callbackNode=null,t.callbackPriority=0;if((s&3)===0||$e(t,s)){if(n=s&-s,n===t.callbackPriority)return n;switch(c!==null&&Rn(c),yn(s)){case 2:case 8:s=Gn;break;case 32:s=en;break;case 268435456:s=ta;break;default:s=en}return c=pv.bind(null,t),s=Ut(s,c),t.callbackPriority=n,t.callbackNode=s,n}return c!==null&&c!==null&&Rn(c),t.callbackPriority=2,t.callbackNode=null,2}function pv(t,n){if(an!==0&&an!==5)return t.callbackNode=null,t.callbackPriority=0,null;var s=t.callbackNode;if(bu()&&t.callbackNode!==s)return null;var c=rt;return c=Be(t,t===xt?c:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c===0?null:(Xb(t,c,n),gv(t,Vt()),t.callbackNode!=null&&t.callbackNode===s?pv.bind(null,t):null)}function mv(t,n){if(bu())return null;Xb(t,n,!0)}function pA(){TA(function(){(mt&6)!==0?Ut(er,gA):hv()})}function Bh(){if(ti===0){var t=Cs;t===0&&(t=he,he<<=1,(he&261888)===0&&(he=256)),ti=t}return ti}function yv(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:ls(""+t)}function bv(t,n){var s=n.ownerDocument.createElement("input");return s.name=n.name,s.value=n.value,t.id&&s.setAttribute("form",t.id),n.parentNode.insertBefore(s,n),t=new FormData(t),s.parentNode.removeChild(s),t}function mA(t,n,s,c,h){if(n==="submit"&&s&&s.stateNode===h){var p=yv((h[cn]||null).action),w=c.submitter;w&&(n=(n=w[cn]||null)?yv(n.formAction):w.getAttribute("formAction"),n!==null&&(p=n,w=null));var k=new ds("action","action",null,c,h);t.push({event:k,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(ti!==0){var I=w?bv(h,w):new FormData(h);oh(s,{pending:!0,data:I,method:h.method,action:p},null,I)}}else typeof p=="function"&&(k.preventDefault(),I=w?bv(h,w):new FormData(h),oh(s,{pending:!0,data:I,method:h.method,action:p},p,I))},currentTarget:h}]})}}for(var qh=0;qh<_f.length;qh++){var Ph=_f[qh],yA=Ph.toLowerCase(),bA=Ph[0].toUpperCase()+Ph.slice(1);Ra(yA,"on"+bA)}Ra(Ym,"onAnimationEnd"),Ra(Xm,"onAnimationIteration"),Ra(Qm,"onAnimationStart"),Ra("dblclick","onDoubleClick"),Ra("focusin","onFocus"),Ra("focusout","onBlur"),Ra($_,"onTransitionRun"),Ra(N_,"onTransitionStart"),Ra(H_,"onTransitionCancel"),Ra(Jm,"onTransitionEnd"),Lr("onMouseEnter",["mouseout","mouseover"]),Lr("onMouseLeave",["mouseout","mouseover"]),Lr("onPointerEnter",["pointerout","pointerover"]),Lr("onPointerLeave",["pointerout","pointerover"]),ar("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ar("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ar("onBeforeInput",["compositionend","keypress","textInput","paste"]),ar("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ar("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ar("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Sl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),vA=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Sl));function vv(t,n){n=(n&4)!==0;for(var s=0;s<t.length;s++){var c=t[s],h=c.event;c=c.listeners;e:{var p=void 0;if(n)for(var w=c.length-1;0<=w;w--){var k=c[w],I=k.instance,W=k.currentTarget;if(k=k.listener,I!==p&&h.isPropagationStopped())break e;p=k,h.currentTarget=W;try{p(h)}catch(ae){Nc(ae)}h.currentTarget=null,p=I}else for(w=0;w<c.length;w++){if(k=c[w],I=k.instance,W=k.currentTarget,k=k.listener,I!==p&&h.isPropagationStopped())break e;p=k,h.currentTarget=W;try{p(h)}catch(ae){Nc(ae)}h.currentTarget=null,p=I}}}}function tt(t,n){var s=n[_o];s===void 0&&(s=n[_o]=new Set);var c=t+"__bubble";s.has(c)||(Sv(n,t,2,!1),s.add(c))}function Gh(t,n,s){var c=0;n&&(c|=4),Sv(s,t,c,n)}var wu="_reactListening"+Math.random().toString(36).slice(2);function Vh(t){if(!t[wu]){t[wu]=!0,vc.forEach(function(s){s!=="selectionchange"&&(vA.has(s)||Gh(s,!1,t),Gh(s,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[wu]||(n[wu]=!0,Gh("selectionchange",!1,n))}}function Sv(t,n,s,c){switch(Yv(n)){case 2:var h=KA;break;case 8:h=WA;break;default:h=sg}s=h.bind(null,n,s,t),h=void 0,!$o||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(h=!0),c?h!==void 0?t.addEventListener(n,s,{capture:!0,passive:h}):t.addEventListener(n,s,!0):h!==void 0?t.addEventListener(n,s,{passive:h}):t.addEventListener(n,s,!1)}function Fh(t,n,s,c,h){var p=c;if((n&1)===0&&(n&2)===0&&c!==null)e:for(;;){if(c===null)return;var w=c.tag;if(w===3||w===4){var k=c.stateNode.containerInfo;if(k===h)break;if(w===4)for(w=c.return;w!==null;){var I=w.tag;if((I===3||I===4)&&w.stateNode.containerInfo===h)return;w=w.return}for(;k!==null;){if(w=Dr(k),w===null)return;if(I=w.tag,I===5||I===6||I===26||I===27){c=p=w;continue e}k=k.parentNode}}c=c.return}Ac(function(){var W=p,ae=cs(s),ce=[];e:{var X=Zm.get(t);if(X!==void 0){var ee=ds,Te=t;switch(t){case"keypress":if(zr(s)===0)break e;case"keydown":case"keyup":ee=nn;break;case"focusin":Te="focus",ee=Io;break;case"focusout":Te="blur",ee=Io;break;case"beforeblur":case"afterblur":ee=Io;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ee=Tc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ee=sf;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ee=y;break;case Ym:case Xm:case Qm:ee=cf;break;case Jm:ee=R;break;case"scroll":case"scrollend":ee=rf;break;case"wheel":ee=ie;break;case"copy":case"cut":case"paste":ee=df;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ee=Rc;break;case"toggle":case"beforetoggle":ee=ke}var Ue=(n&4)!==0,_t=!Ue&&(t==="scroll"||t==="scrollend"),V=Ue?X!==null?X+"Capture":null:X;Ue=[];for(var G=W,K;G!==null;){var se=G;if(K=se.stateNode,se=se.tag,se!==5&&se!==26&&se!==27||K===null||V===null||(se=vi(G,V),se!=null&&Ue.push(wl(G,se,K))),_t)break;G=G.return}0<Ue.length&&(X=new ee(X,Te,null,s,ae),ce.push({event:X,listeners:Ue}))}}if((n&7)===0){e:{if(X=t==="mouseover"||t==="pointerover",ee=t==="mouseout"||t==="pointerout",X&&s!==Lo&&(Te=s.relatedTarget||s.fromElement)&&(Dr(Te)||Te[On]))break e;if((ee||X)&&(X=ae.window===ae?ae:(X=ae.ownerDocument)?X.defaultView||X.parentWindow:window,ee?(Te=s.relatedTarget||s.toElement,ee=W,Te=Te?Dr(Te):null,Te!==null&&(_t=o(Te),Ue=Te.tag,Te!==_t||Ue!==5&&Ue!==27&&Ue!==6)&&(Te=null)):(ee=null,Te=W),ee!==Te)){if(Ue=Tc,se="onMouseLeave",V="onMouseEnter",G="mouse",(t==="pointerout"||t==="pointerover")&&(Ue=Rc,se="onPointerLeave",V="onPointerEnter",G="pointer"),_t=ee==null?X:yi(ee),K=Te==null?X:yi(Te),X=new Ue(se,G+"leave",ee,s,ae),X.target=_t,X.relatedTarget=K,se=null,Dr(ae)===W&&(Ue=new Ue(V,G+"enter",Te,s,ae),Ue.target=K,Ue.relatedTarget=_t,se=Ue),_t=se,ee&&Te)t:{for(Ue=SA,V=ee,G=Te,K=0,se=V;se;se=Ue(se))K++;se=0;for(var ze=G;ze;ze=Ue(ze))se++;for(;0<K-se;)V=Ue(V),K--;for(;0<se-K;)G=Ue(G),se--;for(;K--;){if(V===G||G!==null&&V===G.alternate){Ue=V;break t}V=Ue(V),G=Ue(G)}Ue=null}else Ue=null;ee!==null&&wv(ce,X,ee,Ue,!1),Te!==null&&_t!==null&&wv(ce,_t,Te,Ue,!0)}}e:{if(X=W?yi(W):window,ee=X.nodeName&&X.nodeName.toLowerCase(),ee==="select"||ee==="input"&&X.type==="file")var ft=Mc;else if(Po(X))if($c)ft=O_;else{ft=R_;var De=k_}else ee=X.nodeName,!ee||ee.toLowerCase()!=="input"||X.type!=="checkbox"&&X.type!=="radio"?W&&Oo(W.elementType)&&(ft=Mc):ft=D_;if(ft&&(ft=ft(t,W))){Go(ce,ft,s,ae);break e}De&&De(t,X,W),t==="focusout"&&W&&X.type==="number"&&W.memoizedProps.value!=null&&Do(X,"number",X.value)}switch(De=W?yi(W):window,t){case"focusin":(Po(De)||De.contentEditable==="true")&&(gs=De,wf=W,Xo=null);break;case"focusout":Xo=wf=gs=null;break;case"mousedown":Cf=!0;break;case"contextmenu":case"mouseup":case"dragend":Cf=!1,Km(ce,s,ae);break;case"selectionchange":if(M_)break;case"keydown":case"keyup":Km(ce,s,ae)}var Qe;if(at)e:{switch(t){case"compositionstart":var it="onCompositionStart";break e;case"compositionend":it="onCompositionEnd";break e;case"compositionupdate":it="onCompositionUpdate";break e}it=void 0}else Ir?Oc(t,s)&&(it="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(it="onCompositionStart");it&&(Ci&&s.locale!=="ko"&&(Ir||it!=="onCompositionStart"?it==="onCompositionEnd"&&Ir&&(Qe=Ge()):(ka=ae,No="value"in ka?ka.value:ka.textContent,Ir=!0)),De=Cu(W,it),0<De.length&&(it=new kc(it,t,null,s,ae),ce.push({event:it,listeners:De}),Qe?it.data=Qe:(Qe=qo(s),Qe!==null&&(it.data=Qe)))),(Qe=Ht?Lc(t,s):bf(t,s))&&(it=Cu(W,"onBeforeInput"),0<it.length&&(De=new kc("onBeforeInput","beforeinput",null,s,ae),ce.push({event:De,listeners:it}),De.data=Qe)),mA(ce,t,W,s,ae)}vv(ce,n)})}function wl(t,n,s){return{instance:t,listener:n,currentTarget:s}}function Cu(t,n){for(var s=n+"Capture",c=[];t!==null;){var h=t,p=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||p===null||(h=vi(t,s),h!=null&&c.unshift(wl(t,h,p)),h=vi(t,n),h!=null&&c.push(wl(t,h,p))),t.tag===3)return c;t=t.return}return[]}function SA(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function wv(t,n,s,c,h){for(var p=n._reactName,w=[];s!==null&&s!==c;){var k=s,I=k.alternate,W=k.stateNode;if(k=k.tag,I!==null&&I===c)break;k!==5&&k!==26&&k!==27||W===null||(I=W,h?(W=vi(s,p),W!=null&&w.unshift(wl(s,W,I))):h||(W=vi(s,p),W!=null&&w.push(wl(s,W,I)))),s=s.return}w.length!==0&&t.push({event:n,listeners:w})}var wA=/\r\n?/g,CA=/\u0000|\uFFFD/g;function Cv(t){return(typeof t=="string"?t:""+t).replace(wA,`
`).replace(CA,"")}function Ev(t,n){return n=Cv(n),Cv(t)===n}function Et(t,n,s,c,h,p){switch(s){case"children":typeof c=="string"?n==="body"||n==="textarea"&&c===""||$r(t,c):(typeof c=="number"||typeof c=="bigint")&&n!=="body"&&$r(t,""+c);break;case"className":is(t,"class",c);break;case"tabIndex":is(t,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":is(t,s,c);break;case"style":Ba(t,c,p);break;case"data":if(n!=="object"){is(t,"data",c);break}case"src":case"href":if(c===""&&(n!=="a"||s!=="href")){t.removeAttribute(s);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(s);break}c=ls(""+c),t.setAttribute(s,c);break;case"action":case"formAction":if(typeof c=="function"){t.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof p=="function"&&(s==="formAction"?(n!=="input"&&Et(t,n,"name",h.name,h,null),Et(t,n,"formEncType",h.formEncType,h,null),Et(t,n,"formMethod",h.formMethod,h,null),Et(t,n,"formTarget",h.formTarget,h,null)):(Et(t,n,"encType",h.encType,h,null),Et(t,n,"method",h.method,h,null),Et(t,n,"target",h.target,h,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(s);break}c=ls(""+c),t.setAttribute(s,c);break;case"onClick":c!=null&&(t.onclick=aa);break;case"onScroll":c!=null&&tt("scroll",t);break;case"onScrollEnd":c!=null&&tt("scrollend",t);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(r(61));if(s=c.__html,s!=null){if(h.children!=null)throw Error(r(60));t.innerHTML=s}}break;case"multiple":t.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":t.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){t.removeAttribute("xlink:href");break}s=ls(""+c),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(s,""+c):t.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(s,""):t.removeAttribute(s);break;case"capture":case"download":c===!0?t.setAttribute(s,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(s,c):t.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?t.setAttribute(s,c):t.removeAttribute(s);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?t.removeAttribute(s):t.setAttribute(s,c);break;case"popover":tt("beforetoggle",t),tt("toggle",t),rs(t,"popover",c);break;case"xlinkActuate":xa(t,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":xa(t,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":xa(t,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":xa(t,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":xa(t,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":xa(t,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":xa(t,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":xa(t,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":xa(t,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":rs(t,"is",c);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=nf.get(s)||s,rs(t,s,c))}}function Kh(t,n,s,c,h,p){switch(s){case"style":Ba(t,c,p);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(r(61));if(s=c.__html,s!=null){if(h.children!=null)throw Error(r(60));t.innerHTML=s}}break;case"children":typeof c=="string"?$r(t,c):(typeof c=="number"||typeof c=="bigint")&&$r(t,""+c);break;case"onScroll":c!=null&&tt("scroll",t);break;case"onScrollEnd":c!=null&&tt("scrollend",t);break;case"onClick":c!=null&&(t.onclick=aa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Sc.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(h=s.endsWith("Capture"),n=s.slice(2,h?s.length-7:void 0),p=t[cn]||null,p=p!=null?p[s]:null,typeof p=="function"&&t.removeEventListener(n,p,h),typeof c=="function")){typeof p!="function"&&p!==null&&(s in t?t[s]=null:t.hasAttribute(s)&&t.removeAttribute(s)),t.addEventListener(n,c,h);break e}s in t?t[s]=c:c===!0?t.setAttribute(s,""):rs(t,s,c)}}}function hn(t,n,s){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":tt("error",t),tt("load",t);var c=!1,h=!1,p;for(p in s)if(s.hasOwnProperty(p)){var w=s[p];if(w!=null)switch(p){case"src":c=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:Et(t,n,p,w,s,null)}}h&&Et(t,n,"srcSet",s.srcSet,s,null),c&&Et(t,n,"src",s.src,s,null);return;case"input":tt("invalid",t);var k=p=w=h=null,I=null,W=null;for(c in s)if(s.hasOwnProperty(c)){var ae=s[c];if(ae!=null)switch(c){case"name":h=ae;break;case"type":w=ae;break;case"checked":I=ae;break;case"defaultChecked":W=ae;break;case"value":p=ae;break;case"defaultValue":k=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(r(137,n));break;default:Et(t,n,c,ae,s,null)}}wc(t,p,k,I,W,w,h,!1);return;case"select":tt("invalid",t),c=w=p=null;for(h in s)if(s.hasOwnProperty(h)&&(k=s[h],k!=null))switch(h){case"value":p=k;break;case"defaultValue":w=k;break;case"multiple":c=k;default:Et(t,n,h,k,s,null)}n=p,s=w,t.multiple=!!c,n!=null?Mr(t,!!c,n,!1):s!=null&&Mr(t,!!c,s,!0);return;case"textarea":tt("invalid",t),p=h=c=null;for(w in s)if(s.hasOwnProperty(w)&&(k=s[w],k!=null))switch(w){case"value":c=k;break;case"defaultValue":h=k;break;case"children":p=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(r(91));break;default:Et(t,n,w,k,s,null)}Ec(t,c,h,p);return;case"option":for(I in s)if(s.hasOwnProperty(I)&&(c=s[I],c!=null))switch(I){case"selected":t.selected=c&&typeof c!="function"&&typeof c!="symbol";break;default:Et(t,n,I,c,s,null)}return;case"dialog":tt("beforetoggle",t),tt("toggle",t),tt("cancel",t),tt("close",t);break;case"iframe":case"object":tt("load",t);break;case"video":case"audio":for(c=0;c<Sl.length;c++)tt(Sl[c],t);break;case"image":tt("error",t),tt("load",t);break;case"details":tt("toggle",t);break;case"embed":case"source":case"link":tt("error",t),tt("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(W in s)if(s.hasOwnProperty(W)&&(c=s[W],c!=null))switch(W){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:Et(t,n,W,c,s,null)}return;default:if(Oo(n)){for(ae in s)s.hasOwnProperty(ae)&&(c=s[ae],c!==void 0&&Kh(t,n,ae,c,s,void 0));return}}for(k in s)s.hasOwnProperty(k)&&(c=s[k],c!=null&&Et(t,n,k,c,s,null))}function EA(t,n,s,c){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,p=null,w=null,k=null,I=null,W=null,ae=null;for(ee in s){var ce=s[ee];if(s.hasOwnProperty(ee)&&ce!=null)switch(ee){case"checked":break;case"value":break;case"defaultValue":I=ce;default:c.hasOwnProperty(ee)||Et(t,n,ee,null,c,ce)}}for(var X in c){var ee=c[X];if(ce=s[X],c.hasOwnProperty(X)&&(ee!=null||ce!=null))switch(X){case"type":p=ee;break;case"name":h=ee;break;case"checked":W=ee;break;case"defaultChecked":ae=ee;break;case"value":w=ee;break;case"defaultValue":k=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(r(137,n));break;default:ee!==ce&&Et(t,n,X,ee,c,ce)}}ir(t,w,k,I,W,ae,p,h);return;case"select":ee=w=k=X=null;for(p in s)if(I=s[p],s.hasOwnProperty(p)&&I!=null)switch(p){case"value":break;case"multiple":ee=I;default:c.hasOwnProperty(p)||Et(t,n,p,null,c,I)}for(h in c)if(p=c[h],I=s[h],c.hasOwnProperty(h)&&(p!=null||I!=null))switch(h){case"value":X=p;break;case"defaultValue":k=p;break;case"multiple":w=p;default:p!==I&&Et(t,n,h,p,c,I)}n=k,s=w,c=ee,X!=null?Mr(t,!!s,X,!1):!!c!=!!s&&(n!=null?Mr(t,!!s,n,!0):Mr(t,!!s,s?[]:"",!1));return;case"textarea":ee=X=null;for(k in s)if(h=s[k],s.hasOwnProperty(k)&&h!=null&&!c.hasOwnProperty(k))switch(k){case"value":break;case"children":break;default:Et(t,n,k,null,c,h)}for(w in c)if(h=c[w],p=s[w],c.hasOwnProperty(w)&&(h!=null||p!=null))switch(w){case"value":X=h;break;case"defaultValue":ee=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(r(91));break;default:h!==p&&Et(t,n,w,h,c,p)}Cc(t,X,ee);return;case"option":for(var Te in s)if(X=s[Te],s.hasOwnProperty(Te)&&X!=null&&!c.hasOwnProperty(Te))switch(Te){case"selected":t.selected=!1;break;default:Et(t,n,Te,null,c,X)}for(I in c)if(X=c[I],ee=s[I],c.hasOwnProperty(I)&&X!==ee&&(X!=null||ee!=null))switch(I){case"selected":t.selected=X&&typeof X!="function"&&typeof X!="symbol";break;default:Et(t,n,I,X,c,ee)}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 Ue in s)X=s[Ue],s.hasOwnProperty(Ue)&&X!=null&&!c.hasOwnProperty(Ue)&&Et(t,n,Ue,null,c,X);for(W in c)if(X=c[W],ee=s[W],c.hasOwnProperty(W)&&X!==ee&&(X!=null||ee!=null))switch(W){case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(r(137,n));break;default:Et(t,n,W,X,c,ee)}return;default:if(Oo(n)){for(var _t in s)X=s[_t],s.hasOwnProperty(_t)&&X!==void 0&&!c.hasOwnProperty(_t)&&Kh(t,n,_t,void 0,c,X);for(ae in c)X=c[ae],ee=s[ae],!c.hasOwnProperty(ae)||X===ee||X===void 0&&ee===void 0||Kh(t,n,ae,X,c,ee);return}}for(var V in s)X=s[V],s.hasOwnProperty(V)&&X!=null&&!c.hasOwnProperty(V)&&Et(t,n,V,null,c,X);for(ce in c)X=c[ce],ee=s[ce],!c.hasOwnProperty(ce)||X===ee||X==null&&ee==null||Et(t,n,ce,X,c,ee)}function _v(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function _A(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,s=performance.getEntriesByType("resource"),c=0;c<s.length;c++){var h=s[c],p=h.transferSize,w=h.initiatorType,k=h.duration;if(p&&k&&_v(w)){for(w=0,k=h.responseEnd,c+=1;c<s.length;c++){var I=s[c],W=I.startTime;if(W>k)break;var ae=I.transferSize,ce=I.initiatorType;ae&&_v(ce)&&(I=I.responseEnd,w+=ae*(I<k?1:(k-W)/(I-W)))}if(--c,n+=8*(p+w)/(h.duration/1e3),t++,10<t)break}}if(0<t)return n/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Wh=null,Yh=null;function Eu(t){return t.nodeType===9?t:t.ownerDocument}function Av(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 xv(t,n){if(t===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&n==="foreignObject"?0:t}function Xh(t,n){return t==="textarea"||t==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Qh=null;function AA(){var t=window.event;return t&&t.type==="popstate"?t===Qh?!1:(Qh=t,!0):(Qh=null,!1)}var Tv=typeof setTimeout=="function"?setTimeout:void 0,xA=typeof clearTimeout=="function"?clearTimeout:void 0,kv=typeof Promise=="function"?Promise:void 0,TA=typeof queueMicrotask=="function"?queueMicrotask:typeof kv<"u"?function(t){return kv.resolve(null).then(t).catch(kA)}:Tv;function kA(t){setTimeout(function(){throw t})}function ni(t){return t==="head"}function Rv(t,n){var s=n,c=0;do{var h=s.nextSibling;if(t.removeChild(s),h&&h.nodeType===8)if(s=h.data,s==="/$"||s==="/&"){if(c===0){t.removeChild(h),Bs(n);return}c--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")c++;else if(s==="html")Cl(t.ownerDocument.documentElement);else if(s==="head"){s=t.ownerDocument.head,Cl(s);for(var p=s.firstChild;p;){var w=p.nextSibling,k=p.nodeName;p[nr]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&p.rel.toLowerCase()==="stylesheet"||s.removeChild(p),p=w}}else s==="body"&&Cl(t.ownerDocument.body);s=h}while(s);Bs(n)}function Dv(t,n){var s=t;t=0;do{var c=s.nextSibling;if(s.nodeType===1?n?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(n?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),c&&c.nodeType===8)if(s=c.data,s==="/$"){if(t===0)break;t--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||t++;s=c}while(s)}function Jh(t){var n=t.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var s=n;switch(n=n.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Jh(s),Ao(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}t.removeChild(s)}}function RA(t,n,s,c){for(;t.nodeType===1;){var h=s;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!c&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(c){if(!t[nr])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(p=t.getAttribute("rel"),p==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(p!==h.rel||t.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||t.getAttribute("title")!==(h.title==null?null:h.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(p=t.getAttribute("src"),(p!==(h.src==null?null:h.src)||t.getAttribute("type")!==(h.type==null?null:h.type)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&p&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var p=h.name==null?null:""+h.name;if(h.type==="hidden"&&t.getAttribute("name")===p)return t}else return t;if(t=ua(t.nextSibling),t===null)break}return null}function DA(t,n,s){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=ua(t.nextSibling),t===null))return null;return t}function Ov(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=ua(t.nextSibling),t===null))return null;return t}function Zh(t){return t.data==="$?"||t.data==="$~"}function eg(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function OA(t,n){var s=t.ownerDocument;if(t.data==="$~")t._reactRetry=n;else if(t.data!=="$?"||s.readyState!=="loading")n();else{var c=function(){n(),s.removeEventListener("DOMContentLoaded",c)};s.addEventListener("DOMContentLoaded",c),t._reactRetry=c}}function ua(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return t}var tg=null;function Lv(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var s=t.data;if(s==="/$"||s==="/&"){if(n===0)return ua(t.nextSibling);n--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||n++}t=t.nextSibling}return null}function Mv(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var s=t.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(n===0)return t;n--}else s!=="/$"&&s!=="/&"||n++}t=t.previousSibling}return null}function $v(t,n,s){switch(n=Eu(s),t){case"html":if(t=n.documentElement,!t)throw Error(r(452));return t;case"head":if(t=n.head,!t)throw Error(r(453));return t;case"body":if(t=n.body,!t)throw Error(r(454));return t;default:throw Error(r(451))}}function Cl(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Ao(t)}var da=new Map,Nv=new Set;function _u(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Cr=de.d;de.d={f:LA,r:MA,D:$A,C:NA,L:HA,m:zA,X:jA,S:IA,M:UA};function LA(){var t=Cr.f(),n=pu();return t||n}function MA(t){var n=Or(t);n!==null&&n.tag===5&&n.type==="form"?Jy(n):Cr.r(t)}var Is=typeof document>"u"?null:document;function Hv(t,n,s){var c=Is;if(c&&typeof n=="string"&&n){var h=Mn(n);h='link[rel="'+t+'"][href="'+h+'"]',typeof s=="string"&&(h+='[crossorigin="'+s+'"]'),Nv.has(h)||(Nv.add(h),t={rel:t,crossOrigin:s,href:n},c.querySelector(h)===null&&(n=c.createElement("link"),hn(n,"link",t),Kt(n),c.head.appendChild(n)))}}function $A(t){Cr.D(t),Hv("dns-prefetch",t,null)}function NA(t,n){Cr.C(t,n),Hv("preconnect",t,n)}function HA(t,n,s){Cr.L(t,n,s);var c=Is;if(c&&t&&n){var h='link[rel="preload"][as="'+Mn(n)+'"]';n==="image"&&s&&s.imageSrcSet?(h+='[imagesrcset="'+Mn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(h+='[imagesizes="'+Mn(s.imageSizes)+'"]')):h+='[href="'+Mn(t)+'"]';var p=h;switch(n){case"style":p=js(t);break;case"script":p=Us(t)}da.has(p)||(t=b({rel:"preload",href:n==="image"&&s&&s.imageSrcSet?void 0:t,as:n},s),da.set(p,t),c.querySelector(h)!==null||n==="style"&&c.querySelector(El(p))||n==="script"&&c.querySelector(_l(p))||(n=c.createElement("link"),hn(n,"link",t),Kt(n),c.head.appendChild(n)))}}function zA(t,n){Cr.m(t,n);var s=Is;if(s&&t){var c=n&&typeof n.as=="string"?n.as:"script",h='link[rel="modulepreload"][as="'+Mn(c)+'"][href="'+Mn(t)+'"]',p=h;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=Us(t)}if(!da.has(p)&&(t=b({rel:"modulepreload",href:t},n),da.set(p,t),s.querySelector(h)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(_l(p)))return}c=s.createElement("link"),hn(c,"link",t),Kt(c),s.head.appendChild(c)}}}function IA(t,n,s){Cr.S(t,n,s);var c=Is;if(c&&t){var h=ja(c).hoistableStyles,p=js(t);n=n||"default";var w=h.get(p);if(!w){var k={loading:0,preload:null};if(w=c.querySelector(El(p)))k.loading=5;else{t=b({rel:"stylesheet",href:t,"data-precedence":n},s),(s=da.get(p))&&ng(t,s);var I=w=c.createElement("link");Kt(I),hn(I,"link",t),I._p=new Promise(function(W,ae){I.onload=W,I.onerror=ae}),I.addEventListener("load",function(){k.loading|=1}),I.addEventListener("error",function(){k.loading|=2}),k.loading|=4,Au(w,n,c)}w={type:"stylesheet",instance:w,count:1,state:k},h.set(p,w)}}}function jA(t,n){Cr.X(t,n);var s=Is;if(s&&t){var c=ja(s).hoistableScripts,h=Us(t),p=c.get(h);p||(p=s.querySelector(_l(h)),p||(t=b({src:t,async:!0},n),(n=da.get(h))&&ag(t,n),p=s.createElement("script"),Kt(p),hn(p,"link",t),s.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},c.set(h,p))}}function UA(t,n){Cr.M(t,n);var s=Is;if(s&&t){var c=ja(s).hoistableScripts,h=Us(t),p=c.get(h);p||(p=s.querySelector(_l(h)),p||(t=b({src:t,async:!0,type:"module"},n),(n=da.get(h))&&ag(t,n),p=s.createElement("script"),Kt(p),hn(p,"link",t),s.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},c.set(h,p))}}function zv(t,n,s,c){var h=(h=ye.current)?_u(h):null;if(!h)throw Error(r(446));switch(t){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(n=js(s.href),s=ja(h).hoistableStyles,c=s.get(n),c||(c={type:"style",instance:null,count:0,state:null},s.set(n,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){t=js(s.href);var p=ja(h).hoistableStyles,w=p.get(t);if(w||(h=h.ownerDocument||h,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},p.set(t,w),(p=h.querySelector(El(t)))&&!p._p&&(w.instance=p,w.state.loading=5),da.has(t)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},da.set(t,s),p||BA(h,t,s,w.state))),n&&c===null)throw Error(r(528,""));return w}if(n&&c!==null)throw Error(r(529,""));return null;case"script":return n=s.async,s=s.src,typeof s=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Us(s),s=ja(h).hoistableScripts,c=s.get(n),c||(c={type:"script",instance:null,count:0,state:null},s.set(n,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,t))}}function js(t){return'href="'+Mn(t)+'"'}function El(t){return'link[rel="stylesheet"]['+t+"]"}function Iv(t){return b({},t,{"data-precedence":t.precedence,precedence:null})}function BA(t,n,s,c){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?c.loading=1:(n=t.createElement("link"),c.preload=n,n.addEventListener("load",function(){return c.loading|=1}),n.addEventListener("error",function(){return c.loading|=2}),hn(n,"link",s),Kt(n),t.head.appendChild(n))}function Us(t){return'[src="'+Mn(t)+'"]'}function _l(t){return"script[async]"+t}function jv(t,n,s){if(n.count++,n.instance===null)switch(n.type){case"style":var c=t.querySelector('style[data-href~="'+Mn(s.href)+'"]');if(c)return n.instance=c,Kt(c),c;var h=b({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return c=(t.ownerDocument||t).createElement("style"),Kt(c),hn(c,"style",h),Au(c,s.precedence,t),n.instance=c;case"stylesheet":h=js(s.href);var p=t.querySelector(El(h));if(p)return n.state.loading|=4,n.instance=p,Kt(p),p;c=Iv(s),(h=da.get(h))&&ng(c,h),p=(t.ownerDocument||t).createElement("link"),Kt(p);var w=p;return w._p=new Promise(function(k,I){w.onload=k,w.onerror=I}),hn(p,"link",c),n.state.loading|=4,Au(p,s.precedence,t),n.instance=p;case"script":return p=Us(s.src),(h=t.querySelector(_l(p)))?(n.instance=h,Kt(h),h):(c=s,(h=da.get(p))&&(c=b({},s),ag(c,h)),t=t.ownerDocument||t,h=t.createElement("script"),Kt(h),hn(h,"link",c),t.head.appendChild(h),n.instance=h);case"void":return null;default:throw Error(r(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(c=n.instance,n.state.loading|=4,Au(c,s.precedence,t));return n.instance}function Au(t,n,s){for(var c=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=c.length?c[c.length-1]:null,p=h,w=0;w<c.length;w++){var k=c[w];if(k.dataset.precedence===n)p=k;else if(p!==h)break}p?p.parentNode.insertBefore(t,p.nextSibling):(n=s.nodeType===9?s.head:s,n.insertBefore(t,n.firstChild))}function ng(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function ag(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var xu=null;function Uv(t,n,s){if(xu===null){var c=new Map,h=xu=new Map;h.set(s,c)}else h=xu,c=h.get(s),c||(c=new Map,h.set(s,c));if(c.has(t))return c;for(c.set(t,null),s=s.getElementsByTagName(t),h=0;h<s.length;h++){var p=s[h];if(!(p[nr]||p[tn]||t==="link"&&p.getAttribute("rel")==="stylesheet")&&p.namespaceURI!=="http://www.w3.org/2000/svg"){var w=p.getAttribute(n)||"";w=t+w;var k=c.get(w);k?k.push(p):c.set(w,[p])}}return c}function Bv(t,n,s){t=t.ownerDocument||t,t.head.insertBefore(s,n==="title"?t.querySelector("head > title"):null)}function qA(t,n,s){if(s===1||n.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return t=n.disabled,typeof n.precedence=="string"&&t==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function qv(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function PA(t,n,s,c){if(s.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var h=js(c.href),p=n.querySelector(El(h));if(p){n=p._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=Tu.bind(t),n.then(t,t)),s.state.loading|=4,s.instance=p,Kt(p);return}p=n.ownerDocument||n,c=Iv(c),(h=da.get(h))&&ng(c,h),p=p.createElement("link"),Kt(p);var w=p;w._p=new Promise(function(k,I){w.onload=k,w.onerror=I}),hn(p,"link",c),s.instance=p}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(s,n),(n=s.state.preload)&&(s.state.loading&3)===0&&(t.count++,s=Tu.bind(t),n.addEventListener("load",s),n.addEventListener("error",s))}}var rg=0;function GA(t,n){return t.stylesheets&&t.count===0&&Ru(t,t.stylesheets),0<t.count||0<t.imgCount?function(s){var c=setTimeout(function(){if(t.stylesheets&&Ru(t,t.stylesheets),t.unsuspend){var p=t.unsuspend;t.unsuspend=null,p()}},6e4+n);0<t.imgBytes&&rg===0&&(rg=62500*_A());var h=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Ru(t,t.stylesheets),t.unsuspend)){var p=t.unsuspend;t.unsuspend=null,p()}},(t.imgBytes>rg?50:800)+n);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(c),clearTimeout(h)}}:null}function Tu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ru(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var ku=null;function Ru(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,ku=new Map,n.forEach(VA,t),ku=null,Tu.call(t))}function VA(t,n){if(!(n.state.loading&4)){var s=ku.get(t);if(s)var c=s.get(null);else{s=new Map,ku.set(t,s);for(var h=t.querySelectorAll("link[data-precedence],style[data-precedence]"),p=0;p<h.length;p++){var w=h[p];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(s.set(w.dataset.precedence,w),c=w)}c&&s.set(null,c)}h=n.instance,w=h.getAttribute("data-precedence"),p=s.get(w)||c,p===c&&s.set(null,h),s.set(w,h),this.count++,c=Tu.bind(this),h.addEventListener("load",c),h.addEventListener("error",c),p?p.parentNode.insertBefore(h,p.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(h,t.firstChild)),n.state.loading|=4}}var Al={$$typeof:O,Provider:null,Consumer:null,_currentValue:me,_currentValue2:me,_threadCount:0};function FA(t,n,s,c,h,p,w,k,I){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=c,this.onUncaughtError=h,this.onCaughtError=p,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=I,this.incompleteTransitions=new Map}function Pv(t,n,s,c,h,p,w,k,I,W,ae,ce){return t=new FA(t,n,s,w,I,W,ae,ce,k),n=1,p===!0&&(n|=24),p=Kn(3,null,null,n),t.current=p,p.stateNode=t,n=zf(),n.refCount++,t.pooledCache=n,n.refCount++,p.memoizedState={element:c,isDehydrated:s,cache:n},Bf(p),t}function Gv(t){return t?(t=ys,t):ys}function Vv(t,n,s,c,h,p){h=Gv(h),c.context===null?c.context=h:c.pendingContext=h,c=Vr(n),c.payload={element:s},p=p===void 0?null:p,p!==null&&(c.callback=p),s=Fr(t,c,n),s!==null&&(In(s,t,n),al(s,t,n))}function Fv(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<n?s:n}}function ig(t,n){Fv(t,n),(t=t.alternate)&&Fv(t,n)}function Kv(t){if(t.tag===13||t.tag===31){var n=xi(t,67108864);n!==null&&In(n,t,67108864),ig(t,67108864)}}function Wv(t){if(t.tag===13||t.tag===31){var n=Jn();n=kt(n);var s=xi(t,n);s!==null&&In(s,t,n),ig(t,n)}}var Du=!0;function KA(t,n,s,c){var h=J.T;J.T=null;var p=de.p;try{de.p=2,sg(t,n,s,c)}finally{de.p=p,J.T=h}}function WA(t,n,s,c){var h=J.T;J.T=null;var p=de.p;try{de.p=8,sg(t,n,s,c)}finally{de.p=p,J.T=h}}function sg(t,n,s,c){if(Du){var h=og(c);if(h===null)Fh(t,n,c,Ou,s),Xv(t,c);else if(XA(h,t,n,s,c))c.stopPropagation();else if(Xv(t,c),n&4&&-1<YA.indexOf(t)){for(;h!==null;){var p=Or(h);if(p!==null)switch(p.tag){case 3:if(p=p.stateNode,p.current.memoizedState.isDehydrated){var w=_e(p.pendingLanes);if(w!==0){var k=p;for(k.pendingLanes|=2,k.entangledLanes|=2;w;){var I=1<<31-q(w);k.entanglements[1]|=I,w&=~I}Fa(p),(mt&6)===0&&(hu=Vt()+500,vl(0))}}break;case 31:case 13:k=xi(p,2),k!==null&&In(k,p,2),pu(),ig(p,2)}if(p=og(c),p===null&&Fh(t,n,c,Ou,s),p===h)break;h=p}h!==null&&c.stopPropagation()}else Fh(t,n,c,null,s)}}function og(t){return t=cs(t),lg(t)}var Ou=null;function lg(t){if(Ou=null,t=Dr(t),t!==null){var n=o(t);if(n===null)t=null;else{var s=n.tag;if(s===13){if(t=u(n),t!==null)return t;t=null}else if(s===31){if(t=d(n),t!==null)return t;t=null}else if(s===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return Ou=t,null}function Yv(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(yt()){case er:return 2;case Gn:return 8;case en:case mn:return 32;case ta:return 268435456;default:return 32}default:return 32}}var cg=!1,ai=null,ri=null,ii=null,xl=new Map,Tl=new Map,si=[],YA="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 Xv(t,n){switch(t){case"focusin":case"focusout":ai=null;break;case"dragenter":case"dragleave":ri=null;break;case"mouseover":case"mouseout":ii=null;break;case"pointerover":case"pointerout":xl.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Tl.delete(n.pointerId)}}function kl(t,n,s,c,h,p){return t===null||t.nativeEvent!==p?(t={blockedOn:n,domEventName:s,eventSystemFlags:c,nativeEvent:p,targetContainers:[h]},n!==null&&(n=Or(n),n!==null&&Kv(n)),t):(t.eventSystemFlags|=c,n=t.targetContainers,h!==null&&n.indexOf(h)===-1&&n.push(h),t)}function XA(t,n,s,c,h){switch(n){case"focusin":return ai=kl(ai,t,n,s,c,h),!0;case"dragenter":return ri=kl(ri,t,n,s,c,h),!0;case"mouseover":return ii=kl(ii,t,n,s,c,h),!0;case"pointerover":var p=h.pointerId;return xl.set(p,kl(xl.get(p)||null,t,n,s,c,h)),!0;case"gotpointercapture":return p=h.pointerId,Tl.set(p,kl(Tl.get(p)||null,t,n,s,c,h)),!0}return!1}function Qv(t){var n=Dr(t.target);if(n!==null){var s=o(n);if(s!==null){if(n=s.tag,n===13){if(n=u(s),n!==null){t.blockedOn=n,na(t.priority,function(){Wv(s)});return}}else if(n===31){if(n=d(s),n!==null){t.blockedOn=n,na(t.priority,function(){Wv(s)});return}}else if(n===3&&s.stateNode.current.memoizedState.isDehydrated){t.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Lu(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var s=og(t.nativeEvent);if(s===null){s=t.nativeEvent;var c=new s.constructor(s.type,s);Lo=c,s.target.dispatchEvent(c),Lo=null}else return n=Or(s),n!==null&&Kv(n),t.blockedOn=s,!1;n.shift()}return!0}function Jv(t,n,s){Lu(t)&&s.delete(n)}function QA(){cg=!1,ai!==null&&Lu(ai)&&(ai=null),ri!==null&&Lu(ri)&&(ri=null),ii!==null&&Lu(ii)&&(ii=null),xl.forEach(Jv),Tl.forEach(Jv)}function Mu(t,n){t.blockedOn===n&&(t.blockedOn=null,cg||(cg=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,QA)))}var $u=null;function Zv(t){$u!==t&&($u=t,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){$u===t&&($u=null);for(var n=0;n<t.length;n+=3){var s=t[n],c=t[n+1],h=t[n+2];if(typeof c!="function"){if(lg(c||s)===null)continue;break}var p=Or(s);p!==null&&(t.splice(n,3),n-=3,oh(p,{pending:!0,data:h,method:s.method,action:c},c,h))}}))}function Bs(t){function n(I){return Mu(I,t)}ai!==null&&Mu(ai,t),ri!==null&&Mu(ri,t),ii!==null&&Mu(ii,t),xl.forEach(n),Tl.forEach(n);for(var s=0;s<si.length;s++){var c=si[s];c.blockedOn===t&&(c.blockedOn=null)}for(;0<si.length&&(s=si[0],s.blockedOn===null);)Qv(s),s.blockedOn===null&&si.shift();if(s=(t.ownerDocument||t).$$reactFormReplay,s!=null)for(c=0;c<s.length;c+=3){var h=s[c],p=s[c+1],w=h[cn]||null;if(typeof p=="function")w||Zv(s);else if(w){var k=null;if(p&&p.hasAttribute("formAction")){if(h=p,w=p[cn]||null)k=w.formAction;else if(lg(h)!==null)continue}else k=w.action;typeof k=="function"?s[c+1]=k:(s.splice(c,3),c-=3),Zv(s)}}}function eS(){function t(p){p.canIntercept&&p.info==="react-transition"&&p.intercept({handler:function(){return new Promise(function(w){return h=w})},focusReset:"manual",scroll:"manual"})}function n(){h!==null&&(h(),h=null),c||setTimeout(s,20)}function s(){if(!c&&!navigation.transition){var p=navigation.currentEntry;p&&p.url!=null&&navigation.navigate(p.url,{state:p.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,h=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(s,100),function(){c=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),h!==null&&(h(),h=null)}}}function ug(t){this._internalRoot=t}Nu.prototype.render=ug.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(r(409));var s=n.current,c=Jn();Vv(s,c,t,n,null,null)},Nu.prototype.unmount=ug.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;Vv(t.current,2,null,t,null,null),pu(),n[On]=null}};function Nu(t){this._internalRoot=t}Nu.prototype.unstable_scheduleHydration=function(t){if(t){var n=Ft();t={blockedOn:null,target:t,priority:n};for(var s=0;s<si.length&&n!==0&&n<si[s].priority;s++);si.splice(s,0,t),s===0&&Qv(t)}};var tS=e.version;if(tS!=="19.2.0")throw Error(r(527,tS,"19.2.0"));de.findDOMNode=function(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(r(188)):(t=Object.keys(t).join(","),Error(r(268,t)));return t=g(n),t=t!==null?m(t):null,t=t===null?null:t.stateNode,t};var JA={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:J,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Hu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hu.isDisabled&&Hu.supportsFiber)try{Vn=Hu.inject(JA),Bt=Hu}catch{}}return qs.createRoot=function(t,n){if(!i(t))throw Error(r(299));var s=!1,c="",h=lb,p=cb,w=ub;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(c=n.identifierPrefix),n.onUncaughtError!==void 0&&(h=n.onUncaughtError),n.onCaughtError!==void 0&&(p=n.onCaughtError),n.onRecoverableError!==void 0&&(w=n.onRecoverableError)),n=Pv(t,1,!1,null,null,s,c,null,h,p,w,eS),t[On]=n.current,Vh(t),new ug(n)},qs.hydrateRoot=function(t,n,s){if(!i(t))throw Error(r(299));var c=!1,h="",p=lb,w=cb,k=ub,I=null;return s!=null&&(s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(h=s.identifierPrefix),s.onUncaughtError!==void 0&&(p=s.onUncaughtError),s.onCaughtError!==void 0&&(w=s.onCaughtError),s.onRecoverableError!==void 0&&(k=s.onRecoverableError),s.formState!==void 0&&(I=s.formState)),n=Pv(t,1,!0,n,s??null,c,h,I,p,w,k,eS),n.context=Gv(null),s=n.current,c=Jn(),c=kt(c),h=Vr(c),h.callback=null,Fr(s,h,c),s=c,n.current.lanes=s,qe(n,s),Fa(n),t[On]=n.current,Vh(t),new Nu(n)},qs.version="19.2.0",qs}var vg;function cS(){if(vg)return ju.exports;vg=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(e){console.error(e)}}return l(),ju.exports=lS(),ju.exports}var Pu=cS();const Gu=Wa(Pu),Ps=[],uS=50;let Vu=!1;function Sg(){try{return window.G7Core?.devTools}catch{return}}function ji(l,e,a){const r=Sg();if(Vu&&r?.isEnabled?.()){r.trackLog?.(l,e,a);return}Vu||(l==="error"||l==="warn")&&Ps.length<uS&&Ps.push({level:l,prefix:e,args:a,timestamp:Date.now()})}function Fu(){Vu=!0;const l=Sg();if(!l?.isEnabled?.()){Ps.length=0;return}for(const e of Ps)l.trackLog?.(e.level,e.prefix,e.args);Ps.length=0}const gi=class gi{constructor(){$(this,"debug");$(this,"prefix","[TemplateEngine]");this.debug=!1}static getInstance(){return gi.instance||(gi.instance=new gi),gi.instance}setDebug(e){this.debug=e}isDebugEnabled(){return this.debug}log(...e){this.debug&&console.log(this.prefix,...e),ji("log","TemplateEngine",e)}error(...e){this.debug&&console.error(this.prefix,...e),ji("error","TemplateEngine",e)}warn(...e){this.debug&&console.warn(this.prefix,...e),ji("warn","TemplateEngine",e)}};$(gi,"instance");let Gs=gi;function dt(l){const e=`[${l}]`,a=Gs.getInstance();return{log:(...r)=>{a.isDebugEnabled()&&console.log(e,...r),ji("log",l,r)},warn:(...r)=>{a.isDebugEnabled()&&console.warn(e,...r),ji("warn",l,r)},error:(...r)=>{a.isDebugEnabled()&&console.error(e,...r),ji("error",l,r)}}}Gs.getInstance();const La=dt("ComponentRegistry");class rn extends Error{constructor(e,a,r){super(e),this.code=a,this.details=r,this.name="ComponentRegistryError"}}const Bn=class Bn{constructor(){$(this,"registry",{});$(this,"manifest",null);$(this,"loadingState","idle");$(this,"error",null);$(this,"templateId",null);$(this,"templateType",null)}static getInstance(){return Bn.instance||(Bn.instance=new Bn),Bn.instance}static createIsolatedInstance(){return new Bn}static resetInstance(){Bn.instance=null}async loadComponents(e,a){if(this.loadingState==="loading")throw new rn("Components are already being loaded","LOADING_IN_PROGRESS");if(this.loadingState==="loaded"&&this.templateId===e&&this.templateType===a){La.log("Components already loaded for template:",e,a);return}this.loadingState="loading",this.templateId=e,this.templateType=a,this.error=null;try{await this.loadManifest(),await this.loadComponentBundle(),this.loadingState="loaded",La.log("Successfully loaded components:",Object.keys(this.registry).length)}catch(r){throw this.loadingState="error",this.error=r instanceof Error?r:new Error(String(r)),new rn(`Failed to load components: ${this.error.message}`,"LOAD_FAILED",{originalError:this.error})}}async loadManifest(){try{if(!this.templateId)throw new rn("Template ID not set","TEMPLATE_ID_NOT_SET");const e=`${this.templateId}:${this.templateType}`;if(Bn.manifestCache.has(e)){this.manifest=Bn.manifestCache.get(e),La.log("Manifest loaded from cache:",this.manifest.templateId);return}const a=`/api/templates/${this.templateId}/components.json`,r=await fetch(a);if(!r.ok)throw new rn(`Failed to fetch manifest: ${r.status} ${r.statusText}`,"MANIFEST_FETCH_FAILED",{status:r.status,statusText:r.statusText});const i=await r.json();this.validateManifest(i),this.manifest=i,Bn.manifestCache.set(e,i),La.log("Manifest loaded and cached:",i.templateId)}catch(e){throw e instanceof rn?e:new rn("Failed to load component manifest","MANIFEST_LOAD_FAILED",{originalError:e})}}validateManifest(e){if(!e.version)throw new rn("Manifest missing required field: version","MANIFEST_INVALID",{field:"version"});if(!e.templateId)throw new rn("Manifest missing required field: templateId","MANIFEST_INVALID",{field:"templateId"});if(!e.components||typeof e.components!="object")throw new rn("Manifest missing required field: components","MANIFEST_INVALID",{field:"components"});const a=["basic","composite","layout"];for(const r of a){if(!Array.isArray(e.components[r]))throw new rn(`Manifest field 'components.${r}' must be an array`,"MANIFEST_INVALID",{field:`components.${r}`,value:e.components[r]});e.components[r].forEach((i,o)=>{if(!i.name||typeof i.name!="string")throw new rn(`Invalid component metadata at ${r}[${o}]: missing or invalid 'name'`,"MANIFEST_INVALID",{type:r,index:o,metadata:i});if(!i.type||typeof i.type!="string")throw new rn(`Invalid component metadata at ${r}[${o}]: missing or invalid 'type'`,"MANIFEST_INVALID",{type:r,index:o,metadata:i})})}La.log("Manifest validation passed")}async loadComponentBundle(){try{if(!this.templateId)throw new rn("Template ID not set","TEMPLATE_ID_NOT_SET");const e=this.getGlobalVariableName(),a=window[e];if(!a||typeof a!="object")throw new rn(`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(a),La.log("Component bundle loaded from global variable:",e)}catch(e){throw e instanceof rn?e:new rn("Failed to load component bundle","BUNDLE_LOAD_FAILED",{originalError:e})}}getGlobalVariableName(){if(!this.templateId)throw new rn("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 rn("Manifest not loaded","MANIFEST_NOT_LOADED");const a=["basic","composite","layout"];for(const r of a){const i=this.manifest.components[r]||[];for(const o of i){const u=o.name,d=e[u];if(!d){La.warn(`Component '${u}' not found in bundle`);continue}this.registerComponent(u,d,o)}}}registerComponent(e,a,r){this.registry[e]&&La.warn(`Component '${e}' already registered, overwriting`);const i=We.memo(a);this.registry[e]={component:i,metadata:r},La.log(`[ComponentRegistry] Registered component: ${e} (${r.type})`)}getComponent(e){const a=this.registry[e];return a?a.component:null}getMetadata(e){const a=this.registry[e];return a?a.metadata:null}hasComponent(e){return e in this.registry}getComponentsByType(e){return Object.entries(this.registry).filter(([a,r])=>r.metadata.type===e).map(([a,r])=>a)}getAllComponents(){return Object.keys(this.registry)}getComponentMap(){const e={};for(const[a,r]of Object.entries(this.registry))e[a]=r.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,La.log("Registry cleared")}};$(Bn,"instance",null),$(Bn,"manifestCache",new Map);let fa=Bn;const wg=dt("TranslationEngine");class Ku extends Error{constructor(e,a,r){super(e),this.key=a,this.locale=r,this.name="TranslationError"}}const kn=class kn{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 kn.instance||(kn.instance=new kn(e)),kn.instance}static resetInstance(){kn.instance=null}setCacheVersion(e){this.cacheVersion!==e&&(wg.log("Cache version updated:",this.cacheVersion,"->",e),this.cacheVersion=e,this.cache.clear())}getCacheVersion(){return this.cacheVersion}async loadTranslations(e,a,r="/api",i=!1){const o=`${e}:${a}`;if(!i){const u=this.getFromCache(o);if(u)return this.translations.set(o,u),u}try{let u=`${r}/templates/${e}/lang/${a}.json`;const d=[];this.cacheVersion>0&&d.push(`v=${this.cacheVersion}`),i&&d.push(`_=${Date.now()}`),d.length>0&&(u+=`?${d.join("&")}`);const f=await fetch(u);if(!f.ok)throw new Ku(`Failed to load translations: ${f.statusText}`,void 0,a);const m=await f.json();return this.saveToCache(o,m),this.translations.set(o,m),m}catch(u){throw new Ku(`Failed to fetch translations for ${a}: ${u instanceof Error?u.message:String(u)}`,void 0,a)}}resolveTranslations(e,a,r){let i=e;const o=5;let u=0;for(;u<o&&i.includes("=$t:");){const d=i;if(i=i.replace(kn.NESTED_TRANSLATION_PARAM_PATTERN,(f,g,m)=>"="+this.translate(m,a,void 0,r)),i===d)break;u++}return i.replace(kn.TRANSLATION_PATTERN,(d,f,g)=>{const{cleanedParams:m,trailing:b}=this.separateTrailingText(g);return this.translate(f,a,m,r)+b})}translate(e,a,r,i){const o=this.getTranslation(e,a),u=r&&this.cleanParamsStr(r);if(u){const d=this.parseParams(u,i);return this.replaceParams(o,d)}return o}getTranslation(e,a){const{templateId:r,locale:i}=a,o=`${r}:${i}`,u=this.translations.get(o);if(u){const d=this.getNestedValue(u,e);if(d!==null)return d}if(i!==this.options.fallbackLocale){const d=`${r}:${this.options.fallbackLocale}`,f=this.translations.get(d);if(f){const g=this.getNestedValue(f,e);if(g!==null)return g}}return e}getNestedValue(e,a){const r=a.split(".");let i=e;for(const o of r){if(i==null||typeof i!="object")return null;i=i[o]}return typeof i=="string"?i:null}setTranslationValue(e,a,r,i){const o=`${e}:${a}`,u=this.translations.get(o)??{},d=r.split(".");let f=u;for(let g=0;g<d.length-1;g+=1){const m=d[g],b=f[m];(b==null||typeof b!="object"||Array.isArray(b))&&(f[m]={}),f=f[m]}f[d[d.length-1]]=i,this.translations.set(o,u)}parseParams(e,a){const r={},i=e.startsWith("|")?e.slice(1):e,o=[],d=i.replace(/\{\{(?:[^}]|\}(?!\}))*\}\}/g,f=>(o.push(f),`__PLACEHOLDER_${o.length-1}__`)).matchAll(kn.PARAM_PATTERN);for(const f of d){const[,g,m]=f,b=m.replace(/__PLACEHOLDER_(\d+)__/g,(v,E)=>o[parseInt(E,10)]);r[g.trim()]=this.resolveParamValue(b.trim(),a)}return r}resolveParamValue(e,a){if(e.startsWith("{{")&&e.endsWith("}}")){const r=e.slice(2,-2).trim();if(/[|&()[\]!?:+\-*/%<>=\s]/.test(r)&&a)try{const u=new Function(...Object.keys(a),`return ${r}`)(...Object.values(a));return String(u??"")}catch(o){return wg.error("Expression evaluation failed:",r,o),""}else{const o=this.getNestedDataValue(a,r);return String(o??"")}}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 r=e.match(/(\s+[^\p{L}\w=|&\s][^\p{L}\w=]*\s*)$/u);return r?{cleanedParams:e.slice(0,-r[1].length),trailing:r[1]}:{cleanedParams:e,trailing:""}}cleanParamsStr(e){return this.separateTrailingText(e).cleanedParams||""}getNestedDataValue(e,a){if(!e)return;const r=a.split(".");let i=e;for(const o of r){if(i==null)return;i=i[o]}return i}replaceParams(e,a){let r=e;for(const[i,o]of Object.entries(a)){const u=new RegExp(`\\{\\{${i}\\}\\}`,"g");r=r.replace(u,String(o));const d=new RegExp(`\\{${i}\\}`,"g");r=r.replace(d,String(o))}return r}getFromCache(e){const a=this.cache.get(e);return a?Date.now()-a.timestamp>this.options.cacheTTL?(this.cache.delete(e),null):a.data:null}saveToCache(e,a){this.cache.set(e,{data:a,timestamp:Date.now()})}clearCache(){this.cache.clear(),this.translations.clear()}pruneCache(){const e=Date.now(),a=[];for(const[r,i]of this.cache.entries())e-i.timestamp>this.options.cacheTTL&&a.push(r);for(const r of a)this.cache.delete(r)}getCacheStats(){const e=Date.now();let a=0;for(const r of this.cache.values())e-r.timestamp>this.options.cacheTTL&&a++;return{size:this.cache.size,expired:a}}};$(kn,"instance",null),$(kn,"TRANSLATION_PATTERN",/\$t:(?:defer:)?([a-zA-Z0-9._-]+)(\|(?:(?!\$t:).)+)?/g),$(kn,"NESTED_TRANSLATION_PARAM_PATTERN",/=(\$t:([a-zA-Z0-9._-]+))(?=[|&\s]|$)/g),$(kn,"PARAM_PATTERN",/([^=|&]+)=([^|&]+)/g);let li=kn;const Cg=Object.freeze(Object.defineProperty({__proto__:null,TranslationEngine:li,TranslationError:Ku},Symbol.toStringTag,{value:"Module"})),Ui=dt("PipeRegistry");function Eg(l,e){const a=l.getFullYear(),r=String(l.getMonth()+1).padStart(2,"0"),i=String(l.getDate()).padStart(2,"0"),o=String(l.getHours()).padStart(2,"0"),u=String(l.getMinutes()).padStart(2,"0"),d=String(l.getSeconds()).padStart(2,"0");return e.replace("YYYY",String(a)).replace("YY",String(a).slice(-2)).replace("MM",r).replace("M",String(l.getMonth()+1)).replace("DD",i).replace("D",String(l.getDate())).replace("HH",o).replace("H",String(l.getHours())).replace("mm",u).replace("m",String(l.getMinutes())).replace("ss",d).replace("s",String(l.getSeconds()))}function dS(l,e="ko"){const r=new Date().getTime()-l.getTime(),i=Math.floor(r/1e3),o=Math.floor(i/60),u=Math.floor(o/60),d=Math.floor(u/24),f=Math.floor(d/7),g=Math.floor(d/30),m=Math.floor(d/365);return e==="ko"?i<60?"방금 전":o<60?`${o}분 전`:u<24?`${u}시간 전`:d<7?`${d}일 전`:f<4?`${f}주 전`:g<12?`${g}개월 전`:`${m}년 전`:i<60?"just now":o<60?`${o} minute${o===1?"":"s"} ago`:u<24?`${u} hour${u===1?"":"s"} ago`:d<7?`${d} day${d===1?"":"s"} ago`:f<4?`${f} week${f===1?"":"s"} ago`:g<12?`${g} month${g===1?"":"s"} ago`:`${m} year${m===1?"":"s"} ago`}function Wu(l){if(l==null)return null;if(l instanceof Date)return l;if(typeof l=="number")return new Date(l);if(typeof l=="string"){const e=new Date(l);return isNaN(e.getTime())?null:e}return null}const Vs={date:{fn:(l,e="YYYY-MM-DD")=>{const a=Wu(l);return a?Eg(a,e):""},description:"날짜 포맷 (기본: YYYY-MM-DD)"},datetime:{fn:(l,e="YYYY-MM-DD HH:mm")=>{const a=Wu(l);return a?Eg(a,e):""},description:"날짜+시간 포맷 (기본: YYYY-MM-DD HH:mm)"},relativeTime:{fn:(l,e="ko")=>{const a=Wu(l);return a?dS(a,e):""},description:'상대 시간 표시 (예: "3분 전")'},number:{fn:(l,e)=>{const a=Number(l);if(isNaN(a))return String(l??"");const r={};return e!==void 0&&(r.minimumFractionDigits=e,r.maximumFractionDigits=e),a.toLocaleString(void 0,r)},description:"숫자 포맷 (천단위 구분, 선택적 소수점)"},truncate:{fn:(l,e=100,a="...")=>typeof l!="string"?String(l??""):l.length<=e?l:l.slice(0,e)+a,description:'문자열 자르기 (기본: 100자, 접미사: "...")'},uppercase:{fn:l=>typeof l!="string"?String(l??""):l.toUpperCase(),description:"대문자 변환"},lowercase:{fn:l=>typeof l!="string"?String(l??""):l.toLowerCase(),description:"소문자 변환"},stripHtml:{fn:l=>typeof l!="string"?String(l??""):l.replace(/<[^>]*>/g,""),description:"HTML 태그 제거"},default:{fn:(l,e="")=>l==null||l===""?e:l,description:"기본값 설정 (null, undefined, 빈문자열 시)"},fallback:{fn:(l,e)=>l??e,description:"폴백 값 설정 (null, undefined 시만)"},first:{fn:l=>{if(Array.isArray(l))return l[0]},description:"배열의 첫 번째 요소"},last:{fn:l=>{if(Array.isArray(l))return l[l.length-1]},description:"배열의 마지막 요소"},join:{fn:(l,e=", ")=>Array.isArray(l)?l.join(e):"",description:'배열을 문자열로 결합 (기본 구분자: ", ")'},length:{fn:l=>Array.isArray(l)||typeof l=="string"?l.length:0,description:"배열/문자열 길이"},filterBy:{fn:(l,e,a)=>Array.isArray(l)?Array.isArray(e)?l.filter(r=>{const i=a?r?.[a]:r;return e.includes(i)}):l:[],description:"배열 필터링 (allowList에 포함된 항목만 반환)"},keys:{fn:l=>l==null||typeof l!="object"?[]:Object.keys(l),description:"객체의 키 배열"},values:{fn:l=>l==null||typeof l!="object"?[]:Object.values(l),description:"객체의 값 배열"},json:{fn:(l,e)=>{try{return JSON.stringify(l,null,e)}catch{return""}},description:"JSON 문자열로 변환"},localized:{fn:(l,e)=>l==null?"":typeof l=="string"?l:typeof l!="object"?String(l):l[e||"ko"]||l.ko||l.en||Object.values(l)[0]||"",description:"다국어 객체에서 로케일에 맞는 값 추출"}},Bi=new Map,pi=class pi{static getInstance(){return pi.instance||(pi.instance=new pi),pi.instance}register(e,a,r){if(Vs[e]){Ui.warn(`[PipeRegistry] 내장 파이프를 덮어쓸 수 없습니다: ${e}`);return}Bi.set(e,{fn:a,description:r}),Ui.log(`[PipeRegistry] 커스텀 파이프 등록됨: ${e}`)}unregister(e){if(Vs[e])return Ui.warn(`[PipeRegistry] 내장 파이프는 해제할 수 없습니다: ${e}`),!1;const a=Bi.delete(e);return a&&Ui.log(`[PipeRegistry] 커스텀 파이프 해제됨: ${e}`),a}get(e){const a=Vs[e];return a?a.fn:Bi.get(e)?.fn}has(e){return!!Vs[e]||Bi.has(e)}execute(e,a,r=[]){const i=this.get(e);if(!i)return Ui.warn(`[PipeRegistry] 알 수 없는 파이프: ${e}`),a;try{return i(a,...r)}catch(o){return Ui.error(`[PipeRegistry] 파이프 실행 오류 (${e}):`,o),a}}list(){const e=[];for(const[a,r]of Object.entries(Vs))e.push({name:a,description:r.description,type:"built-in"});for(const[a,r]of Bi.entries())e.push({name:a,description:r.description,type:"custom"});return e.sort((a,r)=>a.name.localeCompare(r.name))}clearCustomPipes(){Bi.clear()}};$(pi,"instance",null);let Rl=pi;Rl.getInstance();function fS(l){const e=l.trim(),a=e.indexOf("(");if(a===-1)return{name:e,args:[]};const r=e.slice(0,a).trim(),i=e.slice(a+1,-1);if(!i.trim())return{name:r,args:[]};const o=[];let u="",d=null,f=0;for(let g=0;g<i.length;g++){const m=i[g];if((g>0?i[g-1]:"")==="\\"){u+=m;continue}if((m==='"'||m==="'")&&!d){d=m;continue}if(m===d){d=null;continue}if(d){u+=m;continue}if(m==="("||m==="["||m==="{"){f++,u+=m;continue}if(m===")"||m==="]"||m==="}"){f--,u+=m;continue}if(m===","&&f===0){o.push(_g(u.trim())),u="";continue}u+=m}return u.trim()&&o.push(_g(u.trim())),{name:r,args:o}}function _g(l){if(l==="null")return null;if(l==="undefined")return;if(l==="true")return!0;if(l==="false")return!1;const e=Number(l);return!isNaN(e)&&l!==""?e:l}function hS(l){const e=[];let a="",r=null,i=0;for(let o=0;o<l.length;o++){const u=l[o],d=o>0?l[o-1]:"",f=o<l.length-1?l[o+1]:"";if(d==="\\"){a+=u;continue}if((u==='"'||u==="'")&&!r){r=u,a+=u;continue}if(u===r){r=null,a+=u;continue}if(r){a+=u;continue}if(u==="("||u==="["||u==="{"){i++,a+=u;continue}if(u===")"||u==="]"||u==="}"){i--,a+=u;continue}if(u==="|"&&f!=="|"&&d!=="|"&&i===0){e.push(a.trim()),a="";continue}a+=u}return a.trim()&&e.push(a.trim()),e.length===0?[l,[]]:[e[0],e.slice(1)]}function Ag(l){let e=null,a=0;for(let r=0;r<l.length;r++){const i=l[r],o=r>0?l[r-1]:"",u=r<l.length-1?l[r+1]:"";if(o!=="\\"){if((i==='"'||i==="'")&&!e){e=i;continue}if(i===e){e=null;continue}if(!e){if(i==="("||i==="["||i==="{"){a++;continue}if(i===")"||i==="]"||i==="}"){a--;continue}if(i==="|"&&u!=="|"&&o!=="|"&&a===0)return!0}}}return!1}function gS(l,e){const a=Rl.getInstance();let r=l;for(const i of e){const o=fS(i);r=a.execute(o.name,r,o.args)}return r}const Er="raw:",Dl="﷐",Fs="﷑",_r="﷒";function Ks(l){return Dl+l+Fs}function xg(l){return l.length>=2&&l.charCodeAt(0)===64976&&l.charCodeAt(l.length-1)===64977}function Tg(l){return l.includes(Dl)}function kg(l){return l.slice(1,-1)}function Ws(l){if(typeof l=="string")return Ks(l);if(Array.isArray(l))return l.map(Ws);if(l&&typeof l=="object"){const e={};for(const[a,r]of Object.entries(l))e[a]=Ws(r);return e}return l}const Ys=dt("DataBindingEngine");function Ol(){try{return window.G7Core?.devTools}catch{return}}class Yu extends Error{constructor(e,a,r){super(e),this.path=a,this.context=r,this.name="DataBindingError"}}const wa=class wa{constructor(e){$(this,"cache",new Map);$(this,"expressionFnCache",new Map);$(this,"renderCycleCache",new Map);$(this,"currentRenderCycleId",0);$(this,"defaultOptions",{defaultValue:void 0,nullSafe:!0,detectCircular:!0,maxDepth:10});e&&(this.defaultOptions={...this.defaultOptions,...e})}startRenderCycle(){this.currentRenderCycleId++,this.renderCycleCache.clear()}isRenderCycleCacheActive(){return this.currentRenderCycleId>0}getFromRenderCycleCache(e){if(this.isRenderCycleCacheActive())return this.renderCycleCache.get(e)}saveToRenderCycleCache(e,a){this.isRenderCycleCacheActive()&&this.renderCycleCache.set(e,a)}resolveBindings(e,a,r,i){const o={...this.defaultOptions,...r},u=Ol(),d=a._computed&&!a.$computed?{...a,$computed:a._computed}:a;return e.replace(wa.BINDING_PATTERN,(f,g)=>{const m=g.trim();let b=!1,v=m;if(m.startsWith(Er)&&(b=!0,v=m.slice(Er.length)),Ag(v)){const O=u?.isEnabled()?performance.now():0;try{const[L,P]=hS(v);let U,B=!1;const Y=/[?:|&!+\-*/<>=()]/.test(L)||/\[['"]/.test(L),ge=L.startsWith("_global")||L.startsWith("_local")||L.startsWith("_isolated")||L.startsWith("$parent");if(o.skipCache)Y?U=this.evaluateExpression(L,d):U=this.resolvePath(L,d,o);else if(Y){const Ne=this.getFromRenderCycleCache(`expr:${L}`);Ne!==void 0?(U=Ne,B=!0):(U=this.evaluateExpression(L,d),this.saveToRenderCycleCache(`expr:${L}`,U))}else if(ge){const Ne=this.getFromRenderCycleCache(L);Ne!==void 0?(U=Ne,B=!0):(U=this.resolvePath(L,d,o),this.saveToRenderCycleCache(L,U))}else{const Ne=this.getFromCache(L);Ne!==void 0?(U=Ne,B=!0):(U=this.resolvePath(L,d,o),this.saveToCache(L,U))}const Ae=gS(U,P);if(u?.isEnabled()){const Ne=performance.now()-O;u.trackExpressionEval({expression:`{{${m}}}`,result:this.sanitizeResultForTracking(Ae),resultType:this.getResultType(Ae),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:B,duration:Ne,method:"resolveBindings",skipCache:o.skipCache})}const Oe=this.formatValue(Ae);return b?Ks(Oe):Oe}catch(L){return Ys.error("Pipe expression evaluation failed:",v,L),f}}if(/[?:&!+\-*/<>=()]/.test(v)||/\|\|/.test(v)||/\[['"]/.test(v)){const O=u?.isEnabled()?performance.now():0;try{let L,P=!1;if(o.skipCache)L=this.evaluateExpression(v,d);else{const B=`expr:${v}`,Y=this.getFromRenderCycleCache(B);Y!==void 0?(L=Y,P=!0):(L=this.evaluateExpression(v,d),this.saveToRenderCycleCache(B,L))}if(u?.isEnabled()){const B=performance.now()-O;u.trackExpressionEval({expression:`{{${m}}}`,result:this.sanitizeResultForTracking(L),resultType:this.getResultType(L),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:P,duration:B,method:"resolveBindings",skipCache:o.skipCache})}const U=this.formatValue(L);return b?Ks(U):U}catch(L){return Ys.error("Expression evaluation failed:",v,L),f}}if(o.skipCache){const O=u?.isEnabled()?performance.now():0,L=this.resolvePath(v,d,o);if(u?.isEnabled()){const U=performance.now()-O;u.trackExpressionEval({expression:`{{${m}}}`,result:this.sanitizeResultForTracking(L),resultType:this.getResultType(L),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:!1,duration:U,method:"resolveBindings",skipCache:!0})}const P=this.formatValue(L);return b?Ks(P):P}const S=v.startsWith("_global")||v.startsWith("_local")||v.startsWith("_isolated")||v.startsWith("$parent"),A=u?.isEnabled()?performance.now():0;let T,D=!1;if(S){const O=this.getFromRenderCycleCache(v);O!==void 0?(T=O,D=!0):(T=this.resolvePath(v,d,o),this.saveToRenderCycleCache(v,T))}else{const O=this.getFromCache(v);O!==void 0?(T=O,D=!0):(T=this.resolvePath(v,d,o),this.saveToCache(v,T))}if(u?.isEnabled()){const O=performance.now()-A;u.trackExpressionEval({expression:`{{${m}}}`,result:this.sanitizeResultForTracking(T),resultType:this.getResultType(T),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:D,duration:O,method:"resolveBindings",skipCache:o.skipCache})}const M=this.formatValue(T);return b?Ks(M):M})}resolve(e,a,r,i){const o={...this.defaultOptions,...r},u=Ol(),d=u?.isEnabled()?performance.now():0;if(o.skipCache){const b=this.resolvePath(e,a,o);return u?.isEnabled()&&u.trackExpressionEval({expression:e,result:this.sanitizeResultForTracking(b),resultType:this.getResultType(b),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:!1,duration:performance.now()-d,method:"resolve",skipCache:!0}),b}const f=e.startsWith("_global")||e.startsWith("_local")||e.startsWith("_isolated")||e.startsWith("$parent");let g=!1;if(f){const b=this.getFromRenderCycleCache(e);if(b!==void 0)return g=!0,u?.isEnabled()&&u.trackExpressionEval({expression:e,result:this.sanitizeResultForTracking(b),resultType:this.getResultType(b),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:!0,duration:performance.now()-d,method:"resolve",skipCache:o.skipCache}),b}else{const b=this.getFromCache(e);if(b!==void 0)return g=!0,u?.isEnabled()&&u.trackExpressionEval({expression:e,result:this.sanitizeResultForTracking(b),resultType:this.getResultType(b),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:!0,duration:performance.now()-d,method:"resolve",skipCache:o.skipCache}),b}const m=this.resolvePath(e,a,o);return f?this.saveToRenderCycleCache(e,m):this.saveToCache(e,m),u?.isEnabled()&&u.trackExpressionEval({expression:e,result:this.sanitizeResultForTracking(m),resultType:this.getResultType(m),componentId:i?.componentId,componentName:i?.componentName,propName:i?.propName,fromCache:g,duration:performance.now()-d,method:"resolve",skipCache:o.skipCache}),m}resolvePath(e,a,r,i=0,o=new WeakSet){if(r.maxDepth&&i>r.maxDepth){if(r.detectCircular)throw new Yu(`Maximum depth exceeded (${r.maxDepth}). Possible circular reference.`,e,a);return r.defaultValue}const u=this.parsePath(e);let d=a;for(let f=0;f<u.length;f++){const g=u[f];if(d==null){if(r.nullSafe)return r.defaultValue;throw new Yu(`Cannot read property '${g}' of ${d}`,e,a)}if(r.detectCircular&&typeof d=="object"){if(o.has(d))throw new Yu(`Circular reference detected at path: ${u.slice(0,f+1).join(".")}`,e,a);o.add(d)}d=d[g],e==="_global.toasts"&&Ys.log(`[DataBindingEngine] segment: ${g}, current:`,d)}return d!==void 0?d:r.defaultValue}parsePath(e){const a=[];let r;for(wa.PATH_SEGMENT_PATTERN.lastIndex=0;(r=wa.PATH_SEGMENT_PATTERN.exec(e))!==null;){const i=r[1]||r[2];i&&a.push(i)}return a}formatValue(e){if(e==null)return"";if(typeof e=="object")try{return JSON.stringify(e)}catch{return"[Object]"}return String(e)}getFromCache(e){const a=this.cache.get(e),r=Ol();if(!a){r?.isEnabled()&&r.recordCacheMiss();return}if(Date.now()-a.timestamp>wa.CACHE_EXPIRY){this.cache.delete(e),r?.isEnabled()&&r.recordCacheMiss();return}return r?.isEnabled()&&r.recordCacheHit(),a.value}saveToCache(e,a){this.cache.set(e,{value:a,timestamp:Date.now()})}isActionDefinition(e){return typeof e.handler!="string"?!1:e.params!==void 0||Array.isArray(e.actions)||typeof e.target=="string"||e.onSuccess!==void 0||e.onError!==void 0}extractSingleBinding(e){if(!e.startsWith("{{")||!e.endsWith("}}")||e.length<5)return null;const a=e.slice(2,-2);let r=0;for(let i=0;i<a.length-1;i++){const o=a[i];if(o==="{")r++;else if(o==="}"){if(r>0)r--;else if(a[i+1]==="}")return null}}return a}resolveObject(e,a,r){if(this.isSwitchExpression(e)){const d=e;return this.resolveSwitch(d,a,r)}if(this.isActionDefinition(e))return{...e};if("iteration"in e)return{...e};const i={},u=[...["cellChildren","expandChildren","expandContext","render"],...r?.skipBindingKeys||[]];for(const[d,f]of Object.entries(e)){if(u.includes(d)){i[d]=f;continue}if(typeof f=="string"){const g=this.extractSingleBinding(f);if(g!==null){const m=g.trim();let b=!1,v=m;m.startsWith(Er)&&(b=!0,v=m.slice(Er.length));const S=/[?:|&!+\-*/<>=()]/.test(v)||/\[['"]/.test(v)?this.evaluateExpression(v,a,r):this.resolve(v,a,r);i[d]=b&&S!=null?Ws(S):S}else i[d]=this.resolveBindings(f,a,r)}else Array.isArray(f)?i[d]=f.map(g=>typeof g=="string"?this.resolveBindings(g,a,r):typeof g=="object"&&g!==null?this.resolveObject(g,a,r):g):f&&typeof f=="object"?i[d]=this.resolveObject(f,a,r):i[d]=f}return i}clearCache(){this.cache.clear(),this.expressionFnCache.clear()}invalidateCacheByKeys(e){for(const a of this.cache.keys())for(const r of e)if(a===r||a.startsWith(`${r}.`)||a.startsWith(`${r}[`)){this.cache.delete(a);break}}pruneCache(){const e=Date.now();for(const[a,r]of this.cache.entries())e-r.timestamp>wa.CACHE_EXPIRY&&this.cache.delete(a)}getCacheStats(){const e=Date.now();let a=0;for(const r of this.cache.values())e-r.timestamp>wa.CACHE_EXPIRY&&a++;return{size:this.cache.size,expired:a}}evaluateExpression(e,a,r){const i=Ol(),o=i?.isEnabled()?performance.now():0;i?.isEnabled()&&i.trackBindingEval();try{let u=this.preprocessOptionalChaining(e);u=this.preprocessTranslationTokens(u);const d=this.extractVariablesFromExpression(u),f={...a};for(const L of d)L in f||(f[L]=void 0);a._computed&&!f.$computed&&(f.$computed=a._computed);const g=a.$locale||"ko";f.$localized=(L,P)=>{if(L==null&&!P)return"";if(typeof L=="string")return L;if(L&&typeof L=="object"&&L[g])return L[g];if(P&&typeof P=="string"){const U=f.$t?f.$t(P):P;if(U&&U!==P)return U}return L&&typeof L=="object"?L.ko||L.en||Object.values(L)[0]||"":L==null?"":String(L)};const m=typeof window<"u"?window.G7Core:void 0;f.$uuid=()=>m?.uuid?m.uuid():typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,L=>{const P=Math.random()*16|0;return(L==="x"?P:P&3|8).toString(16)});let b=a.$templateId,v=g;if(!b&&typeof window<"u"){const P=window.__templateApp?.getConfig?.();P?.templateId&&(b=P.templateId,!a.$locale&&P.locale&&(v=P.locale))}const E={templateId:b||"",locale:v};f.$t=L=>{if(!L||typeof L!="string")return"";try{return li.getInstance().translate(L,E)}catch(P){return Ys.warn("$t() translation failed for key:",L,P),L}},f.$get=(L,P,U=void 0)=>{if(L==null)return U;const B=Array.isArray(P)?P:[P];if(B.length===0)return L;let Y=L;for(const ge of B){if(Y==null||ge==null)return U;Y=Y[ge]}return Y??U};const S=Object.keys(f),A=Object.values(f),T=`${u}|${S.join(",")}`;let D=this.expressionFnCache.get(T);const M=!!D;D||(D=new Function(...S,`return (${u});`),this.expressionFnCache.set(T,D));const O=D(...A);if(i?.isEnabled()){const L=performance.now()-o;i.trackExpressionEval({expression:e,result:this.sanitizeResultForTracking(O),resultType:this.getResultType(O),componentId:r?.componentId,componentName:r?.componentName,propName:r?.propName,fromCache:M,duration:L,method:"evaluateExpression",skipCache:r?.skipCache})}return O}catch(u){throw new Error(`Failed to evaluate expression "${e}": ${u instanceof Error?u.message:String(u)}`)}}getResultType(e){return e===null?"null":e===void 0?"undefined":Array.isArray(e)?"array":typeof e}sanitizeResultForTracking(e){if(e==null||typeof e!="object")return e;try{if(Array.isArray(e))return e.length>10?`[Array(${e.length})]`:e.slice(0,10);const a=Object.keys(e);return a.length>20?`{Object(${a.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,(a,r,i,o)=>`$t('${o}')`),e.replace(/(?<!['"]\s*)(\$t:[a-zA-Z_][a-zA-Z0-9_.\-]*)(?!\s*['"])/g,'"$1"')}preprocessOptionalChaining(e){const a=[];let r=e.replace(/(['"])(?:(?!\1|\\).|\\.)*\1/g,o=>(a.push(o),`__STRING_LITERAL_${a.length-1}__`));const i=[];return r=r.replace(/\$t:[a-zA-Z_][a-zA-Z0-9_.\-]*(?:\|[^'"\s,)]+)?/g,o=>(i.push(o),`__TRANSLATION_TOKEN_${i.length-1}__`)),r=r.replace(/([a-zA-Z_$][a-zA-Z0-9_$]*)\.(?!\?)/g,"$1?."),r=r.replace(/__TRANSLATION_TOKEN_(\d+)__/g,(o,u)=>i[parseInt(u,10)]),r=r.replace(/__STRING_LITERAL_(\d+)__/g,(o,u)=>a[parseInt(u,10)]),r}extractVariablesFromExpression(e){const a=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"]),r=/(?<![.\w$])([a-zA-Z_$][a-zA-Z0-9_$]*)/g,i=new Set;let o;for(;(o=r.exec(e))!==null;){const u=o[1];a.has(u)||i.add(u)}return Array.from(i)}isSwitchExpression(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&"$switch"in e&&"$cases"in e}resolveSwitch(e,a,r){const i={...r,skipCache:!0};let o;try{o=this.resolveBindings(e.$switch,a,i)?.toString()?.trim()??""}catch(d){Ys.warn("resolveSwitch: $switch 키 평가 실패:",e.$switch,d),o=""}let u;if(o&&e.$cases&&o in e.$cases)u=e.$cases[o];else if("$default"in e)u=e.$default;else return;return typeof u=="string"?u.includes("{{")?this.resolveBindings(u,a,i):u:u!==null&&typeof u=="object"?this.resolveObject(u,a,i):u}};$(wa,"BINDING_PATTERN",/\{\{([^}]+)\}\}/g),$(wa,"PATH_SEGMENT_PATTERN",/([^.[\]]+)|\[(\d+)\]/g),$(wa,"CACHE_EXPIRY",3e4);let vn=wa;const pS=new vn,Ll={mobile:{min:0,max:767},tablet:{min:768,max:1023},desktop:{min:1024,max:1/0},portable:{min:0,max:1023}},Ml=new Map;function mS(l,e){let a=null;return((...r)=>{a!==null&&clearTimeout(a),a=setTimeout(()=>{l(...r)},e)})}class yS{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=mS(()=>{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(Ml.has(e))return Ml.get(e)??null;let a=null;if(Ll[e])a={...Ll[e]};else{const r=e.match(/^(-?\d*)-(-?\d*)$/);if(r){const[,i,o]=r,u=i===""?0:parseInt(i,10),d=o===""?1/0:parseInt(o,10);!isNaN(u)&&!isNaN(d)&&u<=d&&(a={min:u,max:d})}}return Ml.set(e,a),a}getMatchingKey(e,a){const r=[];for(const i of Object.keys(e)){const o=this.parseRange(i);o&&a>=o.min&&a<=o.max&&r.push({key:i,range:o,isPreset:!!Ll[i]})}return r.length===0?null:(r.sort((i,o)=>{if(i.isPreset!==o.isPreset)return i.isPreset?1:-1;const u=i.range.max-i.range.min,d=o.range.max-o.range.min;return u-d}),r[0].key)}matches(e){const a=this.parseRange(e);return a?this.currentWidth>=a.min&&this.currentWidth<=a.max:!1}clearSubscribers(){this.subscribers.clear()}destroy(){this.debouncedHandler&&typeof window<"u"&&window.removeEventListener("resize",this.debouncedHandler),this.clearSubscribers(),Ml.clear()}_setWidthForTesting(e){this.currentWidth=e,this.notifySubscribers()}}const ci=new yS,$l=dt("ConditionEvaluator");function bS(l){switch(l){case"true":return{value:!0};case"false":return{value:!1};case"null":return{value:null};case"undefined":return{value:void 0};default:return}}function vS(l){return/[?:|&!+\-*/<>=()]/.test(l)}function SS(l){if(!l.startsWith("{{")||!l.endsWith("}}"))return null;const e=l.slice(2,-2);let a=null,r=0;for(let i=0;i<e.length;i++){const o=e[i];if((i>0?e[i-1]:"")!=="\\"&&((o==='"'||o==="'")&&!a?a=o:o===a&&(a=null),!a&&(o==="{"&&r++,o==="}"&&r--,r<0)))return null}return r===0?e.trim():null}function wS(l,e,a){if(!l)return!0;try{const r=SS(l);let i;if(r!==null){const o=bS(r);o!==void 0?i=o.value:vS(r)?i=a.evaluateExpression(r,e):i=a.resolve(r,e,{skipCache:!0})}else i=a.resolveBindings(l,e,{skipCache:!0});if(typeof i=="string"){const o=i.toLowerCase().trim();if(o==="false"||o==="0"||o===""||o==="null"||o==="undefined")return!1}return!!i}catch(r){return $l.warn(`evaluateStringCondition: 조건 평가 실패: ${l}`,r),!1}}function Nl(l,e,a){if(typeof l=="string")return wS(l,e,a);if("and"in l){if(!Array.isArray(l.and)||l.and.length===0)return $l.warn("evaluateConditionExpression: AND 그룹이 비어있습니다"),!0;for(const r of l.and)if(!Nl(r,e,a))return!1;return!0}if("or"in l){if(!Array.isArray(l.or)||l.or.length===0)return $l.warn("evaluateConditionExpression: OR 그룹이 비어있습니다"),!1;for(const r of l.or)if(Nl(r,e,a))return!0;return!1}return $l.warn("evaluateConditionExpression: 알 수 없는 조건 형식",l),!1}function Rg(l,e,a){if(!Array.isArray(l)||l.length===0)return{matched:!1,branchIndex:-1};for(let r=0;r<l.length;r++){const i=l[r];if(i.if===void 0)return{matched:!0,branchIndex:r};if(Nl(i.if,e,a))return{matched:!0,branchIndex:r}}return{matched:!1,branchIndex:-1}}function CS(l){return typeof l=="string"?!0:l&&typeof l=="object"?"and"in l||"or"in l:!1}function ES(l){if(!Array.isArray(l)||l.length===0)return!1;const e=l[0];return!e||typeof e!="object"?!1:"if"in e||"then"in e}const Ya=dt("RenderHelpers"),_S=new Map([["true",!0],["false",!1],["null",null]]);function Dg(){try{return window.G7Core?.devTools}catch{return}}const Og=new vn;function Xu(l){return/[?:|&!+\-*/<>=()[\]{}]/.test(l)}function Lg(l){if(!l.startsWith("{{")||!l.endsWith("}}"))return null;const e=l.slice(2,-2);let a=null,r=0;for(let i=0;i<e.length;i++){const o=e[i];if((i>0?e[i-1]:"")!=="\\"&&((o==='"'||o==="'")&&!a?a=o:o===a&&(a=null),!a&&(o==="{"&&r++,o==="}"&&r--,r<0)))return null}return r===0?e.trim():null}function Qu(l,e,a){let r=l;if(l.startsWith("{{")&&l.endsWith("}}")&&(r=l.slice(2,-2).trim()),Xu(r))try{return a.evaluateExpression(r,e)}catch(i){Ya.warn(`resolveIterationSource: 표현식 평가 실패: ${l}`,i);return}return a.resolve(r,e,{skipCache:!0})}function AS(l,e){const a={...l};if(e?.parentDataContext)for(const[r,i]of Object.entries(e.parentDataContext))r in a||(a[r]=i);if(e?.state){const r=a._local||{};a._local={...r,...e.state}}return e?.isolatedContext?.state&&(a._isolated=e.isolatedContext.state),a}function Ju(l,e,a,r){if(!e||!Array.isArray(e)||e.length===0)return l;const i=r?.actionDispatcher??xp(),o={...l,actions:e},u=i.bindActionsToProps(o,a,r?.componentContext);return delete u.actions,u}function Mg(l,e,a,r){if(typeof l=="boolean")return l;if(!l)return!0;try{const i=Lg(l);let o;if(i!==null){const u=_S.get(i);u!==void 0?o=u:Xu(i)?o=a.evaluateExpression(i,e):o=a.resolve(i,e,{skipCache:!0})}else o=a.resolveBindings(l,e,{skipCache:!0});if(typeof o=="string"){const u=o.toLowerCase().trim();if(u==="false"||u==="0"||u===""||u==="null"||u==="undefined")return!1}return!!o}catch(i){return Ya.warn(`evaluateIfCondition: 조건 평가 실패 (컴포넌트: ${r||"unknown"}):`,i),!1}}function qi(l,e,a,r){if(l.if!==void 0)return Mg(l.if,e,a,r);if(l.condition!==void 0)return Mg(l.condition,e,a,r);if(l.conditions===void 0)return!0;const i=l.conditions;try{return CS(i)?Nl(i,e,a):ES(i)?Rg(i,e,a).matched:(Ya.warn(`evaluateRenderCondition: 알 수 없는 conditions 형식 (컴포넌트: ${r||"unknown"})`),!0)}catch(o){return Ya.warn(`evaluateRenderCondition: conditions 평가 실패 (컴포넌트: ${r||"unknown"}):`,o),!1}}function $g(l){if(!l.responsive)return l;const e=ci.getWidth(),a=ci.getMatchingKey(l.responsive,e);if(!a)return l;const r=l.responsive[a];return{...l,props:{...l.props,...r.props},children:r.children??l.children,text:r.text??l.text,if:r.if??l.if,iteration:r.iteration??l.iteration}}function Xs(l,e,a,r,i){if(!l||l.length===0)return[];const o=i?.bindingEngine??new vn,u=i?.translationEngine??li.getInstance(),d=i?.translationContext??{templateId:"",locale:"ko"},f=AS(e,i?.componentContext),g=(v,E)=>{if(typeof v=="string"){if(xg(v))return kg(v);if(Tg(v)){const A=[],T=v.replace(new RegExp(`${Dl}([^${Fs}]*)${Fs}`,"g"),(M,O)=>(A.push(O),`${_r}${A.length-1}${_r}`));let D=T;return/\$t:[a-zA-Z0-9._-]+/.test(T)&&(D=u.resolveTranslations(T,d,E)),D.replace(new RegExp(`${_r}(\\d+)${_r}`,"g"),(M,O)=>A[parseInt(O)])}if(v.startsWith("$t:defer:")){const A="$t:"+v.slice(9);return u.resolveTranslations(A,d,E)}if(v.startsWith("$t:"))return u.resolveTranslations(v,d,E);const S=Lg(v);if(S!==null){let A=!1,T=S;S.startsWith(Er)&&(A=!0,T=S.slice(Er.length));let D;if(Xu(T))try{D=o.evaluateExpression(T,E)}catch(M){Ya.warn("renderItemChildren: 표현식 평가 실패:",M);return}else D=o.resolve(T,E,{skipCache:!0});return!A&&typeof D=="string"&&/\$t:[a-zA-Z0-9._-]+/.test(D)&&(D=u.resolveTranslations(D,d,E)),A&&D!=null?Ws(D):D}if(v.includes("{{")){const A=o.resolveBindings(v,E,{skipCache:!0});return typeof A=="string"&&/\$t:[a-zA-Z0-9._-]+/.test(A)?u.resolveTranslations(A,d,E):A}return v}if(Array.isArray(v))return v.map(S=>g(S,E));if(v&&typeof v=="object"){const S={};for(const[A,T]of Object.entries(v))S[A]=g(T,E);return S}return v},m=(v,E)=>{if(!v)return{};const S={};for(const[A,T]of Object.entries(v))S[A]=g(T,E);return S},b=(v,E,S)=>{const A=$g(v),T=A.iteration;if(!T)return[];const D=Qu(T.source,S,o);if(!Array.isArray(D))return Ya.warn(`renderItemChildren: iteration.source가 배열이 아닙니다: ${T.source}`),[];const M=Dg();if(M?.isEnabled()){const L=`${E}-iteration`;M.trackIteration(L,T.source,T.item_var,T.index_var,D.length)}const O=a[A.name];return O?D.flatMap((L,P)=>{const U={...S,[T.item_var]:L,[`${T.item_var}_index`]:P,...T.index_var?{[T.index_var]:P}:{}},B=qi({if:A.if,condition:A.condition,conditions:A.conditions},U,o,A.id);if(A.if&&M?.isEnabled()){const Ze=`${E}-iter-${P}-if`;M.trackIfCondition(Ze,A.if,B,A.name)}if(!B)return[];const Y=A.id?String(g(A.id,U)):void 0,ge=`${E}-iter-${P}`,Ae=i?.getRemountKey?i.getRemountKey(Y,ge):ge,Oe=m(A.props,U),Ne=Ju(Oe,A.actions,U,{actionDispatcher:i?.actionDispatcher,componentContext:i?.componentContext});let He=null;return A.text!==void 0?He=g(A.text,U):A.children&&A.children.length>0&&(He=Xs(A.children,U,a,Ae,i)),M?.isEnabled()&&M.trackRender(A.name),[We.createElement(O,{key:Ae,...Ne},He)]}):(Ya.warn(`renderItemChildren: 컴포넌트를 찾을 수 없습니다: ${A.name}`),[])};return l.flatMap((v,E)=>{const S=$g(v),A=S.id?String(g(S.id,f)):void 0,T=r?`${r}-${A||E}`:A||`child-${E}`,D=i?.getRemountKey?i.getRemountKey(A,T):T;if(S.iteration)return b(S,D,f);const M=qi({if:S.if,condition:S.condition,conditions:S.conditions},f,o,S.id),O=Dg();if(S.if&&O?.isEnabled()){const Y=`${D}-if`;O.trackIfCondition(Y,S.if,M,S.name)}if(!M)return[];const L=a[S.name];if(!L)return Ya.warn(`renderItemChildren: 컴포넌트를 찾을 수 없습니다: ${S.name}`),[];const P=m(S.props,f),U=Ju(P,S.actions,f,{actionDispatcher:i?.actionDispatcher,componentContext:i?.componentContext});let B=null;return S.text!==void 0?B=g(S.text,f):S.children&&S.children.length>0&&(B=Xs(S.children,f,a,D,i)),O?.isEnabled()&&O.trackRender(S.name),[We.createElement(L,{key:D,...U},B)]})}function Pi(l,e,a,r){let i,o;return a instanceof vn?(i=a,o=r):(i=Og,o=a),i.resolveBindings(l,e,o)}function xS(l,e,a,r){const i=a??Og,o={skipCache:!0,...r};let u;try{u=i.resolveBindings(l.key,e,{skipCache:o.skipCache})?.toString()?.trim()??""}catch(g){Ya.warn("resolveClassMap: key 평가 실패:",l.key,g),u=""}let d="";u&&l.variants&&u in l.variants?d=l.variants[u]:l.default&&(d=l.default);const f=[];return l.base?.trim()&&f.push(l.base.trim()),d?.trim()&&f.push(d.trim()),f.join(" ")}function Ng(l,e){return function(){return l.apply(e,arguments)}}const{toString:TS}=Object.prototype,{getPrototypeOf:Zu}=Object,{iterator:Hl,toStringTag:Hg}=Symbol,zl=(l=>e=>{const a=TS.call(e);return l[a]||(l[a]=a.slice(8,-1).toLowerCase())})(Object.create(null)),ha=l=>(l=l.toLowerCase(),e=>zl(e)===l),Il=l=>e=>typeof e===l,{isArray:Gi}=Array,Vi=Il("undefined");function Qs(l){return l!==null&&!Vi(l)&&l.constructor!==null&&!Vi(l.constructor)&&_n(l.constructor.isBuffer)&&l.constructor.isBuffer(l)}const zg=ha("ArrayBuffer");function kS(l){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(l):e=l&&l.buffer&&zg(l.buffer),e}const RS=Il("string"),_n=Il("function"),Ig=Il("number"),Js=l=>l!==null&&typeof l=="object",DS=l=>l===!0||l===!1,jl=l=>{if(zl(l)!=="object")return!1;const e=Zu(l);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Hg in l)&&!(Hl in l)},OS=l=>{if(!Js(l)||Qs(l))return!1;try{return Object.keys(l).length===0&&Object.getPrototypeOf(l)===Object.prototype}catch{return!1}},LS=ha("Date"),MS=ha("File"),$S=ha("Blob"),NS=ha("FileList"),HS=l=>Js(l)&&_n(l.pipe),zS=l=>{let e;return l&&(typeof FormData=="function"&&l instanceof FormData||_n(l.append)&&((e=zl(l))==="formdata"||e==="object"&&_n(l.toString)&&l.toString()==="[object FormData]"))},IS=ha("URLSearchParams"),[jS,US,BS,qS]=["ReadableStream","Request","Response","Headers"].map(ha),PS=l=>l.trim?l.trim():l.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Zs(l,e,{allOwnKeys:a=!1}={}){if(l===null||typeof l>"u")return;let r,i;if(typeof l!="object"&&(l=[l]),Gi(l))for(r=0,i=l.length;r<i;r++)e.call(null,l[r],r,l);else{if(Qs(l))return;const o=a?Object.getOwnPropertyNames(l):Object.keys(l),u=o.length;let d;for(r=0;r<u;r++)d=o[r],e.call(null,l[d],d,l)}}function jg(l,e){if(Qs(l))return null;e=e.toLowerCase();const a=Object.keys(l);let r=a.length,i;for(;r-- >0;)if(i=a[r],e===i.toLowerCase())return i;return null}const ui=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ug=l=>!Vi(l)&&l!==ui;function ed(){const{caseless:l,skipUndefined:e}=Ug(this)&&this||{},a={},r=(i,o)=>{const u=l&&jg(a,o)||o;jl(a[u])&&jl(i)?a[u]=ed(a[u],i):jl(i)?a[u]=ed({},i):Gi(i)?a[u]=i.slice():(!e||!Vi(i))&&(a[u]=i)};for(let i=0,o=arguments.length;i<o;i++)arguments[i]&&Zs(arguments[i],r);return a}const GS=(l,e,a,{allOwnKeys:r}={})=>(Zs(e,(i,o)=>{a&&_n(i)?l[o]=Ng(i,a):l[o]=i},{allOwnKeys:r}),l),VS=l=>(l.charCodeAt(0)===65279&&(l=l.slice(1)),l),FS=(l,e,a,r)=>{l.prototype=Object.create(e.prototype,r),l.prototype.constructor=l,Object.defineProperty(l,"super",{value:e.prototype}),a&&Object.assign(l.prototype,a)},KS=(l,e,a,r)=>{let i,o,u;const d={};if(e=e||{},l==null)return e;do{for(i=Object.getOwnPropertyNames(l),o=i.length;o-- >0;)u=i[o],(!r||r(u,l,e))&&!d[u]&&(e[u]=l[u],d[u]=!0);l=a!==!1&&Zu(l)}while(l&&(!a||a(l,e))&&l!==Object.prototype);return e},WS=(l,e,a)=>{l=String(l),(a===void 0||a>l.length)&&(a=l.length),a-=e.length;const r=l.indexOf(e,a);return r!==-1&&r===a},YS=l=>{if(!l)return null;if(Gi(l))return l;let e=l.length;if(!Ig(e))return null;const a=new Array(e);for(;e-- >0;)a[e]=l[e];return a},XS=(l=>e=>l&&e instanceof l)(typeof Uint8Array<"u"&&Zu(Uint8Array)),QS=(l,e)=>{const r=(l&&l[Hl]).call(l);let i;for(;(i=r.next())&&!i.done;){const o=i.value;e.call(l,o[0],o[1])}},JS=(l,e)=>{let a;const r=[];for(;(a=l.exec(e))!==null;)r.push(a);return r},ZS=ha("HTMLFormElement"),ew=l=>l.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(a,r,i){return r.toUpperCase()+i}),Bg=(({hasOwnProperty:l})=>(e,a)=>l.call(e,a))(Object.prototype),tw=ha("RegExp"),qg=(l,e)=>{const a=Object.getOwnPropertyDescriptors(l),r={};Zs(a,(i,o)=>{let u;(u=e(i,o,l))!==!1&&(r[o]=u||i)}),Object.defineProperties(l,r)},nw=l=>{qg(l,(e,a)=>{if(_n(l)&&["arguments","caller","callee"].indexOf(a)!==-1)return!1;const r=l[a];if(_n(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+a+"'")})}})},aw=(l,e)=>{const a={},r=i=>{i.forEach(o=>{a[o]=!0})};return Gi(l)?r(l):r(String(l).split(e)),a},rw=()=>{},iw=(l,e)=>l!=null&&Number.isFinite(l=+l)?l:e;function sw(l){return!!(l&&_n(l.append)&&l[Hg]==="FormData"&&l[Hl])}const ow=l=>{const e=new Array(10),a=(r,i)=>{if(Js(r)){if(e.indexOf(r)>=0)return;if(Qs(r))return r;if(!("toJSON"in r)){e[i]=r;const o=Gi(r)?[]:{};return Zs(r,(u,d)=>{const f=a(u,i+1);!Vi(f)&&(o[d]=f)}),e[i]=void 0,o}}return r};return a(l,0)},lw=ha("AsyncFunction"),cw=l=>l&&(Js(l)||_n(l))&&_n(l.then)&&_n(l.catch),Pg=((l,e)=>l?setImmediate:e?((a,r)=>(ui.addEventListener("message",({source:i,data:o})=>{i===ui&&o===a&&r.length&&r.shift()()},!1),i=>{r.push(i),ui.postMessage(a,"*")}))(`axios@${Math.random()}`,[]):a=>setTimeout(a))(typeof setImmediate=="function",_n(ui.postMessage)),uw=typeof queueMicrotask<"u"?queueMicrotask.bind(ui):typeof process<"u"&&process.nextTick||Pg,Z={isArray:Gi,isArrayBuffer:zg,isBuffer:Qs,isFormData:zS,isArrayBufferView:kS,isString:RS,isNumber:Ig,isBoolean:DS,isObject:Js,isPlainObject:jl,isEmptyObject:OS,isReadableStream:jS,isRequest:US,isResponse:BS,isHeaders:qS,isUndefined:Vi,isDate:LS,isFile:MS,isBlob:$S,isRegExp:tw,isFunction:_n,isStream:HS,isURLSearchParams:IS,isTypedArray:XS,isFileList:NS,forEach:Zs,merge:ed,extend:GS,trim:PS,stripBOM:VS,inherits:FS,toFlatObject:KS,kindOf:zl,kindOfTest:ha,endsWith:WS,toArray:YS,forEachEntry:QS,matchAll:JS,isHTMLForm:ZS,hasOwnProperty:Bg,hasOwnProp:Bg,reduceDescriptors:qg,freezeMethods:nw,toObjectSet:aw,toCamelCase:ew,noop:rw,toFiniteNumber:iw,findKey:jg,global:ui,isContextDefined:Ug,isSpecCompliantForm:sw,toJSONObject:ow,isAsyncFn:lw,isThenable:cw,setImmediate:Pg,asap:uw,isIterable:l=>l!=null&&_n(l[Hl])};function Ye(l,e,a,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=l,this.name="AxiosError",e&&(this.code=e),a&&(this.config=a),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}Z.inherits(Ye,Error,{toJSON:function(){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:Z.toJSONObject(this.config),code:this.code,status:this.status}}});const Gg=Ye.prototype,Vg={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(l=>{Vg[l]={value:l}}),Object.defineProperties(Ye,Vg),Object.defineProperty(Gg,"isAxiosError",{value:!0}),Ye.from=(l,e,a,r,i,o)=>{const u=Object.create(Gg);Z.toFlatObject(l,u,function(m){return m!==Error.prototype},g=>g!=="isAxiosError");const d=l&&l.message?l.message:"Error",f=e==null&&l?l.code:e;return Ye.call(u,d,f,a,r,i),l&&u.cause==null&&Object.defineProperty(u,"cause",{value:l,configurable:!0}),u.name=l&&l.name||"Error",o&&Object.assign(u,o),u};const dw=null;function td(l){return Z.isPlainObject(l)||Z.isArray(l)}function Fg(l){return Z.endsWith(l,"[]")?l.slice(0,-2):l}function Kg(l,e,a){return l?l.concat(e).map(function(i,o){return i=Fg(i),!a&&o?"["+i+"]":i}).join(a?".":""):e}function fw(l){return Z.isArray(l)&&!l.some(td)}const hw=Z.toFlatObject(Z,{},null,function(e){return/^is[A-Z]/.test(e)});function Ul(l,e,a){if(!Z.isObject(l))throw new TypeError("target must be an object");e=e||new FormData,a=Z.toFlatObject(a,{metaTokens:!0,dots:!1,indexes:!1},!1,function(A,T){return!Z.isUndefined(T[A])});const r=a.metaTokens,i=a.visitor||m,o=a.dots,u=a.indexes,f=(a.Blob||typeof Blob<"u"&&Blob)&&Z.isSpecCompliantForm(e);if(!Z.isFunction(i))throw new TypeError("visitor must be a function");function g(S){if(S===null)return"";if(Z.isDate(S))return S.toISOString();if(Z.isBoolean(S))return S.toString();if(!f&&Z.isBlob(S))throw new Ye("Blob is not supported. Use a Buffer instead.");return Z.isArrayBuffer(S)||Z.isTypedArray(S)?f&&typeof Blob=="function"?new Blob([S]):Buffer.from(S):S}function m(S,A,T){let D=S;if(S&&!T&&typeof S=="object"){if(Z.endsWith(A,"{}"))A=r?A:A.slice(0,-2),S=JSON.stringify(S);else if(Z.isArray(S)&&fw(S)||(Z.isFileList(S)||Z.endsWith(A,"[]"))&&(D=Z.toArray(S)))return A=Fg(A),D.forEach(function(O,L){!(Z.isUndefined(O)||O===null)&&e.append(u===!0?Kg([A],L,o):u===null?A:A+"[]",g(O))}),!1}return td(S)?!0:(e.append(Kg(T,A,o),g(S)),!1)}const b=[],v=Object.assign(hw,{defaultVisitor:m,convertValue:g,isVisitable:td});function E(S,A){if(!Z.isUndefined(S)){if(b.indexOf(S)!==-1)throw Error("Circular reference detected in "+A.join("."));b.push(S),Z.forEach(S,function(D,M){(!(Z.isUndefined(D)||D===null)&&i.call(e,D,Z.isString(M)?M.trim():M,A,v))===!0&&E(D,A?A.concat(M):[M])}),b.pop()}}if(!Z.isObject(l))throw new TypeError("data must be an object");return E(l),e}function Wg(l){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(l).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function nd(l,e){this._pairs=[],l&&Ul(l,this,e)}const Yg=nd.prototype;Yg.append=function(e,a){this._pairs.push([e,a])},Yg.toString=function(e){const a=e?function(r){return e.call(this,r,Wg)}:Wg;return this._pairs.map(function(i){return a(i[0])+"="+a(i[1])},"").join("&")};function gw(l){return encodeURIComponent(l).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Xg(l,e,a){if(!e)return l;const r=a&&a.encode||gw;Z.isFunction(a)&&(a={serialize:a});const i=a&&a.serialize;let o;if(i?o=i(e,a):o=Z.isURLSearchParams(e)?e.toString():new nd(e,a).toString(r),o){const u=l.indexOf("#");u!==-1&&(l=l.slice(0,u)),l+=(l.indexOf("?")===-1?"?":"&")+o}return l}class Qg{constructor(){this.handlers=[]}use(e,a,r){return this.handlers.push({fulfilled:e,rejected:a,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Z.forEach(this.handlers,function(r){r!==null&&e(r)})}}const Jg={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},pw={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:nd,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},ad=typeof window<"u"&&typeof document<"u",rd=typeof navigator=="object"&&navigator||void 0,mw=ad&&(!rd||["ReactNative","NativeScript","NS"].indexOf(rd.product)<0),yw=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",bw=ad&&window.location.href||"http://localhost",pn={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ad,hasStandardBrowserEnv:mw,hasStandardBrowserWebWorkerEnv:yw,navigator:rd,origin:bw},Symbol.toStringTag,{value:"Module"})),...pw};function vw(l,e){return Ul(l,new pn.classes.URLSearchParams,{visitor:function(a,r,i,o){return pn.isNode&&Z.isBuffer(a)?(this.append(r,a.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...e})}function Sw(l){return Z.matchAll(/\w+|\[(\w*)]/g,l).map(e=>e[0]==="[]"?"":e[1]||e[0])}function ww(l){const e={},a=Object.keys(l);let r;const i=a.length;let o;for(r=0;r<i;r++)o=a[r],e[o]=l[o];return e}function Zg(l){function e(a,r,i,o){let u=a[o++];if(u==="__proto__")return!0;const d=Number.isFinite(+u),f=o>=a.length;return u=!u&&Z.isArray(i)?i.length:u,f?(Z.hasOwnProp(i,u)?i[u]=[i[u],r]:i[u]=r,!d):((!i[u]||!Z.isObject(i[u]))&&(i[u]=[]),e(a,r,i[u],o)&&Z.isArray(i[u])&&(i[u]=ww(i[u])),!d)}if(Z.isFormData(l)&&Z.isFunction(l.entries)){const a={};return Z.forEachEntry(l,(r,i)=>{e(Sw(r),i,a,0)}),a}return null}function Cw(l,e,a){if(Z.isString(l))try{return(e||JSON.parse)(l),Z.trim(l)}catch(r){if(r.name!=="SyntaxError")throw r}return(a||JSON.stringify)(l)}const eo={transitional:Jg,adapter:["xhr","http","fetch"],transformRequest:[function(e,a){const r=a.getContentType()||"",i=r.indexOf("application/json")>-1,o=Z.isObject(e);if(o&&Z.isHTMLForm(e)&&(e=new FormData(e)),Z.isFormData(e))return i?JSON.stringify(Zg(e)):e;if(Z.isArrayBuffer(e)||Z.isBuffer(e)||Z.isStream(e)||Z.isFile(e)||Z.isBlob(e)||Z.isReadableStream(e))return e;if(Z.isArrayBufferView(e))return e.buffer;if(Z.isURLSearchParams(e))return a.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let d;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return vw(e,this.formSerializer).toString();if((d=Z.isFileList(e))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return Ul(d?{"files[]":e}:e,f&&new f,this.formSerializer)}}return o||i?(a.setContentType("application/json",!1),Cw(e)):e}],transformResponse:[function(e){const a=this.transitional||eo.transitional,r=a&&a.forcedJSONParsing,i=this.responseType==="json";if(Z.isResponse(e)||Z.isReadableStream(e))return e;if(e&&Z.isString(e)&&(r&&!this.responseType||i)){const u=!(a&&a.silentJSONParsing)&&i;try{return JSON.parse(e,this.parseReviver)}catch(d){if(u)throw d.name==="SyntaxError"?Ye.from(d,Ye.ERR_BAD_RESPONSE,this,null,this.response):d}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:pn.classes.FormData,Blob:pn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Z.forEach(["delete","get","head","post","put","patch"],l=>{eo.headers[l]={}});const Ew=Z.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"]),_w=l=>{const e={};let a,r,i;return l&&l.split(`
`).forEach(function(u){i=u.indexOf(":"),a=u.substring(0,i).trim().toLowerCase(),r=u.substring(i+1).trim(),!(!a||e[a]&&Ew[a])&&(a==="set-cookie"?e[a]?e[a].push(r):e[a]=[r]:e[a]=e[a]?e[a]+", "+r:r)}),e},ep=Symbol("internals");function to(l){return l&&String(l).trim().toLowerCase()}function Bl(l){return l===!1||l==null?l:Z.isArray(l)?l.map(Bl):String(l)}function Aw(l){const e=Object.create(null),a=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=a.exec(l);)e[r[1]]=r[2];return e}const xw=l=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(l.trim());function id(l,e,a,r,i){if(Z.isFunction(r))return r.call(this,e,a);if(i&&(e=a),!!Z.isString(e)){if(Z.isString(r))return e.indexOf(r)!==-1;if(Z.isRegExp(r))return r.test(e)}}function Tw(l){return l.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,a,r)=>a.toUpperCase()+r)}function kw(l,e){const a=Z.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(l,r+a,{value:function(i,o,u){return this[r].call(this,e,i,o,u)},configurable:!0})})}let An=class{constructor(e){e&&this.set(e)}set(e,a,r){const i=this;function o(d,f,g){const m=to(f);if(!m)throw new Error("header name must be a non-empty string");const b=Z.findKey(i,m);(!b||i[b]===void 0||g===!0||g===void 0&&i[b]!==!1)&&(i[b||f]=Bl(d))}const u=(d,f)=>Z.forEach(d,(g,m)=>o(g,m,f));if(Z.isPlainObject(e)||e instanceof this.constructor)u(e,a);else if(Z.isString(e)&&(e=e.trim())&&!xw(e))u(_w(e),a);else if(Z.isObject(e)&&Z.isIterable(e)){let d={},f,g;for(const m of e){if(!Z.isArray(m))throw TypeError("Object iterator must return a key-value pair");d[g=m[0]]=(f=d[g])?Z.isArray(f)?[...f,m[1]]:[f,m[1]]:m[1]}u(d,a)}else e!=null&&o(a,e,r);return this}get(e,a){if(e=to(e),e){const r=Z.findKey(this,e);if(r){const i=this[r];if(!a)return i;if(a===!0)return Aw(i);if(Z.isFunction(a))return a.call(this,i,r);if(Z.isRegExp(a))return a.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,a){if(e=to(e),e){const r=Z.findKey(this,e);return!!(r&&this[r]!==void 0&&(!a||id(this,this[r],r,a)))}return!1}delete(e,a){const r=this;let i=!1;function o(u){if(u=to(u),u){const d=Z.findKey(r,u);d&&(!a||id(r,r[d],d,a))&&(delete r[d],i=!0)}}return Z.isArray(e)?e.forEach(o):o(e),i}clear(e){const a=Object.keys(this);let r=a.length,i=!1;for(;r--;){const o=a[r];(!e||id(this,this[o],o,e,!0))&&(delete this[o],i=!0)}return i}normalize(e){const a=this,r={};return Z.forEach(this,(i,o)=>{const u=Z.findKey(r,o);if(u){a[u]=Bl(i),delete a[o];return}const d=e?Tw(o):String(o).trim();d!==o&&delete a[o],a[d]=Bl(i),r[d]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const a=Object.create(null);return Z.forEach(this,(r,i)=>{r!=null&&r!==!1&&(a[i]=e&&Z.isArray(r)?r.join(", "):r)}),a}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,a])=>e+": "+a).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,...a){const r=new this(e);return a.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[ep]=this[ep]={accessors:{}}).accessors,i=this.prototype;function o(u){const d=to(u);r[d]||(kw(i,u),r[d]=!0)}return Z.isArray(e)?e.forEach(o):o(e),this}};An.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Z.reduceDescriptors(An.prototype,({value:l},e)=>{let a=e[0].toUpperCase()+e.slice(1);return{get:()=>l,set(r){this[a]=r}}}),Z.freezeMethods(An);function sd(l,e){const a=this||eo,r=e||a,i=An.from(r.headers);let o=r.data;return Z.forEach(l,function(d){o=d.call(a,o,i.normalize(),e?e.status:void 0)}),i.normalize(),o}function tp(l){return!!(l&&l.__CANCEL__)}function Fi(l,e,a){Ye.call(this,l??"canceled",Ye.ERR_CANCELED,e,a),this.name="CanceledError"}Z.inherits(Fi,Ye,{__CANCEL__:!0});function np(l,e,a){const r=a.config.validateStatus;!a.status||!r||r(a.status)?l(a):e(new Ye("Request failed with status code "+a.status,[Ye.ERR_BAD_REQUEST,Ye.ERR_BAD_RESPONSE][Math.floor(a.status/100)-4],a.config,a.request,a))}function Rw(l){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(l);return e&&e[1]||""}function Dw(l,e){l=l||10;const a=new Array(l),r=new Array(l);let i=0,o=0,u;return e=e!==void 0?e:1e3,function(f){const g=Date.now(),m=r[o];u||(u=g),a[i]=f,r[i]=g;let b=o,v=0;for(;b!==i;)v+=a[b++],b=b%l;if(i=(i+1)%l,i===o&&(o=(o+1)%l),g-u<e)return;const E=m&&g-m;return E?Math.round(v*1e3/E):void 0}}function Ow(l,e){let a=0,r=1e3/e,i,o;const u=(g,m=Date.now())=>{a=m,i=null,o&&(clearTimeout(o),o=null),l(...g)};return[(...g)=>{const m=Date.now(),b=m-a;b>=r?u(g,m):(i=g,o||(o=setTimeout(()=>{o=null,u(i)},r-b)))},()=>i&&u(i)]}const ql=(l,e,a=3)=>{let r=0;const i=Dw(50,250);return Ow(o=>{const u=o.loaded,d=o.lengthComputable?o.total:void 0,f=u-r,g=i(f),m=u<=d;r=u;const b={loaded:u,total:d,progress:d?u/d:void 0,bytes:f,rate:g||void 0,estimated:g&&d&&m?(d-u)/g:void 0,event:o,lengthComputable:d!=null,[e?"download":"upload"]:!0};l(b)},a)},ap=(l,e)=>{const a=l!=null;return[r=>e[0]({lengthComputable:a,total:l,loaded:r}),e[1]]},rp=l=>(...e)=>Z.asap(()=>l(...e)),Lw=pn.hasStandardBrowserEnv?((l,e)=>a=>(a=new URL(a,pn.origin),l.protocol===a.protocol&&l.host===a.host&&(e||l.port===a.port)))(new URL(pn.origin),pn.navigator&&/(msie|trident)/i.test(pn.navigator.userAgent)):()=>!0,Mw=pn.hasStandardBrowserEnv?{write(l,e,a,r,i,o){const u=[l+"="+encodeURIComponent(e)];Z.isNumber(a)&&u.push("expires="+new Date(a).toGMTString()),Z.isString(r)&&u.push("path="+r),Z.isString(i)&&u.push("domain="+i),o===!0&&u.push("secure"),document.cookie=u.join("; ")},read(l){const e=document.cookie.match(new RegExp("(^|;\\s*)("+l+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(l){this.write(l,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function $w(l){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(l)}function Nw(l,e){return e?l.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):l}function ip(l,e,a){let r=!$w(e);return l&&(r||a==!1)?Nw(l,e):e}const sp=l=>l instanceof An?{...l}:l;function di(l,e){e=e||{};const a={};function r(g,m,b,v){return Z.isPlainObject(g)&&Z.isPlainObject(m)?Z.merge.call({caseless:v},g,m):Z.isPlainObject(m)?Z.merge({},m):Z.isArray(m)?m.slice():m}function i(g,m,b,v){if(Z.isUndefined(m)){if(!Z.isUndefined(g))return r(void 0,g,b,v)}else return r(g,m,b,v)}function o(g,m){if(!Z.isUndefined(m))return r(void 0,m)}function u(g,m){if(Z.isUndefined(m)){if(!Z.isUndefined(g))return r(void 0,g)}else return r(void 0,m)}function d(g,m,b){if(b in e)return r(g,m);if(b in l)return r(void 0,g)}const f={url:o,method:o,data:o,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,withXSRFToken:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:d,headers:(g,m,b)=>i(sp(g),sp(m),b,!0)};return Z.forEach(Object.keys({...l,...e}),function(m){const b=f[m]||i,v=b(l[m],e[m],m);Z.isUndefined(v)&&b!==d||(a[m]=v)}),a}const op=l=>{const e=di({},l);let{data:a,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:u,auth:d}=e;if(e.headers=u=An.from(u),e.url=Xg(ip(e.baseURL,e.url,e.allowAbsoluteUrls),l.params,l.paramsSerializer),d&&u.set("Authorization","Basic "+btoa((d.username||"")+":"+(d.password?unescape(encodeURIComponent(d.password)):""))),Z.isFormData(a)){if(pn.hasStandardBrowserEnv||pn.hasStandardBrowserWebWorkerEnv)u.setContentType(void 0);else if(Z.isFunction(a.getHeaders)){const f=a.getHeaders(),g=["content-type","content-length"];Object.entries(f).forEach(([m,b])=>{g.includes(m.toLowerCase())&&u.set(m,b)})}}if(pn.hasStandardBrowserEnv&&(r&&Z.isFunction(r)&&(r=r(e)),r||r!==!1&&Lw(e.url))){const f=i&&o&&Mw.read(o);f&&u.set(i,f)}return e},Hw=typeof XMLHttpRequest<"u"&&function(l){return new Promise(function(a,r){const i=op(l);let o=i.data;const u=An.from(i.headers).normalize();let{responseType:d,onUploadProgress:f,onDownloadProgress:g}=i,m,b,v,E,S;function A(){E&&E(),S&&S(),i.cancelToken&&i.cancelToken.unsubscribe(m),i.signal&&i.signal.removeEventListener("abort",m)}let T=new XMLHttpRequest;T.open(i.method.toUpperCase(),i.url,!0),T.timeout=i.timeout;function D(){if(!T)return;const O=An.from("getAllResponseHeaders"in T&&T.getAllResponseHeaders()),P={data:!d||d==="text"||d==="json"?T.responseText:T.response,status:T.status,statusText:T.statusText,headers:O,config:l,request:T};np(function(B){a(B),A()},function(B){r(B),A()},P),T=null}"onloadend"in T?T.onloadend=D:T.onreadystatechange=function(){!T||T.readyState!==4||T.status===0&&!(T.responseURL&&T.responseURL.indexOf("file:")===0)||setTimeout(D)},T.onabort=function(){T&&(r(new Ye("Request aborted",Ye.ECONNABORTED,l,T)),T=null)},T.onerror=function(L){const P=L&&L.message?L.message:"Network Error",U=new Ye(P,Ye.ERR_NETWORK,l,T);U.event=L||null,r(U),T=null},T.ontimeout=function(){let L=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const P=i.transitional||Jg;i.timeoutErrorMessage&&(L=i.timeoutErrorMessage),r(new Ye(L,P.clarifyTimeoutError?Ye.ETIMEDOUT:Ye.ECONNABORTED,l,T)),T=null},o===void 0&&u.setContentType(null),"setRequestHeader"in T&&Z.forEach(u.toJSON(),function(L,P){T.setRequestHeader(P,L)}),Z.isUndefined(i.withCredentials)||(T.withCredentials=!!i.withCredentials),d&&d!=="json"&&(T.responseType=i.responseType),g&&([v,S]=ql(g,!0),T.addEventListener("progress",v)),f&&T.upload&&([b,E]=ql(f),T.upload.addEventListener("progress",b),T.upload.addEventListener("loadend",E)),(i.cancelToken||i.signal)&&(m=O=>{T&&(r(!O||O.type?new Fi(null,l,T):O),T.abort(),T=null)},i.cancelToken&&i.cancelToken.subscribe(m),i.signal&&(i.signal.aborted?m():i.signal.addEventListener("abort",m)));const M=Rw(i.url);if(M&&pn.protocols.indexOf(M)===-1){r(new Ye("Unsupported protocol "+M+":",Ye.ERR_BAD_REQUEST,l));return}T.send(o||null)})},zw=(l,e)=>{const{length:a}=l=l?l.filter(Boolean):[];if(e||a){let r=new AbortController,i;const o=function(g){if(!i){i=!0,d();const m=g instanceof Error?g:this.reason;r.abort(m instanceof Ye?m:new Fi(m instanceof Error?m.message:m))}};let u=e&&setTimeout(()=>{u=null,o(new Ye(`timeout ${e} of ms exceeded`,Ye.ETIMEDOUT))},e);const d=()=>{l&&(u&&clearTimeout(u),u=null,l.forEach(g=>{g.unsubscribe?g.unsubscribe(o):g.removeEventListener("abort",o)}),l=null)};l.forEach(g=>g.addEventListener("abort",o));const{signal:f}=r;return f.unsubscribe=()=>Z.asap(d),f}},Iw=function*(l,e){let a=l.byteLength;if(a<e){yield l;return}let r=0,i;for(;r<a;)i=r+e,yield l.slice(r,i),r=i},jw=async function*(l,e){for await(const a of Uw(l))yield*Iw(a,e)},Uw=async function*(l){if(l[Symbol.asyncIterator]){yield*l;return}const e=l.getReader();try{for(;;){const{done:a,value:r}=await e.read();if(a)break;yield r}}finally{await e.cancel()}},lp=(l,e,a,r)=>{const i=jw(l,e);let o=0,u,d=f=>{u||(u=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:g,value:m}=await i.next();if(g){d(),f.close();return}let b=m.byteLength;if(a){let v=o+=b;a(v)}f.enqueue(new Uint8Array(m))}catch(g){throw d(g),g}},cancel(f){return d(f),i.return()}},{highWaterMark:2})},cp=64*1024,{isFunction:Pl}=Z,Bw=(({Request:l,Response:e})=>({Request:l,Response:e}))(Z.global),{ReadableStream:up,TextEncoder:dp}=Z.global,fp=(l,...e)=>{try{return!!l(...e)}catch{return!1}},qw=l=>{l=Z.merge.call({skipUndefined:!0},Bw,l);const{fetch:e,Request:a,Response:r}=l,i=e?Pl(e):typeof fetch=="function",o=Pl(a),u=Pl(r);if(!i)return!1;const d=i&&Pl(up),f=i&&(typeof dp=="function"?(S=>A=>S.encode(A))(new dp):async S=>new Uint8Array(await new a(S).arrayBuffer())),g=o&&d&&fp(()=>{let S=!1;const A=new a(pn.origin,{body:new up,method:"POST",get duplex(){return S=!0,"half"}}).headers.has("Content-Type");return S&&!A}),m=u&&d&&fp(()=>Z.isReadableStream(new r("").body)),b={stream:m&&(S=>S.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(S=>{!b[S]&&(b[S]=(A,T)=>{let D=A&&A[S];if(D)return D.call(A);throw new Ye(`Response type '${S}' is not supported`,Ye.ERR_NOT_SUPPORT,T)})});const v=async S=>{if(S==null)return 0;if(Z.isBlob(S))return S.size;if(Z.isSpecCompliantForm(S))return(await new a(pn.origin,{method:"POST",body:S}).arrayBuffer()).byteLength;if(Z.isArrayBufferView(S)||Z.isArrayBuffer(S))return S.byteLength;if(Z.isURLSearchParams(S)&&(S=S+""),Z.isString(S))return(await f(S)).byteLength},E=async(S,A)=>{const T=Z.toFiniteNumber(S.getContentLength());return T??v(A)};return async S=>{let{url:A,method:T,data:D,signal:M,cancelToken:O,timeout:L,onDownloadProgress:P,onUploadProgress:U,responseType:B,headers:Y,withCredentials:ge="same-origin",fetchOptions:Ae}=op(S),Oe=e||fetch;B=B?(B+"").toLowerCase():"text";let Ne=zw([M,O&&O.toAbortSignal()],L),He=null;const Ze=Ne&&Ne.unsubscribe&&(()=>{Ne.unsubscribe()});let pt;try{if(U&&g&&T!=="get"&&T!=="head"&&(pt=await E(Y,D))!==0){let x=new a(A,{method:"POST",body:D,duplex:"half"}),F;if(Z.isFormData(D)&&(F=x.headers.get("content-type"))&&Y.setContentType(F),x.body){const[ue,fe]=ap(pt,ql(rp(U)));D=lp(x.body,cp,ue,fe)}}Z.isString(ge)||(ge=ge?"include":"omit");const J=o&&"credentials"in a.prototype,de={...Ae,signal:Ne,method:T.toUpperCase(),headers:Y.normalize().toJSON(),body:D,duplex:"half",credentials:J?ge:void 0};He=o&&new a(A,de);let me=await(o?Oe(He,Ae):Oe(A,de));const ne=m&&(B==="stream"||B==="response");if(m&&(P||ne&&Ze)){const x={};["status","statusText","headers"].forEach(te=>{x[te]=me[te]});const F=Z.toFiniteNumber(me.headers.get("content-length")),[ue,fe]=P&&ap(F,ql(rp(P),!0))||[];me=new r(lp(me.body,cp,ue,()=>{fe&&fe(),Ze&&Ze()}),x)}B=B||"text";let pe=await b[Z.findKey(b,B)||"text"](me,S);return!ne&&Ze&&Ze(),await new Promise((x,F)=>{np(x,F,{data:pe,headers:An.from(me.headers),status:me.status,statusText:me.statusText,config:S,request:He})})}catch(J){throw Ze&&Ze(),J&&J.name==="TypeError"&&/Load failed|fetch/i.test(J.message)?Object.assign(new Ye("Network Error",Ye.ERR_NETWORK,S,He),{cause:J.cause||J}):Ye.from(J,J&&J.code,S,He)}}},Pw=new Map,hp=l=>{let e=l?l.env:{};const{fetch:a,Request:r,Response:i}=e,o=[r,i,a];let u=o.length,d=u,f,g,m=Pw;for(;d--;)f=o[d],g=m.get(f),g===void 0&&m.set(f,g=d?new Map:qw(e)),m=g;return g};hp();const od={http:dw,xhr:Hw,fetch:{get:hp}};Z.forEach(od,(l,e)=>{if(l){try{Object.defineProperty(l,"name",{value:e})}catch{}Object.defineProperty(l,"adapterName",{value:e})}});const gp=l=>`- ${l}`,Gw=l=>Z.isFunction(l)||l===null||l===!1,pp={getAdapter:(l,e)=>{l=Z.isArray(l)?l:[l];const{length:a}=l;let r,i;const o={};for(let u=0;u<a;u++){r=l[u];let d;if(i=r,!Gw(r)&&(i=od[(d=String(r)).toLowerCase()],i===void 0))throw new Ye(`Unknown adapter '${d}'`);if(i&&(Z.isFunction(i)||(i=i.get(e))))break;o[d||"#"+u]=i}if(!i){const u=Object.entries(o).map(([f,g])=>`adapter ${f} `+(g===!1?"is not supported by the environment":"is not available in the build"));let d=a?u.length>1?`since :
`+u.map(gp).join(`
`):" "+gp(u[0]):"as no adapter specified";throw new Ye("There is no suitable adapter to dispatch the request "+d,"ERR_NOT_SUPPORT")}return i},adapters:od};function ld(l){if(l.cancelToken&&l.cancelToken.throwIfRequested(),l.signal&&l.signal.aborted)throw new Fi(null,l)}function mp(l){return ld(l),l.headers=An.from(l.headers),l.data=sd.call(l,l.transformRequest),["post","put","patch"].indexOf(l.method)!==-1&&l.headers.setContentType("application/x-www-form-urlencoded",!1),pp.getAdapter(l.adapter||eo.adapter,l)(l).then(function(r){return ld(l),r.data=sd.call(l,l.transformResponse,r),r.headers=An.from(r.headers),r},function(r){return tp(r)||(ld(l),r&&r.response&&(r.response.data=sd.call(l,l.transformResponse,r.response),r.response.headers=An.from(r.response.headers))),Promise.reject(r)})}const yp="1.12.2",Gl={};["object","boolean","number","function","string","symbol"].forEach((l,e)=>{Gl[l]=function(r){return typeof r===l||"a"+(e<1?"n ":" ")+l}});const bp={};Gl.transitional=function(e,a,r){function i(o,u){return"[Axios v"+yp+"] Transitional option '"+o+"'"+u+(r?". "+r:"")}return(o,u,d)=>{if(e===!1)throw new Ye(i(u," has been removed"+(a?" in "+a:"")),Ye.ERR_DEPRECATED);return a&&!bp[u]&&(bp[u]=!0,console.warn(i(u," has been deprecated since v"+a+" and will be removed in the near future"))),e?e(o,u,d):!0}},Gl.spelling=function(e){return(a,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function Vw(l,e,a){if(typeof l!="object")throw new Ye("options must be an object",Ye.ERR_BAD_OPTION_VALUE);const r=Object.keys(l);let i=r.length;for(;i-- >0;){const o=r[i],u=e[o];if(u){const d=l[o],f=d===void 0||u(d,o,l);if(f!==!0)throw new Ye("option "+o+" must be "+f,Ye.ERR_BAD_OPTION_VALUE);continue}if(a!==!0)throw new Ye("Unknown option "+o,Ye.ERR_BAD_OPTION)}}const Vl={assertOptions:Vw,validators:Gl},Ma=Vl.validators;let fi=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Qg,response:new Qg}}async request(e,a){try{return await this._request(e,a)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
`+o):r.stack=o}catch{}}throw r}}_request(e,a){typeof e=="string"?(a=a||{},a.url=e):a=e||{},a=di(this.defaults,a);const{transitional:r,paramsSerializer:i,headers:o}=a;r!==void 0&&Vl.assertOptions(r,{silentJSONParsing:Ma.transitional(Ma.boolean),forcedJSONParsing:Ma.transitional(Ma.boolean),clarifyTimeoutError:Ma.transitional(Ma.boolean)},!1),i!=null&&(Z.isFunction(i)?a.paramsSerializer={serialize:i}:Vl.assertOptions(i,{encode:Ma.function,serialize:Ma.function},!0)),a.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?a.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:a.allowAbsoluteUrls=!0),Vl.assertOptions(a,{baseUrl:Ma.spelling("baseURL"),withXsrfToken:Ma.spelling("withXSRFToken")},!0),a.method=(a.method||this.defaults.method||"get").toLowerCase();let u=o&&Z.merge(o.common,o[a.method]);o&&Z.forEach(["delete","get","head","post","put","patch","common"],S=>{delete o[S]}),a.headers=An.concat(u,o);const d=[];let f=!0;this.interceptors.request.forEach(function(A){typeof A.runWhen=="function"&&A.runWhen(a)===!1||(f=f&&A.synchronous,d.unshift(A.fulfilled,A.rejected))});const g=[];this.interceptors.response.forEach(function(A){g.push(A.fulfilled,A.rejected)});let m,b=0,v;if(!f){const S=[mp.bind(this),void 0];for(S.unshift(...d),S.push(...g),v=S.length,m=Promise.resolve(a);b<v;)m=m.then(S[b++],S[b++]);return m}v=d.length;let E=a;for(;b<v;){const S=d[b++],A=d[b++];try{E=S(E)}catch(T){A.call(this,T);break}}try{m=mp.call(this,E)}catch(S){return Promise.reject(S)}for(b=0,v=g.length;b<v;)m=m.then(g[b++],g[b++]);return m}getUri(e){e=di(this.defaults,e);const a=ip(e.baseURL,e.url,e.allowAbsoluteUrls);return Xg(a,e.params,e.paramsSerializer)}};Z.forEach(["delete","get","head","options"],function(e){fi.prototype[e]=function(a,r){return this.request(di(r||{},{method:e,url:a,data:(r||{}).data}))}}),Z.forEach(["post","put","patch"],function(e){function a(r){return function(o,u,d){return this.request(di(d||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:u}))}}fi.prototype[e]=a(),fi.prototype[e+"Form"]=a(!0)});let Fw=class nS{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let a;this.promise=new Promise(function(o){a=o});const r=this;this.promise.then(i=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const u=new Promise(d=>{r.subscribe(d),o=d}).then(i);return u.cancel=function(){r.unsubscribe(o)},u},e(function(o,u,d){r.reason||(r.reason=new Fi(o,u,d),a(r.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 a=this._listeners.indexOf(e);a!==-1&&this._listeners.splice(a,1)}toAbortSignal(){const e=new AbortController,a=r=>{e.abort(r)};return this.subscribe(a),e.signal.unsubscribe=()=>this.unsubscribe(a),e.signal}static source(){let e;return{token:new nS(function(i){e=i}),cancel:e}}};function Kw(l){return function(a){return l.apply(null,a)}}function Ww(l){return Z.isObject(l)&&l.isAxiosError===!0}const cd={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};Object.entries(cd).forEach(([l,e])=>{cd[e]=l});function vp(l){const e=new fi(l),a=Ng(fi.prototype.request,e);return Z.extend(a,fi.prototype,e,{allOwnKeys:!0}),Z.extend(a,e,null,{allOwnKeys:!0}),a.create=function(i){return vp(di(l,i))},a}const jt=vp(eo);jt.Axios=fi,jt.CanceledError=Fi,jt.CancelToken=Fw,jt.isCancel=tp,jt.VERSION=yp,jt.toFormData=Ul,jt.AxiosError=Ye,jt.Cancel=jt.CanceledError,jt.all=function(e){return Promise.all(e)},jt.spread=Kw,jt.isAxiosError=Ww,jt.mergeConfig=di,jt.AxiosHeaders=An,jt.formToJSON=l=>Zg(Z.isHTMLForm(l)?new FormData(l):l),jt.getAdapter=pp.getAdapter,jt.HttpStatusCode=cd,jt.default=jt;const{Axios:lx,AxiosError:cx,CanceledError:ux,isCancel:dx,CancelToken:fx,VERSION:hx,all:gx,Cancel:px,isAxiosError:mx,spread:yx,toFormData:bx,AxiosHeaders:vx,HttpStatusCode:Sx,formToJSON:wx,getAdapter:Cx,mergeConfig:Ex}=jt,ud="g7.identity.redirectStash",Fl=dt("IdentityGuardInterceptor");class bt{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 a=this.deferredResolver;if(!a){Fl.warn("IdentityGuardInterceptor.resolveDeferred 호출됐지만 대기 중인 launcher 가 없습니다. 모달이 launcher 외부에서 열렸는지 확인하세요.");return}this.deferredResolver=null,a(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,a){return e===428&&typeof a=="object"&&a!==null&&a.error_code==="identity_verification_required"}static async handle(e,a,r){this.domainNoticeShown=!1;const i=this.launcher??Xw,u=!!(r&&(r.email||r.phone))?{...e.verification,target:r}:e.verification,d=await i(u);if(d.status!=="verified")return null;const f=u.return_request;if(!f)return null;const g=Yw(f.url,d.token);return fetch(g,{method:f.method,headers:a?.headers??{Accept:"application/json","Content-Type":"application/json"},body:a?.body,credentials:a?.credentials??"same-origin"})}static redirectExternally(e){const a=e.redirect_url;if(!a)return Fl.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 r={return_url:window.location.href,payload:e,stashed_at:Date.now()};try{window.sessionStorage?.setItem(ud,JSON.stringify(r))}catch(i){Fl.warn("sessionStorage 접근 실패 — stash 없이 redirect 합니다.",i)}window.location.href=a}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}}$(bt,"launcher",null),$(bt,"deferredResolver",null),$(bt,"domainNoticeShown",!1);function Yw(l,e){if(!e)return l;try{const a=typeof window<"u"?window.location.origin:"http://localhost",r=new URL(l,a);return r.searchParams.set("verification_token",e),/^https?:\/\//i.test(l)?r.toString():`${r.pathname}${r.search}${r.hash}`}catch{const a=l.includes("?")?"&":"?";return`${l}${a}verification_token=${encodeURIComponent(e)}`}}const Xw=async l=>{if(typeof window>"u")return{status:"cancelled"};if(l.render_hint==="external_redirect"||l.redirect_url)return bt.redirectExternally(l);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 a=window.location.href,r={return_url:a,payload:l,stashed_at:Date.now()};try{window.sessionStorage?.setItem(ud,JSON.stringify(r))}catch{}const i=`/identity/challenge?return=${encodeURIComponent(a)}`;try{await e.dispatch({handler:"navigate",params:{path:i}})}catch(o){Fl.warn("navigate 실패 — window.location 으로 폴백",o),window.location.href=i}return new Promise(()=>{})},Qw=dt("ApiClient");function dd(){return typeof window<"u"&&window.__G7_DEVTOOLS__?window.__G7_DEVTOOLS__:null}class Jw{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=jt.create({baseURL:this.config.baseURL,timeout:this.config.timeout,headers:{"Content-Type":"application/json",Accept:"application/json"},paramsSerializer:{serialize:a=>{const r=[];for(const[i,o]of Object.entries(a))if(o!=null)if(Array.isArray(o)){const u=i.endsWith("[]")?i:`${i}[]`;for(const d of o)r.push(`${encodeURIComponent(u)}=${encodeURIComponent(String(d))}`)}else r.push(`${encodeURIComponent(i)}=${encodeURIComponent(String(o))}`);return r.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 a=this.getToken();if(a&&e.headers&&(e.headers.Authorization=`Bearer ${a}`),typeof window<"u"&&e.headers){const i=localStorage.getItem("g7_locale");i&&(e.headers["Accept-Language"]=i)}const r=dd();if(r?.isEnabled()){const i=this.buildFullUrl(e),o=(e.method||"GET").toUpperCase(),u=r.trackRequest(i,o,{requestBody:e.data});e._devToolsRequestId=u}return e},e=>Promise.reject(e)),this.client.interceptors.response.use(e=>{const a=e.config,r=a._devToolsRequestId;if(r){const i=dd();i?.isEnabled()&&i.completeRequest(r,e.status,e.data),a._devToolsRequestId=null}return e},async e=>{const a=e.config,r=a?.url||"",o=["/auth/","/layouts/"].some(u=>r.includes(u));if(e.response?.status===401&&!a?._retry&&!o){if(a._retry=!0,await ga.getInstance().refreshToken()){const f=this.getToken();return f&&(a.headers.Authorization=`Bearer ${f}`),a._devToolsRequestId=null,this.client(a)}return this.completeDevToolsRequest(a,e),this.removeToken(),this.config.onUnauthorized&&this.config.onUnauthorized(),Promise.reject(e)}if(e.response?.status===401&&o)return this.completeDevToolsRequest(a,e),Promise.reject(e);if(bt.isIdentityRequired(e.response?.status,e.response?.data)){this.completeDevToolsRequest(a,e);const u={},d=a?.headers??{};for(const[v,E]of Object.entries(d))typeof E=="string"&&(u[v]=E);let f;a?.data!==void 0&&a?.data!==null&&(f=typeof a.data=="string"?a.data:JSON.stringify(a.data),u["Content-Type"]=u["Content-Type"]??"application/json");const g=a?.identity_target,m=await bt.handle(e.response.data,{headers:u,body:f,credentials:"same-origin"},g);if(!m)return Promise.reject(e);let b=null;try{b=await m.json()}catch{b=null}return m.ok?{...e.response,status:m.status,data:b}:Promise.reject(Object.assign(new Error("replay failed"),{response:{status:m.status,data:b}}))}return e.response?.status===403?(this.completeDevToolsRequest(a,e),this.callOnError(e),Promise.reject(e)):(this.completeDevToolsRequest(a,e),e.response&&this.callOnError(e),Promise.reject(e))})}async get(e,a){return(await this.client.get(e,a)).data}async post(e,a,r){return(await this.client.post(e,a,r)).data}async put(e,a,r){return(await this.client.put(e,a,r)).data}async patch(e,a,r){return(await this.client.patch(e,a,r)).data}async delete(e,a){return(await this.client.delete(e,a)).data}getInstance(){return this.client}setOnUnauthorized(e){this.config.onUnauthorized=e}setOnError(e){this.config.onError=e}completeDevToolsRequest(e,a){if(!e?._devToolsRequestId)return;const r=dd();if(!r?.isEnabled())return;const i=e._devToolsRequestId;e._devToolsRequestId=null,a.response?r.completeRequest(i,a.response.status,a.response.data):a.request?r.failRequest(i,a.message||"Network error"):r.failRequest(i,a.message||"Request error")}buildFullUrl(e){let a=e.url||"";if(e.baseURL&&!a.startsWith("http")&&(a=`${e.baseURL}${a.startsWith("/")?"":"/"}${a}`),e.params&&typeof e.params=="object"){const r=e.params,i=[];for(const[o,u]of Object.entries(r))if(u!=null)if(Array.isArray(u)){const d=o.endsWith("[]")?o:`${o}[]`;for(const f of u)i.push(`${encodeURIComponent(d)}=${encodeURIComponent(String(f))}`)}else i.push(`${encodeURIComponent(o)}=${encodeURIComponent(String(u))}`);i.length>0&&(a+=(a.includes("?")?"&":"?")+i.join("&"))}return a}callOnError(e){if(!this.config.onError)return;const a={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(a)}catch(r){Qw.error("Error in onError handler:",r)}}}let fd=null;function $a(){return fd||(fd=new Jw),fd}const no=dt("AuthManager");function Ki(l,e,a,r){try{window.G7Core?.devTools?.trackAuthEvent?.(l,e,a,r)}catch{}}const Kl={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"}},Ca=class Ca{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",Kl.admin),this.config.set("user",Kl.user)}static getInstance(){return Ca.instance||(Ca.instance=new Ca),Ca.instance}on(e,a){this.eventHandlers.has(e)||this.eventHandlers.set(e,[]),this.eventHandlers.get(e).push(a)}emit(e,...a){const r=this.eventHandlers.get(e);r&&r.forEach(i=>i(...a))}isAuthenticated(){return this.state.isAuthenticated}getUser(){return this.state.user}getAuthType(){return this.state.type}async checkAuth(e){const a=$a();if(!a.getToken())return this.clearState(),!1;const i=this.config.get(e);if(!i)return no.error(`Unknown auth type: ${e}`),!1;try{const o=await a.get(i.userEndpoint);return o.success&&o.data?(this.state={isAuthenticated:!0,user:o.data,type:e},this.emit("authStateChange",this.state),!0):(this.clearState(),!1)}catch(o){return o.response?.status===401&&await this.refreshToken()?this.checkAuth(e):(this.clearState(),!1)}}async preloadAuth(e){try{return await this.checkAuth(e)}catch(a){return no.warn(`Preload auth failed for type ${e}:`,a),!1}}async login(e,a,r){const i=$a();if(!this.config.get(e))throw new Error(`Unknown auth type: ${e}`);const u=e==="admin"?Kl.admin.loginEndpoint:Kl.user.loginEndpoint;try{const d=r?.headers?{headers:r.headers}:void 0,f=await i.post(u,a,d);if(f.success&&f.data){i.setToken(f.data.token);const g=f.data.user.language,m=localStorage.getItem(Ca.LOCALE_STORAGE_KEY),b=g&&g!==m;if(g)try{localStorage.setItem(Ca.LOCALE_STORAGE_KEY,g)}catch(v){no.warn("Failed to save user language to localStorage:",v)}return this.state={isAuthenticated:!0,user:f.data.user,type:e},this.emit("login",this.state),this.emit("authStateChange",this.state),Ki("login",!0,void 0,{userId:f.data.user.uuid,email:f.data.user.email,type:e}),b&&window.__templateApp&&window.__templateApp.changeLocale(g),f.data.user}throw new Error("Login failed")}catch(d){this.clearState();const f=d.response?.data?.message,g=new Error(f||d.message||"Login failed");throw g.response=d.response,g.status=d.response?.status,Ki("login",!1,g.message,{type:e,status:d.response?.status}),g}}async logout(){const e=$a(),a=this.state.type?this.config.get(this.state.type):null;try{a&&await e.post(a.logoutEndpoint)}catch(r){no.warn("Logout API call failed:",r)}finally{e.removeToken();const r={...this.state};if(this.clearState(),this.emit("logout",r),this.emit("authStateChange",this.state),Ki("logout",!0,void 0,{previousType:r.type}),a&&r.type){const i=window.location.pathname+window.location.search;window.location.href=this.getLoginRedirectUrl(r.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 a=this.config.get(e);if(!a)return!1;const r=$a();try{const i=await r.post(a.refreshEndpoint);return i.success&&i.data?.token?(r.setToken(i.data.token),this.emit("tokenRefreshed"),Ki("token-refresh",!0,void 0,{type:e}),!0):(Ki("token-refresh",!1,"No token in response",{type:e}),!1)}catch(i){return no.error("Token refresh failed:",i),Ki("token-refresh",!1,i instanceof Error?i.message:"Unknown error",{type:e}),!1}}getLoginRedirectUrl(e,a,r){const i=this.config.get(e);if(!i)return"/login";const o=encodeURIComponent(a);let u=`${i.loginPath}?redirect=${o}`;return r&&(u+=`&reason=${encodeURIComponent(r)}`),u}updateConfig(e,a){if(a.loginPath!==void 0){const i=a.loginPath;if(!i.startsWith("/")||i.startsWith("//"))throw new Error(`AuthManager.updateConfig: loginPath must be a same-origin path starting with '/' (got: ${i})`)}const r=this.config.get(e);r&&this.config.set(e,{...r,...a})}getRedirectUrl(e){const r=this.config.get(e)?.defaultPath||"/",o=new URLSearchParams(window.location.search).get("redirect");if(o)try{const u=decodeURIComponent(o);if(u.startsWith("/"))return u}catch{}return r}getConfig(e){return this.config.get(e)}clearState(){this.state={isAuthenticated:!1,user:null,type:null}}static resetInstance(){Ca.instance=null}};$(Ca,"instance"),$(Ca,"LOCALE_STORAGE_KEY","g7_locale");let ga=Ca;const Sp={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}}"}}},Xa={findHandler(l,e){if(l){if(l[e])return l[e];if(l[String(e)])return l[String(e)];if(l.default)return l.default}},normalizeOnError(l){return l?Array.isArray(l)?l:[l]:[]},injectErrorCode(l,e,a){if(l.handler!=="showErrorPage"||l.params?.errorCode!==void 0)return l;const r=typeof e=="string"?parseInt(e,10):e,i=isNaN(r)?a:r;return i===void 0?l:{...l,params:{...l.params,errorCode:i}}}},pa=dt("ErrorHandlingResolver"),Rr=class Rr{constructor(){$(this,"templateErrorHandling",null);$(this,"layoutErrorHandling",null);$(this,"executeAction",null)}static getInstance(){return Rr.instance||(Rr.instance=new Rr),Rr.instance}static resetInstance(){Rr.instance=null}setTemplateConfig(e){this.templateErrorHandling=e,pa.log("Template config set:",e)}setLayoutConfig(e){this.layoutErrorHandling=e,pa.log("Layout config set:",e)}setActionExecutor(e){this.executeAction=e}resolve(e,a={}){const{errorHandling:r,onError:i}=a;pa.log("Resolving error:",e,{hasActionErrorHandling:!!r,hasActionOnError:!!i,hasLayoutConfig:!!this.layoutErrorHandling,hasTemplateConfig:!!this.templateErrorHandling});let o=Xa.findHandler(r,e);if(o){const u=this.getMatchedKey(r,e);return{handler:Xa.injectErrorCode(o,u,e),level:"action",matchedKey:u}}if(i){const u=Xa.normalizeOnError(i);if(u.length>0)return{handler:u.length===1?u[0]:{handler:"sequence",actions:u},level:"action",matchedKey:"onError"}}if(o=Xa.findHandler(this.layoutErrorHandling||void 0,e),o){const u=this.getMatchedKey(this.layoutErrorHandling,e);return{handler:Xa.injectErrorCode(o,u,e),level:"layout",matchedKey:u}}if(o=Xa.findHandler(this.templateErrorHandling||void 0,e),o){const u=this.getMatchedKey(this.templateErrorHandling,e);return{handler:Xa.injectErrorCode(o,u,e),level:"template",matchedKey:u}}if(o=Xa.findHandler(Sp,e),o){const u=this.getMatchedKey(Sp,e);return{handler:Xa.injectErrorCode(o,u,e),level:"system",matchedKey:u}}return{handler:null,level:null,matchedKey:null}}async execute(e,a){if(!this.executeAction){pa.error("Action executor is not set");return}pa.log("Executing handler:",e.handler,{errorContext:a});try{return await this.executeAction(e,{error:a})}catch(r){throw pa.error("Failed to execute handler:",r),r}}async resolveAndExecute(e,a,r={}){const i=this.resolve(e,r);if(pa.log("Resolve result:",{errorCode:e,handler:i.handler?.handler,level:i.level,matchedKey:i.matchedKey}),!i.handler)return pa.warn("No handler found for error:",e),{handled:!1};try{return{handled:!0,result:await this.execute(i.handler,a)}}catch(o){return pa.error("Handler execution failed:",o),{handled:!1}}}getMatchedKey(e,a){return e[a]?a:e[String(a)]?String(a):"default"}clearLayoutConfig(){this.layoutErrorHandling=null,pa.log("Layout config cleared")}clearAllConfig(){this.templateErrorHandling=null,this.layoutErrorHandling=null,pa.log("All config cleared")}getConfigStatus(){return{hasTemplate:this.templateErrorHandling!==null,hasLayout:this.layoutErrorHandling!==null,hasExecutor:this.executeAction!==null}}};$(Rr,"instance",null);let hd=Rr;function ma(){return hd.getInstance()}var gd={exports:{}},ao={};/**
* @license React
* react-jsx-runtime.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var wp;function Zw(){if(wp)return ao;wp=1;var l=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function a(r,i,o){var u=null;if(o!==void 0&&(u=""+o),i.key!==void 0&&(u=""+i.key),"key"in i){o={};for(var d in i)d!=="key"&&(o[d]=i[d])}else o=i;return i=o.ref,{$$typeof:l,type:r,key:u,ref:i!==void 0?i:null,props:o}}return ao.Fragment=e,ao.jsx=a,ao.jsxs=a,ao}var Cp;function e0(){return Cp||(Cp=1,gd.exports=Zw()),gd.exports}var ct=e0();const t0=Ka({__proto__:null,default:Wa(ct)},[ct]),pd=dt("ParentContextProvider"),Ep=N.createContext(null);let Wl=null;function md(){Wl?(pd.log("[triggerModalParentUpdate] 모달 부모 컨텍스트 업데이트 트리거"),Wl()):pd.warn("[triggerModalParentUpdate] Provider가 아직 마운트되지 않음")}const _p=({children:l})=>{const[e,a]=N.useState(0),r=N.useRef(!0),i=N.useCallback(()=>{const u=window.__g7LayoutContextStack||[];return u[u.length-1]?.dataContext},[]);N.useEffect(()=>(r.current=!0,Wl=()=>{r.current&&(a(u=>u+1),pd.log("[ParentContextProvider] 버전 업데이트됨"))},()=>{r.current=!1,Wl=null}),[]);const o={version:e,getParentDataContext:i};return ct.jsx(Ep.Provider,{value:o,children:l})};function n0(){return N.useContext(Ep)}const z=dt("ActionDispatcher"),Ap=new Set(["navigate","navigateBack","navigateForward","replaceUrl","refresh","logout"]),a0=new Set(["redirect"]);function jn(){try{return window.G7Core?.devTools}catch{return}}class Mt extends Error{constructor(e,a,r){super(e),this.action=a,this.originalError=r,this.name="ActionError"}}const ns=class ns{constructor(e={},a,r){$(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 vn,this.translationEngine=a,this.translationContext=r,this.defaultContext=e,this.registerDefaultHandlers(),this.setupErrorHandling()}setGlobalHeaders(e){this.globalHeaders=e||[]}setNamedActions(e){this.namedActions=e||{};const a=jn();a?.isEnabled?.()&&a.setNamedActionDefinitions?.(this.namedActions),z.log("[setNamedActions] registered:",Object.keys(this.namedActions))}getNamedActions(){return this.namedActions}setPreviewMode(e){this.previewMode=e,z.log("Preview mode:",e?"enabled":"disabled")}isPreviewMode(){return this.previewMode}static getPreviewSuppressedHandlers(){return Ap}static getPreviewSuppressedLayoutFeatures(){return a0}resolveActionRef(e){if(!e.actionRef)return e;const a=this.namedActions[e.actionRef];if(!a)return z.warn(`[resolveActionRef] named action not found: "${e.actionRef}"`),e;const r=jn();r?.isEnabled?.()&&r.trackNamedActionRef?.({actionRefName:e.actionRef,resolvedHandler:a.handler,timestamp:Date.now()});const{actionRef:i,type:o,key:u,event:d,...f}=e,g={...a,...Object.fromEntries(Object.entries(f).filter(([,m])=>m!==void 0)),type:o??a.type};return u!==void 0&&(g.key=u),d!==void 0&&(g.event=d),g}matchesPattern(e,a){if(a==="*")return!0;const r=a.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*");return new RegExp(`^${r}$`).test(e)}getMatchingGlobalHeaders(e,a){const r={};for(const i of this.globalHeaders)this.matchesPattern(e,i.pattern)&&Object.entries(i.headers).forEach(([o,u])=>{const d=Pi(u,a,{skipCache:!0});d!=null&&d!==""&&(r[o]=String(d))});return r}setupErrorHandling(){if(this.errorHandlingSetup)return;ma().setActionExecutor(async(a,r)=>{const i={type:"click",handler:a.handler,target:a.target,params:a.params,actions:a.actions},o={data:{...this.defaultContext.data,error:r.error}};return await this.dispatchAction(i,o)}),this.errorHandlingSetup=!0}registerDefaultHandlers(){this.registerHandler("refetchDataSource",async(a,r)=>{const i=a.params?.dataSourceId,o=a.params?.sync;if(!i){z.warn("refetchDataSource: dataSourceId is required");return}if(typeof window<"u"&&window.G7Core?.dataSource?.refetch){const u=window.G7Core?.state?.get?.()||{},d={...r.state?._global,...u},f=window.G7Core?.state?.getLocal?.()||{},g=r.data?._local||r.state||{},m={...f,...g},b=r.isolatedContext?.state;z.log("[refetchDataSource] localStateOverride:",m),await window.G7Core.dataSource.refetch(i,{...o?{sync:!0}:{},...d?{globalStateOverride:d}:{},...m?{localStateOverride:m}:{},...b?{isolatedStateOverride:b}:{}})}else z.warn("refetchDataSource: G7Core.dataSource.refetch is not available")}),this.registerHandler("appendDataSource",async(a,r)=>{const{dataSourceId:i,dataPath:o,newData:u}=a.params||{};if(!i){z.warn("appendDataSource: dataSourceId is required");return}if(u===void 0){z.warn("appendDataSource: newData is required");return}if(typeof window<"u"&&window.G7Core?.dataSource?.updateData){if(!Array.isArray(u)){z.warn("appendDataSource: newData must be an array, got:",typeof u,u);return}await window.G7Core.dataSource.updateData(i,o||null,u,"append")}else z.warn("appendDataSource: G7Core.dataSource.updateData is not available")}),this.registerHandler("updateDataSource",async(a,r)=>{const{dataSourceId:i,data:o,merge:u=!1}=a.params||{};if(!i){z.warn("updateDataSource: dataSourceId is required");return}if(o===void 0){z.warn("updateDataSource: data is required");return}typeof window<"u"&&window.G7Core?.dataSource?.set?(z.log(`[updateDataSource] Updating dataSource '${i}' with:`,o),window.G7Core.dataSource.set(i,o,{merge:u})):z.warn("updateDataSource: G7Core.dataSource.set is not available")}),this.registerHandler("scrollIntoView",async(a,r)=>{const{selector:i,behavior:o="smooth",block:u="nearest",inline:d="nearest",waitForElement:f=!1,timeout:g=2e3,delay:m=0,retryCount:b=0,retryInterval:v=50,scrollContainer:E}=a.params||{};if(!i){z.warn("scrollIntoView: selector is required");return}if(typeof window>"u"||typeof document>"u"){z.warn("scrollIntoView: window/document is not available");return}let S=null;if(f){if(S=await new Promise(A=>{const T=document.querySelector(i);if(T){A(T);return}const D=setTimeout(()=>{M.disconnect(),A(null)},g),M=new MutationObserver(()=>{const O=document.querySelector(i);O&&(clearTimeout(D),M.disconnect(),A(O))});M.observe(document.body,{childList:!0,subtree:!0})}),!S){z.warn(`scrollIntoView: element not found for selector "${i}" after ${g}ms timeout`);return}}else{m>0&&await new Promise(T=>setTimeout(T,m)),S=document.querySelector(i);let A=0;for(;!S&&A<b;)await new Promise(T=>setTimeout(T,v)),S=document.querySelector(i),A++;if(!S){z.warn(`scrollIntoView: element not found for selector "${i}" after ${A+1} attempts`);return}}if(E){const A=document.querySelector(E);if(!A){z.warn(`scrollIntoView: container not found for selector "${E}"`);return}const T=S.getBoundingClientRect(),D=A.getBoundingClientRect(),M=T.top-D.top+A.scrollTop,O=M+T.height;let L;switch(u){case"start":L=M;break;case"center":L=M-A.clientHeight/2+T.height/2;break;case"end":L=O-A.clientHeight;break;case"nearest":default:const P=T.top<D.top,U=T.bottom>D.bottom;if(P)L=M;else if(U)L=O-A.clientHeight;else return;break}A.scrollTo({top:Math.max(0,L),behavior:o});return}S.scrollIntoView({behavior:o,block:u,inline:d})}),this.registerHandler("reloadExtensions",async(a,r)=>{if(typeof window>"u"){z.warn("reloadExtensions: window is not available");return}const i=window.__templateApp;if(!i){z.warn("reloadExtensions: TemplateApp not initialized");return}if(typeof i.reloadExtensionState=="function")try{await i.reloadExtensionState()}catch(d){throw z.error("reloadExtensions: reloadExtensionState failed",d),d}else z.warn("reloadExtensions: TemplateApp.reloadExtensionState unavailable");const{moduleInfo:o,pluginInfo:u}=a.params||{};if(o)try{await this.executeAction({handler:"reloadModuleHandlers",params:a.params},r)}catch(d){z.error("reloadExtensions: reloadModuleHandlers failed",d)}if(u)try{await this.executeAction({handler:"reloadPluginHandlers",params:a.params},r)}catch(d){z.error("reloadExtensions: reloadPluginHandlers failed",d)}z.log("reloadExtensions: done")}),this.registerHandler("reloadRoutes",async(a,r)=>{if(typeof window>"u"){z.warn("reloadRoutes: window is not available");return}const i=window.__templateApp;if(!i){z.warn("reloadRoutes: TemplateApp not initialized");return}if(typeof i.reloadExtensionState=="function")try{await i.reloadExtensionState(),z.log("reloadRoutes: delegated to reloadExtensionState")}catch(o){throw z.error("reloadRoutes: Failed to reload routes",o),o}else{const o=i.getRouter?.();o&&(await o.loadRoutes(),z.log("reloadRoutes: Routes reloaded (legacy fallback)"))}}),this.registerHandler("refresh",async(a,r)=>{if(typeof window>"u"){z.warn("refresh: window is not available");return}const i=Number(a.params?.delayMs??0);i>0&&await new Promise(o=>setTimeout(o,i)),window.location.reload()}),this.registerHandler("remount",async(a,r)=>{const{componentId:i}=a.params||{};if(!i){z.warn("remount: componentId parameter is required");return}if(!this.globalStateUpdater){z.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}}),z.log(`remount: ${i} key incremented to ${f+1}`)}),this.registerHandler("reloadTranslations",async(a,r)=>{if(typeof window>"u"){z.warn("reloadTranslations: window is not available");return}const i=window.__templateApp;if(!i){z.warn("reloadTranslations: TemplateApp not initialized");return}if(typeof i.reloadExtensionState=="function")try{await i.reloadExtensionState(),z.log("reloadTranslations: delegated to reloadExtensionState")}catch(o){throw z.error("reloadTranslations: Failed to reload translations",o),o}}),this.registerHandler("reloadModuleHandlers",async(a,r)=>{if(typeof window>"u"){z.warn("reloadModuleHandlers: window is not available");return}const{moduleInfo:i,action:o}=a.params||{};if(!i){z.warn("reloadModuleHandlers: moduleInfo is required");return}const u=i.data||i;if(!u.identifier){z.warn("reloadModuleHandlers: moduleInfo with identifier is required");return}if(!o||o!=="add"&&o!=="remove"){z.warn('reloadModuleHandlers: action must be "add" or "remove"');return}const d=window.G7Config;if(!d){z.warn("reloadModuleHandlers: G7Config not available");return}const f=u.identifier;try{if(o==="add"){if(u.assets&&(d.moduleAssets=d.moduleAssets||{},d.moduleAssets[f]=u.assets,z.log(`reloadModuleHandlers: Added assets for ${f}`),u.assets.js)){const g=u.assets.js,m=`module-${f}`;if(document.getElementById(m)){z.warn(`reloadModuleHandlers: Script ${m} already loaded`);return}const b=document.createElement("script");if(b.id=m,b.src=g,b.async=!0,await new Promise((v,E)=>{b.onload=()=>{z.log(`reloadModuleHandlers: Script loaded successfully for ${f}`),v()},b.onerror=()=>{z.error(`reloadModuleHandlers: Failed to load script for ${f}`),E(new Error(`Failed to load module script: ${g}`))},document.head.appendChild(b)}),u.assets.css){const v=u.assets.css,E=`module-css-${f}`;if(!document.getElementById(E)){const S=document.createElement("link");S.id=E,S.rel="stylesheet",S.href=v,document.head.appendChild(S),z.log(`reloadModuleHandlers: CSS loaded for ${f}`)}}}}else if(o==="remove"){d.moduleAssets&&d.moduleAssets[f]&&(delete d.moduleAssets[f],z.log(`reloadModuleHandlers: Removed assets for ${f}`));const g=`module-${f}`,m=document.getElementById(g);m&&(m.remove(),z.log(`reloadModuleHandlers: Removed script for ${f}`));const b=`module-css-${f}`,v=document.getElementById(b);v&&(v.remove(),z.log(`reloadModuleHandlers: Removed CSS for ${f}`))}}catch(g){throw z.error(`reloadModuleHandlers: Failed to ${o} module assets`,g),g}}),this.registerHandler("reloadPluginHandlers",async(a,r)=>{if(typeof window>"u"){z.warn("reloadPluginHandlers: window is not available");return}const{pluginInfo:i,action:o}=a.params||{};if(!i){z.warn("reloadPluginHandlers: pluginInfo is required");return}const u=i.data||i;if(!u.identifier){z.warn("reloadPluginHandlers: pluginInfo with identifier is required");return}if(!o||o!=="add"&&o!=="remove"){z.warn('reloadPluginHandlers: action must be "add" or "remove"');return}const d=window.G7Config;if(!d){z.warn("reloadPluginHandlers: G7Config not available");return}const f=u.identifier;try{if(o==="add"){if(u.assets&&(d.pluginAssets=d.pluginAssets||{},d.pluginAssets[f]=u.assets,z.log(`reloadPluginHandlers: Added assets for ${f}`),u.assets.js)){const g=u.assets.js,m=`plugin-${f}`;if(document.getElementById(m)){z.warn(`reloadPluginHandlers: Script ${m} already loaded`);return}const b=document.createElement("script");if(b.id=m,b.src=g,b.async=!0,await new Promise((v,E)=>{b.onload=()=>{z.log(`reloadPluginHandlers: Script loaded successfully for ${f}`),v()},b.onerror=()=>{z.error(`reloadPluginHandlers: Failed to load script for ${f}`),E(new Error(`Failed to load plugin script: ${g}`))},document.head.appendChild(b)}),u.assets.css){const v=u.assets.css,E=`plugin-css-${f}`;if(!document.getElementById(E)){const S=document.createElement("link");S.id=E,S.rel="stylesheet",S.href=v,document.head.appendChild(S),z.log(`reloadPluginHandlers: CSS loaded for ${f}`)}}}}else if(o==="remove"){d.pluginAssets&&d.pluginAssets[f]&&(delete d.pluginAssets[f],z.log(`reloadPluginHandlers: Removed assets for ${f}`));const g=`plugin-${f}`,m=document.getElementById(g);m&&(m.remove(),z.log(`reloadPluginHandlers: Removed script for ${f}`));const b=`plugin-css-${f}`,v=document.getElementById(b);v&&(v.remove(),z.log(`reloadPluginHandlers: Removed CSS for ${f}`))}}catch(g){throw z.error(`reloadPluginHandlers: Failed to ${o} plugin assets`,g),g}});let e=!1;this.registerHandler("showErrorPage",async(a,r)=>{if(e){z.log("showErrorPage: Already active, skipping duplicate call");return}if(e=!0,typeof window>"u"){e=!1,z.warn("showErrorPage: window is not available");return}const i=window.__templateApp;if(!i){e=!1,z.warn("showErrorPage: TemplateApp not initialized");return}const o=i.getErrorPageHandler?.();if(!o){e=!1,z.warn("showErrorPage: ErrorPageHandler not available");return}const u=a.params?.errorCode||500,d=a.params?.target||"content";let f=a.params?.containerId;f||(f=d==="full"?"app":"main_content"),z.log("showErrorPage:",{errorCode:u,target:d,containerId:f});const g=(m,b=6e4)=>new Promise((v,E)=>{const S=document.getElementById(m);if(S){v(S);return}z.log(`showErrorPage: Waiting for container #${m}...`);let A;const T=new MutationObserver((D,M)=>{const O=document.getElementById(m);O&&(z.log(`showErrorPage: Container #${m} found`),M.disconnect(),clearTimeout(A),v(O))});T.observe(document.body,{childList:!0,subtree:!0}),A=setTimeout(()=>{T.disconnect(),E(new Error(`Container #${m} not found within ${b}ms`))},b)});try{await g(f);const m=ma(),b=m.layoutErrorHandling;m.clearLayoutConfig();try{await o.renderError(u,f)||z.warn(`showErrorPage: Failed to render error page for code ${u}`)}finally{m.setLayoutConfig(b)}}catch(m){throw z.error("showErrorPage: Error rendering error page:",m),m}finally{e=!1}}),this.registerHandler("emitEvent",async(a,r)=>{const i=a.params?.event,o=a.params?.data;if(!i){z.warn("emitEvent: event parameter is required");return}if(typeof window>"u"){z.warn("emitEvent: window is not available");return}const u=window.G7Core;if(!u?.componentEvent?.emit){z.warn("emitEvent: G7Core.componentEvent is not available");return}try{z.log(`emitEvent: Emitting "${i}"`,o);const d={...o,_context:{data:r.data,state:r.state}},f=await u.componentEvent.emit(i,d);if(!f||f.length===0?z.warn(`emitEvent: No listeners found for "${i}"`):z.log(`emitEvent: Event "${i}" completed with ${f.length} listener(s)`,f),this.globalStateUpdater){const g=(u?.state?.get()||{})._local||{},m={event:i,success:!0,data:f.length===1?f[0]:f,listeners:f.length};this.globalStateUpdater({_local:{...g,_eventResult:m}});const b=r.state&&typeof r.state=="object"&&!Array.isArray(r.state)?r.state:g;window.__g7SequenceLocalSync={...b,_eventResult:m}}}catch(d){if(z.error(`emitEvent: Event "${i}" failed`,d),this.globalStateUpdater){const f=u?.state?.get()||{};this.globalStateUpdater({_local:{...f._local,_eventResult:{event:i,success:!1,error:d instanceof Error?d.message:String(d)}}})}throw d}}),this.registerHandler("updateProductField",async(a,r)=>{const{productId:i,field:o,value:u}=a.params||{};if(!i||!o){z.warn("updateProductField: productId and field are required");return}if(typeof window>"u"){z.warn("updateProductField: window is not available");return}const d=window.G7Core;if(!d?.state?.get||!this.globalStateUpdater){z.warn("updateProductField: G7Core.state or globalStateUpdater is not available");return}try{const f=d.state.get()||{},m=(f.products?.data?.data||[]).map(v=>v.id===i?{...v,[o]:u,_modified:!0}:v),b=new Set(f._local?.modifiedProductIds||[]);b.add(i),this.globalStateUpdater({products:{...f.products,data:{...f.products?.data,data:m}},_local:{...f._local,modifiedProductIds:Array.from(b)}}),z.log(`updateProductField: Updated product ${i}, field: ${o}, value:`,u)}catch(f){throw z.error("updateProductField: Error updating product field",f),f}}),this.registerHandler("updateOptionField",async(a,r)=>{const{productId:i,optionId:o,field:u,value:d}=a.params||{};if(!i||!o||!u){z.warn("updateOptionField: productId, optionId and field are required");return}if(typeof window>"u"){z.warn("updateOptionField: window is not available");return}const f=window.G7Core;if(!f?.state?.get||!this.globalStateUpdater){z.warn("updateOptionField: G7Core.state or globalStateUpdater is not available");return}try{const g=f.state.get()||{},b=(g.products?.data?.data||[]).map(E=>{if(E.id===i&&E.options){const S=E.options.map(A=>A.id===o?{...A,[u]:d,_modified:!0}:A);return{...E,options:S,_modified:!0}}return E}),v=new Set(g._local?.modifiedProductIds||[]);v.add(i),this.globalStateUpdater({products:{...g.products,data:{...g.products?.data,data:b}},_local:{...g._local,modifiedProductIds:Array.from(v)}}),z.log(`updateOptionField: Updated product ${i} option ${o}, field: ${u}, value:`,d)}catch(g){throw z.error("updateOptionField: Error updating option field",g),g}}),this.registerHandler("setLocale",async(a,r)=>{const i=a.target;if(!i||typeof i!="string"){z.warn("setLocale: Invalid locale:",i);return}const o=window.__templateApp;if(o&&typeof o.changeLocale=="function")try{await o.changeLocale(i),z.log("setLocale: Locale changed to",i)}catch(u){z.error("setLocale: Failed to change locale:",u),window.location.reload()}else{z.warn("setLocale: TemplateApp not found, falling back to page reload");try{localStorage.setItem("g7_locale",i)}catch{}window.location.reload()}}),this.registerHandler("suppress",async()=>{z.log("suppress: Error intentionally suppressed")}),this.registerBuiltInHandlerMetadata()}registerBuiltInHandlerMetadata(){const e=jn();if(!e?.isEnabled())return;const a=[{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 r of a)e.trackHandlerRegistration(r.name,"built-in",r.description)}createHandler(e,a,r){z.log("createHandler called for:",e.handler,e.type);const i=window.__g7DevTools,o=Date.now(),u=r?.state?{...r.state}:null,d=`handler_${e.handler}_${o}`;return async f=>{if(z.log("Handler invoked for:",e.handler,"event:",f.type),i?.isEnabled?.()&&u){const m=window.G7Core?.state?.getLocal?.()??r?.state??{},b=Date.now()-o;for(const v of Object.keys(u)){const E=u[v],S=m[v];E!==S&&b>100&&(i.trackStaleClosureWarning?.({type:"event-handler-stale",location:`createHandler(${e.handler})`,capturedPath:`_local.${v}`,capturedValue:E,capturedAt:o,currentValue:S,actionId:d,stackTrace:new Error().stack}),z.warn(`[Stale Closure] _local.${v} changed after handler creation:`,`captured="${E}" → current="${S}" (${b}ms ago)`))}}try{f.type!=="change"&&f.preventDefault();let g={};if(f.type==="submit"&&f.target instanceof HTMLFormElement){const v=f.target;new FormData(v).forEach((S,A)=>{g[A]=S})}const m={...this.defaultContext,data:{...a,form:g,_local:r?.state||{},$event:f},event:f,...r&&{state:r.state,setState:r.setState},isolatedContext:r?.isolatedContext};if(e.confirm){let v=this.resolveValue(e.confirm,m.data);if(this.translationEngine&&this.translationContext&&v.startsWith("$t:")&&(v=this.translationEngine.resolveTranslations(v,this.translationContext,m.data)),!confirm(v))return}const b=window.__g7ActionContext;window.__g7ActionContext={...r,data:m.data};try{await this.executeAction(e,m)}finally{window.__g7ActionContext=b}}catch(g){if(z.error("Action execution failed:",g),e.onError){const m=g instanceof Mt&&g.originalError?g.originalError:g,b={...this.defaultContext,data:{...a,error:m,_local:r?.state||{},$event:f},event:f,...r&&{state:r.state,setState:r.setState}},v=Array.isArray(e.onError)?e.onError:[e.onError];for(const E of v)await this.executeAction(E,b)}}}}generateActionId(e,a){const r=e.handler,i=a||"no-target",o=Date.now(),u=Math.random().toString(36).substring(2,9);return`${r}_${i.replace(/[^a-zA-Z0-9]/g,"_")}_${o}_${u}`}async executeAction(e,a){if(e=this.resolveActionRef(e),typeof e.handler=="string"&&e.handler.includes("{{")){const f=this.evaluateExpression(e.handler,a.data);e={...e,handler:f==null?"":String(f)}}const r=jn(),i=r?.isEnabled()?`action_${Date.now()}_${Math.random().toString(36).substring(2,11)}`:void 0,o=performance.now();let u;if(i&&r&&r.logAction({id:i,type:e.handler,params:this.sanitizeForDevTools(e.params),context:this.sanitizeForDevTools({hasState:!!a.state,hasSetState:!!a.setState,dataKeys:a.data?Object.keys(a.data):[]}),startTime:o,status:"started"}),e.if!==void 0)try{const f=this.resolveValue(e.if,a.data),g=f===!0||f==="true"||f&&f!=="false"&&f!=="0"&&f!==!1;if(z.log("[executeAction] if condition result:",e.handler,g),!g)return i&&r&&r.logAction({id:i,type:e.handler,startTime:o,endTime:performance.now(),duration:performance.now()-o,status:"success",result:{skipped:!0,reason:"if condition false"}}),{success:!0,data:void 0}}catch(f){return z.error("[executeAction] if condition error:",e.handler,f),i&&r&&r.logAction({id:i,type:e.handler,startTime:o,endTime:performance.now(),duration:performance.now()-o,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,a.data);i&&(u=this.sanitizeForDevTools(f));const g=e.target?this.resolveValue(e.target,a.data):void 0;if(e.handler==="apiCall"&&a.setState){d=this.generateActionId(e,g);const b=a.state?.loadingActions||{};a.setState({loadingActions:{...b,[d]:!0}})}if(this.previewMode&&Ap.has(e.handler))return z.warn(`Preview mode: "${e.handler}" suppressed`,g||f),i&&r&&r.logAction({id:i,type:e.handler,startTime:o,endTime:performance.now(),duration:performance.now()-o,status:"skipped",metadata:{reason:"preview_mode_suppressed"}}),{success:!0,data:void 0};let m;switch(e.handler){case"ensureIdentityVerified":m=await this.handleEnsureIdentityVerified(f);break;case"resolveIdentityChallenge":m=this.handleResolveIdentityChallenge(f);break;case"navigate":const b=f.path||g;m=await this.handleNavigate(b,f,a);break;case"navigateBack":m=await this.handleNavigateBack();break;case"navigateForward":m=await this.handleNavigateForward();break;case"openWindow":{const S=f.path||g;m=await this.handleOpenWindow(S,f);break}case"replaceUrl":{const S=f.path||g||window.location.pathname;m=await this.handleReplaceUrl(S,f);break}case"apiCall":if(e.onSuccess&&r?.isEnabled()&&i){const S=window.G7Core,A={};if(S?.state?.get){const T=S.state.get();A._global=T}a.state&&(A._local=a.state),r.registerStateCaptureForHandler?.(i,["_global","_local"],A)}const v=e.auth_mode??(e.auth_required?"required":"none"),E=e.identity_target?this.resolveParams(e.identity_target,a.data):void 0;m=await this.handleApiCall(g,f,a,v,E);break;case"login":m=await this.handleLogin(g,f,a);break;case"logout":m=await this.handleLogout(g,a);break;case"setState":z.log("[executeAction] setState resolvedParams:",f),m=await this.handleSetState(e.render!==void 0?{...f,__render:e.render}:f,a);break;case"setError":m=await this.handleSetError(g,f,a);break;case"openModal":m=await this.handleOpenModal(g,a);break;case"closeModal":m=await this.handleCloseModal(a);break;case"showAlert":m=await this.handleShowAlert(g,a);break;case"toast":m=await this.handleToast(f,a);break;case"switch":m=await this.handleSwitch(e,a);break;case"conditions":m=await this.handleConditions(e,a);break;case"sequence":m=await this.handleSequence(e,a);break;case"parallel":m=await this.handleParallel(e,a);break;case"startInterval":m=this.handleStartInterval(f,a);break;case"stopInterval":m=this.handleStopInterval(f);break;case"loadScript":m=await this.handleLoadScript(f,e,a);break;case"callExternal":m=await this.handleCallExternal(f,e,a);break;case"callExternalEmbed":m=await this.handleCallExternalEmbed(f,e,a);break;case"saveToLocalStorage":m=await this.handleSaveToLocalStorage(f,a);break;case"loadFromLocalStorage":m=await this.handleLoadFromLocalStorage(f,a);break;default:m=await this.handleCustomAction({...e,target:g,params:f},a);break}if(e.resultTo&&m!==void 0){const{target:b,key:v,merge:E}=e.resultTo,S=this.resolveValue(v,a.data),A=E==="replace"?"replace":E==="shallow"?"shallow":"deep";if(b==="_local"&&a.setState){const T=this.buildNestedUpdate(S,m),D=A!=="deep"?{...T,__mergeMode:A}:T;a.setState(D),z.log(`[resultTo] Saved to _local.${S} (merge=${A}):`,m)}else if(b==="_local"&&this.globalStateUpdater){const M=(window.G7Core?.state?.get()||{})._local||{},O=this.buildNestedUpdate(S,m);let L;A==="replace"?L=O:A==="shallow"?L={...M,...O}:L=this.deepMergeWithState(O,M),this.globalStateUpdater({_local:L}),z.log(`[resultTo] Saved to _local.${S} via globalStateUpdater (merge=${A}):`,m)}else if(b==="_global"&&this.globalStateUpdater){const T=this.buildNestedUpdate(S,m);this.globalStateUpdater(T),z.log(`[resultTo] Saved to _global.${S}:`,m)}else if(b==="_isolated"&&a.isolatedContext){const T=this.buildNestedUpdate(S,m);a.isolatedContext.mergeState(T,A),z.log(`[resultTo] Saved to _isolated.${S} (merge=${A}):`,m)}else z.warn(`[resultTo] Cannot save result: target=${b}, setState=${!!a.setState}, globalStateUpdater=${!!this.globalStateUpdater}, isolatedContext=${!!a.isolatedContext}`)}if(e.onSuccess){if(r?.isEnabled()&&i&&e.handler==="apiCall"){const E=window.G7Core,S={};E?.state?.get&&(S._global=E.state.get()),a.state&&(S._local=a.state),r.detectStaleClosure?.(i,`${e.handler} → onSuccess`,S,"callback-state-capture",i)}const b={...a,data:{...a.data,result:m,response:m}},v=Array.isArray(e.onSuccess)?e.onSuccess:[e.onSuccess];v.length>1?await this.handleSequence({handler:"sequence",type:"click",actions:v},b):v.length===1&&await this.executeAction(v[0],b)}return i&&r&&r.logAction({id:i,type:e.handler,params:this.sanitizeForDevTools(e.params),resolvedParams:u,startTime:o,endTime:performance.now(),duration:performance.now()-o,status:"success",result:this.sanitizeForDevTools(m)}),{success:!0,data:m}}catch(f){const g=f instanceof Mt?f:new Mt(`Failed to execute action: ${e.handler}`,e,f instanceof Error?f:void 0),m=g.originalError?.response||{},b=m.data||{},v=g.originalError?.status||m.status||500,E=b.message||g.message,S={status:v,message:E,errors:b.errors||m.errors,data:b,statusText:g.originalError?.statusText,error_code:b.error_code??m.error_code},T=ma().resolve(v,{errorHandling:e.errorHandling,onError:e.onError});if(T.handler){if(r?.isEnabled()&&i&&e.handler==="apiCall"){const M=window.G7Core,O={};M?.state?.get&&(O._global=M.state.get()),a.state&&(O._local=a.state),r.detectStaleClosure?.(i,`${e.handler} → onError`,O,"callback-state-capture",i)}const D={...a,data:{...a.data,error:S}};try{const M={type:"click",handler:T.handler.handler,target:T.handler.target,params:T.handler.params,actions:T.handler.actions};return await this.executeAction(M,D),{success:!1,error:g}}catch(M){return z.error("Error executing error handler:",M),{success:!1,error:g}}}throw i&&r&&r.logAction({id:i,type:e.handler,params:this.sanitizeForDevTools(e.params),resolvedParams:u,startTime:o,endTime:performance.now(),duration:performance.now()-o,status:"error",error:{name:g.name,message:g.message,stack:g.stack}}),g}finally{if(e.handler==="apiCall"&&a.setState&&d){const f=a.state?.loadingActions||{},{[d]:g,...m}=f;a.setState({loadingActions:m})}}}async handleNavigate(e,a,r){let i=e;if(a.query)if(a.mergeQuery===!0)i=this.buildMergedQueryPath(e,a.query);else{const u=new URLSearchParams;for(const[f,g]of Object.entries(a.query))if(g!=null&&g!=="")if(Array.isArray(g)){const m=f.endsWith("[]")?f:`${f}[]`;for(const b of g)b!=null&&b!==""&&u.append(m,String(b))}else u.set(f,String(g));const d=u.toString();d&&(i=`${e}?${d}`)}if(z.log("handleNavigate:",{target:e,params:a,finalPath:i,replace:a.replace,windowLocationSearch:window.location.search}),a.replace===!0){const u=window.G7Core;if(u?.updateQueryParams){const d=typeof a.transition_overlay_target=="string"?a.transition_overlay_target:void 0;await u.updateQueryParams(i,d?{transitionOverlayTarget:d}:void 0),z.log("handleNavigate: Used updateQueryParams for replace mode",d?{transitionOverlayTarget:d}:void 0),this.applyScrollOption(a.scroll,a.scrollBehavior,"top");return}z.warn("handleNavigate: G7Core.updateQueryParams not available, falling back to React Router")}const o=this.resolveNavigateFallbackAction(i,a);if(o){z.warn(`handleNavigate: No route matched, falling back to "${o.handler}"`),await this.dispatchAction({type:"click",handler:o.handler,params:o.params},r),this.applyScrollOption(a.scroll,a.scrollBehavior,"top");return}if(!r.navigate)throw new Mt("Navigate function is not provided in context");r.navigate(i,{replace:a.replace===!0}),this.applyScrollOption(a.scroll,a.scrollBehavior,"top")}resolveNavigateFallbackAction(e,a){const r=a.fallback;if(r===!1||a.replace===!0)return null;const o=window.__templateApp?.getRouter?.();if(!o||typeof o.match!="function"||typeof o.getRoutes=="function"&&o.getRoutes().length===0)return null;const u=e.split("?")[0];return o.match(u)?null:this.resolveNavigateFallback(r,e,a)}resolveNavigateFallback(e,a,r){return e==null?{handler:"openWindow",params:{path:a,target:"_self"}}:typeof e=="string"?{handler:e,params:{path:a}}:typeof e=="object"&&typeof e.handler=="string"?{handler:e.handler,params:{path:a,...e.params||{}}}:(z.warn("resolveNavigateFallback: unrecognized fallback option, using openWindow",e),{handler:"openWindow",params:{path:a,target:"_blank"}})}applyScrollOption(e,a,r){const i=e===void 0?r:e;if(i==="preserve")return;const o=a==="smooth"?"smooth":"instant",u=b=>{if(typeof b!="object"||b===null)return!1;const v=b;return"container"in v||"to"in v||"block"in v||"offset"in v},d=(b,v,E=0)=>{b===window?window.scrollTo({top:v,left:E,behavior:o}):b.scrollTo({top:v,left:E,behavior:o})},f=(b,v,E,S)=>{if(v===window){b.scrollIntoView({behavior:o,block:E}),S&&window.scrollBy({top:-S,left:0,behavior:o});return}const A=v,T=b.getBoundingClientRect(),D=A.getBoundingClientRect(),M=A.scrollTop+(T.top-D.top);let O;E==="center"?O=M-(A.clientHeight-b.clientHeight)/2:E==="end"?O=M-(A.clientHeight-b.clientHeight):O=M,O-=S,A.scrollTo({top:Math.max(0,O),left:0,behavior:o})},g=()=>{window.scrollTo({top:0,left:0,behavior:o});const b=document.getElementById("app")??document.body;if(!b)return;b.querySelectorAll("*").forEach(E=>{if(E.scrollTop===0&&E.scrollLeft===0)return;const S=window.getComputedStyle(E),A=S.overflowY,T=S.overflowX;(A==="auto"||A==="scroll"||T==="auto"||T==="scroll")&&E.scrollTo({top:0,left:0,behavior:o})})},m=()=>{try{if(u(i)){const b=i,v=b.block??"start",E=typeof b.offset=="number"?b.offset:0;let S=window;if(typeof b.container=="string"&&b.container.length>0){const T=document.querySelector(b.container);if(!T){z.warn(`applyScrollOption: container not found: ${b.container}`);return}S=T}const A=b.to??"top";if(A==="top"){S===window?g():d(S,0);return}if(typeof A=="number"){d(S,A-E);return}if(typeof A=="object"&&A!==null&&("x"in A||"y"in A)){const{x:T=0,y:D=0}=A;d(S,D-E,T);return}if(typeof A=="string"&&(A.startsWith("#")||A.startsWith("."))){const T=document.querySelector(A);T?f(T,S,v,E):z.warn(`applyScrollOption: target element not found: ${A}`);return}z.warn('applyScrollOption: invalid "to" value in extended form',A);return}if(i==="top"){g();return}if(typeof i=="number"){window.scrollTo({top:i,left:0,behavior:o});return}if(typeof i=="object"&&i!==null&&("x"in i||"y"in i)){const{x:b=0,y:v=0}=i;window.scrollTo({top:v,left:b,behavior:o});return}if(typeof i=="string"&&(i.startsWith("#")||i.startsWith("."))){const b=document.querySelector(i);b&&b.scrollIntoView({behavior:o,block:"start"});return}}catch(b){z.warn("applyScrollOption: failed to apply scroll",b)}};typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(m):m()}async handleOpenWindow(e,a){let r=e;if(a.query){const o=new URLSearchParams;for(const[d,f]of Object.entries(a.query))f!=null&&f!==""&&o.set(d,String(f));const u=o.toString();u&&(r=`${e}?${u}`)}const i=a.target==="_self"?"_self":"_blank";z.log("handleOpenWindow:",{target:e,params:a,finalPath:r,windowTarget:i}),i==="_self"?window.location.assign(r):window.open(r,"_blank")}async handleNavigateBack(){z.log("handleNavigateBack"),window.history.back()}async handleNavigateForward(){z.log("handleNavigateForward"),window.history.forward()}async handleReplaceUrl(e,a){let r=e;if(a.query)if(a.mergeQuery===!0)r=this.buildMergedQueryPath(e,a.query);else{const i=new URLSearchParams;for(const[u,d]of Object.entries(a.query))if(d!=null&&d!=="")if(Array.isArray(d)){const f=u.endsWith("[]")?u:`${u}[]`;for(const g of d)g!=null&&g!==""&&i.append(f,String(g))}else i.set(u,String(d));const o=i.toString();o&&(r=`${e}?${o}`)}z.log("handleReplaceUrl:",{target:e,params:a,finalPath:r}),window.history.replaceState(null,"",r),this.applyScrollOption(a.scroll,a.scrollBehavior,"preserve")}buildMergedQueryPath(e,a){const r=new URLSearchParams(window.location.search);for(const[u,d]of Object.entries(a))if(d==null||d==="")r.delete(u);else if(Array.isArray(d)){const f=u.endsWith("[]")?u:`${u}[]`;r.delete(u),r.delete(f);for(const g of d)g!=null&&g!==""&&r.append(f,String(g))}else r.set(u,String(d));const i=r.toString(),o=e.split("?")[0];return i?`${o}?${i}`:o}async ensureCsrfToken(){try{await fetch("/sanctum/csrf-cookie",{credentials:"include"})}catch(e){throw new Mt("Failed to fetch CSRF token",void 0,e instanceof Error?e:void 0)}}getCsrfTokenFromCookie(){const r=`; ${document.cookie}`.split("; XSRF-TOKEN=");if(r.length===2){const i=r.pop()?.split(";").shift();return i?decodeURIComponent(i):null}return null}buildQueryString(e){const a=new URLSearchParams;for(const[r,i]of Object.entries(e))if(!(i==null||i===""))if(Array.isArray(i))for(const o of i)o!=null&&o!==""&&a.append(`${r}[]`,String(o));else typeof i=="object"?a.append(r,JSON.stringify(i)):a.append(r,String(i));return a.toString()}async handleEnsureIdentityVerified(e){const a=typeof e.purpose=="string"?e.purpose:"sensitive_action",r=e.target&&typeof e.target=="object"?e.target:void 0;return await bt.handle({success:!1,error_code:"identity_verification_required",message:"",verification:{policy_key:e.policy_key??"",purpose:a,provider_id:e.provider_id??null,render_hint:e.render_hint??null,return_request:null}},void 0,r)!==null}handleResolveIdentityChallenge(e){const a=typeof e.result=="string"?e.result:"cancelled";let r;switch(a){case"verified":{const i=typeof e.token=="string"?e.token:"";if(!i){z.warn("resolveIdentityChallenge: result=verified 인데 token 이 비어있습니다. failed 로 강등합니다."),r={status:"failed",failureCode:"MISSING_TOKEN"};break}r={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:"",o=typeof e.expiresAt=="string"?e.expiresAt:"";if(!i||!o){z.warn("resolveIdentityChallenge: result=pending 인데 pollUrl/expiresAt 누락 — failed 로 강등합니다."),r={status:"failed",failureCode:"MALFORMED_PENDING"};break}r={status:"pending",pollUrl:i,pollIntervalMs:typeof e.pollIntervalMs=="number"?e.pollIntervalMs:void 0,expiresAt:o};break}case"failed":r={status:"failed",failureCode:typeof e.failureCode=="string"?e.failureCode:"UNKNOWN",reason:typeof e.reason=="string"?e.reason:void 0};break;case"cancelled":default:r={status:"cancelled"};break}return bt.resolveDeferred(r),!0}async handleApiCall(e,a,r,i="none",o){const{method:u="GET",body:d,headers:f,contentType:g}=a;u!=="GET"&&u!=="HEAD"&&await this.ensureCsrfToken();const m=this.getCsrfTokenFromCookie();let b={};if(i==="required"||i==="optional"){const Y=$a().getToken();Y&&(b={Authorization:`Bearer ${Y}`})}let v=e;const E=a.query||(u==="GET"?d:null);if(E&&typeof E=="object"){const B=this.buildQueryString(E);if(B){const Y=e.includes("?")?"&":"?";v=`${e}${Y}${B}`}}const S=window.G7Core?.state?.getGlobal?.()||r.state?._global||{},A=window.G7Core?.state?.getLocal?.()||r.state?._local||{},T={_global:S,_local:A},D=this.getMatchingGlobalHeaders(e,T),M={};if(typeof window<"u"){const B=localStorage.getItem("g7_locale");B&&(M["Accept-Language"]=B)}const O=g==="multipart/form-data",L={method:u,headers:{...O?{}:{"Content-Type":"application/json"},Accept:"application/json",...M,...m&&{"X-XSRF-TOKEN":m},...b,...D,...f},credentials:"include"};if(d&&u!=="GET")if(O){const B=new FormData;for(const[Y,ge]of Object.entries(d))ge instanceof File||ge instanceof Blob?B.append(Y,ge):ge!=null&&B.append(Y,typeof ge=="object"?JSON.stringify(ge):String(ge));L.body=B}else L.body=JSON.stringify(d);const P=jn();let U=null;P?.isEnabled()&&(U=P.trackRequest(v,u));try{let B=await fetch(v,L),Y;try{Y=await B.json()}catch{Y=null}if(bt.isIdentityRequired(B.status,Y)){const ge=await bt.handle(Y,{body:L.body,headers:L.headers,credentials:L.credentials},o);if(ge){B=ge;try{Y=await B.json()}catch{Y=null}}}if(U&&P?.isEnabled()&&(P.completeRequest(U,B.status,Y),U=null),!B.ok){const ge=Y||{},Ae=new Error(ge.message||`API call failed: ${B.statusText}`);throw Ae.response=ge,Ae.status=B.status,Ae.statusText=B.statusText,new Mt(ge.message||`API call failed: ${B.statusText}`,void 0,Ae)}return Y}catch(B){throw U&&P?.isEnabled()&&P.failRequest(U,B instanceof Error?B.message:String(B)),B}}async handleLogin(e,a,r){const{body:i}=a;if(!i||!i.email||!i.password)throw new Mt("Login requires email and password in body params");const o=e==="user"?"user":"admin",u=o==="admin"?"/api/auth/admin/login":"/api/auth/login",d=window.G7Core?.state?.getGlobal?.()||r.state?._global||{},f=window.G7Core?.state?.getLocal?.()||r.state?._local||{},g={_global:d,_local:f},m=this.getMatchingGlobalHeaders(u,g),b=ga.getInstance();try{const v=Object.keys(m).length>0?{headers:m}:void 0;return{user:await b.login(o,{email:i.email,password:i.password},v)}}catch(v){const E=v.message||"Login failed",S=new Error(E);throw S.response=v.response?.data||{},S.status=v.status||v.response?.status||500,new Mt(E,void 0,S)}}async handleLogout(e,a){await ga.getInstance().logout()}async handleSetState(e,a){z.log("[handleSetState] START, params:",e);const{target:r="component",scope:i,merge:o,__render:u,...d}=e,f=jn(),g=window.G7Core;if(typeof r=="string"&&(r.startsWith("$parent.")||r.startsWith("$root.")))return this.handleParentScopeSetState(r,d,o,a);const m=a.state&&Object.keys(a.state).length>0?a.state:g?.state?.get()||{},b=r==="global"?"_global":r.startsWith("_local.")?r:"_local",v=b==="_global"?m._global:b.startsWith("_local.")?this.getNestedProperty(m._local||{},b.slice(7)):m._local,E=f?.isEnabled()?f.startStateChange(b,v,d,{actionId:a.actionId,handlerType:"setState",source:`target=${r}`}):void 0,S=o==="replace"?"replace":o==="shallow"?"shallow":"deep",A=S!=="deep"?{...d,__mergeMode:S,...E?{__setStateId:E}:{}}:{...d,...E?{__setStateId:E}:{}};if(r==="global"){if(!this.globalStateUpdater){z.warn("Global state updater is not set"),E&&f&&f.completeStateChange(E);return}const T=g?.state?.get()||{},{__setStateId:D,__mergeMode:M,...O}=A,L=S==="deep"?this.deepMergeWithState(O,T):O,P={...L,...E?{__setStateId:E}:{},...S!=="deep"?{__mergeMode:S}:{}};return z.log("setState global:",P),this.globalStateUpdater(P,{render:u}),E&&f&&setTimeout(()=>f.completeStateChange(E),0),{__target:"global",...S!=="deep"?{__mergeMode:S}:{},...L}}else if(r==="isolated"){const T=a.isolatedContext;if(T){const{__mergeMode:D,__setStateId:M,...O}=A;return T.mergeState(O,S),z.log("[handleSetState] isolated state updated:",O,"mergeMode:",S),E&&f&&setTimeout(()=>f.completeStateChange(E),0),{__target:"isolated",...O}}else if(z.warn('[handleSetState] isolated target used but no IsolatedStateContext found. Make sure the component has "isolatedState" attribute. Falling back to local state.'),a.setState){const M=window.__g7PendingLocalState||a.state||{},O=S==="deep"?this.deepMergeWithState(A,M):A;return a.setState(O),E&&f&&setTimeout(()=>f.completeStateChange(E),0),O}else throw E&&f&&f.completeStateChange(E),new Mt("isolated target used but no IsolatedStateContext found and no setState function in context")}else if(r==="local"||r==="component"||r==="_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:O,__setStateId:L,...P}=A,U=S==="deep"?this.deepMergeWithState(P,M.state||{}):P;return z.log(`[handleSetState] scope=${i}: 타겟 컨텍스트에 상태 업데이트`,U),M.setState(U),E&&f&&setTimeout(()=>f.completeStateChange(E),0),U}}z.warn(`[handleSetState] scope=${i}: 레이아웃 컨텍스트 스택이 비어있습니다. current로 폴백합니다.`)}const T=a.setState&&!a._isDispatchFallbackContext;if(z.log("[handleSetState] isRealComponentContext:",T,"context.setState:",!!a.setState,"_isDispatchFallbackContext:",a._isDispatchFallbackContext),T){z.log("[handleSetState] Using COMPONENT setState path"),z.log("[handleSetState] resolvedPayload:",A),z.log("[handleSetState] context.state:",a.state),z.log("[handleSetState] mergeMode:",S);const M=window.__g7PendingLocalState||a.state||{},O=S==="deep"?this.deepMergeWithState(A,{}):A;z.log("[handleSetState] convertedPayload (변경 필드만, dot notation 변환):",O),a.setState(O);const L=S==="deep"?this.deepMergeWithState(A,M):S==="shallow"?{...a.state||{},...A}:A,{__mergeMode:P,__setStateId:U,...B}=L;window.__g7PendingLocalState=B,z.log("[handleSetState] __g7PendingLocalState updated:",B),this.globalStateUpdater&&(this.globalStateUpdater({_local:B},{render:!1}),z.log("[handleSetState] _global._local synced (render:false):",B));const{__mergeMode:Y,__setStateId:ge,...Ae}=A;if(S==="replace")window.__g7ForcedLocalFields=Ae;else{const Oe=window.__g7ForcedLocalFields||{};window.__g7ForcedLocalFields=this.deepMergeWithState(Ae,Oe)}return z.log("[handleSetState] __g7ForcedLocalFields updated:",Ae),E&&f&&setTimeout(()=>f.completeStateChange(E),0),{__target:"local",...L}}else if(this.globalStateUpdater){z.log("[handleSetState] Using GLOBAL STATE UPDATER path for _local");const M=window.__g7PendingLocalState||m._local||{};z.log("[handleSetState] currentLocal (with pending):",M);const O=S==="deep"?this.deepMergeWithState(A,M):A;return z.log("[handleSetState] finalLocal (merged):",O),this.globalStateUpdater({_local:O},{render:u}),window.__g7PendingLocalState=O,z.log("[handleSetState] __g7PendingLocalState updated for globalStateUpdater path"),E&&f&&setTimeout(()=>f.completeStateChange(E),0),{__target:"local",...O}}else throw E&&f&&f.completeStateChange(E),new Mt("setState function is not provided in context and globalStateUpdater is not set")}else if(r.startsWith("_local.")){const T=r.slice(7),{__mergeMode:D,__setStateId:M,...O}=A,L=O.value!==void 0?O.value:Object.values(O)[0];if(a.setState){const U=window.__g7PendingLocalState||a.state||{},B=this.createNestedUpdate(T,L,U),Y={...U,...B};return a.setState(B),E&&f&&setTimeout(()=>f.completeStateChange(E),0),Y}else throw E&&f&&f.completeStateChange(E),new Mt("setState function is not provided in context")}else{if(!a.setState)throw E&&f&&f.completeStateChange(E),new Mt("setState function is not provided in context");const D=window.__g7PendingLocalState||a.state||{},M=S==="deep"?this.deepMergeWithState(A,D):A;return a.setState(M),E&&f&&setTimeout(()=>f.completeStateChange(E),0),M}}async handleParentScopeSetState(e,a,r,i){const o=jn(),u=window.G7Core,d=r==="replace"?"replace":r==="shallow"?"shallow":"deep",f=e.startsWith("$parent."),g=f?"$parent.":"$root.",m=e.slice(g.length);let b,v;if(m==="_local"||m==="_global")b=m,v=void 0;else if(m.startsWith("_local."))b="_local",v=m.slice(7);else if(m.startsWith("_global."))b="_global",v=m.slice(8);else{z.warn(`[handleParentScopeSetState] 지원하지 않는 타겟 형식: ${e}. _local 또는 _global으로 시작해야 합니다.`);return}const E=window.__g7LayoutContextStack||[];if(E.length===0){z.warn(`[handleParentScopeSetState] 레이아웃 컨텍스트 스택이 비어있습니다. target=${e}`);return}const S=f?E[E.length-1]:E[0];if(!S){z.warn(`[handleParentScopeSetState] 타겟 컨텍스트를 찾을 수 없습니다. target=${e}`);return}const A=b==="_global"?S.state?._global:S.state?._local,T=o?.isEnabled()?o.startStateChange(e,A,a,{actionId:i.actionId,handlerType:"setState",source:`target=${e}`}):void 0,{__mergeMode:D,__setStateId:M,...O}=a;if(b==="_global"){if(!this.globalStateUpdater){z.warn("[handleParentScopeSetState] globalStateUpdater가 설정되지 않았습니다."),T&&o&&o.completeStateChange(T);return}const L=u?.state?.get()||{};if(v){const P=O.value!==void 0?O.value:Object.values(O)[0],U=this.createNestedUpdate(v,P,L),B={...L,...U};z.log(`[handleParentScopeSetState] ${e}: 전역 상태 중첩 경로 업데이트`,B),this.globalStateUpdater(B)}else{const P=d==="deep"?this.deepMergeWithState(O,L):O;z.log(`[handleParentScopeSetState] ${e}: 전역 상태 업데이트 (mergeMode=${d})`,P),this.globalStateUpdater(d!=="deep"?{...P,__mergeMode:d}:P)}return T&&o&&setTimeout(()=>o.completeStateChange(T),0),{__target:e,...O}}else{if(!S.setState){z.warn(`[handleParentScopeSetState] 타겟 컨텍스트에 setState가 없습니다. target=${e}`),T&&o&&o.completeStateChange(T);return}const L=S.state||{};if(v){const P=O.value!==void 0?O.value:Object.values(O)[0],U=this.createNestedUpdate(v,P,L),B={...L,...U};return z.log(`[handleParentScopeSetState] ${e}: 로컬 상태 중첩 경로 업데이트`,U),S.setState(U),S.state=B,S.dataContext&&(S.dataContext._local=B),md(),T&&o&&setTimeout(()=>o.completeStateChange(T),0),B}else{const P=d!=="deep"?{...O,__mergeMode:d}:O,U=d==="replace"?O:d==="shallow"?{...L,...O}:this.deepMergeWithState(O,L);return z.log(`[handleParentScopeSetState] ${e}: 로컬 상태 업데이트 (mergeMode=${d})`,U),S.setState(P),S.state=U,S.dataContext&&(S.dataContext._local=U),md(),T&&o&&setTimeout(()=>o.completeStateChange(T),0),U}}}deepMergeWithState(e,a){const r=["errors"];let i=e;if("..."in e){const u=e["..."];if(u&&typeof u=="object"&&!Array.isArray(u)){const{"...":d,...f}=e;i={...u,...f}}else{const{"...":d,...f}=e;i=f}}const o={...a};for(const[u,d]of Object.entries(i)){if(r.includes(u)){o[u]=d;continue}if(u.includes(".")&&u!=="..."){const f=this.createNestedUpdate(u,d,o);this.deepMergeInto(o,f,o);continue}if(d!==null&&typeof d=="object"&&!Array.isArray(d)&&Object.getPrototypeOf(d)!==Object.prototype&&Object.getPrototypeOf(d)!==null){o[u]=d;continue}d!==null&&typeof d=="object"&&!Array.isArray(d)&&a[u]!==null&&typeof a[u]=="object"&&!Array.isArray(a[u])?o[u]=this.deepMergeWithState(d,a[u]):o[u]=d}return o}deepMergeInto(e,a,r){for(const[i,o]of Object.entries(a)){if(o===null){e[i]=o;continue}if(e[i]===null){e[i]=o;continue}typeof o=="object"&&!Array.isArray(o)&&e[i]!==void 0&&e[i]!==null&&typeof e[i]=="object"&&!Array.isArray(e[i])?(e[i]===r[i]&&(e[i]={...e[i]}),this.deepMergeInto(e[i],o,r[i]||{})):typeof o=="object"&&!Array.isArray(o)&&e[i]===void 0&&r[i]!==null&&typeof r[i]=="object"&&!Array.isArray(r[i])?e[i]={...r[i],...o}:e[i]=o}}createNestedUpdate(e,a,r){const i=e.split(".");if(i.length===1)return{[i[0]]:a};const o={};let u=o,d=r;for(let f=0;f<i.length-1;f++){const g=i[f],m=d?.[g],b=m!=null&&typeof m=="object"&&!Array.isArray(m);b?u[g]={...m}:u[g]={},u=u[g],d=b?m:{}}return u[i[i.length-1]]=a,o}buildNestedUpdate(e,a){const r=e.split(".");if(r.length===1)return{[r[0]]:a};const i={};let o=i;for(let u=0;u<r.length-1;u++)o[r[u]]={},o=o[r[u]];return o[r[r.length-1]]=a,i}async handleSetError(e,a,r){let i=e;i=this.resolveValue(i,r.data),this.translationEngine&&this.translationContext&&i.startsWith("$t:")&&(i=this.translationEngine.resolveTranslations(i,this.translationContext,r.data));const o=a?.stateTarget||"local";o==="isolated"&&r.isolatedContext?(r.isolatedContext.mergeState({apiError:i}),z.log("[handleSetError] Error set to isolated state:",i)):o==="global"&&this.globalStateUpdater?(this.globalStateUpdater({apiError:i}),z.log("[handleSetError] Error set to global state:",i)):r.setState?(r.setState({apiError:i}),z.log("[handleSetError] Error set to local state:",i)):z.warn("[handleSetError] Cannot set error: no state updater available")}async handleOpenModal(e,a){if(!this.globalStateUpdater){z.warn("Global state updater is not set for openModal");return}const r=a.data?._global?.modalStack||[];if(r.includes(e)){z.warn(`Modal "${e}" is already open`);return}const i=window.G7Core,o=a.setState&&a.state!==void 0,u=o?void 0:i?.state?.getLocal?.()||{},d=!o&&u!==void 0&&this.globalStateUpdater;if(o||d){const m=window.__g7LayoutContextStack||[],b=o?a.state:u,v=o?a.setState:E=>{this.globalStateUpdater({_local:E})};m.push({state:b,setState:v,dataContext:{_local:b||a.data?._local,_global:o?a.data?._global:a.data?._global||i?.state?.get?.(),_computed:a.data?._computed}}),window.__g7LayoutContextStack=m,z.log(`[handleOpenModal] 레이아웃 컨텍스트 스택에 push, 스택 크기: ${m.length}, state:`,b,o?"(direct)":"(fallback via G7Core)")}else z.warn(`[handleOpenModal] 컨텍스트 스택에 push 실패 - setState: ${!!a.setState}, state: ${a.state!==void 0}, G7Core: ${!!i?.state?.getLocal}`);const f=[...r,e];this.globalStateUpdater({modalStack:f,activeModal:e});const g=jn();if(g?.isEnabled()){const m=r.length>0?r[r.length-1]:void 0;g.trackModalOpen?.({modalId:e,modalName:e,scopeType:"isolated",parentModalId:m,initialState:a.state?{...a.state}:{}})}}async handleCloseModal(e){if(!this.globalStateUpdater){z.warn("Global state updater is not set for closeModal");return}const a=e?.data?._global?.modalStack||[],r=a.length>0?a[a.length-1]:null,i=a.slice(0,-1),o=i.length>0?i[i.length-1]:null,u=window.__g7LayoutContextStack||[];if(u.length>0){const d=u[u.length-1];d&&(d.dataContext=void 0),u.pop(),window.__g7LayoutContextStack=u,z.log(`[handleCloseModal] 레이아웃 컨텍스트 스택에서 pop, 스택 크기: ${u.length}`)}if(r){const d=jn();d?.isEnabled()&&d.trackModalClose?.(r,e?.state)}this.globalStateUpdater({modalStack:i,activeModal:o})}async handleShowAlert(e,a){let r=e;this.translationEngine&&this.translationContext&&e.startsWith("$t:")&&(r=this.translationEngine.resolveTranslations(e,this.translationContext,a.data)),alert(r)}async handleToast(e,a){const{type:r="info",message:i,icon:o,duration:u}=e;if(r==="error"){const f=a.data?.error;if((f?.error_code==="identity_verification_required"||f?.data?.error_code==="identity_verification_required")&&bt.consumeDomainNoticeShown()){z.log("[Toast] IDV 도메인 안내 표출됨 — 중복 가드 토스트 1건 skip");return}}let d=i;if(this.translationEngine&&this.translationContext&&i?.startsWith("$t:")&&(d=this.translationEngine.resolveTranslations(i,this.translationContext,a.data)),this.globalStateUpdater){const g={id:`toast_${Date.now()}_${Math.random().toString(36).substring(2,9)}`,type:r,message:d,...o&&{icon:o},...u&&{duration:u}},E=[...window.G7Core?.state?.get()?.toasts||[],g];this.globalStateUpdater({toasts:E})}else z.log(`[Toast ${r}] ${d}`)}async handleSwitch(e,a){const{cases:r}=e;if(!r){z.warn("switch handler requires cases property");return}const i=this.resolveParams(e.params,a.data);let o;if(i?.value!==void 0?(o=i.value,z.log("switch handler: using params.value as case key:",o)):(o=a.data?.$args?.[0],z.log("switch handler: using $args[0] as case key:",o)),o==null){if(r.default)return z.log("switch handler: case key is undefined, using default case"),await this.executeAction(r.default,a);z.warn("switch handler: case key is not defined and no default case");return}const u=String(o);let d=r[u];if(!d&&r.default&&(z.log(`switch handler: no case found for key "${u}", using default case`),d=r.default),!d){z.warn(`switch handler: no case found for key "${u}" and no default case`);return}return await this.executeAction(d,a)}async handleConditions(e,a){const{conditions:r}=e;if(!r||!Array.isArray(r)){z.warn("conditions handler requires conditions array");return}const i=a.data||{},o=Rg(r,i,this.bindingEngine);if(!o.matched){z.log("conditions handler: no matching branch found");return}const u=r[o.branchIndex];if(z.log(`conditions handler: matched branch ${o.branchIndex}`),!u.then){z.warn('conditions handler: matched branch has no "then" action');return}return Array.isArray(u.then)?await this.handleSequence({...e,actions:u.then},a):await this.executeAction(u.then,a)}handleStartInterval(e,a){const r=typeof e.id=="string"?e.id:"",i=Number(e.intervalMs??1e3),o=Array.isArray(e.actions)?e.actions:[];if(r===""||!o.length||i<=0)return z.warn("startInterval requires non-empty id, positive intervalMs, and actions array"),{success:!1};const u=this.intervals.get(r);u&&(clearInterval(u),this.intervals.delete(r));const d=setInterval(()=>{for(const f of o)this.executeAction(f,a).catch(g=>{z.error(`[startInterval:${r}] tick action failed`,g)})},i);return this.intervals.set(r,d),{success:!0,id:r}}handleStopInterval(e){const a=typeof e.id=="string"?e.id:"";if(a==="")return z.warn("stopInterval requires id parameter"),{success:!1};const r=this.intervals.get(a);return r&&(clearInterval(r),this.intervals.delete(a)),{success:!0,id:a}}stopAllIntervals(){for(const e of this.intervals.values())clearInterval(e);this.intervals.clear()}async handleSequence(e,a){const r=e.actions||e.params?.actions;if(!r||!Array.isArray(r)||r.length===0)return z.warn("sequence handler requires non-empty actions array"),[];const i=jn(),o=i?.isEnabled()&&i.startSequenceExecution?.({eventType:e.type})||"";window.__g7SequenceLocalSync=void 0;const u=[];let d,f=a.state?{...a.state}:{},g=a.isolatedContext?.state?{...a.isolatedContext.state}:{},m=a.data?._computed||{};const b=window.G7Core,v=()=>({_global:b?.state?.get()||{},_local:{...f},_isolated:Object.keys(g).length>0?{...g}:void 0});for(let E=0;E<r.length;E++){const S=r[E],A=Date.now();o&&i?.isEnabled()&&i.captureSequenceActionBefore?.(o,E,S.handler||"unknown",S.params||{},v());const T={...a,state:f,data:{...a.data,_local:f,_computed:m,$computed:m,$prev:d,$results:[...u],_isolated:g},isolatedContext:a.isolatedContext?{...a.isolatedContext,state:g}:null};try{const D=await this.executeAction(S,T);if(d=D.data,u.push(D.data),S.handler==="setState"&&D.data!==void 0){if(D.data.__target==="global"){const{__target:O,__mergeMode:L,...P}=D.data;L==="replace"?f={...f,_global:P}:f={...f,_global:{...f._global||{},...P}},z.log("[handleSequence] global state synchronized (mergeMode=%s):",L||"deep",f._global)}else if(D.data.__target==="isolated"){const{__target:O,__mergeMode:L,...P}=D.data;L==="replace"?g=P:g={...g,...P},z.log("[handleSequence] isolated state synchronized (mergeMode=%s):",L||"deep",g)}else if(D.data.__target==="local"){const{__target:O,__mergeMode:L,__setStateId:P,...U}=D.data;L==="replace"?f=U:f={...f,...U},z.log("[handleSequence] local state synchronized (mergeMode=%s):",L||"deep",f)}else f=D.data,z.log("[handleSequence] state synchronized (legacy):",f);const M=a.data?._computedDefinitions;if(M&&Object.keys(M).length>0){const O={},L={...a.data,_local:f,_computed:O,$computed:O,_isolated:g};for(const[P,U]of Object.entries(M))if(typeof U=="string"){const B=U.trim();if(B.startsWith("{{")&&B.endsWith("}}"))try{const Y=B.slice(2,-2).trim();O[P]=this.bindingEngine.evaluateExpression(Y,L,{skipCache:!0})}catch{O[P]=m[P]}}m=O,z.log("[handleSequence] _computed recalculated after setState:",m)}}if(S.handler!=="setState"){const M=window.__g7SequenceLocalSync;if(M&&M!==f){f=M,window.__g7SequenceLocalSync=void 0,z.log("[handleSequence] currentState synchronized from __g7SequenceLocalSync after custom handler:",S.handler);const O=a.data?._computedDefinitions;if(O&&Object.keys(O).length>0){const L={},P={...a.data,_local:f,_computed:L,$computed:L,_isolated:g};for(const[U,B]of Object.entries(O))if(typeof B=="string"){const Y=B.trim();if(Y.startsWith("{{")&&Y.endsWith("}}"))try{const ge=Y.slice(2,-2).trim();L[U]=this.bindingEngine.evaluateExpression(ge,P,{skipCache:!0})}catch{L[U]=m[U]}}m=L,z.log("[handleSequence] _computed recalculated after custom handler:",m)}}}o&&i?.isEnabled()&&i.captureSequenceActionAfter?.(o,E,v(),Date.now()-A,D.data)}catch(D){throw o&&i?.isEnabled()&&(i.captureSequenceActionAfter?.(o,E,v(),Date.now()-A,void 0,D),i.endSequenceExecution?.(o,D)),z.error(`sequence handler: action[${E}] failed:`,D),D}}return window.__g7SequenceLocalSync=void 0,o&&i?.isEnabled()&&i.endSequenceExecution?.(o),u}async handleParallel(e,a){const r=e.actions||e.params?.actions;if(!r||!Array.isArray(r)||r.length===0)return z.warn("parallel handler requires non-empty actions array"),[];z.log(`parallel handler: executing ${r.length} actions in parallel`);const i=a.isolatedContext?{...a.isolatedContext,state:{...a.isolatedContext.state}}:null,o=r.map((f,g)=>{const m={...a,isolatedContext:i};return this.executeAction(f,m).catch(b=>{throw z.error(`parallel handler: action[${g}] failed:`,b),b})}),u=await Promise.allSettled(o),d=u.filter(f=>f.status==="rejected").length;return d>0&&z.warn(`parallel handler: ${d}/${r.length} actions failed`),u}async handleLoadScript(e,a,r){const{src:i,id:o,async:u=!0,defer:d=!1}=e;if(!i)throw new Mt('loadScript handler requires "src" parameter',a);const f=o||`script_${i.replace(/[^a-zA-Z0-9]/g,"_")}`;return ns.loadedScripts.has(f)?(z.log(`loadScript: script already loaded, skipping: ${f}`),a.onLoad&&await this.executeAction(a.onLoad,r),!0):document.getElementById(f)?(z.log(`loadScript: script element already exists: ${f}`),ns.loadedScripts.add(f),a.onLoad&&await this.executeAction(a.onLoad,r),!0):(z.log(`loadScript: loading script: ${i}`),new Promise((m,b)=>{const v=document.createElement("script");v.id=f,v.src=i,v.async=u,v.defer=d,v.onload=async()=>{if(z.log(`loadScript: script loaded successfully: ${f}`),ns.loadedScripts.add(f),a.onLoad)try{await this.executeAction(a.onLoad,r)}catch(E){z.error("loadScript: onLoad action failed:",E)}m(!0)},v.onerror=E=>{z.error(`loadScript: failed to load script: ${i}`,E),b(new Mt(`Failed to load script: ${i}`,a))},document.head.appendChild(v)}))}async handleCallExternal(e,a,r){const i=e.constructor,o=e.args||{},u=e.method,d=e.methodArgs||[],f=e.callbackEvent,g=e.embedTarget,m=e.callbackSetState,b=e.callbackAction;if(!i)throw new Mt('callExternal handler requires "constructor" parameter',a);const v=this.getNestedProperty(window,i);if(!v||typeof v!="function")throw new Mt(`Constructor not found or not a function: ${i}. Make sure the script is loaded first using loadScript handler.`,a);z.log(`callExternal: calling constructor ${i}`);const E={...o};for(const[A,T]of Object.entries(o))T===!0&&(E[A]=D=>{if(z.log(`callExternal: callback triggered for ${A}`,D),f&&typeof window<"u"&&window.G7Core?.componentEvent&&window.G7Core.componentEvent.emit(f,D),m&&r.setState){const M=P=>{const U={};for(const[B,Y]of Object.entries(P))typeof Y=="string"?U[B]=this.getNestedProperty(D,Y):typeof Y=="object"&&Y!==null&&(U[B]=M(Y));return U},O=M(m);z.log("callExternal: callbackSetState mapping result",O);const L=this.deepMergeWithState(O,r.state||{});z.log("callExternal: merged with existing state",L),r.setState(L)}else f&&r.setState&&r.setState({[`${f.replace(/:/g,"_")}_result`]:D});if(b){const M={...r,data:{...r.data,$event:D}},O=Array.isArray(b)?b:[b];for(const L of O)try{this.executeAction(L,M)}catch(P){z.error("callExternal: callbackAction failed:",P)}}});const S=new v(E);if(u&&typeof S[u]=="function"){if(z.log(`callExternal: calling method ${u}`),u==="embed"&&g){const A=document.querySelector(g);if(A)return S[u](A,...d);throw new Mt(`Embed target element not found: ${g}`,a)}return S[u](...d)}return S}async handleCallExternalEmbed(e,a,r){const i=e.constructor,o=e.args||{},u=e.callbackSetState,d=e.callbackEvent,f=e.layerClassName,g=e.callbackAction;if(!i)throw new Mt('callExternalEmbed handler requires "constructor" parameter',a);const m=this.getNestedProperty(window,i);if(!m||typeof m!="function")throw new Mt(`Constructor not found or not a function: ${i}. Make sure the script is loaded first.`,a);z.log(`callExternalEmbed: creating layer for ${i}`);const{layer:b,closeLayer:v}=this.createEmbedLayer(f),E={...o};for(const[A,T]of Object.entries(o))T===!0&&(E[A]=D=>{if(z.log(`callExternalEmbed: callback triggered for ${A}`,D),v(),d&&typeof window<"u"&&window.G7Core?.componentEvent&&window.G7Core.componentEvent.emit(d,D),u&&r.setState){const M=P=>{const U={};for(const[B,Y]of Object.entries(P))typeof Y=="string"?U[B]=this.getNestedProperty(D,Y):typeof Y=="object"&&Y!==null&&(U[B]=M(Y));return U},O=M(u);z.log("callExternalEmbed: callbackSetState mapping result",O);const L=this.deepMergeWithState(O,r.state||{});z.log("callExternalEmbed: merged with existing state",L),r.setState(L)}if(g){const M={...r,data:{...r.data,$event:D}},O=Array.isArray(g)?g:[g];for(const L of O)try{this.executeAction(L,M)}catch(P){z.error("callExternalEmbed: callbackAction failed:",P)}}});const S=new m(E);if(typeof S.embed=="function")S.embed(b),z.log("callExternalEmbed: embedded in layer");else throw v(),new Mt(`Constructor ${i} does not have embed method`,a);return S}isImeComposing(e){return e?.isComposing===!0||e?.keyCode===229}createEmbedLayer(e){const a=document.createElement("div");a.id="g7-embed-overlay",a.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 r=document.createElement("div");r.id="g7-embed-layer",r.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&&(r.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 o=()=>{a.parentNode&&a.parentNode.removeChild(a)};i.onclick=o;const u=d=>{this.isImeComposing(d)||d.key==="Escape"&&(o(),document.removeEventListener("keydown",u))};return document.addEventListener("keydown",u),a.onclick=d=>{d.target===a&&o()},r.appendChild(i),a.appendChild(r),document.body.appendChild(a),{overlay:a,layer:r,closeLayer:o}}getNestedProperty(e,a){return a.split(".").reduce((r,i)=>r&&r[i]!==void 0?r[i]:void 0,e)}async handleSaveToLocalStorage(e,a){const{key:r,value:i}=e;if(!r)return z.error("saveToLocalStorage: key parameter is required"),!1;try{const o=typeof i=="string"?i:JSON.stringify(i);return localStorage.setItem(r,o),z.log(`saveToLocalStorage: saved ${r}`,i),!0}catch(o){return z.error("saveToLocalStorage: failed to save",{key:r,error:o}),!1}}async handleLoadFromLocalStorage(e,a){const{key:r,target:i,stateKey:o,defaultValue:u}=e;if(!r)return z.error("loadFromLocalStorage: key parameter is required"),u;try{const d=localStorage.getItem(r);if(d===null)return z.log(`loadFromLocalStorage: no value found for ${r}, using default`),o&&a.setState&&a.setState({[o]:u}),u;let f;try{f=JSON.parse(d)}catch{f=d}return z.log(`loadFromLocalStorage: loaded ${r}`,f),o&&a.setState&&a.setState({[o]:f}),f}catch(d){return z.error("loadFromLocalStorage: failed to load",{key:r,error:d}),u}}async handleCustomAction(e,a){const r=this.customHandlers.get(e.handler);if(!r){if(this.previewMode){z.warn(`[Preview] Unknown action handler "${e.handler}" — skipped (preview mode)`);return}throw new Mt(`Unknown action handler: ${e.handler}`,e)}return await r(e,a)}resolveParams(e,a){if(!e)return{};const r={};for(const[i,o]of Object.entries(e))i.includes("{{")&&z.warn(`[resolveParams] setState params의 키에 표현식이 포함되어 있습니다: "${i}". 키는 해석되지 않습니다. 배열 항목 수정은 .map()/.filter() 패턴을 사용하세요.`),typeof o=="string"&&o.includes("{{")?r[i]=this.evaluateExpression(o,a):typeof o=="string"?r[i]=o:Array.isArray(o)?r[i]=o.map(u=>typeof u=="string"&&u.includes("{{")?this.evaluateExpression(u,a):u):typeof o=="object"&&o!==null&&!Array.isArray(o)&&Object.getPrototypeOf(o)!==Object.prototype&&Object.getPrototypeOf(o)!==null?r[i]=o:typeof o=="object"&&o!==null?r[i]=this.resolveParams(o,a):r[i]=o;return r}resolveValue(e,a){return a?this.bindingEngine.resolveBindings(e,a,{skipCache:!0}):e}evaluateExpressions(e,a){let r={};for(const[i,o]of Object.entries(e))if(i==="..."){let u=o;typeof o=="string"&&o.includes("{{")&&(u=this.evaluateExpression(o,a)),u&&typeof u=="object"&&!Array.isArray(u)&&(r={...r,...u})}else typeof o=="string"&&o.includes("{{")?r[i]=this.evaluateExpression(o,a):typeof o=="object"&&o!==null&&!Array.isArray(o)?r[i]=this.evaluateExpressions(o,a):r[i]=o;return r}evaluateExpressionsIfNeeded(e,a){const r={};for(const[i,o]of Object.entries(e))typeof o=="string"&&o.includes("{{")?r[i]=this.evaluateExpression(o,a):r[i]=o;return r}evaluateExpression(e,a){if(!a)return e;const r=e.match(/^\{\{(.+)\}\}$/);if(!(r&&!r[1].includes("}}")&&!r[1].includes("{{"))){let d=a;if(e.includes("_global")){const g=window.G7Core?.state?.get()?._global;g&&(d={...a,_global:g})}if(e.includes("_computed")||e.includes("$computed")){const g=window.__g7ActionContext?.computedRef?.current;g&&Object.keys(g).length>0&&(d={...d,_computed:g,$computed:g})}return this.bindingEngine.resolveBindings(e,d,{skipCache:!0})}let o=r[1].trim();o=o.replace(/\$args\.(\d+)/g,"$args[$1]");let u=a;if(o.includes("_global")){const f=window.G7Core?.state?.get()?._global;f&&(u={...a,_global:f})}if(o.includes("_computed")||o.includes("$computed")){const f=window.__g7ActionContext?.computedRef?.current;f&&Object.keys(f).length>0&&(u={...u,_computed:f,$computed:f})}o.includes("_global.modules")&&(z.log("[evaluateExpression] expression:",o),z.log("[evaluateExpression] dataContext._global:",u._global),z.log("[evaluateExpression] dataContext._global?.modules:",u._global?.modules));try{const d=this.bindingEngine.evaluateExpression(o,u);return o.includes("_global.modules")&&z.log("[evaluateExpression] result:",d),typeof d=="string"&&d.startsWith("$t:")&&this.translationEngine&&this.translationContext?this.translationEngine.resolveTranslations(d,this.translationContext,a):d}catch(d){return z.error("Expression evaluation failed:",e,d),e}}setDefaultContext(e){this.defaultContext={...this.defaultContext,...e}}setGlobalStateUpdater(e){this.globalStateUpdater=e}getGlobalStateUpdater(){return this.globalStateUpdater}async dispatchAction(e,a){const r={...this.defaultContext,...a,data:{...this.defaultContext.data,...a?.data}};if(e.confirm){let i=this.resolveValue(e.confirm,r.data);if(this.translationEngine&&this.translationContext&&i.startsWith("$t:")&&(i=this.translationEngine.resolveTranslations(i,this.translationContext,r.data)),!confirm(i))return{success:!1}}try{return await this.executeAction(e,r)}catch(i){if(z.error("dispatchAction failed:",i),e.onError){const o=i instanceof Mt&&i.originalError?{message:i.originalError.message,response:i.originalError.response}:{message:i instanceof Error?i.message:String(i)},u={...r,data:{...r.data,error:o}},d=Array.isArray(e.onError)?e.onError:[e.onError];for(const f of d)await this.executeAction(f,u)}return{success:!1,error:i instanceof Error?i:new Error(String(i))}}}registerHandler(e,a,r){this.customHandlers.set(e,a);const i=jn();i?.isEnabled()&&i.trackHandlerRegistration(e,r?.category??"custom",r?.description,r?.source)}unregisterHandler(e){this.customHandlers.delete(e);const a=jn();a?.isEnabled()&&a.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 a=e.target;if(a&&!("tagName"in a)){const o={type:e.type??"custom",target:{value:a.value,name:a.name??""}};return e._changedKeys&&(o._changedKeys=e._changedKeys),o}const i=a?{value:a.value,name:a.name??"",checked:a.checked??!1,type:a.type??"",tagName:a.tagName}:{};if(e.type==="scroll"&&a){const o=a;i.scrollHeight=o.scrollHeight??0,i.scrollTop=o.scrollTop??0,i.clientHeight=o.clientHeight??0,i.scrollLeft=o.scrollLeft??0,i.clientWidth=o.clientWidth??0,i.scrollWidth=o.scrollWidth??0}return{type:e.type,target:a?i:null}}executeDebouncedAction(e,a,r,i,o){const u={...r,$event:a,$args:o},d={type:a.type,target:a.target,preventDefault:()=>{},stopPropagation:()=>{}};this.createHandler(e,u,i)(d)}handleDebouncedAction(e,a,r,i,o,u){const d=this.normalizeDebounceConfig(e.debounce),f=o||`default-${e.handler}-${Date.now()}`,g=this.extractEventData(a),m=g._changedKeys;if(m&&Array.isArray(m)&&g?.target?.value&&typeof g.target.value=="object"&&!Array.isArray(g.target.value)){const S=this.debounceAccumulatedValues.get(f);if(S){const A={...S};for(const T of m)A[T]=g.target.value[T];g.target.value=A}this.debounceAccumulatedValues.set(f,g.target.value)}const b=this.debounceTimers.get(f);b&&(clearTimeout(b),this.debounceTimers.delete(f));const v=jn();v?.isEnabled()&&v.trackAction({handler:typeof e.handler=="string"?e.handler:String(e.handler),type:e.type,status:"pending",params:e.params,debounce:{delay:d.delay,status:"pending",scheduledAt:Date.now()}});const E=!this.debounceTimers.has(f+"_leading");if(d.leading&&E&&(this.debounceTimers.set(f+"_leading",setTimeout(()=>{},0)),this.executeDebouncedAction(e,g,r,i,u),v?.isEnabled()&&v.trackAction({handler:typeof e.handler=="string"?e.handler:String(e.handler),type:e.type,status:"success",params:e.params,debounce:{delay:d.delay,status:"executed",executedAt:Date.now(),mode:"leading"}})),d.trailing){const S=()=>{this.executeDebouncedAction(e,g,r,i,u),v?.isEnabled()&&v.trackAction({handler:typeof e.handler=="string"?e.handler:String(e.handler),type:e.type,status:"success",params:e.params,debounce:{delay:d.delay,status:"executed",executedAt:Date.now(),mode:"trailing"}})},A=setTimeout(()=>{this.debounceTimers.delete(f),this.debounceTimers.delete(f+"_leading"),this.pendingDebounceFlushers.delete(f),this.debounceAccumulatedValues.delete(f),S()},d.delay);this.debounceTimers.set(f,A),this.pendingDebounceFlushers.set(f,S)}}clearDebounceTimers(e){if(e)for(const[a,r]of this.debounceTimers)a.startsWith(e+"-")&&(clearTimeout(r),this.debounceTimers.delete(a),this.pendingDebounceFlushers.delete(a),this.debounceAccumulatedValues.delete(a));else{for(const a of this.debounceTimers.values())clearTimeout(a);this.debounceTimers.clear(),this.pendingDebounceFlushers.clear(),this.debounceAccumulatedValues.clear()}}debouncedCall(e,a,r){const i=this.debounceTimers.get(e);i&&(clearTimeout(i),this.debounceTimers.delete(e));const o=setTimeout(()=>{this.debounceTimers.delete(e),this.pendingDebounceFlushers.delete(e),r()},a);this.debounceTimers.set(e,o),this.pendingDebounceFlushers.set(e,r)}flushPendingDebounceTimers(){if(this.pendingDebounceFlushers.size===0)return;const e=new Map(this.pendingDebounceFlushers);for(const[a,r]of e){const i=this.debounceTimers.get(a);i&&(clearTimeout(i),this.debounceTimers.delete(a)),this.debounceTimers.delete(a+"_leading"),this.pendingDebounceFlushers.delete(a),r()}this.globalStateUpdater&&this.globalStateUpdater({})}bindActionsToProps(e,a,r){const i={...e};if(e.actions&&Array.isArray(e.actions)){const o=new Map;for(const m of e.actions){const b=this.resolveActionRef(m),v=b.event||this.getEventHandlerName(b.type);o.has(v)||o.set(v,[]),o.get(v).push(b)}const u=e.name||e.id||"unknown",d=o.has("onDrop"),f=o.has("onDragOver"),g=o.has("onDragEnter");d&&!f&&(i.onDragOver=m=>{m.preventDefault()}),d&&!g&&(i.onDragEnter=m=>{m.preventDefault()});for(const[m,b]of o)i[m]=(...v)=>{for(const E of b){const S=v[0],A=S&&typeof S=="object"&&"preventDefault"in S;if(A&&(m==="onDragOver"||m==="onDrop")&&S.preventDefault(),A&&E.key&&"key"in S){if(this.isImeComposing(S)){z.log("Key filter skipped (IME composing):",E.key);continue}if(S.key!==E.key){z.log("Key filter not matched:",E.key,"actual:",S.key);continue}z.log("Key filter matched:",E.key)}if(E.debounce){const T=`${u}-${E.handler}-${m}`,D=S&&typeof S=="object"&&!("preventDefault"in S)&&"target"in S&&S.target!==null;let M;if(A)M=S;else if(D){const L={type:"custom",target:S.target,preventDefault:()=>{},stopPropagation:()=>{}};S._changedKeys&&(L._changedKeys=S._changedKeys),M=L}else M=new Event("custom");const O=E.event?{...a,$args:v}:a;this.handleDebouncedAction(E,M,O,r,T,v)}else if(this.flushPendingDebounceTimers(),E.event){const T={...a,$args:v},D=A?S:new Event("custom");this.createHandler(E,T,r)(D)}else if(A)this.createHandler(E,a,r)(S);else if(S&&typeof S=="object"&&!("preventDefault"in S)&&"target"in S&&S.target!==null){const D={type:"custom",target:S.target,preventDefault:()=>{},stopPropagation:()=>{}};this.createHandler(E,a,r)(D)}}}}return i}getEventHandlerName(e){return{click:"onClick",change:"onChange",input:"onInput",submit:"onSubmit",focus:"onFocus",blur:"onBlur",keydown:"onKeyDown",keyup:"onKeyUp",keypress:"onKeyPress",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",scroll:"onScroll",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",dragenter:"onDragEnter",dragover:"onDragOver",dragleave:"onDragLeave",drop:"onDrop"}[e]||`on${e.charAt(0).toUpperCase()}${e.slice(1)}`}sanitizeForDevTools(e,a=5){const r=new WeakSet,i=(o,u)=>{if(o==null||typeof o=="string"||typeof o=="number"||typeof o=="boolean")return o;if(u>a)return"[Max Depth Exceeded]";if(typeof o=="function")return`[Function: ${o.name||"anonymous"}]`;if(o instanceof Element)return`[Element: ${o.tagName}${o.className?"."+o.className.split(" ").join("."):""}]`;if(o instanceof Event)return`[Event: ${o.type}]`;if(Array.isArray(o)){if(r.has(o))return"[Circular Array]";r.add(o);const d=o.slice(0,10).map(f=>i(f,u+1));return o.length>10&&d.push(`... ${o.length-10} more items`),d}if(typeof o=="object"){if(r.has(o))return"[Circular Reference]";r.add(o);const d={},f=Object.keys(o),g=f.slice(0,20);for(const m of g)try{d[m]=i(o[m],u+1)}catch{d[m]="[Error accessing property]"}return f.length>20&&(d["..."]=`${f.length-20} more properties`),d}return String(o)};return i(e,0)}};$(ns,"loadedScripts",new Set);let ro=ns,Yl=null;function xp(l){return Yl||(Yl=new ro(l)),Yl}function r0(l){Yl=l}const Tp=dt("TransitionManager");class i0{constructor(){$(this,"isPending",!1);$(this,"subscribers",new Set)}setPending(e){this.isPending!==e&&(Tp.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(){Tp.log("notifySubscribers:",{isPending:this.isPending,subscriberCount:this.subscribers.size}),this.subscribers.forEach(e=>{e(this.isPending)})}clearSubscribers(){this.subscribers.clear()}}const Na=new i0,Xl=dt("TransitionContext"),kp=N.createContext({isTransitioning:!1}),yd=({children:l})=>{const[e,a]=N.useState(()=>{const i=Na.getIsPending();return Xl.log("Initial state:",i),i});N.useEffect(()=>{Xl.log("Subscribing to TransitionManager");const i=Na.subscribe(o=>{Xl.log("Received isPending update:",o),a(o)});return()=>{Xl.log("Unsubscribing from TransitionManager"),i()}},[]);const r=N.useMemo(()=>({isTransitioning:e}),[e]);return ct.jsx(kp.Provider,{value:r,children:l})},Rp=()=>N.useContext(kp);function s0(l){return l<768?"mobile":l<1024?"tablet":"desktop"}function Dp(l){const e=s0(l);return{width:l,isMobile:e==="mobile",isTablet:e==="tablet",isDesktop:e==="desktop",matchedPreset:e}}const bd=N.createContext(Dp(1024)),Ql=({children:l,overrideWidth:e})=>{const[a,r]=N.useState(()=>ci.getWidth());N.useEffect(()=>{const u=ci.subscribe(d=>{r(d)});return()=>{u()}},[]);const i=e??a,o=N.useMemo(()=>Dp(i),[i]);return ct.jsx(bd.Provider,{value:o,children:l})},vd=()=>N.useContext(bd);window.G7Core?.createLogger?.("Core:State");function o0(l,e,a,r){const{syncOnControlledChange:i=!0,isEqual:o}=r??{},u=l!==void 0;N.useRef(u);const[d,f]=N.useState(l!==void 0?l:e),g=d,m=N.useRef(l),b=N.useRef(!1);N.useEffect(()=>{if(b.current){m.current=l;return}i&&u&&l!==m.current&&(o?!o(d,l):d!==l)&&f(l),m.current=l},[l,u,i,o,d]);const v=N.useCallback(E=>{const S=typeof E=="function"?E(g):E;(o?o(g,S):g===S)||(b.current=!0,f(S),a?.(S),requestAnimationFrame(()=>{b.current=!1}))},[g,u,a,o]);return[g,v]}function l0(l,e){return l===e?!0:l.length!==e.length?!1:l.every((a,r)=>a===e[r])}function Op(l,e){if(l===e)return!0;const a=Object.keys(l),r=Object.keys(e);return a.length!==r.length?!1:a.every(i=>l[i]===e[i])}const Lp=N.createContext({}),c0=({children:l,value:e})=>ct.jsx(Lp.Provider,{value:e,children:l}),u0=()=>N.useContext(Lp),d0=(l,e)=>{if(!l)return;const a=e.split(".");let r=l;for(const i of a){if(r==null)return;r=r[i]}return r},f0=(l,e,a)=>{const r=e.split(".");if(r.length===1)return{...l,[r[0]]:a};const i={...l};let o=i;for(let u=0;u<r.length-1;u++){const d=r[u],f=r[u+1],g=/^\d+$/.test(f);Array.isArray(o[d])&&!g?o[d]={...o[d]}:Array.isArray(o[d])?o[d]=[...o[d]]:g?o[d]=Array.isArray(o[d])?[...o[d]]:[]:o[d]={...o[d]||{}},o=o[d]}return o[r[r.length-1]]=a,i},Wi=dt("IsolatedStateContext"),h0={state:{},setState:()=>{Wi.warn("IsolatedStateContext not available: setState called outside IsolatedStateProvider")},getState:()=>{},mergeState:()=>{Wi.warn("IsolatedStateContext not available: mergeState called outside IsolatedStateProvider")},stateRef:{current:{}},scopeId:""},Mp=N.createContext(h0);let g0=0;function p0(){return`isolated-${++g0}-${Date.now().toString(36)}`}function $p(l,e){if(e==null)return l;if(typeof e!="object"||Array.isArray(e))return e;const a={...l};for(const r of Object.keys(e)){const i=e[r],o=l?.[r];i!==null&&typeof i=="object"&&!Array.isArray(i)&&o!==null&&typeof o=="object"&&!Array.isArray(o)?a[r]=$p(o,i):a[r]=i}return a}function m0(l,e){return e?e.split(".").reduce((a,r)=>a?.[r],l):l}function y0(l,e,a){const r=e.split("."),i={...l};let o=i;for(let u=0;u<r.length-1;u++){const d=r[u];o[d]={...o[d]},o=o[d]}return o[r[r.length-1]]=a,i}const b0=({initialState:l={},scopeId:e,children:a})=>{const i=N.useRef(e||p0()).current,[o,u]=N.useState(l),d=N.useRef(o);d.current=o;const f=N.useCallback(E=>m0(d.current,E),[]),g=N.useCallback((E,S)=>{u(A=>{const T=y0(A,E,S);return Wi.log(`[${i}] setState: ${E} =`,S),T})},[i]),m=N.useCallback((E,S="deep")=>{u(A=>{let T;return S==="replace"?T=E:S==="shallow"?T={...A,...E}:T=$p(A,E),Wi.log(`[${i}] mergeState (${S}):`,E),T})},[i]),b=N.useMemo(()=>({state:o,setState:g,getState:f,mergeState:m,stateRef:d,scopeId:i}),[o,g,f,m,i]),v=N.useMemo(()=>({state:d.current,setState:g,getState:f,mergeState:m}),[g,f,m]);return N.useEffect(()=>{const E=window.G7Core,S=window.__g7IsolatedStates||{};return window.__g7IsolatedStates||(window.__g7IsolatedStates=S),S[i]=v,E&&(E._isolatedStates||(E._isolatedStates={}),E._isolatedStates[i]=o),E?.devTools?.isEnabled?.()&&E.devTools.emit?.("isolated:created",{id:i,state:o}),Wi.log(`[${i}] IsolatedStateProvider mounted with initial state:`,o),()=>{delete S[i],E?._isolatedStates&&delete E._isolatedStates[i],E?.devTools?.isEnabled?.()&&E.devTools.emit?.("isolated:destroyed",{id:i}),Wi.log(`[${i}] IsolatedStateProvider unmounted`)}},[i,v]),N.useEffect(()=>{const E=window.G7Core,S=window.__g7IsolatedStates;S?.[i]&&(S[i].state=o),E?._isolatedStates&&(E._isolatedStates[i]=o),E?.devTools?.isEnabled?.()&&E.devTools.emit?.("isolated:updated",{id:i,state:o})},[o,i]),ct.jsx(Mp.Provider,{value:b,children:a})},v0=()=>{const l=N.useContext(Mp);return l.scopeId?l:null};var Ar=yg();function S0(){for(var l=arguments.length,e=new Array(l),a=0;a<l;a++)e[a]=arguments[a];return N.useMemo(()=>r=>{e.forEach(i=>i(r))},e)}const Jl=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Yi(l){const e=Object.prototype.toString.call(l);return e==="[object Window]"||e==="[object global]"}function Sd(l){return"nodeType"in l}function xn(l){var e,a;return l?Yi(l)?l:Sd(l)&&(e=(a=l.ownerDocument)==null?void 0:a.defaultView)!=null?e:window:window}function wd(l){const{Document:e}=xn(l);return l instanceof e}function io(l){return Yi(l)?!1:l instanceof xn(l).HTMLElement}function Np(l){return l instanceof xn(l).SVGElement}function Xi(l){return l?Yi(l)?l.document:Sd(l)?wd(l)?l:io(l)||Np(l)?l.ownerDocument:document:document:document}const Ha=Jl?N.useLayoutEffect:N.useEffect;function Cd(l){const e=N.useRef(l);return Ha(()=>{e.current=l}),N.useCallback(function(){for(var a=arguments.length,r=new Array(a),i=0;i<a;i++)r[i]=arguments[i];return e.current==null?void 0:e.current(...r)},[])}function w0(){const l=N.useRef(null),e=N.useCallback((r,i)=>{l.current=setInterval(r,i)},[]),a=N.useCallback(()=>{l.current!==null&&(clearInterval(l.current),l.current=null)},[]);return[e,a]}function so(l,e){e===void 0&&(e=[l]);const a=N.useRef(l);return Ha(()=>{a.current!==l&&(a.current=l)},e),a}function oo(l,e){const a=N.useRef();return N.useMemo(()=>{const r=l(a.current);return a.current=r,r},[...e])}function Zl(l){const e=Cd(l),a=N.useRef(null),r=N.useCallback(i=>{i!==a.current&&e?.(i,a.current),a.current=i},[]);return[a,r]}function Ed(l){const e=N.useRef();return N.useEffect(()=>{e.current=l},[l]),e.current}let _d={};function lo(l,e){return N.useMemo(()=>{if(e)return e;const a=_d[l]==null?0:_d[l]+1;return _d[l]=a,l+"-"+a},[l,e])}function Hp(l){return function(e){for(var a=arguments.length,r=new Array(a>1?a-1:0),i=1;i<a;i++)r[i-1]=arguments[i];return r.reduce((o,u)=>{const d=Object.entries(u);for(const[f,g]of d){const m=o[f];m!=null&&(o[f]=m+l*g)}return o},{...e})}}const Qi=Hp(1),co=Hp(-1);function C0(l){return"clientX"in l&&"clientY"in l}function Ad(l){if(!l)return!1;const{KeyboardEvent:e}=xn(l.target);return e&&l instanceof e}function E0(l){if(!l)return!1;const{TouchEvent:e}=xn(l.target);return e&&l instanceof e}function xd(l){if(E0(l)){if(l.touches&&l.touches.length){const{clientX:e,clientY:a}=l.touches[0];return{x:e,y:a}}else if(l.changedTouches&&l.changedTouches.length){const{clientX:e,clientY:a}=l.changedTouches[0];return{x:e,y:a}}}return C0(l)?{x:l.clientX,y:l.clientY}:null}const uo=Object.freeze({Translate:{toString(l){if(!l)return;const{x:e,y:a}=l;return"translate3d("+(e?Math.round(e):0)+"px, "+(a?Math.round(a):0)+"px, 0)"}},Scale:{toString(l){if(!l)return;const{scaleX:e,scaleY:a}=l;return"scaleX("+e+") scaleY("+a+")"}},Transform:{toString(l){if(l)return[uo.Translate.toString(l),uo.Scale.toString(l)].join(" ")}},Transition:{toString(l){let{property:e,duration:a,easing:r}=l;return e+" "+a+"ms "+r}}}),zp="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function _0(l){return l.matches(zp)?l:l.querySelector(zp)}const A0={display:"none"};function x0(l){let{id:e,value:a}=l;return We.createElement("div",{id:e,style:A0},a)}function T0(l){let{id:e,announcement:a,ariaLiveType:r="assertive"}=l;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 We.createElement("div",{id:e,style:i,role:"status","aria-live":r,"aria-atomic":!0},a)}function k0(){const[l,e]=N.useState("");return{announce:N.useCallback(r=>{r!=null&&e(r)},[]),announcement:l}}const Ip=N.createContext(null);function R0(l){const e=N.useContext(Ip);N.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(l)},[l,e])}function D0(){const[l]=N.useState(()=>new Set),e=N.useCallback(r=>(l.add(r),()=>l.delete(r)),[l]);return[N.useCallback(r=>{let{type:i,event:o}=r;l.forEach(u=>{var d;return(d=u[i])==null?void 0:d.call(u,o)})},[l]),e]}const O0={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.
`},L0={onDragStart(l){let{active:e}=l;return"Picked up draggable item "+e.id+"."},onDragOver(l){let{active:e,over:a}=l;return a?"Draggable item "+e.id+" was moved over droppable area "+a.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(l){let{active:e,over:a}=l;return a?"Draggable item "+e.id+" was dropped over droppable area "+a.id:"Draggable item "+e.id+" was dropped."},onDragCancel(l){let{active:e}=l;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function M0(l){let{announcements:e=L0,container:a,hiddenTextDescribedById:r,screenReaderInstructions:i=O0}=l;const{announce:o,announcement:u}=k0(),d=lo("DndLiveRegion"),[f,g]=N.useState(!1);if(N.useEffect(()=>{g(!0)},[]),R0(N.useMemo(()=>({onDragStart(b){let{active:v}=b;o(e.onDragStart({active:v}))},onDragMove(b){let{active:v,over:E}=b;e.onDragMove&&o(e.onDragMove({active:v,over:E}))},onDragOver(b){let{active:v,over:E}=b;o(e.onDragOver({active:v,over:E}))},onDragEnd(b){let{active:v,over:E}=b;o(e.onDragEnd({active:v,over:E}))},onDragCancel(b){let{active:v,over:E}=b;o(e.onDragCancel({active:v,over:E}))}}),[o,e])),!f)return null;const m=We.createElement(We.Fragment,null,We.createElement(x0,{id:r,value:i.draggable}),We.createElement(T0,{id:d,announcement:u}));return a?Ar.createPortal(m,a):m}var Jt;(function(l){l.DragStart="dragStart",l.DragMove="dragMove",l.DragEnd="dragEnd",l.DragCancel="dragCancel",l.DragOver="dragOver",l.RegisterDroppable="registerDroppable",l.SetDroppableDisabled="setDroppableDisabled",l.UnregisterDroppable="unregisterDroppable"})(Jt||(Jt={}));function ec(){}function jp(l,e){return N.useMemo(()=>({sensor:l,options:e??{}}),[l,e])}function $0(){for(var l=arguments.length,e=new Array(l),a=0;a<l;a++)e[a]=arguments[a];return N.useMemo(()=>[...e].filter(r=>r!=null),[...e])}const ya=Object.freeze({x:0,y:0});function Up(l,e){return Math.sqrt(Math.pow(l.x-e.x,2)+Math.pow(l.y-e.y,2))}function Bp(l,e){let{data:{value:a}}=l,{data:{value:r}}=e;return a-r}function N0(l,e){let{data:{value:a}}=l,{data:{value:r}}=e;return r-a}function qp(l){let{left:e,top:a,height:r,width:i}=l;return[{x:e,y:a},{x:e+i,y:a},{x:e,y:a+r},{x:e+i,y:a+r}]}function Pp(l,e){if(!l||l.length===0)return null;const[a]=l;return a[e]}function Gp(l,e,a){return e===void 0&&(e=l.left),a===void 0&&(a=l.top),{x:e+l.width*.5,y:a+l.height*.5}}const H0=l=>{let{collisionRect:e,droppableRects:a,droppableContainers:r}=l;const i=Gp(e,e.left,e.top),o=[];for(const u of r){const{id:d}=u,f=a.get(d);if(f){const g=Up(Gp(f),i);o.push({id:d,data:{droppableContainer:u,value:g}})}}return o.sort(Bp)},z0=l=>{let{collisionRect:e,droppableRects:a,droppableContainers:r}=l;const i=qp(e),o=[];for(const u of r){const{id:d}=u,f=a.get(d);if(f){const g=qp(f),m=i.reduce((v,E,S)=>v+Up(g[S],E),0),b=Number((m/4).toFixed(4));o.push({id:d,data:{droppableContainer:u,value:b}})}}return o.sort(Bp)};function I0(l,e){const a=Math.max(e.top,l.top),r=Math.max(e.left,l.left),i=Math.min(e.left+e.width,l.left+l.width),o=Math.min(e.top+e.height,l.top+l.height),u=i-r,d=o-a;if(r<i&&a<o){const f=e.width*e.height,g=l.width*l.height,m=u*d,b=m/(f+g-m);return Number(b.toFixed(4))}return 0}const j0=l=>{let{collisionRect:e,droppableRects:a,droppableContainers:r}=l;const i=[];for(const o of r){const{id:u}=o,d=a.get(u);if(d){const f=I0(d,e);f>0&&i.push({id:u,data:{droppableContainer:o,value:f}})}}return i.sort(N0)};function U0(l,e,a){return{...l,scaleX:e&&a?e.width/a.width:1,scaleY:e&&a?e.height/a.height:1}}function Vp(l,e){return l&&e?{x:l.left-e.left,y:l.top-e.top}:ya}function B0(l){return function(a){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return i.reduce((u,d)=>({...u,top:u.top+l*d.y,bottom:u.bottom+l*d.y,left:u.left+l*d.x,right:u.right+l*d.x}),{...a})}}const q0=B0(1);function P0(l){if(l.startsWith("matrix3d(")){const e=l.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(l.startsWith("matrix(")){const e=l.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function G0(l,e,a){const r=P0(e);if(!r)return l;const{scaleX:i,scaleY:o,x:u,y:d}=r,f=l.left-u-(1-i)*parseFloat(a),g=l.top-d-(1-o)*parseFloat(a.slice(a.indexOf(" ")+1)),m=i?l.width/i:l.width,b=o?l.height/o:l.height;return{width:m,height:b,top:g,right:f+m,bottom:g+b,left:f}}const V0={ignoreTransform:!1};function Ji(l,e){e===void 0&&(e=V0);let a=l.getBoundingClientRect();if(e.ignoreTransform){const{transform:g,transformOrigin:m}=xn(l).getComputedStyle(l);g&&(a=G0(a,g,m))}const{top:r,left:i,width:o,height:u,bottom:d,right:f}=a;return{top:r,left:i,width:o,height:u,bottom:d,right:f}}function Fp(l){return Ji(l,{ignoreTransform:!0})}function F0(l){const e=l.innerWidth,a=l.innerHeight;return{top:0,left:0,right:e,bottom:a,width:e,height:a}}function K0(l,e){return e===void 0&&(e=xn(l).getComputedStyle(l)),e.position==="fixed"}function W0(l,e){e===void 0&&(e=xn(l).getComputedStyle(l));const a=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const o=e[i];return typeof o=="string"?a.test(o):!1})}function tc(l,e){const a=[];function r(i){if(e!=null&&a.length>=e||!i)return a;if(wd(i)&&i.scrollingElement!=null&&!a.includes(i.scrollingElement))return a.push(i.scrollingElement),a;if(!io(i)||Np(i)||a.includes(i))return a;const o=xn(l).getComputedStyle(i);return i!==l&&W0(i,o)&&a.push(i),K0(i,o)?a:r(i.parentNode)}return l?r(l):a}function Kp(l){const[e]=tc(l,1);return e??null}function Td(l){return!Jl||!l?null:Yi(l)?l:Sd(l)?wd(l)||l===Xi(l).scrollingElement?window:io(l)?l:null:null}function Wp(l){return Yi(l)?l.scrollX:l.scrollLeft}function Yp(l){return Yi(l)?l.scrollY:l.scrollTop}function kd(l){return{x:Wp(l),y:Yp(l)}}var sn;(function(l){l[l.Forward=1]="Forward",l[l.Backward=-1]="Backward"})(sn||(sn={}));function Xp(l){return!Jl||!l?!1:l===document.scrollingElement}function Qp(l){const e={x:0,y:0},a=Xp(l)?{height:window.innerHeight,width:window.innerWidth}:{height:l.clientHeight,width:l.clientWidth},r={x:l.scrollWidth-a.width,y:l.scrollHeight-a.height},i=l.scrollTop<=e.y,o=l.scrollLeft<=e.x,u=l.scrollTop>=r.y,d=l.scrollLeft>=r.x;return{isTop:i,isLeft:o,isBottom:u,isRight:d,maxScroll:r,minScroll:e}}const Y0={x:.2,y:.2};function X0(l,e,a,r,i){let{top:o,left:u,right:d,bottom:f}=a;r===void 0&&(r=10),i===void 0&&(i=Y0);const{isTop:g,isBottom:m,isLeft:b,isRight:v}=Qp(l),E={x:0,y:0},S={x:0,y:0},A={height:e.height*i.y,width:e.width*i.x};return!g&&o<=e.top+A.height?(E.y=sn.Backward,S.y=r*Math.abs((e.top+A.height-o)/A.height)):!m&&f>=e.bottom-A.height&&(E.y=sn.Forward,S.y=r*Math.abs((e.bottom-A.height-f)/A.height)),!v&&d>=e.right-A.width?(E.x=sn.Forward,S.x=r*Math.abs((e.right-A.width-d)/A.width)):!b&&u<=e.left+A.width&&(E.x=sn.Backward,S.x=r*Math.abs((e.left+A.width-u)/A.width)),{direction:E,speed:S}}function Q0(l){if(l===document.scrollingElement){const{innerWidth:o,innerHeight:u}=window;return{top:0,left:0,right:o,bottom:u,width:o,height:u}}const{top:e,left:a,right:r,bottom:i}=l.getBoundingClientRect();return{top:e,left:a,right:r,bottom:i,width:l.clientWidth,height:l.clientHeight}}function Jp(l){return l.reduce((e,a)=>Qi(e,kd(a)),ya)}function J0(l){return l.reduce((e,a)=>e+Wp(a),0)}function Z0(l){return l.reduce((e,a)=>e+Yp(a),0)}function eC(l,e){if(e===void 0&&(e=Ji),!l)return;const{top:a,left:r,bottom:i,right:o}=e(l);Kp(l)&&(i<=0||o<=0||a>=window.innerHeight||r>=window.innerWidth)&&l.scrollIntoView({block:"center",inline:"center"})}const tC=[["x",["left","right"],J0],["y",["top","bottom"],Z0]];class Rd{constructor(e,a){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 r=tc(a),i=Jp(r);this.rect={...e},this.width=e.width,this.height=e.height;for(const[o,u,d]of tC)for(const f of u)Object.defineProperty(this,f,{get:()=>{const g=d(r),m=i[o]-g;return this.rect[f]+m},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class fo{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(a=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...a)})},this.target=e}add(e,a,r){var i;(i=this.target)==null||i.addEventListener(e,a,r),this.listeners.push([e,a,r])}}function nC(l){const{EventTarget:e}=xn(l);return l instanceof e?l:Xi(l)}function Dd(l,e){const a=Math.abs(l.x),r=Math.abs(l.y);return typeof e=="number"?Math.sqrt(a**2+r**2)>e:"x"in e&&"y"in e?a>e.x&&r>e.y:"x"in e?a>e.x:"y"in e?r>e.y:!1}var Zn;(function(l){l.Click="click",l.DragStart="dragstart",l.Keydown="keydown",l.ContextMenu="contextmenu",l.Resize="resize",l.SelectionChange="selectionchange",l.VisibilityChange="visibilitychange"})(Zn||(Zn={}));function Zp(l){l.preventDefault()}function aC(l){l.stopPropagation()}var st;(function(l){l.Space="Space",l.Down="ArrowDown",l.Right="ArrowRight",l.Left="ArrowLeft",l.Up="ArrowUp",l.Esc="Escape",l.Enter="Enter",l.Tab="Tab"})(st||(st={}));const em={start:[st.Space,st.Enter],cancel:[st.Esc],end:[st.Space,st.Enter,st.Tab]},rC=(l,e)=>{let{currentCoordinates:a}=e;switch(l.code){case st.Right:return{...a,x:a.x+25};case st.Left:return{...a,x:a.x-25};case st.Down:return{...a,y:a.y+25};case st.Up:return{...a,y:a.y-25}}};class Od{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:a}}=e;this.props=e,this.listeners=new fo(Xi(a)),this.windowListeners=new fo(xn(a)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Zn.Resize,this.handleCancel),this.windowListeners.add(Zn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Zn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:a}=this.props,r=e.node.current;r&&eC(r),a(ya)}handleKeyDown(e){if(Ad(e)){const{active:a,context:r,options:i}=this.props,{keyboardCodes:o=em,coordinateGetter:u=rC,scrollBehavior:d="smooth"}=i,{code:f}=e;if(o.end.includes(f)){this.handleEnd(e);return}if(o.cancel.includes(f)){this.handleCancel(e);return}const{collisionRect:g}=r.current,m=g?{x:g.left,y:g.top}:ya;this.referenceCoordinates||(this.referenceCoordinates=m);const b=u(e,{active:a,context:r.current,currentCoordinates:m});if(b){const v=co(b,m),E={x:0,y:0},{scrollableAncestors:S}=r.current;for(const A of S){const T=e.code,{isTop:D,isRight:M,isLeft:O,isBottom:L,maxScroll:P,minScroll:U}=Qp(A),B=Q0(A),Y={x:Math.min(T===st.Right?B.right-B.width/2:B.right,Math.max(T===st.Right?B.left:B.left+B.width/2,b.x)),y:Math.min(T===st.Down?B.bottom-B.height/2:B.bottom,Math.max(T===st.Down?B.top:B.top+B.height/2,b.y))},ge=T===st.Right&&!M||T===st.Left&&!O,Ae=T===st.Down&&!L||T===st.Up&&!D;if(ge&&Y.x!==b.x){const Oe=A.scrollLeft+v.x,Ne=T===st.Right&&Oe<=P.x||T===st.Left&&Oe>=U.x;if(Ne&&!v.y){A.scrollTo({left:Oe,behavior:d});return}Ne?E.x=A.scrollLeft-Oe:E.x=T===st.Right?A.scrollLeft-P.x:A.scrollLeft-U.x,E.x&&A.scrollBy({left:-E.x,behavior:d});break}else if(Ae&&Y.y!==b.y){const Oe=A.scrollTop+v.y,Ne=T===st.Down&&Oe<=P.y||T===st.Up&&Oe>=U.y;if(Ne&&!v.x){A.scrollTo({top:Oe,behavior:d});return}Ne?E.y=A.scrollTop-Oe:E.y=T===st.Down?A.scrollTop-P.y:A.scrollTop-U.y,E.y&&A.scrollBy({top:-E.y,behavior:d});break}}this.handleMove(e,Qi(co(b,this.referenceCoordinates),E))}}}handleMove(e,a){const{onMove:r}=this.props;e.preventDefault(),r(a)}handleEnd(e){const{onEnd:a}=this.props;e.preventDefault(),this.detach(),a()}handleCancel(e){const{onCancel:a}=this.props;e.preventDefault(),this.detach(),a()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Od.activators=[{eventName:"onKeyDown",handler:(l,e,a)=>{let{keyboardCodes:r=em,onActivation:i}=e,{active:o}=a;const{code:u}=l.nativeEvent;if(r.start.includes(u)){const d=o.activatorNode.current;return d&&l.target!==d?!1:(l.preventDefault(),i?.({event:l.nativeEvent}),!0)}return!1}}];function tm(l){return!!(l&&"distance"in l)}function nm(l){return!!(l&&"delay"in l)}class Ld{constructor(e,a,r){var i;r===void 0&&(r=nC(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=a;const{event:o}=e,{target:u}=o;this.props=e,this.events=a,this.document=Xi(u),this.documentListeners=new fo(this.document),this.listeners=new fo(r),this.windowListeners=new fo(xn(u)),this.initialCoordinates=(i=xd(o))!=null?i:ya,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:a,bypassActivationConstraint:r}}}=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(Zn.Resize,this.handleCancel),this.windowListeners.add(Zn.DragStart,Zp),this.windowListeners.add(Zn.VisibilityChange,this.handleCancel),this.windowListeners.add(Zn.ContextMenu,Zp),this.documentListeners.add(Zn.Keydown,this.handleKeydown),a){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(nm(a)){this.timeoutId=setTimeout(this.handleStart,a.delay),this.handlePending(a);return}if(tm(a)){this.handlePending(a);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,a){const{active:r,onPending:i}=this.props;i(r,e,this.initialCoordinates,a)}handleStart(){const{initialCoordinates:e}=this,{onStart:a}=this.props;e&&(this.activated=!0,this.documentListeners.add(Zn.Click,aC,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Zn.SelectionChange,this.removeTextSelection),a(e))}handleMove(e){var a;const{activated:r,initialCoordinates:i,props:o}=this,{onMove:u,options:{activationConstraint:d}}=o;if(!i)return;const f=(a=xd(e))!=null?a:ya,g=co(i,f);if(!r&&d){if(tm(d)){if(d.tolerance!=null&&Dd(g,d.tolerance))return this.handleCancel();if(Dd(g,d.distance))return this.handleStart()}if(nm(d)&&Dd(g,d.tolerance))return this.handleCancel();this.handlePending(d,g);return}e.cancelable&&e.preventDefault(),u(f)}handleEnd(){const{onAbort:e,onEnd:a}=this.props;this.detach(),this.activated||e(this.props.active),a()}handleCancel(){const{onAbort:e,onCancel:a}=this.props;this.detach(),this.activated||e(this.props.active),a()}handleKeydown(e){e.code===st.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const iC={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Md extends Ld{constructor(e){const{event:a}=e,r=Xi(a.target);super(e,iC,r)}}Md.activators=[{eventName:"onPointerDown",handler:(l,e)=>{let{nativeEvent:a}=l,{onActivation:r}=e;return!a.isPrimary||a.button!==0?!1:(r?.({event:a}),!0)}}];const sC={move:{name:"mousemove"},end:{name:"mouseup"}};var $d;(function(l){l[l.RightClick=2]="RightClick"})($d||($d={}));class oC extends Ld{constructor(e){super(e,sC,Xi(e.event.target))}}oC.activators=[{eventName:"onMouseDown",handler:(l,e)=>{let{nativeEvent:a}=l,{onActivation:r}=e;return a.button===$d.RightClick?!1:(r?.({event:a}),!0)}}];const Nd={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class lC extends Ld{constructor(e){super(e,Nd)}static setup(){return window.addEventListener(Nd.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Nd.move.name,e)};function e(){}}}lC.activators=[{eventName:"onTouchStart",handler:(l,e)=>{let{nativeEvent:a}=l,{onActivation:r}=e;const{touches:i}=a;return i.length>1?!1:(r?.({event:a}),!0)}}];var ho;(function(l){l[l.Pointer=0]="Pointer",l[l.DraggableRect=1]="DraggableRect"})(ho||(ho={}));var nc;(function(l){l[l.TreeOrder=0]="TreeOrder",l[l.ReversedTreeOrder=1]="ReversedTreeOrder"})(nc||(nc={}));function cC(l){let{acceleration:e,activator:a=ho.Pointer,canScroll:r,draggingRect:i,enabled:o,interval:u=5,order:d=nc.TreeOrder,pointerCoordinates:f,scrollableAncestors:g,scrollableAncestorRects:m,delta:b,threshold:v}=l;const E=dC({delta:b,disabled:!o}),[S,A]=w0(),T=N.useRef({x:0,y:0}),D=N.useRef({x:0,y:0}),M=N.useMemo(()=>{switch(a){case ho.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case ho.DraggableRect:return i}},[a,i,f]),O=N.useRef(null),L=N.useCallback(()=>{const U=O.current;if(!U)return;const B=T.current.x*D.current.x,Y=T.current.y*D.current.y;U.scrollBy(B,Y)},[]),P=N.useMemo(()=>d===nc.TreeOrder?[...g].reverse():g,[d,g]);N.useEffect(()=>{if(!o||!g.length||!M){A();return}for(const U of P){if(r?.(U)===!1)continue;const B=g.indexOf(U),Y=m[B];if(!Y)continue;const{direction:ge,speed:Ae}=X0(U,Y,M,e,v);for(const Oe of["x","y"])E[Oe][ge[Oe]]||(Ae[Oe]=0,ge[Oe]=0);if(Ae.x>0||Ae.y>0){A(),O.current=U,S(L,u),T.current=Ae,D.current=ge;return}}T.current={x:0,y:0},D.current={x:0,y:0},A()},[e,L,r,A,o,u,JSON.stringify(M),JSON.stringify(E),S,g,P,m,JSON.stringify(v)])}const uC={x:{[sn.Backward]:!1,[sn.Forward]:!1},y:{[sn.Backward]:!1,[sn.Forward]:!1}};function dC(l){let{delta:e,disabled:a}=l;const r=Ed(e);return oo(i=>{if(a||!r||!i)return uC;const o={x:Math.sign(e.x-r.x),y:Math.sign(e.y-r.y)};return{x:{[sn.Backward]:i.x[sn.Backward]||o.x===-1,[sn.Forward]:i.x[sn.Forward]||o.x===1},y:{[sn.Backward]:i.y[sn.Backward]||o.y===-1,[sn.Forward]:i.y[sn.Forward]||o.y===1}}},[a,e,r])}function fC(l,e){const a=e!=null?l.get(e):void 0,r=a?a.node.current:null;return oo(i=>{var o;return e==null?null:(o=r??i)!=null?o:null},[r,e])}function hC(l,e){return N.useMemo(()=>l.reduce((a,r)=>{const{sensor:i}=r,o=i.activators.map(u=>({eventName:u.eventName,handler:e(u.handler,r)}));return[...a,...o]},[]),[l,e])}var go;(function(l){l[l.Always=0]="Always",l[l.BeforeDragging=1]="BeforeDragging",l[l.WhileDragging=2]="WhileDragging"})(go||(go={}));var Hd;(function(l){l.Optimized="optimized"})(Hd||(Hd={}));const am=new Map;function gC(l,e){let{dragging:a,dependencies:r,config:i}=e;const[o,u]=N.useState(null),{frequency:d,measure:f,strategy:g}=i,m=N.useRef(l),b=T(),v=so(b),E=N.useCallback(function(D){D===void 0&&(D=[]),!v.current&&u(M=>M===null?D:M.concat(D.filter(O=>!M.includes(O))))},[v]),S=N.useRef(null),A=oo(D=>{if(b&&!a)return am;if(!D||D===am||m.current!==l||o!=null){const M=new Map;for(let O of l){if(!O)continue;if(o&&o.length>0&&!o.includes(O.id)&&O.rect.current){M.set(O.id,O.rect.current);continue}const L=O.node.current,P=L?new Rd(f(L),L):null;O.rect.current=P,P&&M.set(O.id,P)}return M}return D},[l,o,a,b,f]);return N.useEffect(()=>{m.current=l},[l]),N.useEffect(()=>{b||E()},[a,b]),N.useEffect(()=>{o&&o.length>0&&u(null)},[JSON.stringify(o)]),N.useEffect(()=>{b||typeof d!="number"||S.current!==null||(S.current=setTimeout(()=>{E(),S.current=null},d))},[d,b,E,...r]),{droppableRects:A,measureDroppableContainers:E,measuringScheduled:o!=null};function T(){switch(g){case go.Always:return!1;case go.BeforeDragging:return a;default:return!a}}}function rm(l,e){return oo(a=>l?a||(typeof e=="function"?e(l):l):null,[e,l])}function pC(l,e){return rm(l,e)}function mC(l){let{callback:e,disabled:a}=l;const r=Cd(e),i=N.useMemo(()=>{if(a||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(r)},[r,a]);return N.useEffect(()=>()=>i?.disconnect(),[i]),i}function ac(l){let{callback:e,disabled:a}=l;const r=Cd(e),i=N.useMemo(()=>{if(a||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(r)},[a]);return N.useEffect(()=>()=>i?.disconnect(),[i]),i}function yC(l){return new Rd(Ji(l),l)}function im(l,e,a){e===void 0&&(e=yC);const[r,i]=N.useState(null);function o(){i(f=>{if(!l)return null;if(l.isConnected===!1){var g;return(g=f??a)!=null?g:null}const m=e(l);return JSON.stringify(f)===JSON.stringify(m)?f:m})}const u=mC({callback(f){if(l)for(const g of f){const{type:m,target:b}=g;if(m==="childList"&&b instanceof HTMLElement&&b.contains(l)){o();break}}}}),d=ac({callback:o});return Ha(()=>{o(),l?(d?.observe(l),u?.observe(document.body,{childList:!0,subtree:!0})):(d?.disconnect(),u?.disconnect())},[l]),r}function bC(l){const e=rm(l);return Vp(l,e)}const sm=[];function vC(l){const e=N.useRef(l),a=oo(r=>l?r&&r!==sm&&l&&e.current&&l.parentNode===e.current.parentNode?r:tc(l):sm,[l]);return N.useEffect(()=>{e.current=l},[l]),a}function SC(l){const[e,a]=N.useState(null),r=N.useRef(l),i=N.useCallback(o=>{const u=Td(o.target);u&&a(d=>d?(d.set(u,kd(u)),new Map(d)):null)},[]);return N.useEffect(()=>{const o=r.current;if(l!==o){u(o);const d=l.map(f=>{const g=Td(f);return g?(g.addEventListener("scroll",i,{passive:!0}),[g,kd(g)]):null}).filter(f=>f!=null);a(d.length?new Map(d):null),r.current=l}return()=>{u(l),u(o)};function u(d){d.forEach(f=>{const g=Td(f);g?.removeEventListener("scroll",i)})}},[i,l]),N.useMemo(()=>l.length?e?Array.from(e.values()).reduce((o,u)=>Qi(o,u),ya):Jp(l):ya,[l,e])}function om(l,e){e===void 0&&(e=[]);const a=N.useRef(null);return N.useEffect(()=>{a.current=null},e),N.useEffect(()=>{const r=l!==ya;r&&!a.current&&(a.current=l),!r&&a.current&&(a.current=null)},[l]),a.current?co(l,a.current):ya}function wC(l){N.useEffect(()=>{if(!Jl)return;const e=l.map(a=>{let{sensor:r}=a;return r.setup==null?void 0:r.setup()});return()=>{for(const a of e)a?.()}},l.map(e=>{let{sensor:a}=e;return a}))}function CC(l,e){return N.useMemo(()=>l.reduce((a,r)=>{let{eventName:i,handler:o}=r;return a[i]=u=>{o(u,e)},a},{}),[l,e])}function lm(l){return N.useMemo(()=>l?F0(l):null,[l])}const cm=[];function EC(l,e){e===void 0&&(e=Ji);const[a]=l,r=lm(a?xn(a):null),[i,o]=N.useState(cm);function u(){o(()=>l.length?l.map(f=>Xp(f)?r:new Rd(e(f),f)):cm)}const d=ac({callback:u});return Ha(()=>{d?.disconnect(),u(),l.forEach(f=>d?.observe(f))},[l]),i}function _C(l){if(!l)return null;if(l.children.length>1)return l;const e=l.children[0];return io(e)?e:l}function AC(l){let{measure:e}=l;const[a,r]=N.useState(null),i=N.useCallback(g=>{for(const{target:m}of g)if(io(m)){r(b=>{const v=e(m);return b?{...b,width:v.width,height:v.height}:v});break}},[e]),o=ac({callback:i}),u=N.useCallback(g=>{const m=_C(g);o?.disconnect(),m&&o?.observe(m),r(m?e(m):null)},[e,o]),[d,f]=Zl(u);return N.useMemo(()=>({nodeRef:d,rect:a,setRef:f}),[a,d,f])}const xC=[{sensor:Md,options:{}},{sensor:Od,options:{}}],TC={current:{}},rc={draggable:{measure:Fp},droppable:{measure:Fp,strategy:go.WhileDragging,frequency:Hd.Optimized},dragOverlay:{measure:Ji}};class po extends Map{get(e){var a;return e!=null&&(a=super.get(e))!=null?a:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:a}=e;return!a})}getNodeFor(e){var a,r;return(a=(r=this.get(e))==null?void 0:r.node.current)!=null?a:void 0}}const kC={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new po,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:ec},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:rc,measureDroppableContainers:ec,windowRect:null,measuringScheduled:!1},RC={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:ec,draggableNodes:new Map,over:null,measureDroppableContainers:ec},ic=N.createContext(RC),um=N.createContext(kC);function DC(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new po}}}function OC(l,e){switch(e.type){case Jt.DragStart:return{...l,draggable:{...l.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case Jt.DragMove:return l.draggable.active==null?l:{...l,draggable:{...l.draggable,translate:{x:e.coordinates.x-l.draggable.initialCoordinates.x,y:e.coordinates.y-l.draggable.initialCoordinates.y}}};case Jt.DragEnd:case Jt.DragCancel:return{...l,draggable:{...l.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Jt.RegisterDroppable:{const{element:a}=e,{id:r}=a,i=new po(l.droppable.containers);return i.set(r,a),{...l,droppable:{...l.droppable,containers:i}}}case Jt.SetDroppableDisabled:{const{id:a,key:r,disabled:i}=e,o=l.droppable.containers.get(a);if(!o||r!==o.key)return l;const u=new po(l.droppable.containers);return u.set(a,{...o,disabled:i}),{...l,droppable:{...l.droppable,containers:u}}}case Jt.UnregisterDroppable:{const{id:a,key:r}=e,i=l.droppable.containers.get(a);if(!i||r!==i.key)return l;const o=new po(l.droppable.containers);return o.delete(a),{...l,droppable:{...l.droppable,containers:o}}}default:return l}}function LC(l){let{disabled:e}=l;const{active:a,activatorEvent:r,draggableNodes:i}=N.useContext(ic),o=Ed(r),u=Ed(a?.id);return N.useEffect(()=>{if(!e&&!r&&o&&u!=null){if(!Ad(o)||document.activeElement===o.target)return;const d=i.get(u);if(!d)return;const{activatorNode:f,node:g}=d;if(!f.current&&!g.current)return;requestAnimationFrame(()=>{for(const m of[f.current,g.current]){if(!m)continue;const b=_0(m);if(b){b.focus();break}}})}},[r,e,i,u,o]),null}function MC(l,e){let{transform:a,...r}=e;return l!=null&&l.length?l.reduce((i,o)=>o({transform:i,...r}),a):a}function $C(l){return N.useMemo(()=>({draggable:{...rc.draggable,...l?.draggable},droppable:{...rc.droppable,...l?.droppable},dragOverlay:{...rc.dragOverlay,...l?.dragOverlay}}),[l?.draggable,l?.droppable,l?.dragOverlay])}function NC(l){let{activeNode:e,measure:a,initialRect:r,config:i=!0}=l;const o=N.useRef(!1),{x:u,y:d}=typeof i=="boolean"?{x:i,y:i}:i;Ha(()=>{if(!u&&!d||!e){o.current=!1;return}if(o.current||!r)return;const g=e?.node.current;if(!g||g.isConnected===!1)return;const m=a(g),b=Vp(m,r);if(u||(b.x=0),d||(b.y=0),o.current=!0,Math.abs(b.x)>0||Math.abs(b.y)>0){const v=Kp(g);v&&v.scrollBy({top:b.y,left:b.x})}},[e,u,d,r,a])}const dm=N.createContext({...ya,scaleX:1,scaleY:1});var xr;(function(l){l[l.Uninitialized=0]="Uninitialized",l[l.Initializing=1]="Initializing",l[l.Initialized=2]="Initialized"})(xr||(xr={}));const HC=N.memo(function(e){var a,r,i,o;let{id:u,accessibility:d,autoScroll:f=!0,children:g,sensors:m=xC,collisionDetection:b=j0,measuring:v,modifiers:E,...S}=e;const A=N.useReducer(OC,void 0,DC),[T,D]=A,[M,O]=D0(),[L,P]=N.useState(xr.Uninitialized),U=L===xr.Initialized,{draggable:{active:B,nodes:Y,translate:ge},droppable:{containers:Ae}}=T,Oe=B!=null?Y.get(B):null,Ne=N.useRef({initial:null,translated:null}),He=N.useMemo(()=>{var we;return B!=null?{id:B,data:(we=Oe?.data)!=null?we:TC,rect:Ne}:null},[B,Oe]),Ze=N.useRef(null),[pt,J]=N.useState(null),[de,me]=N.useState(null),ne=so(S,Object.values(S)),pe=lo("DndDescribedBy",u),x=N.useMemo(()=>Ae.getEnabled(),[Ae]),F=$C(v),{droppableRects:ue,measureDroppableContainers:fe,measuringScheduled:te}=gC(x,{dragging:U,dependencies:[ge.x,ge.y],config:F.droppable}),ye=fC(Y,B),je=N.useMemo(()=>de?xd(de):null,[de]),Me=ve(),Pe=pC(ye,F.draggable.measure);NC({activeNode:B!=null?Y.get(B):null,config:Me.layoutShiftCompensation,initialRect:Pe,measure:F.draggable.measure});const Ie=im(ye,F.draggable.measure,Pe),Lt=im(ye?ye.parentElement:null),At=N.useRef({activatorEvent:null,active:null,activeNode:ye,collisionRect:null,collisions:null,droppableRects:ue,draggableNodes:Y,draggingNode:null,draggingNodeRect:null,droppableContainers:Ae,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Zt=Ae.getNodeFor((a=At.current.over)==null?void 0:a.id),Tt=AC({measure:F.dragOverlay.measure}),on=(r=Tt.nodeRef.current)!=null?r:ye,vt=U?(i=Tt.rect)!=null?i:Ie:null,Za=!!(Tt.nodeRef.current&&Tt.rect),Sn=bC(Za?null:Ie),qn=lm(on?xn(on):null),Ut=vC(U?Zt??ye:null),Rn=EC(Ut),_a=MC(E,{transform:{x:ge.x-Sn.x,y:ge.y-Sn.y,scaleX:1,scaleY:1},activatorEvent:de,active:He,activeNodeRect:Ie,containerNodeRect:Lt,draggingNodeRect:vt,over:At.current.over,overlayNodeRect:Tt.rect,scrollableAncestors:Ut,scrollableAncestorRects:Rn,windowRect:qn}),Pn=je?Qi(je,ge):null,Vt=SC(Ut),yt=om(Vt),er=om(Vt,[Ie]),Gn=Qi(_a,yt),en=vt?q0(vt,_a):null,mn=He&&en?b({active:He,collisionRect:en,droppableRects:ue,droppableContainers:x,pointerCoordinates:Pn}):null,ta=Pp(mn,"id"),[wn,tr]=N.useState(null),Vn=Za?_a:Qi(_a,er),Bt=U0(Vn,(o=wn?.rect)!=null?o:null,Ie),Cn=N.useRef(null),q=N.useCallback((we,_e)=>{let{sensor:Be,options:$e}=_e;if(Ze.current==null)return;const Re=Y.get(Ze.current);if(!Re)return;const xe=we.nativeEvent,Ke=new Be({active:Ze.current,activeNode:Re,event:xe,options:$e,context:At,onAbort(Ce){if(!Y.get(Ce))return;const{onDragAbort:Le}=ne.current,nt={id:Ce};Le?.(nt),M({type:"onDragAbort",event:nt})},onPending(Ce,Ee,Le,nt){if(!Y.get(Ce))return;const{onDragPending:yn}=ne.current,Ft={id:Ce,constraint:Ee,initialCoordinates:Le,offset:nt};yn?.(Ft),M({type:"onDragPending",event:Ft})},onStart(Ce){const Ee=Ze.current;if(Ee==null)return;const Le=Y.get(Ee);if(!Le)return;const{onDragStart:nt}=ne.current,kt={activatorEvent:xe,active:{id:Ee,data:Le.data,rect:Ne}};Ar.unstable_batchedUpdates(()=>{nt?.(kt),P(xr.Initializing),D({type:Jt.DragStart,initialCoordinates:Ce,active:Ee}),M({type:"onDragStart",event:kt}),J(Cn.current),me(xe)})},onMove(Ce){D({type:Jt.DragMove,coordinates:Ce})},onEnd:qe(Jt.DragEnd),onCancel:qe(Jt.DragCancel)});Cn.current=Ke;function qe(Ce){return async function(){const{active:Le,collisions:nt,over:kt,scrollAdjustedTranslate:yn}=At.current;let Ft=null;if(Le&&yn){const{cancelDrop:na}=ne.current;Ft={activatorEvent:xe,active:Le,collisions:nt,delta:yn,over:kt},Ce===Jt.DragEnd&&typeof na=="function"&&await Promise.resolve(na(Ft))&&(Ce=Jt.DragCancel)}Ze.current=null,Ar.unstable_batchedUpdates(()=>{D({type:Ce}),P(xr.Uninitialized),tr(null),J(null),me(null),Cn.current=null;const na=Ce===Jt.DragEnd?"onDragEnd":"onDragCancel";if(Ft){const Dn=ne.current[na];Dn?.(Ft),M({type:na,event:Ft})}})}}},[Y]),le=N.useCallback((we,_e)=>(Be,$e)=>{const Re=Be.nativeEvent,xe=Y.get($e);if(Ze.current!==null||!xe||Re.dndKit||Re.defaultPrevented)return;const Ke={active:xe};we(Be,_e.options,Ke)===!0&&(Re.dndKit={capturedBy:_e.sensor},Ze.current=$e,q(Be,_e))},[Y,q]),oe=hC(m,le);wC(m),Ha(()=>{Ie&&L===xr.Initializing&&P(xr.Initialized)},[Ie,L]),N.useEffect(()=>{const{onDragMove:we}=ne.current,{active:_e,activatorEvent:Be,collisions:$e,over:Re}=At.current;if(!_e||!Be)return;const xe={active:_e,activatorEvent:Be,collisions:$e,delta:{x:Gn.x,y:Gn.y},over:Re};Ar.unstable_batchedUpdates(()=>{we?.(xe),M({type:"onDragMove",event:xe})})},[Gn.x,Gn.y]),N.useEffect(()=>{const{active:we,activatorEvent:_e,collisions:Be,droppableContainers:$e,scrollAdjustedTranslate:Re}=At.current;if(!we||Ze.current==null||!_e||!Re)return;const{onDragOver:xe}=ne.current,Ke=$e.get(ta),qe=Ke&&Ke.rect.current?{id:Ke.id,rect:Ke.rect.current,data:Ke.data,disabled:Ke.disabled}:null,Ce={active:we,activatorEvent:_e,collisions:Be,delta:{x:Re.x,y:Re.y},over:qe};Ar.unstable_batchedUpdates(()=>{tr(qe),xe?.(Ce),M({type:"onDragOver",event:Ce})})},[ta]),Ha(()=>{At.current={activatorEvent:de,active:He,activeNode:ye,collisionRect:en,collisions:mn,droppableRects:ue,draggableNodes:Y,draggingNode:on,draggingNodeRect:vt,droppableContainers:Ae,over:wn,scrollableAncestors:Ut,scrollAdjustedTranslate:Gn},Ne.current={initial:vt,translated:en}},[He,ye,mn,en,Y,on,vt,ue,Ae,wn,Ut,Gn]),cC({...Me,delta:ge,draggingRect:en,pointerCoordinates:Pn,scrollableAncestors:Ut,scrollableAncestorRects:Rn});const Q=N.useMemo(()=>({active:He,activeNode:ye,activeNodeRect:Ie,activatorEvent:de,collisions:mn,containerNodeRect:Lt,dragOverlay:Tt,draggableNodes:Y,droppableContainers:Ae,droppableRects:ue,over:wn,measureDroppableContainers:fe,scrollableAncestors:Ut,scrollableAncestorRects:Rn,measuringConfiguration:F,measuringScheduled:te,windowRect:qn}),[He,ye,Ie,de,mn,Lt,Tt,Y,Ae,ue,wn,fe,Ut,Rn,F,te,qn]),he=N.useMemo(()=>({activatorEvent:de,activators:oe,active:He,activeNodeRect:Ie,ariaDescribedById:{draggable:pe},dispatch:D,draggableNodes:Y,over:wn,measureDroppableContainers:fe}),[de,oe,He,Ie,D,pe,Y,wn,fe]);return We.createElement(Ip.Provider,{value:O},We.createElement(ic.Provider,{value:he},We.createElement(um.Provider,{value:Q},We.createElement(dm.Provider,{value:Bt},g)),We.createElement(LC,{disabled:d?.restoreFocus===!1})),We.createElement(M0,{...d,hiddenTextDescribedById:pe}));function ve(){const we=pt?.autoScrollEnabled===!1,_e=typeof f=="object"?f.enabled===!1:f===!1,Be=U&&!we&&!_e;return typeof f=="object"?{...f,enabled:Be}:{enabled:Be}}}),zC=N.createContext(null),fm="button",IC="Draggable";function jC(l){let{id:e,data:a,disabled:r=!1,attributes:i}=l;const o=lo(IC),{activators:u,activatorEvent:d,active:f,activeNodeRect:g,ariaDescribedById:m,draggableNodes:b,over:v}=N.useContext(ic),{role:E=fm,roleDescription:S="draggable",tabIndex:A=0}=i??{},T=f?.id===e,D=N.useContext(T?dm:zC),[M,O]=Zl(),[L,P]=Zl(),U=CC(u,e),B=so(a);Ha(()=>(b.set(e,{id:e,key:o,node:M,activatorNode:L,data:B}),()=>{const ge=b.get(e);ge&&ge.key===o&&b.delete(e)}),[b,e]);const Y=N.useMemo(()=>({role:E,tabIndex:A,"aria-disabled":r,"aria-pressed":T&&E===fm?!0:void 0,"aria-roledescription":S,"aria-describedby":m.draggable}),[r,E,A,T,S,m.draggable]);return{active:f,activatorEvent:d,activeNodeRect:g,attributes:Y,isDragging:T,listeners:r?void 0:U,node:M,over:v,setNodeRef:O,setActivatorNodeRef:P,transform:D}}function UC(){return N.useContext(um)}const BC="Droppable",qC={timeout:25};function PC(l){let{data:e,disabled:a=!1,id:r,resizeObserverConfig:i}=l;const o=lo(BC),{active:u,dispatch:d,over:f,measureDroppableContainers:g}=N.useContext(ic),m=N.useRef({disabled:a}),b=N.useRef(!1),v=N.useRef(null),E=N.useRef(null),{disabled:S,updateMeasurementsFor:A,timeout:T}={...qC,...i},D=so(A??r),M=N.useCallback(()=>{if(!b.current){b.current=!0;return}E.current!=null&&clearTimeout(E.current),E.current=setTimeout(()=>{g(Array.isArray(D.current)?D.current:[D.current]),E.current=null},T)},[T]),O=ac({callback:M,disabled:S||!u}),L=N.useCallback((Y,ge)=>{O&&(ge&&(O.unobserve(ge),b.current=!1),Y&&O.observe(Y))},[O]),[P,U]=Zl(L),B=so(e);return N.useEffect(()=>{!O||!P.current||(O.disconnect(),b.current=!1,O.observe(P.current))},[P,O]),N.useEffect(()=>(d({type:Jt.RegisterDroppable,element:{id:r,key:o,disabled:a,node:P,rect:v,data:B}}),()=>d({type:Jt.UnregisterDroppable,key:o,id:r})),[r]),N.useEffect(()=>{a!==m.current.disabled&&(d({type:Jt.SetDroppableDisabled,id:r,key:o,disabled:a}),m.current.disabled=a)},[r,o,a,d]),{active:u,rect:v,isOver:f?.id===r,node:P,over:f,setNodeRef:U}}function zd(l,e,a){const r=l.slice();return r.splice(a<0?r.length+a:a,0,r.splice(e,1)[0]),r}function GC(l,e){return l.reduce((a,r,i)=>{const o=e.get(r);return o&&(a[i]=o),a},Array(l.length))}function sc(l){return l!==null&&l>=0}function VC(l,e){if(l===e)return!0;if(l.length!==e.length)return!1;for(let a=0;a<l.length;a++)if(l[a]!==e[a])return!1;return!0}function FC(l){return typeof l=="boolean"?{draggable:l,droppable:l}:l}const oc={scaleX:1,scaleY:1},KC=l=>{var e;let{rects:a,activeNodeRect:r,activeIndex:i,overIndex:o,index:u}=l;const d=(e=a[i])!=null?e:r;if(!d)return null;const f=WC(a,u,i);if(u===i){const g=a[o];return g?{x:i<o?g.left+g.width-(d.left+d.width):g.left-d.left,y:0,...oc}:null}return u>i&&u<=o?{x:-d.width-f,y:0,...oc}:u<i&&u>=o?{x:d.width+f,y:0,...oc}:{x:0,y:0,...oc}};function WC(l,e,a){const r=l[e],i=l[e-1],o=l[e+1];return!r||!i&&!o?0:a<e?i?r.left-(i.left+i.width):o.left-(r.left+r.width):o?o.left-(r.left+r.width):r.left-(i.left+i.width)}const Id=l=>{let{rects:e,activeIndex:a,overIndex:r,index:i}=l;const o=zd(e,r,a),u=e[i],d=o[i];return!d||!u?null:{x:d.left-u.left,y:d.top-u.top,scaleX:d.width/u.width,scaleY:d.height/u.height}},lc={scaleX:1,scaleY:1},YC=l=>{var e;let{activeIndex:a,activeNodeRect:r,index:i,rects:o,overIndex:u}=l;const d=(e=o[a])!=null?e:r;if(!d)return null;if(i===a){const g=o[u];return g?{x:0,y:a<u?g.top+g.height-(d.top+d.height):g.top-d.top,...lc}:null}const f=XC(o,i,a);return i>a&&i<=u?{x:0,y:-d.height-f,...lc}:i<a&&i>=u?{x:0,y:d.height+f,...lc}:{x:0,y:0,...lc}};function XC(l,e,a){const r=l[e],i=l[e-1],o=l[e+1];return r?a<e?i?r.top-(i.top+i.height):o?o.top-(r.top+r.height):0:o?o.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}const hm="Sortable",gm=We.createContext({activeIndex:-1,containerId:hm,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Id,disabled:{draggable:!1,droppable:!1}});function QC(l){let{children:e,id:a,items:r,strategy:i=Id,disabled:o=!1}=l;const{active:u,dragOverlay:d,droppableRects:f,over:g,measureDroppableContainers:m}=UC(),b=lo(hm,a),v=d.rect!==null,E=N.useMemo(()=>r.map(U=>typeof U=="object"&&"id"in U?U.id:U),[r]),S=u!=null,A=u?E.indexOf(u.id):-1,T=g?E.indexOf(g.id):-1,D=N.useRef(E),M=!VC(E,D.current),O=T!==-1&&A===-1||M,L=FC(o);Ha(()=>{M&&S&&m(E)},[M,E,S,m]),N.useEffect(()=>{D.current=E},[E]);const P=N.useMemo(()=>({activeIndex:A,containerId:b,disabled:L,disableTransforms:O,items:E,overIndex:T,useDragOverlay:v,sortedRects:GC(E,f),strategy:i}),[A,b,L.draggable,L.droppable,O,E,T,f,v,i]);return We.createElement(gm.Provider,{value:P},e)}const JC=l=>{let{id:e,items:a,activeIndex:r,overIndex:i}=l;return zd(a,r,i).indexOf(e)},ZC=l=>{let{containerId:e,isSorting:a,wasDragging:r,index:i,items:o,newIndex:u,previousItems:d,previousContainerId:f,transition:g}=l;return!g||!r||d!==o&&i===u?!1:a?!0:u!==i&&e===f},eE={duration:200,easing:"ease"},pm="transform",tE=uo.Transition.toString({property:pm,duration:0,easing:"linear"}),nE={roleDescription:"sortable"};function aE(l){let{disabled:e,index:a,node:r,rect:i}=l;const[o,u]=N.useState(null),d=N.useRef(a);return Ha(()=>{if(!e&&a!==d.current&&r.current){const f=i.current;if(f){const g=Ji(r.current,{ignoreTransform:!0}),m={x:f.left-g.left,y:f.top-g.top,scaleX:f.width/g.width,scaleY:f.height/g.height};(m.x||m.y)&&u(m)}}a!==d.current&&(d.current=a)},[e,a,r,i]),N.useEffect(()=>{o&&u(null)},[o]),o}function rE(l){let{animateLayoutChanges:e=ZC,attributes:a,disabled:r,data:i,getNewIndex:o=JC,id:u,strategy:d,resizeObserverConfig:f,transition:g=eE}=l;const{items:m,containerId:b,activeIndex:v,disabled:E,disableTransforms:S,sortedRects:A,overIndex:T,useDragOverlay:D,strategy:M}=N.useContext(gm),O=iE(r,E),L=m.indexOf(u),P=N.useMemo(()=>({sortable:{containerId:b,index:L,items:m},...i}),[b,i,L,m]),U=N.useMemo(()=>m.slice(m.indexOf(u)),[m,u]),{rect:B,node:Y,isOver:ge,setNodeRef:Ae}=PC({id:u,data:P,disabled:O.droppable,resizeObserverConfig:{updateMeasurementsFor:U,...f}}),{active:Oe,activatorEvent:Ne,activeNodeRect:He,attributes:Ze,setNodeRef:pt,listeners:J,isDragging:de,over:me,setActivatorNodeRef:ne,transform:pe}=jC({id:u,data:P,attributes:{...nE,...a},disabled:O.draggable}),x=S0(Ae,pt),F=!!Oe,ue=F&&!S&&sc(v)&&sc(T),fe=!D&&de,te=fe&&ue?pe:null,je=ue?te??(d??M)({rects:A,activeNodeRect:He,activeIndex:v,overIndex:T,index:L}):null,Me=sc(v)&&sc(T)?o({id:u,items:m,activeIndex:v,overIndex:T}):L,Pe=Oe?.id,Ie=N.useRef({activeId:Pe,items:m,newIndex:Me,containerId:b}),Lt=m!==Ie.current.items,At=e({active:Oe,containerId:b,isDragging:de,isSorting:F,id:u,index:L,items:m,newIndex:Ie.current.newIndex,previousItems:Ie.current.items,previousContainerId:Ie.current.containerId,transition:g,wasDragging:Ie.current.activeId!=null}),Zt=aE({disabled:!At,index:L,node:Y,rect:B});return N.useEffect(()=>{F&&Ie.current.newIndex!==Me&&(Ie.current.newIndex=Me),b!==Ie.current.containerId&&(Ie.current.containerId=b),m!==Ie.current.items&&(Ie.current.items=m)},[F,Me,b,m]),N.useEffect(()=>{if(Pe===Ie.current.activeId)return;if(Pe!=null&&Ie.current.activeId==null){Ie.current.activeId=Pe;return}const on=setTimeout(()=>{Ie.current.activeId=Pe},50);return()=>clearTimeout(on)},[Pe]),{active:Oe,activeIndex:v,attributes:Ze,data:P,rect:B,index:L,newIndex:Me,items:m,isOver:ge,isSorting:F,isDragging:de,listeners:J,node:Y,overIndex:T,over:me,setNodeRef:x,setActivatorNodeRef:ne,setDroppableNodeRef:Ae,setDraggableNodeRef:pt,transform:Zt??je,transition:Tt()};function Tt(){if(Zt||Lt&&Ie.current.newIndex===L)return tE;if(!(fe&&!Ad(Ne)||!g)&&(F||At))return uo.Transition.toString({...g,property:pm})}}function iE(l,e){var a,r;return typeof l=="boolean"?{draggable:l,droppable:!1}:{draggable:(a=l?.draggable)!=null?a:e.draggable,droppable:(r=l?.droppable)!=null?r:e.droppable}}function cc(l){if(!l)return!1;const e=l.data.current;return!!(e&&"sortable"in e&&typeof e.sortable=="object"&&"containerId"in e.sortable&&"items"in e.sortable&&"index"in e.sortable)}const sE=[st.Down,st.Right,st.Up,st.Left],oE=(l,e)=>{let{context:{active:a,collisionRect:r,droppableRects:i,droppableContainers:o,over:u,scrollableAncestors:d}}=e;if(sE.includes(l.code)){if(l.preventDefault(),!a||!r)return;const f=[];o.getEnabled().forEach(b=>{if(!b||b!=null&&b.disabled)return;const v=i.get(b.id);if(v)switch(l.code){case st.Down:r.top<v.top&&f.push(b);break;case st.Up:r.top>v.top&&f.push(b);break;case st.Left:r.left>v.left&&f.push(b);break;case st.Right:r.left<v.left&&f.push(b);break}});const g=z0({collisionRect:r,droppableRects:i,droppableContainers:f});let m=Pp(g,"id");if(m===u?.id&&g.length>1&&(m=g[1].id),m!=null){const b=o.get(a.id),v=o.get(m),E=v?i.get(v.id):null,S=v?.node.current;if(S&&E&&b&&v){const T=tc(S).some((U,B)=>d[B]!==U),D=mm(b,v),M=lE(b,v),O=T||!D?{x:0,y:0}:{x:M?r.width-E.width:0,y:M?r.height-E.height:0},L={x:E.left,y:E.top};return O.x&&O.y?L:co(L,O)}}}};function mm(l,e){return!cc(l)||!cc(e)?!1:l.data.current.sortable.containerId===e.data.current.sortable.containerId}function lE(l,e){return!cc(l)||!cc(e)||!mm(l,e)?!1:l.data.current.sortable.index<e.data.current.sortable.index}const cE={verticalList:YC,horizontalList:KC,rectSorting:Id},uE=({items:l,itemKey:e,strategy:a,children:r,onSortEnd:i,onSortStart:o,sortVersion:u})=>{const d=N.useId(),f=N.useRef({inProgress:!1,lastSortTime:0,lastActiveId:null}),g=$0(jp(Md,{activationConstraint:{distance:5}}),jp(Od,{coordinateGetter:oE})),m=N.useCallback(E=>{f.current={inProgress:!0,lastSortTime:Date.now(),lastActiveId:E.active.id},o?.({activeId:E.active.id})},[o]),b=N.useCallback(E=>{const{active:S,over:A}=E,T=Date.now();if(!A||S.id===A.id){f.current.inProgress=!1;return}const{lastSortTime:D,lastActiveId:M,inProgress:O}=f.current;if(M===S.id&&T-D<500&&!O)return;f.current={inProgress:!1,lastSortTime:T,lastActiveId:S.id};const L=l.findIndex(U=>String(U[e])===String(S.id)),P=l.findIndex(U=>String(U[e])===String(A.id));if(L!==-1&&P!==-1&&L!==P){const U=zd(l,L,P);i?.(U,{oldIndex:L,newIndex:P})}},[l,e,i]),v=l.map(E=>String(E[e]));return ct.jsx(HC,{id:d,sensors:g,collisionDetection:H0,onDragStart:m,onDragEnd:b,children:ct.jsx(QC,{items:v,strategy:cE[a],children:r})},u!==void 0?`${d}-v${u}`:d)},ym=N.createContext(null),dE=({value:l,children:e})=>ct.jsx(ym.Provider,{value:l,children:e}),fE=()=>N.useContext(ym),hE=({id:l,handle:e,as:a="div",children:r})=>{const{attributes:i,listeners:o,setNodeRef:u,transform:d,transition:f,isDragging:g}=rE({id:l}),m={transform:uo.Transform.toString(d),transition:f,opacity:g?.5:1,position:"relative"};return ct.jsx(a,{ref:u,style:m,...i,...e?{}:o,"data-sortable-item":!0,"data-sortable-id":String(l),"data-dragging":g,children:ct.jsx(dE,{value:{listeners:o,handle:e,isDragging:g},children:r})})},ut=dt("DynamicRenderer");function Qa(){try{return window.G7Core?.devTools}catch{return}}function jd(l,e,a,r){if(typeof l=="string"){if(/\$t:[a-zA-Z_][a-zA-Z0-9_.\-]*/.test(l))try{return e.resolveTranslations(l,a,r)}catch{return l}return l}if(Array.isArray(l))return l.map(i=>jd(i,e,a,r));if(l&&typeof l=="object"){const i={};for(const[o,u]of Object.entries(l))i[o]=jd(u,e,a,r);return i}return l}function gE(l){const e=Object.keys(l);return e.length>0&&e.every(a=>/^\d+$/.test(a))}const ba=(l,e)=>{const a=["errors"],r={...l};for(const i of Object.keys(e)){const o=e[i],u=l[i];if(o===null){r[i]=null;continue}if(a.includes(i)){r[i]=o;continue}if(Array.isArray(o)){r[i]=o;continue}if(Array.isArray(u)&&o!==null&&typeof o=="object"&&!Array.isArray(o)&&gE(o)){const d=Object.keys(o).map(g=>parseInt(g,10));if((d.length>0?Math.max(...d):0)>=u.length+d.length+10)r[i]={...o};else{const g=[...u];for(const[m,b]of Object.entries(o)){const v=parseInt(m,10);v>=0&&v<g.length?b!==null&&typeof b=="object"&&!Array.isArray(b)&&g[v]!==null&&typeof g[v]=="object"?g[v]=ba(g[v],b):g[v]=b:v>=g.length&&(g[v]=b)}r[i]=g}}else o!==null&&typeof o=="object"&&u!==null&&typeof u=="object"&&!Array.isArray(u)?r[i]=ba(u,o):r[i]=o}return r},bm=(l,e)=>{const a={...l};for(const r of Object.keys(e)){if(!(r in a))continue;const i=e[r],o=a[r];if(i!==null&&typeof i=="object"&&!Array.isArray(i)&&o!==null&&typeof o=="object"&&!Array.isArray(o)){const u=bm(o,i);Object.keys(u).length===0?delete a[r]:a[r]=u}else delete a[r]}return a},pE=l=>{const e={},a=l.split(";").filter(r=>r.trim());for(const r of a){const i=r.indexOf(":");if(i===-1)continue;const o=r.substring(0,i).trim(),u=r.substring(i+1).trim();if(o&&u){const d=o.replace(/-([a-z])/g,(f,g)=>g.toUpperCase());e[d]=u}}return e};class mE extends N.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,a){ut.error(`컴포넌트 렌더링 에러 (ID: ${this.props.componentId}, Name: ${this.props.componentName}):`,e,a)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:ct.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:[ct.jsx("div",{className:"font-semibold mb-1",children:"컴포넌트 로드 실패"}),ct.jsxs("div",{className:"text-xs opacity-80",children:[this.props.componentName&&`[${this.props.componentName}] `,"데이터를 표시할 수 없습니다."]}),this.state.error&&ct.jsxs("details",{className:"mt-2",children:[ct.jsx("summary",{className:"cursor-pointer text-xs opacity-70 hover:opacity-100",children:"상세 정보"}),ct.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 za=N.memo(({componentDef:l,dataContext:e,translationContext:a,registry:r,bindingEngine:i,translationEngine:o,actionDispatcher:u,parentComponentContext:d,parentFormContextProp:f,parentDataContext:g,isRootRenderer:m=!1,isInsideIteration:b=!1,isEditMode:v=!1,onComponentSelect:E,onComponentHover:S,onDragStart:A,onDragEnd:T,componentPath:D,layoutKey:M})=>{const[O,L]=N.useState({loadingActions:{}});N.useLayoutEffect(()=>{d||(i.startRenderCycle(),window.__g7SetLocalOverrideKeys||(window.__g7ForcedLocalFields=void 0),window.__g7PendingLocalState=null)});const P=N.useRef(null);N.useLayoutEffect(()=>{if(!d&&e._localInit&&typeof e._localInit=="object"){const{_forceLocalInit:q,_merge:le,...oe}=e._localInit,Q=`${JSON.stringify(oe)}:${q||"no-force"}`;if(P.current!==Q){P.current=Q;const he=le||"shallow",we=window.G7Core?.state?.get?.()?._local||{},_e=window.__g7PendingLocalState||{},Be={...we,..._e};he==="replace"?window.__g7PendingLocalState={loadingActions:Be.loadingActions||{},...oe,hasChanges:!1}:he==="deep"?window.__g7PendingLocalState=ba(Be,{...oe,hasChanges:!1}):window.__g7PendingLocalState={...Be,...oe,hasChanges:!1};const $e=window.__g7SetLocalOverrideKeys;$e&&typeof $e=="object"&&(he==="replace"?window.__g7SetLocalOverrideKeys={...oe,hasChanges:!1}:window.__g7SetLocalOverrideKeys=ba($e,{...oe,hasChanges:!1}))}}}),N.useLayoutEffect(()=>{if(!d){const q=window.__g7SetLocalOverrideKeys;if(q){L(he=>bm(he,q));const le=q,oe=window.__g7ForcedLocalFields,Q=window.__g7LastSetLocalSnapshot;queueMicrotask(()=>{window.__g7SetLocalOverrideKeys===le&&(window.__g7SetLocalOverrideKeys=void 0),window.__g7ForcedLocalFields===oe&&(window.__g7ForcedLocalFields=void 0),window.__g7LastSetLocalSnapshot===Q&&(window.__g7LastSetLocalSnapshot=void 0)})}}},[e._local]);const U=N.useRef(M);N.useEffect(()=>{l._fromBase&&M&&U.current!==M&&(U.current=M,L({loadingActions:{}}))},[M,l._fromBase]);const B=N.useRef(""),Y=N.useRef(!1),ge=N.useRef(null),Ae=N.useRef({}),Oe=N.useRef({}),Ne=N.useRef(g),He=v0(),Ze=n0(),pt=Ze?.getParentDataContext()??g;N.useEffect(()=>{if(e._localInit&&typeof e._localInit=="object"){const{_forceLocalInit:q,...le}=e._localInit,oe=JSON.stringify(le),Q=q!==void 0,he="__g7LocalInitTracking";window[he]||(window[he]={hash:"",timestamp:void 0});const ve=window[he],we=`${oe}:${q||"no-force"}`;if(ve.hash!==we){ve.hash=we,ve.timestamp=q,B.current=oe,Q&&(Y.current=!0);const{_merge:$e,...Re}=le,xe=$e||"shallow";if(L(Ke=>xe==="replace"?{loadingActions:Ke.loadingActions||{},...Re,hasChanges:!1}:xe==="deep"?ba(Ke,{...Re,hasChanges:!1}):{...Ke,...Re,hasChanges:!1}),e._globalSetState){const Ke=e._global?._local||{};let qe;xe==="replace"?qe={...Re,hasChanges:!1}:xe==="deep"?qe=ba(Ke,{...Re,hasChanges:!1}):qe={...Ke,...Re,hasChanges:!1},e._globalSetState({_local:qe})}i.invalidateCacheByKeys(["_local"]),ut.log("_localInit applied (data changed):",Object.keys(le))}ge.current=e._localInit}},[e._localInit,g,i]);const{isTransitioning:J}=Rp(),de=u0(),me=f??de,{width:ne}=vd(),pe=fE(),x=N.useMemo(()=>{let q=l;if(l.type==="iterator"&&l.data){const{data:Q,itemName:he,indexName:ve,...we}=l;q={...we,iteration:{source:Q,item_var:he||"item",index_var:ve}}}if(!q.responsive)return q;const le=ci.getMatchingKey(q.responsive,ne);if(!le)return q;const oe=q.responsive[le];return{...q,props:{...q.props,...oe.props},children:oe.children??q.children,text:oe.text??q.text,if:oe.if??q.if,iteration:oe.iteration??q.iteration,__responsiveChildrenKey:oe.children!==void 0?le:void 0}},[l,ne]),F=N.useCallback(q=>{const le=q?.__setStateId;if(L(oe=>{const Q=window.__g7PendingLocalState,ve=window.__g7SetLocalOverrideKeys||Q,we=ve?ba(oe,ve):oe;if(typeof q=="function"){const xe=q(we);return ba(we,xe)}const{__mergeMode:_e,__setStateId:Be,...$e}=q;let Re;if(_e==="replace"?Re=$e:_e==="shallow"?Re={...we,...$e}:Re=ba(we,$e),_e!==void 0){const xe=window.__g7ForcedLocalFields;xe&&(window.__g7ForcedLocalFields={...xe,...$e})}return Re}),le){const oe=Qa();if(oe?.isEnabled()){const Q=x.id||"unknown",he=x.name||"Unknown";setTimeout(()=>{oe.trackComponentRender?.(Q,he,0,["_local"],[]),oe.completeStateChange?.(le)},0)}}},[x.id,x.name]),ue=d?.state??O,fe=d?.setState??F,te=N.useMemo(()=>{const q=e._localInit&&e._localInit!==ge.current;let le;q&&e._local?le=e._local:le=e._local?ba(e._local,ue):ue;const oe=window.__g7ForcedLocalFields;oe&&(le=ba(le,oe));const Q={...e,_local:le},he=e._computedDefinitions;if(he&&Object.keys(he).length>0){const ve=new vn,we={...Q,...He?{_isolated:He.state}:{}},_e={},Be=Qa(),$e=Be?.isEnabled()??!1;for(const[Re,xe]of Object.entries(he)){const Ke=$e?Date.now():0,qe=$e?e._computed?.[Re]:void 0;let Ce;try{if(typeof xe=="string")if(xe.startsWith("{{")&&xe.endsWith("}}")){const Ee=xe.slice(2,-2).trim(),Le=ve.evaluateExpression(Ee,we,{skipCache:!0});_e[Re]=Le}else _e[Re]=xe;else if(xe&&typeof xe=="object"&&"$switch"in xe){const Ee=ve.resolveSwitch(xe,we,{skipCache:!0});_e[Re]=Ee}}catch(Ee){ut.warn(`Failed to recalculate computed value: ${Re}`,Ee),_e[Re]=e._computed?.[Re],Ce=Ee instanceof Error?Ee.message:String(Ee)}if($e&&(Ce||qe!==_e[Re])){const Le=Date.now()-Ke;Be.trackComputedProperty?.(Re,typeof xe=="string"?xe:JSON.stringify(xe),[{type:"_local",path:"_local",value:Q._local}],_e[Re],Le,x.id,Ce),qe!==_e[Re]&&Be.trackComputedRecalc?.(Re,"dependency-change",qe,_e[Re],Le,{type:"_local",path:"_local"},x.id)}}Q._computed=_e}if(He&&(Q._isolated=He.state),pt&&(Q.$parent=pt),l.extensionPointProps){const ve=i.resolveObject(l.extensionPointProps,Q,b?{skipCache:!0}:void 0);Q.extensionPointProps=v&&o?jd(ve,o,a,Q):ve}return l.extensionPointCallbacks&&(Q.extensionPointCallbacks=l.extensionPointCallbacks),v&&(Q.$templateId===void 0&&a?.templateId&&(Q.$templateId=a.templateId),Q.$locale===void 0&&a?.locale&&(Q.$locale=a.locale)),Q},[e,ue,He?.state,pt,Ze?.version,l.extensionPointProps,l.extensionPointCallbacks]);Ae.current=te._local,Oe.current=te._computed||{},Ne.current=pt,N.useEffect(()=>{const q=Qa();if(!q?.isEnabled())return;const le=te._local;le&&q.updateLocalState(le);const oe=te._computed;oe&&q.updateComputedState(oe),pt&&q.updateParentContext?.(pt);const Q=x.id||`comp-${Date.now()}`,he=x.name||"Unknown",ve={global:Object.keys(e._global||{}),local:Object.keys(le||{}),context:d?Object.keys(d.state||{}):[]},we={type:d?"componentContext":"dynamicState",hasComponentContext:!!d,parentId:d?"parent":void 0};q.trackComponentStateSource?.(Q,he,ve,we),ue&&Object.keys(ue).length>0&&q.trackDynamicState?.(Q,ue);const _e=!!(x.expandChildren||x.props?.expandChildren);q.trackContextFlow?.(Q,he,!!d,_e,!0)},[te._local,e,x.id,x.name,d,ue,x.expandChildren,x.props?.expandChildren,pt]);const ye=N.useMemo(()=>({state:{...te._local},setState:fe,stateRef:Ae,computedRef:Oe,isolatedContext:He,parentDataContext:te}),[te._local,fe,O,He,te]),je=N.useMemo(()=>{const q=qi({if:x.if,condition:x.condition,conditions:x.conditions},te,i,x.id);if(x.if||x.condition!==void 0||x.conditions){const oe=Qa();oe?.isEnabled()&&x.if&&oe.trackIfCondition(x.id||`if-${Date.now()}`,x.if,q)}return q},[x.if,x.conditions,te,i,x.id]),Me=N.useMemo(()=>{if(!x.slot)return null;const q=x.slot;if(q.startsWith("{{")&&q.endsWith("}}")){const le=q.slice(2,-2).trim();try{const oe={componentId:x.id,componentName:x.name,propName:"slot"},Q=i.evaluateExpression(le,te,oe);return ut.log(`[Slot] 표현식 평가: "${le}" => "${Q}" (컴포넌트: ${x.id})`),typeof Q=="string"?Q:null}catch(oe){return ut.warn(`slot 표현식 평가 실패 (컴포넌트: ${x.id}):`,oe),null}}return ut.log(`[Slot] 정적 슬롯 ID: "${q}" (컴포넌트: ${x.id})`),q},[x.slot,x.id,te,i]),Pe=N.useMemo(()=>!Me||!x.id?"":`${x.id}-${Me}-${JSON.stringify(x.slotOrder??0)}`,[Me,x.id,x.slotOrder]),Ie=N.useRef(null);N.useEffect(()=>{const q=window.__slotContextValue,le=q?.isEnabled??!1;if(x.slot&&ut.log(`[Slot Registration] 컴포넌트: ${x.id}, isSlotEnabled: ${le}, shouldRender: ${je}, resolvedSlotId: ${Me}`),!le||!je){x.slot&&ut.log(`[Slot Registration] 등록 스킵 - isSlotEnabled: ${le}, shouldRender: ${je}`),Ie.current&&x.id&&q&&(q.unregisterFromSlot(Ie.current,x.id),Ie.current=null);return}if(!Me||!x.id){x.slot&&ut.log(`[Slot Registration] 등록 스킵 - resolvedSlotId: ${Me}, id: ${x.id}`),Ie.current&&x.id&&q&&(q.unregisterFromSlot(Ie.current,x.id),Ie.current=null);return}Ie.current&&Ie.current!==Me&&q.unregisterFromSlot(Ie.current,x.id);const oe={...x,slot:void 0,slotOrder:void 0};return q.registerToSlot(Me,x.id,{componentDef:oe,dataContext:e,order:x.slotOrder??0,parentFormContext:f??null,getParentComponentContext:()=>ye,translationContext:a,registrationKey:Pe}),Ie.current=Me,()=>{const Q=window.__slotContextValue;Me&&x.id&&Q&&Q.unregisterFromSlot(Me,x.id)}},[je,Me,x,e,f,ye,a,Pe]);const Lt=N.useCallback(q=>{if(typeof q=="string"){if(xg(q))return kg(q);if(Tg(q)){const le=[],oe=q.replace(new RegExp(`${Dl}([^${Fs}]*)${Fs}`,"g"),(he,ve)=>(le.push(ve),`${_r}${le.length-1}${_r}`));let Q=oe;return/\$t:[a-zA-Z0-9._-]+/.test(oe)&&(Q=o.resolveTranslations(oe,a,te)),Q.replace(new RegExp(`${_r}(\\d+)${_r}`,"g"),(he,ve)=>le[parseInt(ve)])}if(q.startsWith("$t:defer:"))return q;if(/\$t:[a-zA-Z0-9._-]+/.test(q)){const le=q.trim();return le.startsWith("{")&&le.endsWith("}")||le.startsWith("[")&&le.endsWith("]")?q:o.resolveTranslations(q,a,te)}return q}if(Array.isArray(q))return q.map(le=>Lt(le));if(q&&typeof q=="object"){const le={};for(const[oe,Q]of Object.entries(q))le[oe]=Lt(Q);return le}return q},[o,a,te]),At=N.useCallback(q=>/[?:|&!+\-*/<>=()]/.test(q),[]),Zt=N.useCallback(q=>{if(!q.startsWith("{{")||!q.endsWith("}}"))return null;const le=q.slice(2,-2);let oe=null,Q=0;for(let he=0;he<le.length;he++){const ve=le[he];if((he>0?le[he-1]:"")!=="\\"&&((ve==='"'||ve==="'")&&!oe?oe=ve:ve===oe&&(oe=null),!oe&&(ve==="{"&&Q++,ve==="}"&&Q--,Q<0)))return null}return Q===0?le.trim():null},[]),Tt=N.useMemo(()=>{let q={...x.props||{}};const le=["cellChildren","expandChildren","expandContext","render"],Q=r.getMetadata(x.name)?.skipBindingKeys||[],he=[...new Set([...le,...Q])],ve=b?{skipCache:!0}:void 0,we=Ce=>{if(ve)return ve;if(Ce.startsWith("_computed")||Ce.startsWith("$computed"))return{skipCache:!0}};for(const[Ce,Ee]of Object.entries(q))if(!he.includes(Ce))if(typeof Ee=="string"){const Le=Zt(Ee);if(Le!==null){let nt=!1,kt=Le;Le.startsWith(Er)&&(nt=!0,kt=Le.slice(Er.length));const yn={componentId:x.id,componentName:x.name,propName:Ce};let Ft;if(At(kt))try{Ft=i.evaluateExpression(kt,te,yn)}catch(na){ut.warn(`표현식 평가 실패 (컴포넌트: ${x.id}, prop: ${Ce}):`,na),Ft=void 0}else Ft=i.resolve(kt,te,we(kt),yn);q[Ce]=nt&&Ft!=null?Ws(Ft):Ft}else{const nt={componentId:x.id,componentName:x.name,propName:Ce};q[Ce]=i.resolveBindings(Ee,te,ve,nt)}}else Array.isArray(Ee)?q[Ce]=Ee.map(Le=>typeof Le=="string"?i.resolveBindings(Le,te,ve):typeof Le=="object"&&Le!==null?i.resolveObject(Le,te,ve):Le):Ee&&typeof Ee=="object"&&(q[Ce]=i.resolveObject(Ee,te,ve));for(const[Ce,Ee]of Object.entries(q))q[Ce]=Lt(Ee);if(typeof q.style=="string"&&(q.style=pE(q.style)),q=Ju(q,v?void 0:x.actions,te,{componentContext:ye,actionDispatcher:u}),x.classMap){const Ce=xS(x.classMap,te,i,{skipCache:!0});if(Ce){const Ee=q.className||"";q.className=Ee?`${Ee} ${Ce}`:Ce}}x.style&&(q.style=x.style),x.actions&&x.actions.length>0&&x.type==="composite"&&Object.assign(q,ue),x.component_layout&&(q.__componentLayoutDefs=x.component_layout);const _e=x.expandChildren||x.props?.expandChildren,Be=x.props?.cellChildren,$e=x.children&&x.children.length>0,Re=x.component_layout,xe=x.slot,Ke=x.props?.modalId,qe=x.type==="composite";return(_e||Be||$e||Re||xe||Ke||qe)&&(q.__componentContext=ye),q},[x.props,x.actions,x.style,x.classMap,x.id,te,a,i,o,ye,ue,Lt,At,Zt,b]),on=N.useRef(null),vt=N.useMemo(()=>on.current&&Op(on.current,Tt)?on.current:(on.current=Tt,Tt),[Tt]),Za=N.useMemo(()=>{const q=x.id;if(typeof q!="string"||!q.includes("{{"))return q;const le=i.resolveBindings(q,te,{skipCache:!0});return typeof le=="string"?le:q},[x.id,te,i]),Sn=N.useMemo(()=>{const q=x.dataKey,le=x.trackChanges,oe=x.debounce;if(q){const Q=q.startsWith("_global."),he=Q?q.slice(8):q,ve=Q?e._global:te._local;return{dataKey:he,trackChanges:le??!1,debounce:oe,setState:Q?_e=>{e._globalSetState?e._globalSetState(_e):ut.warn("_global.formData 사용 시 _globalSetState가 필요합니다.")}:fe,state:ve??{},_isGlobal:Q}}if(me.dataKey)return me},[x.dataKey,x.trackChanges,x.debounce,x.id,fe,te._local,e._global,e._globalSetState,me]),qn=N.useRef(new Set);N.useEffect(()=>{qn.current.clear()},[e._global?._remountKeys]);const Ut=N.useCallback((q,le)=>{const oe=e._global?._remountKeys;return q&&oe?.[q]&&!qn.current.has(q)?(qn.current.add(q),`${q}-remount-${oe[q]}`):q||le},[e._global?._remountKeys]),Rn=N.useMemo(()=>{if(x.text!==void 0){if(typeof x.text=="string"){const q=x.text;let le=q;const oe={componentId:x.id,componentName:x.name,propName:"text",skipCache:!0},Q=Zt(q);if(Q!==null)if(Ag(Q))le=i.resolveBindings(q,te,{skipCache:!0},oe);else if(At(Q))try{le=i.evaluateExpression(Q,te,oe)}catch(he){ut.warn(`text 표현식 평가 실패 (컴포넌트: ${x.id}):`,he),le=""}else le=i.resolve(Q,te,{skipCache:!0},oe);else q.includes("{{")&&(le=i.resolveBindings(q,te,{skipCache:!0},oe));return le=Lt(le),le??""}return x.text}return!x.children||x.children.length===0?null:x.children.map((q,le)=>{if(typeof q=="string")return q;const oe=x.__responsiveChildrenKey,Q=oe?`responsive.${oe}.children`:"children",he=D?`${D}.${Q}.${le}`:`${le}`,ve=q._fromBase?q.id||`child-${le}`:Ut(q.id,`child-${le}`),we=!q._fromBase&&M?`${ve}_${M}`:ve;return ct.jsx(za,{componentDef:q,dataContext:te,translationContext:a,registry:r,bindingEngine:i,translationEngine:o,actionDispatcher:u,parentComponentContext:ye,parentFormContextProp:Sn,isInsideIteration:b,isEditMode:v,onComponentSelect:E,onComponentHover:S,componentPath:he,onDragStart:A,onDragEnd:T,layoutKey:M},we)})},[x.text,x.children,x.id,e,te,a,r,i,o,u,ye,Sn,Zt,At,Lt,Ut,b,v,E,S,D,A,T,M]),_a=N.useMemo(()=>{if(!x.iteration)return null;try{const q=Qu(x.iteration.source,te,i);if(!Array.isArray(q))return ut.warn(`iteration source가 배열이 아닙니다 (컴포넌트: ${x.id}):`,q),null;const le=Qa();return le?.isEnabled()&&le.trackIteration(x.id||`iteration-${Date.now()}`,x.iteration.source,x.iteration.item_var,x.iteration.index_var,q.length),q.map((oe,Q)=>{const he={...te,[x.iteration.item_var]:oe};x.iteration.index_var&&(he[x.iteration.index_var]=Q);const ve=Q===0||Q===q.length-1;le?.isEnabled()&&ve&&le.trackNestedContext?.({componentId:`${x.id||"unknown"}-iter-${Q}`,componentType:"iteration",parentContext:{available:Object.keys(te),values:{}},ownContext:{added:[x.iteration.item_var,...x.iteration.index_var?[x.iteration.index_var]:[]],values:{[x.iteration.item_var]:oe,...x.iteration.index_var?{[x.iteration.index_var]:Q}:{}}},depth:1});const we={...x,iteration:void 0,responsive:void 0},_e=D?`${D}.iteration.${Q}`:`iteration.${Q}`,Be=`${Ut(x.id,"item")}-${Q}`;return ct.jsx(za,{componentDef:we,dataContext:he,translationContext:a,registry:r,bindingEngine:i,translationEngine:o,actionDispatcher:u,parentComponentContext:ye,parentFormContextProp:Sn,isInsideIteration:!0,isEditMode:v,onComponentSelect:E,onComponentHover:S,componentPath:_e,onDragStart:A,onDragEnd:T,layoutKey:M},Be)})}catch(q){return ut.error(`iteration 렌더링 실패 (컴포넌트: ${x.id}):`,q),null}},[x.iteration,x.children,x.id,e,te,a,r,i,o,u,ye,Sn,Ut,v,E,S,D,A,T,M]),[Pn,Vt]=N.useState(0),yt=N.useMemo(()=>{if(!x.sortable||!x.itemTemplate)return null;const{sortable:q,itemTemplate:le}=x;try{const oe=Qu(q.source,te,i);if(!Array.isArray(oe))return ut.warn(`sortable source가 배열이 아닙니다 (컴포넌트: ${x.id}):`,oe),null;if(oe.length===0)return null;const Q=q.itemKey||"id",he=q.strategy||"verticalList",ve=q.itemVar||"$item",we=q.indexVar||"$index",_e=q.handle,Be=q.wrapperElement,$e=(Ke,qe)=>{const Ce=x.actions?.filter(Ee=>Ee.event==="onSortEnd"||Ee.type==="onSortEnd");if(Vt(Ee=>Ee+1),Ce&&Ce.length>0&&u){const Ee={...te,$sortedItems:Ke,$sortEvent:qe};Ce.forEach(Le=>{try{const nt=u.createHandler(Le,Ee,ye),kt=new Event("sortend");nt(kt)}catch(nt){ut.error(`onSortEnd action failed: ${Le.handler}`,nt)}})}},Re=Ke=>{const qe=x.actions?.filter(Ce=>Ce.event==="onSortStart"||Ce.type==="onSortStart");if(qe&&qe.length>0&&u){const Ce={...te,$activeId:Ke.activeId};qe.forEach(Ee=>{try{const Le=u.createHandler(Ee,Ce,ye),nt=new Event("sortstart");Le(nt)}catch(Le){ut.error(`onSortStart action failed: ${Ee.handler}`,Le)}})}},xe=oe.map((Ke,qe)=>{const Ce=String(Ke[Q]),Ee={...te,[ve]:Ke,[we]:qe},Le=D?`${D}.sortable.${qe}`:`sortable.${qe}`,nt=`${Ut(x.id,"sortable-item")}-v${Pn}-${Ce}`;return ct.jsx(hE,{id:Ce,handle:_e,...Be?{as:Be}:{},children:(Be&&le.children?le.children:[le]).map((kt,yn)=>ct.jsx(za,{componentDef:kt,dataContext:Ee,translationContext:a,registry:r,bindingEngine:i,translationEngine:o,actionDispatcher:u,parentComponentContext:ye,parentFormContextProp:void 0,isInsideIteration:!0,isEditMode:v,onComponentSelect:E,onComponentHover:S,componentPath:Le,onDragStart:A,onDragEnd:T,layoutKey:M},`${nt}-child-${yn}`))},nt)});return ct.jsx(uE,{items:oe,itemKey:Q,strategy:he,onSortEnd:$e,onSortStart:Re,sortVersion:Pn,children:xe})}catch(oe){return ut.error(`sortable 렌더링 실패 (컴포넌트: ${x.id}):`,oe),null}},[x.sortable,x.itemTemplate,x.actions,x.id,e,te,a,r,i,o,u,ye,Ut,v,E,S,D,A,T,Pn,M]),er=N.useRef(!1);N.useEffect(()=>{if(er.current)return;er.current=!0;const q=Qa();if(q?.isEnabled()&&q.trackMount(l.id,{name:l.name,type:l.type||"component",props:vt}),l.lifecycle?.onMount&&l.lifecycle.onMount.length>0)for(const oe of l.lifecycle.onMount)try{const Q=u.createHandler(oe,te,ye),he=new Event("mount");Q(he),ut.log(`Lifecycle onMount executed: ${oe.handler} (Component: ${l.id})`)}catch(Q){ut.error(`Lifecycle onMount failed: ${oe.handler} (Component: ${l.id})`,Q)}const le=[];if(l.onComponentEvent&&l.onComponentEvent.length>0){const oe=window.G7Core;if(oe?.componentEvent?.on)for(const Q of l.onComponentEvent){if(!Q.event){ut.warn(`onComponentEvent: event name is required (Component: ${l.id})`);continue}const he=async we=>{try{const _e={...te,_eventData:we},$e=await u.createHandler({handler:Q.handler,params:Q.params,onSuccess:Q.onSuccess,onError:Q.onError},_e,ye)(new CustomEvent(Q.event,{detail:we}));return ut.log(`onComponentEvent "${Q.event}" handled: ${Q.handler} (Component: ${l.id})`,{eventData:we,result:$e}),$e}catch(_e){throw ut.error(`onComponentEvent "${Q.event}" failed: ${Q.handler} (Component: ${l.id})`,_e),_e}},ve=oe.componentEvent.on(Q.event,he);le.push(ve),ut.log(`onComponentEvent: Subscribed to "${Q.event}" (Component: ${l.id})`)}else ut.warn(`onComponentEvent: G7Core.componentEvent is not available (Component: ${l.id})`)}return()=>{const oe=Qa();oe?.isEnabled()&&oe.trackUnmount(l.id);for(const Q of le)try{Q()}catch(he){ut.error(`onComponentEvent: Failed to unsubscribe (Component: ${l.id})`,he)}if(le.length>0&&ut.log(`onComponentEvent: Unsubscribed ${le.length} event(s) (Component: ${l.id})`),l.lifecycle?.onUnmount&&l.lifecycle.onUnmount.length>0)for(const Q of l.lifecycle.onUnmount)try{const he=u.createHandler(Q,te,ye),ve=new Event("unmount");he(ve),ut.log(`Lifecycle onUnmount executed: ${Q.handler} (Component: ${l.id})`)}catch(he){ut.error(`Lifecycle onUnmount failed: ${Q.handler} (Component: ${l.id})`,he)}}},[]);const Gn=N.useMemo(()=>{const q=vt.dataKey,le=vt.trackChanges,oe=vt.debounce;return q?{dataKey:q,trackChanges:le??!1,debounce:oe,setState:fe,state:ue}:null},[vt.dataKey,vt.trackChanges,vt.debounce,fe,ue]);N.useEffect(()=>{const q=x.dataKey||vt.dataKey;if(!q)return;const le=Qa();if(!le?.isEnabled())return;const oe=[],Q=ve=>{if(ve)for(const we of ve){const _e=we?.props?.name;if(_e&&oe.push({name:_e,type:we.name||we.type||"unknown"}),we?.children&&Q(we.children),we?.slots)for(const Be of Object.values(we.slots))Array.isArray(Be)&&Q(Be)}};if(l.children&&Q(l.children),l.slots)for(const ve of Object.values(l.slots))Array.isArray(ve)&&Q(ve);const he=l.id||`form-${q}`;return le.trackForm(he,q,oe),()=>{le.untrackForm(he)}},[x,vt.dataKey,l.id,l.children]);const en=N.useRef(null),mn=N.useRef(void 0);N.useEffect(()=>{const q=vt?.name;if(!q||!me.dataKey||!me.setState||vt?.autoBinding===!1)return;const le=`${me.dataKey}.${q}`,oe=window.__g7AutoBindingPaths??new Map;return window.__g7AutoBindingPaths=oe,oe.set(le,(oe.get(le)??0)+1),()=>{const Q=oe.get(le)??0;Q<=1?oe.delete(le):oe.set(le,Q-1)}},[vt?.name,vt?.autoBinding,me.dataKey,me.setState]);const ta=N.useMemo(()=>{const{dataKey:q,trackChanges:le,debounce:oe,...Q}=vt,he=Q.name;if(!he||!me.dataKey||!me.setState)return Q;if(Q.autoBinding===!1){const{autoBinding:Ce,...Ee}=Q;return Ee}const ve=`${me.dataKey}.${he}`,we=d0(me.state,ve),_e=we!==void 0?we:Q.value,$e=r.getMetadata(l.name)?.bindingType,Re=typeof _e=="boolean"&&($e==="checked"||$e==="checkable"&&["checkbox","radio"].includes(Q?.type)),xe=me.debounce,Ke=Ce=>{const Ee=me.state||{},Le=f0(Ee,ve,Ce);if(me.trackChanges&&(Le.hasChanges=!0),window.__g7PendingLocalState=Le,me.setState(Le),me._isGlobal)return;const nt=window.G7Core,kt={[ve]:Ce};me.trackChanges&&(kt.hasChanges=!0),nt?.state?.setLocal?.(kt,{render:!1})},qe=(Ce,Ee)=>{xe&&xe>0?(en.current&&clearTimeout(en.current),en.current=setTimeout(()=>{Ke(Ce),en.current=null,Ee&&(Ee(),window.__g7PendingLocalState=null)},xe)):(Ke(Ce),Ee&&(Ee(),window.__g7PendingLocalState=null))};if(Re)return{...Q,checked:_e,onChange:Ee=>{const Le=Ee.target.checked;Ke(Le),Q.onChange&&Q.onChange(Ee)}};{const Ce=Le=>{const nt=Le?.target?.value!==void 0?Le.target.value:Le;xe&&xe>0&&(mn.current=nt);const kt=Le?.target?{target:{value:nt,name:Le.target.name,type:Le.target.type,checked:Le.target.checked},currentTarget:Le.currentTarget?{value:nt,name:Le.currentTarget.name}:void 0}:Le;qe(nt,()=>{Q.onChange&&Q.onChange(kt)})};let Ee;return mn.current!==void 0?en.current!==null?Ee=mn.current:String(_e??"")===String(mn.current)?(mn.current=void 0,Ee=_e??""):Ee=mn.current:Ee=_e??"",{...Q,value:Ee,onChange:Ce}}},[vt,me,me.state,me.debounce]),wn=N.useMemo(()=>{const q=Qa();if(q?.isEnabled()&&q.trackRender(l.name),!je)return null;if(x.sortable&&x.itemTemplate)return yt;if(x.iteration)return _a;if(x.type==="extension_point"){const{layout:$e,columns:Re,gap:xe,className:Ke,...qe}=x.props||{};let Ce=Ke||"";return $e==="grid"&&Re?Ce=`${Ce} grid grid-cols-${Re} gap-${xe||4}`.trim():$e==="flex"&&(Ce=`${Ce} flex flex-col gap-${xe||4}`.trim()),ct.jsx("div",{id:Za,className:Ce||void 0,...qe,children:Rn})}const le=r.getComponent(x.name);if(!le)return ut.error(`컴포넌트를 찾을 수 없습니다: ${x.name} (ID: ${x.id})`,"componentDef:",JSON.stringify(x,null,2)),null;const oe=e._global?._remountKeys,Q={...ta,id:ta.id??Za,...oe&&Object.keys(oe).length>0&&{__remountTrigger:JSON.stringify(oe)}};if(pe?.listeners&&pe.handle&&ta["data-drag-handle"]!==void 0&&(Object.assign(Q,pe.listeners),Q.style={...Q.style,cursor:pe.isDragging?"grabbing":"grab"}),v){const $e=x.id||`auto_${x.name||x.type||"unknown"}_${Math.random().toString(36).substring(2,8)}`,Re=qe=>{typeof qe.preventDefault=="function"&&qe.preventDefault(),E&&(qe.stopPropagation(),E($e,qe))},xe={"data-editor-id":$e,"data-editor-name":x.name,"data-editor-type":x.type,onClick:Re};D&&(xe["data-editor-path"]=D);const Ke=x.__editorSlotName??x.slot;typeof Ke=="string"&&(xe["data-editor-slot"]=Ke),S&&(xe.onMouseMove=qe=>{qe.stopPropagation(),S($e,qe)},xe.onMouseLeave=qe=>{S(null,qe)}),Object.assign(Q,xe),Q.editorAttrs=xe}const he=x.type==="basic",ve=x.type==="layout",_e=he||ve?(()=>{const $e={};for(const[Re,xe]of Object.entries(Q))Re.startsWith("__")||Re==="editorAttrs"&&he||($e[Re]=xe);return $e})():Q;let Be=ct.jsx(le,{..._e,children:Rn});if(Sn&&(Be=ct.jsx(c0,{value:Sn,children:Be})),x.isolatedState){const $e=typeof x.isolatedState=="object"?x.isolatedState:{},Re=e?._isolatedInit,xe=Re?{...$e,...Re}:$e;Be=ct.jsx(b0,{initialState:xe,scopeId:x.isolatedScopeId,children:Be})}return Be},[je,x.iteration,x.sortable,x.itemTemplate,x.type,x.name,x.id,x.props,x.isolatedState,x.isolatedScopeId,r,ta,Rn,_a,yt,pe,Gn,v,E,S,A,T,D,e._global?._remountKeys]),tr=N.useMemo(()=>{const q=x.blur_until_loaded;if(!q||e?._global?.__isPreview)return!1;if(typeof q=="string"){const Q=Zt(q);if(Q!==null)try{const he={componentId:x.id,componentName:x.name,propName:"blur_until_loaded"};return!!i.evaluateExpression(Q,te,he)}catch(he){return ut.warn(`blur_until_loaded 표현식 평가 실패 (컴포넌트: ${x.id}):`,he),!1}return!1}if(typeof q=="object"&&q!==null){if(!q.enabled)return!1;if(q.data_sources)return(Array.isArray(q.data_sources)?q.data_sources:[q.data_sources]).some(we=>e[we]===void 0);if(J)return!0;const Q=["route","query","_global","_local","_dataSourceErrors"];return Object.keys(e).filter(ve=>!Q.includes(ve)&&!ve.startsWith("_")).some(ve=>e[ve]===void 0)}if(J)return!0;const le=["route","query","_global","_local","_dataSourceErrors"];return Object.keys(e).filter(Q=>!le.includes(Q)&&!Q.startsWith("_")).some(Q=>e[Q]===void 0)},[x.blur_until_loaded,x.id,J,e,te,i,Zt]);if(tr){const q=x.blur_until_loaded;if(typeof q=="object"&&q?.data_sources){const oe=(Array.isArray(q.data_sources)?q.data_sources:[q.data_sources]).reduce((he,ve)=>(he[ve]=e[ve]===void 0?"UNDEFINED":"LOADED",he),{}),Q=Object.keys(e).filter(he=>!he.startsWith("_"));ut.log(`[BLUR APPLIED] Component: ${x.id}, data_sources status:`,oe,"Available keys:",Q)}else ut.log(`[BLUR APPLIED] Component: ${x.id}, blur_until_loaded:`,q)}const Vn=N.useMemo(()=>{if(!x.blur_until_loaded)return{wrapperClasses:"",innerClasses:""};const q=Tt?.className||"";if(!q)return{wrapperClasses:"",innerClasses:""};const le=[/^(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-)/],oe=q.split(/\s+/).filter(Boolean),Q=[],he=[];for(const ve of oe)le.some(_e=>_e.test(ve))?Q.push(ve):he.push(ve);return{wrapperClasses:Q.join(" "),innerClasses:he.join(" ")}},[x.blur_until_loaded,Tt?.className]),Bt=window.__slotContextValue;return Me&&Bt?.isEnabled?null:ct.jsx(mE,{componentId:l.id,componentName:l.name,children:x.blur_until_loaded?ct.jsx("div",{className:[Vn.wrapperClasses,tr?"opacity-50 blur-sm transition-all duration-300 pointer-events-none":void 0].filter(Boolean).join(" ")||void 0,children:wn}):wn})});za.displayName="DynamicRenderer",typeof window<"u"&&(window.__DynamicRenderer=za);function yE(l){const e={};try{const r=new URL(l,typeof window<"u"?window.location.origin:"http://localhost").searchParams,i=new Set;for(const o of r.keys()){if(i.has(o))continue;i.add(o);const u=r.getAll(o);u.length>1||o.endsWith("[]")?e[o]=u:e[o]=u[0]}}catch{}return e}function bE(l){try{return new URL(l,typeof window<"u"?window.location.origin:"http://localhost").pathname}catch{return l.split("?")[0]}}const mi=class mi{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 mi.instance||(mi.instance=new mi),mi.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 r=window.G7Core?.state?.get?.();return r?.settings?.advanced?.debug_mode===!0||r?._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 a={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(a),this.stateHistory.length>this.config.maxHistorySize&&this.stateHistory.shift(),this.notifyStateWatchers(a)}getState(){try{const e=window.G7Core,a=e?.state?.get?.()||{},r={};if(e?._isolatedStates&&typeof e._isolatedStates=="object")for(const[i,o]of Object.entries(e._isolatedStates))r[i]=this.sanitizeObject(o);return{_global:a._global||a,_local:this.currentLocalState,_computed:this.currentComputedState,_isolated:Object.keys(r).length>0?r: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 a={};try{a=(window.G7Core?.state?.get?.()||{})._local||{}}catch{a={}}const r=this.findMismatchedLeafPaths(e,a);return{hasMismatch:r.length>0,mismatchedPaths:r,storageA:e,storageB:a}}findMismatchedLeafPaths(e,a,r=""){const i=[],o=new Set([...Object.keys(e||{}),...Object.keys(a||{})]);for(const u of o){const d=r?`${r}.${u}`:u,f=e?.[u],g=a?.[u],m=f&&typeof f=="object"&&!Array.isArray(f),b=g&&typeof g=="object"&&!Array.isArray(g);if(m&&b)i.push(...this.findMismatchedLeafPaths(f,g,d));else{const v=f===void 0?"__undefined__":JSON.stringify(f),E=g===void 0?"__undefined__":JSON.stringify(g);v!==E&&i.push(d)}}return i}watchState(e,a){return this.stateWatchers.has(e)||this.stateWatchers.set(e,new Set),this.stateWatchers.get(e).add(a),()=>{this.stateWatchers.get(e)?.delete(a)}}notifyStateWatchers(e){if(this.stateWatchers.get("*")?.forEach(a=>{try{a(e.next,e.prev,"*")}catch(r){console.error("[G7DevTools] State watcher error:",r)}}),e.diff)for(const a of e.diff.changed)this.stateWatchers.get(a.path)?.forEach(r=>{try{r(a.newValue,a.oldValue,a.path)}catch(i){console.error("[G7DevTools] State watcher error:",i)}})}diffSnapshots(e,a){const r=this.stateHistory.find(o=>o.id===e),i=this.stateHistory.find(o=>o.id===a);return!r||!i?null:this.calculateDiff(r.next,i.next)}calculateDiff(e,a,r=""){const i={added:[],removed:[],changed:[]},o=new Set(Object.keys(e)),u=new Set(Object.keys(a));for(const d of u){const f=r?`${r}.${d}`:d;o.has(d)?JSON.stringify(e[d])!==JSON.stringify(a[d])&&i.changed.push({path:f,oldValue:e[d],newValue:a[d]}):i.added.push(f)}for(const d of o){const f=r?`${r}.${d}`:d;u.has(d)||i.removed.push(f)}return i}logAction(e){if(!this.config.enabled)return;const a=this.actionHistory.findIndex(r=>r.id===e.id);a>=0?this.actionHistory[a]={...this.actionHistory[a],...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(a=>{try{a(e)}catch(r){console.error("[G7DevTools] Action watcher error:",r)}})}getActionMetrics(){const e=this.actionHistory.filter(o=>o.status==="success"),a=this.actionHistory.filter(o=>o.status==="error"),r={};for(const o of this.actionHistory)r[o.type]=(r[o.type]||0)+1;const i=e.reduce((o,u)=>o+(u.duration||0),0);return{totalActions:this.actionHistory.length,successCount:e.length,errorCount:a.length,averageDuration:e.length>0?i/e.length:0,actionsByType:r}}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 a={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(a),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 a=0,r=0,i=0,o=0;const u={},d={};for(const g of e)g.decision==="cache_hit"?a++:g.decision==="cache_miss"?r++:g.decision==="skip_cache"?i++:g.decision==="invalidate"&&o++,u[g.reason]=(u[g.reason]||0)+1,g.context.componentId&&(d[g.context.componentId]=(d[g.context.componentId]||0)+1);const f=a+r+i;return{totalDecisions:e.length,cacheHits:a,cacheMisses:r,skipCacheCount:i,invalidateCount:o,byReason:u,byComponent:d,avgHitRate:f>0?a/f:0}}getRecentCacheDecisions(e=20,a){let r=[...this.cacheDecisions];return a&&(r=r.filter(i=>i.decision===a)),r.slice(-e)}clearCacheDecisionData(){this.cacheDecisions=[],this.cacheDecisionIdCounter=0}summarizePropsForLifecycle(e){if(!e||typeof e!="object")return e;const a={},r=["children","ref","key"];for(const[i,o]of Object.entries(e))if(!r.includes(i))if(o==null)a[i]=o;else if(Array.isArray(o))a[i]=`[Array(${o.length})]`;else if(typeof o=="object"){const u=Object.keys(o);u.length<=3?a[i]=`{${u.join(", ")}}`:a[i]=`{${u.slice(0,3).join(", ")}, ... +${u.length-3}}`}else typeof o=="string"&&o.length>50?a[i]=o.substring(0,50)+"...":typeof o=="function"?a[i]="[Function]":a[i]=o;return a}trackMount(e,a){if(!this.config.enabled)return;const r=this.summarizePropsForLifecycle(a.props),i={...a,props:r,id:e,mountTime:Date.now()};this.mountedComponents.set(e,i),this.mountWatchers.forEach(o=>{try{o({componentId:e,componentName:a.name,timestamp:i.mountTime})}catch(u){console.error("[G7DevTools] Mount watcher error:",u)}})}trackUnmount(e){if(!this.config.enabled)return;const a=this.mountedComponents.get(e),r=this.eventListeners.get(e)||[];r.length>0&&console.warn(`[G7DevTools] 컴포넌트 ${e} 언마운트 시 ${r.length}개 리스너 미정리`),a&&this.unmountWatchers.forEach(i=>{try{i({componentId:e,componentName:a.name,timestamp:Date.now(),orphanedListeners:r.length})}catch(o){console.error("[G7DevTools] Unmount watcher error:",o)}}),this.mountedComponents.delete(e)}trackListener(e,a,r){if(!this.config.enabled)return;const i=this.eventListeners.get(e)||[];i.push({type:a,target:r,addedAt:Date.now()}),this.eventListeners.set(e,i)}removeListener(e,a){if(!this.config.enabled)return;const r=this.eventListeners.get(e)||[],i=r.findIndex(o=>o.type===a);i>=0&&r.splice(i,1)}getMountedComponents(){return Array.from(this.mountedComponents.values())}getOrphanedListeners(){const e=[];for(const[a,r]of this.eventListeners)this.mountedComponents.has(a)||e.push(...r.map(i=>({...i,componentId:a})));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 a=this.renderCounts.get(e)||0;this.renderCounts.set(e,a+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(),o=JSON.stringify(i).length;o>1e6&&e.push({type:"large-state",message:`상태 크기가 ${(o/1024/1024).toFixed(2)}MB입니다`,suggestion:"불필요한 데이터 정리 필요",severity:o>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 a=this.getOrphanedListeners().length;a>0&&e.push({type:"orphaned-listeners",message:`${a}개의 정리되지 않은 이벤트 리스너`,suggestion:"useEffect cleanup 또는 removeEventListener 확인",severity:a>10?"error":"warning"});const r=Array.from(this.renderCounts.entries()).filter(([,i])=>i>50);return r.length>0&&e.push({type:"excessive-renders",message:`${r.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,a=this.analyzeProfile(e);return console.log("[G7DevTools] 프로파일링 완료",a),a}analyzeProfile(e){const a=this.profilingData.filter(g=>g.type==="render"),r=this.profilingData.filter(g=>g.type==="binding"),i=this.profilingData.filter(g=>g.type==="action"),o={};for(const g of a)g.component&&(o[g.component]||(o[g.component]={count:0,durations:[]}),o[g.component].count++,g.duration&&o[g.component].durations.push(g.duration));const u=Object.entries(o).map(([g,m])=>({name:g,renderCount:m.count,avgDuration:m.durations.length>0?m.durations.reduce((b,v)=>b+v,0)/m.durations.length:0})).sort((g,m)=>m.renderCount-g.renderCount).slice(0,10),d={};for(const g of r)g.expression&&(d[g.expression]=(d[g.expression]||0)+1);const f=Object.entries(d).sort(([,g],[,m])=>m-g).slice(0,10).map(([g])=>g);return{duration:e,entries:this.profilingData,summary:{totalRenders:a.length,totalBindings:r.length,totalActions:i.length,slowestComponents:u,hotPaths:f}}}resetPerformanceStats(){this.renderCounts.clear(),this.bindingEvalCount=0,this.profilingData=[]}trackRequest(e,a,r){if(!this.config.enabled)return"";const i=this.generateId(),o=bE(e),u=yE(e);return this.activeRequests.set(i,{id:i,url:o,fullUrl:e,queryParams:u,method:a,startTime:Date.now(),status:"pending",requestBody:r?.requestBody?this.sanitizeObject(r.requestBody):void 0,dataSourceId:r?.dataSourceId}),this.isProfiling&&this.profilingData.push({type:"network",timestamp:performance.now()}),i}completeRequest(e,a,r){if(!this.config.enabled)return;const i=this.activeRequests.get(e);if(!i)return;const o={...i,status:a>=200&&a<300?"success":"error",statusCode:a,duration:Date.now()-i.startTime,endTime:Date.now(),response:this.sanitizeObject(r)};this.requestHistory.push(o),this.activeRequests.delete(e),this.requestHistory.length>this.config.maxHistorySize&&this.requestHistory.shift(),this.notifyRequestWatchers(o)}failRequest(e,a){if(!this.config.enabled)return;const r=this.activeRequests.get(e);if(!r)return;const i={...r,status:"error",error:a,duration:Date.now()-r.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(a=>{try{a(e)}catch(r){console.error("[G7DevTools] Request watcher error:",r)}})}trackWebSocketConnection(e,a,r){this.config.enabled&&this.wsConnections.set(e,{id:e,url:a,state:r,connectedAt:r==="open"?Date.now():void 0})}trackWebSocketMessage(e,a,r,i){if(!this.config.enabled)return;const o={id:this.generateId(),connectionId:e,direction:a,type:r,payload:this.sanitizeObject(i),timestamp:Date.now(),sequence:this.wsMessageHistory.length};this.wsMessageHistory.push(o),this.wsMessageHistory.length>this.config.maxHistorySize&&this.wsMessageHistory.shift(),this.notifyWebSocketWatchers(o)}getWebSocketConnections(){return Array.from(this.wsConnections.values())}getWebSocketMessageHistory(){return[...this.wsMessageHistory]}getWebSocketConnectionState(){const e=Array.from(this.wsConnections.values());return e.some(a=>a.state==="open")?"connected":e.some(a=>a.state==="connecting")?"reconnecting":"disconnected"}watchWebSocketMessage(e){return this.wsMessageWatchers.add(e),()=>{this.wsMessageWatchers.delete(e)}}notifyWebSocketWatchers(e){this.wsMessageWatchers.forEach(a=>{try{a(e)}catch(r){console.error("[G7DevTools] WebSocket watcher error:",r)}})}trackIfCondition(e,a,r){if(!this.config.enabled)return;const i=this.ifConditions.get(e),o=i?.evaluatedValue;this.ifConditions.set(e,{id:e,expression:a,evaluatedValue:r,evaluationCount:(i?.evaluationCount||0)+1,lastEvaluated:Date.now()}),i&&o!==r&&this.notifyConditionWatchers({id:e,expression:a,oldValue:o,newValue:r,timestamp:Date.now()})}trackIteration(e,a){this.config.enabled&&this.iterations.set(e,{id:e,...a,lastRendered:Date.now()})}getIfConditions(){return Array.from(this.ifConditions.values())}getIterations(){return Array.from(this.iterations.values())}getScopeChain(e){const a=[],r=this.getState();return a.push({name:"_global",value:r._global,source:"global"}),a.push({name:"_local",value:r._local,source:"local"}),a.push({name:"_computed",value:r._computed,source:"computed"}),a}watchConditionChange(e){return this.conditionWatchers.add(e),()=>{this.conditionWatchers.delete(e)}}notifyConditionWatchers(e){this.conditionWatchers.forEach(a=>{try{a(e)}catch(r){console.error("[G7DevTools] Condition watcher error:",r)}})}trackForm(e,a,r){this.config.enabled&&this.forms.set(e,{id:e,dataKey:a,inputs:r,trackedAt:Date.now()})}trackFormChange(e,a,r){if(!this.config.enabled)return;const i={formId:e,inputName:a,value:r,timestamp:Date.now()};this.notifyFormWatchers(i)}untrackForm(e){this.forms.delete(e)}getForms(){return Array.from(this.forms.values())}getFormState(e){const a=this.getState();return this.getNestedValue(a,e)||{}}getBindingPath(e,a){return`${e}.${a}`}watchFormChange(e){return this.formWatchers.add(e),()=>{this.formWatchers.delete(e)}}notifyFormWatchers(e){this.formWatchers.forEach(a=>{try{a(e)}catch(r){console.error("[G7DevTools] Form watcher error:",r)}})}trackFormBindingIssue(e,a,r){if(!this.config.enabled)return;const i={id:`form-issue-${++this.formBindingIssueIdCounter}`,timestamp:Date.now(),type:e,severity:a,formId:r.formId,formDataKey:r.formDataKey,inputInfo:r.inputInfo,contextInfo:r.contextInfo,description:r.description,suggestion:r.suggestion,docLink:r.docLink};this.formBindingIssues.push(i),this.formBindingIssues.length>this.maxFormBindingIssues&&this.formBindingIssues.shift()}validateFormBinding(e,a,r,i){const o=r.map(f=>{const g=[];let m=!0;return f.name||(g.push("Input에 name 속성이 없습니다"),m=!1,this.trackFormBindingIssue("missing-input-name","error",{formId:e,formDataKey:a,inputInfo:{name:f.name,type:f.type},description:"Input에 name 속성이 없어 자동 바인딩이 동작하지 않습니다",suggestion:"Input에 name 속성을 추가하세요",docLink:"troubleshooting-components-form.md"})),a||(g.push("Form에 dataKey가 없습니다"),m=!1),{inputName:f.name||"(unnamed)",inputType:f.type,bindingPath:a&&f.name?`${a}.${f.name}`:"-",isValid:m,currentValue:f.value,issues:g}});if(a||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:a,contextInfo:{hasParentFormContext:i.hasParentContext,parentFormContextProp:i.parentContextProp,isInsideSortable:i.breakReason?.includes("sortable")||!1,isInsideModal:i.breakReason?.includes("modal")||!1,depth:0},description:i.breakReason||"Form 컨텍스트가 제대로 전파되지 않았습니다",suggestion:"parentFormContextProp={undefined}를 확인하거나 중첩 구조를 검토하세요",docLink:"troubleshooting-components-form.md"})}const u={formId:e,dataKey:a,timestamp:Date.now(),contextPropagation:i,inputBindings:o,isValid:o.every(f=>f.isValid)&&!!a&&!i.isContextBroken,issueCount:o.filter(f=>!f.isValid).length+(a?0:1)+(i.isContextBroken?1:0)},d=this.formBindingValidations.findIndex(f=>f.formId===e);return d>=0?this.formBindingValidations[d]=u:this.formBindingValidations.push(u),u}getFormBindingValidationTrackingInfo(){const e=this.getFormBindingValidationStats();return{issues:[...this.formBindingIssues],validations:[...this.formBindingValidations],stats:e,timestamp:Date.now()}}getFormBindingValidationStats(){const e={"missing-datakey":0,"missing-input-name":0,"context-not-propagated":0,"sortable-context-break":0,"modal-context-isolation":0,"duplicate-input-name":0,"value-type-mismatch":0,"binding-path-invalid":0},a={info:0,warning:0,error:0};for(const i of this.formBindingIssues)e[i.type]++,a[i.severity]++;const r=Object.entries(e).filter(([,i])=>i>0).sort((i,o)=>o[1]-i[1]).slice(0,5).map(([i,o])=>({type:i,count:o,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:a,topIssues:r}}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,a,r,i,o,u,d){if(!this.config.enabled)return;const f=`computed-${e}-${u||"global"}`,g={id:f,name:e,expression:a,componentId:u,dependencies:r,currentValue:this.safeClone(i),lastComputedAt:Date.now(),computationTime:o,error:d};this.computedProperties.set(f,g)}trackComputedRecalc(e,a,r,i,o,u,d){if(!this.config.enabled)return;const f=`computed-${e}-${d||"global"}`,g=JSON.stringify(r)!==JSON.stringify(i),m={id:`recalc-${++this.computedRecalcIdCounter}`,computedId:f,computedName:e,timestamp:Date.now(),trigger:a,triggeredBy:u,previousValue:this.safeClone(r),newValue:this.safeClone(i),valueChanged:g,computationTime:o,cascadeCount:0};this.computedRecalcLogs.push(m),this.computedRecalcLogs.length>this.maxComputedRecalcLogs&&this.computedRecalcLogs.shift();const b=this.computedProperties.get(f);b&&(b.currentValue=this.safeClone(i),b.lastComputedAt=Date.now(),b.computationTime=o)}analyzeComputedDependencyChain(e,a){const r=new Set,i=[];let o=!1,u,d=0;const f=(m,b)=>{if(d=Math.max(d,b),r.has(m))return o=!0,u=[...i,m],{name:m,type:"computed",children:[],depth:b};r.add(m),i.push(m);const v=this.computedProperties.get(`computed-${m}-${a||"global"}`),E=[];if(v)for(const S of v.dependencies)S.type==="computed"?E.push(f(S.path,b+1)):E.push({name:S.path,type:S.type,children:[],depth:b+1});return i.pop(),r.delete(m),{name:m,type:"computed",children:E,depth:b}},g=f(e,0);return{root:e,tree:g,hasCycle:o,cyclePath:u,maxDepth:d}}getComputedDependencyTrackingInfo(){const e=Array.from(this.computedProperties.values()),a=this.getComputedDependencyStats(),r=[];for(const i of e){const o=this.analyzeComputedDependencyChain(i.name,i.componentId);r.push(o)}return{properties:e,recalcLogs:[...this.computedRecalcLogs],dependencyChains:r,stats:a,timestamp:Date.now()}}getComputedDependencyStats(){const e={"state-change":0,"datasource-update":0,"dependency-change":0,manual:0,initial:0},a={},r={};let i=0,o=0;for(const g of this.computedRecalcLogs)e[g.trigger]++,g.valueChanged||o++,a[g.computedName]=(a[g.computedName]||0)+1,r[g.computedName]||(r[g.computedName]=[]),r[g.computedName].push(g.computationTime),i+=g.computationTime;const u=Object.entries(a).sort((g,m)=>m[1]-g[1]).slice(0,5).map(([g,m])=>({name:g,count:m})),d=Object.entries(r).map(([g,m])=>({name:g,avgTime:m.reduce((b,v)=>b+v,0)/m.length})).sort((g,m)=>m.avgTime-g.avgTime).slice(0,5);let f=0;for(const g of this.computedProperties.values())this.analyzeComputedDependencyChain(g.name,g.componentId).hasCycle&&f++;return{totalComputed:this.computedProperties.size,totalRecalculations:this.computedRecalcLogs.length,unnecessaryRecalculations:o,avgComputationTime:this.computedRecalcLogs.length>0?i/this.computedRecalcLogs.length:0,topRecalculated:u,slowestComputed:d,cycleDetectionCount:f,byTrigger:e}}clearComputedTracking(){this.computedProperties.clear(),this.computedRecalcLogs=[],this.computedRecalcIdCounter=0}trackModalOpen(e){if(!this.config.enabled)return;const a={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,a),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,a){if(!this.config.enabled)return;const r=this.modalStates.get(e);r&&(r.closedAt=Date.now(),a&&(r.currentState={...a}),this.detectStateLeakage(r))}validateModalDefinitionExists(e,a){const r=this.currentLayout;if(!r?.layoutJson)return;const i=r.layoutJson.modals;if(!i){this.recordModalStateIssue({type:"missing-definition",modalId:e,modalName:a,severity:"error",description:`모달 "${e}"이(가) modalStack에 추가되었으나, 현재 레이아웃에 modals 섹션이 없습니다. 레이아웃 경로: ${r.layoutPath}`,affectedStateKeys:[],expectedValue:`modals 섹션에 id="${e}" 정의 존재`,actualValue:"modals 섹션 없음"});return}const o=Array.isArray(i)?i:Object.values(i);o.some(d=>d?.id===e||d?.props?.id===e)||this.recordModalStateIssue({type:"missing-definition",modalId:e,modalName:a,severity:"error",description:`모달 "${e}"이(가) modalStack에 추가되었으나, 렌더링된 레이아웃의 modals 섹션에 해당 ID의 정의가 없습니다. partial 로딩 실패, 레이아웃 병합 문제, extends 상속 누락 등을 확인하세요. 레이아웃 경로: ${r.layoutPath}`,affectedStateKeys:[],expectedValue:`modals 배열에 id="${e}" 항목 존재`,actualValue:`modals 배열에 ${o.length}개 모달 정의 (${o.map(d=>d?.id||"unknown").join(", ")})`})}trackModalStateChange(e){if(!this.config.enabled)return;const a=this.modalStates.get(e.modalId);if(!a)return;a.stateChangeCount++,a.currentState[e.stateKey]=e.newValue;const r=this.checkIsolationViolation(a,e.stateKey),i={id:`modal-change-${++this.modalStateChangeLogIdCounter}`,modalId:e.modalId,modalName:a.modalName,timestamp:Date.now(),stateKey:e.stateKey,previousValue:e.previousValue,newValue:e.newValue,changeSource:e.changeSource||"user-action",violatesIsolation:r};this.modalStateChangeLogs.push(i),this.modalStateChangeLogs.length>this.maxModalStateChangeLogs&&this.modalStateChangeLogs.shift(),r&&this.recordModalStateIssue({type:"isolation-violation",modalId:e.modalId,modalName:a.modalName,severity:"warning",description:`모달 '${a.modalName}'에서 격리된 상태 키 '${e.stateKey}'가 변경됨`,affectedStateKeys:[e.stateKey]})}detectStateLeakage(e){if(e.scopeType==="isolated")for(const a of e.isolatedStateKeys){const r=e.initialState[a],i=e.currentState[a];if(r!==i&&e.parentModalId){const o=this.modalStates.get(e.parentModalId);o&&o.currentState.hasOwnProperty(a)&&this.recordModalStateIssue({type:"state-leakage",modalId:e.modalId,modalName:e.modalName,severity:"error",description:`모달 닫힘 후 상태 '${a}'가 부모 모달로 유출될 수 있음`,affectedStateKeys:[a],leakedValue:i,expectedValue:r})}}}checkIsolationViolation(e,a){return e.scopeType==="isolated",!1}recordModalStateIssue(e){const a={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(a),this.modalStateIssues.length>this.maxModalStateIssues&&this.modalStateIssues.shift()}getModalStateScopeTrackingInfo(){const e=Array.from(this.modalStates.values()),a=this.getModalStateScopeStats();return{modals:e,issues:[...this.modalStateIssues],relations:[...this.modalStateRelations],changeLogs:[...this.modalStateChangeLogs],stats:a,timestamp:Date.now()}}getModalStateScopeStats(){const e=Array.from(this.modalStates.values()),a={warning:0,error:0},r={"state-leakage":0,"isolation-violation":0,"parent-mutation":0,"orphaned-state":0,"scope-mismatch":0,"cleanup-failure":0,"missing-definition":0};for(const o of this.modalStateIssues)a[o.severity]++,r[o.type]++;const i={isolated:0,shared:0,inherited:0};for(const o of e)i[o.scopeType]++;return{totalModals:e.length,openModals:e.filter(o=>o.closedAt===null).length,nestedModals:e.filter(o=>o.parentModalId!==void 0).length,totalIssues:this.modalStateIssues.length,issuesBySeverity:a,issuesByType:r,byScope:i,leakageDetectionCount:r["state-leakage"],cleanupFailureCount:r["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 a={...e,id:`named_action_ref_${++this.namedActionRefIdCounter}`};this.namedActionRefLogs.push(a),this.namedActionRefLogs.length>this.maxNamedActionRefLogs&&(this.namedActionRefLogs=this.namedActionRefLogs.slice(-this.maxNamedActionRefLogs))}getNamedActionTrackingInfo(){const e={};for(const r of this.namedActionRefLogs)e[r.actionRefName]=(e[r.actionRefName]||0)+1;const a=Object.keys(this.namedActionDefinitions).filter(r=>!e[r]);return{definitions:this.namedActionDefinitions,refLogs:[...this.namedActionRefLogs],stats:{totalDefinitions:Object.keys(this.namedActionDefinitions).length,totalRefs:this.namedActionRefLogs.length,refCountByName:e,unusedDefinitions:a},timestamp:Date.now()}}clearNamedActionTracking(){this.namedActionDefinitions={},this.namedActionRefLogs=[],this.namedActionRefIdCounter=0}trackExpressionEval(e){if(!this.config.enabled)return;const a={...e,id:`expr-${++this.expressionIdCounter}`,timestamp:Date.now(),warning:this.detectExpressionWarning(e)};this.expressionHistory.push(a),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(a)}detectExpressionWarning(e){const{expression:a,result:r,resultType:i,method:o,duration:u}=e;if(i==="undefined"&&!a.includes("??")&&!a.includes("||")&&/^[a-zA-Z_$][a-zA-Z0-9_$.]*$/.test(a.replace(/{{|}}/g,"").trim()))return{type:"undefined-result",message:"표현식 결과가 undefined입니다",suggestion:`데이터가 로드되었는지 확인하거나 fallback 값을 추가하세요: ${a} ?? ''`};if(i==="null")return{type:"null-result",message:"표현식 결과가 null입니다",suggestion:`nullish coalescing 연산자를 사용하세요: ${a} ?? ''`};if(o==="resolveBindings"&&i==="string"){const d=String(r);if(d.includes("[object Object]")||/^\[.*\]$/.test(d))return{type:"array-to-string",message:"배열/객체가 문자열로 변환되었습니다",suggestion:"evaluateExpression()을 사용하여 원본 타입을 유지하세요"}}if(o==="resolveBindings"&&i==="string"&&String(r).includes("[object Object]"))return{type:"object-to-string",message:"객체가 [object Object]로 변환되었습니다",suggestion:"evaluateExpression()을 사용하거나 특정 속성에 접근하세요"};if(i==="undefined"&&a.includes(".")&&!a.includes("?.")){const d=a.replace(/{{|}}/g,"").trim().split(".");if(d.length>=2)return{type:"missing-optional-chain",message:"Optional chaining(?.) 누락 가능성",suggestion:`안전한 접근을 위해 ?. 사용을 고려하세요: ${d.join("?.")}`}}if((a.includes("{{item.")||a.includes("{{index}}"))&&Array.from(this.iterations.values()).some(g=>g.itemVar!=="item"))return{type:"wrong-iteration-var",message:"'item'/'index' 대신 iteration에서 정의한 변수명을 사용해야 합니다",suggestion:"iteration의 item_var/index_var에 정의된 변수명을 확인하세요"};if(u&&u>10)return{type:"slow-evaluation",message:`표현식 평가에 ${u.toFixed(2)}ms 소요됨`,suggestion:"복잡한 표현식을 단순화하거나 computed 값으로 분리하세요"}}getExpressions(){return[...this.expressionHistory]}getExpressionWarnings(){return this.expressionHistory.filter(e=>e.warning!=null)}searchExpressions(e){const a=e.toLowerCase();return this.expressionHistory.filter(r=>r.expression.toLowerCase().includes(a)||r.componentName?.toLowerCase().includes(a)||r.propName?.toLowerCase().includes(a))}getExpressionStats(){const e=this.expressionHistory,a=new Set(e.map(f=>f.expression)),r=e.filter(f=>f.warning!=null),i=e.filter(f=>f.fromCache),o=e.filter(f=>f.duration!=null).map(f=>f.duration),u={};for(const f of e)u[f.resultType]=(u[f.resultType]||0)+1;const d={};for(const f of r)f.warning&&(d[f.warning.type]=(d[f.warning.type]||0)+1);return{totalEvaluations:e.length,uniqueExpressions:a.size,warningCount:r.length,cacheHitRate:e.length>0?i.length/e.length:0,averageDuration:o.length>0?o.reduce((f,g)=>f+g,0)/o.length:0,byType:u,byWarning:d}}clearExpressions(){this.expressionHistory=[],this.expressionIdCounter=0}watchExpressions(e){return this.expressionWatchers.add(e),()=>{this.expressionWatchers.delete(e)}}notifyExpressionWatchers(e){this.expressionWatchers.forEach(a=>{try{a(e)}catch(r){console.error("[G7DevTools] Expression watcher error:",r)}})}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,a=new WeakSet){if(e===null||typeof e!="object")return e;if(a.has(e))return"[Circular]";if(a.add(e),Array.isArray(e))return e.map(i=>this.sanitizeObject(i,a));const r={};for(const i of Object.keys(e))try{r[i]=this.sanitizeObject(e[i],a)}catch{r[i]="[Unable to serialize]"}return r}getNestedValue(e,a){if(!a)return e;const r=a.split(".");let i=e;for(const o of r){if(i==null)return;i=i[o]}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 a=[...this.stateHistory].reverse().find(r=>r.timestamp<=e);if(a)return{_global:a.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,a,r){if(!this.config.enabled)return;const i=r.map(u=>{if(typeof u=="string")return u;try{return JSON.stringify(u)}catch{return String(u)}}).join(" "),o={id:`log-${++this.logIdCounter}`,level:e,prefix:a,message:i,args:this.sanitizeObject(r),timestamp:Date.now(),stack:e==="error"?new Error().stack:void 0};this.logHistory.push(o),this.logHistory.length>this.maxLogHistory&&this.logHistory.shift()}trackAction(e){if(!this.config.enabled)return;const a={id:`debounce-action-${++this.debounceActionIdCounter}`,...e,timestamp:Date.now()};this.debounceActionHistory.push(a),this.debounceActionHistory.length>100&&this.debounceActionHistory.shift()}trackDataSourceUpdate(e){if(!this.config.enabled)return;const a={id:`ds-update-${++this.dataSourceUpdateIdCounter}`,...e};this.dataSourceUpdateHistory.push(a),this.dataSourceUpdateHistory.length>100&&this.dataSourceUpdateHistory.shift()}getDebounceActionHistory(e){let a=[...this.debounceActionHistory];return e?.handler&&(a=a.filter(r=>r.handler.includes(e.handler))),e?.status&&(a=a.filter(r=>r.status===e.status)),e?.limit&&(a=a.slice(-e.limit)),a}getDataSourceUpdateHistory(e){let a=[...this.dataSourceUpdateHistory];return e?.dataSourceId&&(a=a.filter(r=>r.dataSourceId===e.dataSourceId)),e?.updateType&&(a=a.filter(r=>r.updateType===e.updateType)),e?.limit&&(a=a.slice(-e.limit)),a}getLogs(e){let a=[...this.logHistory];if(e?.level){const r=Array.isArray(e.level)?e.level:[e.level];a=a.filter(i=>r.includes(i.level))}if(e?.prefix){const r=e.prefix.toLowerCase();a=a.filter(i=>i.prefix.toLowerCase().includes(r))}if(e?.search){const r=e.search.toLowerCase();a=a.filter(i=>i.message.toLowerCase().includes(r))}return e?.since&&(a=a.filter(r=>r.timestamp>=e.since)),e?.limit&&(a=a.slice(-e.limit)),a}getLogStats(){const a=Date.now()-6e4,r={log:0,warn:0,error:0,debug:0,info:0},i={};let o=0,u=0;for(const d of this.logHistory)r[d.level]++,i[d.prefix]=(i[d.prefix]||0)+1,d.timestamp>=a&&(d.level==="error"&&o++,d.level==="warn"&&u++);return{totalLogs:this.logHistory.length,byLevel:r,byPrefix:i,recentErrors:o,recentWarnings:u}}clearLogs(){this.logHistory=[],this.logIdCounter=0}getLogInfo(){return{entries:this.getLogs(),stats:this.getLogStats()}}trackDataSourceDefinition(e){this.config.enabled&&this.dataSources.set(e.id,{...e,status:"idle"})}trackDataSourceLoading(e){if(!this.config.enabled)return;const a=this.dataSources.get(e);a&&this.dataSources.set(e,{...a,status:"loading"})}trackDataSourceLoaded(e,a,r){if(!this.config.enabled)return;const i=this.dataSources.get(e);if(!i)return;let o,u,d=r;a&&(Array.isArray(a)?(o=a.length,u=a.length>0&&typeof a[0]=="object"?Object.keys(a[0]):void 0):typeof a=="object"&&(Array.isArray(a.data)?(d=d||"data",o=a.data.length,u=a.data.length>0&&typeof a.data[0]=="object"?Object.keys(a.data[0]):void 0):Array.isArray(a.items)?(d=d||"items",o=a.items.length,u=a.items.length>0&&typeof a.items[0]=="object"?Object.keys(a.items[0]):void 0):u=Object.keys(a))),this.dataSources.set(e,{...i,status:"loaded",dataPath:d,itemCount:o,keys:u,lastLoadedAt:Date.now(),error:void 0})}trackDataSourceError(e,a){if(!this.config.enabled)return;const r=this.dataSources.get(e);r&&this.dataSources.set(e,{...r,status:"error",error:a,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 a=this.dataPathTransforms.find(r=>r.dataSourceId===e.dataSourceId);a||(a={dataSourceId:e.dataSourceId,timestamp:Date.now(),transformSteps:[],warnings:[]},this.dataPathTransforms.push(a),this.dataPathTransforms.length>this.maxDataPathTransforms&&this.dataPathTransforms.shift()),a.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&&a.warnings.push(e.warning)}setDataPathFinalBinding(e,a){if(!this.config.enabled)return;const r=this.dataPathTransforms.find(i=>i.dataSourceId===e);r&&(r.finalBinding={expression:a.expression,resolvedPath:a.resolvedPath,value:this.safeClone(a.value)})}getDataPathTransformTrackingInfo(){const e=this.getDataPathTransformStats();return{transforms:[...this.dataPathTransforms],stats:e,timestamp:Date.now()}}getDataPathTransformStats(){const e=this.dataPathTransforms,a={};let r=0;const i={};for(const u of e){a[u.dataSourceId]=(a[u.dataSourceId]||0)+1,r+=u.warnings.length;for(const d of u.warnings)i[d]=(i[d]||0)+1}const o=Object.entries(i).map(([u,d])=>({warning:u,count:d})).sort((u,d)=>d.count-u.count).slice(0,10);return{totalTransforms:e.length,byDataSource:a,warningsCount:r,commonWarnings:o}}getDataPathTransformForDataSource(e){return this.dataPathTransforms.find(a=>a.dataSourceId===e)}clearDataPathTransforms(){this.dataPathTransforms=[]}trackNestedContext(e){if(!this.config.enabled)return"";const a=`nested-${++this.nestedContextIdCounter}`,r=[...new Set([...e.parentContext.available,...e.ownContext.added])],i={...e.parentContext.values,...e.ownContext.values},o={id:a,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:r,values:this.safeClone(i)},accessAttempts:[],depth:e.depth,parentId:e.parentId};return this.nestedContexts.push(o),this.nestedContexts.length>this.maxNestedContexts&&this.nestedContexts.shift(),a}trackNestedContextAccess(e,a){if(!this.config.enabled)return;const r=this.nestedContexts.find(i=>i.id===e);r&&r.accessAttempts.push({path:a.path,found:a.found,value:a.found?this.safeClone(a.value):void 0,error:a.error})}getNestedContextTrackingInfo(){const e=this.getNestedContextStats();return{contexts:[...this.nestedContexts],stats:e,timestamp:Date.now()}}getNestedContextStats(){const e=this.nestedContexts,a={expandChildren:0,cellChildren:0,iteration:0,modal:0,slot:0};let r=0,i=0;const o={};for(const d of e){a[d.componentType]++,d.depth>r&&(r=d.depth);for(const f of d.accessAttempts)f.found||(i++,o[f.path]=(o[f.path]||0)+1)}const u=Object.entries(o).map(([d,f])=>({path:d,count:f})).sort((d,f)=>f.count-d.count).slice(0,10);return{totalContexts:e.length,byType:a,maxDepth:r,failedAccessCount:i,commonFailedPaths:u}}getNestedContextForComponent(e){return this.nestedContexts.find(a=>a.componentId===e)}clearNestedContexts(){this.nestedContexts=[],this.nestedContextIdCounter=0}trackHandlerRegistration(e,a="custom",r,i){this.isEnabled&&this.handlers.set(e,{name:e,category:a,description:r,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(a=>a.category===e)}clearHandlers(){this.handlers.clear()}trackEventSubscribe(e){if(!this.isEnabled)return;const a=this.componentEventSubscriptions.get(e),r=Date.now();a?(a.subscriberCount++,a.lastSubscribedAt=r):this.componentEventSubscriptions.set(e,{eventName:e,subscriberCount:1,firstSubscribedAt:r,lastSubscribedAt:r})}trackEventUnsubscribe(e){if(!this.isEnabled)return;const a=this.componentEventSubscriptions.get(e);a&&(a.subscriberCount--,a.subscriberCount<=0&&this.componentEventSubscriptions.delete(e))}trackEventEmit(e,a,r,i,o){if(!this.isEnabled)return;const u={id:`evt_${++this.componentEventIdCounter}`,eventName:e,data:this.sanitizeForLogging(a),timestamp:Date.now(),listenerCount:r,results:i?this.sanitizeForLogging(i):void 0,hasError:!!o,errorMessage:o?.message};this.componentEventEmitHistory.push(u),this.componentEventEmitHistory.length>this.maxComponentEventHistory&&(this.componentEventEmitHistory=this.componentEventEmitHistory.slice(-this.maxComponentEventHistory))}trackEventOff(e){this.isEnabled&&this.componentEventSubscriptions.delete(e)}trackEventClear(){this.isEnabled&&this.componentEventSubscriptions.clear()}getComponentEventInfo(){const e=Array.from(this.componentEventSubscriptions.values());return{subscriptions:e,emitHistory:[...this.componentEventEmitHistory],totalSubscribers:e.reduce((a,r)=>a+r.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,a,r,i){if(!this.config.enabled)return"";const o=`setState_${++this.stateRenderingIdCounter}`;this.currentStateChangeContext={setStateId:o,startTime:performance.now(),changedPath:e,trigger:i||{},renderedComponents:[]};const u={id:`sr_${this.stateRenderingIdCounter}`,setStateId:o,statePath:e,oldValue:this.sanitizeForLogging(a),newValue:this.sanitizeForLogging(r),timestamp:Date.now(),triggeredBy:i||{},renderedComponents:[],totalRenderDuration:0,affectedBindingsCount:0};return this.stateRenderingLogs.push(u),this.stateRenderingLogs.length>this.maxStateRenderingLogs&&this.stateRenderingLogs.shift(),o}trackComponentRender(e,a,r,i=[],o=[],u){if(!this.config.enabled)return;const d=this.componentRenderCounts.get(a)||0;this.componentRenderCounts.set(a,d+1);for(const f of i)this.stateToComponentMap.has(f)||this.stateToComponentMap.set(f,new Set),this.stateToComponentMap.get(f).add(a);if(this.currentStateChangeContext){const f={componentId:e,componentName:a,renderDuration:r,accessedStatePaths:i,evaluatedBindings:o,renderOrder:this.currentStateChangeContext.renderedComponents.length,parentId:u};this.currentStateChangeContext.renderedComponents.push(f)}this.trackRender(a)}completeStateChange(e){if(!this.config.enabled||!this.currentStateChangeContext||this.currentStateChangeContext.setStateId!==e)return;const a=this.currentStateChangeContext,i=performance.now()-a.startTime,o=this.stateRenderingLogs.findIndex(u=>u.setStateId===e);if(o>=0){const u=this.stateRenderingLogs[o];u.renderedComponents=a.renderedComponents,u.totalRenderDuration=i,u.affectedBindingsCount=a.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,a=Object.fromEntries(this.componentRenderCounts),r={};for(const[i,o]of this.stateToComponentMap)r[i]=Array.from(o);return{logs:e,componentRenderCounts:a,stateToComponentMap:r,stats:this.calculateStateRenderingStats()}}calculateStateRenderingStats(){const e=this.stateRenderingLogs;if(e.length===0)return{totalStateChanges:0,totalRenders:0,avgRenderDuration:0,avgComponentsPerChange:0,topRenderedComponents:[],topInfluentialPaths:[]};const a=e.reduce((d,f)=>d+f.renderedComponents.length,0),r=e.reduce((d,f)=>d+f.totalRenderDuration,0)/e.length,i=a/e.length,o=Array.from(this.componentRenderCounts.entries()).sort((d,f)=>f[1]-d[1]).slice(0,5).map(([d,f])=>({name:d,count:f})),u=Array.from(this.stateToComponentMap.entries()).sort((d,f)=>f[1].size-d[1].size).slice(0,5).map(([d,f])=>({path:d,affectedComponents:f.size}));return{totalStateChanges:e.length,totalRenders:a,avgRenderDuration:r,avgComponentsPerChange:i,topRenderedComponents:o,topInfluentialPaths:u}}getComponentsAffectedByState(e){const a=this.stateToComponentMap.get(e);return a?Array.from(a):[]}getComponentRenderHistory(e){return this.stateRenderingLogs.filter(a=>a.renderedComponents.some(r=>r.componentName===e))}clearStateRenderingLogs(){this.stateRenderingLogs=[],this.componentRenderCounts.clear(),this.stateToComponentMap.clear(),this.currentStateChangeContext=null,this.stateRenderingIdCounter=0}trackComponentStateSource(e,a,r,i){this.config.enabled&&this.componentStateSources.set(e,{componentId:e,componentName:a,stateSource:r,stateProvider:i})}trackDynamicState(e,a){this.config.enabled&&this.dynamicStates.set(e,a)}trackContextFlow(e,a,r,i,o,u){if(!this.config.enabled)return;const d={component:a,componentId:e,contextReceived:r,passedToChildren:i,usedInRender:o};if(this.contextFlowNodes.set(e,d),u){const f=this.contextFlowNodes.get(u);f&&(f.children||(f.children=[]),f.children.push(d))}}getStateHierarchyInfo(e=!0){const a=this.buildStateHierarchyLayers(),r=this.detectStateConflicts(a),i=Array.from(this.componentStateSources.values());return{layers:e?a.map(u=>({...u,values:this.summarizeValues(u.values,2)})):a,conflicts:r,componentStateSources:i,timestamp:Date.now()}}summarizeValues(e,a,r=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(r>=a){if(Array.isArray(e))return`[Array(${e.length})]`;const u=Object.keys(e);return`{${u.slice(0,5).join(", ")}${u.length>5?`, ... +${u.length-5}`:""}}`}if(Array.isArray(e))return e.length<=3?e.map(u=>this.summarizeValues(u,a,r+1)):{__type:"array",__length:e.length,__preview:e.slice(0,3).map(u=>this.summarizeValues(u,a,r+1))};const i={},o=Object.keys(e);for(const u of o)i[u]=this.summarizeValues(e[u],a,r+1);return i}buildStateHierarchyLayers(){const e=[];try{const r=window.G7Core?.state?.get?.();if(!r)return e;r._local&&e.push({name:"Global _local",type:"global",path:"_local",values:r._local,priority:1}),r._global&&e.push({name:"Global _global",type:"global",path:"_global",values:r._global,priority:1});for(const[o,u]of this.dynamicStates)u&&Object.keys(u).length>0&&e.push({name:`DynamicState (${o})`,type:"dynamicState",componentId:o,values:u,priority:2});const i=this.computeEffectiveState(r._local||{});e.push({name:"Effective _local (merged)",type:"effective",values:i,priority:3})}catch(a){console.warn("[G7DevTools] 상태 계층 빌드 실패:",a)}return e}computeEffectiveState(e){const a={...e};for(const[,r]of this.dynamicStates)r._local&&Object.assign(a,r._local);return a}detectStateConflicts(e){const a=[],r=e.find(o=>o.type==="global"&&o.path==="_local");if(!r)return a;const i=e.filter(o=>o.type==="dynamicState");for(const o of i){const u=o.values._local||o.values;for(const[d,f]of Object.entries(u)){const g=r.values[d];if(JSON.stringify(g)!==JSON.stringify(f)){const m=[],b=[];for(const v of this.componentStateSources.values())v.stateSource.local.some(S=>S===`_local.${d}`||S===d)&&(v.stateProvider.type==="dynamicState"?m.push(v.componentName):v.stateProvider.type==="globalState"&&b.push(v.componentName));a.push({path:`_local.${d}`,globalValue:g,dynamicStateValue:f,effectiveValue:f,usedBy:m,notUsedBy:b,severity:b.length>0?"warning":"info",description:b.length>0?`${b.join(", ")}은(는) globalState._local을 읽어 dynamicState 값을 사용하지 못함`:"dynamicState 값이 globalState와 다르지만 모든 컴포넌트가 dynamicState를 사용"})}}}return a}getContextFlowInfo(){const e=[],a=new Set(this.contextFlowNodes.keys());for(const r of this.contextFlowNodes.values())if(r.children)for(const i of r.children)a.delete(i.componentId);for(const r of a){const i=this.contextFlowNodes.get(r);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,a,r,i){if(!this.config.enabled)return;const o=this.analyzeTailwindClasses(r),u={componentId:e,componentName:a,classes:r,computedStyles:i,tailwindAnalysis:o};this.componentStyles.set(e,u),this.detectStyleIssues(u)}analyzeTailwindClasses(e){const a=[],r=[],i=[],o=[],u=["sm:","md:","lg:","xl:","2xl:"],d=[/bg-\w+-\d+/,/text-\w+-\d+/,/border-\w+-\d+/];for(const f of e){o.push(f),f.startsWith("dark:")&&a.push(f);for(const g of u)if(f.startsWith(g)){r.push(f);break}for(const g of d)if(g.test(f)){i.push(f);break}}return{usedClasses:o,darkClasses:a,responsiveClasses:r,dynamicClasses:i}}detectStyleIssues(e){const{componentId:a,componentName:r,computedStyles:i,tailwindAnalysis:o}=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:a,componentName:r,property:i.opacity==="0"?"opacity":i.visibility==="hidden"?"visibility":i.display==="none"?"display":"width/height",currentValue:i.opacity==="0"?"0":i.visibility==="hidden"?"hidden":i.display==="none"?"none":"0px",severity:"warning",description:"요소가 화면에 보이지 않습니다.",suggestion:"opacity, visibility, display, width/height 값을 확인하세요."});const u=o.usedClasses.filter(f=>f.startsWith("bg-")&&!f.startsWith("dark:")),d=o.darkClasses.filter(f=>f.includes("bg-"));u.length>0&&d.length===0&&this.addStyleIssue({id:this.generateId(),type:"dark-mode-missing",componentId:a,componentName:r,property:"background-color",currentValue:u.join(", "),expectedValue:"dark:bg-* 클래스 필요",severity:"info",description:"다크 모드 배경색 클래스가 누락되었습니다.",suggestion:`${u[0]}에 대응하는 dark: 클래스를 추가하세요.`}),o.dynamicClasses.length>0&&this.addStyleIssue({id:this.generateId(),type:"tailwind-purging",componentId:a,componentName:r,property:"class",currentValue:o.dynamicClasses.join(", "),severity:"info",description:"동적으로 생성된 Tailwind 클래스가 있습니다.",suggestion:"tailwind.config.js의 safelist에 추가하거나 전체 클래스명을 상수로 정의하세요."})}addStyleIssue(e){this.styleIssues.some(r=>r.componentId===e.componentId&&r.type===e.type&&r.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(a=>a.type==="invisible-element").length,tailwindIssueCount:this.styleIssues.filter(a=>a.type==="tailwind-purging").length,darkModeIssueCount:this.styleIssues.filter(a=>a.type==="dark-mode-missing").length},timestamp:Date.now()}}clearStyleValidationData(){this.styleIssues=[],this.componentStyles.clear()}trackAuthEvent(e,a,r,i){if(!this.config.enabled)return;const o={id:`auth_${++this.authEventIdCounter}`,type:e,timestamp:Date.now(),success:a,error:r,details:i};this.authEvents.push(o),this.authEvents.length>this.maxAuthEventHistory&&(this.authEvents=this.authEvents.slice(-this.maxAuthEventHistory))}trackAuthHeader(e,a,r,i,o){if(!this.config.enabled)return;const u={url:e,hasAuthHeader:a,headerType:r,tokenValid:i??!1,responseStatus:o,timestamp:Date.now()};this.authHeaderHistory.push(u),this.authHeaderHistory.length>this.maxAuthEventHistory&&(this.authHeaderHistory=this.authHeaderHistory.slice(-this.maxAuthEventHistory)),o===401&&this.trackAuthEvent("api-unauthorized",!1,`401 Unauthorized: ${e}`,{url:e})}getAuthState(){try{const e=window.G7Core,a=e?.api;let r=e?.auth;!r&&e?.AuthManager?.getInstance&&(r=e.AuthManager.getInstance());const i=a?.getToken?.()||r?.getAccessToken?.()||localStorage.getItem("auth_token")||localStorage.getItem("access_token"),o=r?.getRefreshToken?.()||localStorage.getItem("refresh_token");let u="unknown",d=r?.getUser?.();if(d&&(u="AuthManager"),!d){const E=e?.state?.get?.();d=E?._global?.user||E?._global?.currentUser||E?.user||E?.currentUser,d&&(u="G7Core.state")}const f=r?.isAuthenticated?.()??!1;let g="memory";localStorage.getItem("auth_token")||localStorage.getItem("access_token")?g="localStorage":(sessionStorage.getItem("auth_token")||sessionStorage.getItem("access_token"))&&(g="sessionStorage");const m=!!i&&(!!d||f);let b;i&&typeof i=="string"&&i.length>20?b=`${i.substring(0,10)}...${i.substring(i.length-6)}`:i&&(b="***");const v=d?{id:d.id,email:d.email,name:d.name,roles:d.roles?.map(E=>typeof E=="string"?{name:E}:{id:E.id,name:E.name,guard_name:E.guard_name}),permissions:d.permissions?.map(E=>typeof E=="string"?{name:E}:{id:E.id,name:E.name,guard_name:E.guard_name}),avatar:d.avatar||d.profile_photo_url||d.profile_image,created_at:d.created_at,updated_at:d.updated_at,last_login_at:d.last_login_at,email_verified_at:d.email_verified_at,...d.phone&&{phone:d.phone},...d.nickname&&{nickname:d.nickname},...d.status&&{status:d.status},...d.locale&&{locale:d.locale}}:void 0;return{isAuthenticated:m,user:v,tokens:{hasAccessToken:!!i,hasRefreshToken:!!o,storage:g,accessTokenPreview:b},lastActivity:Date.now(),source:u}}catch{return{isAuthenticated:!1,tokens:{hasAccessToken:!1,hasRefreshToken:!1,storage:"memory"},source:"unknown"}}}getAuthDebugInfo(){const e=[...this.authEvents];return{state:this.getAuthState(),events:e,headerAnalysis:[...this.authHeaderHistory],stats:{loginAttempts:e.filter(a=>a.type==="login").length,successfulLogins:e.filter(a=>a.type==="login"&&a.success).length,failedLogins:e.filter(a=>a.type==="login"&&!a.success).length,tokenRefreshes:e.filter(a=>a.type==="token-refresh").length,unauthorizedResponses:e.filter(a=>a.type==="api-unauthorized").length},timestamp:Date.now()}}clearAuthData(){this.authEvents=[],this.authHeaderHistory=[],this.authEventIdCounter=0}trackLayoutLoad(e,a,r,i="api"){if(!this.config.enabled)return;const o=Date.now();this.currentLayout={layoutPath:e,templateId:a,layoutJson:this.sanitizeObject(r),loadedAt:o,version:r.version,layoutName:r.layout_name,source:i};const u={id:`layout-${++this.layoutIdCounter}`,layoutPath:e,templateId:a,loadedAt:o,source:i,version:r.version};this.layoutHistory.push(u),this.layoutHistory.length>this.maxLayoutHistory&&this.layoutHistory.shift(),this.layoutStats.totalLoads++,i==="cache"?this.layoutStats.cacheHits++:this.layoutStats.apiLoads++}getCurrentLayout(){return this.currentLayout}getLayoutHistory(){return[...this.layoutHistory]}getLayoutDebugInfo(){return{current:this.currentLayout,history:[...this.layoutHistory],stats:{...this.layoutStats}}}clearLayoutData(){this.currentLayout=null,this.layoutHistory=[],this.layoutIdCounter=0,this.layoutStats={totalLoads:0,cacheHits:0,apiLoads:0}}startHandlerExecution(e){if(!this.config.enabled)return"";const a=`exec_${++this.executionIdCounter}_${Date.now()}`,r={handlerName:e,executionId:a,startTime:Date.now(),stateChanges:[],dataSourceChanges:[],alerts:[]};if(this.executionDetails.set(a,r),this.executionDetails.size>this.maxExecutionDetails){const i=Array.from(this.executionDetails.keys());i.slice(0,i.length-this.maxExecutionDetails).forEach(u=>this.executionDetails.delete(u))}return a}endHandlerExecution(e,a,r,i){if(!this.config.enabled||!e)return;const o=this.executionDetails.get(e);if(!o)return;o.endTime=Date.now(),o.duration=o.endTime-o.startTime,o.exitReason=a,o.exitLocation=r,o.exitDescription=i;const u=this.changeExpectations.get(e);u&&(o.expectedChanges=u,this.checkExpectations(e,o,u),this.changeExpectations.delete(e)),a==="normal"&&o.stateChanges.length===0&&o.dataSourceChanges.length===0&&this.addChangeAlert(e,{type:"no-state-change",severity:"warning",message:`핸들러 "${o.handlerName}"이(가) 상태 변경 없이 완료됨`,description:"핸들러가 성공적으로 완료되었지만 상태나 데이터소스 변경이 없습니다. 의도한 동작인지 확인하세요.",handlerName:o.handlerName,suggestion:'핸들러 내부 조건문을 확인하거나 DevTools의 "변경감지" 탭에서 exitLocation을 확인하세요.',docLink:"troubleshooting-state.md"}),(a==="early-return-condition"||a==="early-return-validation")&&this.addChangeAlert(e,{type:"early-return-detected",severity:"info",message:`핸들러 "${o.handlerName}"이(가) early return으로 종료됨`,description:i||`종료 위치: ${r||"알 수 없음"}`,handlerName:o.handlerName,suggestion:a==="early-return-validation"?"검증 실패로 인한 early return입니다. 입력 데이터를 확인하세요.":"조건부 early return입니다. 조건문의 평가 결과를 확인하세요."})}recordExitReason(e,a,r,i){if(!this.config.enabled||!e)return;const o=this.executionDetails.get(e);o&&(o.exitReason=a,o.exitLocation=r,o.exitDescription=i)}recordStateChange(e,a,r,i,o){if(!this.config.enabled)return;const u={id:`sc_${++this.stateChangeIdCounter}`,path:a,changeType:r,oldValue:this.safeClone(i),newValue:this.safeClone(o),timestamp:Date.now(),comparison:this.compareValues(i,o),executionId:e};if(this.stateChangeHistory.push(u),e){const d=this.executionDetails.get(e);d&&d.stateChanges.push(u)}this.stateChangeHistory.length>this.maxStateChangeHistory&&this.stateChangeHistory.splice(0,this.stateChangeHistory.length-this.maxStateChangeHistory),u.comparison.isDeepEqual&&typeof i=="object"&&i!==null&&this.addChangeAlert(e||"",{type:"object-reference-same",severity:"warning",message:`상태 "${a}"가 변경되었으나 값이 동일함`,description:"객체 참조가 동일하거나 깊은 비교 결과 변경이 없습니다. 변경 감지가 실패할 수 있습니다.",handlerName:e&&this.executionDetails.get(e)?.handlerName||"unknown",statePath:a,suggestion:"불변성을 유지하여 새 객체를 생성하세요. 예: { ...oldObject, newField: value }",docLink:"troubleshooting-state.md#object-mutation"})}recordDataSourceChange(e,a,r,i,o){if(!this.config.enabled)return;const u={dataSourceId:a,changeType:r,timestamp:Date.now(),previousStatus:i,newStatus:o,executionId:e};if(this.dataSourceChangeHistory.push(u),e){const d=this.executionDetails.get(e);d&&d.dataSourceChanges.push(u)}this.dataSourceChangeHistory.length>this.maxStateChangeHistory&&this.dataSourceChangeHistory.splice(0,this.dataSourceChangeHistory.length-this.maxStateChangeHistory)}expectChange(e,a,r){if(!this.config.enabled||!e)return;const i=this.executionDetails.get(e);if(!i)return;const o={expectedStatePaths:a,expectedDataSources:r,setAt:Date.now(),source:i.handlerName};this.changeExpectations.set(e,o)}checkExpectations(e,a,r){const i=new Set(a.stateChanges.map(u=>u.path)),o=new Set(a.dataSourceChanges.map(u=>u.dataSourceId));for(const u of r.expectedStatePaths)i.has(u)||this.addChangeAlert(e,{type:"expected-not-fulfilled",severity:"error",message:`기대한 상태 변경 "${u}"가 발생하지 않음`,description:`핸들러 "${a.handlerName}"이(가) "${u}" 변경을 예고했지만 실제로 변경되지 않았습니다.`,handlerName:a.handlerName,statePath:u,suggestion:"핸들러 내부 로직을 확인하세요. early return이나 조건부 분기로 인해 변경이 생략되었을 수 있습니다.",docLink:"troubleshooting-state.md"});for(const u of r.expectedDataSources)o.has(u)||this.addChangeAlert(e,{type:"expected-not-fulfilled",severity:"error",message:`기대한 데이터소스 갱신 "${u}"가 발생하지 않음`,description:`핸들러 "${a.handlerName}"이(가) "${u}" 갱신을 예고했지만 실제로 갱신되지 않았습니다.`,handlerName:a.handlerName,dataSourceId:u,suggestion:"refetchDataSource 호출이 실행되었는지 확인하세요.",docLink:"data-sources.md"})}addChangeAlert(e,a){const r={...a,id:`alert_${++this.alertIdCounter}`,timestamp:Date.now()};if(this.changeAlerts.push(r),e){const i=this.executionDetails.get(e);i&&i.alerts.push(r)}this.changeAlerts.length>this.maxChangeAlerts&&this.changeAlerts.splice(0,this.changeAlerts.length-this.maxChangeAlerts)}compareValues(e,a){const r=this.getValueType(e),i=this.getValueType(a),o=r!==i;let u=!1,d;return!o&&(r==="object"||r==="array")?(u=this.deepEqual(e,a),!u&&r==="object"&&(d=this.getChangedKeys(e,a))):u=e===a,{typeChanged:o,oldType:r,newType:i,isDeepEqual:u,changedKeys:d}}getValueType(e){return e===null?"null":e===void 0?"undefined":Array.isArray(e)?"array":typeof e}deepEqual(e,a){if(e===a)return!0;if(typeof e!=typeof a)return!1;if(e===null||a===null||typeof e!="object")return e===a;if(Array.isArray(e)!==Array.isArray(a))return!1;const r=Object.keys(e),i=Object.keys(a);if(r.length!==i.length)return!1;for(const o of r)if(!i.includes(o)||!this.deepEqual(e[o],a[o]))return!1;return!0}getChangedKeys(e,a){const r=[],i=new Set([...Object.keys(e),...Object.keys(a)]);for(const o of i)this.deepEqual(e[o],a[o])||r.push(o);return r}getChangeDetectionInfo(){const e=Array.from(this.executionDetails.values()),a={totalExecutions:e.length,executionsWithStateChange:e.filter(r=>r.stateChanges.length>0).length,executionsWithoutStateChange:e.filter(r=>r.stateChanges.length===0&&r.exitReason==="normal").length,earlyReturnCount:e.filter(r=>r.exitReason==="early-return-condition"||r.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:a,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 a of this.changeAlerts)e[a.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,a){let r=[...this.changeAlerts];return a&&(r=r.filter(i=>i.severity===a)),r.slice(-e)}getHandlerExecutions(e,a=10){return Array.from(this.executionDetails.values()).filter(i=>i.handlerName===e).slice(-a)}findExecutionInStack(e){return this.sequenceExecutionStack.find(a=>a.sequenceId===e)}startSequenceExecution(e){if(!this.config.enabled)return"";const a=`seq_${++this.sequenceIdCounter}_${Date.now()}`,r={sequenceId:a,startTime:Date.now(),totalDuration:0,trigger:e,actions:[],status:"running"};return this.sequenceExecutionStack.push(r),a}captureSequenceActionBefore(e,a,r,i,o){if(!this.config.enabled)return;const u=this.findExecutionInStack(e);if(!u)return;const d={index:a,handler:r,params:this.safeClone(i),stateBeforeAction:{_global:this.safeClone(o._global),_local:this.safeClone(o._local),_isolated:o._isolated?this.safeClone(o._isolated):void 0},stateAfterAction:{_global:{},_local:{}},duration:0,status:"success"};u.actions.push(d)}captureSequenceActionAfter(e,a,r,i,o,u){if(!this.config.enabled)return;const d=this.findExecutionInStack(e);if(!d)return;const f=d.actions.find(m=>m.index===a);if(!f)return;f.stateAfterAction={_global:this.safeClone(r._global),_local:this.safeClone(r._local),_isolated:r._isolated?this.safeClone(r._isolated):void 0},f.duration=i,f.result=this.safeClone(o),f.stateDiff={global:this.computeStateDiff(f.stateBeforeAction._global,f.stateAfterAction._global),local:this.computeStateDiff(f.stateBeforeAction._local,f.stateAfterAction._local)},f.stateBeforeAction._isolated&&f.stateAfterAction._isolated&&(f.stateDiff.isolated=this.computeStateDiff(f.stateBeforeAction._isolated,f.stateAfterAction._isolated));const g=window.__g7PendingLocalState;g&&(f.pendingState=this.safeClone(g)),u&&(f.status="error",f.error={name:u.name,message:u.message,stack:u.stack})}endSequenceExecution(e,a){if(!this.config.enabled)return;const r=this.sequenceExecutionStack.findIndex(o=>o.sequenceId===e);if(r===-1)return;const i=this.sequenceExecutionStack[r];if(i.endTime=Date.now(),i.totalDuration=i.endTime-i.startTime,a){i.status="error",i.error={name:a.name,message:a.message,stack:a.stack};const o=i.actions.find(u=>u.status==="error");o&&(i.failedAtIndex=o.index)}else i.status="success";this.sequenceExecutions.push(i),this.sequenceExecutions.length>this.maxSequenceExecutions&&this.sequenceExecutions.shift(),this.sequenceExecutionStack.splice(r,1)}computeStateDiff(e,a){const r=[],i=[],o=[],u=new Set(Object.keys(e)),d=new Set(Object.keys(a));for(const f of d)u.has(f)||r.push(f);for(const f of u)d.has(f)||i.push(f);for(const f of u)if(d.has(f)){const g=e[f],m=a[f];JSON.stringify(g)!==JSON.stringify(m)&&o.push({path:f,oldValue:g,newValue:m})}return{added:r,removed:i,changed:o}}getSequenceTrackingInfo(){const e=this.getSequenceStats(),a=this.sequenceExecutionStack.length>0?this.sequenceExecutionStack[this.sequenceExecutionStack.length-1]:void 0;return{executions:[...this.sequenceExecutions],currentExecution:a,stats:e}}getSequenceStats(){const e=this.sequenceExecutions,a=e.length,r=e.filter(g=>g.status==="success").length,i=e.filter(g=>g.status==="error").length,o=e.reduce((g,m)=>g+m.actions.length,0),u=a>0?e.reduce((g,m)=>g+m.totalDuration,0)/a:0,d={};for(const g of e)for(const m of g.actions)d[m.handler]=(d[m.handler]||0)+1;const f=Object.entries(d).sort(([,g],[,m])=>m-g).slice(0,5).map(([g,m])=>({handler:g,count:m}));return{totalExecutions:a,successCount:r,errorCount:i,totalActions:o,avgDuration:u,topHandlers:f}}clearSequenceData(){this.sequenceExecutions=[],this.sequenceExecutionStack=[],this.sequenceIdCounter=0}getSequenceExecution(e){const a=this.findExecutionInStack(e);return a||this.sequenceExecutions.find(r=>r.sequenceId===e)}getRecentSequences(e=10){return this.sequenceExecutions.slice(-e)}registerStateCaptureForHandler(e,a,r){if(!this.config.enabled)return;const i=new Map,o=Date.now();for(const u of a)i.set(u,{value:this.safeClone(r[u]),capturedAt:o});this.stateCaptureRegistry.set(e,i)}detectStaleClosure(e,a,r,i,o){if(!this.config.enabled)return[];const u=this.stateCaptureRegistry.get(e);if(!u)return[];const d=Date.now(),f=[];for(const[g,m]of u){const b=this.getValueByPath(r,g),v=d-m.capturedAt;if(!this.isDeepEqual(m.value,b)&&v>0){const E=this.createStaleClosureWarning(i,a,g,m.value,m.capturedAt,b,d,v,o);f.push(E),this.addStaleClosureWarning(E)}}return this.stateCaptureRegistry.delete(e),f}trackStaleClosureWarning(e){if(!this.config.enabled)return;const a=Date.now(),r=this.createStaleClosureWarning(e.type,e.location,e.capturedPath,e.capturedValue,e.capturedAt,e.currentValue,a,a-e.capturedAt,e.actionId,e.stackTrace);this.addStaleClosureWarning(r)}createStaleClosureWarning(e,a,r,i,o,u,d,f,g,m){const b=this.getStaleClosureSeverity(e,f),{description:v,suggestion:E,docLink:S}=this.getStaleClosureMessages(e,r,f);return{id:`stale_${++this.staleClosureIdCounter}_${Date.now()}`,timestamp:Date.now(),type:e,location:a,capturedState:{path:r,capturedValue:this.safeClone(i),capturedAt:o},currentState:{path:r,currentValue:this.safeClone(u),retrievedAt:d},timeDiff:f,severity:b,description:v,suggestion:E,docLink:S,actionId:g,stackTrace:m}}getStaleClosureSeverity(e,a){if(a>5e3)return"error";if(a>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,a,r){const i=r<1e3?`${r}ms`:`${(r/1e3).toFixed(1)}s`;switch(e){case"async-state-capture":return{description:`await 후 ${i} 경과 시점에 '${a}' 상태가 변경됨. 캡처된 상태 대신 최신 상태를 사용해야 함`,suggestion:"await 이후에는 G7Core.state.get()으로 최신 상태를 다시 조회하거나, useRef + getter 패턴을 사용하세요",docLink:"troubleshooting-state-closure.md"};case"callback-state-capture":return{description:`콜백에서 ${i} 전에 캡처된 '${a}' 상태를 사용 중. 최신 상태와 다름`,suggestion:"콜백에서 상태를 참조할 때는 stateRef.current 패턴 또는 G7Core.state.get()를 사용하세요",docLink:"troubleshooting-state-closure.md"};case"timeout-state-capture":return{description:`setTimeout/setInterval 콜백에서 '${a}' 상태가 ${i} 전 값 사용 중`,suggestion:"타이머 콜백 내에서는 G7Core.state.get()으로 최신 상태를 조회하세요",docLink:"troubleshooting-state-closure.md"};case"sequence-state-mismatch":return{description:`sequence 내 '${a}' 상태가 이전 액션 결과와 불일치. context.state 대신 캡처된 값 사용 의심`,suggestion:"sequence 내에서는 context.state 또는 $prev를 사용하여 최신 상태를 참조하세요",docLink:"troubleshooting-state-setstate.md"};case"event-handler-stale":return{description:`이벤트 핸들러에서 ${i} 전에 바인딩된 '${a}' 상태 사용 중`,suggestion:"이벤트 핸들러에서 상태를 참조할 때는 useRef 패턴 또는 G7Core.state.get()를 사용하세요",docLink:"troubleshooting-state-closure.md"};default:return{description:`'${a}' 상태에서 stale closure 감지됨 (${i} 경과)`,suggestion:"상태 참조 시 최신 값을 사용하는지 확인하세요"}}}addStaleClosureWarning(e){this.staleClosureWarnings.push(e),this.staleClosureWarnings.length>this.maxStaleClosureWarnings&&this.staleClosureWarnings.shift()}getValueByPath(e,a){const r=a.split(".");let i=e;for(const o of r){if(i==null)return;i=i[o]}return i}isDeepEqual(e,a){if(e===a)return!0;if(e===null||a===null)return e===a;if(typeof e!=typeof a)return!1;if(typeof e!="object")return e===a;try{return JSON.stringify(e)===JSON.stringify(a)}catch{return!1}}getStaleClosureTrackingInfo(){const e=this.getStaleClosureStats();return{warnings:[...this.staleClosureWarnings],stats:e,timestamp:Date.now()}}getStaleClosureStats(){const e=this.staleClosureWarnings,a={"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)a[f.type]++;const r={info:0,warning:0,error:0};for(const f of e)r[f.severity]++;const i={};for(const f of e)i[f.location]=(i[f.location]||0)+1;const o=Object.entries(i).sort(([,f],[,g])=>g-f).slice(0,5).map(([f,g])=>({location:f,count:g})),u={};for(const f of e)u[f.capturedState.path]=(u[f.capturedState.path]||0)+1;const d=Object.entries(u).sort(([,f],[,g])=>g-f).slice(0,5).map(([f,g])=>({path:f,count:g}));return{totalWarnings:e.length,warningsByType:a,warningsBySeverity:r,topLocations:o,topAffectedPaths:d}}clearStaleClosureData(){this.staleClosureWarnings=[],this.staleClosureIdCounter=0,this.stateCaptureRegistry.clear()}getRecentStaleClosureWarnings(e=10,a){let r=[...this.staleClosureWarnings];return a&&(r=r.filter(i=>i.severity===a)),r.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(r=>{try{return JSON.parse(JSON.stringify(r))}catch{return"[Unserializable]"}});const a={};for(const r of Object.keys(e))try{a[r]=JSON.parse(JSON.stringify(e[r]))}catch{a[r]="[Unserializable]"}return a}}};$(mi,"instance");let Tr=mi;const Un=dt("LayoutLoader");class va extends Error{constructor(e,a,r){super(e),this.code=a,this.details=r,this.name="LayoutLoaderError"}}class Ud{constructor(e){$(this,"componentRegistry");$(this,"currentLayout",null);$(this,"layoutCache",new Map);$(this,"cacheVersion",0);this.componentRegistry=e}setCacheVersion(e){this.cacheVersion!==e&&(Un.log("Cache version updated:",this.cacheVersion,"->",e),this.cacheVersion=e,this.layoutCache.clear())}getCacheVersion(){return this.cacheVersion}async loadLayout(e,a){const r=`${e}:${a}`;if(this.layoutCache.has(r)){Un.log("Loading layout from cache:",a);const o=await this.layoutCache.get(r),u=JSON.parse(JSON.stringify(o));return this.currentLayout=u,Tr.getInstance().trackLayoutLoad(a,e,u,"cache"),u}const i=this.fetchLayout(e,a);return this.layoutCache.set(r,i),i}async fetchLayout(e,a,r=!1){try{let i;a.startsWith("__preview__/")?i=`/api/layouts/preview/${a.replace("__preview__/","")}.json`:i=`/api/layouts/${e}/${a}.json`;const o=this.cacheVersion>0?`${i}?v=${this.cacheVersion}`:i;Un.log("Fetching layout from API:",o);const u=$a(),d=r?null:u.getToken(),f={Accept:"application/json"};d&&(f.Authorization=`Bearer ${d}`);const g=await fetch(o,{headers:f});let m;try{m=await g.json()}catch{m=null}if(!g.ok){if(g.status===401&&!r&&d){Un.log("Token invalid, removing and retrying without token"),u.removeToken();try{return await this.fetchLayout(e,a,!0)}catch(E){throw E instanceof va&&E.details?.status===401?new va(E.message,E.code,{...E.details,hadToken:!0}):E}}const v=m?.message||m?.error;throw new va(`Failed to fetch layout: ${g.status} ${g.statusText}`,"FETCH_FAILED",{status:g.status,statusText:g.statusText,url:o,apiMessage:v})}const b=m.data||m;return this.validateLayoutData(b),this.currentLayout=b,Tr.getInstance().trackLayoutLoad(a,e,b,"api"),Un.log("Layout fetched and cached successfully:",b.layout_name),b}catch(i){const o=`${e}:${a}`;throw this.layoutCache.delete(o),i instanceof va?i:new va("Failed to load layout","LOAD_FAILED",{originalError:i})}}prefetchLayout(e,a){return this.loadLayout(e,a)}validateLayoutData(e){if(!e.version)throw new va("Layout data missing required field: version","VALIDATION_FAILED",{field:"version"});if(!e.layout_name)throw new va("Layout data missing required field: layout_name","VALIDATION_FAILED",{field:"layout_name"});if(!Array.isArray(e.components))throw new va('Layout data field "components" must be an array',"VALIDATION_FAILED",{field:"components",value:e.components});Un.log("Layout data validation passed")}renderLayout(e,a){try{const r=a||this.currentLayout;if(!r)throw new va("No layout data to render","NO_LAYOUT_DATA");Un.log("Rendering layout:",r.layout_name),e.innerHTML="",this.renderComponents(e,r.components),Un.log("Layout rendered successfully")}catch(r){Un.error("Render error:",r),this.renderErrorState(e,r)}}renderComponents(e,a){for(const r of a){const i=this.renderComponent(r);i&&e.appendChild(i)}}renderComponent(e){try{if(!this.componentRegistry.getComponent(e.type))return Un.warn(`Component not found: ${e.type}`),this.createPlaceholderElement(e.type);const r=document.createElement("div");return r.setAttribute("data-component",e.type),e.props&&Object.entries(e.props).forEach(([i,o])=>{r.setAttribute(`data-prop-${i}`,JSON.stringify(o))}),e.children&&e.children.length>0?this.renderComponents(r,e.children):e.text&&(r.textContent=e.text),r}catch(a){return Un.error(`Error rendering component ${e.type}:`,a),this.createErrorElement(e.type,a)}}createPlaceholderElement(e){const a=document.createElement("div");return a.className="component-placeholder",a.setAttribute("data-component-type",e),a.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>
`,a}createErrorElement(e,a){const r=document.createElement("div");return r.className="component-error",r.setAttribute("data-component-type",e),r.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;">${a?.message||"Unknown error"}</p>
</div>
`,r}renderErrorState(e,a){const r=a instanceof Error?a.message:String(a),i=a instanceof va?a.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;
">${r}</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>
`,Un.error("Error state rendered:",i,r)}getCurrentLayout(){return this.currentLayout}clear(){this.currentLayout=null,this.layoutCache.clear(),Un.log("Layout data and cache cleared")}}const vE=dt("TranslationContext"),Bd=N.createContext(null),uc=({children:l,translationEngine:e,translationContext:a})=>{const r=N.useMemo(()=>(o,u)=>{if(u){const d="|"+Object.entries(u).map(([f,g])=>`${f}=${g}`).join("|");return e.translate(o,a,d)}return e.translate(o,a)},[e,a]),i=N.useMemo(()=>({translationEngine:e,translationContext:a,t:r}),[e,a,r]);return ct.jsx(Bd.Provider,{value:i,children:l})},vm=()=>{const l=N.useContext(Bd);return l||(vE.warn("TranslationProvider 외부에서 호출되었습니다. 키를 그대로 반환합니다."),{t:e=>e,translationEngine:null,translationContext:null})},kr=dt("SlotContext"),SE={registerToSlot:()=>{kr.warn("SlotContext not available: registerToSlot called outside SlotProvider")},unregisterFromSlot:()=>{kr.warn("SlotContext not available: unregisterFromSlot called outside SlotProvider")},getSlotComponents:()=>[],subscribeToSlot:()=>()=>{},clearAllSlots:()=>{},isEnabled:!1},wE=N.createContext(SE),qd=({children:l})=>{const e=N.useRef(new Map),a=N.useRef(new Map),r=N.useCallback(m=>{const b=a.current.get(m);b&&b.forEach(v=>{try{v()}catch(E){kr.error(`Slot subscriber error (slotId: ${m}):`,E)}})},[]),i=N.useCallback((m,b,v)=>{if(!m||!b){kr.warn("registerToSlot: slotId and componentId are required");return}e.current.has(m)||e.current.set(m,new Map);const E=e.current.get(m),S=E.get(b);S&&S.registrationKey===v.registrationKey||(E.set(b,v),kr.log(`Component registered to slot: ${b} -> ${m} (order: ${v.order})`),r(m))},[r]),o=N.useCallback((m,b)=>{const v=e.current.get(m);v&&v.has(b)&&(v.delete(b),kr.log(`Component unregistered from slot: ${b} <- ${m}`),v.size===0&&e.current.delete(m),r(m))},[r]),u=N.useCallback(m=>{const b=e.current.get(m);return b?Array.from(b.values()).sort((v,E)=>v.order-E.order):[]},[]),d=N.useCallback((m,b)=>{a.current.has(m)||a.current.set(m,new Set);const v=a.current.get(m);return v.add(b),()=>{v.delete(b),v.size===0&&a.current.delete(m)}},[]),f=N.useCallback(()=>{e.current.forEach((m,b)=>{r(b)}),e.current.clear(),a.current.clear(),kr.log("All slots cleared")},[r]),g=N.useMemo(()=>({registerToSlot:i,unregisterFromSlot:o,getSlotComponents:u,subscribeToSlot:d,clearAllSlots:f,isEnabled:!0}),[i,o,u,d,f]);return N.useLayoutEffect(()=>{typeof window<"u"&&(window.__slotContextValue=g,kr.log("SlotContext exposed to window.__slotContextValue"))},[g]),ct.jsx(wE.Provider,{value:g,children:l})};class Pd{constructor(){this.notificationCreatedEvent=".Illuminate\\Notifications\\Events\\BroadcastNotificationCreated"}listenForWhisper(e,a){return this.listen(".client-"+e,a)}notification(e){return this.listen(this.notificationCreatedEvent,e)}stopListeningForNotification(e){return this.stopListening(this.notificationCreatedEvent,e)}stopListeningForWhisper(e,a){return this.stopListening(".client-"+e,a)}}class Sm{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 CE(l){try{new l}catch(e){if(e instanceof Error&&e.message.includes("is not a constructor"))return!1}return!0}class Gd extends Pd{constructor(e,a,r){super(),this.name=a,this.pusher=e,this.options=r,this.eventFormatter=new Sm(this.options.namespace),this.subscribe()}subscribe(){this.subscription=this.pusher.subscribe(this.name)}unsubscribe(){this.pusher.unsubscribe(this.name)}listen(e,a){return this.on(this.eventFormatter.format(e),a),this}listenToAll(e){return this.subscription.bind_global((a,r)=>{if(a.startsWith("pusher:"))return;let i=String(this.options.namespace??"").replace(/\./g,"\\"),o=a.startsWith(i)?a.substring(i.length+1):"."+a;e(o,r)}),this}stopListening(e,a){return a?this.subscription.unbind(this.eventFormatter.format(e),a):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",a=>{e(a)}),this}on(e,a){return this.subscription.bind(e,a),this}}class wm extends Gd{whisper(e,a){return this.pusher.channels.channels[this.name].trigger(`client-${e}`,a),this}}class EE extends Gd{whisper(e,a){return this.pusher.channels.channels[this.name].trigger(`client-${e}`,a),this}}class _E extends wm{here(e){return this.on("pusher:subscription_succeeded",a=>{e(Object.keys(a.members).map(r=>a.members[r]))}),this}joining(e){return this.on("pusher:member_added",a=>{e(a.info)}),this}whisper(e,a){return this.pusher.channels.channels[this.name].trigger(`client-${e}`,a),this}leaving(e){return this.on("pusher:member_removed",a=>{e(a.info)}),this}}class Cm extends Pd{constructor(e,a,r){super(),this.events={},this.listeners={},this.name=a,this.socket=e,this.options=r,this.eventFormatter=new Sm(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,a){return this.on(this.eventFormatter.format(e),a),this}stopListening(e,a){return this.unbindEvent(this.eventFormatter.format(e),a),this}subscribed(e){return this.on("connect",a=>{e(a)}),this}error(e){return this}on(e,a){return this.listeners[e]=this.listeners[e]||[],this.events[e]||(this.events[e]=(r,i)=>{this.name===r&&this.listeners[e]&&this.listeners[e].forEach(o=>o(i))},this.socket.on(e,this.events[e])),this.listeners[e].push(a),this}unbind(){Object.keys(this.events).forEach(e=>{this.unbindEvent(e)})}unbindEvent(e,a){this.listeners[e]=this.listeners[e]||[],a&&(this.listeners[e]=this.listeners[e].filter(r=>r!==a)),(!a||this.listeners[e].length===0)&&(this.events[e]&&(this.socket.removeListener(e,this.events[e]),delete this.events[e]),delete this.listeners[e])}}class Em extends Cm{whisper(e,a){return this.socket.emit("client event",{channel:this.name,event:`client-${e}`,data:a}),this}}class AE extends Em{here(e){return this.on("presence:subscribed",a=>{e(a.map(r=>r.user_info))}),this}joining(e){return this.on("presence:joining",a=>e(a.user_info)),this}whisper(e,a){return this.socket.emit("client event",{channel:this.name,event:`client-${e}`,data:a}),this}leaving(e){return this.on("presence:leaving",a=>e(a.user_info)),this}}class dc extends Pd{subscribe(){}unsubscribe(){}listen(e,a){return this}listenToAll(e){return this}stopListening(e,a){return this}subscribed(e){return this}error(e){return this}on(e,a){return this}}class _m extends dc{whisper(e,a){return this}}class xE extends dc{whisper(e,a){return this}}class TE extends _m{here(e){return this}joining(e){return this}whisper(e,a){return this}leaving(e){return this}}const Am=class aS{constructor(e){this.setOptions(e),this.connect()}setOptions(e){this.options={...aS._defaultOptions,...e,broadcaster:e.broadcaster};let a=this.csrfToken();a&&(this.options.auth.headers["X-CSRF-TOKEN"]=a,this.options.userAuthentication.headers["X-CSRF-TOKEN"]=a),a=this.options.bearerToken,a&&(this.options.auth.headers.Authorization="Bearer "+a,this.options.userAuthentication.headers.Authorization="Bearer "+a)}csrfToken(){var e,a;return typeof window<"u"&&(e=window.Laravel)!=null&&e.csrfToken?window.Laravel.csrfToken:this.options.csrfToken?this.options.csrfToken:typeof document<"u"&&typeof document.querySelector=="function"?((a=document.querySelector('meta[name="csrf-token"]'))==null?void 0:a.getAttribute("content"))??null:null}};Am._defaultOptions={auth:{headers:{}},authEndpoint:"/broadcasting/auth",userAuthentication:{endpoint:"/broadcasting/user-auth",headers:{}},csrfToken:null,bearerToken:null,host:null,key:null,namespace:"App.Events"};let Vd=Am;class fc extends Vd{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,a,r){return this.channel(e).listen(a,r)}channel(e){return this.channels[e]||(this.channels[e]=new Gd(this.pusher,e,this.options)),this.channels[e]}privateChannel(e){return this.channels["private-"+e]||(this.channels["private-"+e]=new wm(this.pusher,"private-"+e,this.options)),this.channels["private-"+e]}encryptedPrivateChannel(e){return this.channels["private-encrypted-"+e]||(this.channels["private-encrypted-"+e]=new EE(this.pusher,"private-encrypted-"+e,this.options)),this.channels["private-encrypted-"+e]}presenceChannel(e){return this.channels["presence-"+e]||(this.channels["presence-"+e]=new _E(this.pusher,"presence-"+e,this.options)),this.channels["presence-"+e]}leave(e){[e,"private-"+e,"private-encrypted-"+e,"presence-"+e].forEach(a=>{this.leaveChannel(a)})}leaveChannel(e){this.channels[e]&&(this.channels[e].unsubscribe(),delete this.channels[e])}socketId(){return this.pusher.connection.socket_id}disconnect(){this.pusher.disconnect()}}class kE extends Vd{constructor(){super(...arguments),this.channels={}}connect(){let e=this.getSocketIO();this.socket=e(this.options.host??void 0,this.options),this.socket.io.on("reconnect",()=>{Object.values(this.channels).forEach(a=>{a.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,a,r){return this.channel(e).listen(a,r)}channel(e){return this.channels[e]||(this.channels[e]=new Cm(this.socket,e,this.options)),this.channels[e]}privateChannel(e){return this.channels["private-"+e]||(this.channels["private-"+e]=new Em(this.socket,"private-"+e,this.options)),this.channels["private-"+e]}presenceChannel(e){return this.channels["presence-"+e]||(this.channels["presence-"+e]=new AE(this.socket,"presence-"+e,this.options)),this.channels["presence-"+e]}leave(e){[e,"private-"+e,"presence-"+e].forEach(a=>{this.leaveChannel(a)})}leaveChannel(e){this.channels[e]&&(this.channels[e].unsubscribe(),delete this.channels[e])}socketId(){return this.socket.id}disconnect(){this.socket.disconnect()}}class xm extends Vd{constructor(){super(...arguments),this.channels={}}connect(){}listen(e,a,r){return new dc}channel(e){return new dc}privateChannel(e){return new _m}encryptedPrivateChannel(e){return new xE}presenceChannel(e){return new TE}leave(e){}leaveChannel(e){}socketId(){return"fake-socket-id"}disconnect(){}}class RE{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 fc({...this.options,cluster:""});else if(this.options.broadcaster==="pusher")this.connector=new fc(this.options);else if(this.options.broadcaster==="ably")this.connector=new fc({...this.options,cluster:"",broadcaster:"pusher"});else if(this.options.broadcaster==="socket.io")this.connector=new kE(this.options);else if(this.options.broadcaster==="null")this.connector=new xm(this.options);else if(typeof this.options.broadcaster=="function"&&CE(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,a,r){return this.connector.listen(e,a,r)}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 fc||e instanceof xm}socketId(){return this.connector.socketId()}registerInterceptors(){typeof Vue<"u"&&Vue!=null&&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,a)=>{this.socketId()&&e.headers.set("X-Socket-ID",this.socketId()),a()})}registerAxiosRequestInterceptor(){axios.interceptors.request.use(e=>(this.socketId()&&(e.headers["X-Socket-Id"]=this.socketId()),e))}registerjQueryAjaxSetup(){typeof jQuery.ajax<"u"&&jQuery.ajaxPrefilter((e,a,r)=>{this.socketId()&&r.setRequestHeader("X-Socket-Id",this.socketId())})}registerTurboRequestInterceptor(){document.addEventListener("turbo:before-fetch-request",e=>{e.detail.fetchOptions.headers["X-Socket-Id"]=this.socketId()})}}var Fd={exports:{}};/*!
* Pusher JavaScript Library v8.4.0
* https://pusher.com/
*
* Copyright 2020, Pusher
* Released under the MIT licence.
*/var Tm;function DE(){return Tm||(Tm=1,(function(l,e){(function(r,i){l.exports=i()})(window,function(){return(function(a){var r={};function i(o){if(r[o])return r[o].exports;var u=r[o]={i:o,l:!1,exports:{}};return a[o].call(u.exports,u,u.exports,i),u.l=!0,u.exports}return i.m=a,i.c=r,i.d=function(o,u,d){i.o(o,u)||Object.defineProperty(o,u,{enumerable:!0,get:d})},i.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},i.t=function(o,u){if(u&1&&(o=i(o)),u&8||u&4&&typeof o=="object"&&o&&o.__esModule)return o;var d=Object.create(null);if(i.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:o}),u&2&&typeof o!="string")for(var f in o)i.d(d,f,function(g){return o[g]}.bind(null,f));return d},i.n=function(o){var u=o&&o.__esModule?function(){return o.default}:function(){return o};return i.d(u,"a",u),u},i.o=function(o,u){return Object.prototype.hasOwnProperty.call(o,u)},i.p="",i(i.s=2)})([(function(a,r,i){var o=this&&this.__extends||(function(){var A=function(T,D){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(M,O){M.__proto__=O}||function(M,O){for(var L in O)O.hasOwnProperty(L)&&(M[L]=O[L])},A(T,D)};return function(T,D){A(T,D);function M(){this.constructor=T}T.prototype=D===null?Object.create(D):(M.prototype=D.prototype,new M)}})();Object.defineProperty(r,"__esModule",{value:!0});var u=256,d=(function(){function A(T){T===void 0&&(T="="),this._paddingCharacter=T}return A.prototype.encodedLength=function(T){return this._paddingCharacter?(T+2)/3*4|0:(T*8+5)/6|0},A.prototype.encode=function(T){for(var D="",M=0;M<T.length-2;M+=3){var O=T[M]<<16|T[M+1]<<8|T[M+2];D+=this._encodeByte(O>>>18&63),D+=this._encodeByte(O>>>12&63),D+=this._encodeByte(O>>>6&63),D+=this._encodeByte(O>>>0&63)}var L=T.length-M;if(L>0){var O=T[M]<<16|(L===2?T[M+1]<<8:0);D+=this._encodeByte(O>>>18&63),D+=this._encodeByte(O>>>12&63),L===2?D+=this._encodeByte(O>>>6&63):D+=this._paddingCharacter||"",D+=this._paddingCharacter||""}return D},A.prototype.maxDecodedLength=function(T){return this._paddingCharacter?T/4*3|0:(T*6+7)/8|0},A.prototype.decodedLength=function(T){return this.maxDecodedLength(T.length-this._getPaddingLength(T))},A.prototype.decode=function(T){if(T.length===0)return new Uint8Array(0);for(var D=this._getPaddingLength(T),M=T.length-D,O=new Uint8Array(this.maxDecodedLength(M)),L=0,P=0,U=0,B=0,Y=0,ge=0,Ae=0;P<M-4;P+=4)B=this._decodeChar(T.charCodeAt(P+0)),Y=this._decodeChar(T.charCodeAt(P+1)),ge=this._decodeChar(T.charCodeAt(P+2)),Ae=this._decodeChar(T.charCodeAt(P+3)),O[L++]=B<<2|Y>>>4,O[L++]=Y<<4|ge>>>2,O[L++]=ge<<6|Ae,U|=B&u,U|=Y&u,U|=ge&u,U|=Ae&u;if(P<M-1&&(B=this._decodeChar(T.charCodeAt(P)),Y=this._decodeChar(T.charCodeAt(P+1)),O[L++]=B<<2|Y>>>4,U|=B&u,U|=Y&u),P<M-2&&(ge=this._decodeChar(T.charCodeAt(P+2)),O[L++]=Y<<4|ge>>>2,U|=ge&u),P<M-3&&(Ae=this._decodeChar(T.charCodeAt(P+3)),O[L++]=ge<<6|Ae,U|=Ae&u),U!==0)throw new Error("Base64Coder: incorrect characters for decoding");return O},A.prototype._encodeByte=function(T){var D=T;return D+=65,D+=25-T>>>8&6,D+=51-T>>>8&-75,D+=61-T>>>8&-15,D+=62-T>>>8&3,String.fromCharCode(D)},A.prototype._decodeChar=function(T){var D=u;return D+=(42-T&T-44)>>>8&-u+T-43+62,D+=(46-T&T-48)>>>8&-u+T-47+63,D+=(47-T&T-58)>>>8&-u+T-48+52,D+=(64-T&T-91)>>>8&-u+T-65+0,D+=(96-T&T-123)>>>8&-u+T-97+26,D},A.prototype._getPaddingLength=function(T){var D=0;if(this._paddingCharacter){for(var M=T.length-1;M>=0&&T[M]===this._paddingCharacter;M--)D++;if(T.length<4||D>2)throw new Error("Base64Coder: incorrect padding")}return D},A})();r.Coder=d;var f=new d;function g(A){return f.encode(A)}r.encode=g;function m(A){return f.decode(A)}r.decode=m;var b=(function(A){o(T,A);function T(){return A!==null&&A.apply(this,arguments)||this}return T.prototype._encodeByte=function(D){var M=D;return M+=65,M+=25-D>>>8&6,M+=51-D>>>8&-75,M+=61-D>>>8&-13,M+=62-D>>>8&49,String.fromCharCode(M)},T.prototype._decodeChar=function(D){var M=u;return M+=(44-D&D-46)>>>8&-u+D-45+62,M+=(94-D&D-96)>>>8&-u+D-95+63,M+=(47-D&D-58)>>>8&-u+D-48+52,M+=(64-D&D-91)>>>8&-u+D-65+0,M+=(96-D&D-123)>>>8&-u+D-97+26,M},T})(d);r.URLSafeCoder=b;var v=new b;function E(A){return v.encode(A)}r.encodeURLSafe=E;function S(A){return v.decode(A)}r.decodeURLSafe=S,r.encodedLength=function(A){return f.encodedLength(A)},r.maxDecodedLength=function(A){return f.maxDecodedLength(A)},r.decodedLength=function(A){return f.decodedLength(A)}}),(function(a,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o="utf8: invalid string",u="utf8: invalid source encoding";function d(m){for(var b=new Uint8Array(f(m)),v=0,E=0;E<m.length;E++){var S=m.charCodeAt(E);S<128?b[v++]=S:S<2048?(b[v++]=192|S>>6,b[v++]=128|S&63):S<55296?(b[v++]=224|S>>12,b[v++]=128|S>>6&63,b[v++]=128|S&63):(E++,S=(S&1023)<<10,S|=m.charCodeAt(E)&1023,S+=65536,b[v++]=240|S>>18,b[v++]=128|S>>12&63,b[v++]=128|S>>6&63,b[v++]=128|S&63)}return b}r.encode=d;function f(m){for(var b=0,v=0;v<m.length;v++){var E=m.charCodeAt(v);if(E<128)b+=1;else if(E<2048)b+=2;else if(E<55296)b+=3;else if(E<=57343){if(v>=m.length-1)throw new Error(o);v++,b+=4}else throw new Error(o)}return b}r.encodedLength=f;function g(m){for(var b=[],v=0;v<m.length;v++){var E=m[v];if(E&128){var S=void 0;if(E<224){if(v>=m.length)throw new Error(u);var A=m[++v];if((A&192)!==128)throw new Error(u);E=(E&31)<<6|A&63,S=128}else if(E<240){if(v>=m.length-1)throw new Error(u);var A=m[++v],T=m[++v];if((A&192)!==128||(T&192)!==128)throw new Error(u);E=(E&15)<<12|(A&63)<<6|T&63,S=2048}else if(E<248){if(v>=m.length-2)throw new Error(u);var A=m[++v],T=m[++v],D=m[++v];if((A&192)!==128||(T&192)!==128||(D&192)!==128)throw new Error(u);E=(E&15)<<18|(A&63)<<12|(T&63)<<6|D&63,S=65536}else throw new Error(u);if(E<S||E>=55296&&E<=57343)throw new Error(u);if(E>=65536){if(E>1114111)throw new Error(u);E-=65536,b.push(String.fromCharCode(55296|E>>10)),E=56320|E&1023}}b.push(String.fromCharCode(E))}return b.join("")}r.decode=g}),(function(a,r,i){a.exports=i(3).default}),(function(a,r,i){i.r(r);class o{constructor(y,C){this.lastId=0,this.prefix=y,this.name=C}create(y){this.lastId++;var C=this.lastId,R=this.prefix+C,H=this.name+"["+C+"]",ie=!1,be=function(){ie||(y.apply(null,arguments),ie=!0)};return this[C]=be,{number:C,id:R,name:H,callback:be}}remove(y){delete this[y.number]}}var u=new o("_pusher_script_","Pusher.ScriptReceivers"),d={VERSION:"8.4.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:""},f=d;class g{constructor(y){this.options=y,this.receivers=y.receivers||u,this.loading={}}load(y,C,R){var H=this;if(H.loading[y]&&H.loading[y].length>0)H.loading[y].push(R);else{H.loading[y]=[R];var ie=Ge.createScriptRequest(H.getPath(y,C)),be=H.receivers.create(function(ke){if(H.receivers.remove(be),H.loading[y]){var Ve=H.loading[y];delete H.loading[y];for(var at=function(Ht){Ht||ie.cleanup()},ot=0;ot<Ve.length;ot++)Ve[ot](ke,at)}});ie.send(be)}}getRoot(y){var C,R=Ge.getDocument().location.protocol;return y&&y.useTLS||R==="https:"?C=this.options.cdn_https:C=this.options.cdn_http,C.replace(/\/*$/,"")+"/"+this.options.version}getPath(y,C){return this.getRoot(C)+"/"+y+this.options.suffix+".js"}}var m=new o("_pusher_dependencies","Pusher.DependenciesReceivers"),b=new g({cdn_http:f.cdn_http,cdn_https:f.cdn_https,version:f.VERSION,suffix:f.dependency_suffix,receivers:m});const v={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"}}};var S={buildLogSuffix:function(_){const y="See:",C=v.urls[_];if(!C)return"";let R;return C.fullUrl?R=C.fullUrl:C.path&&(R=v.baseUrl+C.path),R?`${y} ${R}`:""}},A;(function(_){_.UserAuthentication="user-authentication",_.ChannelAuthorization="channel-authorization"})(A||(A={}));class T extends Error{constructor(y){super(y),Object.setPrototypeOf(this,new.target.prototype)}}class D extends Error{constructor(y){super(y),Object.setPrototypeOf(this,new.target.prototype)}}class M extends Error{constructor(y){super(y),Object.setPrototypeOf(this,new.target.prototype)}}class O extends Error{constructor(y){super(y),Object.setPrototypeOf(this,new.target.prototype)}}class L extends Error{constructor(y){super(y),Object.setPrototypeOf(this,new.target.prototype)}}class P extends Error{constructor(y){super(y),Object.setPrototypeOf(this,new.target.prototype)}}class U extends Error{constructor(y){super(y),Object.setPrototypeOf(this,new.target.prototype)}}class B extends Error{constructor(y){super(y),Object.setPrototypeOf(this,new.target.prototype)}}class Y extends Error{constructor(y,C){super(C),this.status=y,Object.setPrototypeOf(this,new.target.prototype)}}var Ae=function(_,y,C,R,H){const ie=Ge.createXHR();ie.open("POST",C.endpoint,!0),ie.setRequestHeader("Content-Type","application/x-www-form-urlencoded");for(var be in C.headers)ie.setRequestHeader(be,C.headers[be]);if(C.headersProvider!=null){let ke=C.headersProvider();for(var be in ke)ie.setRequestHeader(be,ke[be])}return ie.onreadystatechange=function(){if(ie.readyState===4)if(ie.status===200){let ke,Ve=!1;try{ke=JSON.parse(ie.responseText),Ve=!0}catch{H(new Y(200,`JSON returned from ${R.toString()} endpoint was invalid, yet status code was 200. Data was: ${ie.responseText}`),null)}Ve&&H(null,ke)}else{let ke="";switch(R){case A.UserAuthentication:ke=S.buildLogSuffix("authenticationEndpoint");break;case A.ChannelAuthorization:ke=`Clients must be authorized to join private or presence channels. ${S.buildLogSuffix("authorizationEndpoint")}`;break}H(new Y(ie.status,`Unable to retrieve auth string from ${R.toString()} endpoint - received status: ${ie.status} from ${C.endpoint}. ${ke}`),null)}},ie.send(y),ie};function Oe(_){return de(pt(_))}var Ne=String.fromCharCode,He="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ze=function(_){var y=_.charCodeAt(0);return y<128?_:y<2048?Ne(192|y>>>6)+Ne(128|y&63):Ne(224|y>>>12&15)+Ne(128|y>>>6&63)+Ne(128|y&63)},pt=function(_){return _.replace(/[^\x00-\x7F]/g,Ze)},J=function(_){var y=[0,2,1][_.length%3],C=_.charCodeAt(0)<<16|(_.length>1?_.charCodeAt(1):0)<<8|(_.length>2?_.charCodeAt(2):0),R=[He.charAt(C>>>18),He.charAt(C>>>12&63),y>=2?"=":He.charAt(C>>>6&63),y>=1?"=":He.charAt(C&63)];return R.join("")},de=window.btoa||function(_){return _.replace(/[\s\S]{1,3}/g,J)};class me{constructor(y,C,R,H){this.clear=C,this.timer=y(()=>{this.timer&&(this.timer=H(this.timer))},R)}isRunning(){return this.timer!==null}ensureAborted(){this.timer&&(this.clear(this.timer),this.timer=null)}}var ne=me;function pe(_){window.clearTimeout(_)}function x(_){window.clearInterval(_)}class F extends ne{constructor(y,C){super(setTimeout,pe,y,function(R){return C(),null})}}class ue extends ne{constructor(y,C){super(setInterval,x,y,function(R){return C(),R})}}var fe={now(){return Date.now?Date.now():new Date().valueOf()},defer(_){return new F(0,_)},method(_,...y){var C=Array.prototype.slice.call(arguments,1);return function(R){return R[_].apply(R,C.concat(arguments))}}},te=fe;function ye(_,...y){for(var C=0;C<y.length;C++){var R=y[C];for(var H in R)R[H]&&R[H].constructor&&R[H].constructor===Object?_[H]=ye(_[H]||{},R[H]):_[H]=R[H]}return _}function je(){for(var _=["Pusher"],y=0;y<arguments.length;y++)typeof arguments[y]=="string"?_.push(arguments[y]):_.push(Pn(arguments[y]));return _.join(" : ")}function Me(_,y){var C=Array.prototype.indexOf;if(_===null)return-1;if(C&&_.indexOf===C)return _.indexOf(y);for(var R=0,H=_.length;R<H;R++)if(_[R]===y)return R;return-1}function Pe(_,y){for(var C in _)Object.prototype.hasOwnProperty.call(_,C)&&y(_[C],C,_)}function Ie(_){var y=[];return Pe(_,function(C,R){y.push(R)}),y}function Lt(_){var y=[];return Pe(_,function(C){y.push(C)}),y}function At(_,y,C){for(var R=0;R<_.length;R++)y.call(C||window,_[R],R,_)}function Zt(_,y){for(var C=[],R=0;R<_.length;R++)C.push(y(_[R],R,_,C));return C}function Tt(_,y){var C={};return Pe(_,function(R,H){C[H]=y(R)}),C}function on(_,y){y=y||function(H){return!!H};for(var C=[],R=0;R<_.length;R++)y(_[R],R,_,C)&&C.push(_[R]);return C}function vt(_,y){var C={};return Pe(_,function(R,H){(y&&y(R,H,_,C)||R)&&(C[H]=R)}),C}function Za(_){var y=[];return Pe(_,function(C,R){y.push([R,C])}),y}function Sn(_,y){for(var C=0;C<_.length;C++)if(y(_[C],C,_))return!0;return!1}function qn(_,y){for(var C=0;C<_.length;C++)if(!y(_[C],C,_))return!1;return!0}function Ut(_){return Tt(_,function(y){return typeof y=="object"&&(y=Pn(y)),encodeURIComponent(Oe(y.toString()))})}function Rn(_){var y=vt(_,function(R){return R!==void 0}),C=Zt(Za(Ut(y)),te.method("join","=")).join("&");return C}function _a(_){var y=[],C=[];return(function R(H,ie){var be,ke,Ve;switch(typeof H){case"object":if(!H)return null;for(be=0;be<y.length;be+=1)if(y[be]===H)return{$ref:C[be]};if(y.push(H),C.push(ie),Object.prototype.toString.apply(H)==="[object Array]")for(Ve=[],be=0;be<H.length;be+=1)Ve[be]=R(H[be],ie+"["+be+"]");else{Ve={};for(ke in H)Object.prototype.hasOwnProperty.call(H,ke)&&(Ve[ke]=R(H[ke],ie+"["+JSON.stringify(ke)+"]"))}return Ve;case"number":case"string":case"boolean":return H}})(_,"$")}function Pn(_){try{return JSON.stringify(_)}catch{return JSON.stringify(_a(_))}}class Vt{constructor(){this.globalLog=y=>{window.console&&window.console.log&&window.console.log(y)}}debug(...y){this.log(this.globalLog,y)}warn(...y){this.log(this.globalLogWarn,y)}error(...y){this.log(this.globalLogError,y)}globalLogWarn(y){window.console&&window.console.warn?window.console.warn(y):this.globalLog(y)}globalLogError(y){window.console&&window.console.error?window.console.error(y):this.globalLogWarn(y)}log(y,...C){var R=je.apply(this,arguments);Uo.log?Uo.log(R):Uo.logToConsole&&y.bind(this)(R)}}var yt=new Vt,er=function(_,y,C,R,H){(C.headers!==void 0||C.headersProvider!=null)&&yt.warn(`To send headers with the ${R.toString()} request, you must use AJAX, rather than JSONP.`);var ie=_.nextAuthCallbackID.toString();_.nextAuthCallbackID++;var be=_.getDocument(),ke=be.createElement("script");_.auth_callbacks[ie]=function(ot){H(null,ot)};var Ve="Pusher.auth_callbacks['"+ie+"']";ke.src=C.endpoint+"?callback="+encodeURIComponent(Ve)+"&"+y;var at=be.getElementsByTagName("head")[0]||be.documentElement;at.insertBefore(ke,at.firstChild)},Gn=er;class en{constructor(y){this.src=y}send(y){var C=this,R="Error loading "+C.src;C.script=document.createElement("script"),C.script.id=y.id,C.script.src=C.src,C.script.type="text/javascript",C.script.charset="UTF-8",C.script.addEventListener?(C.script.onerror=function(){y.callback(R)},C.script.onload=function(){y.callback(null)}):C.script.onreadystatechange=function(){(C.script.readyState==="loaded"||C.script.readyState==="complete")&&y.callback(null)},C.script.async===void 0&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(C.errorScript=document.createElement("script"),C.errorScript.id=y.id+"_error",C.errorScript.text=y.name+"('"+R+"');",C.script.async=C.errorScript.async=!1):C.script.async=!0;var H=document.getElementsByTagName("head")[0];H.insertBefore(C.script,H.firstChild),C.errorScript&&H.insertBefore(C.errorScript,C.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 mn{constructor(y,C){this.url=y,this.data=C}send(y){if(!this.request){var C=Rn(this.data),R=this.url+"/"+y.number+"?"+C;this.request=Ge.createScriptRequest(R),this.request.send(y)}}cleanup(){this.request&&this.request.cleanup()}}var ta=function(_,y){return function(C,R){var H="http"+(y?"s":"")+"://",ie=H+(_.host||_.options.host)+_.options.path,be=Ge.createJSONPRequest(ie,C),ke=Ge.ScriptReceivers.create(function(Ve,at){u.remove(ke),be.cleanup(),at&&at.host&&(_.host=at.host),R&&R(Ve,at)});be.send(ke)}},wn={name:"jsonp",getAgent:ta},tr=wn;function Vn(_,y,C){var R=_+(y.useTLS?"s":""),H=y.useTLS?y.hostTLS:y.hostNonTLS;return R+"://"+H+C}function Bt(_,y){var C="/app/"+_,R="?protocol="+f.PROTOCOL+"&client=js&version="+f.VERSION+(y?"&"+y:"");return C+R}var Cn={getInitial:function(_,y){var C=(y.httpPath||"")+Bt(_,"flash=false");return Vn("ws",y,C)}},q={getInitial:function(_,y){var C=(y.httpPath||"/pusher")+Bt(_);return Vn("http",y,C)}},le={getInitial:function(_,y){return Vn("http",y,y.httpPath||"/pusher")},getPath:function(_,y){return Bt(_)}};class oe{constructor(){this._callbacks={}}get(y){return this._callbacks[Q(y)]}add(y,C,R){var H=Q(y);this._callbacks[H]=this._callbacks[H]||[],this._callbacks[H].push({fn:C,context:R})}remove(y,C,R){if(!y&&!C&&!R){this._callbacks={};return}var H=y?[Q(y)]:Ie(this._callbacks);C||R?this.removeCallback(H,C,R):this.removeAllCallbacks(H)}removeCallback(y,C,R){At(y,function(H){this._callbacks[H]=on(this._callbacks[H]||[],function(ie){return C&&C!==ie.fn||R&&R!==ie.context}),this._callbacks[H].length===0&&delete this._callbacks[H]},this)}removeAllCallbacks(y){At(y,function(C){delete this._callbacks[C]},this)}}function Q(_){return"_"+_}class he{constructor(y){this.callbacks=new oe,this.global_callbacks=[],this.failThrough=y}bind(y,C,R){return this.callbacks.add(y,C,R),this}bind_global(y){return this.global_callbacks.push(y),this}unbind(y,C,R){return this.callbacks.remove(y,C,R),this}unbind_global(y){return y?(this.global_callbacks=on(this.global_callbacks||[],C=>C!==y),this):(this.global_callbacks=[],this)}unbind_all(){return this.unbind(),this.unbind_global(),this}emit(y,C,R){for(var H=0;H<this.global_callbacks.length;H++)this.global_callbacks[H](y,C);var ie=this.callbacks.get(y),be=[];if(R?be.push(C,R):C&&be.push(C),ie&&ie.length>0)for(var H=0;H<ie.length;H++)ie[H].fn.apply(ie[H].context||window,be);else this.failThrough&&this.failThrough(y,C);return this}}class ve extends he{constructor(y,C,R,H,ie){super(),this.initialize=Ge.transportConnectionInitializer,this.hooks=y,this.name=C,this.priority=R,this.key=H,this.options=ie,this.state="new",this.timeline=ie.timeline,this.activityTimeout=ie.activityTimeout,this.id=this.timeline.generateUniqueID()}handlesActivityChecks(){return!!this.hooks.handlesActivityChecks}supportsPing(){return!!this.hooks.supportsPing}connect(){if(this.socket||this.state!=="initialized")return!1;var y=this.hooks.urls.getInitial(this.key,this.options);try{this.socket=this.hooks.getSocket(y,this.options)}catch(C){return te.defer(()=>{this.onError(C),this.changeState("closed")}),!1}return this.bindListeners(),yt.debug("Connecting",{transport:this.name,url:y}),this.changeState("connecting"),!0}close(){return this.socket?(this.socket.close(),!0):!1}send(y){return this.state==="open"?(te.defer(()=>{this.socket&&this.socket.send(y)}),!0):!1}ping(){this.state==="open"&&this.supportsPing()&&this.socket.ping()}onOpen(){this.hooks.beforeOpen&&this.hooks.beforeOpen(this.socket,this.hooks.urls.getPath(this.key,this.options)),this.changeState("open"),this.socket.onopen=void 0}onError(y){this.emit("error",{type:"WebSocketError",error:y}),this.timeline.error(this.buildTimelineMessage({error:y.toString()}))}onClose(y){y?this.changeState("closed",{code:y.code,reason:y.reason,wasClean:y.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0}onMessage(y){this.emit("message",y)}onActivity(){this.emit("activity")}bindListeners(){this.socket.onopen=()=>{this.onOpen()},this.socket.onerror=y=>{this.onError(y)},this.socket.onclose=y=>{this.onClose(y)},this.socket.onmessage=y=>{this.onMessage(y)},this.supportsPing()&&(this.socket.onactivity=()=>{this.onActivity()})}unbindListeners(){this.socket&&(this.socket.onopen=void 0,this.socket.onerror=void 0,this.socket.onclose=void 0,this.socket.onmessage=void 0,this.supportsPing()&&(this.socket.onactivity=void 0))}changeState(y,C){this.state=y,this.timeline.info(this.buildTimelineMessage({state:y,params:C})),this.emit(y,C)}buildTimelineMessage(y){return ye({cid:this.id},y)}}class we{constructor(y){this.hooks=y}isSupported(y){return this.hooks.isSupported(y)}createConnection(y,C,R,H){return new ve(this.hooks,y,C,R,H)}}var _e=new we({urls:Cn,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!Ge.getWebSocketAPI()},isSupported:function(){return!!Ge.getWebSocketAPI()},getSocket:function(_){return Ge.createWebSocket(_)}}),Be={urls:q,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},$e=ye({getSocket:function(_){return Ge.HTTPFactory.createStreamingSocket(_)}},Be),Re=ye({getSocket:function(_){return Ge.HTTPFactory.createPollingSocket(_)}},Be),xe={isSupported:function(){return Ge.isXHRSupported()}},Ke=new we(ye({},$e,xe)),qe=new we(ye({},Re,xe)),Ce={ws:_e,xhr_streaming:Ke,xhr_polling:qe},Ee=Ce,Le=new we({file:"sockjs",urls:le,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return window.SockJS!==void 0},getSocket:function(_,y){return new window.SockJS(_,null,{js_path:b.getPath("sockjs",{useTLS:y.useTLS}),ignore_null_origin:y.ignoreNullOrigin})},beforeOpen:function(_,y){_.send(JSON.stringify({path:y}))}}),nt={isSupported:function(_){var y=Ge.isXDRSupported(_.useTLS);return y}},kt=new we(ye({},$e,nt)),yn=new we(ye({},Re,nt));Ee.xdr_streaming=kt,Ee.xdr_polling=yn,Ee.sockjs=Le;var Ft=Ee;class na extends he{constructor(){super();var y=this;window.addEventListener!==void 0&&(window.addEventListener("online",function(){y.emit("online")},!1),window.addEventListener("offline",function(){y.emit("offline")},!1))}isOnline(){return window.navigator.onLine===void 0?!0:window.navigator.onLine}}var Dn=new na;class tn{constructor(y,C,R){this.manager=y,this.transport=C,this.minPingDelay=R.minPingDelay,this.maxPingDelay=R.maxPingDelay,this.pingDelay=void 0}createConnection(y,C,R,H){H=ye({},H,{activityTimeout:this.pingDelay});var ie=this.transport.createConnection(y,C,R,H),be=null,ke=function(){ie.unbind("open",ke),ie.bind("closed",Ve),be=te.now()},Ve=at=>{if(ie.unbind("closed",Ve),at.code===1002||at.code===1003)this.manager.reportDeath();else if(!at.wasClean&&be){var ot=te.now()-be;ot<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(ot/2,this.minPingDelay))}};return ie.bind("open",ke),ie}isSupported(y){return this.manager.isAlive()&&this.transport.isSupported(y)}}const cn={decodeMessage:function(_){try{var y=JSON.parse(_.data),C=y.data;if(typeof C=="string")try{C=JSON.parse(y.data)}catch{}var R={event:y.event,channel:y.channel,data:C};return y.user_id&&(R.user_id=y.user_id),R}catch(H){throw{type:"MessageParseError",error:H,data:_.data}}},encodeMessage:function(_){return JSON.stringify(_)},processHandshake:function(_){var y=cn.decodeMessage(_);if(y.event==="pusher:connection_established"){if(!y.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",id:y.data.socket_id,activityTimeout:y.data.activity_timeout*1e3}}else{if(y.event==="pusher:error")return{action:this.getCloseAction(y.data),error:this.getCloseError(y.data)};throw"Invalid handshake"}},getCloseAction:function(_){return _.code<4e3?_.code>=1002&&_.code<=1004?"backoff":null:_.code===4e3?"tls_only":_.code<4100?"refused":_.code<4200?"backoff":_.code<4300?"retry":"refused"},getCloseError:function(_){return _.code!==1e3&&_.code!==1001?{type:"PusherError",data:{code:_.code,message:_.reason||_.message}}:null}};var On=cn;class _o extends he{constructor(y,C){super(),this.id=y,this.transport=C,this.activityTimeout=C.activityTimeout,this.bindListeners()}handlesActivityChecks(){return this.transport.handlesActivityChecks()}send(y){return this.transport.send(y)}send_event(y,C,R){var H={event:y,data:C};return R&&(H.channel=R),yt.debug("Event sent",H),this.send(On.encodeMessage(H))}ping(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})}close(){this.transport.close()}bindListeners(){var y={message:R=>{var H;try{H=On.decodeMessage(R)}catch(ie){this.emit("error",{type:"MessageParseError",error:ie,data:R.data})}if(H!==void 0){switch(yt.debug("Event recd",H),H.event){case"pusher:error":this.emit("error",{type:"PusherError",data:H.data});break;case"pusher:ping":this.emit("ping");break;case"pusher:pong":this.emit("pong");break}this.emit("message",H)}},activity:()=>{this.emit("activity")},error:R=>{this.emit("error",R)},closed:R=>{C(),R&&R.code&&this.handleCloseEvent(R),this.transport=null,this.emit("closed")}},C=()=>{Pe(y,(R,H)=>{this.transport.unbind(H,R)})};Pe(y,(R,H)=>{this.transport.bind(H,R)})}handleCloseEvent(y){var C=On.getCloseAction(y),R=On.getCloseError(y);R&&this.emit("error",R),C&&this.emit(C,{action:C,error:R})}}class Jd{constructor(y,C){this.transport=y,this.callback=C,this.bindListeners()}close(){this.unbindListeners(),this.transport.close()}bindListeners(){this.onMessage=y=>{this.unbindListeners();var C;try{C=On.processHandshake(y)}catch(R){this.finish("error",{error:R}),this.transport.close();return}C.action==="connected"?this.finish("connected",{connection:new _o(C.id,this.transport),activityTimeout:C.activityTimeout}):(this.finish(C.action,{error:C.error}),this.transport.close())},this.onClosed=y=>{this.unbindListeners();var C=On.getCloseAction(y)||"backoff",R=On.getCloseError(y);this.finish(C,{error:R})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)}unbindListeners(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)}finish(y,C){this.callback(ye({transport:this.transport,action:y},C))}}class Zd{constructor(y,C){this.timeline=y,this.options=C||{}}send(y,C){this.timeline.isEmpty()||this.timeline.send(Ge.TimelineTransport.getAgent(this,y),C)}}class as extends he{constructor(y,C){super(function(R,H){yt.debug("No callbacks on "+y+" for "+R)}),this.name=y,this.pusher=C,this.subscribed=!1,this.subscriptionPending=!1,this.subscriptionCancelled=!1}authorize(y,C){return C(null,{auth:""})}trigger(y,C){if(y.indexOf("client-")!==0)throw new T("Event '"+y+"' does not start with 'client-'");if(!this.subscribed){var R=S.buildLogSuffix("triggeringClientEvents");yt.warn(`Client event triggered before channel 'subscription_succeeded' event . ${R}`)}return this.pusher.send_event(y,C,this.name)}disconnect(){this.subscribed=!1,this.subscriptionPending=!1}handleEvent(y){var C=y.event,R=y.data;if(C==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(y);else if(C==="pusher_internal:subscription_count")this.handleSubscriptionCountEvent(y);else if(C.indexOf("pusher_internal:")!==0){var H={};this.emit(C,R,H)}}handleSubscriptionSucceededEvent(y){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",y.data)}handleSubscriptionCountEvent(y){y.data.subscription_count&&(this.subscriptionCount=y.data.subscription_count),this.emit("pusher:subscription_count",y.data)}subscribe(){this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(y,C)=>{y?(this.subscriptionPending=!1,yt.error(y.toString()),this.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:y.message},y instanceof Y?{status:y.status}:{}))):this.pusher.send_event("pusher:subscribe",{auth:C.auth,channel_data:C.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 nr extends as{authorize(y,C){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:y},C)}}class Ao{constructor(){this.reset()}get(y){return Object.prototype.hasOwnProperty.call(this.members,y)?{id:y,info:this.members[y]}:null}each(y){Pe(this.members,(C,R)=>{y(this.get(R))})}setMyID(y){this.myID=y}onSubscription(y){this.members=y.presence.hash,this.count=y.presence.count,this.me=this.get(this.myID)}addMember(y){return this.get(y.user_id)===null&&this.count++,this.members[y.user_id]=y.user_info,this.get(y.user_id)}removeMember(y){var C=this.get(y.user_id);return C&&(delete this.members[y.user_id],this.count--),C}reset(){this.members={},this.count=0,this.myID=null,this.me=null}}var Dr=function(_,y,C,R){function H(ie){return ie instanceof C?ie:new C(function(be){be(ie)})}return new(C||(C=Promise))(function(ie,be){function ke(ot){try{at(R.next(ot))}catch(Ht){be(Ht)}}function Ve(ot){try{at(R.throw(ot))}catch(Ht){be(Ht)}}function at(ot){ot.done?ie(ot.value):H(ot.value).then(ke,Ve)}at((R=R.apply(_,y||[])).next())})};class Or extends nr{constructor(y,C){super(y,C),this.members=new Ao}authorize(y,C){super.authorize(y,(R,H)=>Dr(this,void 0,void 0,function*(){if(!R)if(H=H,H.channel_data!=null){var ie=JSON.parse(H.channel_data);this.members.setMyID(ie.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 be=S.buildLogSuffix("authorizationEndpoint");yt.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${be}, or the user should be signed in.`),C("Invalid auth response");return}C(R,H)}))}handleEvent(y){var C=y.event;if(C.indexOf("pusher_internal:")===0)this.handleInternalEvent(y);else{var R=y.data,H={};y.user_id&&(H.user_id=y.user_id),this.emit(C,R,H)}}handleInternalEvent(y){var C=y.event,R=y.data;switch(C){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(y);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(y);break;case"pusher_internal:member_added":var H=this.members.addMember(R);this.emit("pusher:member_added",H);break;case"pusher_internal:member_removed":var ie=this.members.removeMember(R);ie&&this.emit("pusher:member_removed",ie);break}}handleSubscriptionSucceededEvent(y){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(y.data),this.emit("pusher:subscription_succeeded",this.members))}disconnect(){this.members.reset(),super.disconnect()}}var yi=i(1),ja=i(0);class Kt extends nr{constructor(y,C,R){super(y,C),this.key=null,this.nacl=R}authorize(y,C){super.authorize(y,(R,H)=>{if(R){C(R,H);return}let ie=H.shared_secret;if(!ie){C(new Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`),null);return}this.key=Object(ja.decode)(ie),delete H.shared_secret,C(null,H)})}trigger(y,C){throw new P("Client events are not currently supported for encrypted channels")}handleEvent(y){var C=y.event,R=y.data;if(C.indexOf("pusher_internal:")===0||C.indexOf("pusher:")===0){super.handleEvent(y);return}this.handleEncryptedEvent(C,R)}handleEncryptedEvent(y,C){if(!this.key){yt.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!C.ciphertext||!C.nonce){yt.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+C);return}let R=Object(ja.decode)(C.ciphertext);if(R.length<this.nacl.secretbox.overheadLength){yt.error(`Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${R.length}`);return}let H=Object(ja.decode)(C.nonce);if(H.length<this.nacl.secretbox.nonceLength){yt.error(`Expected encrypted event nonce length to be ${this.nacl.secretbox.nonceLength}, got: ${H.length}`);return}let ie=this.nacl.secretbox.open(R,H,this.key);if(ie===null){yt.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,(be,ke)=>{if(be){yt.error(`Failed to make a request to the authEndpoint: ${ke}. Unable to fetch new key, so dropping encrypted event`);return}if(ie=this.nacl.secretbox.open(R,H,this.key),ie===null){yt.error("Failed to decrypt event with new key. Dropping encrypted event");return}this.emit(y,this.getDataToEmit(ie))});return}this.emit(y,this.getDataToEmit(ie))}getDataToEmit(y){let C=Object(yi.decode)(y);try{return JSON.parse(C)}catch{return C}}}class vc extends he{constructor(y,C){super(),this.state="initialized",this.connection=null,this.key=y,this.options=C,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 R=Ge.getNetwork();R.bind("online",()=>{this.timeline.info({netinfo:"online"}),(this.state==="connecting"||this.state==="unavailable")&&this.retryIn(0)}),R.bind("offline",()=>{this.timeline.info({netinfo:"offline"}),this.connection&&this.sendActivityCheck()}),this.updateStrategy()}connect(){if(!(this.connection||this.runner)){if(!this.strategy.isSupported()){this.updateState("failed");return}this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()}}send(y){return this.connection?this.connection.send(y):!1}send_event(y,C,R){return this.connection?this.connection.send_event(y,C,R):!1}disconnect(){this.disconnectInternally(),this.updateState("disconnected")}isUsingTLS(){return this.usingTLS}startConnecting(){var y=(C,R)=>{C?this.runner=this.strategy.connect(0,y):R.action==="error"?(this.emit("error",{type:"HandshakeError",error:R.error}),this.timeline.error({handshakeError:R.error})):(this.abortConnecting(),this.handshakeCallbacks[R.action](R))};this.runner=this.strategy.connect(0,y)}abortConnecting(){this.runner&&(this.runner.abort(),this.runner=null)}disconnectInternally(){if(this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection){var y=this.abandonConnection();y.close()}}updateStrategy(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})}retryIn(y){this.timeline.info({action:"retry",delay:y}),y>0&&this.emit("connecting_in",Math.round(y/1e3)),this.retryTimer=new F(y||0,()=>{this.disconnectInternally(),this.connect()})}clearRetryTimer(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)}setUnavailableTimer(){this.unavailableTimer=new F(this.options.unavailableTimeout,()=>{this.updateState("unavailable")})}clearUnavailableTimer(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()}sendActivityCheck(){this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new F(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 F(this.activityTimeout,()=>{this.sendActivityCheck()}))}stopActivityCheck(){this.activityTimer&&this.activityTimer.ensureAborted()}buildConnectionCallbacks(y){return ye({},y,{message:C=>{this.resetActivityCheck(),this.emit("message",C)},ping:()=>{this.send_event("pusher:pong",{})},activity:()=>{this.resetActivityCheck()},error:C=>{this.emit("error",C)},closed:()=>{this.abandonConnection(),this.shouldRetry()&&this.retryIn(1e3)}})}buildHandshakeCallbacks(y){return ye({},y,{connected:C=>{this.activityTimeout=Math.min(this.options.activityTimeout,C.activityTimeout,C.connection.activityTimeout||1/0),this.clearUnavailableTimer(),this.setConnection(C.connection),this.socket_id=this.connection.id,this.updateState("connected",{socket_id:this.socket_id})}})}buildErrorCallbacks(){let y=C=>R=>{R.error&&this.emit("error",{type:"WebSocketError",error:R.error}),C(R)};return{tls_only:y(()=>{this.usingTLS=!0,this.updateStrategy(),this.retryIn(0)}),refused:y(()=>{this.disconnect()}),backoff:y(()=>{this.retryIn(1e3)}),retry:y(()=>{this.retryIn(0)})}}setConnection(y){this.connection=y;for(var C in this.connectionCallbacks)this.connection.bind(C,this.connectionCallbacks[C]);this.resetActivityCheck()}abandonConnection(){if(this.connection){this.stopActivityCheck();for(var y in this.connectionCallbacks)this.connection.unbind(y,this.connectionCallbacks[y]);var C=this.connection;return this.connection=null,C}}updateState(y,C){var R=this.state;if(this.state=y,R!==y){var H=y;H==="connected"&&(H+=" with new socket ID "+C.socket_id),yt.debug("State changed",R+" -> "+H),this.timeline.info({state:y,params:C}),this.emit("state_change",{previous:R,current:y}),this.emit(y,C)}}shouldRetry(){return this.state==="connecting"||this.state==="connected"}}class Sc{constructor(){this.channels={}}add(y,C){return this.channels[y]||(this.channels[y]=ar(y,C)),this.channels[y]}all(){return Lt(this.channels)}find(y){return this.channels[y]}remove(y){var C=this.channels[y];return delete this.channels[y],C}disconnect(){Pe(this.channels,function(y){y.disconnect()})}}function ar(_,y){if(_.indexOf("private-encrypted-")===0){if(y.config.nacl)return Aa.createEncryptedChannel(_,y,y.config.nacl);let C="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",R=S.buildLogSuffix("encryptedChannelSupport");throw new P(`${C}. ${R}`)}else{if(_.indexOf("private-")===0)return Aa.createPrivateChannel(_,y);if(_.indexOf("presence-")===0)return Aa.createPresenceChannel(_,y);if(_.indexOf("#")===0)throw new D('Cannot create a channel with name "'+_+'".');return Aa.createChannel(_,y)}}var Lr={createChannels(){return new Sc},createConnectionManager(_,y){return new vc(_,y)},createChannel(_,y){return new as(_,y)},createPrivateChannel(_,y){return new nr(_,y)},createPresenceChannel(_,y){return new Or(_,y)},createEncryptedChannel(_,y,C){return new Kt(_,y,C)},createTimelineSender(_,y){return new Zd(_,y)},createHandshake(_,y){return new Jd(_,y)},createAssistantToTheTransportManager(_,y,C){return new tn(_,y,C)}},Aa=Lr;class xo{constructor(y){this.options=y||{},this.livesLeft=this.options.lives||1/0}getAssistant(y){return Aa.createAssistantToTheTransportManager(this,y,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}isAlive(){return this.livesLeft>0}reportDeath(){this.livesLeft-=1}}class Ua{constructor(y,C){this.strategies=y,this.loop=!!C.loop,this.failFast=!!C.failFast,this.timeout=C.timeout,this.timeoutLimit=C.timeoutLimit}isSupported(){return Sn(this.strategies,te.method("isSupported"))}connect(y,C){var R=this.strategies,H=0,ie=this.timeout,be=null,ke=(Ve,at)=>{at?C(null,at):(H=H+1,this.loop&&(H=H%R.length),H<R.length?(ie&&(ie=ie*2,this.timeoutLimit&&(ie=Math.min(ie,this.timeoutLimit))),be=this.tryStrategy(R[H],y,{timeout:ie,failFast:this.failFast},ke)):C(!0))};return be=this.tryStrategy(R[H],y,{timeout:ie,failFast:this.failFast},ke),{abort:function(){be.abort()},forceMinPriority:function(Ve){y=Ve,be&&be.forceMinPriority(Ve)}}}tryStrategy(y,C,R,H){var ie=null,be=null;return R.timeout>0&&(ie=new F(R.timeout,function(){be.abort(),H(!0)})),be=y.connect(C,function(ke,Ve){ke&&ie&&ie.isRunning()&&!R.failFast||(ie&&ie.ensureAborted(),H(ke,Ve))}),{abort:function(){ie&&ie.ensureAborted(),be.abort()},forceMinPriority:function(ke){be.forceMinPriority(ke)}}}}class To{constructor(y){this.strategies=y}isSupported(){return Sn(this.strategies,te.method("isSupported"))}connect(y,C){return rs(this.strategies,y,function(R,H){return function(ie,be){if(H[R].error=ie,ie){is(H)&&C(!0);return}At(H,function(ke){ke.forceMinPriority(be.transport.priority)}),C(null,be)}})}}function rs(_,y,C){var R=Zt(_,function(H,ie,be,ke){return H.connect(y,C(ie,ke))});return{abort:function(){At(R,xa)},forceMinPriority:function(H){At(R,function(ie){ie.forceMinPriority(H)})}}}function is(_){return qn(_,function(y){return!!y.error})}function xa(_){!_.error&&!_.aborted&&(_.abort(),_.aborted=!0)}class Ln{constructor(y,C,R){this.strategy=y,this.transports=C,this.ttl=R.ttl||1800*1e3,this.usingTLS=R.useTLS,this.timeline=R.timeline}isSupported(){return this.strategy.isSupported()}connect(y,C){var R=this.usingTLS,H=ef(R),ie=H&&H.cacheSkipCount?H.cacheSkipCount:0,be=[this.strategy];if(H&&H.timestamp+this.ttl>=te.now()){var ke=this.transports[H.transport];ke&&(["ws","wss"].includes(H.transport)||ie>3?(this.timeline.info({cached:!0,transport:H.transport,latency:H.latency}),be.push(new Ua([ke],{timeout:H.latency*2+1e3,failFast:!0}))):ie++)}var Ve=te.now(),at=be.pop().connect(y,function ot(Ht,Ci){Ht?(Ro(R),be.length>0?(Ve=te.now(),at=be.pop().connect(y,ot)):C(Ht)):(ko(R,Ci.transport.name,te.now()-Ve,ie),C(null,Ci))});return{abort:function(){at.abort()},forceMinPriority:function(ot){y=ot,at&&at.forceMinPriority(ot)}}}}function ss(_){return"pusherTransport"+(_?"TLS":"NonTLS")}function ef(_){var y=Ge.getLocalStorage();if(y)try{var C=y[ss(_)];if(C)return JSON.parse(C)}catch{Ro(_)}return null}function ko(_,y,C,R){var H=Ge.getLocalStorage();if(H)try{H[ss(_)]=Pn({timestamp:te.now(),transport:y,latency:C,cacheSkipCount:R})}catch{}}function Ro(_){var y=Ge.getLocalStorage();if(y)try{delete y[ss(_)]}catch{}}class rr{constructor(y,{delay:C}){this.strategy=y,this.options={delay:C}}isSupported(){return this.strategy.isSupported()}connect(y,C){var R=this.strategy,H,ie=new F(this.options.delay,function(){H=R.connect(y,C)});return{abort:function(){ie.ensureAborted(),H&&H.abort()},forceMinPriority:function(be){y=be,H&&H.forceMinPriority(be)}}}}class bi{constructor(y,C,R){this.test=y,this.trueBranch=C,this.falseBranch=R}isSupported(){var y=this.test()?this.trueBranch:this.falseBranch;return y.isSupported()}connect(y,C){var R=this.test()?this.trueBranch:this.falseBranch;return R.connect(y,C)}}class Mn{constructor(y){this.strategy=y}isSupported(){return this.strategy.isSupported()}connect(y,C){var R=this.strategy.connect(y,function(H,ie){ie&&R.abort(),C(H,ie)});return R}}function ir(_){return function(){return _.isSupported()}}var wc=function(_,y,C){var R={};function H(Ei,Mc,$c,Fo,Ko){var Wo=C(_,Ei,Mc,$c,Fo,Ko);return R[Ei]=Wo,Wo}var ie=Object.assign({},y,{hostNonTLS:_.wsHost+":"+_.wsPort,hostTLS:_.wsHost+":"+_.wssPort,httpPath:_.wsPath}),be=Object.assign({},ie,{useTLS:!0}),ke=Object.assign({},y,{hostNonTLS:_.httpHost+":"+_.httpPort,hostTLS:_.httpHost+":"+_.httpsPort,httpPath:_.httpPath}),Ve={loop:!0,timeout:15e3,timeoutLimit:6e4},at=new xo({minPingDelay:1e4,maxPingDelay:_.activityTimeout}),ot=new xo({lives:2,minPingDelay:1e4,maxPingDelay:_.activityTimeout}),Ht=H("ws","ws",3,ie,at),Ci=H("wss","ws",3,be,at),Dc=H("sockjs","sockjs",1,ke),Bo=H("xhr_streaming","xhr_streaming",1,ke,ot),Oc=H("xdr_streaming","xdr_streaming",1,ke,ot),qo=H("xhr_polling","xhr_polling",1,ke),Ir=H("xdr_polling","xdr_polling",1,ke),Lc=new Ua([Ht],Ve),bf=new Ua([Ci],Ve),vf=new Ua([Dc],Ve),Po=new Ua([new bi(ir(Bo),Bo,Oc)],Ve),Go=new Ua([new bi(ir(qo),qo,Ir)],Ve),jr=new Ua([new bi(ir(Po),new To([Po,new rr(Go,{delay:4e3})]),Go)],Ve),or=new bi(ir(jr),jr,vf),Vo;return y.useTLS?Vo=new To([Lc,new rr(or,{delay:2e3})]):Vo=new To([Lc,new rr(bf,{delay:2e3}),new rr(or,{delay:5e3})]),new Ln(new Mn(new bi(ir(Ht),Vo,or)),R,{ttl:18e5,timeline:y.timeline,useTLS:y.useTLS})},Do=wc,Mr=(function(){var _=this;_.timeline.info(_.buildTimelineMessage({transport:_.name+(_.options.useTLS?"s":"")})),_.hooks.isInitialized()?_.changeState("initialized"):_.hooks.file?(_.changeState("initializing"),b.load(_.hooks.file,{useTLS:_.options.useTLS},function(y,C){_.hooks.isInitialized()?(_.changeState("initialized"),C(!0)):(y&&_.onError(y),_.onClose(),C(!1))})):_.onClose()}),Cc={getRequest:function(_){var y=new window.XDomainRequest;return y.ontimeout=function(){_.emit("error",new M),_.close()},y.onerror=function(C){_.emit("error",C),_.close()},y.onprogress=function(){y.responseText&&y.responseText.length>0&&_.onChunk(200,y.responseText)},y.onload=function(){y.responseText&&y.responseText.length>0&&_.onChunk(200,y.responseText),_.emit("finished",200),_.close()},y},abortRequest:function(_){_.ontimeout=_.onerror=_.onprogress=_.onload=null,_.abort()}},Ec=Cc;const $r=256*1024;class tf extends he{constructor(y,C,R){super(),this.hooks=y,this.method=C,this.url=R}start(y){this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=()=>{this.close()},Ge.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(y)}close(){this.unloader&&(Ge.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)}onChunk(y,C){for(;;){var R=this.advanceBuffer(C);if(R)this.emit("chunk",{status:y,data:R});else break}this.isBufferTooLong(C)&&this.emit("buffer_too_long")}advanceBuffer(y){var C=y.slice(this.position),R=C.indexOf(`
`);return R!==-1?(this.position+=R+1,C.slice(0,R)):null}isBufferTooLong(y){return this.position===y.length&&y.length>$r}}var os;(function(_){_[_.CONNECTING=0]="CONNECTING",_[_.OPEN=1]="OPEN",_[_.CLOSED=3]="CLOSED"})(os||(os={}));var Ba=os,Oo=1;class nf{constructor(y,C){this.hooks=y,this.session=cs(1e3)+"/"+Nr(8),this.location=af(C),this.readyState=Ba.CONNECTING,this.openStream()}send(y){return this.sendRaw(JSON.stringify([y]))}ping(){this.hooks.sendHeartbeat(this)}close(y,C){this.onClose(y,C,!0)}sendRaw(y){if(this.readyState===Ba.OPEN)try{return Ge.createSocketRequest("POST",aa(ls(this.location,this.session))).start(y),!0}catch{return!1}else return!1}reconnect(){this.closeStream(),this.openStream()}onClose(y,C,R){this.closeStream(),this.readyState=Ba.CLOSED,this.onclose&&this.onclose({code:y,reason:C,wasClean:R})}onChunk(y){if(y.status===200){this.readyState===Ba.OPEN&&this.onActivity();var C,R=y.data.slice(0,1);switch(R){case"o":C=JSON.parse(y.data.slice(1)||"{}"),this.onOpen(C);break;case"a":C=JSON.parse(y.data.slice(1)||"[]");for(var H=0;H<C.length;H++)this.onEvent(C[H]);break;case"m":C=JSON.parse(y.data.slice(1)||"null"),this.onEvent(C);break;case"h":this.hooks.onHeartbeat(this);break;case"c":C=JSON.parse(y.data.slice(1)||"[]"),this.onClose(C[0],C[1],!0);break}}}onOpen(y){this.readyState===Ba.CONNECTING?(y&&y.hostname&&(this.location.base=Lo(this.location.base,y.hostname)),this.readyState=Ba.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)}onEvent(y){this.readyState===Ba.OPEN&&this.onmessage&&this.onmessage({data:y})}onActivity(){this.onactivity&&this.onactivity()}onError(y){this.onerror&&this.onerror(y)}openStream(){this.stream=Ge.createSocketRequest("POST",aa(this.hooks.getReceiveURL(this.location,this.session))),this.stream.bind("chunk",y=>{this.onChunk(y)}),this.stream.bind("finished",y=>{this.hooks.onFinished(this,y)}),this.stream.bind("buffer_too_long",()=>{this.reconnect()});try{this.stream.start()}catch(y){te.defer(()=>{this.onError(y),this.onClose(1006,"Could not start streaming",!1)})}}closeStream(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)}}function af(_){var y=/([^\?]*)\/*(\??.*)/.exec(_);return{base:y[1],queryString:y[2]}}function ls(_,y){return _.base+"/"+y+"/xhr_send"}function aa(_){var y=_.indexOf("?")===-1?"?":"&";return _+y+"t="+ +new Date+"&n="+Oo++}function Lo(_,y){var C=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(_);return C[1]+y+C[3]}function cs(_){return Ge.randomInt(_)}function Nr(_){for(var y=[],C=0;C<_;C++)y.push(cs(32).toString(32));return y.join("")}var Hr=nf,_c={getReceiveURL:function(_,y){return _.base+"/"+y+"/xhr_streaming"+_.queryString},onHeartbeat:function(_){_.sendRaw("[]")},sendHeartbeat:function(_){_.sendRaw("[]")},onFinished:function(_,y){_.onClose(1006,"Connection interrupted ("+y+")",!1)}},Mo=_c,Ac={getReceiveURL:function(_,y){return _.base+"/"+y+"/xhr"+_.queryString},onHeartbeat:function(){},sendHeartbeat:function(_){_.sendRaw("[]")},onFinished:function(_,y){y===200?_.reconnect():_.onClose(1006,"Connection interrupted ("+y+")",!1)}},vi=Ac,Ta={getRequest:function(_){var y=Ge.getXHRAPI(),C=new y;return C.onreadystatechange=C.onprogress=function(){switch(C.readyState){case 3:C.responseText&&C.responseText.length>0&&_.onChunk(C.status,C.responseText);break;case 4:C.responseText&&C.responseText.length>0&&_.onChunk(C.status,C.responseText),_.emit("finished",C.status),_.close();break}},C},abortRequest:function(_){_.onreadystatechange=null,_.abort()}},$o=Ta,Si={createStreamingSocket(_){return this.createSocket(Mo,_)},createPollingSocket(_){return this.createSocket(vi,_)},createSocket(_,y){return new Hr(_,y)},createXHR(_,y){return this.createRequest($o,_,y)},createRequest(_,y,C){return new tf(_,y,C)}},ka=Si;ka.createXDR=function(_,y){return this.createRequest(Ec,_,y)};var No=ka,us={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:u,DependenciesReceivers:m,getDefaultStrategy:Do,Transports:Ft,transportConnectionInitializer:Mr,HTTPFactory:No,TimelineTransport:tr,getXHRAPI(){return window.XMLHttpRequest},getWebSocketAPI(){return window.WebSocket||window.MozWebSocket},setup(_){window.Pusher=_;var y=()=>{this.onDocumentBody(_.ready)};window.JSON?y():b.load("json2",{},y)},getDocument(){return document},getProtocol(){return this.getDocument().location.protocol},getAuthorizers(){return{ajax:Ae,jsonp:Gn}},onDocumentBody(_){document.body?_():setTimeout(()=>{this.onDocumentBody(_)},0)},createJSONPRequest(_,y){return new mn(_,y)},createScriptRequest(_){return new en(_)},getLocalStorage(){try{return window.localStorage}catch{return}},createXHR(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest(){var _=this.getXHRAPI();return new _},createMicrosoftXHR(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork(){return Dn},createWebSocket(_){var y=this.getWebSocketAPI();return new y(_)},createSocketRequest(_,y){if(this.isXHRSupported())return this.HTTPFactory.createXHR(_,y);if(this.isXDRSupported(y.indexOf("https:")===0))return this.HTTPFactory.createXDR(_,y);throw"Cross-origin HTTP requests are not supported"},isXHRSupported(){var _=this.getXHRAPI();return!!_&&new _().withCredentials!==void 0},isXDRSupported(_){var y=_?"https:":"http:",C=this.getProtocol();return!!window.XDomainRequest&&C===y},addUnloadListener(_){window.addEventListener!==void 0?window.addEventListener("unload",_,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",_)},removeUnloadListener(_){window.addEventListener!==void 0?window.removeEventListener("unload",_,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",_)},randomInt(_){return Math.floor(function(){return(window.crypto||window.msCrypto).getRandomValues(new Uint32Array(1))[0]/Math.pow(2,32)}()*_)}},Ge=us,zr;(function(_){_[_.ERROR=3]="ERROR",_[_.INFO=6]="INFO",_[_.DEBUG=7]="DEBUG"})(zr||(zr={}));var sr=zr;class xc{constructor(y,C,R){this.key=y,this.session=C,this.events=[],this.options=R||{},this.sent=0,this.uniqueID=0}log(y,C){y<=this.options.level&&(this.events.push(ye({},C,{timestamp:te.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}error(y){this.log(sr.ERROR,y)}info(y){this.log(sr.INFO,y)}debug(y){this.log(sr.DEBUG,y)}isEmpty(){return this.events.length===0}send(y,C){var R=ye({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],y(R,(H,ie)=>{H||this.sent++,C&&C(H,ie)}),!0}generateUniqueID(){return this.uniqueID++,this.uniqueID}}class bn{constructor(y,C,R,H){this.name=y,this.priority=C,this.transport=R,this.options=H||{}}isSupported(){return this.transport.isSupported({useTLS:this.options.useTLS})}connect(y,C){if(this.isSupported()){if(this.priority<y)return qa(new O,C)}else return qa(new B,C);var R=!1,H=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),ie=null,be=function(){H.unbind("initialized",be),H.connect()},ke=function(){ie=Aa.createHandshake(H,function(Ht){R=!0,ot(),C(null,Ht)})},Ve=function(Ht){ot(),C(Ht)},at=function(){ot();var Ht;Ht=Pn(H),C(new L(Ht))},ot=function(){H.unbind("initialized",be),H.unbind("open",ke),H.unbind("error",Ve),H.unbind("closed",at)};return H.bind("initialized",be),H.bind("open",ke),H.bind("error",Ve),H.bind("closed",at),H.initialize(),{abort:()=>{R||(ot(),ie?ie.close():H.close())},forceMinPriority:Ht=>{R||this.priority<Ht&&(ie?ie.close():H.close())}}}}function qa(_,y){return te.defer(function(){y(_)}),{abort:function(){},forceMinPriority:function(){}}}const{Transports:ds}=Ge;var wi=function(_,y,C,R,H,ie){var be=ds[C];if(!be)throw new U(C);var ke=(!_.enabledTransports||Me(_.enabledTransports,y)!==-1)&&(!_.disabledTransports||Me(_.disabledTransports,y)===-1),Ve;return ke?(H=Object.assign({ignoreNullOrigin:_.ignoreNullOrigin},H),Ve=new bn(y,R,ie?ie.getAssistant(be):be,H)):Ve=rf,Ve},rf={isSupported:function(){return!1},connect:function(_,y){var C=te.defer(function(){y(new B)});return{abort:function(){C.ensureAborted()},forceMinPriority:function(){}}}};function Ho(_){if(_==null)throw"You must pass an options object";if(_.cluster==null)throw"Options object must provide a cluster";"disableStats"in _&&yt.warn("The disableStats option is deprecated in favor of enableStats")}const zo=(_,y)=>{var C="socket_id="+encodeURIComponent(_.socketId);for(var R in y.params)C+="&"+encodeURIComponent(R)+"="+encodeURIComponent(y.params[R]);if(y.paramsProvider!=null){let H=y.paramsProvider();for(var R in H)C+="&"+encodeURIComponent(R)+"="+encodeURIComponent(H[R])}return C};var hs=_=>{if(typeof Ge.getAuthorizers()[_.transport]>"u")throw`'${_.transport}' is not a recognized auth transport`;return(y,C)=>{const R=zo(y,_);Ge.getAuthorizers()[_.transport](Ge,R,_,A.UserAuthentication,C)}};const Tc=(_,y)=>{var C="socket_id="+encodeURIComponent(_.socketId);C+="&channel_name="+encodeURIComponent(_.channelName);for(var R in y.params)C+="&"+encodeURIComponent(R)+"="+encodeURIComponent(y.params[R]);if(y.paramsProvider!=null){let H=y.paramsProvider();for(var R in H)C+="&"+encodeURIComponent(R)+"="+encodeURIComponent(H[R])}return C};var sf=_=>{if(typeof Ge.getAuthorizers()[_.transport]>"u")throw`'${_.transport}' is not a recognized auth transport`;return(y,C)=>{const R=Tc(y,_);Ge.getAuthorizers()[_.transport](Ge,R,_,A.ChannelAuthorization,C)}};const of=(_,y,C)=>{const R={authTransport:y.transport,authEndpoint:y.endpoint,auth:{params:y.params,headers:y.headers}};return(H,ie)=>{const be=_.channel(H.channelName);C(be,R).authorize(H.socketId,ie)}};function Io(_,y){let C={activityTimeout:_.activityTimeout||f.activityTimeout,cluster:_.cluster,httpPath:_.httpPath||f.httpPath,httpPort:_.httpPort||f.httpPort,httpsPort:_.httpsPort||f.httpsPort,pongTimeout:_.pongTimeout||f.pongTimeout,statsHost:_.statsHost||f.stats_host,unavailableTimeout:_.unavailableTimeout||f.unavailableTimeout,wsPath:_.wsPath||f.wsPath,wsPort:_.wsPort||f.wsPort,wssPort:_.wssPort||f.wssPort,enableStats:ff(_),httpHost:lf(_),useTLS:df(_),wsHost:cf(_),userAuthenticator:kc(_),channelAuthorizer:gf(_,y)};return"disabledTransports"in _&&(C.disabledTransports=_.disabledTransports),"enabledTransports"in _&&(C.enabledTransports=_.enabledTransports),"ignoreNullOrigin"in _&&(C.ignoreNullOrigin=_.ignoreNullOrigin),"timelineParams"in _&&(C.timelineParams=_.timelineParams),"nacl"in _&&(C.nacl=_.nacl),C}function lf(_){return _.httpHost?_.httpHost:_.cluster?`sockjs-${_.cluster}.pusher.com`:f.httpHost}function cf(_){return _.wsHost?_.wsHost:uf(_.cluster)}function uf(_){return`ws-${_}.pusher.com`}function df(_){return Ge.getProtocol()==="https:"?!0:_.forceTLS!==!1}function ff(_){return"enableStats"in _?_.enableStats:"disableStats"in _?!_.disableStats:!1}function kc(_){const y=Object.assign(Object.assign({},f.userAuthentication),_.userAuthentication);return"customHandler"in y&&y.customHandler!=null?y.customHandler:hs(y)}function hf(_,y){let C;return"channelAuthorization"in _?C=Object.assign(Object.assign({},f.channelAuthorization),_.channelAuthorization):(C={transport:_.authTransport||f.authTransport,endpoint:_.authEndpoint||f.authEndpoint},"auth"in _&&("params"in _.auth&&(C.params=_.auth.params),"headers"in _.auth&&(C.headers=_.auth.headers)),"authorizer"in _&&(C.customHandler=of(y,C,_.authorizer))),C}function gf(_,y){const C=hf(_,y);return"customHandler"in C&&C.customHandler!=null?C.customHandler:sf(C)}class pf extends he{constructor(y){super(function(C,R){yt.debug(`No callbacks on watchlist events for ${C}`)}),this.pusher=y,this.bindWatchlistInternalEvent()}handleEvent(y){y.data.events.forEach(C=>{this.emit(C.name,C)})}bindWatchlistInternalEvent(){this.pusher.connection.bind("message",y=>{var C=y.event;C==="pusher_internal:watchlist_events"&&this.handleEvent(y)})}}function mf(){let _,y;return{promise:new Promise((R,H)=>{_=R,y=H}),resolve:_,reject:y}}var jo=mf;class yf extends he{constructor(y){super(function(C,R){yt.debug("No callbacks on user for "+C)}),this.signin_requested=!1,this.user_data=null,this.serverToUserChannel=null,this.signinDonePromise=null,this._signinDoneResolve=null,this._onAuthorize=(C,R)=>{if(C){yt.warn(`Error during signin: ${C}`),this._cleanup();return}this.pusher.send_event("pusher:signin",{auth:R.auth,user_data:R.user_data})},this.pusher=y,this.pusher.connection.bind("state_change",({previous:C,current:R})=>{C!=="connected"&&R==="connected"&&this._signin(),C==="connected"&&R!=="connected"&&(this._cleanup(),this._newSigninPromiseIfNeeded())}),this.watchlist=new pf(y),this.pusher.connection.bind("message",C=>{var R=C.event;R==="pusher:signin_success"&&this._onSigninSuccess(C.data),this.serverToUserChannel&&this.serverToUserChannel.name===C.channel&&this.serverToUserChannel.handleEvent(C)})}signin(){this.signin_requested||(this.signin_requested=!0,this._signin())}_signin(){this.signin_requested&&(this._newSigninPromiseIfNeeded(),this.pusher.connection.state==="connected"&&this.pusher.config.userAuthenticator({socketId:this.pusher.connection.socket_id},this._onAuthorize))}_onSigninSuccess(y){try{this.user_data=JSON.parse(y.user_data)}catch{yt.error(`Failed parsing user data after signin: ${y.user_data}`),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){yt.error(`user_data doesn't contain an id. user_data: ${this.user_data}`),this._cleanup();return}this._signinDoneResolve(),this._subscribeChannels()}_subscribeChannels(){const y=C=>{C.subscriptionPending&&C.subscriptionCancelled?C.reinstateSubscription():!C.subscriptionPending&&this.pusher.connection.state==="connected"&&C.subscribe()};this.serverToUserChannel=new as(`#server-to-user-${this.user_data.id}`,this.pusher),this.serverToUserChannel.bind_global((C,R)=>{C.indexOf("pusher_internal:")===0||C.indexOf("pusher:")===0||this.emit(C,R)}),y(this.serverToUserChannel)}_cleanup(){this.user_data=null,this.serverToUserChannel&&(this.serverToUserChannel.unbind_all(),this.serverToUserChannel.disconnect(),this.serverToUserChannel=null),this.signin_requested&&this._signinDoneResolve()}_newSigninPromiseIfNeeded(){if(!this.signin_requested||this.signinDonePromise&&!this.signinDonePromise.done)return;const{promise:y,resolve:C}=jo();y.done=!1;const R=()=>{y.done=!0};y.then(R).catch(R),this.signinDonePromise=y,this._signinDoneResolve=C}}class nn{static ready(){nn.isReady=!0;for(var y=0,C=nn.instances.length;y<C;y++)nn.instances[y].connect()}static getClientFeatures(){return Ie(vt({ws:Ge.Transports.ws},function(y){return y.isSupported({})}))}constructor(y,C){Rc(y),Ho(C),this.key=y,this.config=Io(C,this),this.channels=Aa.createChannels(),this.global_emitter=new he,this.sessionID=Ge.randomInt(1e9),this.timeline=new xc(this.key,this.sessionID,{cluster:this.config.cluster,features:nn.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:sr.INFO,version:f.VERSION}),this.config.enableStats&&(this.timelineSender=Aa.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+Ge.TimelineTransport.name}));var R=H=>Ge.getDefaultStrategy(this.config,H,wi);this.connection=Aa.createConnectionManager(this.key,{getStrategy:R,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",H=>{var ie=H.event,be=ie.indexOf("pusher_internal:")===0;if(H.channel){var ke=this.channel(H.channel);ke&&ke.handleEvent(H)}be||this.global_emitter.emit(H.event,H.data)}),this.connection.bind("connecting",()=>{this.channels.disconnect()}),this.connection.bind("disconnected",()=>{this.channels.disconnect()}),this.connection.bind("error",H=>{yt.warn(H)}),nn.instances.push(this),this.timeline.info({instances:nn.instances.length}),this.user=new yf(this),nn.isReady&&this.connect()}channel(y){return this.channels.find(y)}allChannels(){return this.channels.all()}connect(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var y=this.connection.isUsingTLS(),C=this.timelineSender;this.timelineSenderTimer=new ue(6e4,function(){C.send(y)})}}disconnect(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)}bind(y,C,R){return this.global_emitter.bind(y,C,R),this}unbind(y,C,R){return this.global_emitter.unbind(y,C,R),this}bind_global(y){return this.global_emitter.bind_global(y),this}unbind_global(y){return this.global_emitter.unbind_global(y),this}unbind_all(y){return this.global_emitter.unbind_all(),this}subscribeAll(){var y;for(y in this.channels.channels)this.channels.channels.hasOwnProperty(y)&&this.subscribe(y)}subscribe(y){var C=this.channels.add(y,this);return C.subscriptionPending&&C.subscriptionCancelled?C.reinstateSubscription():!C.subscriptionPending&&this.connection.state==="connected"&&C.subscribe(),C}unsubscribe(y){var C=this.channels.find(y);C&&C.subscriptionPending?C.cancelSubscription():(C=this.channels.remove(y),C&&C.subscribed&&C.unsubscribe())}send_event(y,C,R){return this.connection.send_event(y,C,R)}shouldUseTLS(){return this.config.useTLS}signin(){this.user.signin()}}nn.instances=[],nn.isReady=!1,nn.logToConsole=!1,nn.Runtime=Ge,nn.ScriptReceivers=Ge.ScriptReceivers,nn.DependenciesReceivers=Ge.DependenciesReceivers,nn.auth_callbacks=Ge.auth_callbacks;var Uo=r.default=nn;function Rc(_){if(_==null)throw"You must pass your app key when you instantiate Pusher."}Ge.setup(nn)})])})})(Fd)),Fd.exports}var OE=DE();const km=Wa(OE),$t=dt("WebSocketManager");class LE{constructor(){$(this,"echo",null);$(this,"subscriptions",new Map);$(this,"initialized",!1);$(this,"config",null)}configure(e){if(this.initialized){$t.warn("[WebSocketManager] 이미 초기화되어 설정을 변경할 수 없습니다.");return}this.config=e,$t.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){$t.warn("[WebSocketManager] WebSocket 설정이 없습니다. initTemplateApp에서 websocket 옵션을 전달해주세요.");return}const{appKey:e,host:a="localhost",port:r=80,scheme:i="https",authEndpoint:o="/api/broadcasting/auth"}=this.config,u=Number(r)||80,d=i==="https";$t.log("[WebSocketManager] 연결 설정:",{host:a,port:u,scheme:i,useTLS:d,authEndpoint:o}),window.Pusher=km;const f=localStorage.getItem("auth_token"),g={wsHost:a,wsPort:u,wssPort:u,forceTLS:d,disableStats:!0,enabledTransports:["ws","wss"],cluster:"mt1",authEndpoint:o,auth:{headers:{Authorization:f?`Bearer ${f}`:"",Accept:"application/json"}}};$t.log("[WebSocketManager] Pusher 옵션:",g);const m=new km(e,g);m.connection.bind("connecting",()=>{$t.log("[WebSocketManager] 연결 시도 중...")}),m.connection.bind("connected",()=>{$t.log("[WebSocketManager] 연결 성공! Socket ID:",m.connection.socket_id)}),m.connection.bind("failed",()=>{$t.error("[WebSocketManager] 연결 실패 - WebSocket을 사용할 수 없습니다.")}),m.connection.bind("error",b=>{$t.error("[WebSocketManager] 연결 오류:",b)}),m.connection.bind("state_change",b=>{$t.log(`[WebSocketManager] 상태 변경: ${b.previous} → ${b.current}`)}),m.connection.bind("unavailable",()=>{$t.error("[WebSocketManager] WebSocket 사용 불가 - 연결할 수 없습니다.")}),m.connection.bind("disconnected",()=>{$t.warn("[WebSocketManager] 연결이 끊어졌습니다.")}),$t.log("[WebSocketManager] 초기 연결 상태:",m.connection.state),this.echo=new RE({broadcaster:"reverb",client:m}),$t.log("[WebSocketManager] 연결 시작 시도..."),m.connect(),window.Echo=this.echo,this.initialized=!0,$t.log("[WebSocketManager] Echo 초기화 완료")}subscribe(e,a,r,i={}){if(this.initialize(),!this.echo)return $t.warn("[WebSocketManager] Echo가 초기화되지 않았습니다."),"";const{channelType:o="private"}=i,u=`${e}:${a}`;if(this.subscriptions.has(u))return $t.log(`[WebSocketManager] 이미 구독 중: ${u}`),u;let d;switch(o){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(`.${a}`,r),this.subscriptions.set(u,d),$t.log(`[WebSocketManager] 구독 완료: ${u} (${o})`),u}unsubscribe(e){const a=this.subscriptions.get(e);if(!a)return;const r=e.lastIndexOf(":"),i=r>=0?e.substring(r+1):"";if(i)try{a.stopListening(`.${i}`)}catch(o){$t.warn(`[WebSocketManager] stopListening 실패: ${e}`,o)}this.subscriptions.delete(e),$t.log(`[WebSocketManager] 구독 해제: ${e}`)}leaveChannel(e){if(!this.echo)return;this.echo.leave(e);const a=[];this.subscriptions.forEach((r,i)=>{i.startsWith(`${e}:`)&&a.push(i)}),a.forEach(r=>this.subscriptions.delete(r)),$t.log(`[WebSocketManager] 채널 구독 해제: ${e}`)}disconnect(){this.echo&&(this.echo.disconnect(),this.subscriptions.clear(),this.initialized=!1,$t.log("[WebSocketManager] 연결 종료"))}getEcho(){return this.echo}isInitialized(){return this.initialized}isConfigured(){return this.config!==null&&!!this.config.appKey}getSubscriptionCount(){return this.subscriptions.size}}const hc=new LE,gt=dt("DataSourceManager"),ME=new vn;function gc(l,e){const a=l.match(/^\{\{(.+)\}\}$/);if(a){const r=a[1].trim();try{return ME.evaluateExpression(r,e)}catch(i){return gt.error("Failed to evaluate param expression:",r,i),l}}return Pi(l,e,{skipCache:!0})}function Rm(l){const e={};for(const a of l.keys()){if(a in e)continue;const r=l.getAll(a);r.length>1?e[a]=r:r.length===1&&(a.endsWith("[]")?e[a]=r:e[a]=r[0])}return e}function $E(){try{return window.G7Core?.devTools}catch{return}}const bc=class bc{constructor(e={}){$(this,"options");$(this,"dataCache",new Map);$(this,"bindingEngine");$(this,"globalHeaders",[]);this.options=e,this.bindingEngine=new vn}setGlobalHeaders(e){this.globalHeaders=e||[]}matchesPattern(e,a){if(a==="*")return!0;const r=a.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*");return new RegExp(`^${r}$`).test(e)}toFormData(e){const a=new FormData;for(const[r,i]of Object.entries(e))i instanceof File||i instanceof Blob?a.append(r,i):i!=null&&a.append(r,typeof i=="object"?JSON.stringify(i):String(i));return a}getMatchingGlobalHeaders(e,a){const r={};for(const i of this.globalHeaders)this.matchesPattern(e,i.pattern)&&Object.entries(i.headers).forEach(([o,u])=>{const d=gc(u,a);d!=null&&d!==""&&(r[o]=String(d))});return r}filterByCondition(e,a={}){const r=new Set,i=[];for(const o of e){if(r.has(o.id))continue;if(!o.if&&!o.conditions){r.add(o.id),i.push(o);continue}qi({if:o.if,conditions:o.conditions},a,this.bindingEngine,`data_source:${o.id}`)&&(r.add(o.id),i.push(o))}return i}checkErrorCondition(e,a){if(!e.errorCondition?.if||e.errorCondition?.errorCode===void 0)return null;try{const r={response:a};if(qi({if:e.errorCondition.if},r,this.bindingEngine,`errorCondition:${e.id}`))return gt.log(`errorCondition matched for ${e.id}, triggering error ${e.errorCondition.errorCode}`),e.errorCondition.errorCode}catch(r){gt.error(`Failed to evaluate errorCondition for ${e.id}:`,r)}return null}async fetchDataSources(e,a={},r=new URLSearchParams,i,o){const u={},d=!!this.options.sampleProvider,f=e.filter(g=>(d||g.auto_fetch!==!1)&&g.type!=="websocket");return await Promise.all(f.map(async g=>{try{const m=await this.fetchDataSource(g,a,r,i,o);u[g.id]=m,this.dataCache.set(g.id,{data:m,timestamp:Date.now()});const b=this.checkErrorCondition(g,m);if(b!==null){const v={status:b,message:`Error condition matched for ${g.id}`,data:m},E=ma(),S=E.resolve(b,{errorHandling:g.errorHandling,onError:g.onError});if(S.handler)try{await E.execute(S.handler,v)}catch(A){gt.error(`Error executing errorCondition handler for ${g.id}:`,A)}g.fallback!==void 0&&(u[g.id]=g.fallback,this.dataCache.set(g.id,{data:g.fallback,timestamp:Date.now()}),gt.log(`Using fallback data for ${g.id} (errorCondition)`));return}if(g.onSuccess)try{const v={data:m,sourceId:g.id};await this.executeOnSuccessHandler(g.onSuccess,v)}catch(v){gt.error(`Error executing onSuccess handler for ${g.id}:`,v)}}catch(m){gt.error(`Failed to fetch data source: ${g.id}`,m);const b=m?.response?.status||m?.status||500,v=m?.response?.data,E=v?.message||m.message||"Unknown error",S={status:b,message:E,errors:v?.errors,data:v,statusText:m?.response?.statusText},A=ma(),T=A.resolve(b,{errorHandling:g.errorHandling,onError:g.onError});if(T.handler)try{await A.execute(T.handler,S)}catch(D){gt.error(`Error executing error handler for ${g.id}:`,D)}g.fallback!==void 0&&(u[g.id]=g.fallback,this.dataCache.set(g.id,{data:g.fallback,timestamp:Date.now()}),gt.log(`Using fallback data for ${g.id}`)),this.options.onError&&this.options.onError(m,g)}})),u}async fetchDataSourcesWithResults(e,a={},r=new URLSearchParams,i,o,u){if(e.some(m=>m.type==="websocket")){const m=e.filter(b=>b.type==="websocket").map(b=>b.id).join(", ");gt.warn(`fetchDataSourcesWithResults received WebSocket sources (caller should filter them out before calling): ${m}. WebSocket sources are event listeners, not data providers — they should not be passed to fetch.`)}const f=u?.ignoreAutoFetch?e.filter(m=>m.type!=="websocket"):e.filter(m=>m.auto_fetch!==!1&&m.type!=="websocket");return await Promise.all(f.map(async m=>{try{const b=await this.fetchDataSource(m,a,r,i,o);this.dataCache.set(m.id,{data:b,timestamp:Date.now()});const v=this.checkErrorCondition(m,b);if(v!==null){const E={status:v,message:`Error condition matched for ${m.id}`,data:b},S=ma(),A=S.resolve(v,{errorHandling:m.errorHandling,onError:m.onError});let T=!1;if(A.handler)if(m.loading_strategy==="blocking")S.execute(A.handler,E).catch(D=>{gt.error(`Error executing errorCondition handler for ${m.id}:`,D)}),T=!0;else try{await S.execute(A.handler,E),T=!0}catch(D){gt.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()}),gt.log(`Using fallback data for ${m.id} (errorCondition)`),{id:m.id,state:"success",data:m.fallback}):{id:m.id,state:"error",error:new Error(`Error condition matched: ${v}`),errorCode:v,errorHandled:T}}if(m.onSuccess)try{const E={data:b,sourceId:m.id};await this.executeOnSuccessHandler(m.onSuccess,E)}catch(E){gt.error(`Error executing onSuccess handler for ${m.id}:`,E)}return{id:m.id,state:"success",data:b}}catch(b){gt.error(`Failed to fetch data source: ${m.id}`,b);const v=b?.response?.status||b?.status||500,E=b?.response?.data,S=E?.message||b.message||"Unknown error",A={status:v,message:S,errors:E?.errors,data:E,statusText:b?.response?.statusText},T=ma(),D=T.resolve(v,{errorHandling:m.errorHandling,onError:m.onError});let M=!1;if(D.handler)if(m.loading_strategy==="blocking")T.execute(D.handler,A).catch(O=>{gt.error(`Error executing error handler for ${m.id}:`,O)}),M=!0;else try{await T.execute(D.handler,A),M=!0}catch(O){gt.error(`Error executing error handler for ${m.id}:`,O)}return m.fallback!==void 0?(this.dataCache.set(m.id,{data:m.fallback,timestamp:Date.now()}),gt.log(`Using fallback data for ${m.id}`),{id:m.id,state:"success",data:m.fallback}):(this.options.onError&&this.options.onError(b,m),{id:m.id,state:"error",error:b,errorCode:v,errorHandled:M})}}))}fetchDataSourcesInBackground(e,a={},r=new URLSearchParams,i){e.filter(u=>u.auto_fetch!==!1&&u.loading_strategy==="background"&&u.type!=="websocket").forEach(u=>{this.fetchDataSource(u,a,r).then(async d=>{this.dataCache.set(u.id,{data:d,timestamp:Date.now()});const f=this.checkErrorCondition(u,d);if(f!==null){const g={status:f,message:`Error condition matched for ${u.id}`,data:d},m=ma(),b=m.resolve(f,{errorHandling:u.errorHandling,onError:u.onError});if(b.handler)try{await m.execute(b.handler,g)}catch(v){gt.error(`Error executing errorCondition handler for ${u.id}:`,v)}u.fallback!==void 0&&(this.dataCache.set(u.id,{data:u.fallback,timestamp:Date.now()}),gt.log(`Using fallback data for ${u.id} (errorCondition)`),i&&i(u.id,u.fallback));return}if(u.onSuccess)try{const g={data:d,sourceId:u.id};await this.executeOnSuccessHandler(u.onSuccess,g)}catch(g){gt.error(`Error executing onSuccess handler for ${u.id}:`,g)}i&&i(u.id,d)}).catch(async d=>{gt.error(`Background fetch failed: ${u.id}`,d);const f=d?.response?.status||d?.status||500,g=d?.response?.data,m=g?.message||d.message||"Unknown error",b={status:f,message:m,errors:g?.errors,data:g,statusText:d?.response?.statusText},v=ma(),E=v.resolve(f,{errorHandling:u.errorHandling,onError:u.onError});if(E.handler)try{await v.execute(E.handler,b)}catch(S){gt.error(`Error executing error handler for ${u.id}:`,S)}if(u.fallback!==void 0){this.dataCache.set(u.id,{data:u.fallback,timestamp:Date.now()}),gt.log(`Using fallback data for ${u.id}`),i&&i(u.id,u.fallback);return}this.options.onError&&this.options.onError(d,u)})})}async fetchDataSource(e,a,r,i,o){switch(e.type){case"api":return this.fetchApiDataSource(e,a,r,i,o);case"static":return e.data;case"route_params":return a;case"query_params":return Rm(r);default:throw new Error(`Unknown data source type: ${e.type}`)}}async fetchApiDataSource(e,a,r,i,o){if(this.options.sampleProvider?.has(e.id))return await Promise.resolve(this.options.sampleProvider.resolve(e));if(!e.endpoint)throw new Error(`API data source ${e.id} has no endpoint`);const u={route:a,query:Rm(r)};i&&(u._global=i),o&&(u._local=o);let d=Pi(e.endpoint,u,{skipCache:!0});const f=e.method||"GET",m=(e.contentType?typeof e.contentType=="string"&&e.contentType.includes("{{")?Pi(e.contentType,u,{skipCache:!0}):e.contentType:"application/json")==="multipart/form-data";let b=m?{...e.params||{}}:JSON.parse(JSON.stringify(e.params||{}));Object.entries(b).forEach(([S,A])=>{typeof A=="string"&&(b[S]=gc(A,u))}),Object.keys(b).forEach(S=>{b[S]===""&&delete b[S]});const v=$E();let E=null;if(v?.isEnabled()){v.trackDataSourceDefinition({id:e.id,type:e.type,endpoint:d,method:f,autoFetch:e.auto_fetch,initLocal:e.initLocal,initGlobal:e.initGlobal});let S=d;if(f==="GET"&&Object.keys(b).length>0){const A=new URLSearchParams;Object.entries(b).forEach(([D,M])=>{Array.isArray(M)?M.forEach(O=>A.append(D,String(O))):M!=null&&A.append(D,String(M))});const T=A.toString();S=T?`${d}?${T}`:d}E=v.trackRequest(S,f,{requestBody:f!=="GET"?b:void 0,dataSourceId:e.id}),v.trackDataSourceLoading(e.id)}try{let S;const A=e.auth_mode??(e.auth_required===!0?"required":"none"),T=ga.getInstance().isAuthenticated();if(A==="required"&&!T){gt.log(`[DataSourceManager] Skipping ${e.id}: auth_mode is 'required' but no token available`),v?.isEnabled()&&(v.trackDataSourceError(e.id,"Skipped: auth_mode required but not authenticated"),E&&v.failRequest(E,"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"&&T;if(D){const M=$a(),O=d.startsWith("/api/")?d.substring(4):d.startsWith("/api")?d.substring(4)||"/":d;this.options.onError&&gt.log(`[DataSourceManager] Normalized endpoint: ${d} -> ${O}`);const L=this.getMatchingGlobalHeaders(d,u),P={};e.headers&&Object.entries(e.headers).forEach(([ge,Ae])=>{const Oe=gc(Ae,u);Oe!=null&&Oe!==""&&(P[ge]=String(Oe))});const U={...L,...P},B=Object.keys(U).length>0,Y=m?this.toFormData(b):b;switch(f){case"GET":S=await M.get(O,{params:b,...B&&{headers:U}});break;case"POST":B?S=await M.post(O,Y,{headers:U}):S=await M.post(O,Y);break;case"PUT":B?S=await M.put(O,Y,{headers:U}):S=await M.put(O,Y);break;case"PATCH":B?S=await M.patch(O,Y,{headers:U}):S=await M.patch(O,Y);break;case"DELETE":S=await M.delete(O,{params:b,...B&&{headers:U}});break;default:throw new Error(`Unsupported HTTP method: ${f}`)}}else{let M=d;if(f==="GET"){const Y=new URLSearchParams(b).toString();M=Y?`${d}?${Y}`:d}const O={...m?{}:{"Content-Type":"application/json"},Accept:"application/json"};if(typeof window<"u"){const Y=localStorage.getItem("g7_locale");Y&&(O["Accept-Language"]=Y)}const L=this.getMatchingGlobalHeaders(d,u);Object.assign(O,L),e.headers&&Object.entries(e.headers).forEach(([Y,ge])=>{const Ae=gc(ge,u);Ae!=null&&Ae!==""&&(O[Y]=String(Ae))});let P;f!=="GET"&&(m?(P=this.toFormData(b),delete O["Content-Type"]):P=JSON.stringify(b));const U=await fetch(M,{method:f,headers:O,body:P});let B;try{B=await U.json()}catch{B=null}if(E&&v?.isEnabled()&&(v.completeRequest(E,U.status,B),E=null),!U.ok){v?.isEnabled()&&v.trackDataSourceError(e.id,`HTTP ${U.status}: ${U.statusText}`);const Y=new Error(`HTTP error! status: ${U.status}`);throw Y.response={status:U.status,statusText:U.statusText,data:B},Y.status=U.status,Y}S=B,v?.isEnabled()&&v.trackDataSourceLoaded(e.id,S)}return D&&E&&v?.isEnabled()&&(v.completeRequest(E,200,S),v.trackDataSourceLoaded(e.id,S)),S}catch(S){if(E&&v?.isEnabled()){const A=S;A?.response?v.completeRequest(E,A.response.status,A.response.data):v.failRequest(E,S instanceof Error?S.message:String(S)),v.trackDataSourceError(e.id,S instanceof Error?S.message:String(S))}throw S}}getCachedData(e){const a=this.dataCache.get(e);if(!a)return;if(Date.now()-a.timestamp>bc.DATA_CACHE_TTL){this.dataCache.delete(e);return}return a.data}clearCache(){this.dataCache.clear()}subscribeWebSockets(e,a,r={}){const i=[],o=e.filter(u=>u.type==="websocket");return o.length===0||o.forEach(u=>{if(!u.channel||!u.event){gt.warn(`WebSocket source ${u.id} missing channel or event`);return}let d,f;try{d=Pi(u.channel,r,{skipCache:!0}),f=Pi(u.event,r,{skipCache:!0})}catch(b){gt.error(`Failed to resolve WebSocket channel/event for source ${u.id}:`,b);return}const g=b=>!!(!b||b.trim()===""||b.includes("{{")||b.endsWith(".")||b.endsWith(":")||b.startsWith(".")||b.startsWith(":")||b.includes("..")||b.includes("::"));if(g(d)||g(f)){gt.warn(`WebSocket source ${u.id} has invalid channel/event after expression resolution, skipping. Original channel="${u.channel}", resolved="${d}". Original event="${u.event}", resolved="${f}". Available context keys: [${Object.keys(r).join(", ")}]`);return}const m=hc.subscribe(d,f,b=>{const v=u.target_source||u.id;this.dataCache.set(v,{data:b,timestamp:Date.now()}),a(v,b)},{channelType:u.channel_type||"private"});m&&i.push(m)}),i}unsubscribeWebSockets(e){e.length!==0&&e.forEach(a=>{hc.unsubscribe(a)})}async executeOnSuccessHandler(e,a){const r=this.options.actionDispatcher??xp();if(!r){gt.warn("ActionDispatcher not available, skipping onSuccess handler");return}const i=Array.isArray(e)?e:[e];for(const o of i)try{await r.dispatchAction({type:"click",...o},{data:{response:a}})}catch(u){throw gt.error("Failed to execute onSuccess handler:",u),u}}};$(bc,"DATA_CACHE_TTL",3e5);let Sa=bc;const NE=new Sa,hi=dt("ModalDataSourceWrapper");function HE(l,e){if(!l||!e)return l;const r=e.replace(/\?\./g,".").split(/\.(?![^\[]*\])/).flatMap(o=>{const u=o.match(/^([^\[]*)((?:\[\d+\])*)$/);if(u){const[,d,f]=u,g=[];d&&g.push(d);const m=f.match(/\[\d+\]/g);return m&&g.push(...m),g}return[o]}).filter(o=>o!=="");let i=l;for(const o of r){if(i==null)return;if(o.startsWith("[")&&o.endsWith("]")){const u=parseInt(o.slice(1,-1),10);i=i[u]}else i=i[o]}return i}const Dm=({isOpen:l,modalId:e,dataSources:a,dataContext:r,globalStateUpdater:i,bindingEngine:o,debug:u=!1,children:d})=>{const[f,g]=N.useState(!1),[m,b]=N.useState(!1),v=N.useRef(!1),E=N.useRef(null);E.current||(E.current=new Sa);const S=N.useCallback(async()=>{if(!(!a||a.length===0)&&E.current){g(!0);try{const A=r.route||{},T=new URLSearchParams(window.location.search),D=a.map(O=>{let L={...O};if(O.endpoint&&o){const P=o.resolveBindings(O.endpoint,r,{skipCache:!0});L.endpoint=P}if(O.params&&o){const P={};Object.entries(O.params).forEach(([U,B])=>{typeof B=="string"?P[U]=o.resolveBindings(B,r,{skipCache:!0}):P[U]=B}),L.params=P}return L});u&&hi.log(`[ModalDataSourceWrapper] Modal "${e}" fetching data sources:`,D.map(O=>({id:O.id,endpoint:O.endpoint})));const M=await E.current.fetchDataSourcesWithResults(D,A,T);i&&M.forEach(O=>{if(O.state==="success"&&O.data!==void 0){const L=D.find(P=>P.id===O.id);if(L?.initGlobal){const P=O.data?.data??O.data,U=Array.isArray(L.initGlobal)?L.initGlobal:[L.initGlobal];for(const B of U)if(typeof B=="string")i({[B]:P}),u&&hi.log(`[ModalDataSourceWrapper] Modal "${e}" initGlobal: ${O.id}.data -> _global.${B}`);else if(typeof B=="object"&&B.key){const{key:Y,path:ge}=B,Ae=ge?HE(P,ge):P;i({[Y]:Ae}),u&&hi.log(`Modal "${e}" initGlobal: ${O.id}.data${ge?"."+ge:""} -> _global.${Y}`)}}}else O.state==="error"&&hi.error(`Modal "${e}" data source error:`,O.id,O.error)}),u&&hi.log(`Modal "${e}" data sources fetched successfully`)}catch(A){hi.error(`Modal "${e}" data source fetch error:`,A)}finally{g(!1),b(!0)}}},[a,r,i,o,e,u]);return N.useEffect(()=>{if(!a||a.length===0)return;const A=window.__templateApp;return A?.registerModalDataSources&&A.registerModalDataSources(e,a),()=>{A?.unregisterModalDataSources&&A.unregisterModalDataSources(e)}},[e,a]),N.useEffect(()=>{!l&&v.current&&(b(!1),u&&hi.log(`[ModalDataSourceWrapper] Modal "${e}" closed, reset fetch state`)),l&&!v.current&&a&&a.length>0&&!m&&S(),v.current=l},[l,a,m,S,e,u]),ct.jsx(ct.Fragment,{children:d})};class pc extends Error{constructor(a,r,i={}){super(r);$(this,"code");$(this,"userMessageKey");$(this,"showStack");$(this,"icon");$(this,"recoverable");this.name="TemplateEngineError",this.code=a,this.userMessageKey=r,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(a,r){if(!r||!a)return this.userMessageKey;try{return r.translate(this.userMessageKey,a)}catch{return this.userMessageKey}}}class zE extends pc{constructor(){super("TEMPLATE_NOT_FOUND","$t:core.errors.template_not_found",{showStack:!1,icon:"fa-paint-brush",recoverable:!1}),this.name="TemplateNotFoundError"}}function Om(l){if(l instanceof pc)return l;if(l instanceof Error){const e=new pc("TEMPLATE_INIT_ERROR",l.message||"$t:core.errors.template_init_error",{showStack:!0,icon:"fa-circle-exclamation",recoverable:!0});return e.stack=l.stack,e}return new pc("TEMPLATE_INIT_ERROR","$t:core.errors.template_init_error",{showStack:!1,icon:"fa-circle-exclamation",recoverable:!0})}const IE=dt("ErrorDisplay");class Kd{static render(e,a){const r=document.getElementById(e);if(!r){IE.error(`Container #${e} not found`);return}const i=a.debug&&a.showStack&&a.stackTrace,o=window.matchMedia("(prefers-color-scheme: dark)").matches,u={container:`
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
background-color: ${o?"#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: ${o?"#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: ${o?"#ffffff":"#111827"};
margin-bottom: 1rem;
`,message:`
color: ${o?"#d1d5db":"#4b5563"};
margin-bottom: 0.5rem;
line-height: 1.625;
`,detailMessage:`
font-size: 0.875rem;
color: ${o?"#9ca3af":"#6b7280"};
margin-bottom: 1.5rem;
background-color: ${o?"#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: ${o?"#374151":"#f3f4f6"};
border-radius: 0.375rem;
text-align: left;
`,stackTitle:`
font-size: 0.875rem;
font-weight: 600;
color: ${o?"#e5e7eb":"#374151"};
margin-bottom: 0.5rem;
`,stackTrace:`
font-size: 0.75rem;
color: ${o?"#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;
`};r.innerHTML=`
<div style="${u.container}">
<div style="${u.card}">
<!-- 아이콘 -->
<div style="${u.iconContainer}">
<i class="fa-solid ${a.icon}" style="${u.icon}"></i>
</div>
<!-- 제목 -->
<h1 style="${u.title}">
${this.escapeHtml(a.title)}
</h1>
<!-- 사용자 메시지 -->
<p style="${u.message}">
${this.escapeHtml(a.message)}
</p>
<!-- 상세 메시지 (API 응답 등) -->
${a.detailMessage?`
<p style="${u.detailMessage}">
${this.escapeHtml(a.detailMessage)}
</p>
`:`<div style="${u.spacer}"></div>`}
<!-- Stack Trace (디버그 모드일 때만) -->
${i?`
<div style="${u.stackContainer}">
<p style="${u.stackTitle}">
Stack Trace:
</p>
<pre style="${u.stackTrace}">${this.escapeHtml(a.stackTrace)}</pre>
</div>
`:""}
<!-- 새로고침 버튼 (복구 가능할 때만) -->
${a.showReloadButton?`
<div style="${u.buttonContainer}">
<button
onclick="window.location.reload()"
style="${u.button}"
onmouseover="this.style.backgroundColor='#1d4ed8'"
onmouseout="this.style.backgroundColor='#2563eb'"
>
<i class="fa-solid fa-rotate-right" style="margin-right: 0.5rem;"></i>
새로고침
</button>
</div>
`:""}
</div>
</div>
`}static renderFromError(e,a,r,i=!1,o,u,d){let f,g;if(a.userMessageKey.startsWith("$t:"))if(u&&o)try{f=u.translate(a.userMessageKey,o)}catch{f=a.userMessageKey.replace("$t:","")}else f=a.userMessageKey.replace("$t:","");else f=a.userMessageKey;if(d){const m=d;m.details?.apiMessage?g=m.details.apiMessage:m.response?.data?.message&&(g=m.response.data.message)}this.render(e,{title:r,message:f,detailMessage:g,icon:a.icon,showStack:a.showStack,stackTrace:a.stack,showReloadButton:a.recoverable,debug:i})}static escapeHtml(e){if(!e)return"";const a=document.createElement("div");return a.textContent=e,a.innerHTML}}const Zi=dt("Router");class jE{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,a){this.eventHandlers.has(e)||this.eventHandlers.set(e,[]),this.eventHandlers.get(e).push(a)}async emit(e,...a){const r=this.eventHandlers.get(e);r&&await Promise.all(r.map(i=>i(...a)))}async loadRoutes(e){try{const a=e!==void 0&&e>0?`?v=${e}`:"",r=await fetch(`/api/templates/${this.templateIdentifier}/routes.json${a}`);if(!r.ok)throw new Error(`Failed to load routes: ${r.statusText}`);const i=await r.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,Zi.log(`Loaded ${this.routes.length} routes${e?` (v=${e})`:""}`);else throw new Error("Invalid routes data format")}catch(a){throw Zi.error("Error loading routes:",a),a}}setRoutes(e){this.routes=e,Zi.log(`Set ${this.routes.length} routes`)}match(e){for(const a of this.routes){const r=this.matchPattern(a.path,e);if(r!==null)return{route:a,params:r}}return null}matchPattern(e,a){const r=[];let i=e.replace(/:([^/]+)/g,(f,g)=>(r.push(g),"([^/]+)"));i.startsWith("*/")&&(i="(?:/[^/]+)?"+i.slice(1)),i=i.replace(/\//g,"\\/");const o=new RegExp(`^${i}$`),u=a.match(o);if(!u)return null;const d={};return r.forEach((f,g)=>{d[f]=u[g+1]}),d}getRoutes(){return[...this.routes]}getAuthType(e,a){return e.auth_type?e.auth_type:a.startsWith("/admin")?"admin":"user"}async navigateToCurrentPath(){const e=window.location.pathname,a=window.location.search,r=this.match(e);if(!r){Zi.warn(`No route matched for path: ${e}`),this.emit("routeNotFound",e);return}if(r.route.redirect){Zi.log(`Redirecting from ${e} to ${r.route.redirect}`),this.navigate(r.route.redirect);return}if(r.route.auth_required){const u=this.getAuthType(r.route,e),d=ga.getInstance();let f=d.isAuthenticated()&&d.getAuthType()===u;if(f||(f=await d.checkAuth(u)),!f){const g=d.getLoginRedirectUrl(u,e+a);Zi.log(`Not authenticated, redirecting to: ${g}`),window.location.href=g;return}}const i=new URLSearchParams(a),o={};for(const u of i.keys()){if(u in o)continue;const d=i.getAll(u);d.length>1?o[u]=d:d.length===1&&(u.endsWith("[]")?o[u]=d:o[u]=d[0])}await this.emit("routeChange",{path:e,layout:r.route.layout,endpoint:r.route.endpoint,params:{...r.route.params||{},...r.params},query:o,auth_required:r.route.auth_required,auth_type:r.route.auth_type,meta:r.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 a=this.pendingNavigation;this.executeNavigation(a)}}}}const UE=/^\/admin\/layout-editor\/([^/?#]+)\/?$/;function Lm(l){const e=UE.exec(l);return e?{templateIdentifier:e[1]}:null}const Nt=dt("ErrorPageHandler");class BE{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(`/api/templates/${this.templateId}/config.json`);if(!e.ok)return this.debug&&Nt.warn("Failed to load template config:",e.statusText),this.configLoaded=!0,null;const a=await e.json();if(!a.success||!a.data)return this.debug&&Nt.warn("Invalid template config response"),this.configLoaded=!0,null;const r=a.data;return!r.error_config||!r.error_config.layouts?(this.debug&&Nt.warn("No error_config found in template.json"),this.configLoaded=!0,null):(this.errorConfig=r.error_config,this.configLoaded=!0,this.debug&&Nt.log("Error config loaded:",this.errorConfig),this.errorConfig)}catch(e){return Nt.error("Failed to load error config:",e),this.configLoaded=!0,null}}async renderError(e,a="app"){try{const r=await this.loadConfig();if(!r)return this.debug&&Nt.warn("No error config available, cannot render error page"),!1;const i=r.layouts[e]||r.layouts[String(e)];if(!i)return this.debug&&Nt.warn(`No layout defined for error code: ${e}`),!1;this.debug&&Nt.log(`Loading error layout: ${i} for code: ${e}`);const o=await this.layoutLoader.loadLayout(this.templateId,i);if(!o)return this.debug&&Nt.error(`Failed to load error layout: ${i}`),!1;this.debug&&Nt.log("Error layout loaded:",o);let u={};const d=o.data_sources||[];if(d.length>0){this.debug&&Nt.log("Fetching data sources:",d.map(E=>E.id));const m=d.filter(E=>E.loading_strategy==="blocking"),b=d.filter(E=>!E.loading_strategy||E.loading_strategy==="progressive"),v=[...m,...b];if(v.length>0)try{u=await this.dataSourceManager.fetchDataSources(v,{},new URLSearchParams),this.debug&&Nt.log("Data sources fetched:",Object.keys(u))}catch(E){Nt.error("Failed to fetch data sources:",E)}}const f={};d.length>0&&(this.processInitOptions(d,u,f),this.debug&&Nt.log("initOptions processed:",{globalKeys:Object.keys(this.globalState),localKeys:Object.keys(f)}));const g={...u,errorCode:e,_global:{...this.globalState},_local:{...f}};return await this.renderFunction({containerId:a,layoutJson:o,dataContext:g,translationContext:{templateId:this.templateId,locale:this.locale}}),this.debug&&Nt.log(`Error page ${e} rendered successfully`),!0}catch(r){return Nt.error(`Failed to render error page ${e}:`,r),!1}}processInitOptions(e,a,r){for(const i of e){const o=a[i.id];if(!o)continue;const u=o?.data??o;if(i.initLocal){if(typeof i.initLocal=="string")r[i.initLocal]=u,Nt.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;r[d]=f?this.getValueByPath(u,f):u,Nt.log(`initLocal: ${i.id}.data${f?"."+f:""} -> _local.${d}`)}}if(i.initGlobal){const d=Array.isArray(i.initGlobal)?i.initGlobal:[i.initGlobal];for(const f of d)if(typeof f=="string")this.globalState[f]=u,Nt.log(`initGlobal: ${i.id}.data -> _global.${f}`);else if(typeof f=="object"&&f!==null&&"key"in f){const{key:g,path:m}=f;this.globalState[g]=m?this.getValueByPath(u,m):u,Nt.log(`initGlobal: ${i.id}.data${m?"."+m:""} -> _global.${g}`)}}}}getValueByPath(e,a){return a.split(".").reduce((r,i)=>r?.[i],e)}updateGlobalState(e){this.globalState={...this.globalState,...e}}updateLocale(e){this.locale=e,this.debug&&Nt.log("Locale updated:",e)}isConfigLoaded(){return this.configLoaded}async hasErrorLayout(e){const a=await this.loadConfig();return a?!!(a.layouts[e]||a.layouts[String(e)]):!1}clearConfigCache(){this.errorConfig=null,this.configLoaded=!1,this.debug&&Nt.log("Config cache cleared")}}const Tn=dt("ModuleAssetLoader");class qE{constructor(){$(this,"loadedAssets",new Map);$(this,"loadingPromises",new Map)}async loadActiveExtensionAssets(e){if(!e||e.length===0){Tn.log("No module assets to load");return}const a=[...e].sort((o,u)=>o.priority-u.priority);Tn.log("Loading module assets:",a.map(o=>o.identifier));const r=a.filter(o=>o.css).map(o=>this.loadCSS(o.identifier,o.css)),i=a.filter(o=>o.js).map(o=>this.loadJS(o.identifier,o.js));await Promise.all([...r,...i]),Tn.log("All module assets loaded successfully")}async loadCSS(e,a){const r=`module-css-${e}`;if(document.getElementById(r)){Tn.log(`CSS already loaded: ${e}`);return}return new Promise((i,o)=>{const u=document.createElement("link");u.rel="stylesheet",u.href=a,u.id=r,u.onload=()=>{Tn.log(`CSS loaded: ${e}`),this.registerLoadedAsset(e,{type:"css",element:u}),i()},u.onerror=()=>{Tn.warn(`Failed to load CSS: ${e} (${a})`),i()},document.head.appendChild(u)})}async loadJS(e,a){const r=`module-js-${e}`;if(document.getElementById(r)){Tn.log(`JS already loaded: ${e}`);return}const i=this.loadingPromises.get(e);if(i)return Tn.log(`JS already loading: ${e}`),i;const o=new Promise((u,d)=>{const f=document.createElement("script");f.src=a,f.id=r,f.async=!1,f.onload=()=>{Tn.log(`JS loaded: ${e}`),this.registerLoadedAsset(e,{type:"js",element:f}),this.loadingPromises.delete(e),u()},f.onerror=()=>{Tn.warn(`Failed to load JS: ${e} (${a})`),this.loadingPromises.delete(e),u()},document.head.appendChild(f)});return this.loadingPromises.set(e,o),o}registerLoadedAsset(e,a){const r=this.loadedAssets.get(e)||[];r.push(a),this.loadedAssets.set(e,r)}unloadExtensionAsset(e){const a=this.loadedAssets.get(e);if(!a||a.length===0){Tn.log(`No assets to unload for: ${e}`);return}a.forEach(r=>{r.element.parentNode&&(r.element.parentNode.removeChild(r.element),Tn.log(`${r.type.toUpperCase()} unloaded: ${e}`))}),this.loadedAssets.delete(e),Tn.log(`All assets unloaded for: ${e}`)}unloadAllAssets(){Array.from(this.loadedAssets.keys()).forEach(a=>{this.unloadExtensionAsset(a)}),Tn.log("All module assets unloaded")}isLoaded(e){return this.loadedAssets.has(e)}getLoadedModules(){return Array.from(this.loadedAssets.keys())}}let Wd=null;function PE(){return Wd||(Wd=new qE),Wd}function GE(){if(typeof window>"u")return[];const l=window.G7Config;if(!l?.moduleAssets)return[];const e=[];for(const[a,r]of Object.entries(l.moduleAssets)){const i=r;e.push({identifier:a,js:i.js,css:i.css,priority:i.priority,external:i.external})}return e}function VE(){if(typeof window>"u")return[];const l=window.G7Config;if(!l?.pluginAssets)return[];const e=[];for(const[a,r]of Object.entries(l.pluginAssets)){const i=r;e.push({identifier:a,js:i.js,css:i.css,priority:i.priority,external:i.external})}return e}const Yd=dt("SystemBannerManager");class mc{static show(e){this.banners.set(e.id,e),this.render(),Yd.log(`Banner shown: ${e.id}`)}static hide(e){this.banners.delete(e)&&(this.render(),Yd.log(`Banner hidden: ${e}`))}static hideAll(){this.banners.clear(),this.render(),Yd.log("All banners hidden")}static detectLocale(){try{const a=window.G7Core;if(a?.locale?.current)return a.locale.current()}catch{}return(navigator.language||"ko").split("-")[0]}static resolveMessage(e,a){return typeof e=="string"?e:e[a]||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 a=Array.from(this.banners.values()).sort((i,o)=>(i.order??0)-(o.order??0)),r=this.detectLocale();e.innerHTML=a.map(i=>{const o=this.resolveMessage(i.message,r),u=i.background||"#f59e0b",d=i.color||"white";return`<div data-banner-id="${i.id}" style="background:${u};color:${d};text-align:center;padding:8px 16px;font-size:14px;font-weight:500;">${o}</div>`}).join(""),requestAnimationFrame(()=>{e&&this.adjustAppPadding(e.offsetHeight)})}static adjustAppPadding(e){const a=document.getElementById("app");a&&(a.style.paddingTop=e>0?`${e}px`:"")}}$(mc,"banners",new Map),$(mc,"containerId","g7-system-banners");const j=dt("TemplateApp");function Mm(l){const e={};for(const a of l.keys()){if(a in e)continue;const r=l.getAll(a);r.length>1?e[a]=r:r.length===1&&(a.endsWith("[]")?e[a]=r:e[a]=r[0])}return e}const Ea=class Ea{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 a=this.loadLocaleFromStorage(),r=a||e.locale||"ko";this.config={...e,locale:r},!a&&e.locale&&this.saveLocaleToStorage(e.locale)}loadG7Config(){if(typeof window<"u"&&window.G7Config){const e=window.G7Config;e.settings&&(this.globalState.settings=e.settings,j.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,j.log("Loaded plugin settings from G7Config:",Object.keys(e.plugins))),e.modules&&(this.globalState.modules=e.modules,j.log("Loaded module settings from G7Config:",Object.keys(e.modules))),e.appConfig&&(this.globalState.appConfig=e.appConfig,j.log("Loaded appConfig from G7Config:",Object.keys(e.appConfig)))}}resolveRouteExpressions(e){const a=new vn,r={_global:this.globalState};return e.map(i=>{const o={...i};if(o.path&&o.path.includes("{{")){const u=o.path;o.path=a.resolveBindings(o.path,r),o.path=o.path.replace(/\/\/+/g,"/")||"/",o.path.includes("{{")&&(j.warn("Route expression resolution failed, using fallback:",u),o.path=u.replace(/\{\{[^}]+\}\}/g,"").replace(/\/\/+/g,"/")||"/")}if(o.redirect&&o.redirect.includes("{{")){const u=o.redirect;o.redirect=a.resolveBindings(o.redirect,r),o.redirect=o.redirect.replace(/\/\/+/g,"/")||"/",o.redirect.includes("{{")&&(j.warn("Route redirect expression resolution failed:",u),o.redirect=u.replace(/\{\{[^}]+\}\}/g,"").replace(/\/\/+/g,"/")||"/")}return o})}migrateLocaleStorage(){const e=["locale","g7_template_locale"];for(const a of e)try{const r=localStorage.getItem(a);r&&r!==localStorage.getItem(Ea.LOCALE_STORAGE_KEY)&&(localStorage.setItem(Ea.LOCALE_STORAGE_KEY,r),j.log(`Migrated locale from '${a}' to '${Ea.LOCALE_STORAGE_KEY}'`)),localStorage.removeItem(a)}catch(r){j.warn(`Failed to migrate locale key '${a}':`,r)}}async init(){try{Gs.getInstance().setDebug(this.config.debug),j.log("Initializing with config:",this.config);const e=fa.getInstance(),a=ga.getInstance(),r=this.loadCacheVersionFromStorage()||0,[i,o,u,d,f]=await Promise.all([wo({templateId:this.config.templateId,templateType:this.config.templateType,locale:this.config.locale,debug:this.config.debug,cacheVersion:r}),e.loadComponents(this.config.templateId,this.config.templateType),fetch(`/api/templates/${this.config.templateId}/routes.json${r>0?`?v=${r}`:""}`).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 j.error("Error loading routes:",A),A}),a.preloadAuth(this.config.templateType==="admin"?"admin":"user"),fetch(`/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=>(j.warn("Error loading template config:",A),null))]);if(j.log("Template Engine initialized"),j.log("ComponentRegistry loaded"),j.log("Routes data loaded"),j.log("User info preloaded"),j.log("Template config loaded:",f),f?.cache_version!==void 0){const A=this.loadCacheVersionFromStorage();if(this.extensionCacheVersion=f.cache_version,this.saveCacheVersionToStorage(this.extensionCacheVersion),j.log("Extension cache version:",this.extensionCacheVersion),A!==null&&A!==this.extensionCacheVersion){j.log("Cache version changed, reloading routes...");const T=await fetch(`/api/templates/${this.config.templateId}/routes.json?v=${this.extensionCacheVersion}`).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(T.routes)&&(T.routes=this.resolveRouteExpressions(T.routes),Object.assign(u,T),j.log("Routes reloaded with new cache version"));try{const{TranslationEngine:D}=await Promise.resolve().then(()=>Cg),M=D.getInstance();M.setCacheVersion(this.extensionCacheVersion);const O=this.config.locale||"ko",L="en";await M.loadTranslations(this.config.templateId,O,"/api",!0),O!==L&&await M.loadTranslations(this.config.templateId,L,"/api",!0),j.log("Translations reloaded with new cache version")}catch(D){j.error("Failed to reload translations:",D)}}}f?.errorHandling&&(this.templateErrorHandling=f.errorHandling,ma().setTemplateConfig(this.templateErrorHandling),j.log("Template errorHandling registered:",this.templateErrorHandling)),a.on("logout",()=>{j.log("User logged out")}),a.on("authStateChange",A=>{j.log("Auth state changed:",A)}),j.log("AuthManager event handlers registered");const g=$a(),m=this.config.templateType==="admin"?"admin":"user",b=a.getConfig(m);g.setOnUnauthorized(()=>{j.log("Unauthorized - redirecting to login page"),g.removeToken();const A=window.location.pathname+window.location.search,T=a.getLoginRedirectUrl(m,A,"session_expired");window.location.href=T}),j.log("ApiClient onUnauthorized callback registered"),this.layoutLoader=new Ud(e),this.extensionCacheVersion>0&&this.layoutLoader.setCacheVersion(this.extensionCacheVersion),j.log("LayoutLoader initialized:",this.layoutLoader);const v=new Sa({onUnauthorized:()=>{j.warn("Unauthorized request in error page")}});if(this.errorPageHandler=new BE({templateId:this.config.templateId,layoutLoader:this.layoutLoader,locale:this.config.locale,debug:this.config.debug,renderFunction:es,dataSourceManager:v,globalState:this.globalState}),j.log("ErrorPageHandler initialized with DataSourceManager"),await this.handleServerError()){j.log("Server error handled, skipping normal initialization");return}if(this.router=new jE(this.config.templateId),Array.isArray(u.routes)){const A=this.resolveRouteExpressions(u.routes);this.router.setRoutes(A)}else throw new Error("Invalid routes data format");j.log("Router initialized:",this.router),j.log("Routes set:",this.router.getRoutes());const{getActionDispatcher:E}=await Promise.resolve().then(()=>Ia),S=E();if(S&&(S.setDefaultContext({navigate:A=>this.router?.navigate(A)}),S.setGlobalStateUpdater((A,T)=>this.setGlobalState(A,T)),j.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"&&Lm(window.location.pathname)){j.log("Layout editor mode detected — skipping router match"),await es({containerId:"app",layoutJson:{components:[]},dataContext:{},translationContext:{templateId:this.config.templateId,locale:this.config.locale}}),j.log("Template App initialized in layout editor mode");return}this.router.navigateToCurrentPath(),j.log("Template App initialized successfully")}catch(e){j.error("Initialization failed:",e),this.showInitError(e)}}async loadExtensionAssets(){try{const e=PE(),a=GE();a.length>0&&(j.log("Loading module assets:",a.map(i=>i.identifier)),await e.loadActiveExtensionAssets(a));const r=VE();r.length>0&&(j.log("Loading plugin assets:",r.map(i=>i.identifier)),await e.loadActiveExtensionAssets(r)),(a.length>0||r.length>0)&&j.log("Extension assets loaded successfully")}catch(e){j.warn("Failed to load extension assets:",e)}}async handleRouteChange(e){const a=++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(j.log("Route changed:",e,"requestId:",a),!this.layoutLoader)throw new Error("LayoutLoader is not initialized");if(!e.layout)throw new Error("Route layout is not defined");let r=e.layout;const i=r==="__preview__";i&&e.params?.token&&(r=`__preview__/${e.params.token}`);const o=await this.layoutLoader.loadLayout(this.config.templateId,r);if(a!==this.currentRouteChangeId){j.log("Route change cancelled (newer request exists):",a);return}j.log("Layout loaded:",o);const u=ma();o.errorHandling?(u.setLayoutConfig(o.errorHandling),j.log("Layout errorHandling registered:",o.errorHandling)):u.clearLayoutConfig();const d=o.data_sources||[],f=e.query||{},g=new URLSearchParams;for(const[ne,pe]of Object.entries(f))if(Array.isArray(pe))for(const x of pe)g.append(ne,x);else g.set(ne,pe);const m={route:e.params||{},query:f,_global:this.globalState};o.scripts&&Array.isArray(o.scripts)&&await this.loadLayoutScripts(o.scripts,m);const{DataSourceManager:b,getActionDispatcher:v}=await Promise.resolve().then(()=>Ia),E=new b;if(i){const ne=v();ne&&ne.setPreviewMode(!0),this.setGlobalState({__isPreview:!0}),mc.show({id:"preview-mode",message:{ko:"⚠ 미리보기 모드 — 페이지 이동이 비활성화됩니다",en:"⚠ Preview Mode — Navigation is disabled"},background:"linear-gradient(90deg, #f59e0b, #d97706)",color:"white"}),j.log("Preview mode activated")}else{const ne=v();ne?.isPreviewMode()&&(ne.setPreviewMode(!1),mc.hide("preview-mode"))}if(this.currentGlobalHeaders=o.globalHeaders||[],this.currentGlobalHeaders.length>0){E.setGlobalHeaders(this.currentGlobalHeaders);const ne=v();ne&&ne.setGlobalHeaders(this.currentGlobalHeaders),j.log("globalHeaders set:",this.currentGlobalHeaders.map(pe=>pe.pattern))}if(o.named_actions&&Object.keys(o.named_actions).length>0){const ne=v();ne&&ne.setNamedActions(o.named_actions)}const S=E.filterByCondition(d,m);d.length!==S.length&&j.log("Data sources filtered by condition:",{before:d.map(ne=>ne.id),after:S.map(ne=>ne.id)});const A=S.filter(ne=>ne.loading_strategy==="blocking"),T=S.filter(ne=>(ne.loading_strategy||"progressive")!=="blocking"&&ne.type!=="websocket"),D=Array.isArray(o.transition_overlay?.wait_for)?o.transition_overlay.wait_for:[],M=D.length>0&&S.some(ne=>D.includes(ne.id)&&ne.type!=="websocket"&&(ne.loading_strategy||"progressive")!=="background");if((A.length>0||M)&&o.transition_overlay){const ne=typeof o.transition_overlay=="boolean"?{enabled:o.transition_overlay,style:"opaque"}:o.transition_overlay;ne.enabled&&ne.style==="skeleton"&&ne.skeleton?.component&&ne.target?this.renderSkeletonOverlay(ne.target,ne.skeleton,o,ne.fallback_target):ne.enabled&&ne.style==="spinner"&&ne.target&&this.renderSpinnerOverlay(ne.target,ne.spinner,ne.fallback_target)}let O={},L={},P={},U={};this.currentWebSocketSubscriptions.length>0&&(j.log("Unsubscribing previous WebSocket subscriptions:",this.currentWebSocketSubscriptions),E.unsubscribeWebSockets(this.currentWebSocketSubscriptions),this.currentWebSocketSubscriptions=[]),this.currentDataSources=S,this.currentRawDataSources=d,this.currentRouteParams=e.params||{},this.currentQueryParams=g,j.log(`handleRouteChange #${a} - queryObject:`,f),j.log(`handleRouteChange #${a} - queryParams:`,g.toString()),A.length>0&&(j.log("Fetching blocking data sources:",A.map(pe=>pe.id)),(await E.fetchDataSourcesWithResults(A,e.params||{},g)).forEach(pe=>{if(pe.state==="success"&&pe.data!==void 0)O[pe.id]=pe.data;else if(pe.state==="error"&&pe.error){const x=pe.error,F=x.response?.data?.message;L[pe.id]={message:F||pe.error.message,status:x.response?.status||x.status}}}),this.processInitOptions(A,O,P,U),this.currentFetchedData={...O},j.log("Blocking data loaded:",Object.keys(O)),Object.keys(L).length>0&&j.log("Data source errors:",L),Object.keys(P).length>0&&j.log("Local state init (blocking):",Object.keys(P)),Object.keys(U).length>0&&j.log("Isolated state init (blocking):",Object.keys(U)));const B=T.length>0;if(B&&(Na.setPending(!0),j.log("Transition started before rendering")),a!==this.currentRouteChangeId){j.log("Route change cancelled after blocking data (newer request exists):",a);return}const{getState:Y}=await Promise.resolve().then(()=>Ia),ge=Y().currentDataContext||{},Ae=T.map(ne=>ne.id),Oe={};if(B){Ae.forEach(pe=>{ge[pe]!==void 0?Oe[pe]=ge[pe]:Oe[pe]=void 0});const ne=Object.keys(Oe).filter(pe=>Oe[pe]!==void 0);ne.length>0&&j.log("Preserving previous progressive data:",ne),j.log("Progressive data sources initialized:",Ae)}const Ne=o.defines||{},He={...Oe,...e.params,...O,route:{...e.params||{},path:e.path},query:f,_global:{...this.globalState},_globalSetState:ne=>this.setGlobalState(ne),_dataSourceErrors:Object.keys(L).length>0?L:void 0,_localInit:Object.keys(P).length>0?P:void 0,_isolatedInit:Object.keys(U).length>0?U:void 0,_defines:Object.keys(Ne).length>0?Ne:void 0};if(o.computed&&Object.keys(o.computed).length>0){const ne=this.calculateComputed(o.computed,He);Object.keys(ne).length>0&&(He._computed=ne,this.globalState._computed=ne,j.log("Computed values calculated:",Object.keys(ne))),He._computedDefinitions=o.computed}const Ze=o.layout_name||e.layout;this.currentLayoutName!==""&&this.currentLayoutName!==Ze&&(j.log("_local reset due to layout change:",{from:this.currentLayoutName,to:Ze}),this.globalState._local={}),this.currentLayoutName=Ze;const J=o.initLocal||o.state;if(J&&Object.keys(J).length>0){this.globalState._local||(this.globalState._local={});for(const[ne,pe]of Object.entries(J))this.globalState._local[ne]===void 0&&(this.globalState._local[ne]=JSON.parse(JSON.stringify(pe)));He._local={...this.globalState._local},j.log("initLocal applied to _local:",Object.keys(J))}if(o.initGlobal&&Object.keys(o.initGlobal).length>0){for(const[ne,pe]of Object.entries(o.initGlobal))this.globalState[ne]===void 0&&(this.globalState[ne]=JSON.parse(JSON.stringify(pe)));j.log("initGlobal applied to _global:",Object.keys(o.initGlobal))}if(o.initIsolated&&Object.keys(o.initIsolated).length>0){for(const[ne,pe]of Object.entries(o.initIsolated))U[ne]===void 0&&(U[ne]=JSON.parse(JSON.stringify(pe)));j.log("initIsolated applied:",Object.keys(o.initIsolated))}He._global={...this.globalState,layoutWarnings:o.warnings||[]};const de=o.initActions||o.init_actions;if(de&&de.length>0){await this.executeInitActions(de,He),j.log("initActions executed before render");const ne=this.globalState;if(ne._local){if(Object.keys(P).length>0){for(const[pe,x]of Object.entries(P))ne._local[pe]!==void 0?ne._local[pe]=this.deepMerge(ne._local[pe],x):ne._local[pe]=x;j.log("localInit merged into _local after initActions:",Object.keys(P))}He._local=ne._local,j.log("_local merged into dataContext:",ne._local)}if(He._global={...this.globalState,layoutWarnings:o.warnings||[]},j.log("_global merged into dataContext after initActions"),o.computed&&Object.keys(o.computed).length>0){const pe=this.calculateComputed(o.computed,He);Object.keys(pe).length>0&&(He._computed=pe,this.globalState._computed=pe,j.log("Computed values recalculated after init_actions:",Object.keys(pe)))}if(Object.keys(this.currentFetchedData).length>0){for(const[pe,x]of Object.entries(this.currentFetchedData))He[pe]=x;j.log("Fetched data sources merged into dataContext after initActions:",Object.keys(this.currentFetchedData))}}if(o.transition_overlay&&!this.skeletonOverlayContainer&&this.showTransitionOverlay(o.transition_overlay,o),await es({containerId:"app",layoutJson:o,dataContext:He,translationContext:{templateId:this.config.templateId,locale:this.config.locale}}),j.log("Initial render complete with blocking data"),this.reattachSpinnerOverlay(),T.length>0){if(a!==this.currentRouteChangeId){j.log("Route change cancelled before progressive fetch (newer request exists):",a),Na.setPending(!1),this.hideTransitionOverlay();return}j.log("Fetching progressive/background data sources:",T.map(x=>x.id));const{updateTemplateData:ne,getState:pe}=await Promise.resolve().then(()=>Ia);try{const x=T.map(async F=>{try{const fe=(await E.fetchDataSourcesWithResults([F],e.params||{},g,this.globalState))[0];if(!fe){j.log(`Data source ${F.id} skipped (no fetch result)`);return}if(a!==this.currentRouteChangeId){j.log(`Data source ${F.id} fetch cancelled (newer request exists)`);return}if(fe.state==="success"&&fe.data!==void 0){j.log(`Progressive data source loaded: ${F.id}`),this.currentFetchedData[F.id]=fe.data;const te={};this.processInitOptions([F],{[F.id]:fe.data},te);const ye=pe();if(ye.bindingEngine){const Me=[F.id];F.initGlobal&&Me.push("_global"),F.initLocal&&Me.push("_local"),ye.bindingEngine.invalidateCacheByKeys(Me)}const je={[F.id]:fe.data};Object.keys(te).length>0&&(je._localInit=te,Object.assign(P,te)),F.initGlobal&&(je._global={...this.globalState}),ne(je)}else if(fe.state==="error"&&fe.error){const te=fe.error,ye=te.response?.data?.message;L[F.id]={message:ye||fe.error.message,status:te.response?.status||te.status},j.log(`Progressive data source error: ${F.id}`,L[F.id]),ne({[F.id]:null,_dataSourceErrors:{...L}})}}catch(ue){j.error(`Failed to fetch data source: ${F.id}`,ue)}});if(await Promise.all(x),a!==this.currentRouteChangeId){j.log("Route change cancelled after progressive fetch (newer request exists):",a);return}j.log("All progressive data sources loaded")}finally{Na.setPending(!1),this.hideTransitionOverlay()}}else this.hideTransitionOverlay();const me=S.filter(ne=>ne.type==="websocket");if(me.length>0){j.log("Subscribing WebSocket data sources:",me.map(F=>F.id));const{updateTemplateData:ne,getState:pe}=await Promise.resolve().then(()=>Ia),x={...this.currentFetchedData,...e.params,route:{...e.params||{},path:e.path},query:f,_global:{...this.globalState}};j.log("WebSocket binding context keys:",Object.keys(x)),this.currentWebSocketSubscriptions=E.subscribeWebSockets(S,(F,ue)=>{j.log(`WebSocket data received for: ${F}`,ue),this.currentFetchedData[F]=ue;const fe=S.find(Me=>Me.id===F),te=pe();if(te.bindingEngine){const Me=[F];fe?.initGlobal&&Me.push("_global"),fe?.initLocal&&Me.push("_local"),te.bindingEngine.invalidateCacheByKeys(Me)}ne({[F]:ue});const je=S.find(Me=>Me.type==="websocket"&&(Me.target_source||Me.id)===F)?.onReceive;Array.isArray(je)&&je.length>0&&window.G7Core?.dispatch&&(async()=>{for(const Pe of je)try{const Ie=this.getActionDispatcher?.();Ie&&await Ie.dispatchAction(Pe,{navigate:this.getRouter?.()?(Lt,At)=>this.getRouter().navigate(Lt,At):void 0,setState:Lt=>this.setGlobalState(Lt),state:this.globalState,data:{...this.globalState,$args:[ue],$event:ue},_isDispatchFallbackContext:!0})}catch(Ie){j.error(`WebSocket onReceive action failed for ${F}:`,Ie)}})()},x),j.log("WebSocket subscriptions established:",this.currentWebSocketSubscriptions)}j.log("Layout rendered successfully")}catch(r){j.error("Route change handling failed:",r),this.hideTransitionOverlay(),this.showRouteError(r)}}processInitOptions(e,a,r,i){e.some(u=>u.refetchOnMount===!0&&u.initLocal)&&(r._forceLocalInit=Date.now(),j.log("refetchOnMount detected, forcing local state init")),e.forEach(u=>{const d=a[u.id];if(!d)return;const f=d.data??d;if(u.initLocal){if(typeof u.initLocal=="string"){let g=f;if(u.initLocalDefaults&&typeof u.initLocalDefaults=="object"){const b=this.evaluateDefaults(u.initLocalDefaults,a);g={...b,...f},j.log(`initLocalDefaults applied for ${u.initLocal}:`,Object.keys(b))}const m=this.globalState._local?.[u.initLocal];m!==void 0&&typeof m=="object"&&typeof g=="object"?(r[u.initLocal]=this.deepMerge(m,g),j.log(`initLocal (merged): ${u.id}.data -> _local.${u.initLocal}`)):(r[u.initLocal]=g,j.log(`initLocal: ${u.id}.data -> _local.${u.initLocal}`))}else if(typeof u.initLocal=="object"&&u.initLocal.key){const{key:g,path:m}=u.initLocal;let b=m?this.extractValueByPathOrExpression(f,m,u.id):f;if(u.initLocalDefaults&&typeof u.initLocalDefaults=="object"){const E=this.evaluateDefaults(u.initLocalDefaults,a);b={...E,...b},j.log(`initLocalDefaults applied for ${g}:`,Object.keys(E))}const v=this.globalState._local?.[g];v!==void 0&&typeof v=="object"&&typeof b=="object"?(r[g]=this.deepMerge(v,b),j.log(`initLocal (merged): ${u.id}.data${m?"."+m:""} -> _local.${g}`)):(r[g]=b,j.log(`initLocal: ${u.id}.data${m?"."+m:""} -> _local.${g}`))}else if(typeof u.initLocal=="object"){const g=u.initLocal._merge||"deep",m=this.flattenNestedObjectToMappings(u.initLocal);for(const{targetPath:b,sourcePath:v}of m){const E=this.extractValueByPathOrExpression(f,v,u.id);if(b.includes(".")){const S=b.split(".")[0];r[S]===void 0&&this.globalState._local?.[S]!==void 0&&(r[S]=JSON.parse(JSON.stringify(this.globalState._local[S]))),this.setValueAtPath(r,b,E,g),j.log(`initLocal map (${g}): ${u.id} ${v} -> _local.${b}`)}else{const S=this.globalState._local?.[b];g==="replace"?(r[b]=E,j.log(`initLocal map (replace): ${u.id} ${v} -> _local.${b}`)):g==="shallow"?S!==void 0&&typeof S=="object"&&typeof E=="object"?(r[b]={...S,...E},j.log(`initLocal map (shallow): ${u.id} ${v} -> _local.${b}`)):(r[b]=E,j.log(`initLocal map: ${u.id} ${v} -> _local.${b}`)):S!==void 0&&typeof S=="object"&&typeof E=="object"?(r[b]=this.deepMerge(S,E),j.log(`initLocal map (deep): ${u.id} ${v} -> _local.${b}`)):(r[b]=E,j.log(`initLocal map: ${u.id} ${v} -> _local.${b}`))}}}}if(u.initGlobal)if(typeof u.initGlobal=="object"&&!Array.isArray(u.initGlobal)&&!("key"in u.initGlobal))for(const[m,b]of Object.entries(u.initGlobal)){if(typeof b!="string"){j.warn(`initGlobal map value must be string, got ${typeof b} for key ${m}`);continue}const v=this.extractValueByPathOrExpression(f,b,u.id),E=this.globalState[m];E!==void 0&&typeof E=="object"&&typeof v=="object"?(this.globalState[m]=this.deepMerge(E,v),j.log(`initGlobal map (merged): ${u.id} ${b} -> _global.${m}`)):(this.globalState[m]=v,j.log(`initGlobal map: ${u.id} ${b} -> _global.${m}`))}else{const m=Array.isArray(u.initGlobal)?u.initGlobal:[u.initGlobal];for(const b of m)if(typeof b=="string"){const v=this.globalState[b];v!==void 0&&typeof v=="object"&&typeof f=="object"?(this.globalState[b]=this.deepMerge(v,f),j.log(`initGlobal (merged): ${u.id}.data -> _global.${b}`)):(this.globalState[b]=f,j.log(`initGlobal: ${u.id}.data -> _global.${b}`))}else if(typeof b=="object"&&b.key){const{key:v,path:E}=b,S=E?this.extractValueByPathOrExpression(f,E,u.id):f,A=this.globalState[v];A!==void 0&&typeof A=="object"&&typeof S=="object"?(this.globalState[v]=this.deepMerge(A,S),j.log(`initGlobal (merged): ${u.id}.data${E?"."+E:""} -> _global.${v}`)):(this.globalState[v]=S,j.log(`initGlobal: ${u.id}.data${E?"."+E:""} -> _global.${v}`))}}if(i&&u.initIsolated){if(typeof u.initIsolated=="string"){const g=i[u.initIsolated];g!==void 0&&typeof g=="object"&&typeof f=="object"?(i[u.initIsolated]=this.deepMerge(g,f),j.log(`initIsolated (merged): ${u.id}.data -> _isolated.${u.initIsolated}`)):(i[u.initIsolated]=f,j.log(`initIsolated: ${u.id}.data -> _isolated.${u.initIsolated}`))}else if(typeof u.initIsolated=="object"&&u.initIsolated.key){const{key:g,path:m}=u.initIsolated,b=m?this.extractValueByPathOrExpression(f,m,u.id):f,v=i[g];v!==void 0&&typeof v=="object"&&typeof b=="object"?(i[g]=this.deepMerge(v,b),j.log(`initIsolated (merged): ${u.id}.data${m?"."+m:""} -> _isolated.${g}`)):(i[g]=b,j.log(`initIsolated: ${u.id}.data${m?"."+m:""} -> _isolated.${g}`))}else if(typeof u.initIsolated=="object")for(const[g,m]of Object.entries(u.initIsolated)){if(typeof m!="string"){j.warn(`initIsolated map value must be string, got ${typeof m} for key ${g}`);continue}const b=this.extractValueByPathOrExpression(f,m,u.id),v=i[g];v!==void 0&&typeof v=="object"&&typeof b=="object"?(i[g]=this.deepMerge(v,b),j.log(`initIsolated map (merged): ${u.id} ${m} -> _isolated.${g}`)):(i[g]=b,j.log(`initIsolated map: ${u.id} ${m} -> _isolated.${g}`))}}})}evaluateDefaults(e,a){const r={};for(const[i,o]of Object.entries(e))if(typeof o=="string"&&o.startsWith("{{")&&o.endsWith("}}")){const u=o.slice(2,-2).trim();r[i]=this.evaluateExpression(u,a)}else r[i]=o;return r}evaluateExpression(e,a){try{const r=e.split("??").map(i=>i.trim());for(const i of r){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 o=this.getNestedValue(a,i);if(o!=null)return o}return}catch(r){j.warn(`Expression evaluation failed: ${e}`,r);return}}getNestedValue(e,a){const r=a.replace(/\?\./g,".");let i=e;const o=r.split(/\.(?![^\[]*\])/).flatMap(u=>{const d=u.match(/^([^\[]*)((?:\[\d+\])*)$/);if(d){const[,f,g]=d,m=[];f&&m.push(f);const b=g.match(/\[\d+\]/g);return b&&m.push(...b),m}return[u]}).filter(u=>u!=="");for(const u of o){if(i==null)return;if(u.startsWith("[")&&u.endsWith("]")){const d=parseInt(u.slice(1,-1),10);i=i[d]}else i=i[u]}return i}extractValueByPathOrExpression(e,a,r){const i=a.match(/^\{\{(.+)\}\}$/);if(i){const o=i[1].trim(),u=new vn,d={data:e,_global:this.globalState,_local:this.globalState._local||{}};try{const f=u.evaluateExpression(o,d);return j.log(`initLocal/initGlobal expression evaluated: ${a} -> `,f),f}catch(f){j.warn(`initLocal/initGlobal expression evaluation failed for ${r}:`,a,f);return}}return this.getNestedValue(e,a)}async loadLayoutScripts(e,a){const r=[];for(const i of e){if((i.if!==void 0||i.conditions!==void 0)&&!qi({if:i.if,conditions:i.conditions},a,this.bindingEngine,`script:${i.id}`)){j.log(`Script skipped (condition not met): ${i.id}`);continue}if(document.getElementById(i.id)){j.log(`Script already loaded: ${i.id}`);continue}const u=new Promise((d,f)=>{const g=document.createElement("script");g.src=i.src,g.id=i.id,g.async=i.async??!0,g.onload=()=>{j.log(`Script loaded successfully: ${i.id}`),d()},g.onerror=()=>{j.warn(`Failed to load script: ${i.id} (${i.src})`),d()},document.head.appendChild(g)});r.push(u)}r.length>0&&(await Promise.all(r),j.log(`All scripts loaded: ${e.filter(i=>!document.getElementById(i.id)||r.length>0).map(i=>i.id).join(", ")}`))}evaluateScriptCondition(e,a){try{if(e.startsWith("{{")&&e.endsWith("}}")){const r=e.slice(2,-2).trim();return new Function("ctx",`
with(ctx) {
try {
return Boolean(${r});
} catch (e) {
return false;
}
}
`)(a)}return!!e}catch(r){return j.warn(`Failed to evaluate script condition: ${e}`,r),!1}}showInitError(e){const a=Om(e);Kd.renderFromError("app",a,"초기화 실패",this.config.debug,{templateId:this.config.templateId,locale:this.config.locale},void 0,e)}showTransitionOverlay(e,a){const r=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(!r.enabled)return;if(this.hideTransitionOverlay(),r.style==="skeleton"&&r.skeleton?.component&&r.target&&a){this.renderSkeletonOverlay(r.target,r.skeleton,a,r.fallback_target);return}if(r.style==="spinner"&&r.target){this.renderSpinnerOverlay(r.target,r.spinner,r.fallback_target);return}const i=document.documentElement.classList.contains("dark");let o,u="";switch(r.style){case"blur":o=i?"rgba(17,24,39,0.3)":"rgba(255,255,255,0.3)",u="backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);";break;case"fade":o=i?"rgba(17,24,39,0.8)":"rgba(255,255,255,0.8)";break;case"skeleton":o=i?"rgb(17,24,39)":"rgb(249,250,251)";break;case"opaque":default:o=i?"rgb(17,24,39)":"rgb(249,250,251)";break}if(r.target){const d=`#${CSS.escape(r.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:${o};${u}z-index:2147483647;pointer-events:none;}`,document.head.appendChild(f),this.transitionOverlayEl=f}else{const d=document.createElement("div");d.id="g7-transition-overlay",d.setAttribute("aria-hidden","true"),d.style.position="fixed",d.style.inset="0",d.style.zIndex="9999",d.style.pointerEvents="none",d.style.background=o;for(const f of u.split(";")){const g=f.indexOf(":");g!==-1&&d.style.setProperty(f.slice(0,g).trim(),f.slice(g+1).trim())}document.body.appendChild(d),this.transitionOverlayEl=d}}hideTransitionOverlay(){this.transitionOverlayEl&&(this.transitionOverlayEl.remove(),this.transitionOverlayEl=null),this.hideSkeletonOverlay()}renderSkeletonOverlay(e,a,r,i){const u=fa.getInstance().getComponent(a.component);if(!u){j.log(`Skeleton component "${a.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){j.log(`Skeleton overlay: no target found (target="#${e}", fallback="${i||"none"}"), falling back to opaque overlay`),this.showTransitionOverlay({enabled:!0,style:"opaque",target:e});return}this.hideSkeletonOverlay();const m=document.documentElement.classList.contains("dark")?"rgb(17,24,39)":"rgb(249,250,251)",b=f==="fullpage"?"app":f==="fallback"?i:e,v=`#${CSS.escape(b)}`,E=document.createElement("style");E.id="g7-skeleton-overlay-style",E.textContent=`${v}{position:relative;z-index:0;}${v}::after{content:'';position:absolute;inset:0;background:${m};z-index:2147483646;pointer-events:none;}`,document.head.appendChild(E),this.transitionOverlayEl=E;const S=document.createElement("div");if(S.id="g7-skeleton-overlay",S.setAttribute("role","status"),S.setAttribute("aria-busy","true"),S.setAttribute("aria-label","Loading..."),f==="fullpage")S.style.cssText=["position:fixed","inset:0","z-index:20","overflow:hidden","pointer-events:none",`background:${m}`].join(";")+";";else{const O=d.getBoundingClientRect(),L=window.scrollX||document.documentElement.scrollLeft,P=window.scrollY||document.documentElement.scrollTop;S.style.cssText=["position:absolute",`top:${O.top+P}px`,`left:${O.left+L}px`,`width:${O.width}px`,`height:${O.height}px`,"z-index:20","overflow:hidden","pointer-events:none",`background:${m}`].join(";")+";"}document.body.appendChild(S),this.skeletonOverlayContainer=S;const A=r.components||[];let T;if(f==="fullpage")T=A;else{const O=f==="fallback"?i:e;T=this.findComponentChildrenById(A,O)}const D=Pu.createRoot(S);this.skeletonOverlayRoot=D,Ar.flushSync(()=>{D.render(We.createElement(u,{components:T,options:{animation:a.animation||"pulse",iteration_count:a.iteration_count||5}}))});const M=f==="fullpage"?"fullpage (#app)":f==="fallback"?`fallback (#${i})`:`target (#${e})`;j.log(`Skeleton overlay rendered [${M}] with "${a.component}" (${T.length} components)`)}findComponentChildrenById(e,a){const r=i=>{for(const o of i){if(o.id===a)return o.children||[];if(o.children&&Array.isArray(o.children)){const u=r(o.children);if(u!==null)return u}}return null};return r(e)||e}renderSpinnerOverlay(e,a,r){let i=document.getElementById(e),o="target";if(!i&&r&&(i=document.getElementById(r),o="fallback"),i||(i=document.getElementById("app"),o="fullpage"),!i){j.log(`Spinner overlay: no target found (target="#${e}", fallback="${r||"none"}"), falling back to opaque overlay`),this.showTransitionOverlay({enabled:!0,style:"opaque",target:e});return}this.hideSkeletonOverlay();const u=o==="fullpage"?"app":o==="fallback"?r:e,d=`#${CSS.escape(u)}`,f=document.createElement("style");f.id="g7-skeleton-overlay-style",f.textContent=[`${d}{position:relative;}`,"@keyframes g7-spin{to{transform:rotate(360deg)}}"].join(""),document.head.appendChild(f),this.transitionOverlayEl=f;const g=a?.text||window.G7Core?.t?.("nav.loading")||"";this._spinnerState={target:e,fallbackTarget:r,spinnerConfig:a,resolvedText:g},this._mountSpinnerInTarget(i);const m=o==="fullpage"?"fullpage (#app)":o==="fallback"?`fallback (#${r})`:`target (#${e})`,b=a?.component||"default spinner";j.log(`Spinner overlay rendered [${m}] with "${b}"`)}_mountSpinnerInTarget(e){if(!this._spinnerState)return;const{spinnerConfig:a,resolvedText:r}=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,a?.component){const u=fa.getInstance().getComponent(a.component);if(u){const d=Pu.createRoot(i);this.skeletonOverlayRoot=d,Ar.flushSync(()=>{d.render(We.createElement(u,{options:{text:r}}))});return}j.log(`Spinner component "${a.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:a}=this._spinnerState;let r=document.getElementById(e);!r&&a&&(r=document.getElementById(a)),r||(r=document.getElementById("app")),r&&(this._mountSpinnerInTarget(r),j.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 va&&e.details?.status===401){const r=this.config.templateId||"",i=window.location.pathname,o=r.includes("admin")||i.startsWith("/admin")?"admin":"user",u=i+window.location.search,d=!!$a().getToken()||e.details?.hadToken===!0,f=ga.getInstance().getLoginRedirectUrl(o,u,d?"session_expired":void 0);window.location.href=f;return}const a=Om(e);Kd.renderFromError("app",a,"페이지 로딩 실패",this.config.debug,{templateId:this.config.templateId,locale:this.config.locale},void 0,e)}async handleServerError(){const e=window.G7Error;if(!e)return!1;j.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"))?(j.log(`${e.code} error page rendered successfully`),!0):(j.log(`Falling back to ErrorDisplay for ${e.code}`),this.showInitError(new Error(`Service unavailable (${e.code})`)),!0)}catch(a){return j.error(`Failed to render ${e.code} page:`,a),this.showInitError(new Error(`Service unavailable (${e.code})`)),!0}}async handleRouteNotFound(e){j.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"))){j.log("404 error page rendered successfully");return}j.log("Falling back to ErrorDisplay for 404"),this.showRouteError(new Error(`Page not found: ${e}`))}catch(a){j.error("Failed to render 404 page:",a),this.showRouteError(new Error(`Page not found: ${e}`))}}getRouter(){return this.router}getConfig(){return this.config}getLayoutLoader(){return this.layoutLoader}async reloadExtensionState(){j.log("reloadExtensionState: start");let e;try{const a=await fetch(`/api/templates/${this.config.templateId}/config.json?_=${Date.now()}`);if(a.ok){const r=await a.json();r?.success&&r?.data?.cache_version!==void 0&&(e=r.data.cache_version)}}catch(a){j.warn("reloadExtensionState: failed to fetch config.json",a)}e!==void 0&&e!==this.extensionCacheVersion&&(j.log(`reloadExtensionState: cache version ${this.extensionCacheVersion} -> ${e}`),this.extensionCacheVersion=e,this.saveCacheVersionToStorage(e));try{this.router&&(await this.router.loadRoutes(this.extensionCacheVersion),j.log("reloadExtensionState: routes reloaded"))}catch(a){j.error("reloadExtensionState: routes reload failed",a)}try{this.layoutLoader&&(this.extensionCacheVersion>0&&this.layoutLoader.setCacheVersion(this.extensionCacheVersion),this.layoutLoader.clear(),j.log("reloadExtensionState: layout cache cleared"))}catch(a){j.error("reloadExtensionState: layout cache clear failed",a)}try{const{TranslationEngine:a}=await Promise.resolve().then(()=>Cg),r=a.getInstance();this.extensionCacheVersion>0&&r.setCacheVersion(this.extensionCacheVersion);const i=this.config.locale||"ko",o="en";await r.loadTranslations(this.config.templateId,i,"/api",!0),i!==o&&await r.loadTranslations(this.config.templateId,o,"/api",!0),j.log("reloadExtensionState: translations reloaded")}catch(a){j.error("reloadExtensionState: translations reload failed",a)}try{const a=await fetch(`/api/locales/active?_=${Date.now()}`);if(a.ok){const i=(await a.json())?.data?.locales;if(Array.isArray(i)&&i.length>0){const o=this.globalState.appConfig??{};this.setGlobalState({appConfig:{...o,supportedLocales:i}}),j.log("reloadExtensionState: supportedLocales refreshed",i)}}}catch(a){j.warn("reloadExtensionState: supportedLocales refresh failed",a)}j.log("reloadExtensionState: done")}getActionDispatcher(){return Ja().actionDispatcher}async changeLocale(e){try{if(j.log("Changing locale to:",e),this.config.locale===e){j.log("Locale is already",e);return}this.config.locale=e,this.saveLocaleToStorage(e),await this.saveLocaleToDatabase(e),this.layoutLoader&&(this.layoutLoader.clear(),j.log("Layout cache cleared")),this.errorPageHandler&&(this.errorPageHandler.updateLocale(e),j.log("ErrorPageHandler locale updated")),yc(),await wo({templateId:this.config.templateId,templateType:this.config.templateType,locale:e,debug:this.config.debug,cacheVersion:this.extensionCacheVersion}),j.log("Template Engine re-initialized with new locale");const{getActionDispatcher:a}=await Promise.resolve().then(()=>Ia),r=a();r&&(r.setDefaultContext({navigate:i=>this.router?.navigate(i)}),r.setGlobalStateUpdater((i,o)=>this.setGlobalState(i,o)),j.log("Navigate function and setGlobalState re-injected to ActionDispatcher")),this.reinitializeModuleHandlers(),j.log("Module handlers re-initialized"),this.reinitializeTemplateHandlers(),j.log("Template handlers re-initialized"),this.reinitializePluginHandlers(),j.log("Plugin handlers re-initialized"),this.router&&this.router.navigateToCurrentPath(),j.log("Locale changed successfully to",e)}catch(a){throw j.error("Failed to change locale:",a),a}}loadLocaleFromStorage(){try{return localStorage.getItem(Ea.LOCALE_STORAGE_KEY)}catch(e){return j.warn("Failed to load locale from storage:",e),null}}saveLocaleToStorage(e){try{localStorage.setItem(Ea.LOCALE_STORAGE_KEY,e)}catch(a){j.warn("Failed to save locale to storage:",a)}}async saveLocaleToDatabase(e){const a=localStorage.getItem("auth_token");if(!a){j.log("No auth token, skipping DB locale save");return}let r,i;if(this.config.localeApi)r=this.config.localeApi.endpoint,i=this.config.localeApi.method;else{const o=this.config.templateType==="admin";r=o?"/api/admin/users/me/language":"/api/user/profile/update-language",i=o?"PATCH":"POST"}try{const o=this.getXsrfToken(),u=await fetch(r,{method:i,headers:{"Content-Type":"application/json",Accept:"application/json",...o&&{"X-XSRF-TOKEN":o},Authorization:`Bearer ${a}`},credentials:"include",body:JSON.stringify({language:e})});u.ok?j.log("Locale saved to DB:",e):j.warn("Failed to save locale to DB (UI will still change):",u.statusText)}catch(o){j.warn("Failed to call locale API (UI will still change):",o)}}getXsrfToken(){if(typeof document>"u")return null;const a=`; ${document.cookie}`.split("; XSRF-TOKEN=");return a.length===2?decodeURIComponent(a.pop()?.split(";").shift()||""):null}loadCacheVersionFromStorage(){try{const e=localStorage.getItem(Ea.CACHE_VERSION_STORAGE_KEY);return e?parseInt(e,10):null}catch(e){return j.warn("Failed to load cache version from storage:",e),null}}saveCacheVersionToStorage(e){try{localStorage.setItem(Ea.CACHE_VERSION_STORAGE_KEY,String(e))}catch(a){j.warn("Failed to save cache version to storage:",a)}}reinitializeModuleHandlers(){if(typeof window>"u")return;const e="__",a=window;Object.keys(a).forEach(r=>{if(r.startsWith(e)&&typeof a[r]?.initModule=="function")try{a[r].initModule(),j.log(`Module handler re-initialized: ${r}`)}catch(i){j.warn(`Failed to re-initialize module handlers for ${r}:`,i)}})}reinitializeTemplateHandlers(){if(typeof window>"u")return;const e=window.G7TemplateHandlers;if(!e){j.warn("Template handlers not found on window.G7TemplateHandlers");return}const a=this.getActionDispatcher();if(!a){j.warn("ActionDispatcher not available for template handler registration");return}Object.entries(e).forEach(([r,i])=>{a.registerHandler(r,i)}),j.log(`${Object.keys(e).length} template handler(s) re-registered:`,Object.keys(e))}reinitializePluginHandlers(){if(typeof window>"u")return;const e="__",a=window;Object.keys(a).forEach(r=>{if(r.startsWith(e)&&typeof a[r]?.initPlugin=="function")try{a[r].initPlugin(),j.log(`Plugin handler re-initialized: ${r}`)}catch(i){j.warn(`Failed to re-initialize plugin handlers for ${r}:`,i)}})}getLocale(){return this.config.locale}getErrorPageHandler(){return this.errorPageHandler}getGlobalState(){return{...this.globalState}}setGlobalState(e,a){const r={...this.globalState};typeof e=="function"?this.globalState=e(this.globalState):this.globalState={...this.globalState,...e},j.log("Global state updated:",this.globalState),window.G7Core?.devTools?.captureStateSnapshot?.({source:"setGlobalState",prev:r,next:this.globalState}),this.globalStateListeners.forEach(o=>{o(this.globalState)}),a?.render!==!1&&Promise.resolve().then(()=>Ia).then(({updateTemplateData:o,getState:u})=>{const d=u();d.reactRoot&&d.currentLayoutJson&&o({_global:{...this.globalState},_local:this.globalState._local||{}})})}onGlobalStateChange(e){this.globalStateListeners.add(e)}offGlobalStateChange(e){this.globalStateListeners.delete(e)}async refetchDataSource(e,a){let r=this.currentDataSources.find(i=>i.id===e);if(!r)for(const[,i]of this.modalDataSources){const o=i.find(u=>u.id===e);if(o){r=o;break}}if(!r){j.warn(`Data source not found: ${e}`);return}j.log(`Refetching data source: ${e}`,a?.sync?"(sync mode)":"",a?.globalStateOverride?"(with global override)":"",a?.localStateOverride?"(with local override)":""),Na.setPending(!0);try{const i=new Sa;this.currentGlobalHeaders.length>0&&i.setGlobalHeaders(this.currentGlobalHeaders);const o=Ja(),u=o.currentDataContext?._global||{},d=a?.globalStateOverride?{...u,...a.globalStateOverride}:u,f=o.currentDataContext?._local||{},g=a?.localStateOverride?{...f,...a.localStateOverride}:f,b=(await i.fetchDataSourcesWithResults([r],this.currentRouteParams,this.currentQueryParams,d,g,{ignoreAutoFetch:!0}))[0];if(b.state==="success"&&b.data!==void 0){this.currentFetchedData[e]=b.data;const v={};this.processInitOptions([r],{[e]:b.data},v);const E=Ja();if(E.bindingEngine){const A=[e];r.initGlobal&&A.push("_global"),r.initLocal&&A.push("_local"),E.bindingEngine.invalidateCacheByKeys(A)}const S={[e]:b.data};return Object.keys(v).length>0&&(S._localInit=v),r.initGlobal&&(S._global={...this.globalState}),ts(S,a?.sync?{sync:!0}:void 0),j.log(`Data source refetched successfully: ${e}`),b.data}else if(b.state==="error"){j.error(`Failed to refetch data source: ${e}`,b.error);return}}catch(i){j.error(`Error refetching data source: ${e}`,i);return}finally{Na.setPending(!1)}}registerModalDataSources(e,a){this.modalDataSources.set(e,a),j.log(`Modal data sources registered: ${e} (${a.length} sources)`)}unregisterModalDataSources(e){this.modalDataSources.delete(e),j.log(`Modal data sources unregistered: ${e}`)}getDataSource(e){return this.currentFetchedData[e]}setDataSource(e,a,r){if(!e){j.warn("setDataSource: dataSourceId is required");return}const{merge:i=!1,sync:o=!1}=r||{};i&&this.currentFetchedData[e]?this.currentFetchedData[e]={...this.currentFetchedData[e],...a}:this.currentFetchedData[e]=a,Promise.resolve().then(()=>Ia).then(({updateTemplateData:u})=>{u({[e]:this.currentFetchedData[e]},o?{sync:!0}:void 0)}),j.log(`setDataSource: Updated ${e}`,i?"(merged)":"(replaced)")}updateDataSourceItem(e,a,r,i,o){const{idField:u="id",merge:d=!0,skipRender:f=!1}=o||{},g=this.currentFetchedData[e];if(!g)return j.warn(`updateDataSourceItem: DataSource '${e}' not found`),!1;const m=this.parseItemPath(a);let b=g;for(const S of m)if(b=b?.[S],b===void 0)return j.warn(`updateDataSourceItem: Path '${a}' not found in dataSource`),!1;if(!Array.isArray(b))return j.warn(`updateDataSourceItem: Target at '${a}' is not an array`),!1;const v=b.findIndex(S=>String(S[u])===String(r));if(v===-1)return j.warn(`updateDataSourceItem: Item with ${u}='${r}' not found`),!1;d?b[v]=this.deepMerge(b[v],i):b[v]={...b[v],...i};const E=window.G7Core?.devTools;return E?.isEnabled?.()&&E.trackDataSourceUpdate?.({dataSourceId:e,updateType:"partial",itemPath:a,itemId:r,updates:i,timestamp:Date.now()}),f||Promise.resolve().then(()=>Ia).then(({updateTemplateData:S})=>{S({[e]:this.currentFetchedData[e]},{sync:!1})}),j.log(`updateDataSourceItem: Updated ${e}.${a}[${u}=${r}]`),!0}parseItemPath(e){const a=[],r=/([^\.\[\]]+)|\[(\d+)\]/g;let i;for(;(i=r.exec(e))!==null;)i[1]!==void 0?a.push(i[1]):i[2]!==void 0&&a.push(parseInt(i[2],10));return a}deepMerge(e,a){if(a==null)return e;if(typeof a!="object"||Array.isArray(a))return a;const r={...e};for(const i of Object.keys(a))typeof a[i]=="object"&&a[i]!==null&&!Array.isArray(a[i])?r[i]=this.deepMerge(r[i]||{},a[i]):r[i]=a[i];return r}setValueAtPath(e,a,r,i="deep"){const o=a.split(".");let u=e;for(let g=0;g<o.length-1;g++){const m=o[g];(u[m]===void 0||u[m]===null||typeof u[m]!="object")&&(u[m]={}),u=u[m]}const d=o[o.length-1],f=u[d];i==="replace"||f===void 0?u[d]=r:i==="shallow"?typeof f=="object"&&typeof r=="object"&&!Array.isArray(r)?u[d]={...f,...r}:u[d]=r:typeof f=="object"&&typeof r=="object"&&!Array.isArray(r)?u[d]=this.deepMerge(f,r):u[d]=r}flattenNestedObjectToMappings(e,a=""){const r=[];for(const[i,o]of Object.entries(e)){if(i==="_merge")continue;const u=a?`${a}.${i}`:i;typeof o=="string"?r.push({targetPath:u,sourcePath:o}):typeof o=="object"&&o!==null&&!Array.isArray(o)&&r.push(...this.flattenNestedObjectToMappings(o,u))}return r}async updateQueryParams(e,a){j.log("updateQueryParams:",e);const r=new URL(e,window.location.origin),i=new URLSearchParams(r.search);window.history.replaceState(null,"",e),j.log("URL updated via replaceState"),this.currentQueryParams=i,j.log("currentQueryParams updated:",Object.fromEntries(i.entries()));const o=new Sa,u=Ja().currentDataContext?._global||this.globalState||{},d={route:this.currentRouteParams||{},query:Mm(this.currentQueryParams),_global:u},f=Array.isArray(this.currentRawDataSources)&&this.currentRawDataSources.length>0?o.filterByCondition(this.currentRawDataSources,d):this.currentDataSources;this.currentDataSources=f;const g=f.filter(A=>A.auto_fetch!==!1&&A.type!=="websocket");if(g.length===0){j.log("No auto_fetch data sources to refetch");return}j.log(`Refetching ${g.length} auto_fetch data sources`),Na.setPending(!0);const m=Ja().currentLayoutJson,b=m?.transition_overlay,v=Array.isArray(b?.wait_for)?b.wait_for:[],E=g.some(A=>(A.loading_strategy||"progressive")==="blocking"),S=v.length>0&&g.some(A=>v.includes(A.id)&&A.type!=="websocket"&&(A.loading_strategy||"progressive")!=="background");if((E||S)&&b&&typeof b=="object"){const A=a?.transitionOverlayTarget||b.target;b.enabled&&b.style==="skeleton"&&b.skeleton?.component&&A?this.renderSkeletonOverlay(A,b.skeleton,m,b.fallback_target):b.enabled&&b.style==="spinner"&&A&&this.renderSpinnerOverlay(A,b.spinner,b.fallback_target)}try{const A=new Sa;this.currentGlobalHeaders.length>0&&A.setGlobalHeaders(this.currentGlobalHeaders);const T=Ja(),D=T.currentDataContext?._global||{},M=await A.fetchDataSourcesWithResults(g,this.currentRouteParams,this.currentQueryParams,D,void 0,{ignoreAutoFetch:!1}),O={},L={},P=new Map(g.map(U=>[U.id,U]));for(const U of M){const B=P.get(U.id);if(!B){j.warn(`Refetch result id not found in autoFetchDataSources: ${U.id}`);continue}const Y=U.id;U.state==="success"&&U.data!==void 0?(this.currentFetchedData[Y]=U.data,O[Y]=U.data,this.processInitOptions([B],{[Y]:U.data},L),j.log(`Data source refetched: ${Y}`)):U.state==="error"&&j.error(`Failed to refetch data source: ${Y}`,U.error)}if(T.bindingEngine){const U=Object.keys(O);U.push("query"),T.bindingEngine.invalidateCacheByKeys(U)}if(Object.keys(L).length>0&&(O._localInit=L),Object.keys(O).length>0){if(O.query=Mm(this.currentQueryParams),T.currentLayoutJson?.computed&&Object.keys(T.currentLayoutJson.computed).length>0){const U={...T.currentDataContext,...O,query:O.query},B=this.calculateComputed(T.currentLayoutJson.computed,U);Object.keys(B).length>0&&(O._computed=B,this.globalState._computed=B,j.log("Computed values recalculated in updateQueryParams:",Object.keys(B)))}ts(O,{sync:!0}),j.log("Template data updated with new query params")}}catch(A){j.error("Error in updateQueryParams:",A)}finally{Na.setPending(!1),this.hideTransitionOverlay()}}calculateComputed(e,a){const r={},i=new vn;for(const[o,u]of Object.entries(e))try{let d;if(this.isComputedSwitchDefinition(u))d=i.resolveSwitch(u,a,{skipCache:!0});else if(typeof u=="string")if(u.startsWith("{{")&&u.endsWith("}}")){const f=u.slice(2,-2).trim();d=this.evaluateComputedExpression(f,a)}else d=u;r[o]=d,j.log(`Computed ${o}:`,d)}catch(d){j.warn(`Failed to calculate computed value: ${o}`,d),r[o]=void 0}return r}isComputedSwitchDefinition(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&"$switch"in e&&"$cases"in e}evaluateComputedExpression(e,a){try{return new Function("ctx",`
with(ctx) {
try {
return ${e};
} catch (e) {
return undefined;
}
}
`)(a)}catch(r){j.warn(`Expression evaluation failed: ${e}`,r);return}}async executeInitActions(e,a={}){const{getActionDispatcher:r}=await Promise.resolve().then(()=>Ia),i=r();if(!i){j.warn("ActionDispatcher not available for init_actions");return}j.log("Executing init_actions:",e.map(d=>d.handler)),j.log("Init actions dataContext:",a),j.log("Init actions dataContext._global:",a._global);const o=e.map(d=>d.handler).filter(d=>d.includes("."));o.length>0&&await this.waitForHandlers(i,o);let u={...a};for(const d of e)try{const f={type:"click",handler:d.handler,target:d.target,params:d.params,resultTo:d.resultTo,onSuccess:d.onSuccess,onError:d.onError,if:d.if,conditions:d.conditions,auth_mode:d.auth_mode,auth_required:d.auth_required},g=i.createHandler(f,u),m=new Event("init");await g(m),j.log(`Init action executed: ${d.handler}`);const b=this.globalState;u={...u,_global:{...b},_local:b._local||u._local||{}},j.log(`Data context refreshed after ${d.handler}:`,{cartKey:u._global?.cartKey})}catch(f){j.error(`Failed to execute init action: ${d.handler}`,f)}}async waitForHandlers(e,a,r=5e3){const i=Date.now(),o=50,u=()=>a.every(d=>e.customHandlers?.has(d));if(u()){j.log("All module handlers already registered");return}return j.log("Waiting for module handlers:",a),new Promise(d=>{const f=()=>{if(u()){j.log("All module handlers now registered"),d();return}if(Date.now()-i>=r){const g=a.filter(m=>!e.customHandlers?.has(m));j.warn("Timeout waiting for handlers:",g),d();return}setTimeout(f,o)};f()})}};$(Ea,"LOCALE_STORAGE_KEY","g7_locale"),$(Ea,"CACHE_VERSION_STORAGE_KEY","g7_cache_version");let mo=Ea;function Xd(l){const e=new mo(l);return l.websocket&&(hc.configure(l.websocket),j.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=Xd,window.G7Core.dataSource={refetch:async(l,e)=>{const a=window.__templateApp;if(!a){j.warn("TemplateApp not initialized (G7Core.dataSource.refetch)");return}return a.refetchDataSource(l,e)},get:l=>{const e=window.__templateApp;if(!e){j.warn("TemplateApp not initialized (G7Core.dataSource.get)");return}return e.getDataSource(l)}});function FE(l={}){const{checked:e,value:a,name:r,type:i="checkbox"}=l,u=a!==void 0?a:i==="checkbox"||i==="radio"?e??!1:String(e??""),d={checked:e??!1,value:u,name:r??"",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 KE(l={}){const{button:e=0,clientX:a=0,clientY:r=0}=l;return{button:e,clientX:a,clientY:r,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 WE(){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 YE(l,e="keydown"){return{key:l,code:l.length===1?`Key${l.toUpperCase()}`:l,preventDefault:()=>{},stopPropagation:()=>{},nativeEvent:new KeyboardEvent(e,{key:l}),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 XE={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 $m(l){const e=l.replace(/^(dark:|hover:|focus:|active:|disabled:|group-hover:|sm:|md:|lg:|xl:|2xl:)+/,"");for(const[a,r]of Object.entries(XE))if(r.test(e))return a;return null}function Nm(l){const e=l.match(/^((dark:|hover:|focus:|active:|disabled:|group-hover:|sm:|md:|lg:|xl:|2xl:)+)/);return e?e[1]:""}function QE(l,e){if(!e||e.trim()==="")return l;if(!l||l.trim()==="")return e;const a=l.split(/\s+/).filter(Boolean),r=e.split(/\s+/).filter(Boolean),i=new Map;for(const u of r){const d=$m(u);if(d){const f=Nm(u),g=`${d}:${f}`;i.set(g,u)}}return[...a.filter(u=>{const d=$m(u);if(!d)return!0;const f=Nm(u),g=`${d}:${f}`;return!i.has(g)}),...r].join(" ")}function JE(l){return Object.entries(l).filter(([,e])=>e).map(([e])=>e).join(" ")}function ZE(...l){return l.filter(e=>typeof e=="string"&&e.length>0).join(" ")}const Se=dt("G7CoreGlobals");function e_(){window.React=We,window.ReactDOM={...Gu,createPortal:Ar.createPortal,unstable_batchedUpdates:l=>l()},window.ReactJSXRuntime=t0,Se.log("전역 객체 window.React, window.ReactDOM, window.ReactJSXRuntime에 노출됨")}function t_(l){const e=new Map,a=Tr.getInstance();l.componentEvent={on:(r,i)=>(e.has(r)||e.set(r,new Set),e.get(r).add(i),a.trackEventSubscribe(r),()=>{e.get(r)?.delete(i),a.trackEventUnsubscribe(r)}),emit:async(r,i)=>{const o=e.get(r),u=o?.size??0;if(!o||o.size===0)return a.trackEventEmit(r,i,0),[];let d,f=[];try{f=await Promise.all(Array.from(o).map(async g=>{try{return await g(i)}catch(m){throw Se.error(`componentEvent: Error in listener for "${r}":`,m),m}}))}catch(g){d=g instanceof Error?g:new Error(String(g))}if(a.trackEventEmit(r,i,u,f,d),d)throw d;return f},off:r=>{e.delete(r),a.trackEventOff(r)},clear:()=>{e.clear(),a.trackEventClear()}},Se.log("전역 객체 window.G7Core.componentEvent에 노출됨")}function n_(l){l.__runtime||(l.__runtime={DynamicRenderer:za,ComponentRegistry:fa,TranslationEngine:li,DataSourceManager:Sa,dataSourceManager:NE,DataBindingEngine:vn,dataBindingEngine:pS,ActionDispatcher:ro,TranslationReactContext:Bd,TranslationProvider:uc,useTranslation:vm,ResponsiveContext:bd,ResponsiveProvider:Ql,useResponsive:vd,responsiveManager:ci,BREAKPOINT_PRESETS:Ll,AuthManager:ga,createLogger:dt,G7DevToolsCore:Tr},Se.log("전역 객체 window.G7Core.__runtime(코어 런타임 표면)에 노출됨"))}function a_(l){if(l.layoutEditor&&l.layoutEditor.__isStub!==!0||l.layoutEditor&&l.layoutEditor.__isStub===!0)return;const e=[],a=[];l.layoutEditor={__isStub:!0,__queue:e,__readyCallbacks:a,registerWidget:(r,i)=>e.push(["widget",r,i]),registerNodeEditor:(r,i)=>e.push(["nodeEditor",r,i]),registerCanvasOverlay:(r,i)=>e.push(["canvasOverlay",r,i]),onReady:r=>{typeof r=="function"&&a.push(r)}},Se.log("전역 객체 window.G7Core.layoutEditor 예약 접수함(stub) 노출됨")}function r_(l,e){l.useTranslation=vm,l.t=(a,r)=>{const i=e.getState();if(!i.translationEngine||!i.translationContext)return a;if(r){const o="|"+Object.entries(r).map(([u,d])=>`${u}=${d}`).join("|");return i.translationEngine.translate(a,i.translationContext,o)}return i.translationEngine.translate(a,i.translationContext)},Se.log("전역 객체 window.G7Core.useTranslation에 노출됨")}function i_(l,e){l.createChangeEvent=FE,l.createClickEvent=KE,l.createSubmitEvent=WE,l.createKeyboardEvent=YE,l.uuid=()=>typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,a=>{const r=Math.random()*16|0;return(a==="x"?r:r&3|8).toString(16)}),l.createLogger=dt,Se.log("전역 객체 window.G7Core.createLogger에 노출됨"),l.renderItemChildren=(a,r,i,o,u)=>{const d=e.getState(),m={_global:window.__templateApp?.getGlobalState?.()||{},_local:r._local||{},_computed:r._computed||{},...r},b=new Set,v=(S,A)=>{const T=m._global?._remountKeys;return S&&T?.[S]&&!b.has(S)?(b.add(S),`${S}-remount-${T[S]}`):S||A},E={translationContext:d.translationContext,translationEngine:d.translationEngine,bindingEngine:d.bindingEngine,actionDispatcher:d.actionDispatcher,getRemountKey:v,...u};return Xs(a,m,i,o,E)},l.getComponentMap=()=>fa.getInstance().getComponentMap(),l.renderComponentLayout=(a,r,i)=>{if(!a||!Array.isArray(a)||a.length===0)return null;const o=fa.getInstance().getComponentMap(),u=e.getState(),f=window.__templateApp?.getGlobalState?.()||{},g={_global:f._global||{},_local:f._local||{},_computed:f._computed||{},...r},m=new Set,b=(v,E)=>{const S=g._global?._remountKeys;return v&&S?.[v]&&!m.has(v)?(m.add(v),`${v}-remount-${S[v]}`):v||E};return Xs(a,g,o,i,{translationContext:u.translationContext,translationEngine:u.translationEngine,bindingEngine:u.bindingEngine,actionDispatcher:u.actionDispatcher,getRemountKey:b})},l.renderExpandContent=a=>{const{children:r,row:i,expandContext:o,componentContext:u,keyPrefix:d}=a;if(!r||!Array.isArray(r)||r.length===0)return null;const f=a.componentMap||fa.getInstance().getComponentMap(),g=e.getState(),m=l.state?.get?.()||{},b=u?.stateRef?.current??u?.state??{},v={...m._local||{},...b},E=u?.computedRef?.current??m._computed??{},S=g.bindingEngine??l.getDataBindingEngine?.(),A={...m,_local:v,_computed:E,row:i,item:i,$item:i};let T={};if(o&&typeof o=="object"&&S)try{for(const[L,P]of Object.entries(o))if(typeof P=="string"){const U=P.match(/^\{\{([^}]+)\}\}$/);if(U){const B=U[1].trim();try{T[L]=S.evaluateExpression(B,A,{skipCache:!0})}catch{T[L]=void 0}}else T[L]=S.resolveBindings(P,A,{skipCache:!0})}else T[L]=P}catch(L){Se.warn("renderExpandContent: expandContext 평가 오류:",L)}const D={row:i,item:i,$item:i,_local:v,_global:m._global||{},_computed:m._computed||{},...T},M=new Set,O=(L,P)=>{const U=D._global?._remountKeys;return L&&U?.[L]&&!M.has(L)?(M.add(L),`${L}-remount-${U[L]}`):L||P};return Xs(r,D,f,d,{translationContext:g.translationContext,translationEngine:g.translationEngine??void 0,bindingEngine:g.bindingEngine??void 0,actionDispatcher:g.actionDispatcher,componentContext:u,getRemountKey:O})},l.$get=function(r,i,o=void 0){if(r==null)return o;const u=Array.isArray(i)?i:[i];if(u.length===0)return r;let d=r;for(const f of u){if(d==null||f==null)return o;d=d[f]}return d??o},Se.log("전역 객체 window.G7Core.renderItemChildren에 노출됨"),Se.log("전역 객체 window.G7Core.renderComponentLayout에 노출됨"),Se.log("전역 객체 window.G7Core.renderExpandContent에 노출됨"),Se.log("전역 객체 window.G7Core.$get에 노출됨")}function s_(l){l.dispatch=async(e,a)=>{const r=window.__templateApp;if(!r)return Se.warn("G7Core.dispatch: TemplateApp이 초기화되지 않았습니다."),{success:!1,error:new Error("TemplateApp이 초기화되지 않았습니다.")};const i=r.getActionDispatcher?.();if(!i)return Se.warn("G7Core.dispatch: ActionDispatcher를 찾을 수 없습니다."),{success:!1,error:new Error("ActionDispatcher를 찾을 수 없습니다.")};const o=r.getRouter?.(),u=r.getGlobalState?.(),d=r.setGlobalState?.bind(r),g=a?.componentContext||window.__g7ActionContext,m=window.__g7PendingLocalState;let b=g?.state??u;m&&g&&(b=m,Se.log("[dispatch] Using __g7PendingLocalState for context.state:",m));let v=g?.data??u;m&&g?.data?._local&&(v={...g.data,_local:m},Se.log("[dispatch] Updated context.data._local with pendingLocalState"));const E={navigate:o?(S,A)=>o.navigate(S,A):void 0,setState:g?.setState??d,state:b,data:v,_isDispatchFallbackContext:!g?.setState};if(e.debounce){const S=e.debounceKey||`dispatch-${e.handler}`,A=typeof e.debounce=="number"?e.debounce:e.debounce.delay;return i.debouncedCall(S,A,()=>{const{debounce:T,debounceKey:D,...M}=e;i.dispatchAction(M,E)}),{success:!0,debounced:!0}}try{return await i.dispatchAction(e,E)}catch(S){return Se.error("G7Core.dispatch: 액션 실행 오류:",S),{success:!1,error:S instanceof Error?S:new Error(String(S))}}},Se.log("전역 객체 window.G7Core.dispatch에 노출됨")}function yo(l){const e={};for(const[a,r]of Object.entries(l))if(a.includes(".")){const i=a.split(".");let o=e;for(let u=0;u<i.length-1;u++){const d=i[u];d in o?(typeof o[d]!="object"||o[d]===null)&&(o[d]={}):o[d]={},o=o[d]}o[i[i.length-1]]=r}else e[a]=r;return e}function Hm(l,e=""){const a=[];if(!l||typeof l!="object")return a;for(const r of Object.keys(l)){const i=e?`${e}.${r}`:r,o=l[r];o&&typeof o=="object"&&!Array.isArray(o)?a.push(...Hm(o,i)):a.push(i)}return a}function o_(l){const e=Object.keys(l);return e.length>0&&e.every(a=>/^\d+$/.test(a))}function zm(l,e){const a={...l};for(const r of Object.keys(e))r in a?a[r]!==null&&typeof a[r]=="object"&&!Array.isArray(a[r])&&e[r]!==null&&typeof e[r]=="object"&&!Array.isArray(e[r])&&(a[r]=zm(a[r],e[r])):a[r]=e[r];return a}function ea(l,e){if(Array.isArray(l)&&!Array.isArray(e)&&o_(e)){const r=Object.keys(e).map(o=>parseInt(o,10));if(!((r.length>0?Math.max(...r):0)>=l.length+r.length+10)){const o=[...l];for(const[u,d]of Object.entries(e)){const f=parseInt(u,10);f>=0&&f<o.length?d!==null&&typeof d=="object"&&!Array.isArray(d)&&o[f]!==null&&typeof o[f]=="object"?o[f]=ea(o[f],d):o[f]=d:f>=o.length&&(o[f]=d)}return o}}const a={...l};for(const[r,i]of Object.entries(e))i!==null&&typeof i=="object"&&!Array.isArray(i)?a[r]!==null&&typeof a[r]=="object"?a[r]=ea(a[r],i):a[r]={...i}:a[r]=i;return a}function l_(l){l.state={get:()=>window.__templateApp?.getGlobalState?.()||{},set:(e,a)=>{const r=window.__templateApp;if(r?.setGlobalState&&r?.getGlobalState){const i=a?.merge||"deep",o=yo(e);let u;if(i==="replace")u=o;else if(i==="shallow")u={...r.getGlobalState(),...o};else{const d=r.getGlobalState();u=ea(d,o)}r.setGlobalState(u,{render:a?.render})}else Se.warn("G7Core.state.set: TemplateApp이 초기화되지 않았습니다.")},setLocal:(e,a)=>{const r=window.__templateApp;if(a?.render===!1&&!a?.selfManaged){const T=window.__g7AutoBindingPaths;T&&T.size>0&&Hm(yo(e)).some(M=>T.has(M))&&(Se.log("[setLocal] render:false + 자동바인딩 경로 겹침 감지 → render:true 자동 승격 (engine-v1.43.0)"),a={...a,render:!0})}if(a?.debounce){const T=r?.getActionDispatcher?.();if(T){const D=a.debounceKey||`setLocal-${Object.keys(e).join(",")}`,{debounce:M,debounceKey:O,...L}=a;T.debouncedCall(D,a.debounce,()=>{l.state.setLocal(e,L)});return}}const i=a?.scope??"current",o=a?.merge||"deep",u=window.__g7ActionContext,d=yo(e);if(i==="parent"||i==="root"){const T=window.__g7LayoutContextStack||[];if(T.length>0){const D=i==="parent"?T[T.length-1]:T[0];if(D?.setState){D.setState(M=>o==="replace"?d:o==="shallow"?{...M||{},...d}:ea(M||{},d)),Se.log(`[setLocal] scope=${i}: 타겟 컨텍스트에 상태 업데이트 (mergeMode=${o})`,d);return}}Se.warn(`[setLocal] scope=${i}: 레이아웃 컨텍스트 스택이 비어있습니다. current로 폴백합니다.`)}const f=window.__g7PendingLocalState,g=r?.getGlobalState?.()?._local||{},v=!((window.__g7LayoutContextStack||[]).length>0)&&u?.state?u.state:void 0,E=v?zm(g,v):g,S=f||E;let A;if(o==="replace"?A=d:o==="shallow"?A={...S,...d}:A=ea(S,d),r?.setGlobalState&&(r.setGlobalState({_local:A},{render:a?.render}),Se.log(`[setLocal] globalLocal updated via setGlobalState (mergeMode=${o}, render=${a?.render??!0}):`,d)),window.__g7PendingLocalState=A,Se.log("[setLocal] __g7PendingLocalState updated:",A),window.__g7SequenceLocalSync=A,window.__g7LastSetLocalSnapshot=A,o==="replace")window.__g7ForcedLocalFields=d;else{const T=window.__g7ForcedLocalFields||{};window.__g7ForcedLocalFields=ea(T,d)}if(Se.log("[setLocal] __g7ForcedLocalFields updated:",d),o==="replace")window.__g7SetLocalOverrideKeys=d;else{const T=window.__g7SetLocalOverrideKeys||{};window.__g7SetLocalOverrideKeys=ea(T,d)}Se.log("[setLocal] __g7SetLocalOverrideKeys updated:",d),u?.setState&&u.setState(T=>o==="replace"?d:o==="shallow"?{...T||{},...d}:ea(T||{},d)),r?.setGlobalState||Se.warn("G7Core.state.setLocal: TemplateApp이 없습니다.")},getLocal:()=>{const r=(window.__templateApp?.getGlobalState?.()||{})._local||{},i=window.__g7PendingLocalState;if(i)return ea(r,i);const o=window.__g7LastSetLocalSnapshot;return o&&o!==r?ea(r,o):r},update:e=>{const a=window.__templateApp;if(a?.getGlobalState&&a?.setGlobalState){const r=a.getGlobalState(),i=e(r);a.setGlobalState(i)}else Se.warn("G7Core.state.update: TemplateApp이 초기화되지 않았습니다.")},subscribe:e=>{const a=window.__templateApp;return a?.onGlobalStateChange?a.onGlobalStateChange(e):(Se.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,a,r)=>{let i,o,u;typeof e=="string"?(i=e,o=a||{},u=r):(o=e,u=a&&typeof a=="object"&&"merge"in a?a:r);const d=u?.merge||"deep",f=yo(o);if(i){const b=window.__g7IsolatedStates?.[i];b?.mergeState?b.mergeState(f,d):Se.warn(`G7Core.state.setIsolated: scopeId '${i}'를 찾을 수 없습니다.`);return}const g=window.__g7ActionContext;g?.isolatedContext?.mergeState?g.isolatedContext.mergeState(f,d):Se.warn("G7Core.state.setIsolated: 액션 컨텍스트에 isolatedContext가 없습니다.")},getParent:()=>{const e=window.__g7LayoutContextStack||[];if(e.length===0)return Se.log("[getParent] 레이아웃 컨텍스트 스택이 비어있습니다."),null;const a=e[e.length-1];if(!a)return null;const r=a.dataContext||{};return{_local:a.state||r._local||{},_global:r._global||l.state.get()||{},setState:a.setState}},setParentLocal:(e,a,r)=>{const i=window.__g7LayoutContextStack||[];if(i.length===0){Se.warn("[setParentLocal] 레이아웃 컨텍스트 스택이 비어있습니다.");return}const o=i[i.length-1];if(!o?.setState){Se.warn("[setParentLocal] 부모 컨텍스트에 setState가 없습니다.");return}let u,d;typeof e=="string"?(u={[e]:a},d=r):(u=e,d=a&&typeof a=="object"&&"merge"in a?a:r);const f=d?.merge||"deep",g=yo(u),m=o.state?._local!==void 0,b=m?o.state._local:o.state||{};let v;f==="replace"?v=g:f==="shallow"?v={...b,...g}:v=ea(b,g),window.__g7PendingLocalState=v;const E=window.__templateApp;if(E?.setGlobalState&&E.setGlobalState({_local:v}),o.setState(v),m?o.state._local=v:o.state=v,o.dataContext&&(o.dataContext._local=v),f==="replace")window.__g7ForcedLocalFields=g;else{const S=window.__g7ForcedLocalFields||{};window.__g7ForcedLocalFields=ea(S,g)}md()},setParentGlobal:(e,a)=>{let r;typeof e=="string"?r={[e]:a}:r=e,l.state.set(r),Se.log("[setParentGlobal] 전역 상태 업데이트:",r)}},window.__g7IsolatedStates||(window.__g7IsolatedStates={}),l.state.getGlobal=l.state.get,l.state.setGlobal=l.state.set,Se.log("전역 객체 window.G7Core.state에 노출됨")}function c_(l){l.dataSource={get:e=>window.__templateApp?.getDataSource?.(e),set:(e,a,r)=>{const i=window.__templateApp;i?.setDataSource?i.setDataSource(e,a,r):Se.warn("G7Core.dataSource.set: TemplateApp이 초기화되지 않았습니다.")},refetch:async(e,a)=>{const r=window.__templateApp;if(r?.refetchDataSource)return r.refetchDataSource(e,a);Se.warn("G7Core.dataSource.refetch: TemplateApp이 초기화되지 않았습니다.")},updateItem:(e,a,r,i,o)=>{const u=window.__templateApp;return u?.updateDataSourceItem?u.updateDataSourceItem(e,a,r,i,o):(Se.warn("G7Core.dataSource.updateItem: TemplateApp이 초기화되지 않았습니다."),!1)},updateData:(e,a,r,i="append")=>{const o=window.__templateApp;if(!o?.getDataSource||!o?.setDataSource)return Se.warn("G7Core.dataSource.updateData: TemplateApp이 초기화되지 않았습니다."),!1;const u=o.getDataSource(e);if(!u)return Se.warn(`G7Core.dataSource.updateData: 데이터 소스 '${e}'를 찾을 수 없습니다.`),!1;let d,f=u,g=null;if(a){const b=a.split(".");g=b.pop();for(const v of b)if(f&&typeof f=="object"&&v in f)f=f[v];else return Se.warn(`G7Core.dataSource.updateData: 경로 '${a}'를 찾을 수 없습니다.`),!1;d=f[g]}else d=u;if(!Array.isArray(d))return Se.warn("G7Core.dataSource.updateData: 대상 경로의 데이터가 배열이 아닙니다."),!1;if(!Array.isArray(r))return Se.warn("G7Core.dataSource.updateData: newData가 배열이 아닙니다."),!1;const m=i==="prepend"?[...r,...d]:[...d,...r];return a&&g?(f[g]=m,o.setDataSource(e,u,{merge:!1})):o.setDataSource(e,m,{merge:!1}),Se.log(`G7Core.dataSource.updateData: '${e}'에 ${r.length}개 항목 ${i==="prepend"?"앞에":"뒤에"} 추가됨`),!0}},Se.log("전역 객체 window.G7Core.dataSource에 노출됨")}function u_(l,e){l.locale={current:()=>window.__templateApp?.getLocale?.()||"ko",supported:()=>{const r=window.__templateApp?.globalState?.appConfig?.supportedLocales;return Array.isArray(r)&&r.length>0?r:e.getState().templateMetadata?.locales||["ko","en"]},change:async a=>{const r=window.__templateApp;r?.changeLocale?await r.changeLocale(a):Se.warn("G7Core.locale.change: TemplateApp이 초기화되지 않았습니다.")}},Se.log("전역 객체 window.G7Core.locale에 노출됨")}function d_(l){l.toast={show:(e,a)=>{l.dispatch({handler:"toast",params:{message:e,type:a?.type||"info",...a?.duration&&{duration:a.duration}}})},success:(e,a)=>{l.toast.show(e,{type:"success",duration:a})},error:(e,a)=>{l.toast.show(e,{type:"error",duration:a})},warning:(e,a)=>{l.toast.show(e,{type:"warning",duration:a})},info:(e,a)=>{l.toast.show(e,{type:"info",duration:a})}},Se.log("전역 객체 window.G7Core.toast에 노출됨")}function f_(l){l.modal={open:e=>{l.dispatch({handler:"openModal",target:e})},close:e=>{l.dispatch({handler:"closeModal",...e&&{target:e}})},closeAll:()=>{l.dispatch({handler:"closeAllModals"})},isOpen:e=>{const a=l.state.get();return a._global?.activeModal===e||a._global?.modalStack?.includes(e)||!1},getStack:()=>l.state.get()._global?.modalStack||[]},Se.log("전역 객체 window.G7Core.modal에 노출됨")}function h_(l){l.style={mergeClasses:QE,conditionalClass:JE,joinClasses:ZE},Se.log("전역 객체 window.G7Core.style에 노출됨")}function g_(l,e){const{webSocketManager:a}=e;l.websocket={manager:a,subscribe:(r,i,o,u)=>a.subscribe(r,i,o,u),unsubscribe:r=>a.unsubscribe(r),leaveChannel:r=>a.leaveChannel(r),disconnect:()=>a.disconnect(),isInitialized:()=>a.isInitialized(),getSubscriptionCount:()=>a.getSubscriptionCount()},Se.log("전역 객체 window.G7Core.websocket에 노출됨")}function p_(l,e){const{transitionManager:a}=e;l.navigation={isPending:()=>a?.getIsPending?.()||!1,onComplete:r=>{if(!a)return r(),()=>{};let i=a.getIsPending();const o=a.subscribe(u=>{u?i=!0:i&&(r(),o())});return o}},Se.log("전역 객체 window.G7Core.navigation에 노출됨")}function m_(l){l.plugin={getSettings:e=>window.G7Config?.plugins?.[e],get:(e,a,r)=>window.G7Config?.plugins?.[e]?.[a]??r,getAll:()=>window.G7Config?.plugins??{}},Se.log("전역 객체 window.G7Core.plugin에 노출됨")}function y_(l){l.module={getSettings:e=>window.G7Config?.modules?.[e],get:(e,a,r)=>window.G7Config?.modules?.[e]?.[a]??r,getAll:()=>window.G7Config?.modules??{}},Se.log("전역 객체 window.G7Core.module에 노출됨")}function b_(l,e){const{transitionManager:a,responsiveManager:r}=e;l.AuthManager=ga,l.api=$a(),l.TransitionManager=a,l.useTransitionState=Rp,l.ResponsiveManager=r,l.useResponsive=vd,l.useControllableState=o0,l.shallowArrayEqual=l0,l.shallowObjectEqual=Op,l.updateQueryParams=async(i,o)=>{const u=window.__templateApp;if(u?.updateQueryParams)return u.updateQueryParams(i,o);Se.warn("G7Core.updateQueryParams: TemplateApp이 초기화되지 않았습니다.")},Se.log("전역 객체 window.G7Core.AuthManager에 노출됨"),Se.log("전역 객체 window.G7Core.api에 노출됨"),Se.log("전역 객체 window.G7Core.ResponsiveManager에 노출됨"),Se.log("전역 객체 window.G7Core.useResponsive에 노출됨"),Se.log("전역 객체 window.G7Core.useControllableState에 노출됨"),Se.log("전역 객체 window.G7Core.updateQueryParams에 노출됨")}function v_(l,e){l.getSlotContext=()=>window.__slotContextValue??null,l.getDynamicRenderer=()=>window.__DynamicRenderer??null,l.getComponentRegistry=()=>e.getComponentRegistry?.()??fa.getInstance(),l.getDataBindingEngine=()=>e.getDataBindingEngine?.()??e.getState().bindingEngine,l.getTranslationEngine=()=>e.getTranslationEngine?.()??e.getState().translationEngine,l.getActionDispatcher=()=>e.getActionDispatcher?.()??e.getState().actionDispatcher,Se.log("전역 객체 window.G7Core 슬롯 API에 노출됨 (getSlotContext, getDynamicRenderer 등)")}function S_(l){l.identity={setLauncher:bt.setLauncher.bind(bt),handle:bt.handle.bind(bt),isIdentityRequired:bt.isIdentityRequired.bind(bt),hasLauncher:bt.hasLauncher.bind(bt),markDomainNoticeShown:bt.markDomainNoticeShown.bind(bt),redirectExternally:bt.redirectExternally.bind(bt),createDeferred:bt.createDeferred.bind(bt),resolveDeferred:bt.resolveDeferred.bind(bt),reset:bt.reset.bind(bt),redirectStashKey:ud},Se.log("전역 객체 window.G7Core 본인인증(IDV) API에 노출됨 (identity)")}function w_(l){if(typeof window>"u")return;e_(),window.G7Core||(window.G7Core={});const e=window.G7Core;n_(e),t_(e),a_(e),b_(e,l),r_(e,l),i_(e,l),s_(e),l_(e),c_(e),u_(e,l),d_(e),f_(e),h_(e),g_(e,l),p_(e,l),m_(e),y_(e),v_(e,l),S_(e),Se.log("G7Core 전역 객체 초기화 완료")}function C_(){const l=window.G7Core;if(!l){Se.warn("G7Core가 초기화되지 않았습니다.");return}const e=()=>Tr.getInstance(),a={isEnabled:()=>{try{return e().isEnabled()}catch{return!1}},trackRender:r=>{try{e().isEnabled()&&e().trackRender(r)}catch{}},trackIteration:(r,i,o,u,d)=>{try{e().isEnabled()&&e().trackIteration(r,{source:i,itemVar:o,indexVar:u,sourceLength:d})}catch{}},trackIfCondition:(r,i,o,u)=>{try{e().isEnabled()&&e().trackIfCondition(r,i,o)}catch{}},trackMount:(r,i)=>{try{e().isEnabled()&&e().trackMount(r,{...i,id:r})}catch{}},trackUnmount:r=>{try{e().isEnabled()&&e().trackUnmount(r)}catch{}},trackExpressionEval:r=>{try{e().isEnabled()&&e().trackExpressionEval(r)}catch{}},trackBindingEval:r=>{try{e().isEnabled()&&e().trackBindingEval(r)}catch{}},recordCacheHit:()=>{try{e().isEnabled()&&e().recordCacheHit()}catch{}},recordCacheMiss:()=>{try{e().isEnabled()&&e().recordCacheMiss()}catch{}},trackHandlerRegistration:(r,i,o,u)=>{try{e().isEnabled()&&e().trackHandlerRegistration(r,i,o,u)}catch{}},trackHandlerUnregistration:r=>{try{e().isEnabled()&&e().trackHandlerUnregistration(r)}catch{}},logAction:r=>{try{e().isEnabled()&&e().logAction(r)}catch{}},trackRequest:(r,i)=>{try{return e().isEnabled()?e().trackRequest(r,i):""}catch{return""}},completeRequest:(r,i,o)=>{try{e().isEnabled()&&e().completeRequest(r,i,o)}catch{}},failRequest:(r,i)=>{try{e().isEnabled()&&e().failRequest(r,i)}catch{}},trackDataSourceDefinition:r=>{try{e().isEnabled()&&e().trackDataSourceDefinition(r)}catch{}},trackDataSourceLoading:r=>{try{e().isEnabled()&&e().trackDataSourceLoading(r)}catch{}},trackDataSourceLoaded:(r,i,o)=>{try{e().isEnabled()&&e().trackDataSourceLoaded(r,i,o)}catch{}},trackDataSourceError:(r,i)=>{try{e().isEnabled()&&e().trackDataSourceError(r,i)}catch{}},trackForm:(r,i,o)=>{try{e().isEnabled()&&e().trackForm(r,i,o)}catch{}},untrackForm:r=>{try{e().isEnabled()&&e().untrackForm(r)}catch{}},startStateChange:(r,i,o,u)=>{try{return e().isEnabled()?e().startStateChange(r,i,o,u):""}catch{return""}},completeStateChange:r=>{try{e().isEnabled()&&e().completeStateChange(r)}catch{}},trackComponentRender:(r,i,o,u,d,f)=>{try{e().isEnabled()&&e().trackComponentRender(r,i,o,u,d,f)}catch{}},updateLocalState:r=>{try{e().isEnabled()&&e().updateLocalState(r)}catch{}},updateComputedState:r=>{try{e().isEnabled()&&e().updateComputedState(r)}catch{}},updateParentContext:r=>{try{e().isEnabled()&&e().updateParentContext(r)}catch{}},trackComponentStateSource:(r,i,o,u)=>{try{e().isEnabled()&&e().trackComponentStateSource(r,i,o,u)}catch{}},trackDynamicState:(r,i)=>{try{e().isEnabled()&&e().trackDynamicState(r,i)}catch{}},trackContextFlow:(r,i,o,u,d,f)=>{try{e().isEnabled()&&e().trackContextFlow(r,i,o,u,d,f)}catch{}},trackComponentStyle:(r,i,o,u)=>{try{e().isEnabled()&&e().trackComponentStyle(r,i,o,u)}catch{}},trackAuthEvent:(r,i,o,u)=>{try{e().isEnabled()&&e().trackAuthEvent(r,i,o,u)}catch{}},trackAuthHeader:(r,i,o,u,d)=>{try{e().isEnabled()&&e().trackAuthHeader(r,i,o,u,d)}catch{}},trackLog:(r,i,o)=>{try{e().isEnabled()&&e().trackLog(r,i,o)}catch{}},trackAction:r=>{try{e().isEnabled()&&e().trackAction?.(r)}catch{}},trackDataSourceUpdate:r=>{try{e().isEnabled()&&e().trackDataSourceUpdate?.(r)}catch{}},startSequenceExecution:r=>{try{return e().isEnabled()?e().startSequenceExecution(r):""}catch{return""}},captureSequenceActionBefore:(r,i,o,u,d)=>{try{e().isEnabled()&&e().captureSequenceActionBefore(r,i,o,u,d)}catch{}},captureSequenceActionAfter:(r,i,o,u,d,f)=>{try{e().isEnabled()&&e().captureSequenceActionAfter(r,i,o,u,d,f)}catch{}},endSequenceExecution:(r,i)=>{try{e().isEnabled()&&e().endSequenceExecution(r,i)}catch{}},registerStateCaptureForHandler:(r,i,o)=>{try{e().isEnabled()&&e().registerStateCaptureForHandler(r,i,o)}catch{}},detectStaleClosure:(r,i,o,u,d)=>{try{return e().isEnabled()?e().detectStaleClosure(r,i,o,u,d):[]}catch{return[]}},trackStaleClosureWarning:r=>{try{e().isEnabled()&&e().trackStaleClosureWarning(r)}catch{}},trackModalOpen:r=>{try{e().isEnabled()&&e().trackModalOpen(r)}catch{}},trackModalClose:(r,i)=>{try{e().isEnabled()&&e().trackModalClose(r,i)}catch{}},trackModalStateChange:r=>{try{e().isEnabled()&&e().trackModalStateChange(r)}catch{}},trackNestedContext:r=>{try{return e().isEnabled()?e().trackNestedContext(r):""}catch{return""}},trackNestedContextAccess:(r,i)=>{try{e().isEnabled()&&e().trackNestedContextAccess(r,i)}catch{}},trackComputedProperty:(r,i,o,u,d,f,g)=>{try{e().isEnabled()&&e().trackComputedProperty(r,i,o,u,d,f,g)}catch{}},trackComputedRecalc:(r,i,o,u,d,f,g)=>{try{e().isEnabled()&&e().trackComputedRecalc(r,i,o,u,d,f,g)}catch{}},setNamedActionDefinitions:r=>{try{e().isEnabled()&&e().setNamedActionDefinitions(r)}catch{}},trackNamedActionRef:r=>{try{e().isEnabled()&&e().trackNamedActionRef(r)}catch{}}};l.devTools=a,Se.log("G7Core.devTools 인터페이스 초기화 완료")}let bo=null;function E_(){const l=window.G7Core;return l?.__devtools?Promise.resolve(l.__devtools):bo||(bo=new Promise((e,a)=>{const r=window.G7Config?.coreDevToolsAsset||"/build/core/devtools.min.js",i="g7-devtools-bundle",o=()=>{const f=window.G7Core?.__devtools;f?e(f):a(new Error("DevTools 번들 로드됨 — 그러나 __devtools 미노출"))};window.G7Core=window.G7Core||{},window.G7Core.__onDevToolsReady=o;const u=document.getElementById(i);if(u){u.addEventListener("load",o,{once:!0}),u.addEventListener("error",()=>a(new Error(`DevTools 번들 로드 실패: ${r}`)),{once:!0});return}const d=document.createElement("script");d.id=i,d.src=r,d.async=!1,d.addEventListener("load",o,{once:!0}),d.addEventListener("error",()=>{bo=null,a(new Error(`DevTools 번들 로드 실패: ${r}`))},{once:!0}),document.head.appendChild(d)}),bo)}function __(){const l=window.G7Core;if(!l){Se.warn("G7Core가 초기화되지 않았습니다.");return}const e=Tr.getInstance();if(e.initialize(),!e.isEnabled()){window.G7DevTools={isEnabled:()=>!1,enable:()=>{Se.log("환경설정 > 고급 설정 > 디버그 모드를 켜세요")}},Fu(),Se.log("G7DevTools 비활성화됨 (디버그 모드 꺼짐)");return}A_(l,e)}async function A_(l,e){let a;try{a=await E_()}catch(g){Se.warn("DevTools 번들 로드 실패 — 최소 API 로 폴백:",g),window.G7DevTools={isEnabled:()=>!1,enable:()=>{}},Fu();return}const{DiagnosticEngine:r,getServerConnector:i,getStyleTracker:o}=a;C_(),Fu();try{o().enable(),Se.log("StyleTracker 활성화됨")}catch(g){Se.warn("StyleTracker 활성화 실패:",g)}const u=new r,d=i(),f={isEnabled:()=>e.isEnabled(),state:{get:()=>e.getState(),getHistory:()=>e.getStateHistory(),watch:(g,m)=>e.watchState(g,m)},actions:{getHistory:()=>e.getActionHistory(),watch:g=>e.watchActions(g),getMetrics:()=>e.getActionMetrics()},binding:{evaluate:g=>{const m=l.getDataBindingEngine?.();if(!m){Se.warn("DataBindingEngine이 없습니다.");return}return m.evaluateExpression(g,e.getState())},getCacheStats:()=>e.getCacheStats(),clearStats:()=>{e.resetCacheStats(),Se.log("캐시 통계 초기화됨")}},diagnose:{analyze:g=>u.analyze(g),suggestFix:g=>u.suggestFix(g),getCommonIssues:()=>u.getCommonIssues(),getRulesByCategory:g=>u.getRulesByCategory(g)},server:{dumpState:g=>d.dumpState(g),sendLog:g=>d.sendLog(g),sendError:(g,m)=>d.sendError(g,m),isConnected:()=>d.isConnected(),testConnection:()=>d.testConnection()},config:{isDebugMode:()=>e.isEnabled(),setLogLevel:g=>e.setLogLevel(g),setMaxHistory:g=>e.setMaxHistory(g)},lifecycle:{getMountedComponents:()=>e.getLifecycleInfo().mountedComponents,getOrphanedListeners:()=>e.getLifecycleInfo().orphanedListeners},performance:{getRenderCount:()=>e.getPerformanceInfo().renderCounts,getBindingEvalCount:()=>e.getPerformanceInfo().bindingEvalCount,getMemoryWarnings:()=>e.getPerformanceInfo().memoryWarnings,startProfiling:()=>e.startProfiling(),stopProfiling:()=>e.stopProfiling()},network:{getActiveRequests:()=>e.getNetworkInfo().activeRequests,getRequestHistory:()=>e.getNetworkInfo().requestHistory,getPendingDataSources:()=>e.getNetworkInfo().pendingDataSources},conditional:{getIfConditions:()=>e.getConditionalInfo().ifConditions,getIterations:()=>e.getConditionalInfo().iterations},form:{getForms:()=>e.getFormInfo()},websocket:{getInfo:()=>e.getWebSocketInfo()}};window.G7DevTools=f,l.devtools=f,Se.log("G7DevTools 전역 객체 초기화 완료 (window.G7DevTools)"),x_(a.DevToolsPanel)}function x_(l){if(document.getElementById("g7-devtools-root")){Se.log("DevToolsPanel 이미 렌더링됨");return}const e=document.createElement("div");e.id="g7-devtools-root",document.body.appendChild(e);try{Gu.createRoot(e).render(We.createElement(l)),Se.log("DevToolsPanel UI 렌더링 완료")}catch(a){Se.error("DevToolsPanel UI 렌더링 실패:",a)}}const Je=dt("TemplateEngine"),re={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 vo=!1;const So=[];async function T_(l){try{Je.log("템플릿 메타데이터 로드 중...",l);const e=l.split("-").map(r=>r.split("_").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join("")).join(""),a=window[e];return a?.templateMetadata?(Je.log("템플릿 메타데이터 로드 완료 (전역 변수)",a.templateMetadata),a.templateMetadata):(Je.warn(`템플릿 번들에 메타데이터가 없습니다. 전역 변수: ${e}`),{identifier:l,locales:["ko","en"],name:{ko:l,en:l},description:{ko:"",en:""},version:"1.0.0",type:"admin"})}catch(e){return Je.error("템플릿 메타데이터 로드 실패",e),{identifier:l,locales:["ko","en"],name:{ko:l,en:l},description:{ko:"",en:""},version:"1.0.0",type:"admin"}}}function Im(){const e=(typeof window<"u"?window.__templateApp:void 0)?.globalState?.appConfig?.supportedLocales,a=re.templateMetadata?.locales;return{$locale:re.locale,$locales:Array.isArray(e)&&e.length>0?e:a||["ko","en"],$templateLocales:a||["ko","en"],$templateId:re.templateId}}async function wo(l){try{if(Je.log("템플릿 엔진 초기화 시작",l),re.isInitialized)throw new Error("템플릿 엔진이 이미 초기화되었습니다. destroyTemplate()을 먼저 호출하세요.");if(!l.templateId)throw new zE;vo=l.debug??!1,typeof window<"u"&&(window.G7Config||(window.G7Config={}),window.G7Config.debug=vo),__(),re.templateId=l.templateId,re.locale=l.locale||"ko",Je.log("엔진 인스턴스 생성 중..."),re.registry=fa.getInstance(),re.bindingEngine=new vn,re.translationEngine=li.getInstance(),l.cacheVersion!==void 0&&l.cacheVersion>0&&re.translationEngine.setCacheVersion(l.cacheVersion),re.translationContext={templateId:l.templateId,locale:re.locale},re.actionDispatcher=new ro({},re.translationEngine,re.translationContext),r0(re.actionDispatcher),Je.log("다국어 파일 로드 중...",l.templateId,re.locale);const e="en",a=[re.translationEngine.loadTranslations(l.templateId,re.locale).then(()=>{Je.log(`다국어 파일 로드 완료: ${re.locale}`)}).catch(r=>{Je.warn(`다국어 파일 로드 실패 (${re.locale}):`,r instanceof Error?r.message:r)})];re.locale!==e&&a.push(re.translationEngine.loadTranslations(l.templateId,e).then(()=>{Je.log(`폴백 다국어 파일 로드 완료: ${e}`)}).catch(r=>{Je.warn(`폴백 다국어 파일 로드 실패 (${e}):`,r instanceof Error?r.message:r)})),await Promise.allSettled(a),Je.log("템플릿 메타데이터 로드 중...",l.templateId),re.templateMetadata=await T_(l.templateId),re.isInitialized=!0,Je.log("템플릿 엔진 초기화 완료 (ComponentRegistry는 별도 로드)")}catch(e){throw Je.error("템플릿 엔진 초기화 실패",e),re.isInitialized=!1,re.registry=null,re.bindingEngine=null,re.translationEngine=null,re.actionDispatcher=null,e}}let Co=null;function Qd(){const l=window.G7Core;return l?.__LayoutEditorChrome?Promise.resolve(l.__LayoutEditorChrome):Co||(Co=new Promise((e,a)=>{const r=window.G7Config?.coreEditorAsset||"/build/core/layout-editor.min.js",i="g7-layout-editor-bundle",o=document.getElementById(i),u=()=>{const f=window.G7Core?.__LayoutEditorChrome;f?e(f):a(new Error("편집기 번들 로드됨 — 그러나 __LayoutEditorChrome 미노출"))};if(window.G7Core=window.G7Core||{},window.G7Core.__onChromeReady=u,o){o.addEventListener("load",u,{once:!0}),o.addEventListener("error",()=>a(new Error(`편집기 번들 로드 실패: ${r}`)),{once:!0});return}const d=document.createElement("script");d.id=i,d.src=r,d.async=!1,d.addEventListener("load",u,{once:!0}),d.addEventListener("error",()=>{Co=null,a(new Error(`편집기 번들 로드 실패: ${r}`))},{once:!0}),document.head.appendChild(d)}),Co)}async function es(l){try{if(Je.log("템플릿 렌더링 시작",l),!re.isInitialized)throw new Error("템플릿 엔진이 초기화되지 않았습니다. initTemplateEngine()을 먼저 호출하세요.");if(!l.containerId)throw new Error("containerId는 필수입니다.");if(!l.layoutJson)throw new Error("layoutJson은 필수입니다.");const e=document.getElementById(l.containerId);if(!e)throw new Error(`컨테이너를 찾을 수 없습니다: #${l.containerId}`);const a=Im();if(re.containerId=l.containerId,re.currentLayoutJson=l.layoutJson,re.currentDataContext={...a,...l.dataContext||{}},re.translationContext=l.translationContext||{templateId:re.templateId||"",locale:re.locale},re.reactRoot||(Je.log("React Root 생성"),re.reactRoot=Gu.createRoot(e)),typeof window<"u"){const o=Lm(window.location.pathname);if(o){Je.log("레이아웃 편집기 모드 진입",o);let u;try{u=await Qd()}catch(f){Je.error("레이아웃 편집기 번들 로드 실패",f),Kd.render(l.containerId,{title:"레이아웃 편집기 로드 실패",message:f instanceof Error?f.message:"편집기 번들을 불러오지 못했습니다.",icon:"fas fa-triangle-exclamation",showStack:!1,showReloadButton:!0,debug:vo});return}const d=We.createElement(u,{templateIdentifier:o.templateIdentifier,initialLocale:re.locale});re.reactRoot.render(We.createElement(uc,{translationEngine:re.translationEngine,translationContext:re.translationContext,children:We.createElement(yd,{children:We.createElement(Ql,{children:We.createElement(qd,{children:d})})})}));return}}const r=l.layoutJson.components||[];if(r.length===0){Je.warn("렌더링할 컴포넌트가 없습니다.");return}const i=l.layoutJson.modals||[];if(Je.log("modals 배열:",i),Je.log("modals 개수:",i.length),Je.log("DynamicRenderer로 렌더링 시작"),re.reactRoot.render(We.createElement(uc,{translationEngine:re.translationEngine,translationContext:re.translationContext},We.createElement(yd,null,We.createElement(Ql,null,We.createElement(qd,null,[...r.map((o,u)=>{const d=re.currentLayoutJson?.layout_name||"";return We.createElement(za,{key:d&&!o._fromBase?`${o.id}_${d}`:o.id,componentDef:o,dataContext:re.currentDataContext,translationContext:re.translationContext,registry:re.registry,bindingEngine:re.bindingEngine,translationEngine:re.translationEngine,actionDispatcher:re.actionDispatcher,isRootRenderer:u===0,layoutKey:d})}),We.createElement(_p,{key:"__modal_parent_context_provider"},i.map(o=>{const u=re.currentDataContext._global?.modalStack||[],f=u.includes(o.id)||re.currentDataContext._global?.activeModal===o.id,g=u.indexOf(o.id),m=g>=0?50+g:50,b=window.__g7LayoutContextStack||[],E=b[b.length-1]?.dataContext,S=We.createElement(za,{key:`modal_${o.id}_renderer`,componentDef:{...o,props:{...o.props,isOpen:f,style:{...o.props?.style,zIndex:m},onClose:re.actionDispatcher?.createHandler({type:"click",handler:"closeModal"},re.currentDataContext)}},dataContext:re.currentDataContext,translationContext:re.translationContext,registry:re.registry,bindingEngine:re.bindingEngine,translationEngine:re.translationEngine,actionDispatcher:re.actionDispatcher,parentDataContext:E});return o.data_sources&&o.data_sources.length>0?We.createElement(Dm,{key:`modal_${o.id}`,isOpen:f,modalId:o.id,dataSources:o.data_sources,dataContext:re.currentDataContext,globalStateUpdater:re.actionDispatcher?.getGlobalStateUpdater(),bindingEngine:re.bindingEngine,debug:vo,children:S}):S}))]))))),Je.log("템플릿 렌더링 완료"),So.length>0){Je.log(`대기 중인 데이터 업데이트 ${So.length}건 적용`);const o=[...So];So.length=0;for(const{data:u,options:d}of o)ts(u,d)}}catch(e){throw Je.error("템플릿 렌더링 실패",e),e}}function ts(l,e){try{if(Je.log("템플릿 데이터 업데이트 시작",Object.keys(l)),!re.isInitialized)throw new Error("템플릿 엔진이 초기화되지 않았습니다.");if(!re.reactRoot||!re.currentLayoutJson){Je.log("React 미준비 - 데이터 업데이트 큐잉:",Object.keys(l)),So.push({data:l,options:e});return}const a=Im(),r={...re.currentDataContext._global||{},...l._global||{}};re.currentDataContext={...a,...re.currentDataContext,...l,_global:r},r._local!==void 0&&(re.currentDataContext._local=r._local),r._computed!==void 0&&(re.currentDataContext._computed=r._computed);const i=re.currentLayoutJson.components||[],o=re.currentLayoutJson.modals||[];Je.log("updateTemplateData - modals 배열:",o),Je.log("updateTemplateData - modals 개수:",o.length),Je.log("updateTemplateData - activeModal:",re.currentDataContext._global?.activeModal);const u=()=>{re.reactRoot.render(We.createElement(uc,{translationEngine:re.translationEngine,translationContext:re.translationContext},We.createElement(yd,null,We.createElement(Ql,null,We.createElement(qd,null,[...i.map((d,f)=>{const g=re.currentLayoutJson?.layout_name||"";return We.createElement(za,{key:g&&!d._fromBase?`${d.id}_${g}`:d.id,componentDef:d,dataContext:re.currentDataContext,translationContext:re.translationContext,registry:re.registry,bindingEngine:re.bindingEngine,translationEngine:re.translationEngine,actionDispatcher:re.actionDispatcher,isRootRenderer:f===0,layoutKey:g})}),We.createElement(_p,{key:"__modal_parent_context_provider_update"},o.map(d=>{const f=re.currentDataContext._global?.modalStack||[],m=f.includes(d.id)||re.currentDataContext._global?.activeModal===d.id,b=f.indexOf(d.id),v=b>=0?50+b:50,E=window.__g7LayoutContextStack||[],A=E[E.length-1]?.dataContext,T=We.createElement(za,{key:`modal_${d.id}_renderer`,componentDef:{...d,props:{...d.props,isOpen:m,style:{...d.props?.style,zIndex:v},onClose:re.actionDispatcher?.createHandler({type:"click",handler:"closeModal"},re.currentDataContext)}},dataContext:re.currentDataContext,translationContext:re.translationContext,registry:re.registry,bindingEngine:re.bindingEngine,translationEngine:re.translationEngine,actionDispatcher:re.actionDispatcher,parentDataContext:A});return d.data_sources&&d.data_sources.length>0?We.createElement(Dm,{key:`modal_${d.id}`,isOpen:m,modalId:d.id,dataSources:d.data_sources,dataContext:re.currentDataContext,globalStateUpdater:re.actionDispatcher?.getGlobalStateUpdater(),bindingEngine:re.bindingEngine,debug:vo,children:T}):T}))])))))};e?.sync?(Je.log("재렌더링 시작 (sync mode - 즉시 렌더링)"),u()):(Je.log("재렌더링 시작 (with startTransition)"),N.startTransition(()=>{u()})),Je.log("템플릿 데이터 업데이트 완료")}catch(a){throw Je.error("템플릿 데이터 업데이트 실패",a),a}}function yc(){try{Je.log("템플릿 정리 시작"),re.reactRoot&&(Je.log("React Root 언마운트"),re.reactRoot.unmount(),re.reactRoot=null),re.templateId=null,re.locale="ko",re.isInitialized=!1,re.containerId=null,re.currentLayoutJson=null,re.currentDataContext={},re.translationContext={templateId:"",locale:"ko"},re.registry=null,re.bindingEngine=null,re.translationEngine=null,re.actionDispatcher=null,re.templateMetadata=null,Je.log("템플릿 정리 완료")}catch(l){throw Je.error("템플릿 정리 실패",l),l}}function Ja(){return Object.freeze({...re})}function jm(){return re.actionDispatcher}const Eo={initTemplateEngine:wo,renderTemplate:es,updateTemplateData:ts,destroyTemplate:yc,getState:Ja};typeof window<"u"&&(window.G7Core||(window.G7Core={}),window.G7Core.TemplateEngine=Eo,w_({getState:()=>({translationEngine:re.translationEngine,translationContext:re.translationContext,bindingEngine:re.bindingEngine,actionDispatcher:re.actionDispatcher,templateMetadata:re.templateMetadata}),transitionManager:Na,responsiveManager:ci,webSocketManager:hc}),Je.log("전역 객체 window.G7Core.TemplateEngine에 노출됨"));const Ia=Object.freeze(Object.defineProperty({__proto__:null,DataSourceManager:Sa,LayoutLoader:Ud,TemplateApp:mo,TemplateEngine:Eo,default:Eo,destroyTemplate:yc,getActionDispatcher:jm,getState:Ja,initTemplateApp:Xd,initTemplateEngine:wo,loadLayoutEditorBundle:Qd,renderTemplate:es,updateTemplateData:ts},Symbol.toStringTag,{value:"Module"}));Gt.DataSourceManager=Sa,Gt.LayoutLoader=Ud,Gt.TemplateApp=mo,Gt.TemplateEngine=Eo,Gt.default=Eo,Gt.destroyTemplate=yc,Gt.getActionDispatcher=jm,Gt.getState=Ja,Gt.initTemplateApp=Xd,Gt.initTemplateEngine=wo,Gt.loadLayoutEditorBundle=Qd,Gt.renderTemplate=es,Gt.updateTemplateData=ts,Object.defineProperties(Gt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})})(this.G7Core=this.G7Core||{});
//# sourceMappingURL=template-engine.min.js.map