13 lines
No EOL
731 KiB
JavaScript
13 lines
No EOL
731 KiB
JavaScript
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DynamicDashboard-CEusXfUQ.js","assets/useToast-CS8pZhce.js","assets/dollar-sign-Bf6JneNn.js","assets/truck-D5o8mTsH.js","assets/utensils-BhILG_B7.js","assets/formatters-WvGQLZg0.js","assets/AreaChart-BnzyacT3.js","assets/OperationsModule-aDLWk78D.js","assets/building-BdUpGLM5.js","assets/phone-DpnQw4if.js","assets/user-CuEEaB8a.js","assets/mockData-DAqQG5te.js","assets/InventoryModule-B2QbjtwQ.js","assets/useOrders-Dp-LV7vp.js","assets/currency-DdDs82F5.js","assets/useInventory-BwKK4D-W.js","assets/SalesModule-2VZC1D5Y.js","assets/CrmModule-Cw43Bd0U.js","assets/DynamicFormRenderer-u2RREFCE.js","assets/types-DMl_5q2N.js","assets/file-text-DR21jZDS.js","assets/list-XDoRqfJ2.js","assets/star-B6hvSjuv.js","assets/upload-CY2IsfiN.js","assets/FinanceModule-DiPGlGDb.js","assets/EmployeesModule-BFNtlVZT.js","assets/CommunicationsModule-CVUsOJz5.js","assets/HelpDeskModule-B1p0xcj-.js","assets/TasksModule-3oA5V8YP.js","assets/link-DOg0dLYA.js","assets/CmsModule-qZLJpvR4.js","assets/arrow-down-CWbiHuZO.js","assets/arrow-up-B4Ca-HNG.js","assets/image-B_RO1I7c.js","assets/settings-2-CSojebrG.js","assets/MarketingModule-D28ZVpJ3.js","assets/AnalyticsModule-DwAY229b.js","assets/AutomationModule-CWTQE3B1.js","assets/terminal-CcncyL3J.js","assets/AiCenterModule-TWoGGfS0.js","assets/AppsCatalogModule-Dsu6Y18J.js","assets/types-CTcNpN0z.js","assets/SettingsModule-C5LrdOmz.js","assets/indexedDb-D30TbhA6.js","assets/EntityCatalog-_fN1VjC6.js","assets/panels-top-left-BomsDlf9.js","assets/table-_fqSCPRE.js","assets/FieldBuilder-iF06Nk4x.js","assets/fieldTypesMeta-BWfaDuCZ.js","assets/mail-DOD5KO1v.js","assets/eye-CkF1gwUX.js","assets/pen-D8SS70u3.js","assets/FormBuilder-hvNl7u0G.js","assets/move-up-qiRY8MuU.js","assets/save-D8euL60I.js","assets/CardLayoutBuilder-CM6emXoY.js","assets/ViewBuilder-BPVOktaa.js","assets/arrow-up-down--M136cK3.js","assets/CustomEntityPage-BBlkJ9R4.js"])))=>i.map(i=>d[i]);
|
||
import{a as e,c as t,f as n,h as r,i,l as a,n as o,o as s,p as c,r as l,s as u,u as d}from"./useToast-CS8pZhce.js";import{n as f,t as p}from"./demo-D1nHL60J.js";import{S as m,b as h,c as g,f as _,g as v,h as y,i as b,l as x,m as S,n as C,o as w,p as T,r as E,s as ee,t as D,u as O,v as te,x as k,y as ne}from"./indexedDb-D30TbhA6.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var re=c((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,D());else{var t=n(l);t!==null&&k(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function ee(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&k(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?D():S=!1}}}var D;if(typeof y==`function`)D=function(){y(ee)};else if(typeof MessageChannel<`u`){var O=new MessageChannel,te=O.port2;O.port1.onmessage=ee,D=function(){te.postMessage(null)}}else D=function(){_(ee,0)};function k(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,k(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,D()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),ie=c(((e,t)=>{t.exports=re()})),ae=c((e=>{var t=n();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`),s=Symbol.for(`react.recoverable`),c=Symbol.for(`react.optimistic_key`);function l(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:r===c?c:``+r,children:e,containerInfo:t,implementation:n}}var u=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.browser=function(e){return{$$typeof:s,_reason:e}},e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return l(e,t,null,n)},e.flushSync=function(e){var t=u.T,n=a.p;try{if(u.T=null,a.p=2,e)return e()}finally{u.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??a.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else a.d.m(e)}},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return u.H.useFormState(e,t,n)},e.useFormStatus=function(){return u.H.useHostTransitionStatus()},e.version=`19.3.0`})),oe=c(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=ae()})),se=c((e=>{var t=ie(),r=n(),i=oe();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function s(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function c(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(s(e)!==e)throw Error(a(188))}function d(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return u(i),e;if(o===r)return u(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var c=!1,l=i.child;l;){if(l===n){c=!0,n=i,r=o;break}if(l===r){c=!0,r=i,n=o;break}l=l.sibling}if(!c){for(l=o.child;l;){if(l===n){c=!0,n=o,r=i;break}if(l===r){c=!0,r=o,n=i;break}l=l.sibling}if(!c)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}function p(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&p(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function m(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function h(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function g(e){var t=[null,null],n=m(e);return n===null||_(t,e,n.child,{foundSelf:!1}),t}function _(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&_(e,t,n.child,r))return!0;n=n.sibling}return!1}function v(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(a(559))}}var y=null,b=null;function x(e,t,n){return e===n||e===t&&(y=e,!0)}function S(e,t,n){return e===n?(b=e,!1):e===t&&(b!==null&&(y=e),!0)}function C(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function w(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var T=Object.assign,E=Symbol.for(`react.element`),ee=Symbol.for(`react.transitional.element`),D=Symbol.for(`react.portal`),O=Symbol.for(`react.fragment`),te=Symbol.for(`react.strict_mode`),k=Symbol.for(`react.profiler`),ne=Symbol.for(`react.consumer`),re=Symbol.for(`react.context`),ae=Symbol.for(`react.forward_ref`),se=Symbol.for(`react.suspense`),ce=Symbol.for(`react.suspense_list`),A=Symbol.for(`react.memo`),le=Symbol.for(`react.lazy`),ue=Symbol.for(`react.activity`),de=Symbol.for(`react.legacy_hidden`),fe=Symbol.for(`react.memo_cache_sentinel`),j=Symbol.for(`react.view_transition`),pe=Symbol.for(`react.recoverable`),me=Symbol.iterator;function he(e){return typeof e!=`object`||!e?null:(e=me&&e[me]||e[`@@iterator`],typeof e==`function`?e:null)}var ge=Symbol.for(`react.client.reference`);function M(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ge?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case O:return`Fragment`;case k:return`Profiler`;case te:return`StrictMode`;case se:return`Suspense`;case ce:return`SuspenseList`;case ue:return`Activity`;case j:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case D:return`Portal`;case re:return e.displayName||`Context`;case ne:return(e._context.displayName||`Context`)+`.Consumer`;case ae:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case A:return t=e.displayName||null,t===null?M(e.type)||`Memo`:t;case le:t=e._payload,e=e._init;try{return M(e(t))}catch{}}return null}var _e=Array.isArray,N=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ve={pending:!1,data:null,method:null,action:null},ye=[],be=-1;function F(e){return{current:e}}function I(e){0>be||(e.current=ye[be],ye[be]=null,be--)}function xe(e,t){be++,ye[be]=e.current,e.current=t}var Se=F(null),Ce=F(null),we=F(null),Te=F(null);function Ee(e,t){switch(xe(we,t),xe(Ce,e),xe(Se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?up(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=up(t),e=dp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}I(Se),xe(Se,e)}function De(){I(Se),I(Ce),I(we)}function Oe(e){var t=e.memoizedState;t!==null&&(sh._currentValue=t.memoizedState,xe(Te,e)),t=Se.current;var n=dp(t,e.type);t!==n&&(xe(Ce,e),xe(Se,n))}function ke(e){Ce.current===e&&(I(Se),I(Ce)),Te.current===e&&(I(Te),sh._currentValue=ve)}var Ae,je;function Me(e){if(Ae===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ae=t&&t[1]||``,je=-1<e.stack.indexOf(`
|
||
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
||
`+Ae+e+je}var Ne=!1;function Pe(e,t){if(!e||Ne)return``;Ne=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
||
`),l=s.split(`
|
||
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
||
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Ne=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Me(n):``}function Fe(e,t){switch(e.tag){case 26:case 27:case 5:return Me(e.type);case 16:return Me(`Lazy`);case 13:return e.child!==t&&t!==null?Me(`Suspense Fallback`):Me(`Suspense`);case 19:return Me(`SuspenseList`);case 0:case 15:return Pe(e.type,!1);case 11:return Pe(e.type.render,!1);case 1:return Pe(e.type,!0);case 31:return Me(`Activity`);case 30:return Me(`ViewTransition`);default:return``}}function Ie(e){try{var t=``,n=null;do t+=Fe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
||
Error generating stack: `+e.message+`
|
||
`+e.stack}}var Le=Object.prototype.hasOwnProperty,Re=t.unstable_scheduleCallback,ze=t.unstable_cancelCallback,Be=t.unstable_shouldYield,Ve=t.unstable_requestPaint,He=t.unstable_now,Ue=t.unstable_getCurrentPriorityLevel,We=t.unstable_ImmediatePriority,Ge=t.unstable_UserBlockingPriority,Ke=t.unstable_NormalPriority,qe=t.unstable_LowPriority,Je=t.unstable_IdlePriority,Ye=t.log,Xe=t.unstable_setDisableYieldValue,Ze=null,Qe=null;function $e(e){if(typeof Ye==`function`&&Xe(e),Qe&&typeof Qe.setStrictMode==`function`)try{Qe.setStrictMode(Ze,e)}catch{}}var et=Math.clz32?Math.clz32:rt,tt=Math.log,nt=Math.LN2;function rt(e){return e>>>=0,e===0?32:31-(tt(e)/nt|0)|0}var it=256,at=262144,ot=4194304;function st(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ct(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=st(n))):i=st(o):i=st(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=st(n))):i=st(o)):i=st(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function lt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ut(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-et(n),i=1<<r;t|=e[r],n&=~i}return t}function dt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 ft(){var e=ot;return ot<<=1,!(ot&62914560)&&(ot=4194304),e}function pt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function mt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ht(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-et(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&>(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function gt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-et(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function _t(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-et(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function vt(e,t){var n=t&-t;return n=n&42?1:yt(n),(n&(e.suspendedLanes|t))===0?n:0}function yt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function bt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function xt(){var e=P.p;return e===0?(e=window.event,e===void 0?32:Ch(e.type)):e}function St(e,t){var n=P.p;try{return P.p=e,t()}finally{P.p=n}}var Ct=Math.random().toString(36).slice(2),wt=`__reactFiber$`+Ct,Tt=`__reactProps$`+Ct,Et=`__reactContainer$`+Ct,Dt=`__reactEvents$`+Ct,Ot=`__reactListeners$`+Ct,kt=`__reactHandles$`+Ct,At=`__reactResources$`+Ct,jt=`__reactMarker$`+Ct,Mt=`__reactLoad$`+Ct;function Nt(e){delete e[wt],delete e[Tt],delete e[Ot],delete e[kt]}function Pt(e){var t;if(t=e[wt])return t;for(var n=e.parentNode;n;){if(t=n[Et]||n[wt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fm(e);e!==null;){if(n=e[wt])return n;e=fm(e)}return t}e=n,n=e.parentNode}return null}function Ft(e){if(e=e[wt]||e[Et]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function It(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function Lt(e){var t=e[At];return t||=e[At]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Rt(e){e[jt]=!0}function zt(e){e[Mt]=void 0}var Bt=new Set,Vt={};function Ht(e,t){Ut(e,t),Ut(e+`Capture`,t)}function Ut(e,t){for(Vt[e]=t,e=0;e<t.length;e++)Bt.add(t[e])}var Wt=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]*$`),Gt={},Kt={};function qt(e){return Le.call(Kt,e)?!0:Le.call(Gt,e)?!1:Wt.test(e)?Kt[e]=!0:(Gt[e]=!0,!1)}var L=!1;function Jt(){var e=L;return L=!1,e}function Yt(e,t,n){if(qt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Xt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function Zt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function Qt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function $t(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function en(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function tn(e){if(!e._valueTracker){var t=$t(e)?`checked`:`value`;e._valueTracker=en(e,t,``+e[t])}}function nn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=$t(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var rn=/[\n"\\]/g;function an(e){return e.replace(rn,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function on(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Qt(t)):e.value!==``+Qt(t)&&(e.value=``+Qt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):cn(e,Qt(n)):o===`number`&&e.value==t?cn(e,Qt(e.value)):cn(e,Qt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Qt(s):e.removeAttribute(`name`)}function sn(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){tn(e);return}n=n==null?``:``+Qt(n),t=t==null?n:``+Qt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),tn(e)}function cn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function ln(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Qt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function un(e,t,n){if(t!=null&&(t=``+Qt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Qt(n)}function dn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(a(92));if(_e(r)){if(1<r.length)throw Error(a(93));r=r[0]}n=r}n??=``,t=n}n=Qt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),tn(e)}function fn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var pn=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 mn(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||pn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function hn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(a(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,L=!0);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&(mn(e,i,r),L=!0)}else for(var o in t)t.hasOwnProperty(o)&&mn(e,o,t[o])}function gn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var _n=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`],[`maskType`,`mask-type`],[`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`]]),vn=/^[\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 yn(e){return vn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function bn(){}var xn=null;function Sn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Cn=null,wn=null;function Tn(e){var t=Ft(e);if(t&&(e=t.stateNode)){var n=e[Tt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(on(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+an(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[Tt]||null;if(!i)throw Error(a(90));on(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&nn(r)}break a;case`textarea`:un(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&ln(e,!!n.multiple,t,!1)}}}var En=!1;function Dn(e,t,n){if(En)return e(t,n);En=!0;try{return e(t)}finally{if(En=!1,(Cn!==null||wn!==null)&&(zd(),Cn&&(t=Cn,e=wn,wn=Cn=null,Tn(t),e)))for(t=0;t<e.length;t++)Tn(e[t])}}function On(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Tt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(a(231,t,typeof n));return n}var kn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),An=!1;if(kn)try{var jn={};Object.defineProperty(jn,"passive",{get:function(){An=!0}}),window.addEventListener(`test`,jn,jn),window.removeEventListener(`test`,jn,jn)}catch{An=!1}var Mn=null,Nn=null,Pn=null;function Fn(){if(Pn)return Pn;var e,t=Nn,n=t.length,r,i=`value`in Mn?Mn.value:Mn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Pn=i.slice(e,1<r?1-r:void 0)}function In(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ln(){return!0}function Rn(){return!1}function zn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Ln:Rn,this.isPropagationStopped=Rn,this}return T(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Ln)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Ln)},persist:function(){},isPersistent:Ln}),t}var Bn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Vn=zn(Bn),Hn=T({},Bn,{view:0,detail:0}),Un=zn(Hn),Wn,Gn,Kn,qn=T({},Hn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ir,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Kn&&(Kn&&e.type===`mousemove`?(Wn=e.screenX-Kn.screenX,Gn=e.screenY-Kn.screenY):Gn=Wn=0,Kn=e),Wn)},movementY:function(e){return`movementY`in e?e.movementY:Gn}}),Jn=zn(qn),Yn=zn(T({},qn,{dataTransfer:0})),Xn=zn(T({},Hn,{relatedTarget:0})),Zn=zn(T({},Bn,{animationName:0,elapsedTime:0,pseudoElement:0})),Qn=zn(T({},Bn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),$n=zn(T({},Bn,{data:0})),er={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},tr={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`},nr={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function rr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=nr[e])?!!t[e]:!1}function ir(){return rr}var ar=zn(T({},Hn,{key:function(e){if(e.key){var t=er[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=In(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?tr[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ir,charCode:function(e){return e.type===`keypress`?In(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?In(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),or=zn(T({},qn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),sr=zn(T({},Bn,{submitter:0})),cr=zn(T({},Hn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ir})),lr=zn(T({},Bn,{propertyName:0,elapsedTime:0,pseudoElement:0})),ur=zn(T({},qn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),dr=zn(T({},Bn,{newState:0,oldState:0,source:0})),fr=[9,13,27,32],pr=kn&&`CompositionEvent`in window,mr=null;kn&&`documentMode`in document&&(mr=document.documentMode);var hr=kn&&`TextEvent`in window&&!mr,gr=kn&&(!pr||mr&&8<mr&&11>=mr),_r=` `,vr=!1;function yr(e,t){switch(e){case`keyup`:return fr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function br(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var xr=!1;function Sr(e,t){switch(e){case`compositionend`:return br(t);case`keypress`:return t.which===32?(vr=!0,_r):null;case`textInput`:return e=t.data,e===_r&&vr?null:e;default:return null}}function Cr(e,t){if(xr)return e===`compositionend`||!pr&&yr(e,t)?(e=Fn(),Pn=Nn=Mn=null,xr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return gr&&t.locale!==`ko`?null:t.data;default:return null}}var wr={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 Tr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!wr[e.type]:t===`textarea`}function Er(e,t,n,r){Cn?wn?wn.push(r):wn=[r]:Cn=r,t=Jf(t,`onChange`),0<t.length&&(n=new Vn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Dr=null,Or=null;function kr(e){Vf(e,0)}function Ar(e){if(nn(It(e)))return e}function jr(e,t){if(e===`change`)return t}var Mr=!1;if(kn){var Nr;if(kn){var Pr=`oninput`in document;if(!Pr){var Fr=document.createElement(`div`);Fr.setAttribute(`oninput`,`return;`),Pr=typeof Fr.oninput==`function`}Nr=Pr}else Nr=!1;Mr=Nr&&(!document.documentMode||9<document.documentMode)}function Ir(){Dr&&(Dr.detachEvent(`onpropertychange`,Lr),Or=Dr=null)}function Lr(e){if(e.propertyName===`value`&&Ar(Or)){var t=[];Er(t,Or,e,Sn(e)),Dn(kr,t)}}function Rr(e,t,n){e===`focusin`?(Ir(),Dr=t,Or=n,Dr.attachEvent(`onpropertychange`,Lr)):e===`focusout`&&Ir()}function zr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Ar(Or)}function Br(e,t){if(e===`click`)return Ar(t)}function Vr(e,t){if(e===`input`||e===`change`)return Ar(t)}function Hr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Ur=typeof Object.is==`function`?Object.is:Hr;function Wr(e,t){if(Ur(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Le.call(t,i)||!Ur(e[i],t[i]))return!1}return!0}function Gr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Kr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function qr(e,t){var n=Kr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Kr(n)}}function Jr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Jr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Yr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Gr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Gr(e.document)}return t}function Xr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Zr=kn&&`documentMode`in document&&11>=document.documentMode,Qr=null,$r=null,ei=null,ti=!1;function ni(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ti||Qr==null||Qr!==Gr(r)||(r=Qr,`selectionStart`in r&&Xr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ei&&Wr(ei,r)||(ei=r,r=Jf($r,`onSelect`),0<r.length&&(t=new Vn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Qr)))}function ri(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ii={animationend:ri(`Animation`,`AnimationEnd`),animationiteration:ri(`Animation`,`AnimationIteration`),animationstart:ri(`Animation`,`AnimationStart`),transitionrun:ri(`Transition`,`TransitionRun`),transitionstart:ri(`Transition`,`TransitionStart`),transitioncancel:ri(`Transition`,`TransitionCancel`),transitionend:ri(`Transition`,`TransitionEnd`)},ai={},oi={};kn&&(oi=document.createElement(`div`).style,`AnimationEvent`in window||(delete ii.animationend.animation,delete ii.animationiteration.animation,delete ii.animationstart.animation),`TransitionEvent`in window||delete ii.transitionend.transition);function si(e){if(ai[e])return ai[e];if(!ii[e])return e;var t=ii[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in oi)return ai[e]=t[n];return e}var ci=si(`animationend`),li=si(`animationiteration`),ui=si(`animationstart`),di=si(`transitionrun`),fi=si(`transitionstart`),pi=si(`transitioncancel`),mi=si(`transitionend`),hi=new Map,gi=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(` `);gi.push(`scrollEnd`);function _i(e,t){hi.set(e,t),Ht(t,[e])}var vi=0;function yi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=bd.identifierPrefix;var n=vi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function bi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Od;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function xi(e,t){return e=bi(e),t=bi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var Si=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Ci=[],wi=0,Ti=0;function Ei(){for(var e=wi,t=Ti=wi=0;t<e;){var n=Ci[t];Ci[t++]=null;var r=Ci[t];Ci[t++]=null;var i=Ci[t];Ci[t++]=null;var a=Ci[t];if(Ci[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Ai(n,i,a)}}function Di(e,t,n,r){Ci[wi++]=e,Ci[wi++]=t,Ci[wi++]=n,Ci[wi++]=r,Ti|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Oi(e,t,n,r){return Di(e,t,n,r),ji(e)}function ki(e,t){return Di(e,null,null,t),ji(e)}function Ai(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-et(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ji(e){if(50<kd)throw kd=0,Ad=null,Error(a(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Mi={};function Ni(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Pi(e,t,n,r){return new Ni(e,t,n,r)}function Fi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ii(e,t){var n=e.alternate;return n===null?(n=Pi(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Li(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ri(e,t,n,r,i,o){var s=0;if(r=e,typeof r==`function`)Fi(r)&&(s=1);else if(typeof r==`string`)s=qm(e,n,Se.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case ue:return e=Pi(31,n,t,i),e.elementType=ue,e.lanes=o,e;case O:return zi(n.children,i,o,t);case te:s=8,i|=24;break;case k:return e=Pi(12,n,t,i|2),e.elementType=k,e.lanes=o,e;case se:return e=Pi(13,n,t,i),e.elementType=se,e.lanes=o,e;case ce:return e=Pi(19,n,t,i),e.elementType=ce,e.lanes=o,e;case de:case j:return e=i|32,e=Pi(30,n,t,e),e.elementType=j,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case re:s=10;break a;case ne:s=9;break a;case ae:s=11;break a;case A:s=14;break a;case le:s=16,r=null;break a}s=29,n=Error(a(130,e===null?`null`:typeof e,``)),r=null}return t=Pi(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function zi(e,t,n,r){return e=Pi(7,e,r,t),e.lanes=n,e}function Bi(e,t,n){return e=Pi(6,e,null,t),e.lanes=n,e}function Vi(e){var t=Pi(18,null,null,0);return t.stateNode=e,t}function Hi(e,t,n){return t=Pi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ui=new WeakMap;function Wi(e,t){if(typeof e==`object`&&e){var n=Ui.get(e);return n===void 0?(t={value:e,source:t,stack:Ie(t)},Ui.set(e,t),t):n}return{value:e,source:t,stack:Ie(t)}}var Gi=[],Ki=0,qi=null,Ji=0,Yi=[],Xi=0,Zi=null,Qi=1,$i=``;function ea(e,t){Gi[Ki++]=Ji,Gi[Ki++]=qi,qi=e,Ji=t}function ta(e,t,n){Yi[Xi++]=Qi,Yi[Xi++]=$i,Yi[Xi++]=Zi,Zi=e;var r=Qi;e=$i;var i=32-et(r)-1;r&=~(1<<i),n+=1;var a=32-et(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Qi=1<<32-et(t)+i|n<<i|r,$i=a+e}else Qi=1<<a|n<<i|r,$i=e}function na(e){e.return!==null&&(ea(e,1),ta(e,1,0))}function ra(e){for(;e===qi;)qi=Gi[--Ki],Gi[Ki]=null,Ji=Gi[--Ki],Gi[Ki]=null;for(;e===Zi;)Zi=Yi[--Xi],Yi[Xi]=null,$i=Yi[--Xi],Yi[Xi]=null,Qi=Yi[--Xi],Yi[Xi]=null}function ia(e,t){Yi[Xi++]=Qi,Yi[Xi++]=$i,Yi[Xi++]=Zi,Qi=t.id,$i=t.overflow,Zi=e}var aa=null,oa=null,R=!1,sa=null,ca=!1,la=Error(a(519));function ua(e){throw ga(Wi(Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),la}function da(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[wt]=e,t[Tt]=r,n){case`dialog`:Q(`cancel`,t),Q(`close`,t);break;case`iframe`:case`object`:case`embed`:Q(`load`,t);break;case`video`:case`audio`:for(n=0;n<zf.length;n++)Q(zf[n],t);break;case`source`:Q(`error`,t);break;case`img`:case`image`:case`link`:Q(`error`,t),Q(`load`,t);break;case`details`:Q(`toggle`,t);break;case`input`:Q(`invalid`,t),sn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Q(`invalid`,t);break;case`textarea`:Q(`invalid`,t),dn(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||ep(t.textContent,n)?(r.popover!=null&&(Q(`beforetoggle`,t),Q(`toggle`,t)),r.onScroll!=null&&Q(`scroll`,t),r.onScrollEnd!=null&&Q(`scrollend`,t),r.onClick!=null&&(t.onclick=bn),t=!0):t=!1,t||ua(e,!0)}function fa(e){for(aa=e.return;aa;)switch(aa.tag){case 5:case 31:case 13:ca=!1;return;case 27:case 3:ca=!0;return;default:aa=aa.return}}function pa(e){if(e!==aa)return!1;if(!R)return fa(e),R=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||pp(e.type,e.memoizedProps)),n=!n),n&&oa&&ua(e),fa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));oa=dm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));oa=dm(e)}else t===27?(t=oa,Sp(e.type)?(e=um,um=null,oa=e):oa=t):oa=aa?lm(e.stateNode.nextSibling):null;return!0}function ma(){oa=aa=null,R=!1}function ha(){var e=sa;return e!==null&&(fd===null?fd=e:fd.push.apply(fd,e),sa=null),e}function ga(e){sa===null?sa=[e]:sa.push(e)}var _a=F(null),va=null,ya=null;function ba(e,t,n){xe(_a,t._currentValue),t._currentValue=n}function xa(e){e._currentValue=_a.current,I(_a)}function Sa(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Ca(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){var s=i.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Sa(o.return,n,e),r||(s=null);break a}o=c.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(a(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Sa(s,n,e),s=null}else i.tag===13&&i.memoizedState!==null&&i.memoizedState.dehydrated===null?(i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),Sa(i.return,n,e),s=i.child,s=s===null?null:s.sibling):s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function wa(e,t,n,r){e=null;for(var i=t,o=!1;i!==null;){if(!o){if(i.flags&524288)o=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(a(387));if(s=s.memoizedProps,s!==null){var c=i.type;Ur(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===Te.current){if(s=i.alternate,s===null)throw Error(a(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[sh]:e.push(sh))}i=i.return}return e!==null&&Ca(t,e,n,r),t.flags|=262144,e!==null}function Ta(e){for(e=e.firstContext;e!==null;){if(!Ur(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ea(e){va=e,ya=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Da(e){return ka(va,e)}function Oa(e,t){return va===null&&Ea(e),ka(e,t)}function ka(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ya===null){if(e===null)throw Error(a(308));ya=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ya=ya.next=t;return n}var Aa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ja=t.unstable_scheduleCallback,Ma=t.unstable_NormalPriority,Na={$$typeof:re,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Pa(){return{controller:new Aa,data:new Map,refCount:0}}function Fa(e){e.refCount--,e.refCount===0&&ja(Ma,function(){e.controller.abort()})}function Ia(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var La=null;function Ra(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var za=null,Ba=0,Va=0,z=null;function Ha(e,t){if(za===null){var n=za=[];Ba=0,Va=Pf(),z={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Ba++,t.then(Ua,Ua),t}function Ua(){if(--Ba===0&&(La=null,za!==null)){z!==null&&(z.status=`fulfilled`);var e=za;za=null,Va=0,z=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Wa(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Ga=N.S;N.S=function(e,t){if(hd=He(),typeof t==`object`&&t&&typeof t.then==`function`&&Ha(e,t),La!==null)for(var n=bf;n!==null;)Ia(n,La),n=n.next;if(n=e.types,n!==null){for(var r=bf;r!==null;)Ia(r,n),r=r.next;if(Va!==0){r=La,r===null&&(r=La=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ga!==null&&Ga(e,t)};var Ka=F(null);function qa(){var e=Ka.current;return e===null?K.pooledCache:e}function Ja(e,t){t===null?xe(Ka,Ka.current):xe(Ka,t.pool)}function Ya(){var e=qa();return e===null?null:{parent:Na._currentValue,pool:e}}var Xa=Error(a(460)),Za=Error(a(474)),Qa=Error(a(542)),$a={then:function(){}};function eo(e){return e=e.status,e===`fulfilled`||e===`rejected`}function to(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(bn,bn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ao(e),e===void 0&&!(`reason`in t)?Error(a(600)):e;default:if(typeof t.status==`string`)t.then(bn,bn);else{if(e=K,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ao(e),e}throw ro=t,Xa}}function no(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ro=e,Xa):e}}var ro=null;function io(){if(ro===null)throw Error(a(459));var e=ro;return ro=null,e}function ao(e){if(e===Xa||e===Qa)throw Error(a(483))}var oo=null,so=0;function co(e){var t=so;return so+=1,oo===null&&(oo=[]),to(oo,e,t)}function lo(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function uo(e,t){throw t.$$typeof===E?Error(a(525)):(e=Object.prototype.toString.call(t),Error(a(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function fo(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function i(e,t){return e=Ii(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Bi(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===O?(e=d(e,t,n.props.children,r,n.key),lo(e,n),e):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===le&&no(a)===t.type)?(t=i(t,n.props),lo(t,n),t.return=e,t):(t=Ri(n.type,n.key,n.props,null,e.mode,r),lo(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Hi(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=zi(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Bi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case ee:return n=Ri(t.type,t.key,t.props,null,e.mode,n),lo(n,t),n.return=e,n;case D:return t=Hi(t,e.mode,n),t.return=e,t;case le:return t=no(t),f(e,t,n)}if(_e(t)||he(t))return t=zi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,co(t),n);if(t.$$typeof===re)return f(e,Oa(e,t),n);uo(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case ee:return n.key===i?l(e,t,n,r):null;case D:return n.key===i?u(e,t,n,r):null;case le:return n=no(n),p(e,t,n,r)}if(_e(n)||he(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,co(n),r);if(n.$$typeof===re)return p(e,t,Oa(e,n),r);uo(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case ee:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case D:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case le:return r=no(r),m(e,t,n,r,i)}if(_e(r)||he(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,co(r),i);if(r.$$typeof===re)return m(e,t,n,Oa(t,r),i);uo(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),R&&ea(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return R&&ea(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),R&&ea(i,h),l}function g(i,s,c,l){if(c==null)throw Error(a(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),R&&ea(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return R&&ea(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),R&&ea(i,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===O&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case ee:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===O){if(r.tag===7){n(e,r.sibling),c=i(r,o.props.children),lo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===le&&no(l)===r.type){n(e,r.sibling),c=i(r,o.props),lo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===O?(c=zi(o.props.children,e.mode,c,o.key),lo(c,o),c.return=e,e=c):(c=Ri(o.type,o.key,o.props,null,e.mode,c),lo(c,o),c.return=e,e=c)}return s(e);case D:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=i(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Hi(o,e.mode,c),c.return=e,e=c}return s(e);case le:return o=no(o),_(e,r,o,c)}if(_e(o))return h(e,r,o,c);if(he(o)){if(l=he(o),typeof l!=`function`)throw Error(a(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,co(o),c);if(o.$$typeof===re)return _(e,r,Oa(e,o),c);uo(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,o),c.return=e,e=c):(n(e,r),c=Bi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{so=0;var i=_(e,t,n,r);return oo=null,i}catch(t){if(t===Xa||t===Qa)throw t;var a=Pi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var po=fo(!0),mo=fo(!1),ho=!1;function go(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function _o(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function vo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function yo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,G&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ji(e),Ai(e,null,n),t}return Di(e,r,t,n),ji(e)}function bo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,_t(e,n)}}function xo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var So=!1;function Co(){if(So){var e=z;if(e!==null)throw e}}function wo(e,t,n,r){So=!1;var i=e.updateQueue;ho=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(J&f)===f:(r&f)===f){f!==0&&f===Va&&(So=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=T({},d,f);break a;case 2:ho=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),od|=o,e.lanes=o,e.memoizedState=d}}function To(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function Eo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)To(n[e],t)}var Do=F(null),Oo=F(0);function ko(e,t){e=id,xe(Oo,e),xe(Do,t),id=e|t.baseLanes}function Ao(){xe(Oo,id),xe(Do,Do.current)}function jo(){id=Oo.current,I(Do),I(Oo)}var Mo=F(null),No=null;function Po(e){var t=e.alternate;xe(zo,zo.current&1),xe(Mo,e),No===null&&(t===null||Do.current!==null||t.memoizedState!==null)&&(No=e)}function Fo(e){xe(zo,zo.current),xe(Mo,e),No===null&&(No=e)}function Io(e){e.tag===22?(xe(zo,zo.current),xe(Mo,e),No===null&&(No=e)):Lo()}function Lo(){xe(zo,zo.current),xe(Mo,Mo.current)}function Ro(e){I(Mo),No===e&&(No=null),I(zo)}var zo=F(0);function Bo(e,t){xe(Mo,Mo.current),xe(zo,t)}function Vo(e){I(zo),I(Mo),No===e&&(No=null)}function Ho(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||om(n)||sm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Uo=0,B=null,V=null,Wo=null,Go=!1,Ko=!1,qo=!1,Jo=0,Yo=0,Xo=null,Zo=0;function Qo(){throw Error(a(321))}function $o(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ur(e[n],t[n]))return!1;return!0}function es(e,t,n,r,i,a){return Uo=a,B=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?_c:vc,qo=!1,a=n(r,i),qo=!1,Ko&&(a=ns(t,n,r,i)),ts(e),a}function ts(e){N.H=gc;var t=V!==null&&V.next!==null;if(Uo=0,Wo=V=B=null,Go=!1,Yo=0,Xo=null,t)throw Error(a(300));e===null||Fc||(e=e.dependencies,e!==null&&Ta(e)&&(Fc=!0))}function ns(e,t,n,r){B=e;var i=0;do{if(Ko&&(Xo=null),Yo=0,Ko=!1,25<=i)throw Error(a(301));if(i+=1,Wo=V=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}N.H=yc,o=t(n,r)}while(Ko);return o}function rs(){var e=N.H,t=e.useState()[0];return t=typeof t.then==`function`?us(t):t,e=e.useState()[0],(V===null?null:V.memoizedState)!==e&&(B.flags|=1024),t}function is(){var e=Jo!==0;return Jo=0,e}function as(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function os(e){if(Go){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Go=!1}Uo=0,Wo=V=B=null,Ko=!1,Yo=Jo=0,Xo=null}function ss(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Wo===null?B.memoizedState=Wo=e:Wo=Wo.next=e,Wo}function cs(){if(V===null){var e=B.alternate;e=e===null?null:e.memoizedState}else e=V.next;var t=Wo===null?B.memoizedState:Wo.next;if(t!==null)Wo=t,V=e;else{if(e===null)throw B.alternate===null?Error(a(467)):Error(a(310));V=e,e={memoizedState:V.memoizedState,baseState:V.baseState,baseQueue:V.baseQueue,queue:V.queue,next:null},Wo===null?B.memoizedState=Wo=e:Wo=Wo.next=e}return Wo}function ls(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function us(e){var t=Yo;return Yo+=1,Xo===null&&(Xo=[]),e=to(Xo,e,t),t=B,(Wo===null?t.memoizedState:Wo.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?_c:vc),e}function ds(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return us(e);if(e.$$typeof===pe)return;if(e.$$typeof===re)return Da(e)}throw Error(a(438,String(e)))}function fs(e){var t=null,n=B.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=B.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=ls(),B.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=fe;return t.index++,n}function ps(e,t){return typeof t==`function`?t(e):t}function ms(e){return hs(cs(),V,e)}function hs(e,t,n){var r=e.queue;if(r===null)throw Error(a(311));r.lastRenderedReducer=n;var i=e.baseQueue,o=r.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}t.baseQueue=i=o,r.pending=null}if(o=e.baseState,i===null)e.memoizedState=o;else{t=i.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Uo&f)===f:(J&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Va&&(d=!0);else if((Uo&p)===p){u=u.next,p===Va&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,B.lanes|=p,od|=p;f=u.action,qo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,B.lanes|=f,od|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Ur(o,e.memoizedState)&&(Fc=!0,d&&(n=z,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function gs(e){var t=cs(),n=t.queue;if(n===null)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);Ur(o,t.memoizedState)||(Fc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function _s(e,t,n){var r=B,i=cs(),o=R;if(o){if(n===void 0)throw Error(a(407));n=n()}else n=t();var s=!Ur((V||i).memoizedState,n);if(s&&(i.memoizedState=n,Fc=!0),i=i.queue,Hs(bs.bind(null,r,i,e),[e]),e=i.getSnapshot!==t||s||Wo!==null&&!!(Wo.memoizedState.tag&1),Ls(e?9:8,{destroy:void 0},ys.bind(null,r,i,n,t),null),e){if(r.flags|=2048,K===null)throw Error(a(349));o||Uo&127||vs(r,t,n)}return n}function vs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=B.updateQueue,t===null?(t=ls(),B.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ys(e,t,n,r){t.value=n,t.getSnapshot=r,xs(t)&&Ss(e)}function bs(e,t,n){return n(function(){xs(t)&&Ss(e)})}function xs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ur(e,n)}catch{return!0}}function Ss(e){var t=ki(e,2);t!==null&&Pd(t,e,2)}function Cs(e){var t=ss();if(typeof e==`function`){var n=e;if(e=n(),qo){$e(!0);try{n()}finally{$e(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:e},t}function ws(e,t,n,r){return e.baseState=n,hs(e,V,typeof r==`function`?r:ps)}function Ts(e,t,n,r,i){if(pc(e))throw Error(a(485));if(e=t.action,e!==null){var o={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};N.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Es(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Es(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=N.T,o={};o.types=a===null?null:a.types,N.T=o;try{var s=n(i,r),c=N.S;c!==null&&c(o,s),Ds(e,t,s)}catch(n){ks(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),N.T=a}}else try{a=n(i,r),Ds(e,t,a)}catch(n){ks(e,t,n)}}function Ds(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Os(e,t,n)},function(n){return ks(e,t,n)}):Os(e,t,n)}function Os(e,t,n){t.status=`fulfilled`,t.value=n,As(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Es(e,n)))}function ks(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,As(t),t=t.next;while(t!==r)}e.action=null}function As(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function js(e,t){return t}function Ms(e,t){if(R){var n=K.formState;if(n!==null){a:{var r=B;if(R){if(oa){b:{for(var i=oa,a=ca;i.nodeType!==8;){if(!a){i=null;break b}if(i=lm(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){oa=lm(i.nextSibling),r=i.data===`F!`;break a}}ua(r)}r=!1}r&&(t=n[0])}}return n=ss(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:js,lastRenderedState:t},n.queue=r,n=uc.bind(null,B,r),r.dispatch=n,r=Cs(!1),a=fc.bind(null,B,!1,r.queue),r=ss(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Ts.bind(null,B,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ns(e){return Ps(cs(),V,e)}function Ps(e,t,n){if(t=hs(e,t,js)[0],e=ms(ps)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=us(t)}catch(e){throw e===Xa?Qa:e}else r=t;t=cs();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(B.flags|=2048,Ls(9,{destroy:void 0},Fs.bind(null,i,n),null)),[r,a,e]}function Fs(e,t){e.action=t}function Is(e){var t=cs(),n=V;if(n!==null)return Ps(t,n,e);cs(),t=t.memoizedState,n=cs();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ls(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=B.updateQueue,t===null&&(t=ls(),B.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Rs(){return cs().memoizedState}function zs(e,t,n,r){var i=ss();B.flags|=e,i.memoizedState=Ls(1|t,{destroy:void 0},n,r===void 0?null:r)}function Bs(e,t,n,r){var i=cs();r=r===void 0?null:r;var a=i.memoizedState.inst;V!==null&&r!==null&&$o(r,V.memoizedState.deps)?i.memoizedState=Ls(t,a,n,r):(B.flags|=e,i.memoizedState=Ls(1|t,a,n,r))}function Vs(e,t){zs(8390656,8,e,t)}function Hs(e,t){Bs(2048,8,e,t)}function Us(e){B.flags|=4;var t=B.updateQueue;if(t===null)t=ls(),B.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Ws(e){var t=cs().memoizedState;return Us({ref:t,nextImpl:e}),function(){if(G&2)throw Error(a(440));return t.impl.apply(void 0,arguments)}}function Gs(e,t){return Bs(4,2,e,t)}function Ks(e,t){return Bs(4,4,e,t)}function qs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Js(e,t,n){n=n==null?null:n.concat([e]),Bs(4,4,qs.bind(null,t,e),n)}function Ys(){}function Xs(e,t){var n=cs();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&$o(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Zs(e,t){var n=cs();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&$o(t,r[1]))return r[0];if(r=e(),qo){$e(!0);try{e()}finally{$e(!1)}}return n.memoizedState=[r,t],r}function Qs(e,t,n){return n===void 0||Uo&1073741824&&!(J&261930)?e.memoizedState=t:(e.memoizedState=n,e=Md(),B.lanes|=e,od|=e,n)}function $s(e,t,n,r){return Ur(n,t)?n:Do.current===null?!(Uo&106)||Uo&1073741824&&!(J&261930)?(Fc=!0,e.memoizedState=n):(e=Md(),B.lanes|=e,od|=e,t):(e=Qs(e,n,r),Ur(e,t)||(Fc=!0),e)}function ec(e,t,n,r,i){var a=P.p;P.p=a!==0&&8>a?a:8;var o=N.T,s={};s.types=o===null?null:o.types,N.T=s,fc(e,!1,t,n);try{var c=i(),l=N.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?dc(e,t,Wa(c,r),jd(e)):dc(e,t,r,jd(e))}catch(n){dc(e,t,{then:function(){},status:`rejected`,reason:n},jd())}finally{P.p=a,o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}function tc(){}function nc(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=rc(e).queue;ec(e,i,t,ve,n===null?tc:function(){return ic(e),n(r)})}function rc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ve,baseState:ve,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:ve},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ic(e){var t=rc(e);t.next===null&&(t=e.alternate.memoizedState),dc(e,t.next.queue,{},jd())}function ac(){return Da(sh)}function oc(){return cs().memoizedState}function sc(){return cs().memoizedState}function cc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=jd();e=vo(n);var r=yo(t,e,n);r!==null&&(Pd(r,t,n),bo(r,t,n)),t={cache:Pa()},e.payload=t;return}t=t.return}}function lc(e,t,n){var r=jd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},pc(e)?mc(t,n):(n=Oi(e,t,n,r),n!==null&&(Pd(n,e,r),hc(n,t,r)))}function uc(e,t,n){dc(e,t,n,jd())}function dc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(pc(e))mc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Ur(s,o))return Di(e,t,i,0),K===null&&Ei(),!1}catch{}if(n=Oi(e,t,i,r),n!==null)return Pd(n,e,r),hc(n,t,r),!0}return!1}function fc(e,t,n,r){if(r={lane:2,revertLane:Pf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},pc(e)){if(t)throw Error(a(479))}else t=Oi(e,n,r,2),t!==null&&Pd(t,e,2)}function pc(e){var t=e.alternate;return e===B||t!==null&&t===B}function mc(e,t){Ko=Go=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function hc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,_t(e,n)}}var gc={readContext:Da,use:ds,useCallback:Qo,useContext:Qo,useEffect:Qo,useImperativeHandle:Qo,useLayoutEffect:Qo,useInsertionEffect:Qo,useMemo:Qo,useReducer:Qo,useRef:Qo,useState:Qo,useDebugValue:Qo,useDeferredValue:Qo,useTransition:Qo,useSyncExternalStore:Qo,useId:Qo,useHostTransitionStatus:Qo,useFormState:Qo,useActionState:Qo,useOptimistic:Qo,useMemoCache:Qo,useCacheRefresh:Qo,useEffectEvent:Qo},_c={readContext:Da,use:ds,useCallback:function(e,t){return ss().memoizedState=[e,t===void 0?null:t],e},useContext:Da,useEffect:Vs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),zs(4194308,4,qs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return zs(4194308,4,e,t)},useInsertionEffect:function(e,t){zs(4,2,e,t)},useMemo:function(e,t){var n=ss();t=t===void 0?null:t;var r=e();if(qo){$e(!0);try{e()}finally{$e(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ss();if(n!==void 0){var i=n(t);if(qo){$e(!0);try{n(t)}finally{$e(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=lc.bind(null,B,e),[r.memoizedState,e]},useRef:function(e){var t=ss();return e={current:e},t.memoizedState=e},useState:function(e){e=Cs(e);var t=e.queue,n=uc.bind(null,B,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ys,useDeferredValue:function(e,t){return Qs(ss(),e,t)},useTransition:function(){var e=Cs(!1);return e=ec.bind(null,B,e.queue,!0,!1),ss().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=B,i=ss();if(R){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),K===null)throw Error(a(349));J&127||vs(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Vs(bs.bind(null,r,o,e),[e]),r.flags|=2048,Ls(9,{destroy:void 0},ys.bind(null,r,o,n,t),null),n},useId:function(){var e=ss(),t=K.identifierPrefix;if(R){var n=$i,r=Qi;n=(r&~(1<<32-et(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Jo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Zo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ac,useFormState:Ms,useActionState:Ms,useOptimistic:function(e){var t=ss();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=fc.bind(null,B,!0,n),n.dispatch=t,[e,t]},useMemoCache:fs,useCacheRefresh:function(){return ss().memoizedState=cc.bind(null,B)},useEffectEvent:function(e){var t=ss(),n={impl:e};return t.memoizedState=n,function(){if(G&2)throw Error(a(440));return n.impl.apply(void 0,arguments)}}},vc={readContext:Da,use:ds,useCallback:Xs,useContext:Da,useEffect:Hs,useImperativeHandle:Js,useInsertionEffect:Gs,useLayoutEffect:Ks,useMemo:Zs,useReducer:ms,useRef:Rs,useState:function(){return ms(ps)},useDebugValue:Ys,useDeferredValue:function(e,t){return $s(cs(),V.memoizedState,e,t)},useTransition:function(){var e=ms(ps)[0],t=cs().memoizedState;return[typeof e==`boolean`?e:us(e),t]},useSyncExternalStore:_s,useId:oc,useHostTransitionStatus:ac,useFormState:Ns,useActionState:Ns,useOptimistic:function(e,t){return ws(cs(),V,e,t)},useMemoCache:fs,useCacheRefresh:sc,useEffectEvent:Ws},yc={readContext:Da,use:ds,useCallback:Xs,useContext:Da,useEffect:Hs,useImperativeHandle:Js,useInsertionEffect:Gs,useLayoutEffect:Ks,useMemo:Zs,useReducer:gs,useRef:Rs,useState:function(){return gs(ps)},useDebugValue:Ys,useDeferredValue:function(e,t){var n=cs();return V===null?Qs(n,e,t):$s(n,V.memoizedState,e,t)},useTransition:function(){var e=gs(ps)[0],t=cs().memoizedState;return[typeof e==`boolean`?e:us(e),t]},useSyncExternalStore:_s,useId:oc,useHostTransitionStatus:ac,useFormState:Is,useActionState:Is,useOptimistic:function(e,t){var n=cs();return V===null?(n.baseState=e,[e,n.queue.dispatch]):ws(n,V,e,t)},useMemoCache:fs,useCacheRefresh:sc,useEffectEvent:Ws};function bc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:T({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var xc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=jd(),i=vo(r);i.payload=t,n!=null&&(i.callback=n),t=yo(e,i,r),t!==null&&(Pd(t,e,r),bo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=jd(),i=vo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=yo(e,i,r),t!==null&&(Pd(t,e,r),bo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=jd(),r=vo(n);r.tag=2,t!=null&&(r.callback=t),t=yo(e,r,n),t!==null&&(Pd(t,e,n),bo(t,e,n))}};function Sc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Wr(n,r)||!Wr(i,a):!0}function Cc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&xc.enqueueReplaceState(t,t.state,null)}function wc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=T({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Tc(e){Si(e)}function Ec(e){console.error(e)}function Dc(e){Si(e)}function Oc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function kc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Ac(e,t,n){return n=vo(n),n.tag=3,n.payload={element:null},n.callback=function(){Oc(e,t)},n}function jc(e){return e=vo(e),e.tag=3,e}function Mc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){kc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){kc(t,n,r),typeof i!=`function`&&(vd===null?vd=new Set([this]):vd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Nc(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&wa(t,n,i,!0),n=Mo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return No===null?Kd():n.alternate===null&&ad===0&&(ad=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===$a?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),mf(e,r,i)),!1;case 22:return n.flags|=65536,r===$a?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),mf(e,r,i)),!1}throw Error(a(435,n.tag))}return mf(e,r,i),Kd(),!1}if(R)return t=Mo.current,t===null?(r!==la&&(t=Error(a(423),{cause:r}),ga(Wi(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=Wi(r,n),i=Ac(e.stateNode,r,i),xo(e,i),ad!==4&&(ad=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==la&&(e=Error(a(422),{cause:r}),ga(Wi(e,n)))),!1;var o=Error(a(520),{cause:r});if(o=Wi(o,n),dd===null?dd=[o]:dd.push(o),ad!==4&&(ad=2),t===null)return!0;r=Wi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=Ac(n.stateNode,r,e),xo(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(vd===null||!vd.has(o))))return n.flags|=65536,i&=-i,n.lanes|=i,i=jc(i),Mc(i,e,n,r),xo(n,i),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Pc=Error(a(461)),Fc=!1;function Ic(e,t,n,r){t.child=e===null?mo(t,null,n,r):po(t,e.child,n,r)}function Lc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Ea(t),r=es(e,t,n,o,a,i),s=is(),e!==null&&!Fc?(as(e,t,i),dl(e,t,i)):(R&&s&&na(t),t.flags|=1,Ic(e,t,r,i),t.child)}function Rc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Fi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,zc(e,t,a,r,i)):(e=Ri(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!H(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Wr:n,n(o,r)&&e.ref===t.ref)return dl(e,t,i)}return t.flags|=1,e=Ii(a,r),e.ref=t.ref,e.return=t,t.child=e}function zc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Wr(a,r)&&e.ref===t.ref){if(Fc=!1,t.pendingProps=r=a,H(e,i))e.flags&131072&&(Fc=!0);else return t.lanes=e.lanes,dl(e,t,i)}}return qc(e,t,n,r,i)}function Bc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Hc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ja(t,a===null?null:a.cachePool),a===null?Ao():ko(t,a),Io(t);else return r=t.lanes=536870912,Hc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ja(t,null),Ao(),Lo()):(Ja(t,a.cachePool),ko(t,a),Lo(),t.memoizedState=null);return Ic(e,t,i,n),t.child}function Vc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Hc(e,t,n,r,i){var a=qa();return a=a===null?null:{parent:Na._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ja(t,null),Ao(),Io(t),e!==null&&wa(e,t,r,!0),t.childLanes=i,null}function Uc(e,t){return t=nl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Wc(e,t,n){return po(t,e.child,null,n),e=Uc(t,t.pendingProps),e.flags|=2,Ro(t),t.memoizedState=null,e}function Gc(e,t,n){var r=t.pendingProps,i=!!(t.flags&128);if(t.flags&=-129,e===null){if(R){if(r.mode===`hidden`)return e=Uc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Vc(null,e);if(Fo(t),(e=oa)?(e=am(e,ca),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Zi===null?null:{id:Qi,overflow:$i},retryLane:536870912,hydrationErrors:null},n=Vi(e),n.return=t,t.child=n,aa=t,oa=null)):e=null,e===null)throw ua(t);return t.lanes=536870912,null}return Uc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Fo(t),i){if(t.flags&256)t.flags&=-257,t=Wc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(a(558))}else if(Fc||wa(e,t,n,!1),i=(n&e.childLanes)!==0,Fc||i){if(Do.current===null){if(r=K,r!==null&&(s=vt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ki(e,s),Pd(r,e,s),Pc;Kd()}t=Wc(e,t,n)}else e=o.treeContext,oa=lm(s.nextSibling),aa=t,R=!0,sa=null,ca=!1,e!==null&&ia(t,e),t=Uc(t,r),t.flags|=134221824;return t}return e=Ii(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Kc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(a(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function qc(e,t,n,r,i){return Ea(t),n=es(e,t,n,r,void 0,i),r=is(),e!==null&&!Fc?(as(e,t,i),dl(e,t,i)):(R&&r&&na(t),t.flags|=1,Ic(e,t,n,i),t.child)}function Jc(e,t,n,r,i,a){return Ea(t),t.updateQueue=null,n=ns(t,r,n,i),ts(e),r=is(),e!==null&&!Fc?(as(e,t,a),dl(e,t,a)):(R&&r&&na(t),t.flags|=1,Ic(e,t,n,a),t.child)}function Yc(e,t,n,r,i){if(Ea(t),t.stateNode===null){var a=Mi,o=n.contextType;typeof o==`object`&&o&&(a=Da(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=xc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},go(t),o=n.contextType,a.context=typeof o==`object`&&o?Da(o):Mi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(bc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&xc.enqueueReplaceState(a,a.state,null),wo(t,r,a,i),Co(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=wc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Mi,typeof u==`object`&&u&&(o=Da(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Cc(t,a,r,o),ho=!1;var f=t.memoizedState;a.state=f,wo(t,r,a,i),Co(),l=t.memoizedState,s||f!==l||ho?(typeof d==`function`&&(bc(t,n,d,r),l=t.memoizedState),(c=ho||Sc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,_o(e,t),o=t.memoizedProps,u=wc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Mi,typeof l==`object`&&l&&(c=Da(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Cc(t,a,r,c),ho=!1,f=t.memoizedState,a.state=f,wo(t,r,a,i),Co();var p=t.memoizedState;o!==d||f!==p||ho||e!==null&&e.dependencies!==null&&Ta(e.dependencies)?(typeof s==`function`&&(bc(t,n,s,r),p=t.memoizedState),(u=ho||Sc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ta(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Kc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=po(t,e.child,null,i),t.child=po(t,null,n,i)):Ic(e,t,n,i),t.memoizedState=a.state,e=t.child):e=dl(e,t,i),e}function Xc(e,t,n,r){return ma(),t.flags|=256,Ic(e,t,n,r),t.child}var Zc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Qc(e){return{baseLanes:e,cachePool:Ya()}}function $c(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ld),e}function el(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(zo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(R){if(i?Po(t):Lo(),(e=oa)?(e=am(e,ca),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Zi===null?null:{id:Qi,overflow:$i},retryLane:536870912,hydrationErrors:null},n=Vi(e),n.return=t,t.child=n,aa=t,oa=null)):e=null,e===null)throw ua(t);return t.lanes=sm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Lo(),i=t.mode,a=nl({mode:`hidden`,children:a},i),r=zi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Qc(n),r.childLanes=$c(e,o,n),t.memoizedState=Zc,Vc(null,r)):(Po(t),tl(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return il(e,t,a,o,r,c,s,n)}return i?(Lo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Ii(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=zi(i,a,n,null),i.flags|=2):i=Ii(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Vc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Qc(n):(a=i.cachePool,a===null?a=Ya():(s=Na._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=$c(e,o,n),t.memoizedState=Zc,Vc(e.child,r)):(Po(t),n=e.child,e=n.sibling,n=Ii(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function tl(e,t){return t=nl({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function nl(e,t){return e=Pi(22,e,null,t),e.lanes=0,e}function rl(e,t,n){return po(t,e.child,null,n),e=tl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function il(e,t,n,r,i,o,s,c){if(n)return t.flags&256?(Po(t),t.flags&=-257,rl(e,t,c)):t.memoizedState===null?(Lo(),o=i.fallback,s=t.mode,i=nl({mode:`visible`,children:i.children},s),o=zi(o,s,c,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,po(t,e.child,null,c),i=t.child,i.memoizedState=Qc(c),i.childLanes=$c(e,r,c),t.memoizedState=Zc,Vc(null,i)):(Lo(),t.child=e.child,t.flags|=128,null);if(Po(t),sm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(i=Error(a(419)),i.stack=``,i.digest=r,ga({value:i,source:null,stack:null})),rl(e,t,c)}if(Fc||wa(e,t,c,!1),r=(c&e.childLanes)!==0,Fc||r){if(Do.current!==null)return rl(e,t,c);if(r=K,r!==null&&(i=vt(r,c),i!==0&&i!==s.retryLane))throw s.retryLane=i,ki(e,i),Pd(r,e,i),Pc;return om(o)||Kd(),rl(e,t,c)}return om(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,oa=lm(o.nextSibling),aa=t,R=!0,sa=null,ca=!1,e!==null&&ia(t,e),t=tl(t,i.children),t.flags|=134221824,t)}function al(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Sa(e.return,t,n)}function ol(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Ho(n)===null&&(t=e),e=e.sibling}return t}function sl(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function cl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function ll(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=zo.current;if(t.flags&128)return Bo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Bo(t,o),i===`backwards`&&e!==null?(cl(e),Ic(e,t,r,n),cl(e)):Ic(e,t,r,n),r=R?Ji:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&al(e,n,t);else if(e.tag===19)al(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=ol(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,cl(t)),sl(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Ho(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}sl(t,!0,n,null,a,r);break;case`together`:sl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=ol(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),sl(t,!1,i,n,a,r)}return t.child}function ul(e,t,n){var r=t.pendingProps;return ba(t,t.type,r.value),Ic(e,t,r.children,n),t.child}function dl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),od|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(wa(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(a(153));if(t.child!==null){for(e=t.child,n=Ii(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ii(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function H(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Ta(e)))}function fl(e,t,n){switch(t.tag){case 3:Ee(t,t.stateNode.containerInfo),ba(t,Na,e.memoizedState.cache),ma();break;case 27:case 5:Oe(t);break;case 4:Ee(t,t.stateNode.containerInfo);break;case 10:ba(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Fo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Po(t),t.flags|=128,null;r=wa(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?el(e,t,n):(Po(t),e=dl(e,t,n),e===null?null:e.sibling)}Po(t);break;case 19:if(t.flags&128)return ll(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(wa(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return ll(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Bo(t,zo.current),r)break;return null;case 22:return t.lanes=0,Bc(e,t,n,t.pendingProps);case 24:ba(t,Na,e.memoizedState.cache)}return dl(e,t,n)}function pl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Fc=!0;else{if(!H(e,n)&&!(t.flags&128))return Fc=!1,fl(e,t,n);Fc=!!(e.flags&131072)}}else Fc=!1,R&&t.flags&1048576&&ta(t,Ji,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=no(t.elementType),t.type=e,typeof e==`function`)Fi(e)?(r=wc(e,r),t.tag=1,t=Yc(null,t,e,r,n)):(t.tag=0,t=qc(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===ae){t.tag=11,t=Lc(null,t,e,r,n);break a}if(i===A){t.tag=14,t=Rc(null,t,e,r,n);break a}if(i===re){t.tag=10,t.type=e,t=ul(null,t,n);break a}}throw t=M(e)||e,Error(a(306,t,``))}}return t;case 0:return qc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=wc(r,t.pendingProps),Yc(e,t,r,i,n);case 3:a:{if(Ee(t,t.stateNode.containerInfo),e===null)throw Error(a(387));r=t.pendingProps;var o=t.memoizedState;i=o.element,_o(e,t),wo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ba(t,Na,r),r!==o.cache&&Ca(t,[Na],n,!0),Co(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Xc(e,t,r,n);break a}if(r!==i){i=Wi(Error(a(424)),t),ga(i),t=Xc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(oa=lm(e.firstChild),aa=t,R=!0,sa=null,ca=!0,n=mo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ma(),r===i){t=dl(e,t,n);break a}Ic(e,t,r,n)}t=t.child}return t;case 26:return Kc(e,t),e===null?(n=Nm(t.type,null,t.pendingProps,null))?t.memoizedState=n:R||(t.stateNode=fp(t.type,t.pendingProps,we.current,t)):t.memoizedState=Nm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Oe(t),e===null&&R&&(r=t.stateNode=hm(t.type,t.pendingProps,we.current),aa=t,ca=!0,i=oa,Sp(t.type)?(um=i,oa=lm(r.firstChild)):oa=i),Ic(e,t,t.pendingProps.children,n),Kc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&R&&((i=r=oa)&&(r=rm(r,t.type,t.pendingProps,ca),r===null?i=!1:(t.stateNode=r,aa=t,oa=lm(r.firstChild),ca=!1,i=!0)),i||ua(t)),Oe(t),i=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,pp(i,o)?r=null:s!==null&&pp(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=es(e,t,rs,null,null,n),sh._currentValue=i),Kc(e,t),Ic(e,t,r,n),t.child;case 6:return e===null&&R&&((e=n=oa)&&(n=im(n,t.pendingProps,ca),n===null?e=!1:(t.stateNode=n,aa=t,oa=null,e=!0)),e||ua(t)),null;case 13:return el(e,t,n);case 4:return Ee(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=po(t,null,r,n):Ic(e,t,r,n),t.child;case 11:return Lc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Kc(e,t),Ic(e,t,r,n),t.child;case 8:return Ic(e,t,t.pendingProps.children,n),t.child;case 12:return Ic(e,t,t.pendingProps.children,n),t.child;case 10:return ul(e,t,n);case 9:return i=t.type._context,r=t.pendingProps.children,Ea(t),i=Da(i),r=r(i),t.flags|=1,Ic(e,t,r,n),t.child;case 14:return Rc(e,t,t.type,t.pendingProps,n);case 15:return zc(e,t,t.type,t.pendingProps,n);case 19:return ll(e,t,n);case 31:return Gc(e,t,n);case 22:return Bc(e,t,n,t.pendingProps);case 24:return Ea(t),r=Da(Na),e===null?(i=qa(),i===null&&(i=K,o=Pa(),i.pooledCache=o,o.refCount++,o!==null&&(i.pooledCacheLanes|=n),i=o),t.memoizedState={parent:r,cache:i},go(t),ba(t,Na,i)):((e.lanes&n)!==0&&(_o(e,t),wo(t,null,null,n),Co()),i=e.memoizedState,o=t.memoizedState,i.parent===r?(r=o.cache,ba(t,Na,r),r!==i.cache&&Ca(t,[Na],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),ba(t,Na,r))),Ic(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:R&&na(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Kc(e,t),Ic(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function ml(e){e.flags|=4}function hl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Jm(t,r):Jm(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Ud())e.flags|=8192;else throw ro=$a,Za}}else e.flags&=-16777217}function gl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Ym(t)){if(Ud())e.flags|=8192;else throw ro=$a,Za}}function _l(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:ft(),e.lanes|=t,ud|=t)}function vl(e,t){if(!R)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function yl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function bl(e,t,n){var r=t.pendingProps;switch(ra(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yl(t),null;case 1:return yl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),xa(Na),De(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(pa(t)?ml(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ha())),yl(t),null;case 26:var i=t.type,o=t.memoizedState;return e===null?(ml(t),o===null?(yl(t),hl(t,i,null,r,n)):(yl(t),gl(t,o))):o?o===e.memoizedState?(yl(t),t.flags&=-16777217):(ml(t),yl(t),gl(t,o)):(e=e.memoizedProps,e!==r&&ml(t),yl(t),hl(t,i,e,r,n)),null;case 27:if(ke(t),n=we.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ml(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return yl(t),t.subtreeFlags&=-33554433,null}e=Se.current,pa(t)?da(t,e):(e=hm(i,r,n),t.stateNode=e,ml(t))}return yl(t),t.subtreeFlags&=-33554433,null;case 5:if(ke(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ml(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return yl(t),t.subtreeFlags&=-33554433,null}if(o=Se.current,pa(t))da(t,o);else{var s=lp(we.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}o[wt]=t,o[Tt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(np(o,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&ml(t)}}return yl(t),t.subtreeFlags&=-33554433,hl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&ml(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=we.current,pa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=aa,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[wt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||ep(e.nodeValue,n)),e||ua(t,!0)}else e=lp(e).createTextNode(r),e[wt]=t,t.stateNode=e}return yl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=pa(t),n!==null){if(e===null){if(!r)throw Error(a(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(557));e[wt]=t}else ma(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;yl(t),e=!1}else n=ha(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Ro(t),t):(Ro(t),null);if(t.flags&128)throw Error(a(558))}return yl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=pa(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(a(317));i[wt]=t}else ma(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;yl(t),i=!1}else i=ha(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Ro(t),t):(Ro(t),null)}return Ro(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),_l(t,t.updateQueue),yl(t),null);case 4:return De(),e===null&&Wf(t.stateNode.containerInfo),t.flags|=67108864,yl(t),null;case 10:return xa(t.type),yl(t),null;case 19:if(Vo(t),r=t.memoizedState,r===null)return yl(t),null;if(i=!!(t.flags&128),o=r.rendering,o===null){if(i)vl(r,!1);else{if(ad!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Ho(e),o!==null){for(t.flags|=128,vl(r,!1),e=o.updateQueue,t.updateQueue=e,_l(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Li(n,e),n=n.sibling;return Bo(t,zo.current&1|2),R&&ea(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&He()>gd&&(t.flags|=128,i=!0,vl(r,!1),t.lanes=4194304)}}else{if(!i){if(e=Ho(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,_l(t,e),vl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!R)return yl(t),null}else 2*He()-r.renderingStartTime>gd&&n!==536870912&&(t.flags|=128,i=!0,vl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=He(),e.sibling=null,o=zo.current,o=i?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||R?Bo(t,o):(n=o,xe(Mo,t),xe(zo,n),No===null&&(No=t)),R&&ea(t,r.treeForkCount),e}return yl(t),null;case 22:case 23:return Ro(t),jo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(yl(t),t.subtreeFlags&6&&(t.flags|=8192)):yl(t),n=t.updateQueue,n!==null&&_l(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&I(Ka),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),xa(Na),yl(t),null;case 25:return null;case 30:return t.flags|=33554432,yl(t),null}throw Error(a(156,t.tag))}function xl(e,t){switch(ra(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xa(Na),De(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ke(t),null;case 31:if(t.memoizedState!==null){if(Ro(t),t.alternate===null)throw Error(a(340));ma()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ro(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));ma()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Vo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return De(),null;case 10:return xa(t.type),null;case 22:case 23:return Ro(t),jo(),e!==null&&I(Ka),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return xa(Na),null;case 25:return null;default:return null}}function Sl(e,t){switch(ra(t),t.tag){case 3:xa(Na),De();break;case 26:case 27:case 5:ke(t);break;case 4:De();break;case 31:t.memoizedState!==null&&Ro(t);break;case 13:Ro(t);break;case 19:Vo(t);break;case 10:xa(t.type);break;case 22:case 23:Ro(t),jo(),e!==null&&I(Ka);break;case 24:xa(Na)}}function Cl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Z(t,t.return,e)}}function wl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Z(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Z(t,t.return,e)}}function Tl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Eo(t,n)}catch(t){Z(e,e.return,t)}}}function El(e,t,n){n.props=wc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Z(e,t,n)}}function Dl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=yi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Pp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Fp(e);p(e.child,!1,Qp,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Z(e,t,n)}}function Ol(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Z(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Z(e,t,n)}else n.current=null}}function kl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)em(e.stateNode,t[n])}function Al(e){for(var t=e.return;t!==null&&(Nl(t)&&em(e.stateNode,t.stateNode),!Ml(t));)t=t.return}function jl(e){for(var t=e.return;t!==null&&(Nl(t)&&tm(e.stateNode,t.stateNode),!Ml(t));)t=t.return}function Ml(e){return e.tag===5||e.tag===3||e.tag===27}function Nl(e){return e&&e.tag===7&&e.stateNode!==null}function Pl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Z(e,e.return,t)}}function Fl(e,t,n){try{var r=e.stateNode;ip(r,e.type,n,t),r[Tt]=t}catch(t){Z(e,e.return,t)}}function Il(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Sp(e.type)||e.tag===4}function Ll(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Il(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Sp(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Rl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=bn)),kl(e,r),L=!0;else if(i!==4&&(i===27&&(kl(e,r),r=null,Sp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Rl(e,t,n,r),e=e.sibling;e!==null;)Rl(e,t,n,r),e=e.sibling}function zl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),kl(e,r),L=!0;else if(i!==4&&(i===27&&(kl(e,r),r=null,Sp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(zl(e,t,n,r),e=e.sibling;e!==null;)zl(e,t,n,r),e=e.sibling}function Bl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);np(t,r,n),t[wt]=e,t[Tt]=n}catch(t){Z(e,e.return,t)}}var Vl=!1,Hl=null;function Ul(e){(e.tag===30||e.subtreeFlags&33554432)&&(Vl=!0)}var Wl=null;function Gl(){var e=Wl;return Wl=null,e}var Kl=0;function ql(e,t,n,r,i){return Kl=0,Jl(e.child,t,n,r,i)}function Jl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Op(o);r.push(s),s.view&&(a=!0)}else a||Op(o).view&&(a=!0);Vl=!0,Tp(o,Kl===0?t:t+`_`+Kl,n),Kl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Jl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Yl(e,t){for(;e!==null;)e.tag===5?Ep(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Yl(e.child,t)),e=e.sibling}function Xl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Xl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(a(544));var n=t.name;t=xi(t.default,t.share),t!==`none`&&(ql(e,n,t,null,!1)||Yl(e.child,!1))}e=e.sibling}}function Zl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=yi(r,n),a=xi(r.default,n.paired?r.share:r.enter);a===`none`?Xl(e):ql(e,i,a,null,!1)?(Xl(e),n.paired||t||Nd(e,r.onEnter)):Yl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Zl(e,t),e=e.sibling;else Xl(e)}function Ql(e){if(Hl!==null&&Hl.size!==0){var t=Hl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=xi(n.default,n.share);if(a!==`none`&&(ql(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Nd(e,n.onShare)):Yl(e.child,!1)),t.delete(r),t.size===0)break}}}Ql(e)}e=e.sibling}}}function $l(e){if(e.tag===30){var t=e.memoizedProps,n=yi(t,e.stateNode),r=Hl===null?void 0:Hl.get(n),i=xi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(ql(e,n,i,null,!1)?r===void 0?Nd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Hl.delete(n),Nd(e,t.onShare)):Yl(e.child,!1)),Hl!==null&&Ql(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)$l(e),e=e.sibling;else Hl!==null&&Ql(e)}function eu(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=yi(t,e.stateNode);t=xi(t.default,t.update),e.flags&=-5,t!==`none`&&ql(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&eu(e);e=e.sibling}}function tu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Yl(e.child,!1))}tu(e)}e=e.sibling}}function nu(e){if(e.tag===30)e.stateNode.paired=null,Yl(e.child,!1),tu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)nu(e),e=e.sibling;else tu(e)}function ru(e){for(e=e.child;e!==null;)e.tag===30?Yl(e.child,!1):e.subtreeFlags&33554432&&ru(e),e=e.sibling}function iu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Kl<a.length){var l=a[Kl],u=Op(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Tp(c,Kl===0?n:n+`_`+Kl,i),s&&e.flags&4||(Wl===null&&(Wl=[]),Wl.push(c,Kl===0?r:r+`_`+Kl,t.memoizedProps)),Kl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:iu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function au(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=yi(n,r),a=xi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(kp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Kl=0,i=iu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Nd(e,n.onUpdate))}else e.subtreeFlags&33554432&&au(e,t);e=e.sibling}}var ou=!1,U=!1,su=!1,cu=!1,lu=typeof WeakSet==`function`?WeakSet:Set,uu=null,du=!1,fu=!1,pu=!1,mu=!1;function hu(e,t,n){if(e=e.containerInfo,sp=gh,e=Yr(e),Xr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(cp={focusedElem:e,selectionRange:r},gh=!1,n=(n&335544064)===n,uu=t,t=n?9270:1024;uu!==null;){if(e=uu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&$l(r[a]);if(e.alternate===null&&e.flags&2)n&&Ul(e),gu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&$l(r),gu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Ul(e),gu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,uu=r):(n&&eu(e),gu(n))}}Hl=null}function gu(e){for(;uu!==null;){var t=uu,n=e,r=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(i&1024&&r!==null){n=void 0,i=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=wc(t.type,i);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){Z(t,t.return,e)}}break;case 3:if(i&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)nm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:nm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=yi(r.memoizedProps,r.stateNode),i=t.memoizedProps,i=xi(i.default,i.update),i!==`none`&&ql(r,n,i,r.memoizedState=[],!0));break;default:if(i&1024)throw Error(a(163))}if(r=t.sibling,r!==null){r.return=t.return,uu=r;break}uu=t.return}}function _u(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Lu(e,n),r&4&&Cl(5,n);break;case 1:if(Lu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Z(n,n.return,e)}else{var i=wc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Z(n,n.return,e)}}}r&64&&Tl(n),r&512&&Dl(n,n.return);break;case 3:if(Lu(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Eo(e,t)}catch(e){Z(n,n.return,e)}}break;case 27:t===null&&r&4&&Bl(n);case 26:case 5:Lu(e,n),t===null&&r&4&&Pl(n),r&512&&Dl(n,n.return);break;case 12:Lu(e,n);break;case 31:Lu(e,n),r&4&&Eu(e,n);break;case 13:Lu(e,n),r&4&&Du(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=_f.bind(null,n),cm(e,n))));break;case 22:if(r=n.memoizedState!==null||ou,!r){var a=t!==null&&t.memoizedState!==null||U;t=ou,i=U,ou=r,(U=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),zu(e,n,r)):Lu(e,n),ou=t,U=i}break;case 30:Lu(e,n),r&512&&Dl(n,n.return);break;case 7:r&512&&Dl(n,n.return);default:Lu(e,n)}}function vu(e,t){for(e=e.child;e!==null;)yu(e,t),e=e.sibling}function yu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){Z(e,e.return,t)}bu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,L=!0}catch(t){Z(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?wp(s,!0):wp(e.stateNode,!1)}catch(t){Z(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&vu(e,t);break;default:vu(e,t)}}function bu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:yu(n,r);break a;case 22:n.memoizedState===null&&bu(n,r);break a;default:bu(n,r)}}e=e.sibling}}function xu(e){var t=e.alternate;t!==null&&(e.alternate=null,xu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Nt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Su=null,Cu=!1;function wu(e,t,n){for(n=n.child;n!==null;)Tu(e,t,n),n=n.sibling}function Tu(e,t,n){if(Qe&&typeof Qe.onCommitFiberUnmount==`function`)try{Qe.onCommitFiberUnmount(Ze,n)}catch{}switch(n.tag){case 26:U||Ol(n,t),wu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!U&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:U||Ol(n,t),jl(n);var r=Su,i=Cu;Sp(n.type)&&(Su=n.stateNode,Cu=!1),wu(e,t,n),gm(n.stateNode,n.type,n.memoizedProps),Su=r,Cu=i;break;case 5:U||Ol(n,t),jl(n);case 6:if(n.tag===6&&jl(n),r=Su,i=Cu,Su=null,wu(e,t,n),Su=r,Cu=i,Su!==null){if(Cu)try{(Su.nodeType===9?Su.body:Su.nodeName===`HTML`?Su.ownerDocument.body:Su).removeChild(n.stateNode),L=!0}catch(e){Z(n,t,e)}else try{Su.removeChild(n.stateNode),L=!0}catch(e){Z(n,t,e)}}break;case 18:Su!==null&&(Cu?(e=Su,Cp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hh(e)):Cp(Su,n.stateNode));break;case 4:r=Su,i=Cu,Su=n.stateNode.containerInfo,Cu=!0,wu(e,t,n),Su=r,Cu=i;break;case 0:case 11:case 14:case 15:wl(2,n,t),U||wl(4,n,t),wu(e,t,n);break;case 1:U||(Ol(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&El(n,t,r)),wu(e,t,n);break;case 21:wu(e,t,n);break;case 22:U=(r=U)||n.memoizedState!==null,wu(e,t,n),U=r;break;case 30:Ol(n,t),wu(e,t,n);break;case 7:U||Ol(n,t),wu(e,t,n);break;default:wu(e,t,n)}}function Eu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hh(e)}catch(e){Z(t,t.return,e)}}}function Du(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hh(e)}catch(e){Z(t,t.return,e)}}function Ou(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new lu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new lu),t;default:throw Error(a(435,e.tag))}}function ku(e,t){var n=Ou(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=vf.bind(null,e,t);t.then(r,r)}})}function Au(e,t,n){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var o=r[i],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Sp(l.type)){Su=l.stateNode,Cu=!1;break a}break;case 5:Su=l.stateNode,Cu=!1;break a;case 3:case 4:Su=l.stateNode.containerInfo,Cu=!0;break a}l=l.return}if(Su===null)throw Error(a(160));Tu(s,c,o),Su=null,Cu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Mu(t,e,n),t=t.sibling}var ju=null;function Mu(e,t,n){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(i&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Au(t,e,n),Nu(e),i&4&&(wl(3,e,e.return),Cl(3,e),wl(5,e,e.return));break;case 1:Au(t,e,n),Nu(e),i&512&&(U||r===null||Ol(r,r.return)),i&64&&ou&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=ju,Au(t,e,n),Nu(e),i&512&&(U||r===null||Ol(r,r.return)),i&4){if(i=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(ou)e.stateNode=fp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,i=o.ownerDocument||o;b:switch(t){case`title`:r=i.getElementsByTagName(`title`)[0],(!r||r[jt]||r[wt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=i.createElement(t),i.head.insertBefore(r,i.querySelector(`head > title`))),np(r,t,n),r[wt]=e,Rt(r),t=r;break a;case`link`:if(o=Gm(`link`,`href`,i).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=i.createElement(t),np(r,t,n),i.head.appendChild(r);break;case`meta`:if(o=Gm(`meta`,`content`,i).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=i.createElement(t),np(r,t,n),i.head.appendChild(r);break;default:throw Error(a(468,t))}r[wt]=e,Rt(r),t=r}e.stateNode=t}}else ou||Km(o,e.type,e.stateNode)}else e.stateNode=Bm(o,n,e.memoizedProps)}else i===n?n===null&&e.stateNode!==null&&Fl(e,e.memoizedProps,r.memoizedProps):(i===null?(t=r.stateNode,t===null||U||t.parentNode.removeChild(t)):i.count--,n===null?ou||Km(o,e.type,e.stateNode):Bm(o,n,e.memoizedProps))}break;case 27:Au(t,e,n),Nu(e),i&512&&(U||r===null||Ol(r,r.return)),r!==null&&i&4&&Fl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=su,su=!1,Au(t,e,n),su=o,Nu(e),i&512&&(U||r===null||Ol(r,r.return)),e.flags&32){t=e.stateNode;try{fn(t,``),L=!0}catch(t){Z(e,e.return,t)}}i&4&&e.stateNode!=null&&(t=e.memoizedProps,Fl(e,t,r===null?t:r.memoizedProps)),i&1024&&(cu=!0);break;case 6:if(Au(t,e,n),Nu(e),i&4){if(e.stateNode===null)throw Error(a(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,L=!0}catch(t){Z(e,e.return,t)}}break;case 3:if(L=!1,Wm=null,o=ju,ju=bm(t.containerInfo),Au(t,e,n),ju=o,Nu(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Hh(t.containerInfo)}catch(t){Z(e,e.return,t)}cu&&(cu=!1,Pu(e)),L=!1;break;case 4:i=su,su=ou,r=Jt(),o=ju,ju=bm(e.stateNode.containerInfo),Au(t,e,n),Nu(e),ju=o,L&&fu&&(pu=!0),L=r,su=i;break;case 12:Au(t,e,n),Nu(e);break;case 31:Au(t,e,n),Nu(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ku(e,t)));break;case 13:Au(t,e,n),Nu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(md=He()),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ku(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=ou,l=U,u=su;ou=c||o,su=u||o,U=l||s,Au(t,e,n),U=l,su=u,ou=c,Nu(e),i&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||ou||U||(t=s||U,n=ou,r=U,ou=o||ou,U=t,Ru(e,2),ou=n,U=r),!o&&su||vu(e,o)),i&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,ku(e,n))));break;case 19:Au(t,e,n),Nu(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ku(e,t)));break;case 30:i&512&&(U||r===null||Ol(r,r.return)),i=Jt(),o=fu,s=(n&335544064)===n,c=e.memoizedProps,fu=s&&xi(c.default,c.update)!==`none`,Au(t,e,n),Nu(e),s&&r!==null&&L&&(e.flags|=4),fu=o,L=i;break;case 21:break;case 7:i&512&&(U||r===null||Ol(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Au(t,e,n),Nu(e)}}function Nu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Il(r)){n=r;break}r=r.return}r=null;for(var i=e.return;i!==null;){if(Nl(i)){var o=i.stateNode;r===null?r=[o]:r.push(o)}if(Ml(i))break;i=i.return}var s=r;if(n==null)throw Error(a(160));switch(n.tag){case 27:var c=n.stateNode;zl(e,Ll(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(fn(l,``),n.flags&=-33),zl(e,Ll(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Rl(e,Ll(e),u,s);break;default:throw Error(a(161))}}catch(t){Z(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Pu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Pu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,gh=!0,t.reset(),gh=!1),e=e.sibling}}function Fu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Iu(t,e),t=t.sibling;else au(t,!1)}function Iu(e,t){var n=e.alternate;if(n===null)Zl(e,!1);else switch(e.tag){case 3:if(mu=du=!1,Gl(),Fu(t,e),!du&&!pu){if(e=Wl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ep(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),mu=!0}Wl=null;break;case 5:Fu(t,e);break;case 4:r=du,du=!1,Fu(t,e),du&&(pu=!0),du=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Fu(t,e):Zl(e,!1));break;case 30:r=du,i=Gl(),du=!1,Fu(t,e),du&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=yi(a,o),o=yi(n.memoizedProps,o);var s=xi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Kl=0,t=iu(e,n,t,o,s,a,!0),Kl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Nd(e,e.memoizedProps.onUpdate),Wl=i):i!==null&&(i.push.apply(i,Wl),Wl=i),du=e.flags&32?!0:r;break;default:Fu(t,e)}}function Lu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)_u(e,t.alternate,t),t=t.sibling}function Ru(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:wl(4,n,n.return),Ru(n,r);break;case 1:Ol(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&El(n,n.return,i),Ru(n,r);break;case 27:r&2&&gm(n.stateNode,n.type,n.memoizedProps);case 5:Ol(n,n.return),n.tag!==5&&n.tag!==27||jl(n),Ru(n,r);break;case 6:jl(n);break;case 26:Ol(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||U||i.parentNode.removeChild(i),Ru(n,r);break;case 22:n.memoizedState===null&&Ru(n,r);break;case 30:Ol(n,n.return),Ru(n,r);break;case 7:Ol(n,n.return);default:Ru(n,r)}e=e.sibling}}function zu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:zu(i,a,n),Cl(4,a);break;case 1:if(zu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Z(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)To(l[i],c)}catch(e){Z(r,r.return,e)}}s&&o&64&&Tl(a),Dl(a,a.return);break;case 27:n&2&&Bl(a);case 5:a.tag!==5&&a.tag!==27||Al(a),zu(i,a,n),s&&r===null&&o&4&&Pl(a),Dl(a,a.return);break;case 6:Al(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||ou||Km(bm(c.ownerDocument),a.type,c),zu(i,a,n),s&&r===null&&o&4&&Pl(a),Dl(a,a.return);break;case 12:zu(i,a,n);break;case 31:zu(i,a,n),s&&o&4&&Eu(i,a);break;case 13:zu(i,a,n),s&&o&4&&Du(i,a);break;case 22:a.memoizedState===null&&zu(i,a,n),Dl(a,a.return);break;case 30:zu(i,a,n),Dl(a,a.return);break;case 7:Dl(a,a.return);default:zu(i,a,n)}t=t.sibling}}function Bu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Fa(n))}function Vu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Fa(e))}function Hu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Uu(e,t,n,r),t=t.sibling;else i&&ru(t)}function Uu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&nu(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Hu(e,t,n,r),a&2048&&Cl(9,t);break;case 1:Hu(e,t,n,r);break;case 3:Hu(e,t,n,r),i&&mu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Fa(a)));break;case 12:if(a&2048){Hu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){Z(t,t.return,e)}}else Hu(e,t,n,r);break;case 31:Hu(e,t,n,r);break;case 13:Hu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&nu(t),o._visibility&2?Hu(e,t,n,r):(o._visibility|=2,Wu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&nu(s),o._visibility&2?Hu(e,t,n,r):Gu(e,t)),a&2048&&Bu(s,t);break;case 24:Hu(e,t,n,r),a&2048&&Vu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Yl(a.child,!0),Yl(t.child,!0))),Hu(e,t,n,r);break;default:Hu(e,t,n,r)}}function Wu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Wu(a,o,s,c,i),Cl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Wu(a,o,s,c,i)):u._visibility&2?Wu(a,o,s,c,i):Gu(a,o),i&&l&2048&&Bu(o.alternate,o);break;case 24:Wu(a,o,s,c,i),i&&l&2048&&Vu(o.alternate,o);break;default:Wu(a,o,s,c,i)}t=t.sibling}}function Gu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Gu(n,r),i&2048&&Bu(r.alternate,r);break;case 24:Gu(n,r),i&2048&&Vu(r.alternate,r);break;default:Gu(n,r)}t=t.sibling}}var Ku=8192;function W(e,t,n){if(e.subtreeFlags&Ku)for(e=e.child;e!==null;)qu(e,t,n),e=e.sibling}function qu(e,t,n){switch(e.tag){case 26:W(e,t,n),e.flags&Ku&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Zm(n,e)):Qm(n,ju,e.memoizedState,e.memoizedProps));break;case 5:W(e,t,n),e.flags&Ku&&(e=e.stateNode,(t&335544128)===t&&Zm(n,e));break;case 3:case 4:var r=ju;ju=bm(e.stateNode.containerInfo),W(e,t,n),ju=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ku,Ku=16777216,W(e,t,n),Ku=r):W(e,t,n));break;case 30:if((e.flags&Ku)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Hl===null&&(Hl=new Map),Hl.set(r,i)}W(e,t,n);break;default:W(e,t,n)}}function Ju(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Yu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];uu=r,Qu(r,e)}Ju(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Xu(e),e=e.sibling}function Xu(e){switch(e.tag){case 0:case 11:case 15:Yu(e),e.flags&2048&&wl(9,e,e.return);break;case 3:Yu(e);break;case 12:Yu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Zu(e)):Yu(e);break;default:Yu(e)}}function Zu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];uu=r,Qu(r,e)}Ju(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:wl(8,t,t.return),Zu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Zu(t));break;default:Zu(t)}e=e.sibling}}function Qu(e,t){for(;uu!==null;){var n=uu;switch(n.tag){case 0:case 11:case 15:wl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Fa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,uu=r;else a:for(n=e;uu!==null;){r=uu;var i=r.sibling,a=r.return;if(xu(r),r===n){uu=null;break a}if(i!==null){i.return=a,uu=i;break a}uu=a}}}var $u={getCacheForType:function(e){var t=Da(Na),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Da(Na).controller.signal}},ed=typeof WeakMap==`function`?WeakMap:Map,G=0,K=null,q=null,J=0,Y=0,X=null,td=!1,nd=!1,rd=!1,id=0,ad=0,od=0,sd=0,cd=0,ld=0,ud=0,dd=null,fd=null,pd=!1,md=0,hd=0,gd=1/0,_d=null,vd=null,yd=0,bd=null,xd=null,Sd=0,Cd=0,wd=null,Td=null,Ed=null,Dd=null,Od=null,kd=0,Ad=null;function jd(){return G&2&&J!==0?J&-J:N.T===null?xt():Pf()}function Md(){if(ld===0){if(!(J&536870912)||R){var e=at;at<<=1,!(at&3932160)&&(at=262144),ld=e}else ld=536870912}return e=Mo.current,e!==null&&(e.flags|=32),ld}function Nd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Pp(yi(e.memoizedProps,n))),Dd===null&&(Dd=[]),Dd.push(t.bind(null,r))}}function Pd(e,t,n){(e===K&&(Y===2||Y===9)||e.cancelPendingCommit!==null)&&(Vd(e,0),Rd(e,J,ld,!1)),mt(e,n),(!(G&2)||e!==K)&&(e===K&&(!(G&2)&&(sd|=n),ad===4&&Rd(e,J,ld,!1)),Ef(e))}function Fd(e,t,n){if(G&6)throw Error(a(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||lt(e,t),i=r?Yd(e,t):qd(e,t,!0),o=r;do{if(i===0){nd&&!r&&Rd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Ld(n)){i=qd(e,t,!1),o=!1;continue}if(i===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;i=dd;var l=c.current.memoizedState.isDehydrated;if(l&&(Vd(c,s).flags|=256),s=qd(c,s,!1),s!==2&&s!==6){if(rd&&!l){c.errorRecoveryDisabledLanes|=o,sd|=o,i=4;break a}o=fd,fd=i,o!==null&&(fd===null?fd=o:fd.push.apply(fd,o))}i=s}if(o=!1,i!==2)continue}}if(i===1){Vd(e,0),Rd(e,t,0,!0);break}a:{switch(r=e,o=i,o){case 0:case 1:throw Error(a(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Rd(r,t,ld,!td);break a;case 2:fd=null;break;case 3:case 5:break;default:throw Error(a(329))}if((t&62914560)===t&&(i=md+300-He(),10<i)){if(Rd(r,t,ld,!td),ct(r,0,!0)!==0)break a;Sd=t,r.timeoutHandle=gp(Id.bind(null,r,n,fd,_d,pd,t,ld,sd,ud,td,o,`Throttled`,-0,0),i);break a}Id(r,n,fd,_d,pd,t,ld,sd,ud,td,o,null,-0,0)}break}while(1);Ef(e)}function Id(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;if(d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:bn},Hl=null,qu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=nh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?md-He():(a&4194048)===a?hd-He():0,m=eh(d,m),m!==null)){Sd=a,e.cancelPendingCommit=m(nf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Rd(e,a,o,!l);return}nf(e,t,a,n,r,i,o,s,c,l,u,d)}function Ld(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Ur(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Rd(e,t,n,r){t=ut(e,t),t&=~cd,t&=~sd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-et(i),o=1<<a;r[a]=-1,i&=~o}n!==0&>(e,n,t)}function zd(){return G&6?!0:(Df(0,!1),!1)}function Bd(){if(q!==null){if(Y===0)var e=q.return;else e=q,ya=va=null,os(e),oo=null,so=0,e=q;for(;e!==null;)Sl(e.alternate,e),e=e.return;q=null}}function Vd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,_p(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Sd=0,Bd(),K=e,q=n=Ii(e.current,null),J=t,Y=0,X=null,td=!1,nd=lt(e,t),rd=!1,ud=ld=cd=sd=od=ad=0,fd=dd=null,pd=!1,id=ut(e,t),Ei(),n}function Hd(e,t){B=null,N.H=gc,t===Xa||t===Qa?(t=io(),Y=3):t===Za?(t=io(),Y=4):Y=t===Pc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,X=t,q===null&&(ad=1,Oc(e,Wi(t,e.current)))}function Ud(){var e=Mo.current;return e===null?!0:(J&4194048)===J?No===null:(J&62914560)===J||J&536870912?e===No:!1}function Wd(){var e=N.H;return N.H=gc,e===null?gc:e}function Gd(){var e=N.A;return N.A=$u,e}function Kd(){ad=4,td||(J&4194048)!==J&&Mo.current!==null||(nd=!0),!(od&134217727)&&!(sd&134217727)||K===null||Rd(K,J,ld,!1)}function qd(e,t,n){var r=G;G|=2;var i=Wd(),a=Gd();(K!==e||J!==t)&&(_d=null,Vd(e,t)),t=!1;var o=ad;a:do try{if(Y!==0&&q!==null){var s=q,c=X;switch(Y){case 8:Bd(),o=6;break a;case 3:case 2:case 9:case 6:Mo.current===null&&(t=!0);var l=Y;if(Y=0,X=null,$d(e,s,c,l),n&&nd){o=0;break a}break;default:l=Y,Y=0,X=null,$d(e,s,c,l)}}Jd(),o=ad;break}catch(t){Hd(e,t)}while(1);return t&&e.shellSuspendCounter++,ya=va=null,G=r,N.H=i,N.A=a,q===null&&(K=null,J=0,Ei()),o}function Jd(){for(;q!==null;)Zd(q)}function Yd(e,t){var n=G;G|=2;var r=Wd(),i=Gd();K!==e||J!==t?(_d=null,gd=He()+500,Vd(e,t)):nd=lt(e,t);a:do try{if(Y!==0&&q!==null){t=q;var o=X;b:switch(Y){case 1:Y=0,X=null,$d(e,t,o,1);break;case 2:case 9:if(eo(o)){Y=0,X=null,Qd(t);break}t=function(){Y!==2&&Y!==9||K!==e||(Y=7),Ef(e)},o.then(t,t);break a;case 3:Y=7;break a;case 4:Y=5;break a;case 7:eo(o)?(Y=0,X=null,Qd(t)):(Y=0,X=null,$d(e,t,o,7));break;case 5:var s=null;switch(q.tag){case 26:s=q.memoizedState;case 5:case 27:var c=q;if(s?Ym(s):c.stateNode.complete){Y=0,X=null;var l=c.sibling;if(l!==null)q=l;else{var u=c.return;u===null?q=null:(q=u,ef(u))}break b}}Y=0,X=null,$d(e,t,o,5);break;case 6:Y=0,X=null,$d(e,t,o,6);break;case 8:Bd(),ad=6;break a;default:throw Error(a(462))}}Xd();break}catch(t){Hd(e,t)}while(1);return ya=va=null,N.H=r,N.A=i,G=n,q===null?(K=null,J=0,Ei(),ad):0}function Xd(){for(;q!==null&&!Be();)Zd(q)}function Zd(e){var t=pl(e.alternate,e,id);e.memoizedProps=e.pendingProps,t===null?ef(e):q=t}function Qd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Jc(n,t,t.pendingProps,t.type,void 0,J);break;case 11:t=Jc(n,t,t.pendingProps,t.type.render,t.ref,J);break;case 5:os(t);var r=t;r===aa&&(R?(fa(r),r.tag===5&&r.stateNode!=null&&(oa=r.stateNode)):(fa(r),R=!0));default:Sl(n,t),t=q=Li(t,id),t=pl(n,t,id)}e.memoizedProps=e.pendingProps,t===null?ef(e):q=t}function $d(e,t,n,r){ya=va=null,os(t),oo=null,so=0;var i=t.return;try{if(Nc(e,i,t,n,J)){ad=1,Oc(e,Wi(n,e.current)),q=null;return}}catch(t){if(i!==null)throw q=i,t;ad=1,Oc(e,Wi(n,e.current)),q=null;return}t.flags&32768?(R||r===1?e=!0:nd||J&536870912?e=!1:(td=e=!0,(r===2||r===9||r===3||r===6)&&(r=Mo.current,r!==null&&r.tag===13&&(r.flags|=16384))),tf(t,e)):ef(t)}function ef(e){var t=e;do{if(t.flags&32768){tf(t,td);return}e=t.return;var n=bl(t.alternate,t,id);if(n!==null){q=n;return}if(t=t.sibling,t!==null){q=t;return}q=t=e}while(t!==null);ad===0&&(ad=5)}function tf(e,t){do{var n=xl(e.alternate,e);if(n!==null){n.flags&=32767,q=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){q=e;return}q=e=n}while(e!==null);ad=6,q=null}function nf(e,t,n,r,i,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do df();while(yd!==0);if(G&6)throw Error(a(327));if(t!==null){if(t===e.current)throw Error(a(177));e===K&&(q=K=null,J=0),xd=t,bd=e,Sd=n,wd=i,Td=r,rf(e,t,n,s,c,l,f)}}function rf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Cd=s,s|=Ti,ht(e,n,s,r,i,a),Dd=null,(n&335544064)===n?(Od=Ra(e),r=10262):(Od=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,yf(Ke,function(){return ff(),null})):(e.callbackNode=null,e.callbackPriority=0),Vl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=N.T,N.T=null,i=P.p,P.p=2,a=G,G|=4;try{hu(e,t,n)}finally{G=a,P.p=i,N.T=r}}yd=1,Vl?Ed=Mp(o,e.containerInfo,Od,sf,cf,of,lf,ff,af,null,null):(sf(),cf(),lf())}function af(e){if(yd!==0){var t=bd.onRecoverableError;t(e,{componentStack:null})}}function of(){yd===3&&(yd=0,Iu(xd,bd),yd=4)}function sf(){if(yd===1){yd=0;var e=bd,t=xd,n=Sd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=N.T,N.T=null;var i=P.p;P.p=2;var a=G;G|=4;try{fu=pu=!1,Mu(t,e,n),n=cp;var o=Yr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Jr(s.ownerDocument.documentElement,s)){if(c!==null&&Xr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=qr(s,h),v=qr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}gh=!!sp,cp=sp=null}finally{G=a,P.p=i,N.T=r}}e.current=t,yd=2}}function cf(){if(yd===2){yd=0;var e=bd,t=xd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=G;G|=4;try{_u(e,t.alternate,t)}finally{G=i,P.p=r,N.T=n}}yd=3}}function lf(){if(yd===4||yd===3){yd=0;var e=Ed;Ed=null,Ve();var t=bd,n=xd,r=Sd,i=Td,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?yd=5:(yd=0,xd=bd=null,uf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(vd=null),bt(r),n=n.stateNode,Qe&&typeof Qe.onCommitFiberRoot==`function`)try{Qe.onCommitFiberRoot(Ze,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=N.T,a=P.p,P.p=2,N.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{N.T=n,P.p=a}}if(i=Dd,o=Od,Od=null,i!==null&&(Dd=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Sd&3&&df(),Ef(t),a=t.pendingLanes,r&261930&&a&42?t===Ad?kd++:(kd=0,Ad=t):(kd=0,Ad=null),Df(0,!1)}}function uf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Fa(t)))}function df(){return Ed!==null&&(Ed.skipTransition(),Ed=null),sf(),cf(),lf(),ff()}function ff(){if(yd!==5)return!1;var e=bd,t=Cd;Cd=0;var n=bt(Sd),r=N.T,i=P.p;try{P.p=32>n?32:n,N.T=null,n=wd,wd=null;var o=bd,s=Sd;if(yd=0,xd=bd=null,Sd=0,G&6)throw Error(a(331));var c=G;if(G|=4,Xu(o.current),Uu(o,o.current,s,n),G=c,Df(0,!1),Qe&&typeof Qe.onPostCommitFiberRoot==`function`)try{Qe.onPostCommitFiberRoot(Ze,o)}catch{}return!0}finally{P.p=i,N.T=r,uf(e,t)}}function pf(e,t,n){t=Wi(n,t),t=Ac(e.stateNode,t,2),e=yo(e,t,2),e!==null&&(mt(e,2),Ef(e))}function Z(e,t,n){if(e.tag===3)pf(e,e,n);else for(;t!==null;){if(t.tag===3){pf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(vd===null||!vd.has(r))){e=Wi(n,e),n=jc(2),r=yo(t,n,2),r!==null&&(Mc(n,r,t,e),mt(r,2),Ef(r));break}}t=t.return}}function mf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new ed;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(rd=!0,i.add(n),e=hf.bind(null,e,t,n),t.then(e,e))}function hf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,K===e&&(J&n)===n&&(ad===4||ad===3&&(J&62914560)===J&&300>He()-md?G&2?cd|=n:Vd(e,0):cd|=n,ud===J&&(ud=0)),Ef(e)}function gf(e,t){t===0&&(t=ft()),e=ki(e,t),e!==null&&(mt(e,t),Ef(e))}function _f(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),gf(e,n)}function vf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(t),gf(e,n)}function yf(e,t){return Re(e,t)}var bf=null,xf=null,Sf=!1,Cf=!1,wf=!1,Tf=0;function Ef(e){e!==xf&&e.next===null&&(xf===null?bf=xf=e:xf=xf.next=e),Cf=!0,Sf||(Sf=!0,Nf())}function Df(e,t){if(!wf&&Cf){wf=!0;do for(var n=!1,r=bf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-et(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Mf(r,a))}else a=J,a=ct(r,r===K?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||lt(r,a)||(n=!0,Mf(r,a))}r=r.next}while(n);wf=!1}}function Of(){kf()}function kf(){Cf=Sf=!1;var e=0;Tf!==0&&hp()&&(e=Tf);for(var t=He(),n=null,r=bf;r!==null;){var i=r.next,a=Af(r,t);a===0?(r.next=null,n===null?bf=i:n.next=i,i===null&&(xf=n)):(n=r,(e!==0||a&3)&&(Cf=!0)),r=i}yd!==0&&yd!==5||Df(e,!1),Tf!==0&&(Tf=0)}function Af(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-et(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=dt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=K,n=J,n=ct(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Y===2||Y===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&ze(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||lt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&ze(r),bt(n)){case 2:case 8:n=Ge;break;case 32:n=Ke;break;case 268435456:n=Je;break;default:n=Ke}return r=jf.bind(null,e),n=Re(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&ze(r),e.callbackPriority=2,e.callbackNode=null,2}function jf(e,t){if(yd!==0&&yd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(df()&&e.callbackNode!==n)return null;var r=J;return r=ct(e,e===K?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Fd(e,r,t),Af(e,He()),e.callbackNode!=null&&e.callbackNode===n?jf.bind(null,e):null)}function Mf(e,t){if(df())return null;Fd(e,t,!0)}function Nf(){bp(function(){G&6?Re(We,Of):kf()})}function Pf(){if(Tf===0){var e=Va;e===0&&(e=it,it<<=1,!(it&261888)&&(it=256)),Tf=e}return Tf}function Ff(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:yn(e)}function If(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Ff((i[Tt]||null).action),o=r.submitter;o&&(t=(t=o[Tt]||null)?Ff(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Vn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Tf!==0){var e=new FormData(i,o);nc(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),nc(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Lf=0;Lf<gi.length;Lf++){var Rf=gi[Lf];_i(Rf.toLowerCase(),`on`+(Rf[0].toUpperCase()+Rf.slice(1)))}_i(ci,`onAnimationEnd`),_i(li,`onAnimationIteration`),_i(ui,`onAnimationStart`),_i(`dblclick`,`onDoubleClick`),_i(`focusin`,`onFocus`),_i(`focusout`,`onBlur`),_i(di,`onTransitionRun`),_i(fi,`onTransitionStart`),_i(pi,`onTransitionCancel`),_i(mi,`onTransitionEnd`),Ut(`onMouseEnter`,[`mouseout`,`mouseover`]),Ut(`onMouseLeave`,[`mouseout`,`mouseover`]),Ut(`onPointerEnter`,[`pointerout`,`pointerover`]),Ut(`onPointerLeave`,[`pointerout`,`pointerover`]),Ht(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ht(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ht(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ht(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ht(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ht(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var zf=`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(` `),Bf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(zf));function Vf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Si(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Si(e)}i.currentTarget=null,a=c}}}}function Q(e,t){var n=t[Dt];n===void 0&&(n=t[Dt]=new Set);var r=e+`__bubble`;n.has(r)||(Gf(t,e,2,!1),n.add(r))}function Hf(e,t,n){var r=0;t&&(r|=4),Gf(n,e,r,t)}var Uf=`_reactListening`+Math.random().toString(36).slice(2);function Wf(e){if(!e[Uf]){e[Uf]=!0,Bt.forEach(function(t){t!==`selectionchange`&&(Bf.has(t)||Hf(t,!1,e),Hf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Uf]||(t[Uf]=!0,Hf(`selectionchange`,!1,t))}}function Gf(e,t,n,r){switch(Ch(t)){case 2:var i=_h;break;case 8:i=vh;break;default:i=yh}n=i.bind(null,t,n,e),i=void 0,!An||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Kf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var c=r.stateNode.containerInfo;if(c===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;c!==null;){if(o=Pt(c),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=a=o;continue a}c=c.parentNode}}r=r.return}Dn(function(){var r=a,i=Sn(n),o=[];a:{var c=hi.get(e);if(c!==void 0){var l=Vn,u=e;switch(e){case`keypress`:if(In(n)===0)break a;case`keydown`:case`keyup`:l=ar;break;case`focusin`:u=`focus`,l=Xn;break;case`focusout`:u=`blur`,l=Xn;break;case`beforeblur`:case`afterblur`:l=Xn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Jn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Yn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=cr;break;case ci:case li:case ui:l=Zn;break;case mi:l=lr;break;case`scroll`:case`scrollend`:l=Un;break;case`wheel`:l=ur;break;case`copy`:case`cut`:case`paste`:l=Qn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=or;break;case`submit`:l=sr;break;case`toggle`:case`beforetoggle`:l=dr}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=On(m,p),g!=null&&d.push(qf(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),o.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==xn&&(u=n.relatedTarget||n.fromElement)&&(Pt(u)||u[Et]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Pt(l):null,l!==null&&(f=s(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Jn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=or,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:It(c),h=l==null?u:It(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Pt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?w(c,l,Yf):null,c!==null&&Xf(o,u,c,d,!1),l!==null&&f!==null&&Xf(o,f,l,d,!0)))}a:{if(c=r?It(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=jr;else if(Tr(c)){if(Mr)_=Vr;else{_=zr;var v=Rr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&gn(r.elementType)&&(_=jr):_=Br;if(_&&=_(e,r)){Er(o,_,n,i);break a}v&&v(e,c,r)}switch(v=r?It(r):window,e){case`focusin`:(Tr(v)||v.contentEditable===`true`)&&(Qr=v,$r=r,ei=null);break;case`focusout`:ei=$r=Qr=null;break;case`mousedown`:ti=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:ti=!1,ni(o,n,i);break;case`selectionchange`:if(Zr)break;case`keydown`:case`keyup`:ni(o,n,i)}var y;if(pr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else xr?yr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(gr&&n.locale!==`ko`&&(xr||b!==`onCompositionStart`?b===`onCompositionEnd`&&xr&&(y=Fn()):(Mn=i,Nn=`value`in Mn?Mn.value:Mn.textContent,xr=!0)),v=Jf(r,b),0<v.length&&(b=new $n(b,e,null,n,i),o.push({event:b,listeners:v}),y?b.data=y:(y=br(n),y!==null&&(b.data=y)))),(y=hr?Sr(e,n):Cr(e,n))&&(b=Jf(r,`onBeforeInput`),0<b.length&&(v=new $n(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:v,listeners:b}),v.data=y)),If(o,e,r,n,i)}Vf(o,t)})}function qf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Jf(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=On(e,n),i!=null&&r.unshift(qf(e,i,a)),i=On(e,t),i!=null&&r.push(qf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Yf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Xf(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=On(n,a),l!=null&&o.unshift(qf(n,l,c))):i||(l=On(n,a),l!=null&&o.push(qf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Zf=/\r\n?/g,Qf=/\u0000|\uFFFD/g;function $f(e){return(typeof e==`string`?e:``+e).replace(Zf,`
|
||
`).replace(Qf,``)}function ep(e,t){return t=$f(t),$f(e)===t}function $(e,t,n,r,i,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||fn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&fn(e,``+r);else return;break;case`className`:Xt(e,`class`,r);break;case`tabIndex`:Xt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Xt(e,n,r);break;case`style`:hn(e,r,o);return;case`data`:if(t!==`object`){Xt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=yn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`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}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&$(e,t,`name`,i.name,i,null),$(e,t,`formEncType`,i.formEncType,i,null),$(e,t,`formMethod`,i.formMethod,i,null),$(e,t,`formTarget`,i.formTarget,i,null)):($(e,t,`encType`,i.encType,i,null),$(e,t,`method`,i.method,i,null),$(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=yn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=bn);return;case`onScroll`:r!=null&&Q(`scroll`,e);return;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=yn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`: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`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Q(`beforetoggle`,e),Q(`toggle`,e),Yt(e,`popover`,r);break;case`xlinkActuate`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Yt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=_n.get(n)||n,Yt(e,n,r);else return}L=!0}function tp(e,t,n,r,i,o){switch(n){case`style`:hn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)fn(e,r);else if(typeof r==`number`||typeof r==`bigint`)fn(e,``+r);else return;break;case`onScroll`:r!=null&&Q(`scroll`,e);return;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=bn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Vt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),o=n.slice(2,i?n.length-7:void 0),t=e[Tt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,i),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,i);break a}L=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Yt(e,n,r)}return}L=!0}function np(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Q(`error`,e),Q(`load`,e);var r=!1,i=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:$(e,t,o,s,n,null)}}i&&$(e,t,`srcSet`,n.srcSet,n,null),r&&$(e,t,`src`,n.src,n,null);return;case`input`:Q(`invalid`,e);var c=o=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(a(137,t));break;default:$(e,t,r,d,n,null)}}sn(e,o,c,l,u,s,i,!1);return;case`select`:for(i in Q(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:$(e,t,i,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&ln(e,!!r,n,!0):ln(e,!!r,t,!1);return;case`textarea`:for(s in Q(`invalid`,e),o=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(a(91));break;default:$(e,t,s,c,n,null)}dn(e,r,i,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:$(e,t,l,r,n,null)}return;case`dialog`:Q(`beforetoggle`,e),Q(`toggle`,e),Q(`cancel`,e),Q(`close`,e);break;case`iframe`:case`object`:Q(`load`,e);break;case`video`:case`audio`:for(r=0;r<zf.length;r++)Q(zf[r],e);break;case`image`:Q(`error`,e),Q(`load`,e);break;case`details`:Q(`toggle`,e);break;case`embed`:case`source`:case`link`:Q(`error`,e),Q(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:$(e,t,u,r,n,null)}return;default:if(gn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&tp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&$(e,t,c,r,n,null))}var rp={};function ip(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||$(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(L=!0),o=m;break;case`name`:m!==f&&(L=!0),i=m;break;case`checked`:m!==f&&(L=!0),u=m;break;case`defaultChecked`:m!==f&&(L=!0),d=m;break;case`value`:m!==f&&(L=!0),s=m;break;case`defaultValue`:m!==f&&(L=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(a(137,t));break;default:m!==f&&$(e,t,p,m,r,f)}}on(e,s,c,l,u,d,o,i);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||$(e,t,o,null,r,l)}for(i in r)if(o=r[i],l=n[i],r.hasOwnProperty(i)&&(o!=null||l!=null))switch(i){case`value`:o!==l&&(L=!0),p=o;break;case`defaultValue`:o!==l&&(L=!0),c=o;break;case`multiple`:o!==l&&(L=!0),s=o;default:o!==l&&$(e,t,i,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?ln(e,!!n,n?[]:``,!1):ln(e,!!n,t,!0)):ln(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:$(e,t,c,null,r,i)}for(s in r)if(i=r[s],o=n[s],r.hasOwnProperty(s)&&(i!=null||o!=null))switch(s){case`value`:i!==o&&(L=!0),p=i;break;case`defaultValue`:i!==o&&(L=!0),m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(a(91));break;default:i!==o&&$(e,t,s,i,r,o)}un(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:$(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(L=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:$(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&$(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(a(137,t));break;default:$(e,t,u,p,r,m)}return;default:if(gn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&tp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||tp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&$(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||$(e,t,f,p,r,m)}function ap(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function op(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&ap(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&ap(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var sp=null,cp=null;function lp(e){return e.nodeType===9?e:e.ownerDocument}function up(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function dp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function fp(e,t,n,r){return n=lp(n).createElement(e),n[wt]=r,n[Tt]=t,np(n,e,t),Rt(n),n}function pp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var mp=null;function hp(){var e=window.event;return e&&e.type===`popstate`?e!==mp&&(mp=e,!0):(mp=null,!1)}var gp=typeof setTimeout==`function`?setTimeout:void 0,_p=typeof clearTimeout==`function`?clearTimeout:void 0,vp=typeof Promise==`function`?Promise:void 0,yp=typeof requestAnimationFrame==`function`?requestAnimationFrame:gp,bp=typeof queueMicrotask==`function`?queueMicrotask:vp===void 0?gp:function(e){return vp.resolve(null).then(e).catch(xp)};function xp(e){setTimeout(function(){throw e})}function Sp(e){return e===`head`}function Cp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Hh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_m(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_m(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[jt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_m(e.ownerDocument.body)}n=i}while(n);Hh(t)}function wp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Tp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ep(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Dp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Op(e){return Dp(e.getBoundingClientRect(),getComputedStyle(e),e)}function kp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Dp(t,n,e)}function Ap(e){return e.documentElement.clientHeight}function jp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Mp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Ap(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Xm(f),u>$m){s.length=o;break}f=new Promise(jp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Np(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Np.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:T({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Np.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Np.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Pp(e){return{name:e,group:new Np(`group`,e),imagePair:new Np(`image-pair`,e),old:new Np(`old`,e),new:new Np(`new`,e)}}function Fp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Fp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Bp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Rp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),p(this._fragmentFiber.child,!1,Ip,e,s,r)}this._eventListeners=a}};function Ip(e,t,n,r){return v(e).addEventListener(t,n,r),!1}Fp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Bp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Rp(i.optionsOrUseCapture),p(this._fragmentFiber.child,!1,Lp,e,n,i),r.splice(t,1),a!==null&&a()}};function Lp(e,t,n,r){return v(e).removeEventListener(t,n,r),!1}function Rp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function zp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Bp(e,t,n,r){if(e.length===0)return-1;r=zp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&zp(a.optionsOrUseCapture)===r)return i}return-1}Fp.prototype.dispatchEvent=function(e){var t=m(this._fragmentFiber);if(t===null)return!0;t=v(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Fp.prototype.focus=function(e){p(this._fragmentFiber.child,!0,Vp,e,void 0,void 0)};function Vp(e,t){return e.tag!==6&&(e=v(e),pm(e,t))}Fp.prototype.focusLast=function(e){var t=[];p(this._fragmentFiber.child,!0,Hp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Vp(t[n],e);n--);};function Hp(e,t){return t.push(e),!1}Fp.prototype.blur=function(){var e=m(this._fragmentFiber);e!==null&&(e=v(e),e=lp(e).activeElement,e!==null&&p(this._fragmentFiber.child,!1,Up,e,void 0,void 0))};function Up(e,t){return e.tag!==6&&(e=v(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Fp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),p(this._fragmentFiber.child,!1,Wp,e,void 0,void 0)};function Wp(e,t){return e.tag!==6&&(e=v(e),t.observe(e),!1)}Fp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),p(this._fragmentFiber.child,!1,Gp,e,void 0,void 0);for(var n=t=0;n<Kp.length;n++){var r=Kp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Kp[t++]=r}Kp.length=t}};function Gp(e,t){return e.tag!==6&&(e=v(e),t.unobserve(e),!1)}var Kp=[],qp=!1;function Jp(e,t,n){Kp.push({fragmentInstance:e,observer:t,instance:n}),qp||(qp=!0,mm(function(){qp=!1;var e=Kp;Kp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Fp.prototype.getClientRects=function(){var e=[];return p(this._fragmentFiber.child,!1,Yp,e,void 0,void 0),e};function Yp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=v(e),t.push.apply(t,e.getClientRects());return!1}Fp.prototype.getRootNode=function(e){var t=m(this._fragmentFiber);return t===null?this:v(t).getRootNode(e)},Fp.prototype.compareDocumentPosition=function(e){var t=m(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];p(this._fragmentFiber.child,!1,Hp,n,void 0,void 0);var r=v(t);if(n.length===0){if(n=r,h(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=g(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=v(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=v(n[0]),i=v(n[n.length-1]);var a=h(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Xp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Xp(e,t,n,r,i){var a=Pt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=m(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=w(n,a,C),t===null?t=!1:(p(t,!0,x,a,n),a=y,y=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=w(r,a,C),t===null?t=!1:(p(t,!0,S,a,r),a=y,b=y=null,t=a!==null)),t):!1}function Zp(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Fp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(a(566));var t=[];p(this._fragmentFiber.child,!1,Hp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=g(this._fragmentFiber);if(r=n?r[1]||r[0]||m(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=v(r),Zp(e,n);return}if(r=v(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var i=t[r];i.tag===6?(i=v(i),Zp(i,n)):v(i).scrollIntoView(e),r+=n?-1:1}};function Qp(e,t){return e=v(e),$p(e,t),!1}function $p(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function em(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Kp.length;i++){var a=Kp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Kp[r++]=a)}Kp.length=r,n.observe(e)}),$p(e,t))}function tm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Jp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function nm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:nm(n),Nt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[jt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=lm(e.nextSibling),e===null)break}return null}function im(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lm(e.nextSibling),e===null))return null;return e}function am(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lm(e.nextSibling),e===null))return null;return e}function om(e){return e.data===`$?`||e.data===`$~`}function sm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function lm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var um=null;function dm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function fm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function pm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function mm(e){yp(function(){yp(function(t){return e(t)})})}function hm(e,t,n){switch(t=lp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(a(452));return e;case`head`:if(e=t.head,!e)throw Error(a(453));return e;case`body`:if(e=t.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function gm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&$(e,t,r,null,rp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===bn&&(e.onclick=null),Nt(e)}function _m(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Nt(e)}var vm=new Map,ym=new Set;function bm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var xm=P.d;P.d={f:Sm,r:Cm,D:Em,C:Dm,L:Om,m:km,X:jm,S:Am,M:Mm};function Sm(){var e=xm.f(),t=zd();return e||t}function Cm(e){var t=Ft(e);t!==null&&t.tag===5&&t.type===`form`?ic(t):xm.r(e)}var wm=typeof document>`u`?null:document;function Tm(e,t,n){var r=wm;if(r&&typeof t==`string`&&t){var i=an(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),ym.has(i)||(ym.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),np(t,`link`,e),Rt(t),r.head.appendChild(t)))}}function Em(e){xm.D(e),Tm(`dns-prefetch`,e,null)}function Dm(e,t){xm.C(e,t),Tm(`preconnect`,e,t)}function Om(e,t,n){xm.L(e,t,n);var r=wm;if(r&&e&&t){var i=`link[rel="preload"][as="`+an(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+an(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+an(n.imageSizes)+`"]`)):i+=`[href="`+an(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Fm(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);np(o,`link`,e),t===`style`&&(o[Mt]=!0,o.onload=o.onerror=function(){zt(o)}),Rt(o),r.head.appendChild(o)}}}function km(e,t){xm.m(e,t);var n=wm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+an(r)+`"][href="`+an(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!vm.has(a)&&(e=T({rel:`modulepreload`,href:e},t),vm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),np(r,`link`,e),Rt(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=Lt(r).hoistableStyles,a=Pm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Fm(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);Rt(c),np(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jm(e,t){xm.X(e,t);var n=wm;if(n&&e){var r=Lt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=T({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Rt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mm(e,t){xm.M(e,t);var n=wm;if(n&&e){var r=Lt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Rt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t,n,r){var i=(i=we.current)?bm(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Pm(n.href),t=Lt(i).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Pm(n.href);var o=Lt(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(Fm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=vm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vm.set(e,o)),Lm(i,e,o,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Rm(n),t=Lt(i).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Pm(e){return`href="`+an(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Mt]){r.loading=1;return}}else t=e.createElement(`link`),t[Mt]=!0,t.onload=t.onerror=zt.bind(null,t),np(t,`link`,n),Rt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Rm(e){return`[src="`+an(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+an(n.href)+`"]`);if(r)return t.instance=r,Rt(r),r;var i=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Rt(r),np(r,`style`,i),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Pm(n.href);var o=e.querySelector(Fm(i));if(o)return t.state.loading|=4,t.instance=o,Rt(o),o;r=Im(n),(i=vm.get(i))&&Hm(r,i),o=(e.ownerDocument||e).createElement(`link`),Rt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),np(o,`link`,r),t.state.loading|=4,Vm(o,n.precedence,e),t.instance=o;case`script`:return o=Rm(n.src),(i=e.querySelector(zm(o)))?(t.instance=i,Rt(i),i):(r=n,(i=vm.get(o))&&(r=T({},n),Um(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),Rt(i),np(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vm(r,n.precedence,e));return t.instance}function Vm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Hm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wm=null;function Gm(e,t,n){if(Wm===null){var r=new Map,i=Wm=new Map;i.set(n,r)}else i=Wm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[jt]||a[wt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Km(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qm(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Pm(r.href),a=t.querySelector(Fm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Rt(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),Rt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&$m===0&&($m=62500*op());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=new Map,ih.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=nh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var sh={$$typeof:re,Provider:null,Consumer:null,_currentValue:ve,_currentValue2:ve,_threadCount:0};function ch(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,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=pt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pt(0),this.hiddenUpdates=pt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function lh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ch(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Pi(3,null,null,t),e.current=a,a.stateNode=e,t=Pa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},go(a),e}function uh(e){return e?(e=Mi,e):Mi}function dh(e,t,n,r,i,a){i=uh(i),r.context===null?r.context=i:r.pendingContext=i,r=vo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=yo(e,r,t),n!==null&&(Pd(n,e,t),bo(n,e,t))}function fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ph(e,t){fh(e,t),(e=e.alternate)&&fh(e,t)}function mh(e){if(e.tag===13||e.tag===31){var t=ki(e,67108864);t!==null&&Pd(t,e,67108864),ph(e,67108864)}}function hh(e){if(e.tag===13||e.tag===31){var t=jd();t=yt(t);var n=ki(e,t);n!==null&&Pd(n,e,t),ph(e,t)}}var gh=!0;function _h(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=2,yh(e,t,n,r)}finally{P.p=a,N.T=i}}function vh(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=8,yh(e,t,n,r)}finally{P.p=a,N.T=i}}function yh(e,t,n,r){if(gh){var i=bh(r);if(i===null)Kf(e,t,r,xh,n),Mh(e,r);else if(Ph(i,e,t,n,r))r.stopPropagation();else if(Mh(e,r),t&4&&-1<jh.indexOf(e)){for(;i!==null;){var a=Ft(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=st(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-et(o);s.entanglements[1]|=c,o&=~c}Ef(a),!(G&6)&&(gd=He()+500,Df(0,!1))}}break;case 31:case 13:s=ki(a,2),s!==null&&Pd(s,a,2),zd(),ph(a,2)}if(a=bh(r),a===null&&Kf(e,t,r,xh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Kf(e,t,r,null,n)}}function bh(e){return e=Sn(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=Pt(e),e!==null){var t=s(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=c(t),e!==null)return e;e=null}else if(n===31){if(e=l(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return xh=e,null}function Ch(e){switch(e){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`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`fullscreenerror`: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`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ue()){case We:return 2;case Ge:return 8;case Ke:case qe:return 32;case Je:return 268435456;default:return 32}default:return 32}}var wh=!1,Th=null,Eh=null,Dh=null,Oh=new Map,kh=new Map,Ah=[],jh=`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 Mh(e,t){switch(e){case`focusin`:case`focusout`:Th=null;break;case`dragenter`:case`dragleave`:Eh=null;break;case`mouseover`:case`mouseout`:Dh=null;break;case`pointerover`:case`pointerout`:Oh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:kh.delete(t.pointerId)}}function Nh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Ft(t),t!==null&&mh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ph(e,t,n,r,i){switch(t){case`focusin`:return Th=Nh(Th,e,t,n,r,i),!0;case`dragenter`:return Eh=Nh(Eh,e,t,n,r,i),!0;case`mouseover`:return Dh=Nh(Dh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Oh.set(a,Nh(Oh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kh.set(a,Nh(kh.get(a)||null,e,t,n,r,i)),!0}return!1}function Fh(e){var t=Pt(e.target);if(t!==null){var n=s(t);if(n!==null){if(t=n.tag,t===13){if(t=c(n),t!==null){e.blockedOn=t,St(e.priority,function(){hh(n)});return}}else if(t===31){if(t=l(n),t!==null){e.blockedOn=t,St(e.priority,function(){hh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ih(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);xn=r,n.target.dispatchEvent(r),xn=null}else return t=Ft(n),t!==null&&mh(t),e.blockedOn=n,!1;t.shift()}return!0}function Lh(e,t,n){Ih(e)&&n.delete(t)}function Rh(){wh=!1,Th!==null&&Ih(Th)&&(Th=null),Eh!==null&&Ih(Eh)&&(Eh=null),Dh!==null&&Ih(Dh)&&(Dh=null),Oh.forEach(Lh),kh.forEach(Lh)}function zh(e,n){e.blockedOn===n&&(e.blockedOn=null,wh||(wh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Rh)))}var Bh=null;function Vh(e){Bh!==e&&(Bh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bh===e&&(Bh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Sh(r||n)===null)continue;break}var a=Ft(n);a!==null&&(e.splice(t,3),t-=3,nc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Hh(e){function t(t){return zh(t,e)}Th!==null&&zh(Th,e),Eh!==null&&zh(Eh,e),Dh!==null&&zh(Dh,e),Oh.forEach(t),kh.forEach(t);for(var n=0;n<Ah.length;n++){var r=Ah[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ah.length&&(n=Ah[0],n.blockedOn===null);)Fh(n),n.blockedOn===null&&Ah.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[Tt]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Tt]||null)s=o.formAction;else if(Sh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Vh(n)}}}function Uh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Wh(e){this._internalRoot=e}Gh.prototype.render=Wh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var n=t.current;dh(n,jd(),e,t,null,null)},Gh.prototype.unmount=Wh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dh(e.current,2,null,e,null,null),zd(),t[Et]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=xt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ah.length&&t!==0&&t<Ah[n].priority;n++);Ah.splice(n,0,e),n===0&&Fh(e)}};var Kh=r.version;if(Kh!==`19.3.0`)throw Error(a(527,Kh,`19.3.0`));P.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(a(188)):(e=Object.keys(e).join(`,`),Error(a(268,e)));return e=d(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var qh={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:N,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{Ze=Jh.inject(qh),Qe=Jh}catch{}}e.createRoot=function(e,t){if(!o(e))throw Error(a(299));var n=!1,r=``,i=Tc,s=Ec,c=Dc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=lh(e,1,!1,null,null,n,r,null,i,s,c,Uh),e[Et]=t.current,Wf(e),new Wh(t)}})),ce=c(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=se()})),A=r(n(),1),le=ce(),ue=`modulepreload`,de=function(e){return`/`+e},fe={},j=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=de(t,n),t=s(t),t in fe)return;fe[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:ue,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},pe=e=>{throw TypeError(e)},me=(e,t,n)=>t.has(e)||pe(`Cannot `+n),he=(e,t,n)=>(me(e,t,`read from private field`),n?n.call(e):t.get(e)),ge=(e,t,n)=>t.has(e)?pe(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),M=(e,t,n,r)=>(me(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),_e=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,N=/^[\\/]{2}/;function P(e,t){return t+e.replace(/\\/g,`/`)}var ve=`popstate`;function ye(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function be(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return Ce(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:we(t)}return Ee(t,n,null,e)}function F(e,t){if(e===!1||e==null)throw Error(t)}function I(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function xe(){return Math.random().toString(36).substring(2,10)}function Se(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Ce(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?Te(t):t,state:n,key:t&&t.key||r||xe(),mask:i}}function we({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function Te(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Ee(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=ye(e)?e:Ce(h.location,e,t);n&&n(r,e),l=u()+1;let d=Se(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=ye(e)?e:Ce(h.location,e,t);n&&n(r,e),l=u();let i=Se(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return De(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(ve,d),c=e,()=>{i.removeEventListener(ve,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function De(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),F(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:we(t);return i=i.replace(/ $/,`%20`),!n&&N.test(i)&&(i=r+i),new URL(i,r)}var Oe,ke=class{constructor(e){if(ge(this,Oe,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(he(this,Oe).has(e))return he(this,Oe).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){he(this,Oe).set(e,t)}};Oe=new WeakMap;var Ae=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function je(e){return Ae.has(e)}var Me=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`]);function Ne(e){return Me.has(e)}function Pe(e){return e.index===!0}function Fe(e,t,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(F(e.index!==!0||!e.children,`Cannot specify children on an index route`),F(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),Pe(e)){let n={...e,id:s};return r[s]=Ie(n,t(n)),n}{let n={...e,id:s,children:void 0};return r[s]=Ie(n,t(n)),e.children&&(n.children=Fe(e.children,t,o,r,i)),n}})}function Ie(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Le(e,t,n=`/`){return Re(e,t,n,!1)}function Re(e,t,n,r,i){let a=it((typeof t==`string`?Te(t):t).pathname||`/`,n);if(a==null)return null;let o=i??Be(e),s=null,c=rt(a);for(let e=0;s==null&&e<o.length;++e)s=$e(o[e],c,r);return s}function ze(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function Be(e){let t=Ve(e);return Ue(t),t}function Ve(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;F(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=mt([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(F(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),Ve(e.children,t,u,l,o)),(e.path!=null||e.index)&&t.push({path:l,score:Ze(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=nt(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of He(e.path))a(e,t,!0,n)}),t}function He(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=He(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function Ue(e){e.sort((e,t)=>e.score===t.score?Qe(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var We=/^:[\w-]+$/,Ge=3,Ke=2,qe=1,Je=10,Ye=-2,Xe=e=>e===`*`;function Ze(e,t){let n=e.split(`/`),r=n.length;return n.some(Xe)&&(r+=Ye),t&&(r+=Ke),n.filter(e=>!Xe(e)).reduce((e,t)=>e+(We.test(t)?Ge:t===``?qe:Je),r)}function Qe(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function $e(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?tt(u,l,s.matcher,s.compiledParams):et(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=et({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:mt([a,d.pathname]),pathnameBase:gt(mt([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=mt([a,d.pathnameBase]))}return o}function et(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=nt(e.path,e.caseSensitive,e.end);return tt(e,t,n,r)}function tt(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=ht(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=ht(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function nt(e,t=!1,n=!0){I(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function rt(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return I(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function it(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function at({basename:e,pathname:t}){return t===`/`?e:mt([e,t])}var ot=e=>_e.test(e);function st(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?Te(e):e,a;return n?(n=pt(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?ct(n.substring(1),`/`):ct(n,t)):a=t,{pathname:a,search:_t(r),hash:vt(i)}}function ct(e,t){let n=ht(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function lt(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function ut(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function dt(e){let t=ut(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function ft(e,t,n,r=!1){let i;typeof e==`string`?i=Te(e):(i={...e},F(!i.pathname||!i.pathname.includes(`?`),lt(`?`,`pathname`,`search`,i)),F(!i.pathname||!i.pathname.includes(`#`),lt(`#`,`pathname`,`hash`,i)),F(!i.search||!i.search.includes(`#`),lt(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=st(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var pt=e=>e.replace(/[\\/]{2,}/g,`/`),mt=e=>pt(e.join(`/`));function ht(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var gt=e=>ht(e).replace(/^\/*/,`/`),_t=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,vt=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,yt=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],bt=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function xt(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function St(e){return mt(e.map(e=>e.route.path).filter(Boolean))||`/`}var Ct=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function wt(e,t){let n=e;if(typeof n!=`string`||!_e.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Ct)try{let e=new URL(window.location.href),r=N.test(n)?new URL(P(n,e.protocol)):new URL(n),a=it(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{I(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var Tt=Symbol(`Uninstrumented`);function Et(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){let t=Object.keys(n);for(let r of t)e[r]&&n[r].push(e[r])}}));let r={};if(typeof t.lazy==`function`&&n.lazy.length>0){let e=Ot(n.lazy,t.lazy,()=>void 0);e&&(r.lazy=e)}if(typeof t.lazy==`object`){let e=t.lazy;[`middleware`,`loader`,`action`].forEach(t=>{let i=e[t],a=n[`lazy.${t}`];if(typeof i==`function`&&a.length>0){let e=Ot(a,i,()=>void 0);e&&(r.lazy=Object.assign(r.lazy||{},{[t]:e}))}})}return[`loader`,`action`].forEach(e=>{let i=t[e];if(typeof i==`function`&&n[e].length>0){let t=i[Tt]??i,a=Ot(n[e],t,(...e)=>At(e[0]));a&&(e===`loader`&&t.hydrate===!0&&(a.hydrate=!0),a[Tt]=t,r[e]=a)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=e[Tt]??e,r=Ot(n.middleware,t,(...e)=>At(e[0]));return r?(r[Tt]=t,r):e})),r}function Dt(e,t){let n={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){let t=Object.keys(e);for(let r of t)e[r]&&n[r].push(e[r])}})),n.navigate.length>0){let t=e.navigate[Tt]??e.navigate,r=Ot(n.navigate,t,(...t)=>{let[n,r]=t;return{to:typeof n==`number`||typeof n==`string`?n:n?we(n):`.`,...jt(e,r??{})}});r&&(r[Tt]=t,e.navigate=r)}if(n.fetch.length>0){let t=e.fetch[Tt]??e.fetch,r=Ot(n.fetch,t,(...t)=>{let[n,,r,i]=t;return{href:r??`.`,fetcherKey:n,...jt(e,i??{})}});r&&(r[Tt]=t,e.fetch=r)}return e}function Ot(e,t,n){return e.length===0?null:async(...r)=>{let i=await kt(e,n(...r),()=>t(...r),e.length-1);if(i.type===`error`)throw i.value;return i.value}}async function kt(e,t,n,r){let i=e[r],a;if(i){let o,s=async()=>(o?console.error(`You cannot call instrumented handlers more than once`):o=kt(e,t,n,r-1),a=await o,F(a,`Expected a result`),a.type===`error`&&a.value instanceof Error?{status:`error`,error:a.value}:{status:`success`,error:void 0});try{await i(s,t)}catch(e){console.error(`An instrumentation function threw an error:`,e)}o||await s(),await o}else try{a={type:`success`,value:await n()}}catch(e){a={type:`error`,value:e}}return a||{type:`error`,value:Error(`No result assigned in instrumentation chain.`)}}function At(e){let{request:t,context:n,params:r,pattern:i}=e;return{request:Mt(t),params:{...r},pattern:i,context:Nt(n)}}function jt(e,t){return{currentUrl:we(e.state.location),...`formMethod`in t?{formMethod:t.formMethod}:{},...`formEncType`in t?{formEncType:t.formEncType}:{},...`formData`in t?{formData:t.formData}:{},...`body`in t?{body:t.body}:{}}}function Mt(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Nt(e){if(Ft(e)){let t={...e};return Object.freeze(t),t}return{get:t=>e.get(t)}}var Pt=Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function Ft(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join(`\0`)===Pt}var It=new URL(`http://localhost`);function Lt(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),It)}catch{return It}}function Rt(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function zt(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function Bt(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!Rt(i,n),s=!Rt(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!zt(e,i)||!Rt(i,a)))throw Error(`External navigation is not allowed`)}var Vt=[`POST`,`PUT`,`PATCH`,`DELETE`],Ht=new Set(Vt),Ut=[`GET`,...Vt],Wt=new Set(Ut),Gt=new Set([301,302,303,307,308]),Kt=new Set([307,308]),qt={state:`idle`,location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},L={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Jt={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},Yt=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Xt=`remix-router-transitions`,Zt=Symbol(`ResetLoaderData`),Qt,$t,en,tn,nn=class{constructor(e){ge(this,Qt),ge(this,$t),ge(this,en),ge(this,tn),M(this,Qt,e),M(this,$t,Be(e))}get stableRoutes(){return he(this,Qt)}get activeRoutes(){return he(this,en)??he(this,Qt)}get branches(){return he(this,tn)??he(this,$t)}get hasHMRRoutes(){return he(this,en)!=null}setRoutes(e){M(this,Qt,e),M(this,$t,Be(e))}setHmrRoutes(e){M(this,en,e),M(this,tn,Be(e))}commitHmrRoutes(){he(this,en)&&(M(this,Qt,he(this,en)),M(this,$t,he(this,tn)),M(this,en,void 0),M(this,tn,void 0))}};Qt=new WeakMap,$t=new WeakMap,en=new WeakMap,tn=new WeakMap;function rn(e){let t=e.window?e.window:typeof window<`u`?window:void 0,n=t!==void 0&&t.document!==void 0&&t.document.createElement!==void 0;F(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||Yt,a=i;if(e.instrumentations){let t=e.instrumentations;a=e=>({...i(e),...Et(t.map(e=>e.route).filter(Boolean),e)})}let o={},s=new nn(Fe(e.routes,a,void 0,o)),c=e.basename||`/`;c.startsWith(`/`)||(c=`/${c}`);let l=e.dataStrategy||xn,u={...e.future},d=null,f=new Set,p=null,m=null,h=null,g=null,_=e.hydrationData!=null,v=Re(s.activeRoutes,e.history.location,c,!1,s.branches),y=!1,b=null,x,S;if(v==null&&!e.patchRoutesOnNavigation){let t=Kn(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=Gn(s.activeRoutes);x=!0,S=!x,v=n,b={[r.id]:t}}else if(v&&!e.hydrationData&&at(v,s.activeRoutes,e.history.location.pathname).active&&(v=null),!v){x=!1,S=!x,v=[];let t=at(null,s.activeRoutes,e.history.location.pathname);t.active&&t.matches&&(y=!0,v=t.matches)}else if(v.some(e=>e.route.lazy))x=!1,S=!x;else if(!v.some(e=>ln(e.route)))x=!0,S=!x;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=v;if(n){let e=v.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}S=!1,x=!0,r.forEach(e=>{let r=un(e.route,t,n);S||=r.renderFallback,x&&=!r.shouldLoad})}let C,w={historyAction:e.history.action,location:e.history.location,matches:v,initialized:x,renderFallback:S,navigation:qt,restoreScrollPosition:e.hydrationData==null&&null,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||b,fetchers:new Map,blockers:new Map},T=`POP`,E=null,ee=!1,D,O=!1,te=new Map,k=null,ne=!1,re=!1,ie=new Set,ae=new Map,oe=0,se=-1,ce=new Map,A=new Set,le=new Map,ue=new Map,de=new Set,fe=new Map,j,pe=null;function me(){if(d=e.history.listen(({action:t,location:n,delta:r})=>{if(j){j(),j=void 0;return}I(fe.size===0||r!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let i=Qe({currentLocation:w.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{j=e});e.history.go(r*-1),Ze(i,{state:`blocked`,location:n,proceed(){Ze(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(w.blockers);e.set(i,Jt),M({blockers:e})}}),E?.resolve(),E=null;return}return ye(t,n)}),n){gr(t,te);let e=()=>_r(t,te);t.addEventListener(`pagehide`,e),k=()=>t.removeEventListener(`pagehide`,e)}return w.initialized||ye(`POP`,w.location,{initialHydration:!0}),C}function he(){d&&d(),k&&k(),f.clear(),D&&D.abort(),w.fetchers.forEach((e,t)=>Ue(w.fetchers,t)),w.blockers.forEach((e,t)=>Xe(t))}function ge(e){if(f.add(e),p){let{newErrors:t}=p;p=null,e(w,{deletedFetchers:[],newErrors:t,viewTransitionOpts:void 0,flushSync:!1})}return()=>f.delete(e)}function M(e,t={}){e.matches&&=e.matches.map(e=>{let t=o[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}),w={...w,...e};let n=[],r=[];w.fetchers.forEach((e,t)=>{e.state===`idle`&&(de.has(t)?n.push(t):r.push(t))}),de.forEach(e=>{!w.fetchers.has(e)&&!ae.has(e)&&n.push(e)}),f.size===0&&(p={newErrors:e.errors??null}),[...f].forEach(r=>r(w,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),n.forEach(e=>Ue(w.fetchers,e)),r.forEach(e=>w.fetchers.delete(e))}function _e(t,n,{flushSync:r}={}){let i=w.actionData!=null&&w.navigation.formMethod!=null&&sr(w.navigation.formMethod)&&w.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?w.actionData:null;let o=n.loaderData?Hn(w.loaderData,n.loaderData,n.matches||[],n.errors):w.loaderData,c=w.blockers;c.size>0&&(c=new Map(c),c.forEach((e,t)=>c.set(t,Jt)));let l=!ne&&rt(t,n.matches||w.matches),u=ee===!0||w.navigation.formMethod!=null&&sr(w.navigation.formMethod)&&t.state?._isRedirect!==!0;s.commitHmrRoutes(),ne||T===`POP`||(T===`PUSH`?e.history.push(t,t.state):T===`REPLACE`&&e.history.replace(t,t.state));let d;if(T===`POP`){let e=te.get(w.location.pathname);e&&e.has(t.pathname)?d={currentLocation:w.location,nextLocation:t}:te.has(t.pathname)&&(d={currentLocation:t,nextLocation:w.location})}else if(O){let e=te.get(w.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),te.set(w.location.pathname,e)),d={currentLocation:w.location,nextLocation:t}}M({...n,actionData:a,loaderData:o,historyAction:T,location:t,initialized:!0,renderFallback:!1,navigation:qt,revalidation:`idle`,restoreScrollPosition:l,preventScrollReset:u,blockers:c},{viewTransitionOpts:d,flushSync:r===!0}),T=`POP`,ee=!1,O=!1,ne=!1,re=!1,E?.resolve(),E=null,pe?.resolve(),pe=null}async function P(t,n){if(E?.resolve(),E=null,typeof t==`number`){E||=vr();let n=E.promise;return e.history.go(t),n}let{path:r,submission:i,error:a}=sn(!1,on(w.location,w.matches,c,t,n?.fromRouteId,n?.relative),n),o;if(n?.mask){let t=typeof n.mask==`string`?Te(n.mask):{...w.location.mask,...n.mask};if(o={pathname:t.pathname??``,search:t.search??``,hash:t.hash??``},N.test(o.pathname))throw Error(`External navigation is not allowed`);o.pathname.startsWith(`\\`)&&(o.pathname=o.pathname.replace(/^\\+/,`/`)),Bt(typeof n.mask==`string`?n.mask:we(n.mask),we(o),e.history.createURL(`/`),`reject`)}let s=w.location,l=Ce(s,r,n&&n.state,void 0,o);l={...l,...e.history.encodeLocation(l)},Bt(t==null?e.history.createHref(w.location):typeof t==`string`?t:we(t),e.history.createHref(l.mask||l),e.history.createURL(`/`),`reject`);let u=n&&n.replace!=null?n.replace:void 0,d=`PUSH`;u===!0?d=`REPLACE`:u===!1||i!=null&&sr(i.formMethod)&&i.formAction===w.location.pathname+w.location.search&&(d=`REPLACE`);let f=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,p=(n&&n.flushSync)===!0,m=Qe({currentLocation:s,nextLocation:l,historyAction:d});if(m){Ze(m,{state:`blocked`,location:l,proceed(){Ze(m,{state:`proceeding`,proceed:void 0,reset:void 0,location:l}),P(t,n)},reset(){let e=new Map(w.blockers);e.set(m,Jt),M({blockers:e})}});return}await ye(d,l,{submission:i,pendingError:a,preventScrollReset:f,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:p,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate})}function ve(){pe||=vr(),Ie(),M({revalidation:`loading`});let e=pe.promise;return w.navigation.state===`submitting`?e:w.navigation.state===`idle`?(ye(w.historyAction,w.location,{startUninterruptedRevalidation:!0}),e):(ye(T||w.historyAction,w.navigation.location,{overrideNavigation:w.navigation,enableViewTransition:O===!0}),e)}async function ye(t,n,r){D&&D.abort(),D=null,T=t,ne=(r&&r.startUninterruptedRevalidation)===!0,nt(w.location,w.matches),ee=(r&&r.preventScrollReset)===!0,O=(r&&r.enableViewTransition)===!0;let i=s.activeRoutes,a=r?.initialHydration&&w.matches&&w.matches.length>0&&!y?w.matches:Re(i,n,c,!1,s.branches),o=(r&&r.flushSync)===!0;if(a&&w.initialized&&!re&&Yn(w.location,n)&&!(r&&r.submission&&sr(r.submission.formMethod))){_e(n,{matches:a},{flushSync:o});return}let l=at(a,i,n.pathname);if(l.active&&l.matches&&(a=l.matches),!a){let{error:e,notFoundMatches:t,route:r}=$e(n.pathname);_e(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:o});return}let u=r&&r.overrideNavigation?{...r.overrideNavigation,matches:a,historyAction:t}:void 0;D=new AbortController;let d=In(e.history,n,D.signal,r&&r.submission),f=e.getContext?await e.getContext():new ke,p;if(r&&r.pendingError)p=[Wn(a).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&sr(r.submission.formMethod)){let i=await be(d,n,r.submission,a,t,f,l.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:o});if(i.shortCircuited)return;if(i.pendingActionResult){let[e,t]=i.pendingActionResult;if(er(t)&&xt(t.error)&&t.error.status===404){D=null,_e(n,{matches:i.matches,loaderData:{},errors:{[e]:t.error}});return}}a=i.matches||a,p=i.pendingActionResult,u=dr(n,a,t,r.submission),o=!1,l.active=!1,d=In(e.history,d.url,d.signal)}let{shortCircuited:m,matches:h,loaderData:g,errors:_,workingFetchers:v}=await xe(d,n,a,t,f,l.active,u,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,o,p,r&&r.callSiteDefaultShouldRevalidate);m||(D=null,_e(n,{matches:h||a,...Un(p),loaderData:g,errors:_,...v?{fetchers:v}:{}}))}async function be(t,n,i,l,u,d,f,p,m={}){if(Ie(),M({navigation:fr(n,l,u,i)},{flushSync:m.flushSync===!0}),f){let e=await st(l,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Gn(s.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=Wn(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}if(e.matches)l=e.matches;else{let{notFoundMatches:e,error:t,route:r}=$e(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let h,g=lr(l,n);if(!g.route.action&&!g.route.lazy)h={type:`error`,error:Kn(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};else{let e=await Ne(t,n,Dn(a,o,t,n,l,g,p?[]:r,d),d,null);if(h=e[g.route.id],!h){for(let t of l)if(e[t.route.id]){h=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(tr(h)){let n;return n=m&&m.replace!=null?m.replace:Fn(h.response.headers.get(`Location`),new URL(t.url),c,e.history)===w.location.pathname+w.location.search,await Me(t,h,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(er(h)){let e=Wn(l,g.route.id);return(m&&m.replace)!==!0&&(T=`PUSH`),{matches:l,pendingActionResult:[e.route.id,h,g.route.id]}}return{matches:l,pendingActionResult:[g.route.id,h]}}async function xe(t,n,i,l,u,d,f,p,m,h,g,_,v,y){let b=f||dr(n,i,l,p),x=p||m||ur(b),S=!ne&&!g;if(d){if(S){let e=Se(v);M({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await st(i,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Gn(s.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=Wn(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(e.matches)i=e.matches;else{let{error:e,notFoundMatches:t,route:r}=$e(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let C=s.activeRoutes,{dsMatches:T,revalidatingFetchers:E}=cn(t,u,a,o,e.history,w,i,x,n,g?[]:r,g===!0,re,ie,de,le,A,C,c,e.patchRoutesOnNavigation!=null,s.branches,v,y);if(se=++oe,!e.dataStrategy&&!T.some(e=>e.shouldLoad)&&!T.some(e=>e.route.middleware&&e.route.middleware.length>0)&&E.length===0){let e=new Map(w.fetchers),t=qe(e);return _e(n,{matches:i,loaderData:{},errors:v&&er(v[1])?{[v[0]]:v[1].error}:null,...Un(v),...t?{fetchers:e}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=Se(v);t!==void 0&&(e.actionData=t)}E.length>0&&(e.fetchers=Ee(E)),M(e,{flushSync:_})}E.forEach(e=>{Ge(e.key),e.controller&&ae.set(e.key,e.controller)});let ee=()=>E.forEach(e=>Ge(e.key));D&&D.signal.addEventListener(`abort`,ee);let{loaderResults:O,fetcherResults:te}=await Pe(T,E,t,n,u);if(t.signal.aborted)return{shortCircuited:!0};D&&D.signal.removeEventListener(`abort`,ee),E.forEach(e=>ae.delete(e.key));let k=qn(O);if(k)return await Me(t,k.result,!0,{replace:h}),{shortCircuited:!0};if(k=qn(te),k)return A.add(k.key),await Me(t,k.result,!0,{replace:h}),{shortCircuited:!0};let ce=new Map(w.fetchers),{loaderData:ue,errors:fe}=Vn(w,i,O,v,E,te,ce);g&&w.errors&&(fe={...w.errors,...fe});let j=qe(ce),pe=Je(se,ce),me=j||pe||E.length>0;return{matches:i,loaderData:ue,errors:fe,...me?{workingFetchers:ce}:{}}}function Se(e){if(e&&!er(e[1]))return{[e[0]]:e[1].data};if(w.actionData)return Object.keys(w.actionData).length===0?null:w.actionData}function Ee(e){let t=new Map(w.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=pr(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function Oe(t,n,r,i){Ge(t);let a=(i&&i.flushSync)===!0,o=s.activeRoutes,l=on(w.location,w.matches,c,r,n,i?.relative),u=Re(o,l,c,!1,s.branches),d=at(u,o,l);if(d.active&&d.matches&&(u=d.matches),!u){Be(t,n,Kn(404,{pathname:l}),{flushSync:a});return}let{path:f,submission:p,error:m}=sn(!0,l,i);if(m){Be(t,n,m,{flushSync:a});return}let h=e.getContext?await e.getContext():new ke,g=(i&&i.preventScrollReset)===!0;if(p&&sr(p.formMethod)){await Ae(t,n,f,u,h,d.active,a,g,p,i&&i.defaultShouldRevalidate);return}le.set(t,{routeId:n,path:f}),await je(t,n,f,u,h,d.active,a,g,p)}async function Ae(t,n,i,l,u,d,f,p,m,h){Ie(),le.delete(t),Le(t,mr(m,w.fetchers.get(t)),{flushSync:f});let g=new AbortController,_=In(e.history,i,g.signal,m);if(d){let e=await st(l,new URL(_.url).pathname,_.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){Be(t,n,e.error,{flushSync:f});return}if(e.matches)l=e.matches;else{Be(t,n,Kn(404,{pathname:i}),{flushSync:f});return}}let v=lr(l,i);if(!v.route.action&&!v.route.lazy){Be(t,n,Kn(405,{method:m.formMethod,pathname:i,routeId:n}),{flushSync:f});return}ae.set(t,g);let y=oe,b=Dn(a,o,_,i,l,v,r,u),x=await Ne(_,i,b,u,t),S=x[v.route.id];if(!S){for(let e of b)if(x[e.route.id]){S=x[e.route.id];break}}if(_.signal.aborted){ae.get(t)===g&&ae.delete(t);return}if(de.has(t)){if(tr(S)||er(S)){Le(t,hr(void 0));return}}else{if(tr(S)){if(ae.delete(t),se>y){Le(t,hr(void 0));return}return A.add(t),Le(t,pr(m)),Me(_,S,!1,{fetcherSubmission:m,preventScrollReset:p})}if(er(S)){Be(t,n,S.error);return}}let C=w.navigation.location||w.location,E=In(e.history,C,g.signal),ee=s.activeRoutes,O=w.navigation.state===`idle`?w.matches:Re(ee,w.navigation.location,c,!1,s.branches);F(O,`Didn't find any matches after fetcher action`);let te=++oe;ce.set(t,te);let{dsMatches:k,revalidatingFetchers:ne}=cn(E,u,a,o,e.history,w,O,m,C,r,!1,re,ie,de,le,A,ee,c,e.patchRoutesOnNavigation!=null,s.branches,[v.route.id,S],h),ue=pr(m,S.data),fe=new Map(w.fetchers);fe.set(t,ue),ne.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=fe.get(t),r=pr(void 0,n?n.data:void 0);fe.set(t,r),Ge(t),e.controller&&ae.set(t,e.controller)}),M({fetchers:fe});let j=()=>ne.forEach(e=>Ge(e.key));g.signal.addEventListener(`abort`,j);let{loaderResults:pe,fetcherResults:me}=await Pe(k,ne,E,C,u);if(g.signal.aborted)return;g.signal.removeEventListener(`abort`,j),ce.delete(t),ae.delete(t),ne.forEach(e=>ae.delete(e.key));let he=w.fetchers.has(t),ge=e=>{if(!he)return e;let n=new Map(e.fetchers);return n.set(t,hr(S.data)),{...e,fetchers:n}},N=qn(pe);if(N)return w=ge(w),Me(E,N.result,!1,{preventScrollReset:p});if(N=qn(me),N)return A.add(N.key),w=ge(w),Me(E,N.result,!1,{preventScrollReset:p});let P=new Map(w.fetchers);he&&P.set(t,hr(S.data));let{loaderData:ve,errors:ye}=Vn(w,O,pe,void 0,ne,me,P);Je(te,P),w.navigation.state===`loading`&&te>se?(F(T,`Expected pending action`),D&&D.abort(),_e(w.navigation.location,{matches:O,loaderData:ve,errors:ye,fetchers:P})):(M({errors:ye,loaderData:Hn(w.loaderData,ve,O,ye),fetchers:P}),re=!1)}async function je(t,n,i,s,c,l,u,d,f){let p=w.fetchers.get(t);Le(t,pr(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=In(e.history,i,m.signal);if(l){let e=await st(s,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){Be(t,n,e.error,{flushSync:u});return}if(e.matches)s=e.matches;else{Be(t,n,Kn(404,{pathname:i}),{flushSync:u});return}}let g=lr(s,i);ae.set(t,m);let _=oe,v=await Ne(h,i,Dn(a,o,h,i,s,g,r,c),c,t),y=v[g.route.id];if(!y){for(let e of s)if(v[e.route.id]){y=v[e.route.id];break}}if(ae.get(t)===m&&ae.delete(t),!h.signal.aborted){if(de.has(t)){Le(t,hr(void 0));return}if(tr(y)){if(se>_){Le(t,hr(void 0));return}A.add(t),await Me(h,y,!1,{preventScrollReset:d});return}if(er(y)){Be(t,n,y.error);return}Le(t,hr(y.data))}}async function Me(r,i,a,{submission:o,fetcherSubmission:s,preventScrollReset:l,replace:u}={}){a||(E?.resolve(),E=null),i.response.headers.has(`X-Remix-Revalidate`)&&(re=!0);let d=i.response.headers.get(`Location`);F(d,`Expected a Location header on the redirect Response`);let f=d,p=new URL(r.url);d=Fn(d,p,c,e.history),Bt(f,d,p,`allow-explicit`);let m=Ce(w.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(ot(d)){let n=De(t,d,!0);e=n.origin!==t.location.origin||it(n.pathname,c)==null}if(e){u?t.location.replace(d):t.location.assign(d);return}}D=null;let h=u===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:g,formAction:_,formEncType:v}=w.navigation;!o&&!s&&g&&_&&v&&(o=ur(w.navigation));let y=o||s;Kt.has(i.response.status)&&y&&sr(y.formMethod)?await ye(h,m,{submission:{...y,formAction:d},preventScrollReset:l||ee,enableViewTransition:a?O:void 0}):await ye(h,m,{overrideNavigation:dr(m,[],h,o),fetcherSubmission:s,preventScrollReset:l||ee,enableViewTransition:a?O:void 0})}async function Ne(e,t,n,r,i){let a,o={};try{a=await On(l,e,t,n,i,r,!1)}catch(e){return n.filter(e=>e.shouldLoad).forEach(t=>{o[t.route.id]={type:`error`,error:e}}),o}if(e.signal.aborted)return o;if(!sr(e.method))for(let e of n){if(a[e.route.id]?.type===`error`)break;!a.hasOwnProperty(e.route.id)&&!w.loaderData.hasOwnProperty(e.route.id)&&(!w.errors||!w.errors.hasOwnProperty(e.route.id))&&e.shouldCallHandler()&&(a[e.route.id]={type:`error`,result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,r]of Object.entries(a))if($n(r)){let i=r.result;o[t]={type:`redirect`,response:Mn(i,e,t,n,c)}}else o[t]=await jn(r);return o}async function Pe(e,t,n,r,i){let a=Ne(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await Ne(e.request,e.path,e.matches,i,e.key))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:`error`,error:Kn(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function Ie(){re=!0,le.forEach((e,t)=>{ae.has(t)&&ie.add(t),Ge(t)})}function Le(e,t,n={}){let r=new Map(w.fetchers);r.set(e,t),M({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function Be(e,t,n,r={}){let i=Wn(w.matches,t),a=new Map(w.fetchers);Ue(a,e),M({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function Ve(e){return ue.set(e,(ue.get(e)||0)+1),de.has(e)&&de.delete(e),w.fetchers.get(e)||L}function He(e,t){Ge(e,t?.reason),Le(e,hr(null))}function Ue(e,t){let n=w.fetchers.get(t);ae.has(t)&&!(n&&n.state===`loading`&&ce.has(t))&&Ge(t),le.delete(t),ce.delete(t),A.delete(t),de.delete(t),ie.delete(t),e.delete(t)}function We(e){let t=(ue.get(e)||0)-1;t<=0?(ue.delete(e),de.add(e)):ue.set(e,t),M({fetchers:new Map(w.fetchers)})}function Ge(e,t){let n=ae.get(e);n&&(n.abort(t),ae.delete(e))}function Ke(e,t){for(let n of e){let e=t.get(n);F(e,`Expected fetcher: ${n}`);let r=hr(e.data);t.set(n,r)}}function qe(e){let t=[],n=!1;for(let r of A){let i=e.get(r);F(i,`Expected fetcher: ${r}`),i.state===`loading`&&(A.delete(r),t.push(r),n=!0)}return Ke(t,e),n}function Je(e,t){let n=[];for(let[r,i]of ce)if(i<e){let e=t.get(r);F(e,`Expected fetcher: ${r}`),e.state===`loading`&&(Ge(r),ce.delete(r),n.push(r))}return Ke(n,t),n.length>0}function Ye(e,t){let n=w.blockers.get(e)||Jt;return fe.get(e)!==t&&fe.set(e,t),n}function Xe(e){w.blockers.delete(e),fe.delete(e)}function Ze(e,t){let n=w.blockers.get(e)||Jt;F(n.state===`unblocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`proceeding`||n.state===`blocked`&&t.state===`unblocked`||n.state===`proceeding`&&t.state===`unblocked`,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(w.blockers);r.set(e,t),M({blockers:r})}function Qe({currentLocation:e,nextLocation:t,historyAction:n}){if(fe.size===0)return;fe.size>1&&I(!1,`A router only supports one blocker at a time`);let r=Array.from(fe.entries()),[i,a]=r[r.length-1],o=w.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function $e(e){let t=Kn(404,{pathname:e}),n=s.activeRoutes,{matches:r,route:i}=Gn(n);return{notFoundMatches:r,route:i,error:t}}function et(e,t,n){if(m=e,g=t,h=n||null,!_&&w.navigation===qt){_=!0;let e=rt(w.location,w.matches);e!=null&&M({restoreScrollPosition:e})}return()=>{m=null,g=null,h=null}}function tt(e,t){return h&&h(e,t.map(e=>ze(e,w.loaderData)))||e.key}function nt(e,t){if(m&&g){let n=tt(e,t);m[n]=g()}}function rt(e,t){if(m){let n=tt(e,t),r=m[n];if(typeof r==`number`)return r}return null}function at(t,n,r){if(e.patchRoutesOnNavigation){let e=s.branches;if(!t)return{active:!0,matches:Re(n,r,c,!0,e)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:Re(n,r,c,!0,e)}}return{active:!1,matches:null}}async function st(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let l=t;for(;;){let t=o;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:l,fetcherKey:i,patch:(e,n)=>{r.aborted||mn(e,n,s,t,a,!1)}})}catch(e){return{type:`error`,error:e,partialMatches:l}}if(r.aborted)return{type:`aborted`};let u=s.branches,d=Re(s.activeRoutes,n,c,!1,u),f=null;if(d&&(Object.keys(d[0].params).length===0||(f=Re(s.activeRoutes,n,c,!0,u),!(f&&l.length<f.length&&ct(l,f.slice(0,l.length))))))return{type:`success`,matches:d};if(f||=Re(s.activeRoutes,n,c,!0,u),!f||ct(l,f))return{type:`success`,matches:null};l=f}}function ct(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function lt(e){o={},s.setHmrRoutes(Fe(e,a,void 0,o))}function ut(e,t,n=!1){mn(e,t,s,o,a,n),s.hasHMRRoutes||M({})}return C={get basename(){return c},get future(){return u},get state(){return w},get routes(){return s.stableRoutes},get branches(){return s.branches},get manifest(){return o},get window(){return t},initialize:me,subscribe:ge,enableScrollRestoration:et,navigate:P,fetch:Oe,revalidate:ve,createHref:t=>e.history.createHref(t),createURL:t=>e.history.createURL(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Ve,resetFetcher:He,deleteFetcher:We,dispose:he,getBlocker:Ye,deleteBlocker:Xe,patchRoutes:ut,_internalFetchControllers:ae,_internalSetRoutes:lt,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){M(e)}},e.instrumentations&&(C=Dt(C,e.instrumentations.map(e=>e.router).filter(Boolean))),C}function an(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function on(e,t,n,r,i,a){let o,s;if(i){o=[];for(let e of t)if(o.push(e),e.route.id===i){s=e;break}}else o=t,s=t[t.length-1];let c=ft(r||`.`,dt(o),it(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=cr(c.search);if(s.route.index&&!e)c.search=c.search?c.search.replace(/^\?/,`?index&`):`?index`;else if(!s.route.index&&e){let e=new URLSearchParams(c.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();c.search=n?`?${n}`:``}}return n!==`/`&&(c.pathname=at({basename:n,pathname:c.pathname})),we(c)}function sn(e,t,n){if(!n||!an(n))return{path:t};if(n.formMethod&&!or(n.formMethod))return{path:t,error:Kn(405,{method:n.formMethod})};let r=()=>({path:t,error:Kn(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=Jn(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!sr(i))return r();let e=typeof n.body==`string`?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,[t,n])=>`${e}${t}=${n}
|
||
`,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if(n.formEncType===`application/json`){if(!sr(i))return r();try{let e=typeof n.body==`string`?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return r()}}}F(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=Rn(n.formData),s=n.formData;else if(n.body instanceof FormData)o=Rn(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=zn(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=zn(o)}catch{return r()}let c={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(sr(c.formMethod))return{path:t,submission:c};let l=Te(t);return e&&l.search&&cr(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:we(l),submission:c}}function cn(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x){let S=b?er(b[1])?b[1].error:b[1].data:void 0,C=i.createURL(a.location),w=i.createURL(c),T;if(u&&a.errors){let e=Object.keys(a.errors)[0];T=o.findIndex(t=>t.route.id===e)}else if(b&&er(b[1])){let e=b[0];T=o.findIndex(t=>t.route.id===e)-1}let E=b?b[1].statusCode:void 0,ee=E&&E>=400,D={currentUrl:C,currentParams:a.matches[0]?.params||{},nextUrl:w,nextParams:o[0].params,...s,actionResult:S,actionStatus:E},O=St(o),te=o.map((i,o)=>{let{route:s}=i,f=null;if(T!=null&&o>T)f=!1;else if(s.lazy)f=!0;else if(!ln(s))f=!1;else if(u){let{shouldLoad:e}=un(s,a.loaderData,a.errors);f=e}else dn(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return En(n,r,e,c,O,i,l,t,f);let p=!1;typeof x==`boolean`?p=x:ee?p=!1:d||C.pathname+C.search===w.pathname+w.search?p=!0:C.search===w.search?fn(a.matches[o],i)&&(p=!0):p=!0;let m={...D,defaultShouldRevalidate:p},h=pn(i,m);return En(n,r,e,c,O,i,l,t,h,m,x)}),k=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s))return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,b=Re(g,e.path,_??`/`,!1,y);if(!b){if(v&&m)return;k.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let S=lr(b,e.path),C=new AbortController,w=In(i,e.path,C.signal),T=null;if(f.has(s))f.delete(s),T=Dn(n,r,w,e.path,b,S,l,t);else if(m)d&&(T=Dn(n,r,w,e.path,b,S,l,t));else{let i;i=typeof x==`boolean`?x:!ee&&d;let a={...D,defaultShouldRevalidate:i};pn(S,a)&&(T=Dn(n,r,w,e.path,b,S,l,t,a))}T&&k.push({key:s,routeId:e.routeId,path:e.path,matches:T,match:S,request:w,controller:C})}),{dsMatches:te,revalidatingFetchers:k}}function ln(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function un(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!ln(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;if(!r&&i)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader==`function`&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let a=!r&&!i;return{shouldLoad:a,renderFallback:a}}function dn(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function fn(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function pn(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function mn(e,t,n,r,i,a){let o;if(e){let t=r[e];F(t,`No route found to patch children into: routeId = ${e}`),t.children||=[],o=t.children}else o=n.activeRoutes;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>hn(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=Fe(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&c.length>0)for(let e=0;e<c.length;e++){let{existingRoute:t,newRoute:n}=c[e],r=t,[a]=Fe([n],i,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}n.hasHMRRoutes||n.setRoutes([...n.activeRoutes])}function hn(e,t){return`id`in e&&`id`in t&&e.id===t.id?!0:e.index!==t.index||e.path!==t.path||e.caseSensitive!==t.caseSensitive?!1:(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((e,n)=>t.children?.some(t=>hn(e,t)))??!1}var gn=new WeakMap,_n=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(F(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=gn.get(i);o||(o={},gn.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=je(e),n=i[e]!==void 0&&e!==`hasErrorBoundary`;if(t)I(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)I(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();t!=null&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}typeof i.lazy==`object`&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>e===void 0)&&(i.lazy=void 0))})();return o[e]=c,c},vn=new WeakMap;function yn(e,t,n,r,i){let a=n[e.id];if(F(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=vn.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{F(typeof e.lazy==`function`,`No lazy route function found`);let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(r===void 0)continue;let i=Ne(e),o=a[e]!==void 0&&e!==`hasErrorBoundary`;i?I(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?I(!o,`Route "${a.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`):n[e]=r}Object.assign(a,n),Object.assign(a,{...r(a),lazy:void 0})})();return vn.set(a,n),n.catch(()=>{}),{lazyRoutePromise:n,lazyHandlerPromise:n}}let o=Object.keys(e.lazy),s=[],c;for(let a of o){if(i&&i.includes(a))continue;let o=_n({key:a,route:e,manifest:n,mapRouteProperties:r});o&&(s.push(o),a===t&&(c=o))}let l=s.length>0?Promise.all(s).then(()=>{}):void 0;return l?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:l,lazyHandlerPromise:c}}async function bn(e){let t=e.matches.filter(e=>e.shouldLoad),n={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,r)=>{n[t[r].route.id]=e}),n}async function xn(e){return e.matches.some(e=>e.route.middleware)?Sn(e,()=>bn(e)):bn(e)}function Sn(e,t){return Cn(e,t,e=>{if(ar(e))throw e;return e},Zn,n);function n(t,n,r){if(r)return Promise.resolve(Object.assign(r.value,{[n]:{type:`error`,result:t}}));{let{matches:r}=e,i=Wn(r,r[Math.min(Math.max(r.findIndex(e=>e.route.id===n),0),Math.max(r.findIndex(e=>e.shouldCallHandler()),0))].route.id).route.id;return Promise.resolve({[i]:{type:`error`,result:t}})}}}async function Cn(e,t,n,r,i){let{matches:a,...o}=e;return await wn(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function wn(e,t,n,r,i,a,o=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let c=t[o];if(!c)return await n();let[l,u]=c,d,f=async()=>{if(d)throw Error("You may only call `next()` once per middleware");try{return d={value:await wn(e,t,n,r,i,a,o+1)},d.value}catch(e){return d={value:await a(e,l,d)},d.value}};try{let t=await u(e,f),n=t==null?void 0:r(t);return i(n)?n:d?n??d.value:(d={value:await f()},d.value)}catch(e){return await a(e,l,d)}}function Tn(e,t,n,r,i){let a=_n({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=yn(r.route,sr(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function En(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=Tn(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?pn(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?pn(a,{...l,defaultShouldRevalidate:e}):pn(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!sr(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(sr(n.method)||!p)?kn({request:n,path:r,pattern:i,match:a,lazyHandlerPromise:f?.handler,lazyRoutePromise:f?.route,handlerOverride:e,scopedContext:s}):Promise.resolve({type:`data`,result:void 0})}}}function Dn(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?En(e,t,n,r,St(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:Tn(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function On(e,t,n,r,i,a,o){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let s={request:t,url:Ln(t,n),pattern:St(r),params:r[0].params,context:a,matches:r},c=o?()=>{throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=s;return Sn(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},l=await e({...s,fetcherKey:i,runClientMiddleware:c});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return l}async function kn({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=sr(e.method),d=u?`action`:`loader`,f=i=>{let a,c=new Promise((e,t)=>a=t);l=()=>a(),e.signal.addEventListener(`abort`,l);let u=a=>typeof i==`function`?i({request:e,url:Ln(e,t),pattern:n,params:r.params,context:s},...a===void 0?[]:[a]):Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)),f=(async()=>{try{return{type:`data`,result:await(o?o(e=>u(e)):u())}}catch(e){return{type:`error`,result:e}}})();return Promise.race([f,c])};try{let t=u?r.route.action:r.route.loader;if(i||a){if(t){let e,[n]=await Promise.all([f(t).catch(t=>{e=t}),i,a]);if(e!==void 0)throw e;c=n}else{await i;let t=u?r.route.action:r.route.loader;if(t)[c]=await Promise.all([f(t),a]);else if(d===`action`){let t=new URL(e.url),n=t.pathname+t.search;throw Kn(405,{method:e.method,pathname:n,routeId:r.route.id})}else return{type:`data`,result:void 0}}}else if(t)c=await f(t);else{let t=new URL(e.url);throw Kn(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function An(e){let t=e.headers.get(`Content-Type`);return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function jn(e){let{result:t,type:n}=e;if(rr(t)){let e;try{e=await An(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new bt(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?nr(t)?t.data instanceof Error?{type:`error`,error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:Xn(t),statusCode:xt(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:xt(t)?t.status:void 0}:nr(t)?{type:`data`,data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`data`,data:t}}function Mn(e,t,n,r,i){let a=e.headers.get(`Location`);if(F(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!ot(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=on(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var Nn=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Pn(e){try{return Nn.includes(new URL(e).protocol)}catch{return!1}}function Fn(e,t,n,r){if(ot(e)){let r=e,i=N.test(r)?new URL(P(r,t.protocol)):new URL(r);if(Pn(i.toString()))throw Error(`Invalid redirect location`);let a=it(i.pathname,n)!=null;if(i.origin===t.origin&&a)return pt(i.pathname)+i.search+i.hash}try{if(Pn(r.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function In(e,t,n,r){let i=e.createURL(Jn(t)).toString(),a={signal:n};if(r&&sr(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),t===`application/json`?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):a.body=t===`text/plain`?r.text:t===`application/x-www-form-urlencoded`&&r.formData?Rn(r.formData):r.formData}return new Request(i,a)}function Ln(e,t){let n=new URL(e.url),r=typeof t==`string`?Te(t):t;if(n.pathname=r.pathname||`/`,r.search){let e=new URLSearchParams(r.search),t=e.getAll(`index`);e.delete(`index`);for(let n of t.filter(Boolean))e.append(`index`,n);n.search=e.size?`?${e.toString()}`:``}else n.search=``;return n.hash=r.hash||``,n}function Rn(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function zn(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Bn(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&er(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let d=n.route.id,f=t[d];if(F(!tr(f),`Cannot handle redirect results in processLoaderData`),er(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=Wn(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=Zt),c||(c=!0,s=xt(f.error)?f.error.status:500),f.headers&&(l[d]=f.headers)}else a[d]=f.data,f.statusCode&&f.statusCode!==200&&!c&&(s=f.statusCode),f.headers&&(l[d]=f.headers)}),u!==void 0&&n&&(o={[n[0]]:u},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:l}}function Vn(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=Bn(t,n,r);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:n,match:r,controller:i}=t;if(i&&i.signal.aborted)return;let s=a[n];if(F(s,`Did not find corresponding fetcher result`),er(s)){let t=Wn(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if(tr(s))F(!1,`Unhandled fetcher revalidation redirect`);else{let e=hr(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function Hn(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==Zt).reduce((e,[t,n])=>(e[t]=n,e),{});for(let a of n){let n=a.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&a.route.loader&&(i[n]=e[n]),r&&r.hasOwnProperty(n))break}return i}function Un(e){return e?er(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Wn(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.hasErrorBoundary===!0)||e[0]}function Gn(e){let t=e.length===1?e[0]:e.find(e=>e.index||!e.path||e.path===`/`)||{id:`__shim-error-route__`};return{matches:[{params:{},pathname:``,pathnameBase:``,route:t}],route:t}}function Kn(e,{pathname:t,routeId:n,method:r,type:i,message:a}={}){let o=`Unknown Server Error`,s=`Unknown @remix-run/router error`;return e===400?(o=`Bad Request`,r&&t&&n?s=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i===`invalid-body`&&(s=`Unable to encode submission body`)):e===403?(o=`Forbidden`,s=`Route "${n}" does not match URL "${t}"`):e===404?(o=`Not Found`,s=`No route matches URL "${t}"`):e===405&&(o=`Method Not Allowed`,r&&t&&n?s=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(s=`Invalid request method "${r.toUpperCase()}"`)),new bt(e||500,o,Error(s),!0)}function qn(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(tr(r))return{key:n,result:r}}}function Jn(e){return we({...typeof e==`string`?Te(e):e,hash:``})}function Yn(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash||t.hash!==``}function Xn(e){return new bt(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function Zn(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&Qn(t))}function Qn(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function $n(e){return rr(e.result)&&Gt.has(e.result.status)}function er(e){return e.type===`error`}function tr(e){return(e&&e.type)===`redirect`}function nr(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function rr(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function ir(e){return Gt.has(e)}function ar(e){return rr(e)&&ir(e.status)&&e.headers.has(`Location`)}function or(e){return Wt.has(e.toUpperCase())}function sr(e){return Ht.has(e.toUpperCase())}function cr(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function lr(e,t){let n=typeof t==`string`?Te(t).search:t.search;if(e[e.length-1].route.index&&cr(n||``))return e[e.length-1];let r=ut(e);return r[r.length-1]}function ur(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(t&&n&&r){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function dr(e,t,n,r){return r?{state:`loading`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:`loading`,location:e,matches:t,historyAction:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function fr(e,t,n,r){return{state:`submitting`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function pr(e,t){return e?{state:`loading`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:`loading`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function mr(e,t){return{state:`submitting`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function hr(e){return{state:`idle`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function gr(e,t){try{let n=e.sessionStorage.getItem(Xt);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch{}}function _r(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(Xt,JSON.stringify(n))}catch(e){I(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function vr(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch{}},t=async e=>{i(e);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var yr=A.createContext(null);yr.displayName=`DataRouter`;var br=A.createContext(null);br.displayName=`DataRouterState`;var xr=A.createContext(!1);function Sr(){return A.useContext(xr)}var Cr=A.createContext({isTransitioning:!1});Cr.displayName=`ViewTransition`;var wr=A.createContext(new Map);wr.displayName=`Fetchers`;var Tr=A.createContext(null);Tr.displayName=`Await`;var Er=A.createContext(null);Er.displayName=`Navigation`;var Dr=A.createContext(null);Dr.displayName=`Location`;var Or=A.createContext({outlet:null,matches:[],isDataRoute:!1});Or.displayName=`Route`;var kr=A.createContext(null);kr.displayName=`RouteError`;var Ar=`REACT_ROUTER_ERROR`,jr=`REDIRECT`,Mr=`ROUTE_ERROR_RESPONSE`;function Nr(e){if(e.startsWith(`${Ar}:${jr}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Pr(e){if(e.startsWith(`${Ar}:${Mr}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new bt(t.status,t.statusText,t.data)}catch{}}function Fr(e,{relative:t}={}){F(Ir(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=A.useContext(Er),{hash:i,pathname:a,search:o}=Gr(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:mt([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Ir(){return A.useContext(Dr)!=null}function Lr(){return F(Ir(),`useLocation() may be used only in the context of a <Router> component.`),A.useContext(Dr).location}var Rr=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function zr(e){A.useContext(Er).static||A.useLayoutEffect(e)}function Br(){let{isDataRoute:e}=A.useContext(Or);return e?si():Vr()}function Vr(){F(Ir(),`useNavigate() may be used only in the context of a <Router> component.`);let e=A.useContext(yr),{basename:t,navigator:n}=A.useContext(Er),{matches:r}=A.useContext(Or),{pathname:i}=Lr(),a=JSON.stringify(dt(r)),o=A.useRef(!1);return zr(()=>{o.current=!0}),A.useCallback((r,s={})=>{if(I(o.current,Rr),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=ft(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:mt([t,c.pathname])),Bt(typeof r==`string`?r:we(r),n.createHref(c),Lt(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var Hr=A.createContext(null);function Ur(e){let t=A.useContext(Or).outlet;return A.useMemo(()=>t&&A.createElement(Hr.Provider,{value:e},t),[t,e])}function Wr(){let{matches:e}=A.useContext(Or);return e[e.length-1]?.params??{}}function Gr(e,{relative:t}={}){let{matches:n}=A.useContext(Or),{pathname:r}=Lr(),i=JSON.stringify(dt(n));return A.useMemo(()=>ft(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Kr(e,t,n){F(Ir(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=A.useContext(Er),{matches:i}=A.useContext(Or),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;li(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
||
|
||
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=Lr(),d;if(t){let e=typeof t==`string`?Te(t):t;F(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):Le(e,{pathname:p});I(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),I(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=$r(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:mt([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:mt([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?A.createElement(Dr.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function qr(){let e=oi(),t=xt(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=A.createElement(A.Fragment,null,A.createElement(`p`,null,`💿 Hey developer 👋`),A.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,A.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,A.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),A.createElement(A.Fragment,null,A.createElement(`h2`,null,`Unexpected Application Error!`),A.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?A.createElement(`pre`,{style:i},n):null,o)}var Jr=A.createElement(qr,null),Yr=class extends A.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Pr(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:A.createElement(Or.Provider,{value:this.props.routeContext},A.createElement(kr.Provider,{value:e,children:this.props.component}));return this.context?A.createElement(Zr,{error:e},t):t}};Yr.contextType=xr;var Xr=new WeakMap;function Zr({children:e,error:t}){let{basename:n,navigator:r}=A.useContext(Er);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Nr(t.digest);if(e){let i=Xr.get(t);if(i)throw i;let a=wt(e.location,n),o=a.absoluteURL||a.to;if(Bt(e.location,o,Lt(r),`allow-explicit`),Pn(o))throw Error(`Invalid redirect location`);if(Ct&&!Xr.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw Xr.set(t,n),n}}return A.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function Qr({routeContext:e,match:t,children:n}){let r=A.useContext(yr);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),A.createElement(Or.Provider,{value:e},n)}function $r(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);F(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:St(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||Jr,o&&(s<0&&c===0?(li(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?A.createElement(n.route.Component,null):n.route.element?n.route.element:e,A.createElement(Qr,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?A.createElement(Yr,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function ei(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ti(e){let t=A.useContext(yr);return F(t,ei(e)),t}function ni(e){let t=A.useContext(br);return F(t,ei(e)),t}function ri(e){let t=A.useContext(Or);return F(t,ei(e)),t}function ii(e){let t=ri(e),n=t.matches[t.matches.length-1];return F(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function ai(){return ii(`useRouteId`)}function oi(){let e=A.useContext(kr),t=ni(`useRouteError`),n=ii(`useRouteError`);return e===void 0?t.errors?.[n]:e}function si(){let{router:e}=ti(`useNavigate`),t=ii(`useNavigate`),n=A.useRef(!1);return zr(()=>{n.current=!0}),A.useCallback(async(r,i={})=>{I(n.current,Rr),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var ci={};function li(e,t,n){!t&&!ci[e]&&(ci[e]=!0,I(!1,n))}var ui={};function di(e,t){!e&&!ui[t]&&(ui[t]=!0,console.warn(t))}var fi=A.useOptimistic,pi=()=>void 0;function mi(e){return fi?fi(e):[e,pi]}function hi(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&I(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:A.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&I(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:A.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&I(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:A.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var gi=[`HydrateFallback`,`hydrateFallbackElement`],_i=class{constructor(){this.status=`pending`,this.promise=new Promise((e,t)=>{this.resolve=t=>{this.status===`pending`&&(this.status=`resolved`,e(t))},this.reject=e=>{this.status===`pending`&&(this.status=`rejected`,t(e))}})}};function vi({router:e,flushSync:t,onError:n,useTransitions:r}){r=Sr()||r;let[i,a]=A.useState(e.state),[o,s]=mi(i),[c,l]=A.useState(),[u,d]=A.useState({isTransitioning:!1}),[f,p]=A.useState(),[m,h]=A.useState(),[g,_]=A.useState(),v=A.useRef(new Map),y=A.useCallback((i,{deletedFetchers:o,newErrors:c,flushSync:u,viewTransitionOpts:g})=>{c&&n&&Object.values(c).forEach(e=>n(e,{location:i.location,params:i.matches[0]?.params??{},pattern:St(i.matches)})),i.fetchers.forEach((e,t)=>{e.data!==void 0&&v.current.set(t,e.data)}),o.forEach(e=>v.current.delete(e)),di(u===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let y=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition==`function`;if(di(g==null||y,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!g||!y){t&&u?t(()=>a(i)):r===!1?a(i):A.startTransition(()=>{r===!0&&s(e=>yi(e,i)),a(i)});return}if(t&&u){t(()=>{m&&(f?.resolve(),m.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:g.currentLocation,nextLocation:g.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>a(i))});n.finished.finally(()=>{t(()=>{p(void 0),h(void 0),l(void 0),d({isTransitioning:!1})})}),t(()=>h(n));return}m?(f?.resolve(),m.skipTransition(),_({state:i,currentLocation:g.currentLocation,nextLocation:g.nextLocation})):(l(i),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}))},[e.window,t,m,f,r,s,n]);A.useLayoutEffect(()=>e.subscribe(y),[e,y]),A.useEffect(()=>{u.isTransitioning&&!u.flushSync&&p(new _i)},[u]),A.useEffect(()=>{if(f&&c&&e.window){let t=c,n=f.promise,i=e.window.document.startViewTransition(async()=>{r===!1?a(t):A.startTransition(()=>{r===!0&&s(e=>yi(e,t)),a(t)}),await n});i.finished.finally(()=>{p(void 0),h(void 0),l(void 0),d({isTransitioning:!1})}),h(i)}},[c,f,e.window,r,s]),A.useEffect(()=>{f&&c&&o.location.key===c.location.key&&f.resolve()},[f,m,o.location,c]),A.useEffect(()=>{!u.isTransitioning&&g&&(l(g.state),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),_(void 0))},[u.isTransitioning,g]);let b=A.useMemo(()=>({createHref:e.createHref,createURL:e.createURL,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})}),[e]),x=e.basename||`/`,S=A.useMemo(()=>({router:e,navigator:b,static:!1,basename:x,onError:n}),[e,b,x,n]);return A.createElement(A.Fragment,null,A.createElement(yr.Provider,{value:S},A.createElement(br.Provider,{value:o},A.createElement(wr.Provider,{value:v.current},A.createElement(Cr.Provider,{value:u},A.createElement(wi,{basename:x,location:o.location,navigationType:o.historyAction,navigator:b,useTransitions:r},A.createElement(bi,{routes:e.routes,manifest:e.manifest,future:e.future,state:o,isStatic:!1,onError:n})))))),null)}function yi(e,t){return{...e,navigation:t.navigation.state===`idle`?e.navigation:t.navigation,revalidation:t.revalidation===`idle`?e.revalidation:t.revalidation,actionData:t.navigation.state===`submitting`?e.actionData:t.actionData,fetchers:t.fetchers}}var bi=A.memo(xi);function xi({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Kr(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Si({to:e,replace:t,state:n,relative:r}){F(Ir(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i,navigator:a}=A.useContext(Er);I(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:o}=A.useContext(Or),{pathname:s}=Lr(),c=Br(),l=ft(e,dt(o),s,r===`path`);Bt(typeof e==`string`?e:we(e),a.createHref(l),Lt(a),`reject`);let u=JSON.stringify(l);return A.useEffect(()=>{c(JSON.parse(u),{replace:t,state:n,relative:r})},[c,u,r,t,n]),null}function Ci(e){return Ur(e.context)}function wi({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){F(!Ir(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=A.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=Te(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=A.useMemo(()=>{let e=it(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return I(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:A.createElement(Er.Provider,{value:c},A.createElement(Dr.Provider,{children:t,value:h}))}A.Component;var Ti=`get`,Ei=`application/x-www-form-urlencoded`;function Di(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Oi(e){return Di(e)&&e.tagName.toLowerCase()===`button`}function ki(e){return Di(e)&&e.tagName.toLowerCase()===`form`}function Ai(e){return Di(e)&&e.tagName.toLowerCase()===`input`}function ji(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Mi(e,t){return e.button===0&&(!t||t===`_self`)&&!ji(e)}var Ni=null;function Pi(){if(Ni===null)try{new FormData(document.createElement(`form`),0),Ni=!1}catch{Ni=!0}return Ni}var Fi=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Ii(e){return e!=null&&!Fi.has(e)?(I(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ei}"`),null):e}function Li(e,t){let n,r,i,a,o;if(ki(e)){let o=e.getAttribute(`action`);r=o?it(o,t):null,n=e.getAttribute(`method`)||Ti,i=Ii(e.getAttribute(`enctype`))||Ei,a=new FormData(e)}else if(Oi(e)||Ai(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?it(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Ti,i=Ii(e.getAttribute(`formenctype`))||Ii(o.getAttribute(`enctype`))||Ei,a=new FormData(o,e),!Pi()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Di(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Ti,r=null,i=Ei,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function Ri(e,t){if(e===!1||e==null)throw Error(t)}function zi(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return i.pathname=n?i.pathname.endsWith(`/`)?`${i.pathname}_.${r}`:`${i.pathname}.${r}`:i.pathname===`/`?`_root.${r}`:t&&it(i.pathname,t)===`/`?`${ht(t)}/_root.${r}`:`${ht(i.pathname)}.${r}`,i}async function Bi(e,t){if(e.id in t)return t[e.id];try{let n=await j(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Vi(e){return e!=null&&typeof e.page==`string`}function Hi(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Ui(e,t,n){return Ji((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Bi(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Hi).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Wi(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Gi(e,t,{includeHydrateFallback:n}={}){return Ki(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Ki(e){return[...new Set(e)]}function qi(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Ji(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Vi(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(qi(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Yi(){let e=A.useContext(yr);return Ri(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Xi(){let e=A.useContext(br);return Ri(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Zi=A.createContext(void 0);Zi.displayName=`FrameworkContext`;function Qi(){let e=A.useContext(Zi);return Ri(e,`You must render this element inside a <HydratedRouter> element`),e}function $i(e,t){let n=A.useContext(Zi),[r,i]=A.useState(!1),[a,o]=A.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=A.useRef(null);A.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),A.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:ea(s,p),onBlur:ea(c,m),onMouseEnter:ea(l,p),onMouseLeave:ea(u,m),onTouchStart:ea(d,p)}]:[a,f,{}]:[!1,f,{}]}function ea(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function ta({page:e,...t}){let n=Sr(),{nonce:r}=Qi(),{router:i}=Yi(),a=A.useMemo(()=>Le(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?A.createElement(ra,{page:e,matches:a,...t}):A.createElement(ia,{page:e,matches:a,...t})):null}function na(e){let{manifest:t,routeModules:n}=Qi(),[r,i]=A.useState([]);return A.useEffect(()=>{let r=!1;return Ui(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function ra({page:e,matches:t,...n}){let r=Lr(),{future:i}=Qi(),{basename:a}=Yi(),o=A.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=zi(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return A.createElement(A.Fragment,null,o.map(e=>A.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function ia({page:e,matches:t,...n}){let r=Lr(),{future:i,manifest:a,routeModules:o}=Qi(),{basename:s}=Yi(),{loaderData:c,matches:l}=Xi(),u=A.useMemo(()=>Wi(e,t,l,a,r,`data`),[e,t,l,a,r]),d=A.useMemo(()=>Wi(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=A.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];t&&t.hasLoader&&(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=zi(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=A.useMemo(()=>Gi(d,a),[d,a]),m=na(d);return A.createElement(A.Fragment,null,f.map(e=>A.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>A.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>A.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function aa(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}A.Component;var oa=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{oa&&(window.__reactRouterVersion=`7.18.3`)}catch{}function R(e,t){return rn({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:be({window:t?.window}),hydrationData:t?.hydrationData||sa(),routes:e,mapRouteProperties:hi,hydrationRouteProperties:gi,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function sa(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:ca(e.errors)}),e}function ca(e){if(!e)return null;let t=Object.entries(e),n={};for(let[e,r]of t)if(r&&r.__type===`RouteErrorResponse`)n[e]=new bt(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type===`Error`){if(typeof r.__subType==`string`&&yt.includes(r.__subType)){let t=window[r.__subType];if(typeof t==`function`)try{let i=new t(r.message);i.stack=``,n[e]=i}catch{}}if(n[e]==null){let t=Error(r.message);t.stack=``,n[e]=t}}else n[e]=r;return n}var la=A.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=A.useContext(Er),v=typeof l==`string`&&_e.test(l),y=wt(l,h);l=y.to;let b=Fr(l,{relative:r}),x=Lr(),S=null;if(o){let e=ft(o,[],x.mask?x.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:mt([h,e.pathname])),S=g.createHref(e)}let[C,w,T]=$i(n,p),E=ma(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function ee(t){e&&e(t),t.defaultPrevented||E(t)}let D=!(y.isExternal||i),O=A.createElement(`a`,{...p,...T,href:(D?S:void 0)||y.absoluteURL||b,onClick:D?ee:e,ref:aa(m,w),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return C&&!v?A.createElement(A.Fragment,null,O,A.createElement(ta,{page:b})):O});la.displayName=`Link`;var ua=A.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=Gr(a,{relative:c.relative}),d=Lr(),f=A.useContext(br),{navigator:p,basename:m}=A.useContext(Er),h=f!=null&&ya(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=it(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),S={isActive:b,isPending:x,isTransitioning:h},C=b?e:void 0,w;w=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let T=typeof i==`function`?i(S):i;return A.createElement(la,{...c,"aria-current":C,className:w,ref:l,style:T,to:a,viewTransition:o},typeof s==`function`?s(S):s)});ua.displayName=`NavLink`;var da=A.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Ti,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=A.useContext(Er),g=_a(),_=va(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&_e.test(s);return A.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?A.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});da.displayName=`Form`;function fa(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function pa(e){let t=A.useContext(yr);return F(t,fa(e)),t}function ma(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=Br(),d=Lr(),f=Gr(e,{relative:o});return A.useCallback(p=>{if(Mi(p,t)){p.preventDefault();let t=n===void 0?we(d)===we(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?A.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}var ha=0,ga=()=>`__${String(++ha)}__`;function _a(){let{router:e}=pa(`useSubmit`),{basename:t}=A.useContext(Er),n=ai(),r=e.fetch,i=e.navigate;return A.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Li(e,t);if(a.navigate===!1){let e=a.fetcherKey||ga();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function va(e,{relative:t}={}){let{basename:n}=A.useContext(Er),r=A.useContext(Or);F(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Gr(e||`.`,{relative:t})},o=Lr();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:mt([n,a.pathname])),we(a)}function ya(e,{relative:t}={}){let n=A.useContext(Cr);F(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=pa(`useViewTransitionState`),i=Gr(e,{relative:t});if(!n.isTransitioning)return!1;let a=it(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=it(n.nextLocation.pathname,r)||n.nextLocation.pathname;return et(i.pathname,o)!=null||et(i.pathname,a)!=null}var ba=r(oe(),1);function xa(e){return A.createElement(vi,{flushSync:ba.flushSync,...e})}var Sa={restaurant_hall_delivery:{id:`restaurant_hall_delivery`,name:`Ресторан: Зал + Доставка`,label:`Суши & Гёдза (Зал + Доставка)`,category:`Общепит`,companyName:`Суши & Гёдза`,locations:[`Горский 1/1`,`Красный пр-т 186а`],capabilities:{crm:!0,sales:!0,communications:!0,helpdesk:!0,tasks:!0,cms:!0,marketing:!0,analytics:!0,finance:!0,employees:!0,inventory:!0,purchasing:!0,delivery:!0,booking:!0,pos:!0,kds:!0,dining:!0,work_orders:!1,production:!0,automation:!0,ai:!0},operationsTabs:[{id:`overview`,label:`Обзор`,route:`/operations`},{id:`orders`,label:`Заказы`,route:`/operations/orders`,badge:`14`},{id:`pos`,label:`Касса (POS)`,route:`/operations/pos`,requiredCapability:`pos`},{id:`dining`,label:`Зал`,route:`/operations/dining`,requiredCapability:`dining`,badge:`82%`},{id:`kds`,label:`Кухня (KDS)`,route:`/operations/kds`,requiredCapability:`kds`,badge:`6`},{id:`catalog`,label:`Меню`,route:`/operations/catalog`},{id:`recipes`,label:`Техкарты`,route:`/operations/recipes`,requiredCapability:`production`},{id:`inventory`,label:`Склад`,route:`/operations/inventory`,requiredCapability:`inventory`},{id:`purchasing`,label:`Закупки`,route:`/operations/purchasing`,requiredCapability:`purchasing`},{id:`delivery`,label:`Доставка`,route:`/operations/delivery`,requiredCapability:`delivery`,badge:`5`},{id:`booking`,label:`Бронирования`,route:`/operations/booking`,requiredCapability:`booking`}],terminology:{itemLabel:`Блюдо`,itemsLabel:`Меню и напитки`,bookingResourceLabel:`Стол`,orderSourceLabel:`Зал / Доставка / Навынос`,clientIdentifierLabel:`Гость ресторана`},dashboardPreset:{primaryKpis:[`revenue_today`,`orders_count`,`avg_check`,`hall_occupancy`,`food_cost`],quickActionIds:[`new_order`,`book_table`,`create_task`,`new_client`,`new_expense`,`write_off`]}},restaurant_delivery_only:{id:`restaurant_delivery_only`,name:`Ресторан: Только Доставка / Dark Kitchen`,label:`Суши & Гёдза Express (Dark Kitchen)`,category:`Общепит / Dark Kitchen`,companyName:`Суши & Гёдза Express`,locations:[`Красный пр-т 186а (Кухня 1)`],capabilities:{crm:!0,sales:!0,communications:!0,helpdesk:!0,tasks:!0,cms:!0,marketing:!0,analytics:!0,finance:!0,employees:!0,inventory:!0,purchasing:!0,delivery:!0,booking:!1,pos:!0,kds:!0,dining:!1,work_orders:!1,production:!0,automation:!0,ai:!0},operationsTabs:[{id:`overview`,label:`Обзор`,route:`/operations`},{id:`orders`,label:`Заказы`,route:`/operations/orders`,badge:`19`},{id:`pos`,label:`Касса (POS)`,route:`/operations/pos`,requiredCapability:`pos`},{id:`kds`,label:`Кухня (KDS)`,route:`/operations/kds`,requiredCapability:`kds`,badge:`9`},{id:`catalog`,label:`Меню`,route:`/operations/catalog`},{id:`recipes`,label:`Техкарты`,route:`/operations/recipes`,requiredCapability:`production`},{id:`inventory`,label:`Склад`,route:`/operations/inventory`,requiredCapability:`inventory`},{id:`purchasing`,label:`Закупки`,route:`/operations/purchasing`,requiredCapability:`purchasing`},{id:`delivery`,label:`Доставка`,route:`/operations/delivery`,requiredCapability:`delivery`,badge:`12`}],terminology:{itemLabel:`Позиция доставки`,itemsLabel:`Ассортимент Dark Kitchen`,bookingResourceLabel:`Линия сборки`,orderSourceLabel:`Доставка / Агрегаторы`,clientIdentifierLabel:`Получатель заказа`},dashboardPreset:{primaryKpis:[`revenue_today`,`orders_count`,`avg_check`,`delivery_avg_time`,`food_cost`],quickActionIds:[`new_order`,`assign_courier`,`create_task`,`new_client`,`inventory_check`]}},retail:{id:`retail`,name:`Розничная торговля / Retail`,label:`Krona Retail & Store`,category:`Торговля`,companyName:`Krona Concept Store`,locations:[`Флагманский магазин — Ленина 12`,`Островок в ТЦ`],capabilities:{crm:!0,sales:!0,communications:!0,helpdesk:!1,tasks:!0,cms:!0,marketing:!0,analytics:!0,finance:!0,employees:!0,inventory:!0,purchasing:!0,delivery:!1,booking:!1,pos:!0,kds:!1,dining:!1,work_orders:!1,production:!1,automation:!0,ai:!0},operationsTabs:[{id:`overview`,label:`Обзор`,route:`/operations`},{id:`orders`,label:`Продажи`,route:`/operations/orders`,badge:`31`},{id:`pos`,label:`Касса`,route:`/operations/pos`,requiredCapability:`pos`},{id:`catalog`,label:`Товары & Штрихкоды`,route:`/operations/catalog`},{id:`inventory`,label:`Склад & Остатки`,route:`/operations/inventory`,requiredCapability:`inventory`},{id:`purchasing`,label:`Закупки`,route:`/operations/purchasing`,requiredCapability:`purchasing`},{id:`suppliers`,label:`Поставщики`,route:`/operations/purchasing?tab=suppliers`},{id:`audit`,label:`Инвентаризация`,route:`/operations/inventory?tab=audit`},{id:`pricing`,label:`Цены & Скидки`,route:`/operations/catalog?tab=pricing`}],terminology:{itemLabel:`Товар`,itemsLabel:`Товары и SKU`,bookingResourceLabel:`Торговая точка`,orderSourceLabel:`Касса / Интернет-магазин`,clientIdentifierLabel:`Покупатель`},dashboardPreset:{primaryKpis:[`revenue_today`,`orders_count`,`avg_check`,`stock_turnover`,`margin_rate`],quickActionIds:[`pos_sale`,`stock_intake`,`new_client`,`inventory_scan`,`create_task`]}},car_wash:{id:`car_wash`,name:`Автомойка`,label:`Автомойка Крона`,category:`Автоуслуги`,companyName:`Автомойка Крона`,locations:[`Бокс 1-6 — ул. Станционная 42`],capabilities:{crm:!0,sales:!0,communications:!0,helpdesk:!1,tasks:!0,cms:!1,marketing:!0,analytics:!0,finance:!0,employees:!0,inventory:!0,purchasing:!0,delivery:!1,booking:!0,pos:!0,kds:!1,dining:!1,work_orders:!0,production:!1,automation:!0,ai:!0},operationsTabs:[{id:`overview`,label:`Обзор`,route:`/operations`},{id:`booking`,label:`Запись & Очередь`,route:`/operations/booking`,requiredCapability:`booking`,badge:`7`},{id:`work_orders`,label:`Заказ-наряды`,route:`/operations/work-orders`,requiredCapability:`work_orders`,badge:`3`},{id:`vehicles`,label:`Автомобили`,route:`/crm?tab=vehicles`},{id:`pos`,label:`Касса & Оплата`,route:`/operations/pos`,requiredCapability:`pos`},{id:`bays`,label:`Боксы`,route:`/operations/bays`},{id:`catalog`,label:`Услуги & Прайс`,route:`/operations/catalog`},{id:`inventory`,label:`Материалы & Склад`,route:`/operations/inventory`,requiredCapability:`inventory`}],terminology:{itemLabel:`Услуга`,itemsLabel:`Услуги`,bookingResourceLabel:`Бокс`,orderSourceLabel:`Прямой заезд / Запись`,clientIdentifierLabel:`Владелец (Госномер)`},dashboardPreset:{primaryKpis:[`revenue_today`,`bay_load`,`avg_ticket`,`repeat_rate`],quickActionIds:[`new_booking`,`new_vehicle`,`new_payment`,`create_task`]}},beauty_services:{id:`beauty_services`,name:`Салон красоты / Бьюти`,label:`Студия Красоты Крона Эстетик`,category:`Сфера услуг`,companyName:`Студия Красоты Крона`,locations:[`Центр — Советская 25`],capabilities:{crm:!0,sales:!0,communications:!0,helpdesk:!1,tasks:!0,cms:!0,marketing:!0,analytics:!0,finance:!0,employees:!0,inventory:!0,purchasing:!0,delivery:!1,booking:!0,pos:!0,kds:!1,dining:!1,work_orders:!1,production:!1,automation:!0,ai:!0},operationsTabs:[{id:`overview`,label:`Обзор`,route:`/operations`},{id:`booking`,label:`Запись клиентов`,route:`/operations/booking`,requiredCapability:`booking`,badge:`11`},{id:`schedule`,label:`Расписание мастеров`,route:`/employees?tab=schedule`},{id:`pos`,label:`Касса & Визиты`,route:`/operations/pos`,requiredCapability:`pos`},{id:`masters`,label:`Специалисты`,route:`/employees`},{id:`catalog`,label:`Услуги салона`,route:`/operations/catalog`},{id:`resources`,label:`Рабочие места`,route:`/operations/bays`},{id:`inventory`,label:`Расходники`,route:`/operations/inventory`,requiredCapability:`inventory`}],terminology:{itemLabel:`Услуга мастера`,itemsLabel:`Услуги и уходовая косметика`,bookingResourceLabel:`Мастер / Кресло`,orderSourceLabel:`Онлайн-запись / Стойка`,clientIdentifierLabel:`Клиент салона`},dashboardPreset:{primaryKpis:[`revenue_today`,`appointments_today`,`master_load`,`avg_check`,`retention_rate`],quickActionIds:[`new_booking`,`new_client`,`pos_sale`,`chat_message`,`create_task`]}},wholesale_b2b:{id:`wholesale_b2b`,name:`Оптовая торговля / B2B`,label:`Торговый Дом Крона Опт`,category:`Опт & Дистрибуция`,companyName:`Торговый Дом Крона Опт`,locations:[`Центральный распределительный склад — Северный проезд 8`],capabilities:{crm:!0,sales:!0,communications:!0,helpdesk:!0,tasks:!0,cms:!1,marketing:!0,analytics:!0,finance:!0,employees:!0,inventory:!0,purchasing:!0,delivery:!0,booking:!1,pos:!1,kds:!1,dining:!1,work_orders:!1,production:!1,automation:!0,ai:!0},operationsTabs:[{id:`overview`,label:`Обзор`,route:`/operations`},{id:`orders`,label:`B2B Заказы & Спецификации`,route:`/operations/orders`,badge:`18`},{id:`companies`,label:`Компании & Договоры`,route:`/crm?tab=companies`},{id:`inventory`,label:`Оптовый склад & Партии`,route:`/operations/inventory`,requiredCapability:`inventory`},{id:`purchasing`,label:`Контракты & Закупки`,route:`/operations/purchasing`,requiredCapability:`purchasing`},{id:`suppliers`,label:`Поставщики`,route:`/operations/purchasing?tab=suppliers`},{id:`documents`,label:`УПД & Документы`,route:`/finance?tab=docs`},{id:`delivery`,label:`Логистика & Отгрузки`,route:`/operations/delivery`,requiredCapability:`delivery`}],terminology:{itemLabel:`Товарная позиция`,itemsLabel:`Номенклатурный каталог`,bookingResourceLabel:`Складская зона`,orderSourceLabel:`B2B Договор / EDI`,clientIdentifierLabel:`Контрагент / ИНН`},dashboardPreset:{primaryKpis:[`revenue_month`,`active_contracts`,`receivables`,`warehouse_capacity`,`b2b_avg_deal`],quickActionIds:[`new_deal`,`new_contract`,`stock_receipt`,`create_invoice`,`create_task`]}},auto_service:{id:`auto_service`,name:`Автосервис / СТО`,label:`СТО Крона`,category:`Автоуслуги`,companyName:`СТО Крона`,locations:[`Главный сервис`],capabilities:{crm:!0,sales:!0,communications:!0,helpdesk:!1,tasks:!0,cms:!1,marketing:!0,analytics:!0,finance:!0,employees:!0,inventory:!0,purchasing:!0,delivery:!1,booking:!0,pos:!0,kds:!1,dining:!1,work_orders:!0,production:!1,automation:!0,ai:!0},operationsTabs:[{id:`overview`,label:`Обзор`,route:`/operations`},{id:`booking`,label:`Запись & Очередь`,route:`/operations/booking`,requiredCapability:`booking`,badge:`7`},{id:`vehicles`,label:`Автомобили`,route:`/crm?tab=vehicles`},{id:`work_orders`,label:`Заказ-наряды`,route:`/operations/work-orders`,requiredCapability:`work_orders`,badge:`4`},{id:`pos`,label:`Касса & Оплата`,route:`/operations/pos`,requiredCapability:`pos`},{id:`bays`,label:`Посты & Подъёмники`,route:`/operations/bays`},{id:`catalog`,label:`Услуги & Прайс`,route:`/operations/catalog`},{id:`inventory`,label:`Запчасти & Склад`,route:`/operations/inventory`,requiredCapability:`inventory`}],terminology:{itemLabel:`Услуга / Деталь`,itemsLabel:`Работы и запчасти`,bookingResourceLabel:`Подъёмник`,orderSourceLabel:`Заказ-наряд`,clientIdentifierLabel:`Владелец ТС (Госномер)`},dashboardPreset:{primaryKpis:[`revenue_today`,`work_orders_active`,`bay_load`,`avg_ticket`,`repeat_rate`],quickActionIds:[`new_booking`,`new_work_order`,`new_vehicle`,`new_payment`,`create_task`]}},fitness:{id:`fitness`,name:`Фитнес-клуб`,label:`Крона Фитнес`,category:`Спорт и здоровье`,companyName:`Крона Фитнес`,locations:[`Клуб на Ленина`],capabilities:{crm:!0,sales:!0,communications:!0,helpdesk:!0,tasks:!0,cms:!0,marketing:!0,analytics:!0,finance:!0,employees:!0,inventory:!0,purchasing:!0,delivery:!1,booking:!0,pos:!0,kds:!1,dining:!1,work_orders:!1,production:!1,automation:!0,ai:!0},operationsTabs:[{id:`overview`,label:`Обзор`,route:`/operations`},{id:`booking`,label:`Расписание & Запись`,route:`/operations/booking`,requiredCapability:`booking`},{id:`pos`,label:`Касса & Ресепшн`,route:`/operations/pos`,requiredCapability:`pos`},{id:`trainers`,label:`Тренеры`,route:`/employees`},{id:`catalog`,label:`Абонементы & Услуги`,route:`/operations/catalog`},{id:`inventory`,label:`Склад (Бар/Мерч)`,route:`/operations/inventory`,requiredCapability:`inventory`}],terminology:{itemLabel:`Абонемент / Тренировка`,itemsLabel:`Прайс-лист`,bookingResourceLabel:`Зал / Тренер`,orderSourceLabel:`Онлайн / Ресепшн`,clientIdentifierLabel:`Член клуба`},dashboardPreset:{primaryKpis:[`revenue_today`,`active_memberships`,`visits_today`,`avg_check`],quickActionIds:[`new_booking`,`new_client`,`pos_sale`,`create_task`]}},clinic:{id:`clinic`,name:`Медицинская клиника / Стоматология`,label:`Крона Мед`,category:`Здоровье`,companyName:`Крона Мед`,locations:[`Главный филиал`],capabilities:{crm:!0,sales:!0,communications:!0,helpdesk:!0,tasks:!0,cms:!0,marketing:!0,analytics:!0,finance:!0,employees:!0,inventory:!0,purchasing:!0,delivery:!1,booking:!0,pos:!0,kds:!1,dining:!1,work_orders:!1,production:!1,automation:!0,ai:!0},operationsTabs:[{id:`overview`,label:`Обзор`,route:`/operations`},{id:`booking`,label:`Приемы & Расписание`,route:`/operations/booking`,requiredCapability:`booking`},{id:`pos`,label:`Касса`,route:`/operations/pos`,requiredCapability:`pos`},{id:`doctors`,label:`Врачи`,route:`/employees`},{id:`catalog`,label:`Услуги`,route:`/operations/catalog`},{id:`inventory`,label:`Медикаменты & Расходники`,route:`/operations/inventory`,requiredCapability:`inventory`}],terminology:{itemLabel:`Услуга`,itemsLabel:`Услуги`,bookingResourceLabel:`Врач / Кабинет`,orderSourceLabel:`Запись`,clientIdentifierLabel:`Пациент`},dashboardPreset:{primaryKpis:[`revenue_today`,`visits_today`,`avg_check`],quickActionIds:[`new_booking`,`new_client`,`pos_sale`,`create_task`]}},coworking:{id:`coworking`,name:`Коворкинг / Аренда пространств`,label:`Крона Коворкинг`,category:`Недвижимость`,companyName:`Крона Коворкинг`,locations:[`Кампус`],capabilities:{crm:!0,sales:!0,communications:!0,helpdesk:!0,tasks:!0,cms:!0,marketing:!0,analytics:!0,finance:!0,employees:!0,inventory:!0,purchasing:!0,delivery:!1,booking:!0,pos:!0,kds:!1,dining:!1,work_orders:!1,production:!1,automation:!0,ai:!0},operationsTabs:[{id:`overview`,label:`Обзор`,route:`/operations`},{id:`booking`,label:`Бронирование`,route:`/operations/booking`,requiredCapability:`booking`},{id:`pos`,label:`Оплата`,route:`/operations/pos`,requiredCapability:`pos`},{id:`catalog`,label:`Тарифы`,route:`/operations/catalog`},{id:`inventory`,label:`Склад`,route:`/operations/inventory`,requiredCapability:`inventory`}],terminology:{itemLabel:`Тариф / Опция`,itemsLabel:`Тарифы`,bookingResourceLabel:`Переговорная / Стол`,orderSourceLabel:`Онлайн / Ресепшн`,clientIdentifierLabel:`Резидент`},dashboardPreset:{primaryKpis:[`revenue_today`,`occupancy_rate`,`active_memberships`],quickActionIds:[`new_booking`,`new_client`,`pos_sale`,`create_task`]}},logistics:{id:`logistics`,name:`Логистика / Курьерская служба`,label:`Крона Доставка`,category:`Логистика`,companyName:`Крона Доставка`,locations:[`Сортировочный центр`],capabilities:{crm:!0,sales:!0,communications:!0,helpdesk:!0,tasks:!0,cms:!0,marketing:!0,analytics:!0,finance:!0,employees:!0,inventory:!1,purchasing:!1,delivery:!0,booking:!1,pos:!0,kds:!1,dining:!1,work_orders:!1,production:!1,automation:!0,ai:!0},operationsTabs:[{id:`overview`,label:`Обзор`,route:`/operations`},{id:`delivery`,label:`Заказы & Маршруты`,route:`/operations/delivery`,requiredCapability:`delivery`},{id:`pos`,label:`Оплата`,route:`/operations/pos`,requiredCapability:`pos`}],terminology:{itemLabel:`Услуга доставки`,itemsLabel:`Тарифы`,bookingResourceLabel:`Курьер / Машина`,orderSourceLabel:`Заказ`,clientIdentifierLabel:`Отправитель / Получатель`},dashboardPreset:{primaryKpis:[`orders_today`,`avg_delivery_time`,`success_rate`],quickActionIds:[`new_order`,`assign_courier`,`create_task`]}},custom_meta:{id:`custom_meta`,name:`Кастомный профиль / Meta-profile`,label:`Универсальный Business OS (Все модули)`,category:`Конфигурируемый`,companyName:`Бизнес-экосистема Крона`,locations:[`Главный офис`,`Локация 2`],capabilities:{crm:!0,sales:!0,communications:!0,helpdesk:!0,tasks:!0,cms:!0,marketing:!0,analytics:!0,finance:!0,employees:!0,inventory:!0,purchasing:!0,delivery:!0,booking:!0,pos:!0,kds:!0,dining:!0,work_orders:!0,production:!0,automation:!0,ai:!0},operationsTabs:[{id:`overview`,label:`Обзор`,route:`/operations`},{id:`orders`,label:`Заказы`,route:`/operations/orders`},{id:`pos`,label:`Касса (POS)`,route:`/operations/pos`},{id:`dining`,label:`Зал`,route:`/operations/dining`},{id:`kds`,label:`KDS`,route:`/operations/kds`},{id:`work_orders`,label:`Заказ-наряды`,route:`/operations/work-orders`},{id:`catalog`,label:`Каталог`,route:`/operations/catalog`},{id:`inventory`,label:`Склад`,route:`/operations/inventory`},{id:`purchasing`,label:`Закупки`,route:`/operations/purchasing`},{id:`delivery`,label:`Доставка`,route:`/operations/delivery`},{id:`booking`,label:`Бронирования`,route:`/operations/booking`}],terminology:{itemLabel:`Единица продукции`,itemsLabel:`Каталог сущностей`,bookingResourceLabel:`Бизнес-ресурс`,orderSourceLabel:`Канал продаж`,clientIdentifierLabel:`Клиент / Субъект`},dashboardPreset:{primaryKpis:[`revenue_today`,`orders_count`,`avg_check`,`tasks_open`,`ai_insights`],quickActionIds:[`new_order`,`new_client`,`create_task`,`new_expense`,`chat_message`]}}},Ca=[{id:`kds-1`,orderNumber:`#104`,tableOrChannel:`Стол 4`,status:`cooking`,elapsedMinutes:8,isUrgent:!1,items:[{name:`Филадельфия Премиум`,quantity:2,station:`Суши-цех`},{name:`Том Ям с морепродуктами`,quantity:1,station:`Кухня`}]},{id:`kds-2`,orderNumber:`#105`,tableOrChannel:`Доставка #42`,status:`new`,elapsedMinutes:2,isUrgent:!0,items:[{name:`Калифорния с крабом`,quantity:1,station:`Суши-цех`},{name:`Гёдза со свининой`,quantity:2,station:`Кухня`},{name:`Морс клюквенный 0.5`,quantity:2,station:`Бар`}]},{id:`kds-3`,orderNumber:`#103`,tableOrChannel:`Стол 2`,status:`ready`,elapsedMinutes:14,items:[{name:`Рамен Тонкоцу`,quantity:1,station:`Кухня`},{name:`Эби Темпура`,quantity:1,station:`Гриль`}]}],wa=[{id:`del-1`,orderId:`#ORD-2041`,recipientName:`Максим Белов`,phone:`+7 (913) 456-78-90`,address:`ул. Ленина 21, кв. 44, подъезд 2, эт. 5`,courierName:`Алексей Смирнов (Авто)`,status:`in_transit`,amount:2450,paymentMethod:`card`,etaMinutes:18},{id:`del-2`,orderId:`#ORD-2042`,recipientName:`Екатерина Морозова`,phone:`+7 (923) 112-33-44`,address:`Красный проспект 99, офис 305`,courierName:`Дмитрий Волков (Самокат)`,status:`pending`,amount:1890,paymentMethod:`online`,etaMinutes:35},{id:`del-3`,orderId:`#ORD-2039`,recipientName:`Олег Савельев`,phone:`+7 (905) 998-21-12`,address:`ул. Кирова 48, кв. 12`,courierName:`Алексей Смирнов (Авто)`,status:`delivered`,amount:3200,paymentMethod:`cash`,etaMinutes:0}],Ta=[{id:`book-1`,resourceName:`Стол 4 (у окна, 4 чел)`,time:`19:00`,clientName:`Анна Воронина`,clientPhone:`+7 (913) 777-12-34`,guestsOrCar:`3 гостя`,status:`confirmed`,deposit:1e3},{id:`book-2`,resourceName:`Стол 1 (VIP, 6 чел)`,time:`20:30`,clientName:`Виктор Платонов`,clientPhone:`+7 (923) 888-99-00`,guestsOrCar:`5 гостей`,status:`confirmed`,deposit:2e3},{id:`book-3`,resourceName:`Пост 1 (Мойка + Детейлинг)`,time:`14:00`,clientName:`Сергей Ковалев`,clientPhone:`+7 (903) 445-56-67`,guestsOrCar:`BMW X5 (А001АА 154)`,status:`seated`,deposit:500}],Ea=[{id:`WO-881`,vehicle:`Toyota Land Cruiser (Р777УУ 154)`,ownerName:`Андрей Романов`,phone:`+7 (913) 222-33-44`,bay:`Пост 2 (Подъёмник)`,masterName:`Иван Кузнецов`,services:[`Замена масла ДВС`,`Диагностика ходовой`,`Замена передних колодок`],partsAmount:8600,laborAmount:4200,status:`in_progress`},{id:`WO-882`,vehicle:`Porsche Cayenne (В500ВВ 154)`,ownerName:`Елена Соколова`,phone:`+7 (923) 444-11-22`,bay:`Пост 4 (Детейлинг бокс)`,masterName:`Артем Васильев`,services:[`Комплексная мойка Люкс`,`Керамическое покрытие кузова`,`Консервация кожи`],partsAmount:3500,laborAmount:14e3,status:`ready`}],Da=[{id:`notif-1`,title:`Критический остаток на складе`,message:`Лосось охлажденный (филе): осталось 2.4 кг (порог 6 кг). Оформите заявку поставщику.`,type:`danger`,timestamp:`12 минут назад`,actionUrl:`/operations/inventory`,read:!1},{id:`notif-2`,title:`Долгий заказ в обработке`,message:`Заказ #104 на Стол 4 готовится уже более 18 минут. Требуется внимание шефа.`,type:`warning`,timestamp:`5 минут назад`,actionUrl:`/operations/kds`,read:!1},{id:`notif-3`,title:`Дневная цель по выручке выполнена`,message:`Выручка за сегодня достигла 184 500 ₽ (108% от плана).`,type:`success`,timestamp:`40 минут назад`,read:!1}],Oa=f((e,t)=>({theme:typeof window<`u`&&([`soft-light`,`light`,`dark`].includes(localStorage.getItem(`krona_theme_mode`)||``)?localStorage.getItem(`krona_theme_mode`):null)||`soft-light`,setTheme:t=>{typeof window<`u`&&(localStorage.setItem(`krona_theme_mode`,t),document.documentElement.setAttribute(`data-theme`,t)),e({theme:t})},viewportMode:`desktop`,setViewportMode:t=>e({viewportMode:t}),currentProfileId:typeof window<`u`&&localStorage.getItem(`krona_profile_id`)||`restaurant_hall_delivery`,setProfileId:t=>{typeof window<`u`&&localStorage.setItem(`krona_profile_id`,t);let n=Sa[t]||Sa.restaurant_hall_delivery;e({currentProfileId:t,customCapabilities:{...n.capabilities},activeLocation:n.locations[0]||`Главная точка`}),p.getState().setCurrentProfileId(t)},currentRoleId:typeof window<`u`&&localStorage.getItem(`krona_role_id`)||`owner`,setRoleId:t=>{typeof window<`u`&&localStorage.setItem(`krona_role_id`,t),e({currentRoleId:t}),p.getState().setCurrentRoleId(t)},activeLocation:`Горский 1/1`,setActiveLocation:t=>e({activeLocation:t}),customCapabilities:{...Sa.restaurant_hall_delivery.capabilities},toggleCapability:t=>e(e=>({customCapabilities:{...e.customCapabilities,[t]:!e.customCapabilities[t]}})),resetCapabilitiesToProfile:()=>{e({customCapabilities:{...(Sa[t().currentProfileId]||Sa.restaurant_hall_delivery).capabilities}})},isCommandPaletteOpen:!1,setIsCommandPaletteOpen:t=>e({isCommandPaletteOpen:t}),isQuickActionsOpen:!1,setIsQuickActionsOpen:t=>e({isQuickActionsOpen:t}),isNotificationsOpen:!1,setIsNotificationsOpen:t=>e({isNotificationsOpen:t}),isAiDrawerOpen:!1,setIsAiDrawerOpen:t=>e({isAiDrawerOpen:t}),isRightPanelCollapsed:!1,setIsRightPanelCollapsed:t=>e({isRightPanelCollapsed:t}),posCart:[{id:`pos-1`,name:`Филадельфия Премиум`,price:690,quantity:1,category:`Роллы`},{id:`pos-2`,name:`Том Ям с креветками`,price:540,quantity:1,category:`Супы`}],posDiscountPercent:0,posCustomerName:`Александр (постоянный гость)`,posOrderType:`hall`,posTableNumber:`Стол 4`,posPaymentModalOpen:!1,posLastReceipt:null,addToCart:t=>e(e=>e.posCart.find(e=>e.id===t.id)?{posCart:e.posCart.map(e=>e.id===t.id?{...e,quantity:e.quantity+1}:e)}:{posCart:[...e.posCart,{...t,quantity:1}]}),removeFromCart:t=>e(e=>({posCart:e.posCart.filter(e=>e.id!==t)})),updateCartQuantity:(t,n)=>e(e=>({posCart:e.posCart.map(e=>e.id===t?{...e,quantity:Math.max(1,e.quantity+n)}:e).filter(e=>e.quantity>0)})),clearCart:()=>e({posCart:[],posDiscountPercent:0}),setPosDiscount:t=>e({posDiscountPercent:t}),setPosCustomer:t=>e({posCustomerName:t}),setPosOrderType:t=>e({posOrderType:t}),setPosTableNumber:t=>e({posTableNumber:t}),setPosPaymentModalOpen:t=>e({posPaymentModalOpen:t}),completeCheckout:n=>{let r=t(),i=r.posCart.reduce((e,t)=>e+t.price*t.quantity,0),a=i*r.posDiscountPercent/100,o=i-a,s={orderNumber:`#${Math.floor(100+Math.random()*900)}`,timestamp:new Date().toLocaleTimeString(`ru-RU`,{hour:`2-digit`,minute:`2-digit`}),items:[...r.posCart],subtotal:i,discount:a,total:o,paymentType:n,customer:r.posCustomerName,location:r.activeLocation};r.customCapabilities.kds&&e({kdsTickets:[{id:`kds-${Date.now()}`,orderNumber:s.orderNumber,tableOrChannel:r.posOrderType===`hall`?r.posTableNumber:`Навынос / Касса`,status:`new`,elapsedMinutes:0,items:r.posCart.map(e=>({name:e.name,quantity:e.quantity,station:e.category.includes(`Роллы`)||e.category.includes(`Суши`)?`Суши-цех`:`Кухня`}))},...r.kdsTickets]}),e({posLastReceipt:s,posCart:[],posPaymentModalOpen:!1})},kdsTickets:Ca,updateKdsTicketStatus:(t,n)=>e(e=>({kdsTickets:e.kdsTickets.map(e=>e.id===t?{...e,status:n}:e)})),deliveries:wa,updateDeliveryStatus:(t,n)=>e(e=>({deliveries:e.deliveries.map(e=>e.id===t?{...e,status:n}:e)})),bookings:Ta,addBooking:t=>e(e=>({bookings:[...e.bookings,{...t,id:`book-${Date.now()}`}]})),updateBookingStatus:(t,n)=>e(e=>({bookings:e.bookings.map(e=>e.id===t?{...e,status:n}:e)})),workOrders:Ea,updateWorkOrderStatus:(t,n)=>e(e=>({workOrders:e.workOrders.map(e=>e.id===t?{...e,status:n}:e)})),addWorkOrder:t=>e(e=>({workOrders:[{...t,id:`WO-${Math.floor(800+Math.random()*200)}`},...e.workOrders]})),notifications:Da,dismissNotification:t=>e(e=>({notifications:e.notifications.filter(e=>e.id!==t)})),markAllNotificationsRead:()=>e(e=>({notifications:e.notifications.map(e=>({...e,read:!0}))})),getActiveProfile:()=>Sa[t().currentProfileId]||Sa.restaurant_hall_delivery,getActiveCapabilities:()=>t().customCapabilities})),ka=class{entityName;constructor(e){this.entityName=e}resolveContext(e){return e||h()}async applySimulation(){let{simulateLatency:e,latencyMs:t,simulateErrors:n,errorType:r}=p.getState();if(e&&t>0&&await new Promise(e=>setTimeout(e,t)),n||r&&r!==`none`)switch(r){case`forbidden_403`:throw Error(`[403 Forbidden]: Отказано в доступе к ресурсу «${this.entityName}».`);case`conflict_409`:throw Error(`[409 Conflict]: Конфликт параллельного изменения записи «${this.entityName}».`);case`validation_422`:throw Error(`[422 Validation Error]: Ошибка валидации структуры записи «${this.entityName}».`);default:throw Error(`[Сетевая ошибка]: Не удалось связаться с сервером для «${this.entityName}».`)}}async getById(e,t){await this.applySimulation();let n=this.resolveContext(t),r=await g(e,n.tenantId);if(!r||r.entityType!==this.entityName)return null;let i=r.tenant_id||`tenant_main`;if(i!==n.tenantId)throw new ne(`Отказано в доступе: запись «${this.entityName}» с ID ${e} принадлежит тенанту «${i}» (запрос от «${n.tenantId}»).`);return r}async list(e,t){await this.applySimulation();let n=this.resolveContext(t),r=e?.sort?{field:String(e.sort.field),order:e.sort.order}:void 0,i=await x(this.entityName,{search:e?.search,filter:e?.filter,sort:r,page:e?.page,pageSize:e?.pageSize,tenantId:n.tenantId});return{items:i.items,total:i.total,page:i.page,pageSize:i.pageSize,totalPages:i.totalPages}}async create(e,t){await this.applySimulation();let n=this.resolveContext(t),r=p.getState().demoDate||new Date().toISOString(),i=n.actorId||p.getState().currentRoleId||`demo_user`,a=d(),o={...e,id:a,entityType:this.entityName,tenant_id:n.tenantId,updatedAt:r,audit:{createdAt:r,createdById:i,updatedAt:r,updatedById:i,version:1,tenantId:n.tenantId,correlationId:n.correlationId}};return await _(o,n.tenantId),await T(`audit_log`,{id:d(),entityType:this.entityName,entityId:a,tenant_id:n.tenantId,correlation_id:n.correlationId,action:`create`,userId:i,userName:`Роль: ${i}`,timestamp:r,summary:`Создана запись «${this.entityName}» (${a.slice(0,8)}...)`},n.tenantId),o}async update(e,t,n){await this.applySimulation();let r=this.resolveContext(n),i=await this.getById(e,r);if(!i)throw new te(`Запись «${this.entityName}» с ID ${e} не найдена.`);let a=p.getState().demoDate||new Date().toISOString(),o=r.actorId||p.getState().currentRoleId||`demo_user`,s={...i,...t,id:e,entityType:this.entityName,tenant_id:r.tenantId,updatedAt:a,audit:{...i.audit,updatedAt:a,updatedById:o,version:(i.audit?.version||1)+1,tenantId:r.tenantId,correlationId:r.correlationId}};return await _(s,r.tenantId),await T(`audit_log`,{id:d(),entityType:this.entityName,entityId:e,tenant_id:r.tenantId,correlation_id:r.correlationId,action:`update`,userId:o,userName:`Роль: ${o}`,timestamp:a,summary:`Обновлена запись «${this.entityName}» (${e.slice(0,8)}...)`},r.tenantId),s}async delete(e,t){await this.applySimulation();let n=this.resolveContext(t);if(!await this.getById(e,n))return!1;await E(e,this.entityName,n.tenantId);let r=p.getState().demoDate||new Date().toISOString(),i=n.actorId||p.getState().currentRoleId||`demo_user`;return await T(`audit_log`,{id:d(),entityType:this.entityName,entityId:e,tenant_id:n.tenantId,correlation_id:n.correlationId,action:`delete`,userId:i,userName:`Роль: ${i}`,timestamp:r,summary:`Удалена запись «${this.entityName}» (${e.slice(0,8)}...)`},n.tenantId),!0}async batchUpdate(e,t){let n=[];for(let r of e){let e=await this.update(r.id,r.data,t);n.push(e)}return n}async count(e,t){return await this.applySimulation(),(await this.list({filter:e},t)).total}},Aa=class{contacts;companies;leads;deals;activities;notes;constructor(){this.contacts=new ka(`contact`),this.companies=new ka(`company`),this.leads=new ka(`lead`),this.deals=new ka(`deal`),this.activities=new ka(`activity`),this.notes=new ka(`note`)}async getTimeline(e,t){let n=[],r=await this.activities.list({filter:{targetEntityType:e,targetEntityId:t}});for(let e of r.items)n.push({id:e.id,timestamp:e.audit?.createdAt||new Date().toISOString(),type:`activity`,title:`${e.type.toUpperCase()}: ${e.title}`,description:e.description,actor:e.assignedTo||`Менеджер`});let i=await this.notes.list({filter:{targetEntityType:e,targetEntityId:t}});for(let e of i.items)n.push({id:e.id,timestamp:e.audit?.createdAt||new Date().toISOString(),type:`note`,title:`Заметка менеджера`,description:e.content,actor:e.authorName});if(e===`contact`||e===`company`){let r=await this.deals.list({filter:e===`contact`?{contactId:t}:{companyId:t}});for(let e of r.items)n.push({id:e.id,timestamp:e.audit?.createdAt||new Date().toISOString(),type:`deal_created`,title:`Сделка: ${e.title}`,description:`Этап: ${e.stage}, сумма: ${(e.amount.minor/100).toLocaleString(`ru-RU`)} ₽`,actor:`Отдел продаж`})}return n.sort((e,t)=>t.timestamp>e.timestamp?1:-1)}async convertLeadToDeal(e,t){let n=await this.leads.getById(e);if(!n)throw Error(`Лид с ID ${e} не найден.`);let r=(n.contactName||`Клиент`).split(` `),i=r[0],a=r.slice(1).join(` `)||`Клиент`,o=await this.contacts.create({firstName:i,lastName:a,phone:n.phone,email:n.email,roles:[`client`],status:`active`}),s=await this.deals.create({title:t||n.title,pipelineId:`pipe_default`,stage:`proposal`,amount:n.estimatedValue||{minor:1e6,currency:`RUB`},probability:60,contactId:o.id});return await this.leads.update(e,{status:`converted`,convertedContactId:o.id,convertedDealId:s.id}),await this.notes.create({targetEntityType:`deal`,targetEntityId:s.id,content:`Сделка создана из лида «${n.title}». Источник: ${n.source}.`,authorName:`Система`}),{deal:s,contact:o}}},ja=class{products;categories;priceLists;orders;payments;shipments;returns;constructor(){this.products=new ka(`product`),this.categories=new ka(`product_category`),this.priceLists=new ka(`price_list`),this.orders=new ka(`order`),this.payments=new ka(`payment`),this.shipments=new ka(`shipment`),this.returns=new ka(`return`)}async updateOrderStatus(e,t){return this.orders.update(e,{status:t})}async confirmOrder(e,t=`wh_main`){let n=await this.orders.getById(e);if(!n)throw Error(`Заказ с ID ${e} не найден.`);let r=oo().inventory;if(r&&n.items)for(let i of n.items)await r.reserveStock(e,t,i.productId,i.quantity);return this.orders.update(e,{status:`confirmed`})}async cancelOrder(e){if(!await this.orders.getById(e))throw Error(`Заказ с ID ${e} не найден.`);let t=oo().inventory;return t&&await t.cancelOrderReservations(e),this.orders.update(e,{status:`cancelled`})}async createPayment(e,t,n,r=!1){let i=await this.orders.getById(e);if(!i)throw Error(`Заказ с ID ${e} не найден.`);let a=new Date().toISOString(),o=await this.payments.create({orderId:e,orderNumber:i.orderNumber,amount:t,method:n,status:`completed`,paidAt:a,transactionId:`TXN-${d().slice(0,10)}`});if(await this.orders.update(e,{paymentStatus:`paid`}),r){let n=oo().finance;n&&await n.createTransactionFromPayment(o.id,e,t)}return o}async createShipment(e,t,n){let r=await this.orders.getById(e);if(!r)throw Error(`Заказ с ID ${e} не найден.`);let i=n||r.items.map(e=>({productId:e.productId,sku:e.sku,name:e.name,quantity:e.quantity})),a=await this.shipments.create({orderId:e,orderNumber:r.orderNumber,warehouseId:t,status:`ready`,trackingNumber:`TRK-${d().slice(0,8)}`,carrier:`Krona Экспресс`,dispatchedAt:new Date().toISOString(),items:i});await this.orders.update(e,{fulfillmentStatus:`fulfilled`,status:`shipped`});let o=oo().inventory;return o&&await o.fulfillOrderReservations(e,t,i),a}async processReturn(e,t,n,r=`wh_main`,i=!1){let a=await this.orders.getById(e);if(!a)throw Error(`Заказ с ID ${e} не найден.`);let o=n.reduce((e,t)=>e+t.refundAmount.minor,0),s=await this.returns.create({orderId:e,orderNumber:a.orderNumber,status:`refunded`,reason:t,totalRefund:{minor:o,currency:a.total.currency},items:n});await this.orders.update(e,{fulfillmentStatus:`returned`,paymentStatus:`refunded`});let c=oo().inventory;if(c)for(let e of n)await c.adjustStock(r,e.productId,e.quantity,`Возврат по заказу #${a.orderNumber}: ${t}`);if(i){let t=oo().finance;t&&await t.createTransactionFromReturn(s.id,e,s.totalRefund)}return s}},Ma=class{warehouses;stockItems;movements;receipts;reservations;constructor(){this.warehouses=new ka(`warehouse`),this.stockItems=new ka(`stock_item`),this.movements=new ka(`stock_movement`),this.receipts=new ka(`goods_receipt`),this.reservations=new ka(`stock_reservation`)}async adjustStock(e,t,n,r){let i=(await this.stockItems.list({filter:{warehouseId:e,productId:t}})).items[0],a=new Date().toISOString();if(!i)i=await this.stockItems.create({warehouseId:e,warehouseName:`Склад`,productId:t,sku:`SKU`,productName:`Товар`,onHand:Math.max(0,n),reserved:0,available:Math.max(0,n),unit:`шт`});else{let e=Math.max(0,i.onHand+n),t=Math.max(0,e-i.reserved);i=await this.stockItems.update(i.id,{onHand:e,available:t})}return await this.movements.create({type:n>=0?`adjustment`:`loss`,productId:t,productName:i.productName,sku:i.sku,targetWarehouseId:e,quantity:Math.abs(n),notes:r,timestamp:a}),i}async reserveStock(e,t,n,r){let i=await this.reservations.create({orderId:e,warehouseId:t,productId:n,quantity:r,status:`active`,expiresAt:new Date(Date.now()+864e5).toISOString()}),a=await this.stockItems.list({filter:{warehouseId:t,productId:n}});if(a.items.length>0){let e=a.items[0],t=e.reserved+r,n=Math.max(0,e.onHand-t);await this.stockItems.update(e.id,{reserved:t,available:n})}return await this.movements.create({type:`transfer`,productId:n,productName:a.items[0]?.productName||`Товар`,sku:a.items[0]?.sku||`SKU`,sourceWarehouseId:t,quantity:r,notes:`Резервирование под заказ #${e.slice(0,8)}`,timestamp:new Date().toISOString()}),i}async cancelOrderReservations(e){let t=await this.reservations.list({filter:{orderId:e,status:`active`}});for(let n of t.items){await this.reservations.update(n.id,{status:`cancelled`});let t=await this.stockItems.list({filter:{warehouseId:n.warehouseId,productId:n.productId}});if(t.items.length>0){let e=t.items[0],r=Math.max(0,e.reserved-n.quantity),i=Math.max(0,e.onHand-r);await this.stockItems.update(e.id,{reserved:r,available:i})}await this.movements.create({type:`adjustment`,productId:n.productId,productName:t.items[0]?.productName||`Товар`,sku:t.items[0]?.sku||`SKU`,targetWarehouseId:n.warehouseId,quantity:n.quantity,notes:`Снятие резерва (отмена заказа #${e.slice(0,8)})`,timestamp:new Date().toISOString()})}}async fulfillOrderReservations(e,t,n){let r=await this.reservations.list({filter:{orderId:e,status:`active`}});for(let e of r.items)await this.reservations.update(e.id,{status:`fulfilled`});if(n&&n.length>0)for(let r of n){let n=await this.stockItems.list({filter:{warehouseId:t,productId:r.productId}});if(n.items.length>0){let e=n.items[0],t=Math.max(0,e.onHand-r.quantity),i=Math.max(0,e.reserved-r.quantity),a=Math.max(0,t-i);await this.stockItems.update(e.id,{onHand:t,reserved:i,available:a})}await this.movements.create({type:`shipment`,productId:r.productId,productName:r.name,sku:r.sku,sourceWarehouseId:t,quantity:r.quantity,notes:`Отгрузка по заказу #${e.slice(0,8)}`,timestamp:new Date().toISOString()})}}async receiveGoods(e){let t=await this.receipts.getById(e);if(!t)throw Error(`Приходная накладная с ID ${e} не найдена.`);let n=await this.receipts.update(e,{status:`received`,receivedAt:new Date().toISOString()});for(let e of t.items)await this.adjustStock(t.warehouseId,e.productId,e.quantity,`Поступление по накладной №${t.receiptNumber}`);return n}async createAndReceiveGoods(e,t,n,r){let i=r.reduce((e,t)=>e+(t.costPrice?.minor||0)*t.quantity,0),a=await this.receipts.create({receiptNumber:t,warehouseId:e,supplierName:n,status:`received`,receivedAt:new Date().toISOString(),totalCost:{minor:i,currency:`RUB`},items:r}),o=(await this.warehouses.getById(e))?.name||`Склад`;for(let i of r){let r=await this.stockItems.list({filter:{warehouseId:e,productId:i.productId}});if(r.items.length>0){let e=r.items[0],t=e.onHand+i.quantity,n=Math.max(0,t-e.reserved);await this.stockItems.update(e.id,{onHand:t,available:n})}else await this.stockItems.create({warehouseId:e,warehouseName:o,productId:i.productId,sku:i.sku,productName:i.name,onHand:i.quantity,reserved:0,available:i.quantity,unit:`шт`});await this.movements.create({type:`receipt`,productId:i.productId,productName:i.name,sku:i.sku,targetWarehouseId:e,quantity:i.quantity,notes:`Приходная накладная №${t} (${n})`,timestamp:new Date().toISOString()})}return a}},Na=class{accounts;transactions;constructor(){this.accounts=new ka(`account`),this.transactions=new ka(`cash_flow_transaction`)}async getPnLMetrics(e=`current_month`){let t=await this.transactions.list({pageSize:500}),n=0,r=0;for(let e of t.items)e.type===`inflow`?n+=e.amount.minor:r+=e.amount.minor;let i=Math.round(n*.42),a=n-i,o=r,s=a-o,c=n>0?Math.round(s/n*1e3)/10:0;return{period:e,revenue:{minor:n,currency:`RUB`},costOfGoodsSold:{minor:i,currency:`RUB`},grossProfit:{minor:a,currency:`RUB`},operatingExpenses:{minor:o,currency:`RUB`},netProfit:{minor:s,currency:`RUB`},operatingMarginPercent:c}}async createTransactionFromPayment(e,t,n){let r=await this.accounts.list(),i=r.items.find(e=>e.isDefault)||r.items[0],a=await this.transactions.create({transactionNumber:`CFT-${d().slice(0,8)}`,type:`inflow`,category:`sales_revenue`,amount:n,accountId:i?.id||`acc_default`,accountName:i?.name||`Основной расчетный счет`,referenceType:`order_payment`,referenceId:e,description:`Оплата по заказу (${t.slice(0,8)}...)`,timestamp:new Date().toISOString()});return i&&await this.accounts.update(i.id,{balance:{minor:i.balance.minor+n.minor,currency:i.balance.currency}}),a}async createTransactionFromReturn(e,t,n){let r=await this.accounts.list(),i=r.items.find(e=>e.isDefault)||r.items[0],a=await this.transactions.create({transactionNumber:`CFT-${d().slice(0,8)}`,type:`outflow`,category:`refund`,amount:n,accountId:i?.id||`acc_default`,accountName:i?.name||`Основной расчетный счет`,referenceType:`order_return`,referenceId:e,description:`Возврат средств по заказу (${t.slice(0,8)}...)`,timestamp:new Date().toISOString()});return i&&await this.accounts.update(i.id,{balance:{minor:Math.max(0,i.balance.minor-n.minor),currency:i.balance.currency}}),a}},Pa={contact:{id:`meta_contact`,code:`contact`,name:`Контакт`,pluralName:`Контакты`,description:`Физические лица: клиенты, представители компаний, лиды`,isSystem:!0,category:`crm`,maturity:`pilot1`,defaultView:`table`,fields:[{id:`f_fn`,key:`firstName`,label:`Имя`,type:`text`,required:!0,system:!0},{id:`f_ln`,key:`lastName`,label:`Фамилия`,type:`text`,required:!0,system:!0},{id:`f_mn`,key:`middleName`,label:`Отчество`,type:`text`,system:!0},{id:`f_ph`,key:`phone`,label:`Телефон`,type:`phone`,system:!0},{id:`f_em`,key:`email`,label:`Email`,type:`email`,system:!0},{id:`f_comp`,key:`companyId`,label:`Компания`,type:`entity_ref`,targetEntity:`company`,system:!0},{id:`f_title`,key:`jobTitle`,label:`Должность`,type:`text`,system:!0},{id:`f_roles`,key:`roles`,label:`Роли`,type:`multiselect`,system:!0,options:[{label:`Клиент`,value:`client`},{label:`Лид`,value:`lead`},{label:`Партнёр`,value:`partner`},{label:`Поставщик`,value:`vendor`},{label:`Подрядчик`,value:`contractor`}]}]},company:{id:`meta_company`,code:`company`,name:`Компания`,pluralName:`Компании`,description:`Юридические лица: клиенты, партнёры, поставщики`,isSystem:!0,category:`crm`,maturity:`pilot1`,defaultView:`table`,fields:[{id:`f_cname`,key:`name`,label:`Название компании`,type:`text`,required:!0,system:!0},{id:`f_cleg`,key:`legalName`,label:`Юридическое наименование`,type:`text`,system:!0},{id:`f_cinn`,key:`inn`,label:`ИНН`,type:`text`,system:!0},{id:`f_cweb`,key:`website`,label:`Веб-сайт`,type:`text`,system:!0},{id:`f_cph`,key:`phone`,label:`Телефон`,type:`phone`,system:!0},{id:`f_cem`,key:`email`,label:`Email`,type:`email`,system:!0},{id:`f_caddr`,key:`address`,label:`Адрес`,type:`text`,system:!0}]},lead:{id:`meta_lead`,code:`lead`,name:`Лид`,pluralName:`Лиды`,description:`Входящие обращения и потенциальные клиенты`,isSystem:!0,category:`crm`,maturity:`pilot1`,defaultView:`kanban`,fields:[{id:`f_ltitle`,key:`title`,label:`Тема обращения`,type:`text`,required:!0,system:!0},{id:`f_lcname`,key:`contactName`,label:`Контактное лицо`,type:`text`,required:!0,system:!0},{id:`f_lph`,key:`phone`,label:`Телефон`,type:`phone`,system:!0},{id:`f_lem`,key:`email`,label:`Email`,type:`email`,system:!0},{id:`f_lstat`,key:`status`,label:`Статус лида`,type:`select`,system:!0,options:[{label:`Новый`,value:`new`},{label:`В работе`,value:`contacted`},{label:`Квалификация`,value:`qualifying`},{label:`Квалифицирован`,value:`qualified`},{label:`Дисквалифицирован`,value:`disqualified`},{label:`Конвертирован`,value:`converted`}]},{id:`f_lval`,key:`estimatedValue`,label:`Оценочный бюджет`,type:`money`,system:!0}]},deal:{id:`meta_deal`,code:`deal`,name:`Сделка`,pluralName:`Сделки`,description:`Воронка продаж и коммерческие сделки`,isSystem:!0,category:`crm`,maturity:`pilot1`,defaultView:`kanban`,fields:[{id:`f_dtitle`,key:`title`,label:`Название сделки`,type:`text`,required:!0,system:!0},{id:`f_damt`,key:`amount`,label:`Сумма сделки`,type:`money`,required:!0,system:!0},{id:`f_dstg`,key:`stage`,label:`Этап воронки`,type:`select`,system:!0,options:[{label:`Выявление потребности`,value:`discovery`},{label:`Коммерческое предложение`,value:`proposal`},{label:`Переговоры`,value:`negotiation`},{label:`Договор и оплата`,value:`contract`},{label:`Успешно закрыто`,value:`won`},{label:`Закрыто и проиграно`,value:`lost`}]},{id:`f_dprob`,key:`probability`,label:`Вероятность (%)`,type:`number`,system:!0},{id:`f_ddate`,key:`expectedCloseDate`,label:`Планируемая дата`,type:`date`,system:!0},{id:`f_dcont`,key:`contactId`,label:`Контакт`,type:`entity_ref`,targetEntity:`contact`,system:!0},{id:`f_dcomp`,key:`companyId`,label:`Компания`,type:`entity_ref`,targetEntity:`company`,system:!0}]},order:{id:`meta_order`,code:`order`,name:`Заказ`,pluralName:`Заказы`,description:`Заказы клиентов, продажи, чеки и счета`,isSystem:!0,category:`commerce`,maturity:`pilot1`,defaultView:`table`,fields:[{id:`f_onum`,key:`orderNumber`,label:`Номер заказа`,type:`text`,required:!0,system:!0},{id:`f_ocust`,key:`customerName`,label:`Клиент`,type:`text`,required:!0,system:!0},{id:`f_ostat`,key:`status`,label:`Статус заказа`,type:`select`,system:!0,options:[{label:`Черновик`,value:`draft`},{label:`Подтверждён`,value:`confirmed`},{label:`В обработке`,value:`processing`},{label:`Готов к выдаче`,value:`ready`},{label:`Отправлен`,value:`shipped`},{label:`Доставлен`,value:`delivered`},{label:`Завершён`,value:`completed`},{label:`Отменён`,value:`cancelled`}]},{id:`f_otot`,key:`total`,label:`Итоговая сумма`,type:`money`,required:!0,system:!0},{id:`f_opay`,key:`paymentStatus`,label:`Оплата`,type:`select`,system:!0,options:[{label:`Ожидает оплаты`,value:`pending`},{label:`Частично оплачен`,value:`partially_paid`},{label:`Оплачен`,value:`paid`},{label:`Возврат`,value:`refunded`}]}]},product:{id:`meta_product`,code:`product`,name:`Товар / Услуга`,pluralName:`Товары и услуги`,description:`Номенклатура, товары, услуги и технологические карты`,isSystem:!0,category:`commerce`,maturity:`pilot1`,defaultView:`table`,fields:[{id:`f_psku`,key:`sku`,label:`Артикул / SKU`,type:`text`,required:!0,system:!0},{id:`f_pname`,key:`name`,label:`Наименование`,type:`text`,required:!0,system:!0},{id:`f_pprice`,key:`price`,label:`Цена продажи`,type:`money`,required:!0,system:!0},{id:`f_pcost`,key:`costPrice`,label:`Себестоимость`,type:`money`,system:!0},{id:`f_punit`,key:`unit`,label:`Единица измерения`,type:`text`,system:!0},{id:`f_psrv`,key:`isService`,label:`Это услуга`,type:`boolean`,system:!0}]},warehouse:{id:`meta_warehouse`,code:`warehouse`,name:`Склад / Локация`,pluralName:`Склады и локации`,description:`Складские помещения, зоны хранения, торговые точки`,isSystem:!0,category:`inventory`,maturity:`pilot1`,defaultView:`table`,fields:[{id:`f_wname`,key:`name`,label:`Название склада`,type:`text`,required:!0,system:!0},{id:`f_wcode`,key:`code`,label:`Код склада`,type:`text`,required:!0,system:!0},{id:`f_wtype`,key:`type`,label:`Тип склада`,type:`select`,system:!0,options:[{label:`Центральный склад`,value:`central`},{label:`Склад магазина`,value:`store`},{label:`Кухонный цех`,value:`kitchen_stock`},{label:`Транзитный склад`,value:`transit`}]},{id:`f_waddr`,key:`address`,label:`Адрес`,type:`text`,system:!0}]}},Fa=class{async listEntities(e){let t=e||k(),n=await w(`entities_meta`,t);return n.length>0?n:Object.values(Pa)}async getEntity(e,t){let n=await this.listEntities(t),r=e.trim().toLowerCase();return n.find(e=>e.code.trim().toLowerCase()===r)||null}async createEntity(e,t){let n=d(),r=t||k(),i={...e,id:n,tenant_id:e.tenant_id||r};return await T(`entities_meta`,i,r),i}async updateEntity(e,t){let n=await this.getEntity(e);if(!n)throw Error(`Сущность с кодом «${e}» не найдена.`);let r={...n,...t,code:e};return await T(`entities_meta`,r),r}async deleteEntity(e){let t=await this.getEntity(e);if(!t)return!1;if(t.isSystem)throw Error(`Нельзя удалить системную сущность «${e}».`);return await b(`entities_meta`,t.id),!0}async addField(e,t){let n=await this.getEntity(e);if(!n)throw Error(`Сущность с кодом «${e}» не найдена.`);let r={...t,id:`fld_${d()}`};return n.fields.push(r),await T(`entities_meta`,n),await T(`fields_meta`,{...r,entityCode:e}),r}async updateField(e,t,n){let r=await this.getEntity(e);if(!r)throw Error(`Сущность с кодом «${e}» не найдена.`);let i=r.fields.findIndex(e=>e.id===t);if(i===-1)throw Error(`Поле с ID «${t}» не найдено.`);let a={...r.fields[i],...n,id:t};return r.fields[i]=a,await T(`entities_meta`,r),await T(`fields_meta`,{...a,entityCode:e}),a}async deleteField(e,t){let n=await this.getEntity(e);if(!n)throw Error(`Сущность с кодом «${e}» не найдена.`);let r=n.fields.find(e=>e.id===t);if(r?.system||r?.isSystem)throw Error(`Нельзя удалить системное поле`);return n.fields=n.fields.filter(e=>e.id!==t),await T(`entities_meta`,n),await b(`fields_meta`,t),!0}async listLayouts(e,t){let n=t||k(),r=(await(await ee()).transaction(`layouts_meta`,`readonly`).store.index(`by_entity`).getAll(e)).filter(e=>!e.tenant_id||e.tenant_id===`system`||e.tenant_id===n);if(r.length>0)return r;let i=await this.getEntity(e,n);return[{id:`layout_def_${e}`,entityCode:e,name:`Основная форма`,isDefault:!0,sections:[{id:`sec_main`,title:`Основные сведения`,columns:2,fieldKeys:i?.fields.map(e=>e.key)||[]}]}]}async getLayout(e){return O(`layouts_meta`,e)}async saveLayout(e,t){let n=t||k(),r={...e,tenant_id:e.tenant_id||n};return await T(`layouts_meta`,r,n),e}async deleteLayout(e){return await b(`layouts_meta`,e),!0}async listViews(e,t){let n=t||k(),r=(await(await ee()).transaction(`views_meta`,`readonly`).store.index(`by_entity`).getAll(e)).filter(e=>!e.tenant_id||e.tenant_id===`system`||e.tenant_id===n);if(r.length>0)return r;let i=await this.getEntity(e,n);return[{id:`view_def_${e}`,entityCode:e,name:`Все записи`,type:i?.defaultView||`table`,isDefault:!0,visibleFieldKeys:i?.fields.map(e=>e.key)||[],filters:[]}]}async getView(e){return O(`views_meta`,e)}async saveView(e,t){let n=t||k(),r={...e,tenant_id:e.tenant_id||n};return await T(`views_meta`,r,n),e}async deleteView(e){return await b(`views_meta`,e),!0}},Ia=class{async log(e){let t=p.getState().demoDate||new Date().toISOString(),n=d(),r={...e,id:n,timestamp:t};return await T(`audit_log`,r),r}async getHistory(e,t){return(await(await ee()).transaction(`audit_log`,`readonly`).store.index(`by_entity_id`).getAll(t)).filter(t=>t.entityType===e).sort((e,t)=>t.timestamp>e.timestamp?1:-1)}async listRecent(e=50){return(await w(`audit_log`)).sort((e,t)=>t.timestamp>e.timestamp?1:-1).slice(0,e)}async clearHistory(){await D(`audit_log`)}};function La(e){return e instanceof Date?e:new Date(e)}function Ra(e,t=`ru-RU`){let n=La(e);return isNaN(n.getTime())?`—`:new Intl.DateTimeFormat(t,{day:`2-digit`,month:`2-digit`,year:`numeric`}).format(n)}function za(e,t=`ru-RU`){let n=La(e);return isNaN(n.getTime())?`—`:new Intl.DateTimeFormat(t,{day:`2-digit`,month:`2-digit`,year:`numeric`,hour:`2-digit`,minute:`2-digit`}).format(n)}function Ba(e,t=`ru-RU`){let n=La(e);return isNaN(n.getTime())?`—`:new Intl.DateTimeFormat(t,{hour:`2-digit`,minute:`2-digit`}).format(n)}var Va=class{static getNow(){let e=p.getState().demoDate;return new Date(e)}static getIso(){return p.getState().demoDate}static setTime(e){let t=typeof e==`string`?e:e.toISOString();p.getState().setDemoDate(t)}static advanceHours(e){p.getState().advanceDemoHours(e)}static advanceMinutes(e){p.getState().advanceDemoHours(e/60)}static formatCurrent(e=!0){let t=this.getNow();return e?za(t):Ra(t)}static formatCurrentTime(){return Ba(this.getNow())}};function z(e,t=0){let n=Va.getNow().getTime();return new Date(n+e*864e5+t*36e5).toISOString()}function Ha(e){return z(e).slice(0,10)}function Ua(){return[{name:`ООО «СеверТорг»`,inn:`7701234567`,roles:[`client`,`partner`],city:`Москва`},{name:`АО «ТехноЛаб»`,inn:`7812987654`,roles:[`vendor`],city:`Санкт-Петербург`},{name:`ГК «Айсберг Логистик»`,inn:`5405112233`,roles:[`partner`],city:`Новосибирск`},{name:`ООО «Кофе Эксперт»`,inn:`7722445566`,roles:[`vendor`,`client`],city:`Москва`},{name:`ИП «Михайлов Автодеталь»`,inn:`6677889900`,roles:[`client`],city:`Екатеринбург`},{name:`ООО «Бьюти Групп»`,inn:`7733557799`,roles:[`client`],city:`Москва`},{name:`АО «Ресторанный Синдикат»`,inn:`7801334455`,roles:[`client`,`partner`],city:`Санкт-Петербург`},{name:`ООО «ПакТрейд Упаковка»`,inn:`5001223344`,roles:[`vendor`],city:`Мытищи`},{name:`ООО «СтройСервисМонтаж»`,inn:`7744112233`,roles:[`subcontractor`],city:`Москва`},{name:`ИП «Семенова Студио»`,inn:`2311445566`,roles:[`client`],city:`Краснодар`},{name:`ООО «Гурман Продукт»`,inn:`7715667788`,roles:[`vendor`],city:`Москва`},{name:`АО «ФармаХолдинг»`,inn:`7819998877`,roles:[`client`],city:`Санкт-Петербург`}].map((e,t)=>({id:`comp_seed_${t+1}`,name:e.name,legalName:e.name,inn:e.inn,kpp:`770101001`,roles:[...e.roles],phone:`+7 (495) ${100+t*15}-${10+t*2}-${20+t*3}`,email:`contact@${e.name.toLowerCase().replace(/[^a-z0-9]/g,``)||`company`}.ru`,website:`https://${e.name.toLowerCase().replace(/[^a-z0-9]/g,``)||`company`}.example.com`,address:`г. ${e.city}, ул. Деловая, д. ${t+10}`,status:`active`,audit:{createdAt:z(-30+t),createdById:`usr_sys_01`,updatedAt:z(-2),updatedById:`usr_sys_01`,version:1}}))}function Wa(e){return[[`Алексей`,`Морозов`,`Владимирович`],[`Елена`,`Соколова`,`Сергеевна`],[`Михаил`,`Романов`,`Николаевич`],[`Анна`,`Кузнецова`,`Игоревна`],[`Дмитрий`,`Смирнов`,`Алексеевич`],[`Ольга`,`Попова`,`Дмитриевна`],[`Сергей`,`Васильев`,`Петрович`],[`Татьяна`,`Новикова`,`Олеговна`],[`Иван`,`Федоров`,`Сергеевич`],[`Наталья`,`Морозова`,`Андреевна`],[`Артем`,`Волков`,`Михайлович`],[`Мария`,`Алексеева`,`Юрьевна`],[`Виктор`,`Лебедев`,`Борисович`],[`Юлия`,`Семенова`,`Викторовна`],[`Павел`,`Егоров`,`Анатольевич`],[`Ирина`,`Павлова`,`Константиновна`],[`Роман`,`Козлов`,`Евгеньевич`],[`Екатерина`,`Степанова`,`Валерьевна`],[`Денис`,`Николаев`,`Григорьевич`],[`Светлана`,`Орлова`,`Романовна`],[`Константин`,`Андреев`,`Сергеевич`],[`Алина`,`Макарова`,`Ильинична`],[`Максим`,`Захаров`,`Витальевич`],[`Ксения`,`Зайцева`,`Тимуровна`],[`Владимир`,`Соловьев`,`Максимович`],[`Дарья`,`Борисова`,`Денисовна`],[`Андрей`,`Яковлев`,`Станиславович`],[`Виктория`,`Григорьева`,`Аркадьевна`],[`Илья`,`Романов`,`Вадимович`],[`Полина`,`Воробьева`,`Антоновна`],[`Григорий`,`Сергеев`,`Олегович`],[`Александра`,`Кузьмина`,`Федоровна`]].map(([t,n,r],i)=>{let a=e[i%e.length],o=i%4==0?`partner`:i%3==0?`vendor`:`client`;return{id:`cnt_seed_${i+1}`,firstName:t,lastName:n,middleName:r,roles:[o],companyId:i%2==0?a.id:void 0,jobTitle:i%2==0?`Руководитель направления`:`Частный клиент`,email:`${n.toLowerCase()}.${t.toLowerCase()}@example.com`,phone:`+7 (9${10+i%80}) ${200+i*5}-${10+i%80}-${20+i%70}`,telegram:`@${n.toLowerCase()}_${i+1}`,status:`active`,notes:`Клиентский профиль #${i+1}. Приоритетное обслуживание.`,audit:{createdAt:z(-25+i*.5),createdById:`usr_sys_01`,updatedAt:z(-1),updatedById:`usr_sys_01`,version:1}}})}function Ga(){return[{id:`cat_beverages`,name:`Кофе и чайное сырье`,code:`BEV`},{id:`cat_food`,name:`Кулинария и десерты`,code:`FOOD`},{id:`cat_equip`,name:`Кофейное оборудование`,code:`EQUIP`},{id:`cat_auto`,name:`Автохимия и запчасти`,code:`AUTO`},{id:`cat_beauty`,name:`Косметика и уход`,code:`BEAUTY`},{id:`cat_services`,name:`Сервисные работы и ТО`,code:`SRV`}].map(e=>({id:e.id,name:e.name,code:e.code,audit:{createdAt:z(-60),createdById:`usr_sys_01`,updatedAt:z(-10),updatedById:`usr_sys_01`,version:1}}))}function Ka(e){let t=[];return[{cat:`cat_beverages`,name:`Зерновой кофе Espresso Bar 1кг`,price:185e3,cost:95e3,unit:`кг`},{cat:`cat_beverages`,name:`Зерновой кофе Ethiopia Yirgacheffe 1кг`,price:245e3,cost:13e4,unit:`кг`},{cat:`cat_beverages`,name:`Зерновой кофе Colombia Supremo 1кг`,price:21e4,cost:11e4,unit:`кг`},{cat:`cat_beverages`,name:`Чай листовой Ассам Мокалбари 500г`,price:12e4,cost:6e4,unit:`уп`},{cat:`cat_beverages`,name:`Чай зеленый Сенча Премиум 500г`,price:135e3,cost:7e4,unit:`уп`},{cat:`cat_beverages`,name:`Сироп Карамель Соленая 1л`,price:89e3,cost:42e3,unit:`бут`},{cat:`cat_beverages`,name:`Сироп Ваниль Мадагаскар 1л`,price:89e3,cost:42e3,unit:`бут`},{cat:`cat_beverages`,name:`Какао-порошок Barry Callebaut 1кг`,price:16e4,cost:9e4,unit:`кг`},{cat:`cat_food`,name:`Круассан классический на сливочном масле`,price:22e3,cost:9e3,unit:`шт`},{cat:`cat_food`,name:`Круассан миндальный с кремом`,price:29e3,cost:12e3,unit:`шт`},{cat:`cat_food`,name:`Сэндвич с лососем и авокадо`,price:42e3,cost:21e3,unit:`шт`},{cat:`cat_food`,name:`Сэндвич с индейкой и песто`,price:36e3,cost:17e3,unit:`шт`},{cat:`cat_food`,name:`Чизкейк Нью-Йорк классический`,price:34e3,cost:14e3,unit:`порц`},{cat:`cat_food`,name:`Торт Морковный со сливочным кремом`,price:32e3,cost:13e3,unit:`порц`},{cat:`cat_food`,name:`Гранола с греческим йогуртом и ягодами`,price:28e3,cost:11e3,unit:`порц`},{cat:`cat_food`,name:`Печенье Кукис Шоколадное 80г`,price:15e3,cost:6e3,unit:`шт`},{cat:`cat_equip`,name:`Кофемашина La Marzocco Linea PB 2GR`,price:98e6,cost:72e6,unit:`шт`},{cat:`cat_equip`,name:`Кофемашина Nuova Simonelli Appia Life 2GR`,price:45e6,cost:34e6,unit:`шт`},{cat:`cat_equip`,name:`Кофемолка Mahlkonig E65S GBW`,price:23e6,cost:175e5,unit:`шт`},{cat:`cat_equip`,name:`Водоумягчитель DVA 12л`,price:145e4,cost:85e4,unit:`шт`},{cat:`cat_equip`,name:`Темпер динамометрический 58.5мм`,price:95e3,cost:45e3,unit:`шт`},{cat:`cat_equip`,name:`Питчер молочный Motta 500мл`,price:38e3,cost:18e3,unit:`шт`},{cat:`cat_equip`,name:`Весы бариста Acaia Lunar`,price:28e4,cost:19e4,unit:`шт`},{cat:`cat_auto`,name:`Моторное масло синтетическое 5W-40 4л`,price:45e4,cost:27e4,unit:`канистра`},{cat:`cat_auto`,name:`Моторное масло 0W-20 Eco 4л`,price:52e4,cost:31e4,unit:`канистра`},{cat:`cat_auto`,name:`Масляный фильтр Mann-Filter W712`,price:85e3,cost:42e3,unit:`шт`},{cat:`cat_auto`,name:`Воздушный фильтр C25004`,price:95e3,cost:48e3,unit:`шт`},{cat:`cat_auto`,name:`Колодки тормозные передние керамик`,price:42e4,cost:23e4,unit:`компл`},{cat:`cat_auto`,name:`Тормозная жидкость DOT-4 1л`,price:75e3,cost:35e3,unit:`бут`},{cat:`cat_auto`,name:`Очиститель тормозов аэрозоль 500мл`,price:45e3,cost:2e4,unit:`баллон`},{cat:`cat_auto`,name:`Антифриз готовый красный G12+ 5кг`,price:16e4,cost:85e3,unit:`канистра`},{cat:`cat_beauty`,name:`Шампунь восстанавливающий кератин 1л`,price:32e4,cost:16e4,unit:`бут`},{cat:`cat_beauty`,name:`Маска глубокого увлажнения волос 500мл`,price:28e4,cost:135e3,unit:`банка`},{cat:`cat_beauty`,name:`Масло аргановое для кончиков волос 100мл`,price:21e4,cost:95e3,unit:`флакон`},{cat:`cat_beauty`,name:`Крем питательный для рук с маслом ши 75мл`,price:85e3,cost:38e3,unit:`тюбик`},{cat:`cat_beauty`,name:`Гель-лак премиум оттенок Nude 15мл`,price:65e3,cost:28e3,unit:`флакон`},{cat:`cat_beauty`,name:`Сыворотка для лица с гиалуроновой кислотой 30мл`,price:39e4,cost:18e4,unit:`флакон`},{cat:`cat_beauty`,name:`Набор одноразовых пилок для маникюра (50 шт)`,price:95e3,cost:4e4,unit:`уп`},{cat:`cat_services`,name:`Регламентное ТО кофемашины с декальцинацией`,price:65e4,cost:2e5,unit:`усл`,isSrv:!0},{cat:`cat_services`,name:`Комплексная замена масла и фильтров автомобиля`,price:25e4,cost:8e4,unit:`усл`,isSrv:!0},{cat:`cat_services`,name:`Диагностика ходовой части автомобиля на вибростенде`,price:18e4,cost:5e4,unit:`усл`,isSrv:!0},{cat:`cat_services`,name:`Стрижка женская модельная и укладка`,price:35e4,cost:1e5,unit:`усл`,isSrv:!0},{cat:`cat_services`,name:`Маникюр аппаратный с покрытием гель-лак`,price:28e4,cost:8e4,unit:`усл`,isSrv:!0},{cat:`cat_services`,name:`Настройка и калибровка кофемолки bar-flow`,price:3e5,cost:9e4,unit:`усл`,isSrv:!0},{cat:`cat_services`,name:`Выездной аудит торговой точки и склада`,price:12e5,cost:4e5,unit:`усл`,isSrv:!0}].forEach((n,r)=>{let i=!!n.isSrv,a=e.find(e=>e.id===n.cat);t.push({id:`prd_seed_${r+1}`,sku:`${a?.code||`GEN`}-${1e3+r}`,name:n.name,categoryId:n.cat,categoryName:a?.name||`Общая`,barcode:`4600000${1e5+r}`,price:{minor:n.price,currency:`RUB`},costPrice:{minor:n.cost,currency:`RUB`},unit:n.unit,isService:i,trackInventory:!i,minStockAlert:i?0:10,status:`active`,audit:{createdAt:z(-45+r%20),createdById:`usr_sys_01`,updatedAt:z(-2),updatedById:`usr_sys_01`,version:1}})}),t}function qa(){return[{id:`wh_main`,name:`Центральный распределительный склад (Москва-Юг)`,code:`WH-MAIN`,type:`central`,address:`г. Москва, Варшавское шоссе, д. 148`,isDefault:!0,status:`active`,responsibleUserId:`usr_wh_01`,audit:{createdAt:z(-100),createdById:`usr_sys_01`,updatedAt:z(-5),updatedById:`usr_sys_01`,version:1}},{id:`wh_northwest`,name:`Региональный склад (Санкт-Петербург СЗ)`,code:`WH-NW`,type:`store`,address:`г. Санкт-Петербург, Выборгское шоссе, д. 32`,isDefault:!1,status:`active`,responsibleUserId:`usr_wh_02`,audit:{createdAt:z(-80),createdById:`usr_sys_01`,updatedAt:z(-5),updatedById:`usr_sys_01`,version:1}},{id:`wh_showroom`,name:`Склад-шоурум (Флагманский магазин)`,code:`WH-SHOWROOM`,type:`store`,address:`г. Москва, ул. Большая Дмитровка, д. 7`,isDefault:!1,status:`active`,responsibleUserId:`usr_wh_03`,audit:{createdAt:z(-60),createdById:`usr_sys_01`,updatedAt:z(-5),updatedById:`usr_sys_01`,version:1}}]}function Ja(e,t){let n=[`discovery`,`proposal`,`negotiation`,`contract`,`won`,`lost`];return[`Поставка кофемашин для сети ресторанов`,`Годовой сервисный контракт на автопарк`,`Оптовая партия премиального зернового кофе`,`Оснащение спа-салона уходовой косметикой`,`Комплекс ТО и замена масел для таксопарка`,`Поставка оборудования для 3 новых кофеен`,`Партия сиропов и чайных смесей для бара`,`Договор на поставку автохимии и фильтров`,`Корпоративные подарочные наборы кофе и чая`,`Обновление кухонного и барного инвентаря`,`Запуск франшизной точки: полное оснащение`,`Поставка косметики для сети барбершопов`,`Договор планового технического обслуживания`,`Спецзаказ на партию динамических темперов`,`Поставка расходных материалов для шиномонтажа`,`Кейтеринг и мобильная кофейня на выставку`,`Автоматизация рабочих мест и кассовой зоны`,`Поставка профессиональных весов и посуды`,`Партия синтетических масел 0W-20 для СТО`,`Поставка десертов и выпечки для кофе-поинтов`,`Сертификация и аудит оборудования фабрики`,`Поставка средств для бережного ухода за кожей`,`Замена группы прокладок и клапанов 12 машин`,`Снабжение автосервиса тормозными колодками`,`Партия крафтового какао для кондитерской`].map((r,i)=>{let a=n[i%n.length],o=15e6+i*37%85*1e6,s=e[i%e.length],c=t[i%t.length],l=a===`won`?100:a===`lost`?0:a===`contract`?85:a===`negotiation`?65:40;return{id:`deal_seed_${i+1}`,title:r,pipelineId:`pipe_b2b`,stage:a,amount:{minor:o,currency:`RUB`},probability:l,expectedCloseDate:Ha(5+i%25),contactId:s.id,companyId:c.id,lostReason:a===`lost`?`Бюджет проекта перенесен на следующий квартал`:void 0,audit:{createdAt:z(-20+i%15),createdById:`usr_sys_01`,updatedAt:z(-1),updatedById:`usr_sys_01`,version:1}}})}function Ya(e,t,n){let r=[`delivered`,`delivered`,`completed`,`completed`,`shipped`,`ready`,`confirmed`,`processing`,`draft`,`cancelled`],i=[],a=[],o=[];for(let s=0;s<28;s++){let c=r[s%r.length],l=e[s%e.length],u=n[s%n.length],d=`ORD-2026-${String(1001+s).padStart(4,`0`)}`,f=`ord_seed_${s+1}`,p=2+s%3,m=[],h=0;for(let e=0;e<p;e++){let n=t[(s*3+e)%t.length],r=1+(s+e)%4,i=n.price.minor*r;h+=i,m.push({id:`oi_seed_${s+1}_${e+1}`,productId:n.id,sku:n.sku,name:n.name,quantity:r,unitPrice:n.price,discountMinor:0,totalPrice:{minor:i,currency:`RUB`}})}let g=s%5==0?Math.round(h*.05):0,_=h-g,v=c===`delivered`||c===`completed`||c===`shipped`||s%3==0,y=c===`delivered`||c===`completed`||c===`shipped`,b=v?`paid`:`pending`,x=y?`fulfilled`:c===`ready`?`partially_fulfilled`:`unfulfilled`,S={id:f,orderNumber:d,customerType:`contact`,customerId:l.id,customerName:`${l.firstName} ${l.lastName}`,status:c,paymentStatus:b,fulfillmentStatus:x,items:m,subtotal:{minor:h,currency:`RUB`},discountMinor:g,taxMinor:Math.round(_*.2),shippingMinor:0,total:{minor:_,currency:`RUB`},warehouseId:u.id,channel:s%4==0?`pos`:s%3==0?`web`:`b2b`,shippingAddress:`г. Москва, ул. Клиентская, д. ${s+1}`,audit:{createdAt:z(-18+s*.6),createdById:`usr_sys_01`,updatedAt:z(-1),updatedById:`usr_sys_01`,version:1}};i.push(S),v&&a.push({id:`pmt_seed_${s+1}`,orderId:f,orderNumber:d,amount:{minor:_,currency:`RUB`},method:s%2==0?`bank_transfer`:`card`,status:`completed`,transactionId:`TXN-${1e5+s*17}`,paidAt:z(-17+s*.6),audit:{createdAt:z(-17+s*.6),createdById:`usr_sys_01`,updatedAt:z(-17+s*.6),updatedById:`usr_sys_01`,version:1}}),y&&o.push({id:`shp_seed_${s+1}`,orderId:f,orderNumber:d,warehouseId:u.id,status:c===`delivered`||c===`completed`?`delivered`:`shipped`,trackingNumber:`KRONA-TRK-${7e4+s*11}`,carrier:`Krona Экспресс Доставка`,dispatchedAt:z(-15+s*.6),deliveredAt:c===`delivered`||c===`completed`?z(-14+s*.6):void 0,items:m.map(e=>({productId:e.productId,sku:e.sku,name:e.name,quantity:e.quantity})),audit:{createdAt:z(-15+s*.6),createdById:`usr_sys_01`,updatedAt:z(-1),updatedById:`usr_sys_01`,version:1}})}return{orders:i,payments:a,shipments:o}}function Xa(e,t){let n=[],r=[];return t.forEach(t=>{e.filter(e=>!e.isService).forEach((e,i)=>{let a=30+i*7%150,o=i%5*3,s=a-o;n.push({id:`stk_${t.id}_${e.id}`,warehouseId:t.id,warehouseName:t.name,productId:e.id,sku:e.sku,productName:e.name,onHand:a,reserved:o,available:s,unit:e.unit,minThreshold:e.minStockAlert,audit:{createdAt:z(-40),createdById:`usr_sys_01`,updatedAt:z(-2),updatedById:`usr_sys_01`,version:1}}),i%3==0&&r.push({id:`mov_${t.id}_${e.id}_1`,type:`receipt`,productId:e.id,productName:e.name,sku:e.sku,targetWarehouseId:t.id,quantity:50,referenceNumber:`GR-${1e3+i}`,notes:`Плановое поступление от поставщика`,timestamp:z(-10+i%5),audit:{createdAt:z(-10+i%5),createdById:`usr_sys_01`,updatedAt:z(-10+i%5),updatedById:`usr_sys_01`,version:1}})})}),{stockItems:n,movements:r}}function Za(e){let t=[{id:`acc_main_bank`,name:`Основной расчетный счет (ПАО Сбербанк)`,type:`bank`,balance:{minor:458e6,currency:`RUB`},currency:`RUB`,accountNumber:`40702810938000012345`,bankName:`ПАО СБЕРБАНК`,isDefault:!0,status:`active`,audit:{createdAt:z(-100),createdById:`usr_sys_01`,updatedAt:z(-1),updatedById:`usr_sys_01`,version:1}},{id:`acc_cash_desk`,name:`Касса наличных (Главный офис)`,type:`cash_desk`,balance:{minor:345e5,currency:`RUB`},currency:`RUB`,isDefault:!1,status:`active`,audit:{createdAt:z(-100),createdById:`usr_sys_01`,updatedAt:z(-1),updatedById:`usr_sys_01`,version:1}},{id:`acc_acquiring`,name:`Эквайринг Т-Банк`,type:`acquiring`,balance:{minor:189e6,currency:`RUB`},currency:`RUB`,isDefault:!1,status:`active`,audit:{createdAt:z(-100),createdById:`usr_sys_01`,updatedAt:z(-1),updatedById:`usr_sys_01`,version:1}}],n=[];return e.forEach((e,t)=>{n.push({id:`tx_seed_${t+1}`,transactionNumber:`CFT-2026-${String(1001+t).padStart(4,`0`)}`,type:`inflow`,category:`sales_revenue`,amount:e.amount,accountId:e.method===`cash`?`acc_cash_desk`:`acc_main_bank`,accountName:e.method===`cash`?`Касса наличных`:`Основной расчетный счет`,referenceType:`order_payment`,referenceId:e.id,description:`Поступление оплаты по заказу №${e.orderNumber}`,timestamp:e.paidAt,audit:{createdAt:e.paidAt,createdById:`usr_sys_01`,updatedAt:e.paidAt,updatedById:`usr_sys_01`,version:1}})}),[{cat:`rent`,name:`Аренда помещений склада и офиса за текущий месяц`,amt:38e6,daysAgo:10},{cat:`payroll`,name:`Выплата аванса сотрудникам`,amt:65e6,daysAgo:15},{cat:`supplier_payment`,name:`Оплата партии сырья поставщику ООО «Кофе Эксперт»`,amt:485e5,daysAgo:7},{cat:`taxes`,name:`Уплата квартальных налоговых платежей (УСН/НДС)`,amt:29e6,daysAgo:12},{cat:`utilities`,name:`Оплата электроэнергии и коммунальных услуг`,amt:85e5,daysAgo:4}].forEach((e,t)=>{let r=z(-e.daysAgo);n.push({id:`tx_outflow_${t+1}`,transactionNumber:`CFT-OUT-${2001+t}`,type:`outflow`,category:e.cat,amount:{minor:e.amt,currency:`RUB`},accountId:`acc_main_bank`,accountName:`Основной расчетный счет`,referenceType:`manual`,description:e.name,timestamp:r,audit:{createdAt:r,createdById:`usr_sys_01`,updatedAt:r,updatedById:`usr_sys_01`,version:1}})}),{accounts:t,transactions:n}}function Qa(){return[{id:`aud_seed_1`,entityType:`system`,entityId:`seed_init`,action:`create`,userId:`usr_sys_01`,userName:`Системный администратор`,timestamp:z(-30),summary:`Инициализация демонстрационного контура Krona Universal Business OS`},{id:`aud_seed_2`,entityType:`warehouse`,entityId:`wh_main`,action:`create`,userId:`usr_sys_01`,userName:`Администратор склада`,timestamp:z(-25),summary:`Создан центральный склад «Москва-Юг» с адресным хранением`},{id:`aud_seed_3`,entityType:`company`,entityId:`comp_seed_1`,action:`create`,userId:`usr_sales_01`,userName:`Менеджер по продажам`,timestamp:z(-20),summary:`Зарегистрирован ключевой корпоративный клиент ООО «СеверТорг»`}]}async function $a(e=!1){if(await C(`contact`)>0&&!e)return!1;e&&await S();let t=Ua(),n=Wa(t),r=Ga(),i=Ka(r),a=qa(),o=Ja(n,t),{orders:s,payments:c,shipments:l}=Ya(n,i,a),{stockItems:u,movements:d}=Xa(i,a),{accounts:f,transactions:p}=Za(c),m=Qa();for(let e of t)await _({...e,entityType:`company`});for(let e of n)await _({...e,entityType:`contact`});for(let e of r)await _({...e,entityType:`product_category`});for(let e of i)await _({...e,entityType:`product`});for(let e of a)await _({...e,entityType:`warehouse`});for(let e of o)await _({...e,entityType:`deal`});for(let e of s)await _({...e,entityType:`order`});for(let e of c)await _({...e,entityType:`payment`});for(let e of l)await _({...e,entityType:`shipment`});for(let e of u)await _({...e,entityType:`stock_item`});for(let e of d)await _({...e,entityType:`stock_movement`});for(let e of f)await _({...e,entityType:`account`});for(let e of p)await _({...e,entityType:`cash_flow_transaction`});for(let e of m)await T(`audit_log`,e);for(let[,e]of Object.entries(Pa)){await T(`entities_meta`,e);for(let t of e.fields)await T(`fields_meta`,{...t,entityCode:e.code})}return!0}var eo=new Aa,to=new ja,no=new Ma,ro=new Na,io=new Fa,ao={crm:eo,commerce:to,inventory:no,finance:ro,metadata:io,audit:new Ia};function oo(){return ao}var so=!1;async function co(e=!1){if(!so||e)try{await $a(e),so=!0}catch(e){console.warn(`[MockServices] Failed to initialize IndexedDB storage:`,e)}}function lo(e,t){(0,A.useEffect)(()=>{let n=y.subscribe(e,t);return()=>{n()}},[e,t])}function uo(e){let[t,n]=(0,A.useState)([]),[r,i]=(0,A.useState)(null),[a,o]=(0,A.useState)([]),[s,c]=(0,A.useState)([]),[l,u]=(0,A.useState)(!0),[d,f]=(0,A.useState)(null),p=(0,A.useCallback)(async()=>{try{u(!0),f(null);let t=await io.listEntities();if(n(t),e){let t=await io.getEntity(e);i(t);let[n,r]=await Promise.all([io.listLayouts(e),io.listViews(e)]);o(n),c(r)}}catch(e){f(e instanceof Error?e:Error(String(e)))}finally{u(!1)}},[e]);(0,A.useEffect)(()=>{let e=!0;return Promise.resolve().then(()=>{e&&p()}),()=>{e=!1}},[p]),lo(`entity:changed`,p),lo(`storage:reset`,p),lo(`snapshot:imported`,p);let m=(0,A.useCallback)(async e=>{let t=await io.createEntity(e);return await p(),t},[p]),h=(0,A.useCallback)(async(e,t)=>{let n=await io.updateEntity(e,t);return await p(),n},[p]),g=(0,A.useCallback)(async(e,t)=>{let n=await io.addField(e,t);return await p(),n},[p]),_=(0,A.useCallback)(async(e,t,n)=>{let r=await io.updateField(e,t,n);return await p(),r},[p]),v=(0,A.useCallback)(async(e,t)=>{let n=await io.deleteField(e,t);return await p(),n},[p]);return{entities:t,currentEntity:r,layouts:a,views:s,loading:l,error:d,refetch:p,createEntity:m,updateEntity:h,deleteEntity:(0,A.useCallback)(async e=>{let t=await io.deleteEntity(e);return await p(),t},[p]),addField:g,updateField:_,deleteField:v,saveLayout:(0,A.useCallback)(async e=>{let t=await io.saveLayout(e);return await p(),t},[p]),deleteLayout:(0,A.useCallback)(async e=>{let t=await io.deleteLayout(e);return await p(),t},[p]),saveView:(0,A.useCallback)(async e=>{let t=await io.saveView(e);return await p(),t},[p]),deleteView:(0,A.useCallback)(async e=>{let t=await io.deleteView(e);return await p(),t},[p])}}var fo=[{id:`dashboard`,label:`Главная`,iconName:`LayoutDashboard`,route:`/`,sections:[{id:`overview`,label:`Сводка дня`,route:`/`},{id:`alerts`,label:`Требует внимания`,route:`/?tab=alerts`,badge:`3`},{id:`live`,label:`Операционный статус`,route:`/?tab=live`}]},{id:`operations`,label:`Операции`,iconName:`Workflow`,route:`/operations`,sections:[]},{id:`crm`,label:`CRM`,iconName:`Users`,route:`/crm`,requiredCapability:`crm`,sections:[{id:`overview`,label:`Обзор CRM`,route:`/crm`},{id:`clients`,label:`Клиенты`,route:`/crm/clients`,badge:`1,420`},{id:`deals`,label:`Сделки & Воронка`,route:`/crm/deals`,badge:`18`},{id:`leads`,label:`Лиды`,route:`/crm/leads`,badge:`9`},{id:`companies`,label:`Компании`,route:`/crm/companies`},{id:`segments`,label:`Сегменты`,route:`/crm/segments`},{id:`activities`,label:`Активности`,route:`/crm/activities`}]},{id:`sales`,label:`Продажи`,iconName:`ShoppingBag`,route:`/sales`,requiredCapability:`sales`,sections:[{id:`overview`,label:`Обзор`,route:`/sales`},{id:`orders`,label:`Все заказы`,route:`/sales/orders`,badge:`42`},{id:`invoices`,label:`Счета`,route:`/sales/invoices`},{id:`payments`,label:`Оплаты`,route:`/sales/payments`},{id:`refunds`,label:`Возвраты`,route:`/sales/refunds`},{id:`funnels`,label:`Конверсия`,route:`/sales/funnels`}]},{id:`inventory`,label:`Склад`,iconName:`Boxes`,route:`/inventory`,requiredCapability:`inventory`,sections:[{id:`overview`,label:`Обзор склада`,route:`/inventory`},{id:`items`,label:`Остатки товаров`,route:`/inventory/items`},{id:`warehouses`,label:`Склады & Локации`,route:`/inventory/warehouses`},{id:`batches`,label:`Партии & Сроки`,route:`/inventory/batches`},{id:`movements`,label:`Перемещения`,route:`/inventory/movements`},{id:`writeoffs`,label:`Списания`,route:`/inventory/writeoffs`},{id:`audit`,label:`Инвентаризация`,route:`/inventory/audit`}]},{id:`finance`,label:`Финансы`,iconName:`BadgeDollarSign`,route:`/finance`,requiredCapability:`finance`,sections:[{id:`overview`,label:`Обзор & Сальдо`,route:`/finance`},{id:`cashflow`,label:`ДДС (Cash Flow)`,route:`/finance/cashflow`},{id:`pnl`,label:`P&L (Прибыли и убытки)`,route:`/finance/pnl`},{id:`shifts`,label:`Кассовые смены`,route:`/finance/shifts`,badge:`2 открыты`},{id:`transactions`,label:`Платежи`,route:`/finance/transactions`},{id:`debt`,label:`Задолженности`,route:`/finance/debt`}]},{id:`employees`,label:`Сотрудники`,iconName:`UserCheck`,route:`/employees`,requiredCapability:`employees`,sections:[{id:`list`,label:`Команда`,route:`/employees`},{id:`schedule`,label:`Графики & Смены`,route:`/employees/schedule`},{id:`timetrack`,label:`Рабочее время & Табель`,route:`/employees/timetrack`},{id:`roles`,label:`Должности & Ставки`,route:`/employees/roles`},{id:`kpi`,label:`KPI & Мотивация`,route:`/employees/kpi`}]},{id:`communications`,label:`Коммуникации`,iconName:`MessageSquareText`,route:`/communications`,requiredCapability:`communications`,badge:`3`,sections:[{id:`inbox`,label:`Единый Inbox`,route:`/communications`},{id:`telegram`,label:`Telegram Bot & Чат`,route:`/communications?channel=telegram`},{id:`whatsapp`,label:`WhatsApp`,route:`/communications?channel=whatsapp`},{id:`team`,label:`Командный чат`,route:`/communications?channel=team`},{id:`channels`,label:`Подключенные каналы`,route:`/communications/channels`}]},{id:`helpdesk`,label:`HelpDesk`,iconName:`Headset`,route:`/helpdesk`,requiredCapability:`helpdesk`,sections:[{id:`overview`,label:`Обзор поддержки`,route:`/helpdesk`},{id:`tickets`,label:`Очередь тикетов`,route:`/helpdesk/tickets`,badge:`5`},{id:`sla`,label:`SLA & Эскалации`,route:`/helpdesk/sla`},{id:`kb`,label:`База знаний`,route:`/helpdesk/kb`},{id:`analytics`,label:`Метрики поддержки`,route:`/helpdesk/analytics`}]},{id:`tasks`,label:`Задачи и проекты`,iconName:`CheckSquare`,route:`/tasks`,requiredCapability:`tasks`,sections:[{id:`my`,label:`Мои задачи`,route:`/tasks`},{id:`kanban`,label:`Канбан-доска`,route:`/tasks/kanban`},{id:`projects`,label:`Проекты`,route:`/tasks/projects`},{id:`calendar`,label:`Календарь дедлайнов`,route:`/tasks/calendar`},{id:`overdue`,label:`Просроченные`,route:`/tasks/overdue`,badge:`2`}]},{id:`cms`,label:`Сайты`,iconName:`Globe`,route:`/cms`,requiredCapability:`cms`,sections:[{id:`sites`,label:`Мои сайты`,route:`/cms`},{id:`pages`,label:`Страницы & Конструктор`,route:`/cms/pages`},{id:`forms`,label:`Лид-формы`,route:`/cms/forms`},{id:`media`,label:`Медиабиблиотека`,route:`/cms/media`},{id:`seo`,label:`SEO & Аналитика`,route:`/cms/seo`},{id:`domains`,label:`Домены`,route:`/cms/domains`}]},{id:`marketing`,label:`Маркетинг`,iconName:`Megaphone`,route:`/marketing`,requiredCapability:`marketing`,sections:[{id:`overview`,label:`Обзор маркетинга`,route:`/marketing`},{id:`promos`,label:`Акции & Промокоды`,route:`/marketing/promos`},{id:`broadcasts`,label:`Рассылки`,route:`/marketing/broadcasts`},{id:`content`,label:`Контент-план`,route:`/marketing/content`},{id:`ai_marketer`,label:`AI Маркетолог`,route:`/marketing/ai`}]},{id:`analytics`,label:`Аналитика`,iconName:`BarChart3`,route:`/analytics`,requiredCapability:`analytics`,sections:[{id:`overview`,label:`Общий дашборд`,route:`/analytics`},{id:`sales_bi`,label:`Продажи & Выручка`,route:`/analytics/sales`},{id:`abc`,label:`ABC/XYZ анализ`,route:`/analytics/abc`},{id:`retention`,label:`Когорты & LTV`,route:`/analytics/retention`},{id:`forecasts`,label:`ИИ-прогнозы`,route:`/analytics/forecasts`}]},{id:`automation`,label:`Автоматизация`,iconName:`Cpu`,route:`/automation`,requiredCapability:`automation`,sections:[{id:`scenarios`,label:`Сценарии & Workflows`,route:`/automation`},{id:`builder`,label:`Конструктор цепочек`,route:`/automation/builder`},{id:`triggers`,label:`Триггеры событий`,route:`/automation/triggers`},{id:`history`,label:`Лог выполнения`,route:`/automation/history`}]},{id:`ai`,label:`ИИ-центр`,iconName:`Sparkles`,route:`/ai`,requiredCapability:`ai`,badge:`✦`,sections:[{id:`chat`,label:`Диалог с AI`,route:`/ai`},{id:`team`,label:`AI Команда`,route:`/ai/team`},{id:`tasks`,label:`ИИ-задачи в фоне`,route:`/ai/tasks`},{id:`history`,label:`История & Контекст`,route:`/ai/history`},{id:`usage`,label:`Лимиты & Токены`,route:`/ai/usage`}]},{id:`apps`,label:`Приложения`,iconName:`Grid`,route:`/apps`,sections:[{id:`catalog`,label:`Каталог расширений`,route:`/apps`},{id:`installed`,label:`Установленные`,route:`/apps/installed`},{id:`integrations`,label:`Интеграции`,route:`/apps/integrations`}]},{id:`settings`,label:`Настройки`,iconName:`Settings`,route:`/settings`,sections:[{id:`company`,label:`Организация & Точки`,route:`/settings`},{id:`profile`,label:`Бизнес-профиль`,route:`/settings/profile`},{id:`capabilities`,label:`Configuration Studio`,route:`/settings/capabilities`},{id:`users`,label:`Пользователи & Роли`,route:`/settings/users`},{id:`integrations`,label:`API & Webhooks`,route:`/settings/api`},{id:`appearance`,label:`Тема & Брендинг`,route:`/settings/appearance`}]}],po={owner:{id:`owner`,label:`Владелец бизнеса`,badge:`Owner`,description:`Полный доступ ко всем модулям, финансовой аналитике, настройкам и AI-центру`,allowedModules:[`*`],defaultRoute:`/`},administrator:{id:`administrator`,label:`Администратор`,badge:`Admin`,description:`Управление процессами, персоналом, точками, правами и операционной деятельностью`,allowedModules:[`*`],defaultRoute:`/`},manager:{id:`manager`,label:`Управляющий`,badge:`Manager`,description:`Операции, смены, заказы, доставка, склад, контроль персонала и операционная аналитика`,allowedModules:[`dashboard`,`operations`,`crm`,`sales`,`inventory`,`employees`,`tasks`,`communications`,`analytics`],defaultRoute:`/operations`},cashier:{id:`cashier`,label:`Кассир / Оператор`,badge:`POS`,description:`Кассовый терминал, оформление заказов, прием оплаты, клиентская база`,allowedModules:[`operations`,`sales`,`crm`],defaultRoute:`/operations/pos`},cook:{id:`cook`,label:`Повар / Шеф-повар`,badge:`KDS`,description:`Кухонный дисплей (KDS), отметка готовности блюд, стоп-лист`,allowedModules:[`operations`],defaultRoute:`/operations/kds`},courier:{id:`courier`,label:`Курьер / Доставка`,badge:`Courier`,description:`Мобильный экран доставки: маршруты, заказы, адрес клиента, отметка вручения`,allowedModules:[`operations`],defaultRoute:`/operations/courier`},specialist:{id:`specialist`,label:`Специалист / Мастер`,badge:`Service`,description:`Журнал записи, заказ-наряды постов, расписание смен, услуги`,allowedModules:[`operations`,`crm`,`tasks`],defaultRoute:`/operations/work-orders`},marketer:{id:`marketer`,label:`Маркетолог`,badge:`Marketing`,description:`Маркетинговые кампании, CRM сегменты, сайты/CMS, рассылки, сквозная аналитика, AI`,allowedModules:[`dashboard`,`crm`,`marketing`,`cms`,`communications`,`analytics`,`ai`],defaultRoute:`/marketing`},warehouse:{id:`warehouse`,label:`Складской оператор`,badge:`Warehouse`,description:`Приходные накладные, списания, партии, инвентаризация и поставщики`,allowedModules:[`operations`,`inventory`,`tasks`],defaultRoute:`/operations/inventory`},support:{id:`support`,label:`Специалист поддержки`,badge:`Support`,description:`Очередь тикетов, омниканальные чаты, база знаний и SLA`,allowedModules:[`helpdesk`,`communications`,`crm`],defaultRoute:`/helpdesk`}},mo={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};mo.node;var ho=a(mo),go={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};go.node;var _o=a(go),vo={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};vo.node;var yo=a(vo),bo={name:`arrow-up-right`,size:24,node:[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]};bo.node;var xo=a(bo),So={name:`badge-dollar-sign`,size:24,node:[[`path`,{d:`M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z`,key:`3c2336`}],[`path`,{d:`M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8`,key:`1h4pet`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}]]};So.node;var Co=a(So),wo={name:`bell-ring`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M22 8c0-2.3-.8-4.3-2-6`,key:`5bb3ad`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}],[`path`,{d:`M4 2C2.8 3.7 2 5.7 2 8`,key:`tap9e0`}]]};wo.node;var To=a(wo),Eo={name:`bell`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]};Eo.node;var Do=a(Eo),Oo={name:`boxes`,size:24,node:[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]};Oo.node;var ko=a(Oo),Ao={name:`building-2`,size:24,node:[[`path`,{d:`M10 12h4`,key:`a56b0p`}],[`path`,{d:`M10 8h4`,key:`1sr2af`}],[`path`,{d:`M14 21v-3a2 2 0 0 0-4 0v3`,key:`1rgiei`}],[`path`,{d:`M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2`,key:`secmi2`}],[`path`,{d:`M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16`,key:`16ra0t`}]]};Ao.node;var jo=a(Ao),Mo={name:`calendar`,size:24,node:[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]};Mo.node;var No=a(Mo),Po={name:`car`,size:24,node:[[`path`,{d:`M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2`,key:`5owen`}],[`circle`,{cx:`7`,cy:`17`,r:`2`,key:`u2ysq9`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}],[`circle`,{cx:`17`,cy:`17`,r:`2`,key:`axvx0g`}]]};Po.node;var Fo=a(Po),Io={name:`chart-column`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]],aliases:[`bar-chart-3`]};Io.node;var Lo=a(Io),Ro={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Ro.node;var zo=a(Ro),Bo={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};Bo.node;var Vo=a(Bo),Ho={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};Ho.node;var Uo=a(Ho),B={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};B.node;var V=a(B),Wo={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};Wo.node;var Go=a(Wo),Ko={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};Ko.node;var qo=a(Ko),Jo={name:`circle-check-big`,size:24,node:[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]],aliases:[`check-circle`]};Jo.node;var Yo=a(Jo),Xo={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};Xo.node;var Zo=a(Xo),Qo={name:`circle-user`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}],[`path`,{d:`M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662`,key:`154egf`}]],aliases:[`user-circle`]};Qo.node;var $o=a(Qo),es={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]};es.node;var ts=a(es),ns={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};ns.node;var rs=a(ns),is={name:`compass`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]};is.node;var as=a(is),os={name:`cpu`,size:24,node:[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]};os.node;var ss=a(os),cs={name:`credit-card`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`2`,key:`ynyp8z`}],[`line`,{x1:`2`,x2:`22`,y1:`10`,y2:`10`,key:`1b3vmo`}]]};cs.node;var ls=a(cs),us={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};us.node;var ds=a(us),fs={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};fs.node;var ps=a(fs),ms={name:`file-check-corner`,size:24,node:[[`path`,{d:`M10.5 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v6`,key:`g5mvt7`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m14 20 2 2 4-4`,key:`15kota`}]],aliases:[`file-check-2`]};ms.node;var hs=a(ms),gs={name:`flask-conical`,size:24,node:[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]};gs.node;var _s=a(gs),vs={name:`globe`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]};vs.node;var ys=a(vs),bs={name:`grid-3x3`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]],aliases:[`grid`,`grid-3-x-3`]};bs.node;var xs=a(bs),Ss={name:`hash`,size:24,node:[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]};Ss.node;var Cs=a(Ss),ws={name:`headset`,size:24,node:[[`path`,{d:`M3 11h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-5Zm0 0a9 9 0 1 1 18 0m0 0v5a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3Z`,key:`12oyoe`}],[`path`,{d:`M21 16v2a4 4 0 0 1-4 4h-5`,key:`1x7m43`}]]};ws.node;var Ts=a(ws),Es={name:`house`,size:24,node:[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]],aliases:[`home`]};Es.node;var Ds=a(Es),Os={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};Os.node;var ks=a(Os),As={name:`layers`,size:24,node:[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]],aliases:[`layers-3`]};As.node;var js=a(As),Ms={name:`layout-dashboard`,size:24,node:[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]};Ms.node;var Ns=a(Ms),Ps={name:`lock`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]};Ps.node;var Fs=a(Ps),Is={name:`map-pin`,size:24,node:[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]};Is.node;var Ls=a(Is),Rs={name:`megaphone`,size:24,node:[[`path`,{d:`M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z`,key:`q8bfy3`}],[`path`,{d:`M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14`,key:`1853fq`}],[`path`,{d:`M8 6v8`,key:`15ugcq`}]]};Rs.node;var zs=a(Rs),Bs={name:`menu`,size:24,node:[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]};Bs.node;var Vs=a(Bs),Hs={name:`message-square-text`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]};Hs.node;var Us=a(Hs),Ws={name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]};Ws.node;var Gs=a(Ws),Ks={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]};Ks.node;var qs=a(Ks),Js={name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]};Js.node;var Ys=a(Js),Xs={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};Xs.node;var Zs=a(Xs),Qs={name:`octagon-alert`,size:24,node:[[`path`,{d:`M12 16h.01`,key:`1drbdi`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z`,key:`1fd625`}]],aliases:[`alert-octagon`]};Qs.node;var $s=a(Qs),ec={name:`package`,size:24,node:[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]};ec.node;var tc=a(ec),nc={name:`pause`,size:24,node:[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]};nc.node;var rc=a(nc),ic={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};ic.node;var ac=a(ic),oc={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};oc.node;var sc=a(oc),cc={name:`radio`,size:24,node:[[`path`,{d:`M16.247 7.761a6 6 0 0 1 0 8.478`,key:`1fwjs5`}],[`path`,{d:`M19.075 4.933a10 10 0 0 1 0 14.134`,key:`ehdyv1`}],[`path`,{d:`M4.925 19.067a10 10 0 0 1 0-14.134`,key:`1q22gi`}],[`path`,{d:`M7.753 16.239a6 6 0 0 1 0-8.478`,key:`r2q7qm`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]};cc.node;var lc=a(cc),uc={name:`receipt`,size:24,node:[[`path`,{d:`M12 17V7`,key:`pyj7ub`}],[`path`,{d:`M16 8h-6a2 2 0 0 0 0 4h4a2 2 0 0 1 0 4H8`,key:`1elt7d`}],[`path`,{d:`M4 3a1 1 0 0 1 1-1 1.3 1.3 0 0 1 .7.2l.933.6a1.3 1.3 0 0 0 1.4 0l.934-.6a1.3 1.3 0 0 1 1.4 0l.933.6a1.3 1.3 0 0 0 1.4 0l.933-.6a1.3 1.3 0 0 1 1.4 0l.934.6a1.3 1.3 0 0 0 1.4 0l.933-.6A1.3 1.3 0 0 1 19 2a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1 1.3 1.3 0 0 1-.7-.2l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.934.6a1.3 1.3 0 0 1-1.4 0l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-1.4 0l-.934-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-.7.2 1 1 0 0 1-1-1z`,key:`ycz6yz`}]]};uc.node;var dc=a(uc),fc={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};fc.node;var pc=a(fc),mc={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};mc.node;var hc=a(mc),gc={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};gc.node;var _c=a(gc),vc={name:`send`,size:24,node:[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]};vc.node;var yc=a(vc),bc={name:`server`,size:24,node:[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]};bc.node;var xc=a(bc),Sc={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};Sc.node;var Cc=a(Sc),wc={name:`shield-alert`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]};wc.node;var Tc=a(wc),Ec={name:`shield-check`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]};Ec.node;var Dc=a(Ec),Oc={name:`shield`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]};Oc.node;var kc=a(Oc),Ac={name:`shopping-bag`,size:24,node:[[`path`,{d:`M16 10a4 4 0 0 1-8 0`,key:`1ltviw`}],[`path`,{d:`M3.103 6.034h17.794`,key:`awc11p`}],[`path`,{d:`M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z`,key:`o988cm`}]]};Ac.node;var jc=a(Ac),Mc={name:`sliders-horizontal`,size:24,node:[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]};Mc.node;var Nc=a(Mc),Pc={name:`sliders-vertical`,size:24,node:[[`path`,{d:`M10 8h4`,key:`1sr2af`}],[`path`,{d:`M12 21v-9`,key:`17s77i`}],[`path`,{d:`M12 8V3`,key:`13r4qs`}],[`path`,{d:`M17 16h4`,key:`h1uq16`}],[`path`,{d:`M19 12V3`,key:`o1uvq1`}],[`path`,{d:`M19 21v-5`,key:`qua636`}],[`path`,{d:`M3 14h4`,key:`bcjad9`}],[`path`,{d:`M5 10V3`,key:`cb8scm`}],[`path`,{d:`M5 21v-7`,key:`1w1uti`}]],aliases:[`sliders`]};Pc.node;var Fc=a(Pc),Ic={name:`smartphone`,size:24,node:[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]};Ic.node;var Lc=a(Ic),Rc={name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]};Rc.node;var zc=a(Rc),Bc={name:`square-check-big`,size:24,node:[[`path`,{d:`M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344`,key:`2acyp4`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]],aliases:[`check-square`]};Bc.node;var Vc=a(Bc),Hc={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};Hc.node;var Uc=a(Hc),Wc={name:`tablet`,size:24,node:[[`rect`,{width:`16`,height:`20`,x:`4`,y:`2`,rx:`2`,ry:`2`,key:`76otgf`}],[`line`,{x1:`12`,x2:`12.01`,y1:`18`,y2:`18`,key:`1dp563`}]]};Wc.node;var Gc=a(Wc),Kc={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};Kc.node;var qc=a(Kc),Jc={name:`trending-down`,size:24,node:[[`path`,{d:`M16 17h6v-6`,key:`t6n2it`}],[`path`,{d:`m22 17-8.5-8.5-5 5L2 7`,key:`x473p`}]]};Jc.node;var Yc=a(Jc),Xc={name:`trending-up`,size:24,node:[[`path`,{d:`M16 7h6v6`,key:`box55l`}],[`path`,{d:`m22 7-8.5 8.5-5-5L2 17`,key:`1t1m79`}]]};Xc.node;var Zc=a(Xc),Qc={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]};Qc.node;var $c=a(Qc),el={name:`user-check`,size:24,node:[[`path`,{d:`m16 11 2 2 4-4`,key:`9rsbq5`}],[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]};el.node;var tl=a(el),nl={name:`user-plus`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`19`,x2:`19`,y1:`8`,y2:`14`,key:`1bvyxn`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]};nl.node;var rl=a(nl),il={name:`users`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]};il.node;var al=a(il),ol={name:`workflow`,size:24,node:[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]};ol.node;var sl=a(ol),cl={name:`wrench`,size:24,node:[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]};cl.node;var ll=a(cl),ul={name:`zap`,size:24,node:[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]};ul.node;var dl=a(ul),H=u(),fl={LayoutDashboard:(0,H.jsx)(Ns,{className:`w-4 h-4 shrink-0`}),Workflow:(0,H.jsx)(sl,{className:`w-4 h-4 shrink-0 text-krona-gold`}),Users:(0,H.jsx)(al,{className:`w-4 h-4 shrink-0`}),ShoppingBag:(0,H.jsx)(jc,{className:`w-4 h-4 shrink-0`}),Boxes:(0,H.jsx)(ko,{className:`w-4 h-4 shrink-0`}),BadgeDollarSign:(0,H.jsx)(Co,{className:`w-4 h-4 shrink-0`}),UserCheck:(0,H.jsx)(tl,{className:`w-4 h-4 shrink-0`}),MessageSquareText:(0,H.jsx)(Us,{className:`w-4 h-4 shrink-0`}),Headset:(0,H.jsx)(Ts,{className:`w-4 h-4 shrink-0`}),CheckSquare:(0,H.jsx)(Vc,{className:`w-4 h-4 shrink-0`}),Globe:(0,H.jsx)(ys,{className:`w-4 h-4 shrink-0`}),Megaphone:(0,H.jsx)(zs,{className:`w-4 h-4 shrink-0`}),BarChart3:(0,H.jsx)(Lo,{className:`w-4 h-4 shrink-0`}),Cpu:(0,H.jsx)(ss,{className:`w-4 h-4 shrink-0`}),Sparkles:(0,H.jsx)(zc,{className:`w-4 h-4 shrink-0 text-krona-gold`}),Grid:(0,H.jsx)(xs,{className:`w-4 h-4 shrink-0`}),Settings:(0,H.jsx)(Cc,{className:`w-4 h-4 shrink-0`})},pl=()=>{let[e,t]=(0,A.useState)(!1),{currentRoleId:n,getActiveCapabilities:r}=Oa(),{entities:i}=uo(),a=i.filter(e=>!e.isSystem),o=r(),s=po[n],c=fo.filter(e=>!(!s.allowedModules.includes(`*`)&&!s.allowedModules.includes(e.id)||e.requiredCapability&&!o[e.requiredCapability]));return(0,H.jsxs)(`aside`,{className:`relative h-screen bg-[#252722] text-[#D8D8D0] hidden md:flex flex-col border-r border-[#3A3D35] transition-all duration-200 z-20 select-none ${e?`w-16`:`w-56`}`,children:[(0,H.jsxs)(`div`,{className:`h-14 px-3.5 flex items-center justify-between border-b border-[#3A3D35] bg-[#20221E]`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2.5 overflow-hidden`,children:[(0,H.jsx)(`img`,{src:`/branding/krona-symbol.png`,alt:`Крона`,className:`w-8 h-8 object-contain shrink-0`}),!e&&(0,H.jsxs)(`div`,{className:`flex flex-col min-w-0 leading-tight select-none`,children:[(0,H.jsx)(`span`,{className:`text-sm font-bold tracking-wider text-[#E5B842] uppercase truncate`,children:`Крона`}),(0,H.jsx)(`span`,{className:`text-[9px] uppercase tracking-widest text-[#B78335] font-semibold`,children:`Business OS`})]})]}),(0,H.jsx)(`button`,{onClick:()=>t(!e),className:`p-1 rounded text-[#858980] hover:text-[#D8D8D0] hover:bg-[#30332C] transition-colors`,title:e?`Развернуть меню`:`Свернуть меню`,children:e?(0,H.jsx)(V,{className:`w-4 h-4`}):(0,H.jsx)(Uo,{className:`w-4 h-4`})})]}),(0,H.jsxs)(`div`,{className:`flex-1 overflow-y-auto py-2.5 px-2 space-y-0.5`,children:[c.map(t=>(0,H.jsx)(ua,{to:t.route,end:t.route===`/`,className:({isActive:e})=>`group relative flex items-center gap-2.5 px-2.5 py-2 rounded-md text-xs font-medium transition-all ${e?`bg-[#34382F] text-[#F5F0E5] font-semibold`:`text-[#BFC1B9] hover:text-[#F5F0E5] hover:bg-[#30332C]`}`,title:e?t.label:void 0,children:({isActive:n})=>(0,H.jsxs)(H.Fragment,{children:[n&&(0,H.jsx)(`div`,{className:`absolute left-0 top-1.5 bottom-1.5 w-1 bg-[#B78335] rounded-r`}),(0,H.jsx)(`div`,{className:`shrink-0 ${n?`text-[#D4B16D]`:`text-[#BFC1B9]`}`,children:fl[t.iconName]||(0,H.jsx)(Ns,{className:`w-4 h-4 shrink-0`})}),!e&&(0,H.jsxs)(`div`,{className:`flex-1 flex items-center justify-between truncate`,children:[(0,H.jsx)(`span`,{className:`truncate`,children:t.label}),t.badge&&(0,H.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded-full bg-[#3A3D35] text-[#D8D8D0] font-mono`,children:t.badge})]})]})},t.id)),a.length>0&&(0,H.jsxs)(`div`,{className:`pt-2 mt-2 border-t border-[#3A3D35]/80`,children:[!e&&(0,H.jsx)(`div`,{className:`px-2 pb-1 text-[10px] font-semibold uppercase tracking-wider text-[#858980]`,children:`Пользовательские модули`}),a.map(t=>(0,H.jsx)(ua,{to:`/entities/${t.code}`,className:({isActive:e})=>`group relative flex items-center gap-2.5 px-2.5 py-1.5 rounded-md text-xs font-medium transition-all ${e?`bg-[#34382F] text-[#F5F0E5] font-semibold`:`text-[#BFC1B9] hover:text-[#F5F0E5] hover:bg-[#30332C]`}`,title:e?t.name:void 0,children:({isActive:n})=>(0,H.jsxs)(H.Fragment,{children:[n&&(0,H.jsx)(`div`,{className:`absolute left-0 top-1.5 bottom-1.5 w-1 bg-[#B78335] rounded-r`}),(0,H.jsx)(`div`,{className:`shrink-0 text-krona-gold`,children:(0,H.jsx)(zc,{className:`w-3.5 h-3.5`})}),!e&&(0,H.jsx)(`span`,{className:`truncate text-xs`,children:t.name})]})},t.code))]}),(0,H.jsx)(`div`,{className:`pt-1`,children:(0,H.jsx)(ua,{to:`/settings/entities`,className:({isActive:e})=>`group relative flex items-center gap-2.5 px-2.5 py-1.5 rounded-md text-xs font-medium transition-all ${e?`bg-[#34382F] text-[#F5F0E5] font-semibold`:`text-[#BFC1B9] hover:text-[#F5F0E5] hover:bg-[#30332C]`}`,title:e?`Конструктор сущностей`:void 0,children:({isActive:t})=>(0,H.jsxs)(H.Fragment,{children:[t&&(0,H.jsx)(`div`,{className:`absolute left-0 top-1.5 bottom-1.5 w-1 bg-[#B78335] rounded-r`}),(0,H.jsx)(`div`,{className:`shrink-0 text-krona-green`,children:(0,H.jsx)(sl,{className:`w-3.5 h-3.5`})}),!e&&(0,H.jsx)(`span`,{className:`truncate text-xs`,children:`Конструктор сущностей`})]})})})]}),(0,H.jsx)(`div`,{className:`p-2.5 border-t border-[#3A3D35] bg-[#20221E]/60 text-xs`,children:e?(0,H.jsx)(`div`,{className:`flex justify-center`,title:`Текущая роль: ${s.label}`,children:(0,H.jsx)(`div`,{className:`w-2.5 h-2.5 rounded-full bg-krona-green`})}):(0,H.jsx)(`div`,{className:`flex items-center justify-between`,children:(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`div`,{className:`w-2 h-2 rounded-full bg-krona-green animate-pulse`}),(0,H.jsxs)(`div`,{className:`truncate`,children:[(0,H.jsx)(`div`,{className:`text-[11px] font-semibold text-[#F5F0E5] truncate`,children:s.label}),(0,H.jsxs)(`div`,{className:`text-[9px] text-[#858980]`,children:[`RBAC: `,s.badge]})]})]})})})]})},ml=A.forwardRef(({icon:t,"aria-label":n,size:r=`md`,className:a,...o},c)=>(0,H.jsx)(i,{ref:c,size:`icon`,"aria-label":n,className:e(s({sm:`p-1.5 text-xs`,md:`p-2 text-sm`,lg:`p-2.5 text-base`}[r],a)),...o,children:t}));ml.displayName=`IconButton`;var hl=A.forwardRef(({label:t,error:n,helperText:r,icon:i,endIcon:a,className:o,id:c,...l},u)=>{let d=(0,A.useId)(),f=c||d,p=n?`${f}-error`:void 0,m=r?`${f}-helper`:void 0;return(0,H.jsxs)(`div`,{className:`w-full flex flex-col gap-1.5 text-left`,children:[t&&(0,H.jsx)(`label`,{htmlFor:f,className:`text-xs font-medium text-krona-secondary select-none`,children:t}),(0,H.jsxs)(`div`,{className:`relative flex items-center`,children:[i&&(0,H.jsx)(`div`,{className:`absolute left-3 text-krona-secondary pointer-events-none flex items-center`,"aria-hidden":`true`,children:i}),(0,H.jsx)(`input`,{ref:u,id:f,"aria-invalid":n?`true`:`false`,"aria-describedby":p||m,className:e(s(`w-full bg-krona-surface text-krona-primary border border-krona-border rounded-md px-3 py-2 text-sm placeholder:text-krona-disabled transition-colors focus:outline-none focus:border-krona-green focus:ring-2 focus:ring-krona-green/20 disabled:opacity-50`,i&&`pl-9`,a&&`pr-9`,n&&`border-krona-danger focus:border-krona-danger focus:ring-krona-danger/20`,o)),...l}),a&&(0,H.jsx)(`div`,{className:`absolute right-3 text-krona-secondary pointer-events-none flex items-center`,"aria-hidden":`true`,children:a})]}),n&&(0,H.jsx)(`span`,{id:p,role:`alert`,className:`text-xs text-krona-danger`,children:n}),r&&!n&&(0,H.jsx)(`span`,{id:m,className:`text-xs text-krona-secondary`,children:r})]})});hl.displayName=`Input`;var gl=A.forwardRef(({label:t,error:n,helperText:r,options:i,className:a,id:o,...c},l)=>{let u=(0,A.useId)(),d=o||u,f=n?`${d}-error`:void 0,p=r?`${d}-helper`:void 0;return(0,H.jsxs)(`div`,{className:`w-full flex flex-col gap-1.5 text-left`,children:[t&&(0,H.jsx)(`label`,{htmlFor:d,className:`text-xs font-medium text-krona-secondary select-none`,children:t}),(0,H.jsxs)(`div`,{className:`relative flex items-center`,children:[(0,H.jsx)(`select`,{ref:l,id:d,"aria-invalid":n?`true`:`false`,"aria-describedby":f||p,className:e(s(`w-full appearance-none bg-krona-surface text-krona-primary border border-krona-border rounded-md px-3 py-2 pr-9 text-sm transition-colors focus:outline-none focus:border-krona-green focus:ring-2 focus:ring-krona-green/20 disabled:opacity-50 cursor-pointer`,n&&`border-krona-danger focus:border-krona-danger focus:ring-krona-danger/20`,a)),...c,children:i.map(e=>(0,H.jsx)(`option`,{value:e.value,disabled:e.disabled,children:e.label},e.value))}),(0,H.jsx)(`div`,{className:`absolute right-3 pointer-events-none text-krona-secondary`,"aria-hidden":`true`,children:(0,H.jsx)(Vo,{className:`w-4 h-4`})})]}),n&&(0,H.jsx)(`span`,{id:f,role:`alert`,className:`text-xs text-krona-danger`,children:n}),r&&!n&&(0,H.jsx)(`span`,{id:p,className:`text-xs text-krona-secondary`,children:r})]})});gl.displayName=`Select`;var _l=A.forwardRef(({label:t,description:n,error:r,className:i,id:a,checked:o,...c},l)=>{let u=(0,A.useId)(),d=a||u;return(0,H.jsxs)(`div`,{className:`flex items-start gap-2.5 text-left`,children:[(0,H.jsxs)(`div`,{className:`relative flex items-center justify-center mt-0.5`,children:[(0,H.jsx)(`input`,{ref:l,id:d,type:`checkbox`,checked:o,className:`peer sr-only`,...c}),(0,H.jsx)(`label`,{htmlFor:d,className:e(s(`w-4 h-4 rounded border border-krona-border bg-krona-surface peer-checked:bg-krona-green peer-checked:border-krona-green flex items-center justify-center transition-all cursor-pointer peer-focus-visible:ring-2 peer-focus-visible:ring-krona-green/30 peer-disabled:opacity-50 peer-disabled:cursor-not-allowed`,r&&`border-krona-danger`,i)),children:o&&(0,H.jsx)(zo,{className:`w-3 h-3 text-white stroke-[3]`,"aria-hidden":`true`})})]}),(t||n)&&(0,H.jsxs)(`div`,{className:`flex flex-col`,children:[t&&(0,H.jsx)(`label`,{htmlFor:d,className:`text-sm font-medium text-krona-primary cursor-pointer select-none`,children:t}),n&&(0,H.jsx)(`p`,{className:`text-xs text-krona-secondary mt-0.5`,children:n}),r&&(0,H.jsx)(`span`,{role:`alert`,className:`text-xs text-krona-danger mt-0.5`,children:r})]})]})});_l.displayName=`Checkbox`;var vl=({title:t,value:n,change:r,subtitle:i,icon:a,actionText:o,onAction:c,className:l})=>(0,H.jsxs)(`div`,{className:e(s(`bg-krona-surface border border-krona-border rounded-lg p-4 shadow-krona-soft flex flex-col justify-between transition-all duration-150 hover:border-krona-border-strong`,l)),children:[(0,H.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,H.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,H.jsx)(`p`,{className:`text-xs font-medium text-krona-secondary truncate`,children:t}),(0,H.jsxs)(`div`,{className:`mt-1.5 flex items-baseline gap-2`,children:[(0,H.jsx)(`span`,{className:`text-2xl font-semibold text-krona-primary tracking-tight`,children:n}),r&&(0,H.jsxs)(`span`,{className:s(`inline-flex items-center text-xs font-medium px-1.5 py-0.5 rounded`,r.trend===`up`&&`text-status-success-text bg-status-success-soft`,r.trend===`down`&&`text-status-danger-text bg-status-danger-soft`,r.trend===`neutral`&&`text-krona-secondary bg-krona-muted`),children:[r.trend===`up`&&(0,H.jsx)(Zc,{className:`w-3 h-3 mr-0.5`,"aria-hidden":`true`}),r.trend===`down`&&(0,H.jsx)(Yc,{className:`w-3 h-3 mr-0.5`,"aria-hidden":`true`}),r.trend===`neutral`&&(0,H.jsx)(qs,{className:`w-3 h-3 mr-0.5`,"aria-hidden":`true`}),r.value]})]})]}),a&&(0,H.jsx)(`div`,{className:`p-2.5 rounded-lg bg-krona-workspace border border-krona-border/60 text-krona-secondary shrink-0`,children:a})]}),(i||o)&&(0,H.jsxs)(`div`,{className:`mt-3 pt-2.5 border-t border-krona-border/40 flex items-center justify-between text-xs text-krona-secondary`,children:[i&&(0,H.jsx)(`span`,{children:i}),o&&(0,H.jsxs)(`button`,{type:`button`,onClick:c,className:`text-krona-green hover:text-krona-green-hover font-medium hover:underline focus:outline-none ml-auto cursor-pointer`,children:[o,` →`]})]})]}),yl=({isOpen:e,onClose:n,title:r,subtitle:a,children:o,footer:s,maxWidth:c,size:l,closeOnBackdropClick:u=!0})=>{let d=l||c||`md`,f=(0,A.useRef)(null),p=(0,A.useRef)(null),m=(0,A.useId)(),h=(0,A.useId)();if((0,A.useEffect)(()=>{if(!e)return;p.current=document.activeElement;let t=f.current;if(t){let e=t.querySelectorAll(`button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])`);e.length>0&&e[0].focus()}let r=e=>{if(e.key===`Escape`){e.preventDefault(),n();return}if(e.key===`Tab`){let t=f.current;if(!t)return;let n=Array.from(t.querySelectorAll(`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`)).filter(e=>e.offsetParent!==null);if(n.length===0){e.preventDefault();return}let r=n[0],i=n[n.length-1];e.shiftKey?document.activeElement===r&&(e.preventDefault(),i.focus()):document.activeElement===i&&(e.preventDefault(),r.focus())}};return window.addEventListener(`keydown`,r),()=>{window.removeEventListener(`keydown`,r),p.current&&typeof p.current.focus==`function`&&p.current.focus()}},[e,n]),!e)return null;let g={sm:`max-w-sm`,md:`max-w-md`,lg:`max-w-lg`,xl:`max-w-xl`,"2xl":`max-w-2xl`,"3xl":`max-w-3xl`,"4xl":`max-w-4xl`};return(0,H.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4`,children:[(0,H.jsx)(`div`,{className:`fixed inset-0 krona-overlay transition-opacity duration-200 cursor-pointer`,onClick:u?n:void 0,"aria-hidden":`true`}),(0,H.jsxs)(`div`,{ref:f,className:`relative w-full ${g[d]||g.md} bg-krona-raised border border-krona-border rounded-xl shadow-krona-modal z-10 flex flex-col max-h-[90vh] overflow-hidden animate-fade-in`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":m,"aria-describedby":a?h:void 0,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between px-6 py-4 border-b border-krona-border/60 bg-krona-surface/50`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`h3`,{id:m,className:`text-base font-semibold text-krona-primary`,children:r}),a&&(0,H.jsx)(`p`,{id:h,className:`text-xs text-krona-secondary mt-0.5`,children:a})]}),(0,H.jsx)(i,{variant:`ghost`,size:`icon`,onClick:n,"aria-label":`Закрыть диалоговое окно`,children:(0,H.jsx)(t,{className:`w-4 h-4`,"aria-hidden":`true`})})]}),(0,H.jsx)(`div`,{className:`px-6 py-5 overflow-y-auto flex-1 text-sm text-krona-primary`,children:o}),s&&(0,H.jsx)(`div`,{className:`flex items-center justify-end gap-2.5 px-6 py-3.5 border-t border-krona-border/60 bg-krona-surface/30`,children:s})]})]})},bl=({isOpen:e,onClose:n,title:r,subtitle:a,children:o,footer:s,width:c,size:l,side:u=`right`})=>{let d=l||c||`md`,f=(0,A.useRef)(null),p=(0,A.useRef)(null),m=(0,A.useId)(),h=(0,A.useId)();if((0,A.useEffect)(()=>{if(!e)return;p.current=document.activeElement;let t=f.current;if(t){let e=t.querySelectorAll(`button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])`);e.length>0&&e[0].focus()}let r=e=>{if(e.key===`Escape`){e.preventDefault(),n();return}if(e.key===`Tab`){let t=f.current;if(!t)return;let n=Array.from(t.querySelectorAll(`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`)).filter(e=>e.offsetParent!==null);if(n.length===0){e.preventDefault();return}let r=n[0],i=n[n.length-1];e.shiftKey?document.activeElement===r&&(e.preventDefault(),i.focus()):document.activeElement===i&&(e.preventDefault(),r.focus())}};return window.addEventListener(`keydown`,r),()=>{window.removeEventListener(`keydown`,r),p.current&&typeof p.current.focus==`function`&&p.current.focus()}},[e,n]),!e)return null;let g={sm:`max-w-sm`,md:`max-w-md`,lg:`max-w-lg`,xl:`max-w-xl`};return(0,H.jsxs)(`div`,{className:`fixed inset-0 z-50 overflow-hidden`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":m,children:[(0,H.jsx)(`div`,{className:`fixed inset-0 krona-overlay transition-opacity cursor-pointer`,onClick:n,"aria-hidden":`true`}),(0,H.jsx)(`div`,{className:`fixed inset-y-0 ${u===`right`?`right-0 pl-10`:`left-0 pr-10`} max-w-full flex`,children:(0,H.jsxs)(`div`,{ref:f,className:`w-screen ${g[d]||g.md} bg-krona-raised ${u===`right`?`border-l`:`border-r`} border-krona-border shadow-krona-modal flex flex-col animate-fade-in`,"aria-describedby":a?h:void 0,children:[(0,H.jsxs)(`div`,{className:`px-5 py-4 border-b border-krona-border flex items-center justify-between bg-krona-surface/60`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`h3`,{id:m,className:`text-sm font-semibold text-krona-primary`,children:r}),a&&(0,H.jsx)(`p`,{id:h,className:`text-xs text-krona-secondary mt-0.5`,children:a})]}),(0,H.jsx)(i,{variant:`ghost`,size:`icon`,onClick:n,"aria-label":`Закрыть панель`,children:(0,H.jsx)(t,{className:`w-4 h-4`,"aria-hidden":`true`})})]}),(0,H.jsx)(`div`,{className:`flex-1 overflow-y-auto p-5 text-sm`,children:o}),s&&(0,H.jsx)(`div`,{className:`p-4 border-t border-krona-border bg-krona-surface/40 flex justify-end gap-2`,children:s})]})})]})},xl=({children:e})=>{let[t,n]=(0,A.useState)([]),r=(0,A.useCallback)(e=>{n(t=>t.filter(t=>t.id!==e))},[]),i=(0,A.useCallback)(({type:e,title:t,message:i,durationMs:a=4e3})=>{let o=d(),s={id:o,type:e,title:t,message:i,durationMs:a};return n(e=>[...e,s]),a>0&&setTimeout(()=>{r(o)},a),o},[r]);return(0,H.jsxs)(o.Provider,{value:{toasts:t,showToast:i,dismissToast:r},children:[e,(0,H.jsx)(Sl,{toasts:t,onDismiss:r})]})},Sl=({toasts:e,onDismiss:t})=>e.length===0?null:(0,H.jsx)(`div`,{"aria-live":`polite`,"aria-atomic":`false`,className:`fixed bottom-4 right-4 z-50 flex flex-col gap-2 max-w-sm w-full pointer-events-none`,children:e.map(e=>(0,H.jsx)(Cl,{toast:e,onDismiss:()=>t(e.id)},e.id))}),Cl=({toast:e,onDismiss:n})=>{let r={success:(0,H.jsx)(Zo,{className:`w-5 h-5 text-krona-green flex-shrink-0`}),error:(0,H.jsx)(qo,{className:`w-5 h-5 text-krona-danger flex-shrink-0`}),warning:(0,H.jsx)($c,{className:`w-5 h-5 text-krona-warning flex-shrink-0`}),info:(0,H.jsx)(ks,{className:`w-5 h-5 text-krona-info flex-shrink-0`})},i={success:`border-krona-green/40`,error:`border-krona-danger/40`,warning:`border-krona-warning/40`,info:`border-krona-info/40`},a=e.type===`error`||e.type===`warning`;return(0,H.jsxs)(`div`,{role:a?`alert`:`status`,className:`pointer-events-auto flex items-start gap-3 p-3.5 bg-krona-raised border ${i[e.type]} rounded-lg shadow-krona-raised text-sm text-krona-primary animate-fade-in`,children:[r[e.type],(0,H.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,H.jsx)(`p`,{className:`font-semibold text-xs text-krona-primary`,children:e.title}),e.message&&(0,H.jsx)(`p`,{className:`text-xs text-krona-secondary mt-0.5`,children:e.message})]}),(0,H.jsx)(`button`,{type:`button`,onClick:n,className:`text-krona-secondary hover:text-krona-primary p-1 rounded-md hover:bg-krona-surface cursor-pointer`,"aria-label":`Закрыть уведомление`,children:(0,H.jsx)(t,{className:`w-3.5 h-3.5`,"aria-hidden":`true`})})]})},wl=({variant:t=`rectangular`,width:n,height:r,lines:i=1,className:a,style:o,...c})=>{let l=`animate-pulse bg-krona-surface-muted`,u={text:`h-4 rounded`,rectangular:`rounded-md`,circular:`rounded-full aspect-square`},d={width:typeof n==`number`?`${n}px`:n,height:typeof r==`number`?`${r}px`:r,...o};return t===`text`&&i>1?(0,H.jsx)(`div`,{className:`flex flex-col gap-2 w-full`,"aria-hidden":`true`,role:`presentation`,children:Array.from({length:i}).map((t,n)=>(0,H.jsx)(`div`,{className:e(s(l,u.text,a)),style:{width:n===i-1&&i>1?`70%`:d.width||`100%`,height:d.height},...c},n))}):(0,H.jsx)(`div`,{className:e(s(l,u[t],a)),style:d,"aria-hidden":`true`,role:`presentation`,...c})},Tl=({title:e})=>(0,H.jsxs)(`div`,{className:`p-6 space-y-6 max-w-7xl mx-auto animate-fade-in`,"aria-busy":`true`,"aria-label":`Загрузка страницы`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsxs)(`div`,{className:`space-y-2`,children:[e?(0,H.jsx)(`h2`,{className:`text-xl font-bold text-krona-primary`,children:e}):(0,H.jsx)(wl,{variant:`text`,width:220,height:28}),(0,H.jsx)(wl,{variant:`text`,width:320,height:16})]}),(0,H.jsxs)(`div`,{className:`flex gap-2`,children:[(0,H.jsx)(wl,{variant:`rectangular`,width:100,height:36}),(0,H.jsx)(wl,{variant:`rectangular`,width:120,height:36})]})]}),(0,H.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-4 gap-4`,children:Array.from({length:4}).map((e,t)=>(0,H.jsxs)(`div`,{className:`p-4 bg-krona-surface border border-krona-border rounded-lg space-y-3`,children:[(0,H.jsx)(wl,{variant:`text`,width:`50%`,height:14}),(0,H.jsx)(wl,{variant:`text`,width:`80%`,height:24}),(0,H.jsx)(wl,{variant:`text`,width:`40%`,height:12})]},t))}),(0,H.jsxs)(`div`,{className:`bg-krona-surface border border-krona-border rounded-lg p-5 space-y-4`,children:[(0,H.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,H.jsx)(wl,{variant:`text`,width:180,height:20}),(0,H.jsx)(wl,{variant:`rectangular`,width:200,height:32})]}),(0,H.jsx)(`div`,{className:`space-y-3`,children:Array.from({length:6}).map((e,t)=>(0,H.jsx)(wl,{variant:`rectangular`,width:`100%`,height:40},t))})]})]}),El=class extends A.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error(`[ErrorBoundary${this.props.scope?` - ${this.props.scope}`:``}]:`,e,t)}handleReset=()=>{this.setState({hasError:!1,error:null}),this.props.onReset&&this.props.onReset()};render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,H.jsxs)(`div`,{role:`alert`,className:`p-8 my-6 bg-krona-raised border border-krona-danger/30 rounded-xl shadow-krona-soft max-w-2xl mx-auto text-center animate-fade-in`,children:[(0,H.jsx)(`div`,{className:`w-12 h-12 rounded-full bg-krona-danger/10 text-krona-danger flex items-center justify-center mx-auto mb-4`,children:(0,H.jsx)($c,{className:`w-6 h-6`,"aria-hidden":`true`})}),(0,H.jsxs)(`h3`,{className:`text-lg font-semibold text-krona-primary mb-2`,children:[`Произошла ошибка в работе `,this.props.scope?`компонента «${this.props.scope}»`:`интерфейса`]}),(0,H.jsx)(`p`,{className:`text-sm text-krona-secondary max-w-md mx-auto mb-4`,children:this.state.error?.message||`Непредвиденная ошибка отображения данных.`}),(0,H.jsxs)(`div`,{className:`flex items-center justify-center gap-3`,children:[(0,H.jsxs)(i,{variant:`primary`,size:`sm`,onClick:this.handleReset,children:[(0,H.jsx)(hc,{className:`w-4 h-4 mr-1.5`}),`Попробовать снова`]}),(0,H.jsxs)(i,{variant:`outline`,size:`sm`,onClick:()=>{window.location.href=`/`},children:[(0,H.jsx)(Ds,{className:`w-4 h-4 mr-1.5`}),`На главную`]})]})]}):this.props.children}},Dl=({level:t,size:n=`md`,showDescription:r=!1,className:i,...a})=>{let o={pilot1:{label:`Pilot 1`,description:`Готово к пилоту (IndexedDB, транзакционный контур)`,badgeClass:`bg-emerald-50 text-emerald-800 border-emerald-300 dark:bg-emerald-950/40 dark:text-emerald-300 dark:border-emerald-700`,icon:Zo,iconClass:`text-emerald-600 dark:text-emerald-400`},target:{label:`Target prototype`,description:`Целевой прототип (интерактивный макет с бизнес-логикой)`,badgeClass:`bg-sky-50 text-sky-800 border-sky-300 dark:bg-sky-950/40 dark:text-sky-300 dark:border-sky-700`,icon:js,iconClass:`text-sky-600 dark:text-sky-400`},demo:{label:`Demo only`,description:`Демонстрационный режим (симуляция)`,badgeClass:`bg-purple-50 text-purple-800 border-purple-300 dark:bg-purple-950/40 dark:text-purple-300 dark:border-purple-700`,icon:_s,iconClass:`text-purple-600 dark:text-purple-400`}}[t],c=o.icon;return(0,H.jsxs)(`span`,{"data-testid":`maturity-badge-${t}`,title:o.description,className:e(s(`inline-flex items-center font-medium rounded-full border border-solid shadow-xs select-none`,o.badgeClass,{sm:`text-[11px] px-2 py-0.5 gap-1`,md:`text-xs px-2.5 py-1 gap-1.5`}[n],i)),...a,children:[(0,H.jsx)(c,{className:s(n===`sm`?`w-3 h-3`:`w-3.5 h-3.5`,o.iconClass)}),(0,H.jsx)(`span`,{children:o.label}),r&&(0,H.jsxs)(`span`,{className:`hidden sm:inline text-[10px] opacity-75 font-normal ml-1`,children:[`• `,o.description]})]})},Ol=()=>{let{theme:e,setTheme:t,viewportMode:n,setViewportMode:r,currentProfileId:a,setProfileId:o,currentRoleId:s,setRoleId:c,activeLocation:l,setActiveLocation:u,setIsCommandPaletteOpen:d,setIsQuickActionsOpen:f,setIsNotificationsOpen:p,setIsAiDrawerOpen:m,notifications:h,getActiveProfile:g,getActiveCapabilities:_}=Oa(),v=Lr(),y=Br(),b=g(),x=_(),S=po[s],[C,w]=A.useState(!1),T=h.filter(e=>!e.read).length,E=v.pathname,ee=fo.find(e=>e.route===`/`?E===`/`:E.startsWith(e.route))||fo[0],D=ee.id===`operations`?b.operationsTabs.filter(e=>!e.requiredCapability||x[e.requiredCapability]):ee.sections.filter(e=>!e.requiredCapability||x[e.requiredCapability]);return(0,H.jsxs)(`header`,{className:`sticky top-0 z-30 bg-krona-workspace/95 backdrop-blur-sm border-b border-krona-border`,children:[(0,H.jsxs)(`div`,{className:`h-14 px-4 flex items-center justify-between gap-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,H.jsxs)(`div`,{className:`relative group`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 bg-krona-surface border border-krona-border rounded-lg px-2.5 py-1.5 cursor-pointer hover:border-krona-gold/60 transition-colors shadow-krona-soft`,children:[(0,H.jsx)(`span`,{className:`w-2 h-2 rounded-full bg-krona-gold`}),(0,H.jsxs)(`div`,{className:`flex flex-col text-left`,children:[(0,H.jsx)(`span`,{className:`text-[10px] uppercase font-semibold tracking-wider text-krona-secondary`,children:`Профиль бизнеса`}),(0,H.jsx)(`span`,{className:`text-xs font-semibold text-krona-primary max-w-[170px] truncate`,children:b.name})]}),(0,H.jsx)(Vo,{className:`w-3.5 h-3.5 text-krona-secondary`})]}),(0,H.jsxs)(`div`,{className:`absolute left-0 top-full mt-1 w-72 bg-krona-raised border border-krona-border rounded-xl shadow-krona-modal p-1.5 hidden group-hover:block z-50 animate-fade-in`,children:[(0,H.jsx)(`div`,{className:`px-2.5 py-1.5 text-[11px] font-semibold text-krona-secondary uppercase tracking-wider border-b border-krona-border/60`,children:`Отраслевые профили Кроны`}),(0,H.jsx)(`div`,{className:`max-h-80 overflow-y-auto py-1 space-y-0.5`,children:Object.values(Sa).map(e=>(0,H.jsxs)(`button`,{onClick:()=>{o(e.id),y(`/operations`)},className:`w-full text-left px-2.5 py-2 rounded-lg text-xs flex items-center justify-between transition-colors ${e.id===a?`bg-krona-gold/15 text-krona-gold-text font-medium`:`hover:bg-krona-workspace text-krona-primary`}`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`font-medium truncate`,children:e.name}),(0,H.jsx)(`div`,{className:`text-[10px] text-krona-secondary truncate`,children:e.companyName})]}),(0,H.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-krona-muted text-krona-secondary shrink-0`,children:e.category})]},e.id))})]})]}),(0,H.jsxs)(`div`,{className:`relative group`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5 bg-krona-surface border border-krona-border rounded-lg px-2.5 py-1.5 cursor-pointer hover:border-krona-border-strong text-xs text-krona-primary shadow-krona-soft`,children:[(0,H.jsx)(Ls,{className:`w-3.5 h-3.5 text-krona-secondary`}),(0,H.jsx)(`span`,{className:`max-w-[130px] truncate font-medium`,children:l}),(0,H.jsx)(Vo,{className:`w-3 h-3 text-krona-secondary`})]}),(0,H.jsxs)(`div`,{className:`absolute left-0 top-full mt-1 w-56 bg-krona-raised border border-krona-border rounded-lg shadow-krona-modal p-1 hidden group-hover:block z-50`,children:[(0,H.jsx)(`div`,{className:`px-2 py-1 text-[10px] font-semibold text-krona-secondary uppercase`,children:`Точки продаж / Локации`}),b.locations.map(e=>(0,H.jsx)(`button`,{onClick:()=>u(e),className:`w-full text-left px-2.5 py-1.5 rounded text-xs transition-colors ${e===l?`bg-krona-green/10 text-krona-green font-medium`:`hover:bg-krona-workspace text-krona-primary`}`,children:e},e))]})]}),(0,H.jsxs)(`div`,{className:`relative group`,children:[(0,H.jsxs)(`div`,{"data-testid":`role-switcher-btn`,onClick:()=>w(e=>!e),className:`flex items-center gap-1.5 bg-krona-surface border border-krona-border rounded-lg px-2.5 py-1.5 cursor-pointer hover:border-krona-border-strong text-xs shadow-krona-soft`,children:[(0,H.jsx)(kc,{className:`w-3.5 h-3.5 text-krona-green`}),(0,H.jsxs)(`div`,{className:`flex flex-col text-left`,children:[(0,H.jsx)(`span`,{className:`text-[9px] uppercase font-semibold text-krona-secondary`,children:`Роль`}),(0,H.jsx)(`span`,{className:`font-semibold text-krona-primary truncate max-w-[90px]`,children:S.badge})]}),(0,H.jsx)(Vo,{className:`w-3 h-3 text-krona-secondary`})]}),(0,H.jsxs)(`div`,{className:`absolute left-0 top-full mt-1 w-64 bg-krona-raised border border-krona-border rounded-xl shadow-krona-modal p-1.5 z-50 ${C?`block`:`hidden group-hover:block`}`,children:[(0,H.jsx)(`div`,{className:`px-2 py-1 text-[10px] font-semibold text-krona-secondary uppercase border-b border-krona-border/60`,children:`Переключение роли (RBAC)`}),(0,H.jsx)(`div`,{className:`max-h-72 overflow-y-auto py-1 space-y-0.5`,children:Object.values(po).map(e=>(0,H.jsxs)(`button`,{"data-testid":`role-option-${e.id}`,onClick:()=>{w(!1),c(e.id),y(e.defaultRoute)},className:`w-full text-left px-2.5 py-2 rounded-lg text-xs transition-colors ${e.id===s?`bg-krona-green/15 text-krona-green-text font-medium`:`hover:bg-krona-workspace text-krona-primary`}`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:e.label}),(0,H.jsx)(`span`,{className:`text-[10px] px-1 py-0.5 rounded bg-krona-muted text-krona-secondary`,children:e.badge})]}),(0,H.jsx)(`div`,{className:`text-[10px] text-krona-secondary truncate mt-0.5`,children:e.description})]},e.id))})]})]})]}),(0,H.jsx)(`div`,{className:`flex-1 max-w-md hidden md:block`,children:(0,H.jsxs)(`button`,{onClick:()=>d(!0),className:`w-full flex items-center justify-between px-3 py-1.5 rounded-lg bg-krona-surface border border-krona-border text-xs text-krona-secondary hover:border-krona-border-strong shadow-krona-soft transition-colors`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(_c,{className:`w-3.5 h-3.5`}),(0,H.jsx)(`span`,{children:`Поиск по Кроне, клиентам, чекам, KDS...`})]}),(0,H.jsx)(`kbd`,{className:`px-1.5 py-0.5 text-[10px] bg-krona-workspace border border-krona-border rounded text-krona-secondary font-mono`,children:`Ctrl+K`})]})}),(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,H.jsxs)(i,{variant:`gold`,size:`sm`,onClick:()=>m(!0),className:`hidden sm:inline-flex text-xs font-medium gap-1.5`,children:[(0,H.jsx)(zc,{className:`w-3.5 h-3.5`}),(0,H.jsx)(`span`,{children:`✦ Спросить Крону`})]}),(0,H.jsx)(i,{variant:`primary`,size:`sm`,onClick:()=>f(!0),className:`px-2.5`,title:`Быстрое создание`,children:(0,H.jsx)(sc,{className:`w-4 h-4`})}),(0,H.jsxs)(`div`,{className:`flex items-center bg-krona-surface border border-krona-border rounded-lg p-0.5 shadow-krona-soft`,children:[(0,H.jsx)(`button`,{onClick:()=>r(`desktop`),className:`p-1.5 rounded transition-colors ${n===`desktop`?`bg-krona-workspace text-krona-green`:`text-krona-secondary hover:text-krona-primary`}`,title:`Desktop View`,children:(0,H.jsx)(Ys,{className:`w-3.5 h-3.5`})}),(0,H.jsx)(`button`,{onClick:()=>r(`tablet-landscape`),className:`p-1.5 rounded transition-colors ${n===`tablet-landscape`?`bg-krona-workspace text-krona-green`:`text-krona-secondary hover:text-krona-primary`}`,title:`Tablet Landscape`,children:(0,H.jsx)(Gc,{className:`w-3.5 h-3.5 rotate-90`})}),(0,H.jsx)(`button`,{onClick:()=>r(`tablet-portrait`),className:`p-1.5 rounded transition-colors ${n===`tablet-portrait`?`bg-krona-workspace text-krona-green`:`text-krona-secondary hover:text-krona-primary`}`,title:`Tablet Portrait`,children:(0,H.jsx)(Gc,{className:`w-3.5 h-3.5`})}),(0,H.jsx)(`button`,{onClick:()=>r(`mobile`),className:`p-1.5 rounded transition-colors ${n===`mobile`?`bg-krona-workspace text-krona-green`:`text-krona-secondary hover:text-krona-primary`}`,title:`Mobile View`,children:(0,H.jsx)(Lc,{className:`w-3.5 h-3.5`})})]}),(0,H.jsxs)(`div`,{className:`flex items-center bg-krona-surface border border-krona-border rounded-lg p-0.5 shadow-krona-soft`,children:[(0,H.jsx)(`button`,{"data-testid":`theme-toggle-soft`,onClick:()=>t(`soft-light`),className:`px-2 py-1 text-[11px] font-medium rounded transition-colors ${e===`soft-light`?`bg-krona-workspace text-krona-gold-text`:`text-krona-secondary`}`,title:`Soft Light (Основная)`,children:`Soft`}),(0,H.jsx)(`button`,{"data-testid":`theme-toggle-light`,onClick:()=>t(`light`),className:`p-1 rounded transition-colors ${e===`light`?`bg-krona-workspace text-krona-gold`:`text-krona-secondary`}`,title:`Light`,children:(0,H.jsx)(Uc,{className:`w-3.5 h-3.5`})}),(0,H.jsx)(`button`,{"data-testid":`theme-toggle-dark`,onClick:()=>t(`dark`),className:`p-1 rounded transition-colors ${e===`dark`?`bg-krona-workspace text-krona-gold`:`text-krona-secondary`}`,title:`Dark`,children:(0,H.jsx)(Zs,{className:`w-3.5 h-3.5`})})]}),(0,H.jsxs)(`button`,{onClick:()=>p(!0),className:`relative p-2 rounded-lg bg-krona-surface border border-krona-border text-krona-secondary hover:text-krona-primary shadow-krona-soft transition-colors`,title:`Уведомления`,children:[(0,H.jsx)(Do,{className:`w-4 h-4`}),T>0&&(0,H.jsx)(`span`,{className:`absolute -top-1 -right-1 w-4 h-4 rounded-full bg-krona-danger text-white text-[10px] font-bold flex items-center justify-center`,children:T})]})]})]}),D.length>0&&(0,H.jsxs)(`nav`,{className:`px-4 flex items-center gap-1 overflow-x-auto h-10 border-t border-krona-border/50 bg-krona-workspace/70 text-xs`,children:[(0,H.jsxs)(`span`,{className:`text-[11px] font-bold uppercase tracking-wider text-krona-secondary mr-2 flex items-center gap-1`,children:[(0,H.jsx)(js,{className:`w-3 h-3 text-krona-secondary`}),ee.label,`:`]}),D.map(e=>{let t=E===e.route||e.route!==`/operations`&&e.route!==`/`&&E.startsWith(e.route);return(0,H.jsxs)(`button`,{onClick:()=>y(e.route),className:`px-3 py-1.5 rounded-md font-medium whitespace-nowrap transition-all flex items-center gap-1.5 ${t?`bg-[#2F684C] text-[#F8F6F0] shadow-sm`:`text-krona-secondary hover:text-krona-primary hover:bg-krona-surface/60`}`,children:[(0,H.jsx)(`span`,{children:e.label}),e.badge&&(0,H.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.2 rounded-full font-bold ${t?`bg-white/20 text-white`:`bg-krona-muted text-krona-secondary`}`,children:e.badge})]},e.id)})]})]})},kl=()=>{let{isRightPanelCollapsed:e,setIsRightPanelCollapsed:t,getActiveProfile:n,setIsQuickActionsOpen:r,activeLocation:a}=Oa(),o=n(),s=Br(),[c,u]=(0,A.useState)(`ai`),[f,p]=(0,A.useState)([{id:`1`,sender:`ai`,text:`Приветствую! Я Krona AI. Анализирую точку «${a}» (${o.name}). Выручка в норме, но обратите внимание на запас охлажденного лосося — осталось 2.4 кг. Чем помочь?`,time:`12:30`}]),[m,h]=(0,A.useState)(``),[g,_]=(0,A.useState)(!1),[v,y]=(0,A.useState)(`all`),b=[`Что требует внимания сегодня?`,`Какие позиции скоро закончатся?`,`Самые прибыльные позиции?`,`Каких клиентов стоит вернуть?`],x=e=>{let t=e||m;if(!t.trim())return;let n={id:`usr-${d()}`,sender:`user`,text:t,time:new Date().toLocaleTimeString(`ru-RU`,{hour:`2-digit`,minute:`2-digit`})};p(e=>[...e,n]),h(``),_(!0),setTimeout(()=>{let e=`Анализирую операционные данные Кроны...`;e=t.includes(`внимания`)?`⚠️ 3 критических алерта: 1) Запас лосося ниже минимума (2.4 кг из 6 кг); 2) Заказ #104 готовится уже 18 минут; 3) Курьер Алексей завершил смену с 24 500 ₽ наличных к инкассации.`:t.includes(`закончатся`)||t.includes(`склад`)?`📦 Скоро закончатся: Лосось атлантический (2.4 кг), Угорь копченый (0.0 кг — в стоп-листе!), Тигровые креветки (4.8 кг). Рекомендую сформировать авто-заявку в СибРыбТорг.`:t.includes(`прибыльные`)||t.includes(`блюда`)?`💰 Топ по маржинальности: 1) Гёдза свинина (маржа 76.1%, food cost 23.9%); 2) Рамен Тонкоцу (маржа 72.1%); 3) Филадельфия Премиум (выручка 58 650 ₽/день).`:t.includes(`клиент`)?`👥 В зоне риска 14 постоянных клиентов (не было визитов более 30 дней). Например: Дмитрий Мельников (LTV 18 500 ₽). Предлагаю запустить триггерную рассылку со скидкой 15% в Telegram-боте.`:`Ответ AI по профилю «${o.name}»: Задача зафиксирована в оркестраторе Кроны. Контекст передан специализированным агентам.`,p(t=>[...t,{id:`ai-${Date.now()}`,sender:`ai`,text:e,time:new Date().toLocaleTimeString(`ru-RU`,{hour:`2-digit`,minute:`2-digit`})}]),_(!1)},650)};return e?(0,H.jsxs)(`button`,{onClick:()=>t(!1),className:`hidden xl:flex fixed right-0 top-20 bg-krona-surface border-y border-l border-krona-border rounded-l-lg p-2 text-krona-secondary hover:text-krona-primary shadow-krona-soft z-20 flex-col items-center gap-2 transition-all`,title:`Развернуть панель управления`,children:[(0,H.jsx)(Uo,{className:`w-4 h-4 text-krona-gold`}),(0,H.jsx)(`span`,{className:`text-[10px] font-semibold uppercase [writing-mode:vertical-rl] tracking-wider text-krona-secondary`,children:`Command Panel`})]}):(0,H.jsxs)(`aside`,{className:`hidden xl:flex w-80 h-[calc(100vh-3.5rem)] bg-krona-workspace/95 border-l border-krona-border flex-col shrink-0 z-20`,children:[(0,H.jsxs)(`div`,{className:`p-3 border-b border-krona-border flex items-center justify-between bg-krona-surface/50`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-1 bg-krona-workspace p-0.5 rounded-lg border border-krona-border text-xs`,children:[(0,H.jsxs)(`button`,{onClick:()=>u(`ai`),className:`px-2.5 py-1 rounded-md font-medium flex items-center gap-1 transition-colors ${c===`ai`?`bg-krona-gold text-white font-semibold shadow-sm`:`text-krona-secondary hover:text-krona-primary`}`,children:[(0,H.jsx)(zc,{className:`w-3 h-3`}),(0,H.jsx)(`span`,{children:`Krona AI`})]}),(0,H.jsxs)(`button`,{onClick:()=>u(`actions`),className:`px-2.5 py-1 rounded-md font-medium flex items-center gap-1 transition-colors ${c===`actions`?`bg-[#2F684C] text-white font-semibold shadow-sm`:`text-krona-secondary hover:text-krona-primary`}`,children:[(0,H.jsx)(dl,{className:`w-3 h-3`}),(0,H.jsx)(`span`,{children:`Действия`})]}),(0,H.jsxs)(`button`,{onClick:()=>u(`chat`),className:`px-2.5 py-1 rounded-md font-medium flex items-center gap-1 transition-colors ${c===`chat`?`bg-krona-surface text-krona-primary shadow-sm`:`text-krona-secondary hover:text-krona-primary`}`,children:[(0,H.jsx)(Gs,{className:`w-3 h-3`}),(0,H.jsx)(`span`,{children:`Чаты`})]})]}),(0,H.jsx)(`button`,{onClick:()=>t(!0),className:`p-1 rounded text-krona-secondary hover:text-krona-primary`,title:`Свернуть панель`,children:(0,H.jsx)(V,{className:`w-4 h-4`})})]}),c===`ai`&&(0,H.jsxs)(`div`,{className:`flex-1 flex flex-col overflow-hidden`,children:[(0,H.jsx)(`div`,{className:`p-2.5 border-b border-krona-border/60 bg-krona-surface/40 flex items-center gap-1.5 overflow-x-auto text-[11px]`,children:b.map((e,t)=>(0,H.jsx)(`button`,{onClick:()=>x(e),className:`whitespace-nowrap px-2 py-1 rounded-full bg-krona-gold/10 hover:bg-krona-gold/20 text-krona-gold-text border border-krona-gold/30 transition-colors`,children:e},t))}),(0,H.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-3 space-y-3 text-xs`,children:[f.map(e=>(0,H.jsxs)(`div`,{className:`flex gap-2 ${e.sender===`user`?`justify-end`:`justify-start`}`,children:[e.sender===`ai`&&(0,H.jsx)(`div`,{className:`w-6 h-6 rounded-full bg-krona-gold/20 border border-krona-gold/40 flex items-center justify-center text-krona-gold shrink-0`,children:(0,H.jsx)(zc,{className:`w-3.5 h-3.5`})}),(0,H.jsxs)(`div`,{className:`p-2.5 rounded-lg max-w-[85%] leading-relaxed ${e.sender===`user`?`bg-[#2F684C] text-[#F8F6F0] rounded-br-none`:`bg-krona-surface border border-krona-border text-krona-primary rounded-bl-none shadow-krona-soft`}`,children:[(0,H.jsx)(`p`,{children:e.text}),(0,H.jsx)(`span`,{className:`block text-[9px] mt-1 text-right ${e.sender===`user`?`text-white/70`:`text-krona-secondary`}`,children:e.time})]})]},e.id)),g&&(0,H.jsxs)(`div`,{className:`flex items-center gap-1 text-krona-gold text-xs italic`,children:[(0,H.jsx)(zc,{className:`w-3.5 h-3.5 animate-spin`}),(0,H.jsx)(`span`,{children:`Krona AI думает...`})]})]}),(0,H.jsx)(`div`,{className:`p-2.5 border-t border-krona-border bg-krona-surface/60`,children:(0,H.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),x()},className:`flex items-center gap-1.5`,children:[(0,H.jsx)(`input`,{type:`text`,value:m,onChange:e=>h(e.target.value),placeholder:`Спросите AI об остатках, выручке...`,className:`flex-1 text-xs bg-krona-surface border border-krona-border rounded-md px-3 py-2 text-krona-primary placeholder:text-krona-secondary focus:outline-none focus:border-krona-gold`}),(0,H.jsx)(i,{type:`submit`,variant:`gold`,size:`sm`,className:`px-2.5`,children:(0,H.jsx)(yc,{className:`w-3.5 h-3.5`})})]})})]}),c===`actions`&&(0,H.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-3 space-y-2 text-xs`,children:[(0,H.jsxs)(`div`,{className:`text-[11px] font-semibold text-krona-secondary uppercase tracking-wider mb-2`,children:[`Быстрые операции: `,o.name]}),(0,H.jsxs)(i,{variant:`outline`,className:`w-full justify-start text-xs`,onClick:()=>r(!0),children:[(0,H.jsx)(jc,{className:`w-4 h-4 mr-2 text-krona-green`}),(0,H.jsx)(`span`,{children:`Новый чек / заказ`})]}),o.capabilities.booking&&(0,H.jsxs)(i,{variant:`outline`,className:`w-full justify-start text-xs`,onClick:()=>r(!0),children:[(0,H.jsx)(No,{className:`w-4 h-4 mr-2 text-krona-gold`}),(0,H.jsxs)(`span`,{children:[`Забронировать `,o.terminology.bookingResourceLabel.toLowerCase()]})]}),o.capabilities.work_orders&&(0,H.jsxs)(i,{variant:`outline`,className:`w-full justify-start text-xs`,onClick:()=>r(!0),children:[(0,H.jsx)(Fo,{className:`w-4 h-4 mr-2 text-krona-info`}),(0,H.jsx)(`span`,{children:`Открыть заказ-наряд на пост`})]}),(0,H.jsxs)(i,{variant:`outline`,className:`w-full justify-start text-xs`,onClick:()=>s(`/operations/pos`),children:[(0,H.jsx)(dc,{className:`w-4 h-4 mr-2 text-krona-green`}),(0,H.jsx)(`span`,{children:`Открыть кассовый терминал (POS)`})]}),(0,H.jsxs)(i,{variant:`outline`,className:`w-full justify-start text-xs`,onClick:()=>s(`/tasks`),children:[(0,H.jsx)(Vc,{className:`w-4 h-4 mr-2 text-krona-secondary`}),(0,H.jsx)(`span`,{children:`Поставить задачу сотруднику`})]}),(0,H.jsxs)(i,{variant:`outline`,className:`w-full justify-start text-xs`,onClick:()=>s(`/inventory`),children:[(0,H.jsx)(hc,{className:`w-4 h-4 mr-2 text-krona-warning`}),(0,H.jsx)(`span`,{children:`Провести списание / инвентаризацию`})]})]}),c===`chat`&&(0,H.jsxs)(`div`,{className:`flex-1 flex flex-col overflow-hidden`,children:[(0,H.jsxs)(`div`,{className:`p-2 border-b border-krona-border flex gap-1 text-[11px]`,children:[(0,H.jsx)(`button`,{onClick:()=>y(`all`),className:`px-2 py-0.5 rounded ${v===`all`?`bg-krona-surface font-semibold text-krona-primary`:`text-krona-secondary`}`,children:`Все (3)`}),(0,H.jsx)(`button`,{onClick:()=>y(`clients`),className:`px-2 py-0.5 rounded ${v===`clients`?`bg-krona-surface font-semibold text-krona-primary`:`text-krona-secondary`}`,children:`Клиенты (2)`}),(0,H.jsx)(`button`,{onClick:()=>y(`team`),className:`px-2 py-0.5 rounded ${v===`team`?`bg-krona-surface font-semibold text-krona-primary`:`text-krona-secondary`}`,children:`Команда (1)`})]}),(0,H.jsxs)(`div`,{className:`flex-1 overflow-y-auto divide-y divide-krona-border/50 text-xs`,children:[(0,H.jsxs)(`div`,{onClick:()=>s(`/communications`),className:`p-3 hover:bg-krona-surface cursor-pointer transition-colors`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5 font-semibold text-krona-primary`,children:[(0,H.jsx)(`span`,{className:`w-2 h-2 rounded-full bg-blue-500`}),(0,H.jsx)(`span`,{children:`Александр Сорокин`})]}),(0,H.jsx)(`span`,{className:`text-[10px] text-krona-secondary`,children:`13:42`})]}),(0,H.jsx)(`p`,{className:`text-xs text-krona-secondary truncate`,children:`Добрый день! Подскажите, стол 4 у окна сегодня свободен?`}),(0,H.jsxs)(`div`,{className:`mt-1 flex items-center gap-1.5`,children:[(0,H.jsx)(l,{variant:`gold`,size:`sm`,children:`Telegram`}),(0,H.jsx)(l,{variant:`green`,size:`sm`,children:`Новый`})]})]}),(0,H.jsxs)(`div`,{onClick:()=>s(`/communications`),className:`p-3 hover:bg-krona-surface cursor-pointer transition-colors`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5 font-semibold text-krona-primary`,children:[(0,H.jsx)(`span`,{className:`w-2 h-2 rounded-full bg-green-500`}),(0,H.jsx)(`span`,{children:`Екатерина Морозова`})]}),(0,H.jsx)(`span`,{className:`text-[10px] text-krona-secondary`,children:`12:15`})]}),(0,H.jsx)(`p`,{className:`text-xs text-krona-secondary truncate`,children:`Спасибо за быструю доставку! Курьер был очень вежливым.`}),(0,H.jsx)(l,{variant:`info`,size:`sm`,children:`WhatsApp`})]}),(0,H.jsxs)(`div`,{onClick:()=>s(`/communications`),className:`p-3 hover:bg-krona-surface cursor-pointer transition-colors`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5 font-semibold text-krona-primary`,children:[(0,H.jsx)(`span`,{className:`w-2 h-2 rounded-full bg-krona-gold`}),(0,H.jsx)(`span`,{children:`Кухня & Шеф (Внутренний)`})]}),(0,H.jsx)(`span`,{className:`text-[10px] text-krona-secondary`,children:`11:10`})]}),(0,H.jsx)(`p`,{className:`text-xs text-krona-secondary truncate`,children:`Артур: Заканчивается лосось, переключите позиции на контроль.`}),(0,H.jsx)(l,{variant:`warning`,size:`sm`,children:`Командный чат`})]})]}),(0,H.jsx)(`div`,{className:`p-2 border-t border-krona-border bg-krona-surface/50 text-center`,children:(0,H.jsx)(`button`,{onClick:()=>s(`/communications`),className:`text-xs text-krona-green font-medium hover:underline`,children:`Открыть единый Inbox →`})})]})]})},Al=()=>{let{setIsQuickActionsOpen:e}=Oa(),[n,r]=(0,A.useState)(!1),i=Br();return(0,H.jsxs)(H.Fragment,{children:[n&&(0,H.jsxs)(`div`,{className:`fixed inset-0 z-50 flex flex-col justify-end`,children:[(0,H.jsx)(`div`,{className:`fixed inset-0 krona-overlay`,onClick:()=>r(!1)}),(0,H.jsxs)(`div`,{className:`relative bg-krona-raised border-t border-krona-border rounded-t-2xl p-4 z-10 max-h-[80vh] overflow-y-auto animate-fade-in shadow-krona-modal`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between pb-3 mb-2 border-b border-krona-border`,children:[(0,H.jsx)(`span`,{className:`text-sm font-semibold text-krona-primary`,children:`Все разделы Кроны`}),(0,H.jsx)(`button`,{onClick:()=>r(!1),className:`p-1 text-krona-secondary`,children:(0,H.jsx)(t,{className:`w-5 h-5`})})]}),(0,H.jsx)(`div`,{className:`grid grid-cols-3 gap-2 text-center text-xs pb-4`,children:fo.map(e=>(0,H.jsx)(`button`,{onClick:()=>{r(!1),i(e.route)},className:`p-3 rounded-lg border border-krona-border bg-krona-surface hover:bg-krona-workspace flex flex-col items-center gap-1.5 transition-colors`,children:(0,H.jsx)(`span`,{className:`text-krona-gold font-medium text-xs truncate max-w-full`,children:e.label})},e.id))})]})]}),(0,H.jsxs)(`nav`,{className:`fixed bottom-0 inset-x-0 h-16 bg-[#252722] text-[#D8D8D0] border-t border-[#3A3D35] flex items-center justify-around z-40 px-2`,children:[(0,H.jsxs)(ua,{to:`/`,end:!0,className:({isActive:e})=>`flex flex-col items-center gap-1 p-1 text-[11px] ${e?`text-[#D4B16D] font-semibold`:`text-[#858980]`}`,children:[(0,H.jsx)(Ns,{className:`w-5 h-5`}),(0,H.jsx)(`span`,{children:`Главная`})]}),(0,H.jsxs)(ua,{to:`/operations`,className:({isActive:e})=>`flex flex-col items-center gap-1 p-1 text-[11px] ${e?`text-[#D4B16D] font-semibold`:`text-[#858980]`}`,children:[(0,H.jsx)(sl,{className:`w-5 h-5`}),(0,H.jsx)(`span`,{children:`Работа`})]}),(0,H.jsx)(`button`,{onClick:()=>e(!0),className:`w-11 h-11 rounded-full bg-[#2F684C] hover:bg-[#285A42] text-white flex items-center justify-center shadow-lg -mt-5 transition-transform active:scale-95`,title:`Быстрое действие`,children:(0,H.jsx)(sc,{className:`w-6 h-6`})}),(0,H.jsxs)(ua,{to:`/communications`,className:({isActive:e})=>`flex flex-col items-center gap-1 p-1 text-[11px] ${e?`text-[#D4B16D] font-semibold`:`text-[#858980]`}`,children:[(0,H.jsx)(Gs,{className:`w-5 h-5`}),(0,H.jsx)(`span`,{children:`Чаты`})]}),(0,H.jsxs)(`button`,{onClick:()=>r(!0),className:`flex flex-col items-center gap-1 p-1 text-[11px] text-[#858980] hover:text-[#D8D8D0]`,children:[(0,H.jsx)(Vs,{className:`w-5 h-5`}),(0,H.jsx)(`span`,{children:`Ещё`})]})]})]})},jl=()=>{let{isCommandPaletteOpen:e,setIsCommandPaletteOpen:n,setProfileId:r,setRoleId:i,setTheme:a,setIsQuickActionsOpen:o,theme:s}=Oa(),{entities:c}=uo(),[l,u]=(0,A.useState)(``),d=Br();if((0,A.useEffect)(()=>{let t=t=>{(t.ctrlKey||t.metaKey)&&t.key.toLowerCase()===`k`&&(t.preventDefault(),n(!e)),t.key===`Escape`&&e&&n(!1)};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,n]),!e)return null;let f=c.filter(e=>e.name.toLowerCase().includes(l.toLowerCase())||e.code.toLowerCase().includes(l.toLowerCase())),p=fo.filter(e=>e.label.toLowerCase().includes(l.toLowerCase())||e.route.toLowerCase().includes(l.toLowerCase())),m=Object.values(Sa).filter(e=>e.name.toLowerCase().includes(l.toLowerCase())||e.label.toLowerCase().includes(l.toLowerCase())),h=Object.values(po).filter(e=>e.label.toLowerCase().includes(l.toLowerCase())||e.badge.toLowerCase().includes(l.toLowerCase()));return(0,H.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-start justify-center pt-20 p-4`,children:[(0,H.jsx)(`div`,{className:`fixed inset-0 krona-overlay`,onClick:()=>n(!1)}),(0,H.jsxs)(`div`,{className:`relative w-full max-w-2xl bg-krona-raised border border-krona-border rounded-xl shadow-krona-modal z-10 overflow-hidden flex flex-col max-h-[75vh] animate-fade-in`,children:[(0,H.jsxs)(`div`,{className:`p-3.5 border-b border-krona-border flex items-center gap-3 bg-krona-surface/70`,children:[(0,H.jsx)(_c,{className:`w-5 h-5 text-krona-secondary shrink-0`}),(0,H.jsx)(`input`,{autoFocus:!0,type:`text`,value:l,onChange:e=>u(e.target.value),placeholder:`Поиск по Кроне, модулям, профилям, ролям или действиям (Ctrl+K)...`,className:`w-full bg-transparent text-krona-primary placeholder:text-krona-secondary text-sm focus:outline-none`}),(0,H.jsx)(`button`,{onClick:()=>n(!1),className:`text-krona-secondary hover:text-krona-primary p-1`,children:(0,H.jsx)(t,{className:`w-4 h-4`})})]}),(0,H.jsxs)(`div`,{className:`overflow-y-auto p-3 space-y-4 text-xs`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wider text-krona-secondary px-2 mb-1.5`,children:`Быстрые действия`}),(0,H.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,H.jsxs)(`button`,{onClick:()=>{n(!1),o(!0)},className:`w-full text-left px-3 py-2 rounded-md hover:bg-krona-workspace flex items-center justify-between group transition-colors`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,H.jsx)(sc,{className:`w-4 h-4 text-krona-green`}),(0,H.jsx)(`span`,{className:`font-medium text-krona-primary`,children:`Создать новую сущность (быстрое меню)`})]}),(0,H.jsx)(yo,{className:`w-3.5 h-3.5 text-krona-secondary group-hover:text-krona-primary`})]}),(0,H.jsxs)(`button`,{onClick:()=>{a(s===`dark`?`soft-light`:`dark`),n(!1)},className:`w-full text-left px-3 py-2 rounded-md hover:bg-krona-workspace flex items-center justify-between group transition-colors`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[s===`dark`?(0,H.jsx)(Uc,{className:`w-4 h-4 text-krona-gold`}):(0,H.jsx)(Zs,{className:`w-4 h-4 text-krona-secondary`}),(0,H.jsxs)(`span`,{className:`font-medium text-krona-primary`,children:[`Переключить тему (`,s===`dark`?`на Светлую`:`на Темную`,`)`]})]}),(0,H.jsx)(yo,{className:`w-3.5 h-3.5 text-krona-secondary group-hover:text-krona-primary`})]})]})]}),p.length>0&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wider text-krona-secondary px-2 mb-1.5`,children:`Модули платформы`}),(0,H.jsx)(`div`,{className:`space-y-0.5`,children:p.slice(0,8).map(e=>(0,H.jsxs)(`button`,{onClick:()=>{d(e.route),n(!1)},className:`w-full text-left px-3 py-2 rounded-md hover:bg-krona-workspace flex items-center justify-between group transition-colors`,children:[(0,H.jsx)(`span`,{className:`font-medium text-krona-primary`,children:e.label}),(0,H.jsx)(`span`,{className:`text-krona-secondary text-[11px] font-mono`,children:e.route})]},e.id))})]}),f.length>0&&(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wider text-krona-secondary px-2 mb-1.5 flex items-center gap-1.5`,children:[(0,H.jsx)(js,{className:`w-3.5 h-3.5 text-krona-green`}),`Сущности и модели данных (`,f.length,`)`]}),(0,H.jsx)(`div`,{className:`space-y-0.5`,children:f.slice(0,6).map(e=>(0,H.jsxs)(`div`,{className:`w-full px-3 py-2 rounded-md hover:bg-krona-workspace flex items-center justify-between group transition-colors`,children:[(0,H.jsxs)(`button`,{onClick:()=>{d(e.isSystem?`/${e.code}`:`/entities/${e.code}`),n(!1)},className:`flex items-center gap-2 flex-1 text-left min-w-0`,children:[(0,H.jsx)(`span`,{className:`font-medium text-krona-primary truncate`,children:e.name}),(0,H.jsxs)(`span`,{className:`text-krona-secondary text-[10px] font-mono`,children:[`(`,e.code,`)`]}),e.isSystem?(0,H.jsx)(`span`,{className:`text-[9px] px-1 py-0.2 bg-krona-surface border border-krona-border rounded text-krona-secondary`,children:`System`}):(0,H.jsx)(`span`,{className:`text-[9px] px-1 py-0.2 bg-krona-gold/10 text-krona-gold border border-krona-gold/30 rounded font-semibold`,children:`Custom`})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity`,children:[(0,H.jsx)(`button`,{onClick:()=>{d(`/settings/entities/${e.code}/fields`),n(!1)},className:`p-1 text-[10px] text-krona-secondary hover:text-krona-primary hover:bg-krona-surface rounded`,title:`Конструктор полей`,children:(0,H.jsx)(Fc,{className:`w-3 h-3`})}),(0,H.jsx)(`button`,{onClick:()=>{d(e.isSystem?`/${e.code}`:`/entities/${e.code}`),n(!1)},className:`p-1 text-[10px] text-krona-secondary hover:text-krona-primary hover:bg-krona-surface rounded`,title:`Открыть записи`,children:(0,H.jsx)(yo,{className:`w-3 h-3`})})]})]},e.code))})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wider text-krona-secondary px-2 mb-1.5 flex items-center gap-1.5`,children:[(0,H.jsx)(zc,{className:`w-3.5 h-3.5 text-krona-gold`}),`Сменить бизнес-профиль`]}),(0,H.jsx)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:m.map(e=>(0,H.jsxs)(`button`,{onClick:()=>{r(e.id),n(!1),d(`/operations`)},className:`text-left p-2 rounded-md border border-krona-border hover:border-krona-green/50 bg-krona-surface hover:bg-krona-workspace transition-all`,children:[(0,H.jsx)(`div`,{className:`font-medium text-krona-primary text-xs truncate`,children:e.name}),(0,H.jsx)(`div`,{className:`text-[10px] text-krona-secondary truncate`,children:e.category})]},e.id))})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wider text-krona-secondary px-2 mb-1.5`,children:`Сменить роль (RBAC)`}),(0,H.jsx)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:h.slice(0,6).map(e=>(0,H.jsxs)(`button`,{onClick:()=>{i(e.id),n(!1),d(e.defaultRoute)},className:`text-left p-2 rounded-md border border-krona-border hover:border-krona-gold/50 bg-krona-surface hover:bg-krona-workspace transition-all`,children:[(0,H.jsx)(`div`,{className:`font-medium text-krona-primary text-xs`,children:e.label}),(0,H.jsx)(`div`,{className:`text-[10px] text-krona-secondary truncate`,children:e.badge})]},e.id))})]})]}),(0,H.jsxs)(`div`,{className:`px-4 py-2 border-t border-krona-border bg-krona-surface/50 text-[11px] text-krona-secondary flex items-center justify-between`,children:[(0,H.jsx)(`span`,{children:`Навигация: ↑ ↓ \xA0|\xA0 Выбор: Enter \xA0|\xA0 Закрыть: Esc`}),(0,H.jsx)(`span`,{className:`font-medium text-krona-gold`,children:`Крона AGI Universal OS`})]})]})]})},Ml=()=>{let{isQuickActionsOpen:e,setIsQuickActionsOpen:t,getActiveProfile:n,addBooking:r,addWorkOrder:a,activeLocation:o}=Oa(),s=n(),[c,l]=(0,A.useState)(`order`),[u,d]=(0,A.useState)(null),[f,p]=(0,A.useState)(``),[m,h]=(0,A.useState)(``),[g,_]=(0,A.useState)(`19:00`),[v,y]=(0,A.useState)(`Стол 3`),[b,x]=(0,A.useState)(`Toyota Camry (А123АА 154)`),[S,C]=(0,A.useState)(`1500`);return(0,H.jsx)(yl,{isOpen:e,onClose:()=>t(!1),title:`Быстрое создание`,subtitle:`Профиль: ${s.name} • ${o}`,maxWidth:`lg`,children:u?(0,H.jsxs)(`div`,{className:`py-10 flex flex-col items-center justify-center text-center`,children:[(0,H.jsx)(Zo,{className:`w-12 h-12 text-krona-green mb-3`}),(0,H.jsx)(`h4`,{className:`text-base font-semibold text-krona-primary`,children:u}),(0,H.jsx)(`p`,{className:`text-xs text-krona-secondary mt-1`,children:`Данные синхронизированы в локальном mock API`})]}):(0,H.jsxs)(`div`,{className:`space-y-4`,children:[(0,H.jsxs)(`div`,{className:`grid grid-cols-3 gap-2 pb-2`,children:[(0,H.jsxs)(`button`,{type:`button`,onClick:()=>l(`order`),className:`p-2.5 rounded-lg border text-left flex items-center gap-2.5 transition-all ${c===`order`?`border-krona-green bg-krona-green/10 text-krona-green-text font-medium`:`border-krona-border bg-krona-surface text-krona-secondary hover:bg-krona-workspace`}`,children:[(0,H.jsx)(jc,{className:`w-4 h-4 shrink-0`}),(0,H.jsx)(`div`,{className:`text-xs truncate`,children:`Новый заказ / чек`})]}),(0,H.jsxs)(`button`,{type:`button`,onClick:()=>l(`booking`),className:`p-2.5 rounded-lg border text-left flex items-center gap-2.5 transition-all ${c===`booking`?`border-krona-green bg-krona-green/10 text-krona-green-text font-medium`:`border-krona-border bg-krona-surface text-krona-secondary hover:bg-krona-workspace`}`,children:[(0,H.jsx)(No,{className:`w-4 h-4 shrink-0`}),(0,H.jsx)(`div`,{className:`text-xs truncate`,children:`Запись / Бронь`})]}),(0,H.jsx)(`button`,{type:`button`,onClick:()=>l(s.capabilities.work_orders?`work_order`:`client`),className:`p-2.5 rounded-lg border text-left flex items-center gap-2.5 transition-all ${c===`work_order`||c===`client`?`border-krona-green bg-krona-green/10 text-krona-green-text font-medium`:`border-krona-border bg-krona-surface text-krona-secondary hover:bg-krona-workspace`}`,children:s.capabilities.work_orders?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(ll,{className:`w-4 h-4 shrink-0`}),(0,H.jsx)(`div`,{className:`text-xs truncate`,children:`Заказ-наряд`})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(rl,{className:`w-4 h-4 shrink-0`}),(0,H.jsx)(`div`,{className:`text-xs truncate`,children:`Новый клиент`})]})})]}),(0,H.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),c===`booking`?(r({clientName:f||`Новый клиент`,clientPhone:m||`+7 (900) 000-00-00`,resourceName:v,time:g,status:`confirmed`,deposit:Number(S)||0}),d(`Бронирование ресурса "${v}" успешно создано!`)):c===`work_order`?(a({vehicle:b||`Автомобиль клиента`,ownerName:f||`Владелец`,phone:m||`+7 (900) 000-00-00`,bay:`Пост 1`,masterName:`Иван Кузнецов`,services:[`Комплексная диагностика`,`Мойка / ТО`],partsAmount:1200,laborAmount:Number(S)||2500,status:`in_progress`}),d(`Заказ-наряд на ${b} открыт!`)):d(`Действие успешно выполнено для точки "${o}"!`),setTimeout(()=>{d(null),t(!1)},1200)},className:`space-y-3 pt-2`,children:[(0,H.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,H.jsx)(hl,{label:`Имя клиента`,value:f,onChange:e=>p(e.target.value),placeholder:`Иван Петров`,required:!0}),(0,H.jsx)(hl,{label:`Номер телефона`,value:m,onChange:e=>h(e.target.value),placeholder:`+7 (913) 000-00-00`,required:!0})]}),c===`booking`&&(0,H.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,H.jsx)(hl,{label:`Ресурс (${s.terminology.bookingResourceLabel})`,value:v,onChange:e=>y(e.target.value),placeholder:`Стол 4 / Пост 2 / Мастер`}),(0,H.jsx)(hl,{label:`Время записи`,type:`time`,value:g,onChange:e=>_(e.target.value)})]}),c===`work_order`&&(0,H.jsx)(`div`,{className:`space-y-3`,children:(0,H.jsx)(hl,{label:`Автомобиль и госномер`,value:b,onChange:e=>x(e.target.value),placeholder:`BMW X5 (А001АА 154)`,icon:(0,H.jsx)(Fo,{className:`w-4 h-4`})})}),(0,H.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,H.jsx)(hl,{label:`Сумма / Депозит (₽)`,type:`number`,value:S,onChange:e=>C(e.target.value),placeholder:`2500`}),(0,H.jsxs)(`div`,{className:`flex flex-col gap-1.5 text-left`,children:[(0,H.jsx)(`label`,{className:`text-xs font-medium text-krona-secondary`,children:`Точка бизнеса`}),(0,H.jsx)(`input`,{disabled:!0,value:o,className:`w-full bg-krona-workspace text-krona-secondary border border-krona-border rounded-md px-3 py-2 text-sm`})]})]}),(0,H.jsxs)(`div`,{className:`pt-3 flex justify-end gap-2`,children:[(0,H.jsx)(i,{type:`button`,variant:`secondary`,onClick:()=>t(!1),children:`Отмена`}),(0,H.jsx)(i,{type:`submit`,variant:`primary`,children:`Создать сущность`})]})]})]})})},Nl=()=>{let{isNotificationsOpen:e,setIsNotificationsOpen:t,notifications:n,dismissNotification:r,markAllNotificationsRead:a}=Oa(),o=Br(),s=e=>{switch(e){case`danger`:return(0,H.jsx)(qo,{className:`w-4 h-4 text-krona-danger`});case`warning`:return(0,H.jsx)($c,{className:`w-4 h-4 text-krona-warning`});case`success`:return(0,H.jsx)(Zo,{className:`w-4 h-4 text-krona-green`});default:return(0,H.jsx)(ks,{className:`w-4 h-4 text-krona-info`})}};return(0,H.jsx)(bl,{isOpen:e,onClose:()=>t(!1),title:`Центр внимания и уведомлений`,subtitle:`Срочные алерты, статус кассы, стоп-листы и опоздания`,width:`md`,footer:(0,H.jsxs)(`div`,{className:`w-full flex items-center justify-between`,children:[(0,H.jsxs)(i,{variant:`ghost`,size:`sm`,onClick:a,children:[(0,H.jsx)(zo,{className:`w-3.5 h-3.5 mr-1.5`}),`Прочитать все`]}),(0,H.jsx)(i,{variant:`secondary`,size:`sm`,onClick:()=>t(!1),children:`Закрыть`})]}),children:(0,H.jsx)(`div`,{className:`space-y-3`,children:n.length===0?(0,H.jsxs)(`div`,{className:`py-12 text-center text-krona-secondary text-xs`,children:[(0,H.jsx)(Do,{className:`w-8 h-8 mx-auto mb-2 opacity-30`}),`Нет активных уведомлений. Все системы в норме!`]}):n.map(e=>(0,H.jsx)(`div`,{className:`p-3.5 rounded-lg border transition-all ${e.read?`bg-krona-surface/40 border-krona-border/60 opacity-80`:`bg-krona-surface border-krona-border shadow-krona-soft`}`,children:(0,H.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,H.jsx)(`div`,{className:`mt-0.5 shrink-0`,children:s(e.type)}),(0,H.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-2 mb-1`,children:[(0,H.jsx)(`h5`,{className:`text-xs font-semibold text-krona-primary truncate`,children:e.title}),(0,H.jsx)(`span`,{className:`text-[10px] text-krona-secondary whitespace-nowrap`,children:e.timestamp})]}),(0,H.jsx)(`p`,{className:`text-xs text-krona-secondary leading-relaxed`,children:e.message}),(0,H.jsxs)(`div`,{className:`mt-2.5 flex items-center justify-between pt-1 border-t border-krona-border/40`,children:[e.actionUrl?(0,H.jsx)(`button`,{onClick:()=>{t(!1),o(e.actionUrl)},className:`text-xs text-krona-green font-medium hover:underline`,children:`Перейти к решению →`}):(0,H.jsx)(`span`,{}),(0,H.jsx)(`button`,{onClick:()=>r(e.id),className:`text-krona-secondary hover:text-krona-danger p-1 rounded`,title:`Удалить`,children:(0,H.jsx)(qc,{className:`w-3.5 h-3.5`})})]})]})]})},e.id))})})},Pl=()=>{let{theme:e,viewportMode:t,isAiDrawerOpen:n,setIsAiDrawerOpen:r,getActiveProfile:a,activeLocation:o}=Oa(),s=a();(0,A.useEffect)(()=>{document.documentElement.setAttribute(`data-theme`,e)},[e]);let c=()=>{switch(t){case`mobile`:return`max-w-[420px] h-[880px] my-6 border-8 border-[#3A3D35] rounded-[36px] overflow-hidden shadow-2xl relative`;case`tablet-portrait`:return`max-w-[820px] h-[1050px] my-6 border-8 border-[#3A3D35] rounded-[28px] overflow-hidden shadow-2xl relative`;case`tablet-landscape`:return`max-w-[1180px] h-[800px] my-6 border-8 border-[#3A3D35] rounded-[24px] overflow-hidden shadow-2xl relative`;default:return`w-full min-h-screen`}},l=t!==`desktop`,u=t===`mobile`;return(0,H.jsx)(`div`,{className:`min-h-screen bg-[#191B18] flex items-center justify-center ${l?`p-4`:``}`,children:(0,H.jsxs)(`div`,{className:`w-full bg-krona-app text-krona-primary flex flex-col transition-all duration-300 ${c()}`,children:[(0,H.jsxs)(`div`,{className:`flex-1 flex overflow-hidden w-full h-full relative`,children:[!u&&(0,H.jsx)(pl,{}),(0,H.jsxs)(`div`,{className:`flex-1 flex flex-col min-w-0 overflow-hidden bg-krona-workspace`,children:[(0,H.jsx)(Ol,{}),(0,H.jsx)(`main`,{className:`flex-1 overflow-y-auto ${u?`pb-20`:`pb-8`} p-4 md:p-6`,children:(0,H.jsx)(Ci,{})})]}),t===`desktop`&&(0,H.jsx)(kl,{})]}),u&&(0,H.jsx)(Al,{}),(0,H.jsx)(jl,{}),(0,H.jsx)(Ml,{}),(0,H.jsx)(Nl,{}),(0,H.jsx)(bl,{isOpen:n,onClose:()=>r(!1),title:`✦ Krona AI — Бизнес-оркестратор`,subtitle:`Контекст: ${s.name} • ${o}`,width:`md`,children:(0,H.jsxs)(`div`,{className:`space-y-4`,children:[(0,H.jsxs)(`div`,{className:`p-3 bg-krona-gold/10 border border-krona-gold/30 rounded-lg text-xs leading-relaxed text-krona-gold-text`,children:[(0,H.jsx)(`strong`,{children:`Krona AI Core v1:`}),` Интеллектуальный помощник подключен к локальной модели данных бизнеса, остаткам, расписанию смен и фискальным отчетам.`]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(`span`,{className:`text-xs font-semibold text-krona-secondary uppercase tracking-wider`,children:`Ролевые агенты команды:`}),(0,H.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-xs`,children:[(0,H.jsxs)(`div`,{className:`p-2.5 rounded-lg border border-krona-border bg-krona-surface`,children:[(0,H.jsx)(`div`,{className:`font-semibold text-krona-primary`,children:`Бизнес-аналитик`}),(0,H.jsx)(`div`,{className:`text-[11px] text-krona-secondary`,children:`Food cost, выручка, чеки`})]}),(0,H.jsxs)(`div`,{className:`p-2.5 rounded-lg border border-krona-border bg-krona-surface`,children:[(0,H.jsx)(`div`,{className:`font-semibold text-krona-primary`,children:`Складской агент`}),(0,H.jsx)(`div`,{className:`text-[11px] text-krona-secondary`,children:`Списания, закупки, пороги`})]}),(0,H.jsxs)(`div`,{className:`p-2.5 rounded-lg border border-krona-border bg-krona-surface`,children:[(0,H.jsx)(`div`,{className:`font-semibold text-krona-primary`,children:`Маркетолог`}),(0,H.jsx)(`div`,{className:`text-[11px] text-krona-secondary`,children:`Сегменты, LTV, рассылки`})]}),(0,H.jsxs)(`div`,{className:`p-2.5 rounded-lg border border-krona-border bg-krona-surface`,children:[(0,H.jsx)(`div`,{className:`font-semibold text-krona-primary`,children:`Финансовый аудитор`}),(0,H.jsx)(`div`,{className:`text-[11px] text-krona-secondary`,children:`Кассовые смены, ДДС, P&L`})]})]})]}),(0,H.jsx)(`div`,{className:`pt-2`,children:(0,H.jsx)(i,{variant:`primary`,className:`w-full text-xs`,onClick:()=>{r(!1),window.location.href=`/ai`},children:`Открыть полноэкранный AI-центр →`})})]})})]})})},Fl=({requiredPermission:e,moduleName:t})=>{let n=Br(),{currentRoleId:r,setCurrentRoleId:a}=p();return(0,H.jsx)(`div`,{"data-testid":`forbidden-page`,className:`min-h-[70vh] flex items-center justify-center p-6 animate-fade-in`,children:(0,H.jsxs)(`div`,{className:`max-w-md w-full bg-krona-surface border border-krona-border rounded-2xl p-8 text-center shadow-krona-soft`,children:[(0,H.jsx)(`div`,{className:`w-16 h-16 bg-krona-danger/10 text-krona-danger rounded-2xl flex items-center justify-center mx-auto mb-5`,children:(0,H.jsx)(Tc,{className:`w-8 h-8`,"aria-hidden":`true`})}),(0,H.jsx)(`span`,{className:`inline-block px-2.5 py-1 text-xs font-semibold bg-krona-danger/15 text-krona-danger rounded-full mb-3`,children:`403 Доступ ограничен`}),(0,H.jsxs)(`h1`,{className:`text-xl font-bold text-krona-primary mb-2`,children:[`Нет прав на просмотр `,t?`«${t}»`:`раздела`]}),(0,H.jsxs)(`p`,{className:`text-sm text-krona-secondary mb-6`,children:[`Текущая роль `,(0,H.jsxs)(`strong`,{className:`text-krona-primary font-semibold`,children:[`«`,r,`»`]}),` не имеет разрешений на этот модуль`,e?` (требуется: ${e})`:``,`.`]}),(0,H.jsxs)(`div`,{className:`p-3 bg-krona-workspace rounded-lg text-xs text-krona-secondary text-left mb-6 space-y-1`,children:[(0,H.jsx)(`p`,{className:`font-medium text-krona-primary`,children:`Быстрое решение для демонстрации:`}),(0,H.jsx)(`p`,{children:`Переключите роль на «Владелец» (owner) или «Администратор» (admin) для полного доступа.`})]}),(0,H.jsxs)(`div`,{className:`flex flex-col gap-2.5 sm:flex-row sm:justify-center`,children:[(0,H.jsxs)(i,{variant:`primary`,size:`md`,"data-testid":`switch-to-owner-btn`,onClick:()=>{a(`owner`),Oa.getState().setRoleId(`owner`)},children:[(0,H.jsx)(pc,{className:`w-4 h-4 mr-1.5`}),`Переключить на Owner`]}),(0,H.jsxs)(i,{variant:`outline`,size:`md`,"data-testid":`go-home-btn`,onClick:()=>n(`/`),children:[(0,H.jsx)(Ds,{className:`w-4 h-4 mr-1.5`}),`На главную`]})]})]})})},Il=({module:e,moduleName:t,requiredCapability:n,children:r})=>{let{currentRoleId:i,currentProfileId:a,stateOverride:o}=p();if(o===`permission_denied`)return(0,H.jsx)(Fl,{moduleName:t||e,requiredPermission:`demo:permission_denied`});if(o===`loading`)return(0,H.jsx)(Tl,{title:t});if(o===`error`)throw Error(`[Демо-ошибка]: Имитация сбоя при загрузке раздела «${t||e}».`);let s=po[i];if(s&&!(s.id===`owner`||s.id===`administrator`||s.allowedModules.includes(`*`))&&!s.allowedModules.includes(e))return(0,H.jsx)(Fl,{moduleName:t||e,requiredPermission:`Доступ к модулю «${e}» для роли «${s.label}»`});let c=Sa[a];return c&&n&&c.capabilities[n]===!1?(0,H.jsx)(Fl,{moduleName:t||e,requiredPermission:`Возможность «${n}» в бизнес-профиле «${c.name}»`}):(0,H.jsx)(H.Fragment,{children:r})},Ll=(0,A.lazy)(()=>j(()=>import(`./DynamicDashboard-CEusXfUQ.js`).then(e=>({default:e.DynamicDashboard})),__vite__mapDeps([0,1,2,3,4,5,6]))),Rl=()=>(0,H.jsx)(Il,{module:`dashboard`,moduleName:`Дашборд`,children:(0,H.jsx)(El,{scope:`Модуль Дашборд`,children:(0,H.jsx)(A.Suspense,{fallback:(0,H.jsx)(Tl,{title:`Дашборд`}),children:(0,H.jsx)(Ll,{})})})}),zl=(0,A.lazy)(()=>j(()=>import(`./OperationsModule-aDLWk78D.js`).then(e=>({default:e.OperationsModule})),__vite__mapDeps([7,1,8,2,9,3,10,4,5,11,12,13,14,15,16]))),Bl=()=>(0,H.jsx)(Il,{module:`operations`,moduleName:`Операции`,children:(0,H.jsx)(El,{scope:`Модуль Операции`,children:(0,H.jsx)(A.Suspense,{fallback:(0,H.jsx)(Tl,{title:`Операции`}),children:(0,H.jsx)(zl,{})})})}),Vl=(0,A.lazy)(()=>j(()=>import(`./CrmModule-Cw43Bd0U.js`).then(e=>({default:e.CrmModule})),__vite__mapDeps([17,1,18,19,20,21,22,23,14,8,13]))),Hl=()=>(0,H.jsx)(Il,{module:`crm`,moduleName:`CRM & Клиенты`,children:(0,H.jsx)(El,{scope:`Модуль CRM`,children:(0,H.jsx)(A.Suspense,{fallback:(0,H.jsx)(Tl,{title:`CRM & Клиенты`}),children:(0,H.jsx)(Vl,{})})})}),Ul=(0,A.lazy)(()=>j(()=>import(`./SalesModule-2VZC1D5Y.js`).then(e=>({default:e.SalesModule})),__vite__mapDeps([16,1,3,13,14,15]))),Wl=()=>(0,H.jsx)(Il,{module:`sales`,moduleName:`Продажи`,children:(0,H.jsx)(El,{scope:`Модуль Продажи`,children:(0,H.jsx)(A.Suspense,{fallback:(0,H.jsx)(Tl,{title:`Продажи`}),children:(0,H.jsx)(Ul,{})})})}),Gl=(0,A.lazy)(()=>j(()=>import(`./InventoryModule-B2QbjtwQ.js`).then(e=>({default:e.InventoryModule})),__vite__mapDeps([12,1,13,14,15]))),Kl=()=>(0,H.jsx)(Il,{module:`inventory`,moduleName:`Склад и остатки`,children:(0,H.jsx)(El,{scope:`Модуль Склад`,children:(0,H.jsx)(A.Suspense,{fallback:(0,H.jsx)(Tl,{title:`Склад и остатки`}),children:(0,H.jsx)(Gl,{})})})}),ql=(0,A.lazy)(()=>j(()=>import(`./FinanceModule-DiPGlGDb.js`).then(e=>({default:e.FinanceModule})),__vite__mapDeps([24,1,8,14]))),Jl=()=>(0,H.jsx)(Il,{module:`finance`,moduleName:`Финансы и касса`,children:(0,H.jsx)(El,{scope:`Модуль Финансы`,children:(0,H.jsx)(A.Suspense,{fallback:(0,H.jsx)(Tl,{title:`Финансы и касса`}),children:(0,H.jsx)(ql,{})})})}),Yl=(0,A.lazy)(()=>j(()=>import(`./EmployeesModule-BFNtlVZT.js`).then(e=>({default:e.EmployeesModule})),__vite__mapDeps([25,1,9,22,11]))),Xl=()=>(0,H.jsx)(Il,{module:`employees`,moduleName:`Сотрудники и смены`,children:(0,H.jsx)(El,{scope:`Модуль Сотрудники`,children:(0,H.jsx)(A.Suspense,{fallback:(0,H.jsx)(Tl,{title:`Сотрудники и смены`}),children:(0,H.jsx)(Yl,{})})})}),Zl=(0,A.lazy)(()=>j(()=>import(`./CommunicationsModule-CVUsOJz5.js`).then(e=>({default:e.CommunicationsModule})),__vite__mapDeps([26,1,11]))),Ql=()=>(0,H.jsx)(Il,{module:`communications`,moduleName:`Коммуникации`,children:(0,H.jsx)(El,{scope:`Модуль Коммуникации`,children:(0,H.jsx)(A.Suspense,{fallback:(0,H.jsx)(Tl,{title:`Коммуникации`}),children:(0,H.jsx)(Zl,{})})})}),$l=(0,A.lazy)(()=>j(()=>import(`./HelpDeskModule-B1p0xcj-.js`).then(e=>({default:e.HelpDeskModule})),__vite__mapDeps([27,1,11]))),eu=()=>(0,H.jsx)(Il,{module:`helpdesk`,moduleName:`Поддержка (HelpDesk)`,children:(0,H.jsx)(El,{scope:`Модуль Поддержка`,children:(0,H.jsx)(A.Suspense,{fallback:(0,H.jsx)(Tl,{title:`Поддержка (HelpDesk)`}),children:(0,H.jsx)($l,{})})})}),tu=(0,A.lazy)(()=>j(()=>import(`./TasksModule-3oA5V8YP.js`).then(e=>({default:e.TasksModule})),__vite__mapDeps([28,1,29,11]))),nu=()=>(0,H.jsx)(Il,{module:`tasks`,moduleName:`Задачи`,children:(0,H.jsx)(El,{scope:`Модуль Задачи`,children:(0,H.jsx)(A.Suspense,{fallback:(0,H.jsx)(Tl,{title:`Задачи`}),children:(0,H.jsx)(tu,{})})})}),ru=(0,A.lazy)(()=>j(()=>import(`./CmsModule-qZLJpvR4.js`).then(e=>({default:e.CmsModule})),__vite__mapDeps([30,1,31,32,33,34]))),iu=()=>(0,H.jsx)(Il,{module:`cms`,moduleName:`Сайты и CMS`,children:(0,H.jsx)(El,{scope:`Модуль CMS`,children:(0,H.jsx)(A.Suspense,{fallback:(0,H.jsx)(Tl,{title:`Сайты и CMS`}),children:(0,H.jsx)(ru,{})})})}),au=(0,A.lazy)(()=>j(()=>import(`./MarketingModule-D28ZVpJ3.js`).then(e=>({default:e.MarketingModule})),__vite__mapDeps([35,1,5]))),ou=()=>(0,H.jsx)(Il,{module:`marketing`,moduleName:`Маркетинг & Промо`,children:(0,H.jsx)(El,{scope:`Модуль Маркетинг`,children:(0,H.jsx)(A.Suspense,{fallback:(0,H.jsx)(Tl,{title:`Маркетинг & Промо`}),children:(0,H.jsx)(au,{})})})}),U=(0,A.lazy)(()=>j(()=>import(`./AnalyticsModule-DwAY229b.js`).then(e=>({default:e.AnalyticsModule})),__vite__mapDeps([36,1,2,5,6]))),su=()=>(0,H.jsx)(Il,{module:`analytics`,moduleName:`Аналитика & BI`,children:(0,H.jsx)(El,{scope:`Модуль Аналитика`,children:(0,H.jsx)(A.Suspense,{fallback:(0,H.jsx)(Tl,{title:`Аналитика & BI`}),children:(0,H.jsx)(U,{})})})}),cu=(0,A.lazy)(()=>j(()=>import(`./AutomationModule-CWTQE3B1.js`).then(e=>({default:e.AutomationModule})),__vite__mapDeps([37,1,31,38]))),lu=()=>(0,H.jsx)(Il,{module:`automation`,moduleName:`Автоматизация & Сценарии`,children:(0,H.jsx)(El,{scope:`Модуль Автоматизация`,children:(0,H.jsx)(A.Suspense,{fallback:(0,H.jsx)(Tl,{title:`Автоматизация & Сценарии`}),children:(0,H.jsx)(cu,{})})})}),uu=(0,A.lazy)(()=>j(()=>import(`./AiCenterModule-TWoGGfS0.js`).then(e=>({default:e.AiCenterModule})),__vite__mapDeps([39,1,20,38]))),du=()=>(0,H.jsx)(Il,{module:`ai`,moduleName:`AI Центр`,children:(0,H.jsx)(El,{scope:`Модуль AI Центр`,children:(0,H.jsx)(A.Suspense,{fallback:(0,H.jsx)(Tl,{title:`AI Центр`}),children:(0,H.jsx)(uu,{})})})}),fu=(0,A.lazy)(()=>j(()=>import(`./AppsCatalogModule-Dsu6Y18J.js`).then(e=>({default:e.AppsCatalogModule})),__vite__mapDeps([40,1,41]))),pu=()=>(0,H.jsx)(Il,{module:`apps`,moduleName:`Каталог приложений`,children:(0,H.jsx)(El,{scope:`Модуль Приложения`,children:(0,H.jsx)(A.Suspense,{fallback:(0,H.jsx)(Tl,{title:`Каталог приложений`}),children:(0,H.jsx)(fu,{})})})}),mu=(0,A.lazy)(()=>j(()=>import(`./SettingsModule-C5LrdOmz.js`).then(e=>({default:e.SettingsModule})),__vite__mapDeps([42,1,43,8,23,41]))),hu=()=>(0,H.jsx)(Il,{module:`settings`,moduleName:`Настройки платформы`,children:(0,H.jsx)(El,{scope:`Модуль Настройки`,children:(0,H.jsx)(A.Suspense,{fallback:(0,H.jsx)(Tl,{title:`Настройки платформы`}),children:(0,H.jsx)(mu,{})})})}),gu=(0,A.lazy)(()=>j(()=>import(`./EntityCatalog-_fN1VjC6.js`).then(e=>({default:e.EntityCatalog})),__vite__mapDeps([44,1,45,46]))),_u=()=>(0,H.jsx)(Il,{module:`settings`,moduleName:`Каталог сущностей`,children:(0,H.jsx)(El,{scope:`Каталог сущностей`,children:(0,H.jsx)(A.Suspense,{fallback:(0,H.jsx)(Tl,{title:`Каталог сущностей платформы`}),children:(0,H.jsx)(gu,{})})})}),vu=(0,A.lazy)(()=>j(()=>import(`./FieldBuilder-iF06Nk4x.js`).then(e=>({default:e.FieldBuilder})),__vite__mapDeps([47,1,48,19,8,20,33,29,21,49,9,22,10,50,51]))),yu=()=>(0,H.jsx)(Il,{module:`settings`,moduleName:`Конструктор полей`,children:(0,H.jsx)(El,{scope:`Конструктор полей`,children:(0,H.jsx)(A.Suspense,{fallback:(0,H.jsx)(Tl,{title:`Конструктор полей сущности`}),children:(0,H.jsx)(vu,{})})})}),bu=(0,A.lazy)(()=>j(()=>import(`./FormBuilder-hvNl7u0G.js`).then(e=>({default:e.FormBuilder})),__vite__mapDeps([52,1,48,19,8,20,33,29,21,49,9,22,10,50,53,54]))),xu=()=>(0,H.jsx)(Il,{module:`settings`,moduleName:`Конструктор форм`,children:(0,H.jsx)(El,{scope:`Конструктор форм`,children:(0,H.jsx)(A.Suspense,{fallback:(0,H.jsx)(Tl,{title:`Конструктор экранных форм`}),children:(0,H.jsx)(bu,{})})})}),Su=(0,A.lazy)(()=>j(()=>import(`./CardLayoutBuilder-CM6emXoY.js`).then(e=>({default:e.CardLayoutBuilder})),__vite__mapDeps([55,1,43,50,21,53,54,34,10,14]))),Cu=()=>(0,H.jsx)(Il,{module:`settings`,moduleName:`Конструктор карточки`,children:(0,H.jsx)(El,{scope:`Конструктор карточки`,children:(0,H.jsx)(A.Suspense,{fallback:(0,H.jsx)(Tl,{title:`Конструктор детальной карточки`}),children:(0,H.jsx)(Su,{})})})}),wu=(0,A.lazy)(()=>j(()=>import(`./ViewBuilder-BPVOktaa.js`).then(e=>({default:e.ViewBuilder})),__vite__mapDeps([56,1,43,57,50,54,46,14]))),Tu=()=>(0,H.jsx)(Il,{module:`settings`,moduleName:`Конструктор представлений`,children:(0,H.jsx)(El,{scope:`Конструктор представлений`,children:(0,H.jsx)(A.Suspense,{fallback:(0,H.jsx)(Tl,{title:`Конструктор представлений и списков`}),children:(0,H.jsx)(wu,{})})})}),Eu=(0,A.lazy)(()=>j(()=>import(`./CustomEntityPage-BBlkJ9R4.js`).then(e=>({default:e.CustomEntityPage})),__vite__mapDeps([58,1,43,31,57,32,19,18,20,21,22,23,14,50,49,45,51,9,46]))),Du=()=>(0,H.jsx)(El,{scope:`Модуль сущности`,children:(0,H.jsx)(A.Suspense,{fallback:(0,H.jsx)(Tl,{title:`Загрузка данных сущности...`}),children:(0,H.jsx)(Eu,{})})}),Ou=()=>{let e=Br(),t=Lr();return(0,H.jsx)(`div`,{className:`min-h-[70vh] flex items-center justify-center p-6 animate-fade-in`,children:(0,H.jsxs)(`div`,{className:`max-w-md w-full bg-krona-surface border border-krona-border rounded-2xl p-8 text-center shadow-krona-soft`,children:[(0,H.jsx)(`div`,{className:`w-16 h-16 bg-krona-surface-muted text-krona-gold rounded-2xl flex items-center justify-center mx-auto mb-5`,children:(0,H.jsx)(as,{className:`w-8 h-8`,"aria-hidden":`true`})}),(0,H.jsx)(`span`,{className:`inline-block px-2.5 py-1 text-xs font-semibold bg-krona-surface-muted text-krona-secondary rounded-full mb-3`,children:`404 Страница не найдена`}),(0,H.jsx)(`h1`,{className:`text-xl font-bold text-krona-primary mb-2`,children:`Раздел не существует`}),(0,H.jsx)(`p`,{className:`text-sm text-krona-secondary mb-2`,children:`Запрошенный адрес не найден в системе Krona Business OS:`}),(0,H.jsx)(`code`,{className:`inline-block px-2 py-1 text-xs bg-krona-workspace text-krona-primary rounded border border-krona-border font-mono mb-6 max-w-full truncate`,children:t.pathname}),(0,H.jsxs)(`div`,{className:`flex flex-col gap-2.5 sm:flex-row sm:justify-center`,children:[(0,H.jsxs)(i,{variant:`outline`,size:`md`,onClick:()=>e(-1),children:[(0,H.jsx)(_o,{className:`w-4 h-4 mr-1.5`}),`Назад`]}),(0,H.jsxs)(i,{variant:`primary`,size:`md`,onClick:()=>e(`/`),children:[(0,H.jsx)(Ds,{className:`w-4 h-4 mr-1.5`}),`На главную`]})]})]})})},ku={platform_owner:{label:`Владелец платформы`,description:`Полный доступ ко всем управленческим, финансовым, релизным и инфраструктурным операциям.`,permissions:{canManagePlatformStatus:!0,canGrantTrialGrace:!0,canEditEntitlements:!0,canTriggerRollouts:!0,canPauseRollbackRollouts:!0,canManageIncidents:!0,canCreateAnnouncements:!0,canScheduleMaintenance:!0,canRequestDiagnostics:!0,canExportAudit:!0,canViewBillingDetails:!0}},platform_admin:{label:`Системный администратор`,description:`Управление организациями, инфраструктурой, инцидентами и техническими операциями.`,permissions:{canManagePlatformStatus:!0,canGrantTrialGrace:!0,canEditEntitlements:!1,canTriggerRollouts:!0,canPauseRollbackRollouts:!0,canManageIncidents:!0,canCreateAnnouncements:!0,canScheduleMaintenance:!0,canRequestDiagnostics:!0,canExportAudit:!0,canViewBillingDetails:!1}},support_operator:{label:`Оператор поддержки`,description:`Диагностика инцидентов, запрос телеметрии, отправка точечных сервисных сообщений.`,permissions:{canManagePlatformStatus:!1,canGrantTrialGrace:!1,canEditEntitlements:!1,canTriggerRollouts:!1,canPauseRollbackRollouts:!1,canManageIncidents:!0,canCreateAnnouncements:!0,canScheduleMaintenance:!1,canRequestDiagnostics:!0,canExportAudit:!1,canViewBillingDetails:!1}},billing_manager:{label:`Биллинг-менеджер`,description:`Управление подписками, тарифами, продлениями, выдача пробных и льготных периодов.`,permissions:{canManagePlatformStatus:!0,canGrantTrialGrace:!0,canEditEntitlements:!0,canTriggerRollouts:!1,canPauseRollbackRollouts:!1,canManageIncidents:!1,canCreateAnnouncements:!0,canScheduleMaintenance:!1,canRequestDiagnostics:!1,canExportAudit:!1,canViewBillingDetails:!0}},security_auditor:{label:`Аудитор безопасности`,description:`Read-only доступ ко всем операциям с правом полного аудита и экспорта защищённого журнала.`,permissions:{canManagePlatformStatus:!1,canGrantTrialGrace:!1,canEditEntitlements:!1,canTriggerRollouts:!1,canPauseRollbackRollouts:!1,canManageIncidents:!1,canCreateAnnouncements:!1,canScheduleMaintenance:!1,canRequestDiagnostics:!0,canExportAudit:!0,canViewBillingDetails:!0}},release_manager:{label:`Релиз-менеджер`,description:`Управление каталогом модулей, compatibility matrix, запуск пилотных и фазовых раскаток.`,permissions:{canManagePlatformStatus:!1,canGrantTrialGrace:!1,canEditEntitlements:!1,canTriggerRollouts:!0,canPauseRollbackRollouts:!0,canManageIncidents:!0,canCreateAnnouncements:!0,canScheduleMaintenance:!1,canRequestDiagnostics:!1,canExportAudit:!1,canViewBillingDetails:!1}}},Au=[{tenantId:`01918a20-0001-7000-8000-000000000001`,displayName:`ООО «Северная Ритейл Группа»`,inn:`7801234567`,domain:`nordretail.ru`,platformStatus:`active`,userCount:142,branchCount:18,installedModulesCount:6,mrrMinorUnits:289e5,outstandingDebtMinorUnits:0,currency:`RUB`,tariffPlan:`Enterprise Max`,subscriptionEndAt:`2026-11-15T00:00:00Z`,gracePeriodUntil:null,lastActiveAt:`2026-09-10T18:40:00Z`,sourceRevision:`rev-2026-09-08-01`,projectedAt:`2026-09-10T18:45:00Z`,contactEmail:`it-dir@nordretail.ru`,contactPhone:`+7 (812) 300-11-22`},{tenantId:`01918a20-0002-7000-8000-000000000002`,displayName:`АО «Балтийская Логистика»`,inn:`7810987654`,domain:`baltlogistics.ru`,platformStatus:`active`,userCount:88,branchCount:7,installedModulesCount:5,mrrMinorUnits:175e5,outstandingDebtMinorUnits:0,currency:`RUB`,tariffPlan:`Business Pro`,subscriptionEndAt:`2026-09-14T00:00:00Z`,gracePeriodUntil:null,lastActiveAt:`2026-09-10T18:35:00Z`,sourceRevision:`rev-2026-09-08-02`,projectedAt:`2026-09-10T18:45:00Z`,contactEmail:`admin@baltlogistics.ru`,contactPhone:`+7 (812) 450-99-88`},{tenantId:`01918a20-0003-7000-8000-000000000003`,displayName:`Сеть кофеен «Эспрессо Поинт»`,inn:`7705432198`,domain:`espressopoint.com`,platformStatus:`trial`,userCount:34,branchCount:9,installedModulesCount:4,mrrMinorUnits:0,outstandingDebtMinorUnits:0,currency:`RUB`,tariffPlan:`Trial Pilot (POS + Omnichannel)`,subscriptionEndAt:`2026-09-17T00:00:00Z`,gracePeriodUntil:null,lastActiveAt:`2026-09-10T18:10:00Z`,sourceRevision:`rev-2026-09-07-01`,projectedAt:`2026-09-10T18:45:00Z`,contactEmail:`ceo@espressopoint.com`,contactPhone:`+7 (495) 777-12-34`},{tenantId:`01918a20-0004-7000-8000-000000000004`,displayName:`ООО «ТехноПромСнаб»`,inn:`5406123987`,domain:`tehnoprom-snab.ru`,platformStatus:`grace`,userCount:52,branchCount:3,installedModulesCount:5,mrrMinorUnits:12e6,outstandingDebtMinorUnits:12e6,currency:`RUB`,tariffPlan:`Business Standard`,subscriptionEndAt:`2026-09-05T00:00:00Z`,gracePeriodUntil:`2026-09-15T00:00:00Z`,lastActiveAt:`2026-09-10T17:50:00Z`,sourceRevision:`rev-2026-09-05-01`,projectedAt:`2026-09-10T18:45:00Z`,contactEmail:`finance@tehnoprom-snab.ru`,contactPhone:`+7 (383) 220-44-55`},{tenantId:`01918a20-0005-7000-8000-000000000005`,displayName:`ИП Смирнов А. В. («Уральский Крепёж»)`,inn:`667100234567`,domain:`ural-krepezh.ru`,platformStatus:`suspended`,userCount:16,branchCount:2,installedModulesCount:3,mrrMinorUnits:45e5,outstandingDebtMinorUnits:9e6,currency:`RUB`,tariffPlan:`Starter Ops`,subscriptionEndAt:`2026-08-20T00:00:00Z`,gracePeriodUntil:`2026-08-30T00:00:00Z`,lastActiveAt:`2026-08-29T14:20:00Z`,sourceRevision:`rev-2026-08-20-01`,projectedAt:`2026-09-10T18:45:00Z`,contactEmail:`smirnov@ural-krepezh.ru`,contactPhone:`+7 (343) 310-20-30`},{tenantId:`01918a20-0006-7000-8000-000000000006`,displayName:`Клиника «Здоровая Семья»`,inn:`7728901234`,domain:`healthfamily-med.ru`,platformStatus:`active`,userCount:110,branchCount:5,installedModulesCount:6,mrrMinorUnits:245e5,outstandingDebtMinorUnits:0,currency:`RUB`,tariffPlan:`Business Pro`,subscriptionEndAt:`2026-10-01T00:00:00Z`,gracePeriodUntil:null,lastActiveAt:`2026-09-10T18:25:00Z`,sourceRevision:`rev-2026-09-01-01`,projectedAt:`2026-09-10T18:45:00Z`,contactEmail:`med-it@healthfamily-med.ru`,contactPhone:`+7 (495) 890-77-66`},{tenantId:`01918a20-0007-7000-8000-000000000007`,displayName:`ООО «Волга-Агротрейд»`,inn:`6315678901`,domain:`volga-agro.ru`,platformStatus:`active`,userCount:64,branchCount:4,installedModulesCount:4,mrrMinorUnits:14e6,outstandingDebtMinorUnits:0,currency:`RUB`,tariffPlan:`Business Standard`,subscriptionEndAt:`2026-09-16T00:00:00Z`,gracePeriodUntil:null,lastActiveAt:`2026-09-10T18:05:00Z`,sourceRevision:`rev-2026-09-08-03`,projectedAt:`2026-09-10T18:45:00Z`,contactEmail:`ops@volga-agro.ru`,contactPhone:`+7 (846) 990-11-44`},{tenantId:`01918a20-0008-7000-8000-000000000008`,displayName:`ООО «Ювелирный Дом Аврора»`,inn:`7709876543`,domain:`aurora-jewel.ru`,platformStatus:`active`,userCount:40,branchCount:6,installedModulesCount:5,mrrMinorUnits:195e5,outstandingDebtMinorUnits:0,currency:`RUB`,tariffPlan:`Business Pro`,subscriptionEndAt:`2026-12-31T00:00:00Z`,gracePeriodUntil:null,lastActiveAt:`2026-09-10T18:38:00Z`,sourceRevision:`rev-2026-09-09-01`,projectedAt:`2026-09-10T18:45:00Z`,contactEmail:`sec@aurora-jewel.ru`,contactPhone:`+7 (495) 340-55-66`},{tenantId:`01918a20-0009-7000-8000-000000000009`,displayName:`Фитнес-клубы «Атлетика Плюс»`,inn:`7814567890`,domain:`atletika-plus.ru`,platformStatus:`trial`,userCount:28,branchCount:3,installedModulesCount:4,mrrMinorUnits:0,outstandingDebtMinorUnits:0,currency:`RUB`,tariffPlan:`Trial Pilot (Omnichannel)`,subscriptionEndAt:`2026-09-28T00:00:00Z`,gracePeriodUntil:null,lastActiveAt:`2026-09-10T17:15:00Z`,sourceRevision:`rev-2026-09-02-01`,projectedAt:`2026-09-10T18:45:00Z`,contactEmail:`director@atletika-plus.ru`,contactPhone:`+7 (812) 670-80-90`},{tenantId:`01918a20-0010-7000-8000-000000000010`,displayName:`ООО «Сибирский Лесокомбинат»`,inn:`2466123456`,domain:`sibles-group.ru`,platformStatus:`active`,userCount:95,branchCount:6,installedModulesCount:5,mrrMinorUnits:21e6,outstandingDebtMinorUnits:0,currency:`RUB`,tariffPlan:`Business Pro`,subscriptionEndAt:`2026-10-05T00:00:00Z`,gracePeriodUntil:null,lastActiveAt:`2026-09-10T16:40:00Z`,sourceRevision:`rev-2026-09-01-02`,projectedAt:`2026-09-10T18:45:00Z`,contactEmail:`it@sibles-group.ru`,contactPhone:`+7 (391) 211-33-77`},{tenantId:`01918a20-0011-7000-8000-000000000011`,displayName:`ООО «Казань Экспресс Доставка»`,inn:`1655345678`,domain:`kzn-express-delivery.ru`,platformStatus:`grace`,userCount:45,branchCount:4,installedModulesCount:4,mrrMinorUnits:98e5,outstandingDebtMinorUnits:98e5,currency:`RUB`,tariffPlan:`Business Standard`,subscriptionEndAt:`2026-09-08T00:00:00Z`,gracePeriodUntil:`2026-09-18T00:00:00Z`,lastActiveAt:`2026-09-10T17:45:00Z`,sourceRevision:`rev-2026-09-08-04`,projectedAt:`2026-09-10T18:45:00Z`,contactEmail:`buh@kzn-express.ru`,contactPhone:`+7 (843) 520-10-20`},{tenantId:`01918a20-0012-7000-8000-000000000012`,displayName:`ИП Ковалева М. И. («Шоколадница на Невском»)`,inn:`784200112233`,domain:`choconeva.spb.ru`,platformStatus:`active`,userCount:22,branchCount:2,installedModulesCount:3,mrrMinorUnits:65e5,outstandingDebtMinorUnits:0,currency:`RUB`,tariffPlan:`Starter Ops`,subscriptionEndAt:`2026-09-13T00:00:00Z`,gracePeriodUntil:null,lastActiveAt:`2026-09-10T18:30:00Z`,sourceRevision:`rev-2026-09-06-01`,projectedAt:`2026-09-10T18:45:00Z`,contactEmail:`kovaleva@choconeva.spb.ru`,contactPhone:`+7 (812) 998-77-11`},{tenantId:`01918a20-0013-7000-8000-000000000013`,displayName:`АО «Приморский Рыбокомбинат»`,inn:`2540112233`,domain:`prim-fish.ru`,platformStatus:`active`,userCount:160,branchCount:8,installedModulesCount:7,mrrMinorUnits:32e6,outstandingDebtMinorUnits:0,currency:`RUB`,tariffPlan:`Enterprise Max`,subscriptionEndAt:`2026-11-30T00:00:00Z`,gracePeriodUntil:null,lastActiveAt:`2026-09-10T15:20:00Z`,sourceRevision:`rev-2026-09-04-01`,projectedAt:`2026-09-10T18:45:00Z`,contactEmail:`dispatch@prim-fish.ru`,contactPhone:`+7 (423) 240-50-60`},{tenantId:`01918a20-0014-7000-8000-000000000014`,displayName:`ООО «АвтоДизель Сервис»`,inn:`7604123456`,domain:`autodiesel-yar.ru`,platformStatus:`suspended`,userCount:18,branchCount:1,installedModulesCount:2,mrrMinorUnits:39e5,outstandingDebtMinorUnits:78e5,currency:`RUB`,tariffPlan:`Starter Ops`,subscriptionEndAt:`2026-07-15T00:00:00Z`,gracePeriodUntil:`2026-07-25T00:00:00Z`,lastActiveAt:`2026-07-24T11:00:00Z`,sourceRevision:`rev-2026-07-15-01`,projectedAt:`2026-09-10T18:45:00Z`,contactEmail:`info@autodiesel-yar.ru`,contactPhone:`+7 (4852) 77-88-99`}],ju=[{moduleId:`krona-core`,name:`Krona Core System`,code:`core`,category:`core`,description:`Системное ядро: пользователи, роли, RBAC, аутентификация и метаданные сущностей.`,latestVersion:`2.4.0`,availableVersions:[`2.4.0`,`2.3.2`,`2.2.0`],requiredCapabilities:[`system:base`],manifestVersion:`1.0`,rolloutChannel:`stable`,activeTenantsCount:14,instancesCount:14,dependencies:[],releaseHistory:[{version:`2.4.0`,releasedAt:`2026-08-25T10:00:00Z`,changelog:`Оптимизация кеша метаданных, поддержка новых типов колонок.`,compatibleCore:`>=2.4.0`},{version:`2.3.2`,releasedAt:`2026-07-10T12:00:00Z`,changelog:`Патч безопасности для сессионных токенов.`,compatibleCore:`>=2.3.0`}]},{moduleId:`krona-crm`,name:`CRM & Клиенты`,code:`crm`,category:`crm`,description:`Управление сделками, воронки продаж, контакты клиентов и карточки лидов.`,latestVersion:`2.1.2`,availableVersions:[`2.1.2`,`2.1.0`,`2.0.4`],requiredCapabilities:[`crm:deals`,`crm:contacts`],manifestVersion:`1.0`,rolloutChannel:`stable`,activeTenantsCount:12,instancesCount:12,dependencies:[`krona-core`],releaseHistory:[{version:`2.1.2`,releasedAt:`2026-08-30T14:00:00Z`,changelog:`Авторасчет конверсий и drag-and-drop в канбан-доске.`,compatibleCore:`>=2.3.0`}]},{moduleId:`krona-operations`,name:`Операционный склад и логистика`,code:`operations`,category:`operations`,description:`Складской учет, перемещения, штрихкодирование партий, инвентаризации.`,latestVersion:`1.9.5`,availableVersions:[`1.9.5`,`1.9.0`,`1.8.4`],requiredCapabilities:[`ops:inventory`,`ops:warehouses`],manifestVersion:`1.0`,rolloutChannel:`stable`,activeTenantsCount:10,instancesCount:10,dependencies:[`krona-core`],releaseHistory:[{version:`1.9.5`,releasedAt:`2026-08-15T09:00:00Z`,changelog:`Поддержка сериализованного учета весового товара.`,compatibleCore:`>=2.3.0`}]},{moduleId:`krona-finance`,name:`Финансы и казначейство`,code:`finance`,category:`finance`,description:`Платежи, статьи ДДС, банковские выписки, бюджетирование и сверки.`,latestVersion:`2.0.1`,availableVersions:[`2.0.1`,`2.0.0`,`1.8.9`],requiredCapabilities:[`fin:ledger`,`fin:cashflow`],manifestVersion:`1.0`,rolloutChannel:`stable`,activeTenantsCount:9,instancesCount:9,dependencies:[`krona-core`],releaseHistory:[{version:`2.0.1`,releasedAt:`2026-09-02T16:00:00Z`,changelog:`Интеграция с новыми форматами 1С и валютными minor units.`,compatibleCore:`>=2.4.0`}]},{moduleId:`krona-staff`,name:`Кадры и смены`,code:`staff`,category:`staff`,description:`Графики смен, табелирование, карточки сотрудников, KPI.`,latestVersion:`1.5.0`,availableVersions:[`1.5.0`,`1.4.2`],requiredCapabilities:[`staff:shifts`,`staff:attendance`],manifestVersion:`1.0`,rolloutChannel:`pilot`,activeTenantsCount:7,instancesCount:7,dependencies:[`krona-core`],releaseHistory:[{version:`1.5.0`,releasedAt:`2026-09-01T11:00:00Z`,changelog:`Пилотный биометрический учет и гибкие смены.`,compatibleCore:`>=2.4.0`}]},{moduleId:`krona-omnichannel`,name:`Омниканальные коммуникации`,code:`omnichannel`,category:`omnichannel`,description:`Единый центр диалогов: Telegram, WhatsApp, MAX-бот, телефония и почта.`,latestVersion:`3.0.0-rc2`,availableVersions:[`3.0.0-rc2`,`2.8.4`,`2.7.0`],requiredCapabilities:[`comm:channels`,`comm:chat`],manifestVersion:`1.0`,rolloutChannel:`pilot`,activeTenantsCount:6,instancesCount:6,dependencies:[`krona-core`,`krona-crm`],releaseHistory:[{version:`3.0.0-rc2`,releasedAt:`2026-09-06T15:30:00Z`,changelog:`Новый WebSocket транспорт и ускоренная доставка медиа.`,compatibleCore:`>=2.4.0`}]},{moduleId:`krona-pos`,name:`Кассовый узел POS`,code:`pos`,category:`pos`,description:`Рабочее место кассира: ФЗ-54, печать чеков, сканер, быстрые продажи.`,latestVersion:`1.8.2`,availableVersions:[`1.8.2`,`1.8.0`,`1.7.5`],requiredCapabilities:[`pos:fiscal`,`pos:sales`],manifestVersion:`1.0`,rolloutChannel:`stable`,activeTenantsCount:5,instancesCount:5,dependencies:[`krona-core`,`krona-operations`],releaseHistory:[{version:`1.8.2`,releasedAt:`2026-08-18T10:00:00Z`,changelog:`Драйверы для АТОЛ 5.0 и оффлайн-буферизация чеков.`,compatibleCore:`>=2.3.0`}]},{moduleId:`krona-analytics`,name:`Бизнес-Аналитика и дашборды`,code:`analytics`,category:`analytics`,description:`OLAP-кубы, когортный анализ, план-факт, автоотчеты руководству.`,latestVersion:`2.2.0`,availableVersions:[`2.2.0`,`2.1.1`,`2.0.0`],requiredCapabilities:[`analytics:bi`,`analytics:export`],manifestVersion:`1.0`,rolloutChannel:`stable`,activeTenantsCount:8,instancesCount:8,dependencies:[`krona-core`],releaseHistory:[{version:`2.2.0`,releasedAt:`2026-08-28T12:00:00Z`,changelog:`Предиктивные графики выручки и экспорт в Excel/PDF.`,compatibleCore:`>=2.3.0`}]}],Mu=[{subscriptionId:`sub-001`,tenantId:`01918a20-0001-7000-8000-000000000001`,tenantName:`ООО «Северная Ритейл Группа»`,billingAccountRef:`ACC-NORD-7801`,planCode:`enterprise-max`,period:`year`,amountMinorUnits:3468e5,currency:`RUB`,status:`normal`,renewsAt:`2026-11-15T00:00:00Z`,validFrom:`2025-11-15T00:00:00Z`,validUntil:`2026-11-15T00:00:00Z`,graceUntil:null,activeModules:[`krona-core`,`krona-crm`,`krona-operations`,`krona-finance`,`krona-staff`,`krona-pos`],autoRenew:!0,history:[{eventAt:`2025-11-15T10:00:00Z`,type:`renewed`,description:`Годовое продление тарифа Enterprise Max`,actor:`billing_manager`}]},{subscriptionId:`sub-002`,tenantId:`01918a20-0002-7000-8000-000000000002`,tenantName:`АО «Балтийская Логистика»`,billingAccountRef:`ACC-BALT-7810`,planCode:`business-pro`,period:`month`,amountMinorUnits:175e5,currency:`RUB`,status:`expiring_7d`,renewsAt:`2026-09-14T00:00:00Z`,validFrom:`2026-08-14T00:00:00Z`,validUntil:`2026-09-14T00:00:00Z`,graceUntil:null,activeModules:[`krona-core`,`krona-crm`,`krona-operations`,`krona-finance`,`krona-analytics`],autoRenew:!1,history:[{eventAt:`2026-08-14T10:00:00Z`,type:`renewed`,description:`Месячный счет оплачен по безналичному расчету`,actor:`billing_manager`}]},{subscriptionId:`sub-003`,tenantId:`01918a20-0003-7000-8000-000000000003`,tenantName:`Сеть кофеен «Эспрессо Поинт»`,billingAccountRef:`ACC-ESPRESSO-7705`,planCode:`trial-pilot`,period:`month`,amountMinorUnits:0,currency:`RUB`,status:`expiring_7d`,renewsAt:null,validFrom:`2026-08-17T00:00:00Z`,validUntil:`2026-09-17T00:00:00Z`,graceUntil:null,activeModules:[`krona-core`,`krona-pos`,`krona-operations`,`krona-omnichannel`],autoRenew:!1,history:[{eventAt:`2026-08-17T11:00:00Z`,type:`trial_added`,description:`Выдан промо-триал на 30 дней для тестирования POS касс`,actor:`platform_owner`}]},{subscriptionId:`sub-004`,tenantId:`01918a20-0004-7000-8000-000000000004`,tenantName:`ООО «ТехноПромСнаб»`,billingAccountRef:`ACC-TPS-5406`,planCode:`business-std`,period:`month`,amountMinorUnits:12e6,currency:`RUB`,status:`grace`,renewsAt:null,validFrom:`2026-08-05T00:00:00Z`,validUntil:`2026-09-05T00:00:00Z`,graceUntil:`2026-09-15T00:00:00Z`,activeModules:[`krona-core`,`krona-crm`,`krona-operations`,`krona-finance`,`krona-staff`],autoRenew:!1,history:[{eventAt:`2026-09-06T09:00:00Z`,type:`grace_granted`,description:`Предоставлен Grace Period 10 дней по запросу финдиректора`,actor:`billing_manager`}]},{subscriptionId:`sub-005`,tenantId:`01918a20-0005-7000-8000-000000000005`,tenantName:`ИП Смирнов А. В. («Уральский Крепёж»)`,billingAccountRef:`ACC-SMIRNOV-6671`,planCode:`starter-ops`,period:`month`,amountMinorUnits:45e5,currency:`RUB`,status:`suspended`,renewsAt:null,validFrom:`2026-07-20T00:00:00Z`,validUntil:`2026-08-20T00:00:00Z`,graceUntil:`2026-08-30T00:00:00Z`,activeModules:[`krona-core`,`krona-operations`,`krona-crm`],autoRenew:!1,history:[{eventAt:`2026-08-31T00:01:00Z`,type:`plan_changed`,description:`Приостановлено за неоплату после окончания льготного периода`,actor:`platform_admin`}]},{subscriptionId:`sub-006`,tenantId:`01918a20-0006-7000-8000-000000000006`,tenantName:`Клиника «Здоровая Семья»`,billingAccountRef:`ACC-MED-7728`,planCode:`business-pro`,period:`month`,amountMinorUnits:245e5,currency:`RUB`,status:`expiring_30d`,renewsAt:`2026-10-01T00:00:00Z`,validFrom:`2026-09-01T00:00:00Z`,validUntil:`2026-10-01T00:00:00Z`,graceUntil:null,activeModules:[`krona-core`,`krona-crm`,`krona-staff`,`krona-finance`,`krona-analytics`,`krona-omnichannel`],autoRenew:!0,history:[{eventAt:`2026-09-01T08:00:00Z`,type:`renewed`,description:`Автосписание успешно выполнено`,actor:`billing_manager`}]},{subscriptionId:`sub-007`,tenantId:`01918a20-0007-7000-8000-000000000007`,tenantName:`ООО «Волга-Агротрейд»`,billingAccountRef:`ACC-AGRO-6315`,planCode:`business-std`,period:`month`,amountMinorUnits:14e6,currency:`RUB`,status:`expiring_7d`,renewsAt:`2026-09-16T00:00:00Z`,validFrom:`2026-08-16T00:00:00Z`,validUntil:`2026-09-16T00:00:00Z`,graceUntil:null,activeModules:[`krona-core`,`krona-crm`,`krona-operations`,`krona-finance`],autoRenew:!1,history:[]},{subscriptionId:`sub-011`,tenantId:`01918a20-0011-7000-8000-000000000011`,tenantName:`ООО «Казань Экспресс Доставка»`,billingAccountRef:`ACC-KZN-1655`,planCode:`business-std`,period:`month`,amountMinorUnits:98e5,currency:`RUB`,status:`grace`,renewsAt:null,validFrom:`2026-08-08T00:00:00Z`,validUntil:`2026-09-08T00:00:00Z`,graceUntil:`2026-09-18T00:00:00Z`,activeModules:[`krona-core`,`krona-crm`,`krona-operations`,`krona-finance`],autoRenew:!1,history:[{eventAt:`2026-09-08T18:00:00Z`,type:`grace_granted`,description:`Предоставлен Grace Period 10 дней`,actor:`billing_manager`}]},{subscriptionId:`sub-012`,tenantId:`01918a20-0012-7000-8000-000000000012`,tenantName:`ИП Ковалева М. И. («Шоколадница на Невском»)`,billingAccountRef:`ACC-CHOC-7842`,planCode:`starter-ops`,period:`month`,amountMinorUnits:65e5,currency:`RUB`,status:`expiring_7d`,renewsAt:`2026-09-13T00:00:00Z`,validFrom:`2026-08-13T00:00:00Z`,validUntil:`2026-09-13T00:00:00Z`,graceUntil:null,activeModules:[`krona-core`,`krona-pos`,`krona-operations`],autoRenew:!1,history:[]}],Nu=[{serverId:`srv-001-sel-spb`,name:`vps-sel-spb-prod-01`,hostname:`node-spb-01.infra.krona.systems`,ipAddress:`178.212.13.102`,hostingProvider:`Selectel`,region:`ru-spb-1`,status:`healthy`,agentVersion:`1.4.2`,agentStatus:`enrolled`,certificateExpiresAt:`2027-08-15T00:00:00Z`,certificateDaysRemaining:338,cpuLoadPercent:24,ramUsedBytes:6871947673,ramTotalBytes:17179869184,diskUsedBytes:53687091200,diskTotalBytes:161061273600,inodeUsedPercent:31,networkRxBytesPerSec:142e4,networkTxBytesPerSec:289e4,uptimeSeconds:7894e3,latencyMs:12,deployedInstancesCount:5,lastSeenAt:`2026-09-10T18:45:00Z`,backup:{state:`ok`,lastSuccessfulAt:`2026-09-10T03:00:00Z`,sizeBytes:12884901888,encryptedExternalCopy:!0,targetProvider:`Selectel S3 Cold`},restoreDrill:{state:`passed`,lastAttemptAt:`2026-08-15T04:00:00Z`,verifiedAt:`2026-08-15T04:22:00Z`,drillDurationSeconds:1320}},{serverId:`srv-002-sel-msk`,name:`vps-sel-msk-prod-02`,hostname:`node-msk-02.infra.krona.systems`,ipAddress:`185.129.50.44`,hostingProvider:`Selectel`,region:`ru-msk-2`,status:`healthy`,agentVersion:`1.4.2`,agentStatus:`enrolled`,certificateExpiresAt:`2027-06-20T00:00:00Z`,certificateDaysRemaining:282,cpuLoadPercent:38,ramUsedBytes:12884901888,ramTotalBytes:34359738368,diskUsedBytes:128849018880,diskTotalBytes:322122547200,inodeUsedPercent:44,networkRxBytesPerSec:38e5,networkTxBytesPerSec:72e5,uptimeSeconds:432e4,latencyMs:18,deployedInstancesCount:6,lastSeenAt:`2026-09-10T18:45:00Z`,backup:{state:`ok`,lastSuccessfulAt:`2026-09-10T03:30:00Z`,sizeBytes:25769803776,encryptedExternalCopy:!0,targetProvider:`Selectel S3 Cold`},restoreDrill:{state:`passed`,lastAttemptAt:`2026-08-20T04:00:00Z`,verifiedAt:`2026-08-20T04:35:00Z`,drillDurationSeconds:2100}},{serverId:`srv-003-tw-msk`,name:`vps-tw-msk-cluster-03`,hostname:`node-msk-tw-03.infra.krona.systems`,ipAddress:`194.87.112.89`,hostingProvider:`Timeweb Cloud`,region:`msk-dc1`,status:`warning`,agentVersion:`1.4.1`,agentStatus:`enrolled`,certificateExpiresAt:`2026-10-10T00:00:00Z`,certificateDaysRemaining:29,cpuLoadPercent:78,ramUsedBytes:14602888806,ramTotalBytes:17179869184,diskUsedBytes:171798691840,diskTotalBytes:214748364800,inodeUsedPercent:72,networkRxBytesPerSec:54e5,networkTxBytesPerSec:91e5,uptimeSeconds:1209600,latencyMs:34,deployedInstancesCount:4,lastSeenAt:`2026-09-10T18:44:12Z`,backup:{state:`ok`,lastSuccessfulAt:`2026-09-10T02:15:00Z`,sizeBytes:19327352832,encryptedExternalCopy:!0,targetProvider:`Yandex Object Storage`},restoreDrill:{state:`overdue`,lastAttemptAt:`2026-05-10T03:00:00Z`,verifiedAt:`2026-05-10T03:40:00Z`,drillDurationSeconds:2400}},{serverId:`srv-004-tw-spb`,name:`vps-tw-spb-omni-04`,hostname:`node-spb-tw-04.infra.krona.systems`,ipAddress:`194.87.214.15`,hostingProvider:`Timeweb Cloud`,region:`spb-dc2`,status:`critical`,agentVersion:`1.4.0`,agentStatus:`enrolled`,certificateExpiresAt:`2027-02-14T00:00:00Z`,certificateDaysRemaining:156,cpuLoadPercent:94,ramUsedBytes:16106127360,ramTotalBytes:17179869184,diskUsedBytes:198642237440,diskTotalBytes:214748364800,inodeUsedPercent:88,networkRxBytesPerSec:128e5,networkTxBytesPerSec:184e5,uptimeSeconds:604800,latencyMs:95,deployedInstancesCount:3,lastSeenAt:`2026-09-10T18:43:05Z`,backup:{state:`failed`,lastSuccessfulAt:`2026-09-08T02:00:00Z`,sizeBytes:0,encryptedExternalCopy:!1,targetProvider:`Timeweb S3`},restoreDrill:{state:`failed`,lastAttemptAt:`2026-09-09T04:00:00Z`,verifiedAt:null,drillDurationSeconds:0}},{serverId:`srv-005-sel-msk`,name:`vps-sel-msk-db-05`,hostname:`db-replica-01.infra.krona.systems`,ipAddress:`185.129.50.99`,hostingProvider:`Selectel`,region:`ru-msk-2`,status:`healthy`,agentVersion:`1.4.2`,agentStatus:`enrolled`,certificateExpiresAt:`2027-09-01T00:00:00Z`,certificateDaysRemaining:355,cpuLoadPercent:19,ramUsedBytes:21474836480,ramTotalBytes:68719476736,diskUsedBytes:429496729600,diskTotalBytes:0xfa00000000,inodeUsedPercent:26,networkRxBytesPerSec:89e5,networkTxBytesPerSec:42e5,uptimeSeconds:15552e3,latencyMs:14,deployedInstancesCount:2,lastSeenAt:`2026-09-10T18:45:00Z`,backup:{state:`ok`,lastSuccessfulAt:`2026-09-10T01:00:00Z`,sizeBytes:85899345920,encryptedExternalCopy:!0,targetProvider:`Selectel S3 Cold`},restoreDrill:{state:`passed`,lastAttemptAt:`2026-08-01T02:00:00Z`,verifiedAt:`2026-08-01T02:55:00Z`,drillDurationSeconds:3300}},{serverId:`srv-006-tw-kzn`,name:`vps-tw-kzn-pilot-06`,hostname:`node-kzn-01.infra.krona.systems`,ipAddress:`194.87.180.22`,hostingProvider:`Timeweb Cloud`,region:`kzn-dc1`,status:`offline`,agentVersion:`1.3.8`,agentStatus:`unreachable`,certificateExpiresAt:`2026-11-20T00:00:00Z`,certificateDaysRemaining:70,cpuLoadPercent:0,ramUsedBytes:0,ramTotalBytes:8589934592,diskUsedBytes:0,diskTotalBytes:107374182400,inodeUsedPercent:0,networkRxBytesPerSec:0,networkTxBytesPerSec:0,uptimeSeconds:0,latencyMs:999,deployedInstancesCount:2,lastSeenAt:`2026-09-10T16:12:00Z`,backup:{state:`overdue`,lastSuccessfulAt:`2026-09-07T03:00:00Z`,sizeBytes:5368709120,encryptedExternalCopy:!0,targetProvider:`Timeweb S3`},restoreDrill:{state:`never`,lastAttemptAt:null,verifiedAt:null}},{serverId:`srv-007-sel-spb`,name:`vps-sel-spb-worker-07`,hostname:`worker-spb-01.infra.krona.systems`,ipAddress:`178.212.13.205`,hostingProvider:`Selectel`,region:`ru-spb-1`,status:`healthy`,agentVersion:`1.4.2`,agentStatus:`enrolled`,certificateExpiresAt:`2027-05-10T00:00:00Z`,certificateDaysRemaining:241,cpuLoadPercent:42,ramUsedBytes:10737418240,ramTotalBytes:17179869184,diskUsedBytes:64424509440,diskTotalBytes:161061273600,inodeUsedPercent:38,networkRxBytesPerSec:21e5,networkTxBytesPerSec:34e5,uptimeSeconds:3110400,latencyMs:13,deployedInstancesCount:4,lastSeenAt:`2026-09-10T18:45:00Z`,backup:{state:`ok`,lastSuccessfulAt:`2026-09-10T04:00:00Z`,sizeBytes:10737418240,encryptedExternalCopy:!0,targetProvider:`Selectel S3 Cold`},restoreDrill:{state:`passed`,lastAttemptAt:`2026-07-28T05:00:00Z`,verifiedAt:`2026-07-28T05:25:00Z`,drillDurationSeconds:1500}},{serverId:`srv-008-tw-msk`,name:`vps-tw-msk-ingress-08`,hostname:`ingress-01.infra.krona.systems`,ipAddress:`194.87.112.10`,hostingProvider:`Timeweb Cloud`,region:`msk-dc1`,status:`healthy`,agentVersion:`1.4.2`,agentStatus:`enrolled`,certificateExpiresAt:`2027-04-18T00:00:00Z`,certificateDaysRemaining:219,cpuLoadPercent:15,ramUsedBytes:4294967296,ramTotalBytes:8589934592,diskUsedBytes:21474836480,diskTotalBytes:85899345920,inodeUsedPercent:19,networkRxBytesPerSec:154e5,networkTxBytesPerSec:162e5,uptimeSeconds:5184e3,latencyMs:16,deployedInstancesCount:1,lastSeenAt:`2026-09-10T18:45:00Z`,backup:{state:`ok`,lastSuccessfulAt:`2026-09-10T02:00:00Z`,sizeBytes:2147483648,encryptedExternalCopy:!0,targetProvider:`Timeweb S3`},restoreDrill:{state:`passed`,lastAttemptAt:`2026-08-10T03:00:00Z`,verifiedAt:`2026-08-10T03:15:00Z`,drillDurationSeconds:900}},{serverId:`srv-009-sel-nov`,name:`vps-sel-nov-edge-09`,hostname:`edge-nov-01.infra.krona.systems`,ipAddress:`185.129.88.19`,hostingProvider:`Selectel`,region:`ru-nov-1`,status:`warning`,agentVersion:`1.4.1`,agentStatus:`enrolled`,certificateExpiresAt:`2027-01-05T00:00:00Z`,certificateDaysRemaining:116,cpuLoadPercent:62,ramUsedBytes:11811160064,ramTotalBytes:17179869184,diskUsedBytes:96636764160,diskTotalBytes:128849018880,inodeUsedPercent:68,networkRxBytesPerSec:42e5,networkTxBytesPerSec:51e5,uptimeSeconds:2592e3,latencyMs:46,deployedInstancesCount:3,lastSeenAt:`2026-09-10T18:44:30Z`,backup:{state:`ok`,lastSuccessfulAt:`2026-09-09T03:00:00Z`,sizeBytes:8589934592,encryptedExternalCopy:!0,targetProvider:`Selectel S3 Cold`},restoreDrill:{state:`passed`,lastAttemptAt:`2026-07-15T04:00:00Z`,verifiedAt:`2026-07-15T04:30:00Z`,drillDurationSeconds:1800}},{serverId:`srv-010-tw-spb`,name:`vps-tw-spb-analytics-10`,hostname:`bi-worker-01.infra.krona.systems`,ipAddress:`194.87.214.90`,hostingProvider:`Timeweb Cloud`,region:`spb-dc2`,status:`healthy`,agentVersion:`1.4.2`,agentStatus:`enrolled`,certificateExpiresAt:`2027-08-30T00:00:00Z`,certificateDaysRemaining:353,cpuLoadPercent:32,ramUsedBytes:25769803776,ramTotalBytes:34359738368,diskUsedBytes:171798691840,diskTotalBytes:429496729600,inodeUsedPercent:41,networkRxBytesPerSec:62e5,networkTxBytesPerSec:84e5,uptimeSeconds:6912e3,latencyMs:14,deployedInstancesCount:3,lastSeenAt:`2026-09-10T18:45:00Z`,backup:{state:`ok`,lastSuccessfulAt:`2026-09-10T03:00:00Z`,sizeBytes:34359738368,encryptedExternalCopy:!0,targetProvider:`Timeweb S3`},restoreDrill:{state:`passed`,lastAttemptAt:`2026-08-25T04:00:00Z`,verifiedAt:`2026-08-25T04:40:00Z`,drillDurationSeconds:2400}}],Pu=[{moduleInstanceId:`inst-001`,tenantId:`01918a20-0001-7000-8000-000000000001`,tenantName:`ООО «Северная Ритейл Группа»`,moduleId:`krona-core`,moduleName:`Krona Core System`,deploymentId:`dep-001`,serverId:`srv-001-sel-spb`,serverName:`vps-sel-spb-prod-01`,mode:`platform`,currentVersion:`2.4.0`,health:`healthy`,lastHeartbeatAt:`2026-09-10T18:44:50Z`,uptimeSeconds:7894e3},{moduleInstanceId:`inst-002`,tenantId:`01918a20-0001-7000-8000-000000000001`,tenantName:`ООО «Северная Ритейл Группа»`,moduleId:`krona-operations`,moduleName:`Операционный склад и логистика`,deploymentId:`dep-001`,serverId:`srv-001-sel-spb`,serverName:`vps-sel-spb-prod-01`,mode:`platform`,currentVersion:`1.9.5`,health:`healthy`,lastHeartbeatAt:`2026-09-10T18:44:50Z`,uptimeSeconds:7894e3},{moduleInstanceId:`inst-003`,tenantId:`01918a20-0002-7000-8000-000000000002`,tenantName:`АО «Балтийская Логистика»`,moduleId:`krona-crm`,moduleName:`CRM & Клиенты`,deploymentId:`dep-002`,serverId:`srv-002-sel-msk`,serverName:`vps-sel-msk-prod-02`,mode:`platform`,currentVersion:`2.1.2`,health:`healthy`,lastHeartbeatAt:`2026-09-10T18:44:30Z`,uptimeSeconds:432e4},{moduleInstanceId:`inst-004`,tenantId:`01918a20-0003-7000-8000-000000000003`,tenantName:`Сеть кофеен «Эспрессо Поинт»`,moduleId:`krona-pos`,moduleName:`Кассовый узел POS`,deploymentId:`dep-003`,serverId:`srv-003-tw-msk`,serverName:`vps-tw-msk-cluster-03`,mode:`platform`,currentVersion:`1.8.2`,health:`degraded`,lastHeartbeatAt:`2026-09-10T18:43:55Z`,uptimeSeconds:1209600},{moduleInstanceId:`inst-005`,tenantId:`01918a20-0004-7000-8000-000000000004`,tenantName:`ООО «ТехноПромСнаб»`,moduleId:`krona-finance`,moduleName:`Финансы и казначейство`,deploymentId:`dep-004`,serverId:`srv-003-tw-msk`,serverName:`vps-tw-msk-cluster-03`,mode:`platform`,currentVersion:`2.0.1`,health:`healthy`,lastHeartbeatAt:`2026-09-10T18:44:10Z`,uptimeSeconds:1209600},{moduleInstanceId:`inst-006`,tenantId:`01918a20-0006-7000-8000-000000000006`,tenantName:`Клиника «Здоровая Семья»`,moduleId:`krona-omnichannel`,moduleName:`Омниканальные коммуникации`,deploymentId:`dep-005`,serverId:`srv-004-tw-spb`,serverName:`vps-tw-spb-omni-04`,mode:`platform`,currentVersion:`3.0.0-rc2`,health:`degraded`,lastHeartbeatAt:`2026-09-10T18:42:15Z`,uptimeSeconds:604800},{moduleInstanceId:`inst-007`,tenantId:`01918a20-0007-7000-8000-000000000007`,tenantName:`ООО «Волга-Агротрейд»`,moduleId:`krona-operations`,moduleName:`Операционный склад и логистика`,deploymentId:`dep-006`,serverId:`srv-006-tw-kzn`,serverName:`vps-tw-kzn-pilot-06`,mode:`platform`,currentVersion:`1.9.0`,health:`offline`,lastHeartbeatAt:`2026-09-10T16:12:00Z`,uptimeSeconds:0},{moduleInstanceId:`inst-008`,tenantId:`01918a20-0008-7000-8000-000000000008`,tenantName:`ООО «Ювелирный Дом Аврора»`,moduleId:`krona-core`,moduleName:`Krona Core System`,deploymentId:`dep-007`,serverId:`srv-002-sel-msk`,serverName:`vps-sel-msk-prod-02`,mode:`platform`,currentVersion:`2.4.0`,health:`healthy`,lastHeartbeatAt:`2026-09-10T18:45:00Z`,uptimeSeconds:432e4},{moduleInstanceId:`inst-009`,tenantId:`01918a20-0008-7000-8000-000000000008`,tenantName:`ООО «Ювелирный Дом Аврора»`,moduleId:`krona-crm`,moduleName:`CRM & Клиенты`,deploymentId:`dep-007`,serverId:`srv-002-sel-msk`,serverName:`vps-sel-msk-prod-02`,mode:`platform`,currentVersion:`2.1.2`,health:`healthy`,lastHeartbeatAt:`2026-09-10T18:45:00Z`,uptimeSeconds:432e4},{moduleInstanceId:`inst-010`,tenantId:`01918a20-0009-7000-8000-000000000009`,tenantName:`Фитнес-клубы «Атлетика Плюс»`,moduleId:`krona-staff`,moduleName:`Кадры и смены`,deploymentId:`dep-008`,serverId:`srv-007-sel-spb`,serverName:`vps-sel-spb-worker-07`,mode:`platform`,currentVersion:`1.5.0`,health:`healthy`,lastHeartbeatAt:`2026-09-10T18:44:45Z`,uptimeSeconds:3110400},{moduleInstanceId:`inst-011`,tenantId:`01918a20-0010-7000-8000-000000000010`,tenantName:`ООО «Сибирский Лесокомбинат»`,moduleId:`krona-analytics`,moduleName:`Бизнес-Аналитика и дашборды`,deploymentId:`dep-009`,serverId:`srv-010-tw-spb`,serverName:`vps-tw-spb-analytics-10`,mode:`platform`,currentVersion:`2.2.0`,health:`healthy`,lastHeartbeatAt:`2026-09-10T18:45:00Z`,uptimeSeconds:6912e3},{moduleInstanceId:`inst-012`,tenantId:`01918a20-0011-7000-8000-000000000011`,tenantName:`ООО «Казань Экспресс Доставка»`,moduleId:`krona-operations`,moduleName:`Операционный склад и логистика`,deploymentId:`dep-010`,serverId:`srv-006-tw-kzn`,serverName:`vps-tw-kzn-pilot-06`,mode:`platform`,currentVersion:`1.8.4`,health:`offline`,lastHeartbeatAt:`2026-09-10T16:12:00Z`,uptimeSeconds:0},{moduleInstanceId:`inst-013`,tenantId:`01918a20-0012-7000-8000-000000000012`,tenantName:`ИП Ковалева М. И. («Шоколадница на Невском»)`,moduleId:`krona-pos`,moduleName:`Кассовый узел POS`,deploymentId:`dep-011`,serverId:`srv-007-sel-spb`,serverName:`vps-sel-spb-worker-07`,mode:`platform`,currentVersion:`1.8.2`,health:`healthy`,lastHeartbeatAt:`2026-09-10T18:44:20Z`,uptimeSeconds:3110400},{moduleInstanceId:`inst-014`,tenantId:`01918a20-0013-7000-8000-000000000013`,tenantName:`АО «Приморский Рыбокомбинат»`,moduleId:`krona-core`,moduleName:`Krona Core System`,deploymentId:`dep-012`,serverId:`srv-009-sel-nov`,serverName:`vps-sel-nov-edge-09`,mode:`standalone`,currentVersion:`2.4.0`,health:`healthy`,lastHeartbeatAt:`2026-09-10T18:44:15Z`,uptimeSeconds:2592e3},{moduleInstanceId:`inst-015`,tenantId:`01918a20-0013-7000-8000-000000000013`,tenantName:`АО «Приморский Рыбокомбинат»`,moduleId:`krona-finance`,moduleName:`Финансы и казначейство`,deploymentId:`dep-012`,serverId:`srv-009-sel-nov`,serverName:`vps-sel-nov-edge-09`,mode:`standalone`,currentVersion:`2.0.1`,health:`healthy`,lastHeartbeatAt:`2026-09-10T18:44:15Z`,uptimeSeconds:2592e3}],Fu=[{installationId:`inst-dev-001`,tenantId:`01918a20-0001-7000-8000-000000000001`,tenantName:`ООО «Северная Ритейл Группа»`,kind:`android`,deviceName:`Zebra TC26 Barcode Terminal`,osVersion:`Android 11 (API 30)`,appVersion:`1.2.0`,status:`outdated`,registeredAt:`2025-10-12T08:00:00Z`,lastSeenAt:`2026-09-10T18:40:00Z`,ipAddressMasked:`10.20.1.*`},{installationId:`inst-dev-002`,tenantId:`01918a20-0001-7000-8000-000000000001`,tenantName:`ООО «Северная Ритейл Группа»`,kind:`android`,deviceName:`Honeywell ScanPal EDA51`,osVersion:`Android 10 (API 29)`,appVersion:`1.1.8`,status:`outdated`,registeredAt:`2025-09-01T10:00:00Z`,lastSeenAt:`2026-09-10T17:15:00Z`,ipAddressMasked:`10.20.1.*`},{installationId:`inst-dev-003`,tenantId:`01918a20-0002-7000-8000-000000000002`,tenantName:`АО «Балтийская Логистика»`,kind:`desktop`,deviceName:`Workstation-Logistics-Office-04`,osVersion:`Windows 11 Pro 23H2`,appVersion:`2.4.0`,status:`supported`,registeredAt:`2026-01-15T12:00:00Z`,lastSeenAt:`2026-09-10T18:35:00Z`,ipAddressMasked:`192.168.10.*`},{installationId:`inst-dev-004`,tenantId:`01918a20-0003-7000-8000-000000000003`,tenantName:`Сеть кофеен «Эспрессо Поинт»`,kind:`android`,deviceName:`iMin Swan 1 POS Desktop`,osVersion:`Android 11 (API 30)`,appVersion:`1.1.5`,status:`outdated`,registeredAt:`2026-04-10T09:00:00Z`,lastSeenAt:`2026-09-10T18:10:00Z`,ipAddressMasked:`192.168.1.*`},{installationId:`inst-dev-005`,tenantId:`01918a20-0003-7000-8000-000000000003`,tenantName:`Сеть кофеен «Эспрессо Поинт»`,kind:`web`,deviceName:`Chrome 128 / macOS Sequoia`,osVersion:`macOS 15.0`,appVersion:`2.4.0`,status:`supported`,registeredAt:`2026-05-01T14:00:00Z`,lastSeenAt:`2026-09-10T18:12:00Z`,ipAddressMasked:`85.140.22.*`},{installationId:`inst-dev-006`,tenantId:`01918a20-0004-7000-8000-000000000004`,tenantName:`ООО «ТехноПромСнаб»`,kind:`desktop`,deviceName:`Buh-Accountant-PC`,osVersion:`Windows 10 Enterprise`,appVersion:`2.3.2`,status:`supported`,registeredAt:`2025-11-20T11:00:00Z`,lastSeenAt:`2026-09-10T17:50:00Z`,ipAddressMasked:`172.16.0.*`},{installationId:`inst-dev-007`,tenantId:`01918a20-0006-7000-8000-000000000006`,tenantName:`Клиника «Здоровая Семья»`,kind:`android`,deviceName:`Samsung Galaxy Tab Active3 (Dr. Mobile)`,osVersion:`Android 12`,appVersion:`1.2.0`,status:`outdated`,registeredAt:`2026-02-18T10:00:00Z`,lastSeenAt:`2026-09-10T18:20:00Z`,ipAddressMasked:`10.100.2.*`},{installationId:`inst-dev-008`,tenantId:`01918a20-0007-7000-8000-000000000007`,tenantName:`ООО «Волга-Агротрейд»`,kind:`android`,deviceName:`Urovo DT50 4G Rugged`,osVersion:`Android 9 (API 28)`,appVersion:`1.0.4`,status:`blocked`,registeredAt:`2025-06-01T08:00:00Z`,lastSeenAt:`2026-09-08T14:00:00Z`,ipAddressMasked:`192.168.4.*`},{installationId:`inst-dev-009`,tenantId:`01918a20-0008-7000-8000-000000000008`,tenantName:`ООО «Ювелирный Дом Аврора»`,kind:`web`,deviceName:`Safari 18 / iPadOS 18`,osVersion:`iPadOS 18.0`,appVersion:`2.4.0`,status:`supported`,registeredAt:`2026-07-01T15:00:00Z`,lastSeenAt:`2026-09-10T18:38:00Z`,ipAddressMasked:`94.25.17.*`},{installationId:`inst-dev-010`,tenantId:`01918a20-0012-7000-8000-000000000012`,tenantName:`ИП Ковалева М. И. («Шоколадница на Невском»)`,kind:`android`,deviceName:`Эвотор Power Smart-Касса`,osVersion:`Android 10 (API 29)`,appVersion:`1.1.9`,status:`outdated`,registeredAt:`2026-03-15T09:00:00Z`,lastSeenAt:`2026-09-10T18:29:00Z`,ipAddressMasked:`192.168.88.*`},{installationId:`inst-dev-011`,tenantId:`01918a20-0013-7000-8000-000000000013`,tenantName:`АО «Приморский Рыбокомбинат»`,kind:`desktop`,deviceName:`Torg-Server-Dock-01`,osVersion:`Ubuntu 24.04 LTS Desktop`,appVersion:`2.4.0`,status:`supported`,registeredAt:`2026-05-12T07:00:00Z`,lastSeenAt:`2026-09-10T15:20:00Z`,ipAddressMasked:`10.50.0.*`}],Iu=[{incidentId:`inc-2026-09-001`,incidentNumber:`INC-1048`,severity:`critical`,status:`open`,summary:`Узел vps-tw-kzn-pilot-06 не отвечает на heartbeat > 2 часов`,description:`Сервер hosting-провайдера Timeweb Cloud в дата-центре Казань потерял сетевую связность. Затронуты экземпляры модулей для ООО «Волга-Агротрейд» и ООО «Казань Экспресс Доставка». Серверный монитор перешел в статус unreachable.`,affectedTenantIds:[`01918a20-0007-7000-8000-000000000007`,`01918a20-0011-7000-8000-000000000011`],affectedServerIds:[`srv-006-tw-kzn`],affectedModuleIds:[`krona-operations`],ownerName:`Алексей Смирнов (Platform Admin)`,openedAt:`2026-09-10T16:30:00Z`,timeline:[{timestamp:`2026-09-10T16:30:00Z`,author:`System Monitor Watchdog`,message:`Heartbeat missed > 3 cycles. Host 194.87.180.22 state changed to unreachable.`},{timestamp:`2026-09-10T16:45:00Z`,author:`Алексей Смирнов`,message:`Открыт тикет в техподдержку Timeweb Cloud #TW-94812. Ожидается ответ сетевого дежурного.`},{timestamp:`2026-09-10T17:15:00Z`,author:`Алексей Смирнов`,message:`Провайдер подтвердил аварию на коммутаторе стойки DC-KZN-01.`}]},{incidentId:`inc-2026-09-002`,incidentNumber:`INC-1049`,severity:`high`,status:`mitigating`,summary:`Перегрузка дисковой подсистемы и сбой бэкапа на vps-tw-spb-omni-04`,description:`Диск заполнен на 92%, резервное копирование завершилось ошибкой No space left on device. WebSocket-соединения омниканального модуля испытывают задержки до 95ms.`,affectedTenantIds:[`01918a20-0006-7000-8000-000000000006`],affectedServerIds:[`srv-004-tw-spb`],affectedModuleIds:[`krona-omnichannel`],ownerName:`Дмитрий Волков (Platform Admin)`,openedAt:`2026-09-10T17:00:00Z`,timeline:[{timestamp:`2026-09-10T17:00:00Z`,author:`System Monitor Watchdog`,message:`Disk threshold 90% exceeded, nightly backup job exit code 1.`},{timestamp:`2026-09-10T17:30:00Z`,author:`Дмитрий Волков`,message:`Запущена очистка временных логов WebSocket и ротация старых дампов.`}]},{incidentId:`inc-2026-09-003`,incidentNumber:`INC-1045`,severity:`medium`,status:`resolved`,summary:`Задержка фискализации чеков в модуле POS для «Эспрессо Поинт»`,description:`Служба очереди чеков накапливала буфер из-за таймаутов ОФД. Очередь успешно сброшена, фискальные накопители синхронизированы.`,affectedTenantIds:[`01918a20-0003-7000-8000-000000000003`],affectedServerIds:[`srv-003-tw-msk`],affectedModuleIds:[`krona-pos`],ownerName:`Елена Соколова (Support Operator)`,openedAt:`2026-09-09T14:10:00Z`,resolvedAt:`2026-09-09T16:40:00Z`,timeline:[{timestamp:`2026-09-09T14:10:00Z`,author:`Елена Соколова`,message:`Поступили обращения о задержках чеков. Запрошена телеметрия с узла.`},{timestamp:`2026-09-09T16:40:00Z`,author:`Елена Соколова`,message:`Канал связи с ОФД восстановлен, очередь 0. Инцидент закрыт.`}]}],Lu=[{announcementId:`anc-001`,audience:{allTenants:!0},title:`Плановые технические работы на инфраструктуре Selectel`,body:`В ночь с 14 на 15 сентября с 03:00 до 05:00 МСК будут проводиться работы по обновлению гипервизоров. Возможны кратковременные перерывы до 5 минут.`,priority:`important`,channels:[`in_app`],status:`completed`,validFrom:`2026-09-09T10:00:00Z`,validUntil:`2026-09-15T06:00:00Z`,createdAt:`2026-09-09T09:30:00Z`,author:`Алексей Смирнов (Platform Admin)`,stats:{totalTargeted:14,queued:0,delivered:14,failed:0}},{announcementId:`anc-002`,audience:{requiredModuleId:`krona-omnichannel`,tenantIds:[`01918a20-0003-7000-8000-000000000003`,`01918a20-0006-7000-8000-000000000006`,`01918a20-0009-7000-8000-000000000009`]},title:`Доступна новая версия Omnichannel 3.0 (Пилотная программа)`,body:`Приглашаем принять участие в тестировании нового WebSocket-транспорта и ускоренной обработки диалогов Telegram/WhatsApp.`,priority:`normal`,channels:[`in_app`,`comm_adapter`],status:`scheduled`,validFrom:`2026-09-12T09:00:00Z`,validUntil:`2026-09-30T23:59:00Z`,createdAt:`2026-09-10T15:00:00Z`,author:`Мария Лебедева (Release Manager)`,stats:{totalTargeted:3,queued:3,delivered:0,failed:0}}],Ru=[{rolloutId:`rol-001`,moduleId:`krona-omnichannel`,moduleName:`Омниканальные коммуникации`,targetVersion:`3.0.0-rc2`,stage:`pilot`,pilotTenantIds:[`01918a20-0003-7000-8000-000000000003`,`01918a20-0006-7000-8000-000000000006`],percentage:15,startedAt:`2026-09-08T10:00:00Z`,updatedAt:`2026-09-10T14:00:00Z`,notes:`Пилотный запуск на 2 организациях перед общей раскаткой.`},{rolloutId:`rol-002`,moduleId:`krona-staff`,moduleName:`Кадры и смены`,targetVersion:`1.5.0`,stage:`percentage`,pilotTenantIds:[`01918a20-0009-7000-8000-000000000009`],percentage:25,startedAt:`2026-09-05T09:00:00Z`,updatedAt:`2026-09-09T11:00:00Z`,notes:`Постепенная раскатка 25% тенантов, жалоб на производительность нет.`}],zu=[{eventId:`evt-000001`,occurredAt:`2026-09-08T10:00:00Z`,operatorId:`op-001`,operatorName:`Михаил Романов`,operatorRole:`platform_owner`,action:`rollout.pilot_started`,target:{type:`rollout`,id:`rol-001`,displayName:`Омниканальные коммуникации 3.0.0-rc2`},reason:`Запуск пилотной программы Omnichannel 3.0 для тестовых организаций`,impactSummary:`Затронуты 2 пилотные организации, переключение на новый WebSocket транспорт`,correlationId:`corr-init-001`,idempotencyKey:`idem-rol-001`,previousHash:`GENESIS_HASH_00000000000000000000000000000000000000000000000000000000000000`,hash:`8f4a1c6e9d2b3a4f5c6e7d8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f6a7b8c`},{eventId:`evt-000002`,occurredAt:`2026-09-08T18:00:00Z`,operatorId:`op-002`,operatorName:`Анна Кузнецова`,operatorRole:`billing_manager`,action:`subscription.grace_period_granted`,target:{type:`subscription`,id:`sub-011`,displayName:`ООО «Казань Экспресс Доставка»`,tenantId:`01918a20-0011-7000-8000-000000000011`},reason:`Задержка платежного поручения в банке, обращение финдиректора`,impactSummary:`Продление льготного доступа на 10 дней без блокировки пользователей`,correlationId:`corr-grace-011`,idempotencyKey:`idem-grace-011`,previousHash:`8f4a1c6e9d2b3a4f5c6e7d8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f6a7b8c`,hash:`a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2`},{eventId:`evt-000003`,occurredAt:`2026-09-10T16:30:00Z`,operatorId:`op-003`,operatorName:`Алексей Смирнов`,operatorRole:`platform_admin`,action:`incident.created`,target:{type:`incident`,id:`inc-2026-09-001`,displayName:`INC-1048 (vps-tw-kzn-pilot-06 unreachable)`},reason:`Автоматический триггер сторожевого таймера телеметрии ноды`,impactSummary:`Критический инцидент, уведомление дежурной смены инфраструктуры`,correlationId:`corr-inc-1048`,previousHash:`a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2`,hash:`7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d`}],Bu=`krona_control_center_db`,Vu=null;async function Hu(){return Vu||=v(Bu,1,{upgrade(e){e.objectStoreNames.contains(`organizations`)||e.createObjectStore(`organizations`,{keyPath:`tenantId`}),e.objectStoreNames.contains(`modules`)||e.createObjectStore(`modules`,{keyPath:`moduleId`}),e.objectStoreNames.contains(`subscriptions`)||e.createObjectStore(`subscriptions`,{keyPath:`subscriptionId`}),e.objectStoreNames.contains(`installations`)||e.createObjectStore(`installations`,{keyPath:`installationId`}),e.objectStoreNames.contains(`instances`)||e.createObjectStore(`instances`,{keyPath:`moduleInstanceId`}),e.objectStoreNames.contains(`servers`)||e.createObjectStore(`servers`,{keyPath:`serverId`}),e.objectStoreNames.contains(`incidents`)||e.createObjectStore(`incidents`,{keyPath:`incidentId`}),e.objectStoreNames.contains(`announcements`)||e.createObjectStore(`announcements`,{keyPath:`announcementId`}),e.objectStoreNames.contains(`rollouts`)||e.createObjectStore(`rollouts`,{keyPath:`rolloutId`}),e.objectStoreNames.contains(`audit_events`)||e.createObjectStore(`audit_events`,{keyPath:`eventId`}).createIndex(`by_occurred`,`occurredAt`)}}),Vu}async function Uu(e=!1){let t=await Hu();if(await t.count(`organizations`)===0||e){let n=t.transaction([`organizations`,`modules`,`subscriptions`,`installations`,`instances`,`servers`,`incidents`,`announcements`,`rollouts`,`audit_events`],`readwrite`);e&&await Promise.all([n.objectStore(`organizations`).clear(),n.objectStore(`modules`).clear(),n.objectStore(`subscriptions`).clear(),n.objectStore(`installations`).clear(),n.objectStore(`instances`).clear(),n.objectStore(`servers`).clear(),n.objectStore(`incidents`).clear(),n.objectStore(`announcements`).clear(),n.objectStore(`rollouts`).clear(),n.objectStore(`audit_events`).clear()]);for(let e of Au)await n.objectStore(`organizations`).put(e);for(let e of ju)await n.objectStore(`modules`).put(e);for(let e of Mu)await n.objectStore(`subscriptions`).put(e);for(let e of Fu)await n.objectStore(`installations`).put(e);for(let e of Pu)await n.objectStore(`instances`).put(e);for(let e of Nu)await n.objectStore(`servers`).put(e);for(let e of Iu)await n.objectStore(`incidents`).put(e);for(let e of Lu)await n.objectStore(`announcements`).put(e);for(let e of Ru)await n.objectStore(`rollouts`).put(e);for(let e of zu)await n.objectStore(`audit_events`).put(e);await n.done}let[n,r,i,a,o,s,c,l,u,d]=await Promise.all([t.getAll(`organizations`),t.getAll(`modules`),t.getAll(`subscriptions`),t.getAll(`installations`),t.getAll(`instances`),t.getAll(`servers`),t.getAll(`incidents`),t.getAll(`announcements`),t.getAll(`rollouts`),t.getAll(`audit_events`)]);return d.sort((e,t)=>new Date(t.occurredAt).getTime()-new Date(e.occurredAt).getTime()),{organizations:n,modules:r,subscriptions:i,installations:a,instances:o,servers:s,incidents:c,announcements:l,rollouts:u,auditLog:d}}async function Wu(e,t){await(await Hu()).put(e,t)}async function Gu(e){if(typeof window<`u`&&window.crypto&&window.crypto.subtle){let t=new TextEncoder().encode(e),n=await window.crypto.subtle.digest(`SHA-256`,t);return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t=(t<<5)-t+r,t|=0}return`fallback_sha256_${Math.abs(t).toString(16).padStart(8,`0`)}_${e.length}`}var Ku={platform_owner:{id:`op-001`,name:`Михаил Романов`,role:`platform_owner`,email:`m.romanov@krona.systems`,title:`Владелец платформы & Архитектор`},platform_admin:{id:`op-002`,name:`Алексей Смирнов`,role:`platform_admin`,email:`a.smirnov@krona.systems`,title:`Главный системный администратор`},support_operator:{id:`op-003`,name:`Елена Соколова`,role:`support_operator`,email:`e.sokolova@krona.systems`,title:`Ведущий инженер поддержки L2`},billing_manager:{id:`op-004`,name:`Анна Кузнецова`,role:`billing_manager`,email:`a.kuznetsova@krona.systems`,title:`Руководитель биллинговых операций`},security_auditor:{id:`op-005`,name:`Сергей Белов`,role:`security_auditor`,email:`s.belov@krona.systems`,title:`Офицер информационной безопасности`},release_manager:{id:`op-006`,name:`Мария Лебедева`,role:`release_manager`,email:`m.lebedeva@krona.systems`,title:`Руководитель релизного конвейера`}},W=f((e,t)=>({activeRole:`platform_owner`,activeOperator:Ku.platform_owner,isAccessGatePassed:typeof window<`u`&&localStorage.getItem(`kcc_access_gate`)===`1`,isLoading:!1,isInitialized:!1,serverMonitorOutage:!1,organizations:[],modules:[],subscriptions:[],installations:[],instances:[],servers:[],incidents:[],announcements:[],rollouts:[],auditLog:[],inspectorTarget:null,pendingConfirmModal:null,initialize:async(t=!1)=>{e({isLoading:!0});try{e({...await Uu(t),isInitialized:!0,isLoading:!1})}catch(t){console.error(`[KCC DB] Failed to init indexedDB:`,t),e({isLoading:!1})}},setActiveRole:t=>{e({activeRole:t,activeOperator:Ku[t]})},setAccessGatePassed:t=>{typeof window<`u`&&(t?localStorage.setItem(`kcc_access_gate`,`1`):localStorage.removeItem(`kcc_access_gate`)),e({isAccessGatePassed:t})},openInspector:(t,n)=>e({inspectorTarget:{type:t,id:n}}),closeInspector:()=>e({inspectorTarget:null}),setServerMonitorOutage:t=>e({serverMonitorOutage:t}),toggleServerMonitorOutage:()=>e(e=>({serverMonitorOutage:!e.serverMonitorOutage})),openConfirmModal:t=>e({pendingConfirmModal:t}),closeConfirmModal:()=>e({pendingConfirmModal:null}),recordAuditEvent:async({action:n,target:r,reason:i,impactSummary:a})=>{let{activeOperator:o,auditLog:s}=t(),c=s[0],l=c?c.hash:`GENESIS_HASH_00000000000000000000000000000000000000000000000000000000000000`,u=`evt-${Date.now().toString(36)}-${Math.random().toString(36).substring(2,6)}`,d=new Date().toISOString(),f=`corr-${Date.now().toString(36)}`,p=await Gu(`${l}|${d}|${o.id}|${o.role}|${n}|${r.type}:${r.id}|${i}|${f}`),m={eventId:u,occurredAt:d,operatorId:o.id,operatorName:o.name,operatorRole:o.role,action:n,target:r,reason:i,impactSummary:a,correlationId:f,previousHash:l,hash:p};return await Wu(`audit_events`,m),e(e=>({auditLog:[m,...e.auditLog]})),m},updateOrganizationStatus:async(n,r,i)=>{let{organizations:a,recordAuditEvent:o}=t(),s=a.find(e=>e.tenantId===n);if(!s)return;let c=s.platformStatus,l={...s,platformStatus:r,projectedAt:new Date().toISOString()};await Wu(`organizations`,l),e(e=>({organizations:e.organizations.map(e=>e.tenantId===n?l:e)})),await o({action:`organization.status_changed`,target:{type:`organization`,id:n,displayName:s.displayName,tenantId:n},reason:i,impactSummary:`Статус организации изменен с «${c}» на «${r}»`})},grantModuleTrial:async(n,r,i,a)=>{let{organizations:o,modules:s,recordAuditEvent:c}=t(),l=o.find(e=>e.tenantId===n),u=s.find(e=>e.moduleId===r);if(!l||!u)return;let d=new Date(Date.now()+i*24*3600*1e3).toISOString(),f={...l,installedModulesCount:l.installedModulesCount+1,tariffPlan:`${l.tariffPlan} (+Trial ${u.name})`,projectedAt:new Date().toISOString()};await Wu(`organizations`,f),e(e=>({organizations:e.organizations.map(e=>e.tenantId===n?f:e)})),await c({action:`entitlement.trial_granted`,target:{type:`organization`,id:n,displayName:l.displayName,tenantId:n},reason:a,impactSummary:`Выдан пробный доступ к модулю «${u.name}» на ${i} дней (до ${d.slice(0,10)})`})},grantGracePeriod:async(n,r,i)=>{let{subscriptions:a,recordAuditEvent:o}=t(),s=a.find(e=>e.subscriptionId===n);if(!s)return;let c=new Date(Date.now()+r*24*3600*1e3).toISOString(),l={...s,status:`grace`,graceUntil:c,history:[{eventAt:new Date().toISOString(),type:`grace_granted`,description:`Предоставлен льготный период на ${r} дней`,actor:t().activeOperator.name},...s.history]};await Wu(`subscriptions`,l),e(e=>({subscriptions:e.subscriptions.map(e=>e.subscriptionId===n?l:e)})),await o({action:`subscription.grace_period_granted`,target:{type:`subscription`,id:n,displayName:s.tenantName,tenantId:s.tenantId},reason:i,impactSummary:`Установлен Grace Period на ${r} дней (до ${c.slice(0,10)})`})},renewSubscription:async(n,r,i,a)=>{let{subscriptions:o,recordAuditEvent:s}=t(),c=o.find(e=>e.subscriptionId===n);if(!c)return;let l=new Date(c.validUntil).getTime(),u=(r===`year`?365:30)*24*3600*1e3,d=new Date(Math.max(Date.now(),l)+u).toISOString(),f={...c,period:r,activeModules:i,status:`normal`,validUntil:d,renewsAt:d,graceUntil:null,history:[{eventAt:new Date().toISOString(),type:`renewed`,description:`Продление тарифа на ${r===`year`?`1 год`:`1 месяц`}`,actor:t().activeOperator.name},...c.history]};await Wu(`subscriptions`,f),e(e=>({subscriptions:e.subscriptions.map(e=>e.subscriptionId===n?f:e)})),await s({action:`subscription.renewed`,target:{type:`subscription`,id:n,displayName:c.tenantName,tenantId:c.tenantId},reason:a,impactSummary:`Продление подписки до ${d.slice(0,10)}, активных модулей: ${i.length}`})},createIncidentFromAlert:async(n,r,i,a)=>{let{servers:o,instances:s,recordAuditEvent:c,incidents:l}=t(),u=o.find(e=>e.serverId===n),d=s.filter(e=>e.serverId===n).map(e=>e.tenantId),f=Array.from(new Set(s.filter(e=>e.serverId===n).map(e=>e.moduleId))),p=`INC-${1050+l.length}`,m=`inc-${Date.now().toString(36)}`,h=new Date().toISOString(),g={incidentId:m,incidentNumber:p,severity:i,status:`open`,summary:r,description:`Инцидент открыт оператором из телеметрического оповещения узла ${u?u.name:n}.`,affectedTenantIds:d,affectedServerIds:[n],affectedModuleIds:f,ownerName:t().activeOperator.name,openedAt:h,timeline:[{timestamp:h,author:t().activeOperator.name,message:`Инцидент зарегистрирован в системе. Причина: ${a}`}]};await Wu(`incidents`,g),e(e=>({incidents:[g,...e.incidents]})),await c({action:`incident.created`,target:{type:`incident`,id:m,displayName:`${p} (${r})`},reason:a,impactSummary:`Создан инцидент ${p} со степенью критичности ${i}`})},resolveIncident:async(n,r)=>{let{incidents:i,recordAuditEvent:a,activeOperator:o}=t(),s=i.find(e=>e.incidentId===n);if(!s)return;let c=new Date().toISOString(),l={...s,status:`resolved`,resolvedAt:c,timeline:[...s.timeline,{timestamp:c,author:o.name,message:`Инцидент переведен в статус resolved. Решение: ${r}`}]};await Wu(`incidents`,l),e(e=>({incidents:e.incidents.map(e=>e.incidentId===n?l:e)})),await a({action:`incident.resolved`,target:{type:`incident`,id:n,displayName:s.incidentNumber},reason:r,impactSummary:`Инцидент ${s.incidentNumber} успешно разрешен`})},createAnnouncement:async(n,r)=>{let{recordAuditEvent:i,activeOperator:a,organizations:o}=t(),s=`anc-${Date.now().toString(36)}`,c=new Date().toISOString(),l=o.length;n.audience.tenantIds&&n.audience.tenantIds.length>0&&(l=n.audience.tenantIds.length);let u={...n,announcementId:s,createdAt:c,author:a.name,stats:{totalTargeted:l,queued:l,delivered:0,failed:0}};await Wu(`announcements`,u),e(e=>({announcements:[u,...e.announcements]})),await i({action:`announcement.created`,target:{type:`announcement`,id:s,displayName:n.title},reason:r,impactSummary:`Создано оповещение «${n.title}» для ${l} организаций`})},triggerRolloutStage:async(n,r,i,a)=>{let{rollouts:o,recordAuditEvent:s}=t(),c=o.find(e=>e.rolloutId===n);if(!c)return;let l={...c,stage:r,percentage:i,updatedAt:new Date().toISOString()};await Wu(`rollouts`,l),e(e=>({rollouts:e.rollouts.map(e=>e.rolloutId===n?l:e)})),await s({action:`rollout.stage_${r}`,target:{type:`rollout`,id:n,displayName:`${c.moduleName} ${c.targetVersion}`},reason:a,impactSummary:`Раскатка переведена в стадию «${r}» (${i}%)`})},createRollout:async(n,r,i,a,o,s,c)=>{let{modules:l,recordAuditEvent:u}=t(),d=l.find(e=>e.moduleId===n),f=`rol-${Date.now().toString(36)}`,p=new Date().toISOString(),m={rolloutId:f,moduleId:n,moduleName:d?d.name:n,targetVersion:r,stage:i,pilotTenantIds:a,percentage:o,startedAt:p,updatedAt:p,notes:s};await Wu(`rollouts`,m),e(e=>({rollouts:[m,...e.rollouts]})),await u({action:`rollout.created`,target:{type:`rollout`,id:f,displayName:`${m.moduleName} ${r}`},reason:c,impactSummary:`Инициирован конвейер раскатки ${m.moduleName} ${r} (стадия ${i})`})},requestServerDiagnostics:async(e,n)=>{let{servers:r,recordAuditEvent:i}=t(),a=r.find(t=>t.serverId===e);a&&await i({action:`infrastructure.diagnostics_requested`,target:{type:`infrastructure`,id:e,displayName:a.name},reason:n,impactSummary:`Запрошен полный дамп телеметрии и логов с узла ${a.name}`})},scheduleServerMaintenance:async(e,n)=>{let{servers:r,recordAuditEvent:i}=t(),a=r.find(t=>t.serverId===e);a&&await i({action:`infrastructure.maintenance_scheduled`,target:{type:`infrastructure`,id:e,displayName:a.name},reason:n,impactSummary:`Запланировано регламентное техническое обслуживание для узла ${a.name}`})},resetToDefaults:async()=>{await t().initialize(!0)}}));function qu(){let e=W(e=>e.activeRole),t=W(e=>e.activeOperator),n=ku[e];return{role:e,operator:t,definition:n,permissions:n.permissions}}var Ju={platform_owner:{label:`Владелец платформы`,shortLabel:`Владелец`,description:`Полный доступ ко всей инфраструктуре, биллингу, лицензиям и управлению платформой`},platform_admin:{label:`Администратор платформы`,shortLabel:`Админ`,description:`Управление организациями, инсталляциями, серверами и техническими параметрами`},support_operator:{label:`Оператор поддержки`,shortLabel:`Поддержка`,description:`Диагностика организаций, сброс кэша, техническая помощь и расследования`},billing_manager:{label:`Менеджер биллинга`,shortLabel:`Биллинг`,description:`Финансовые показатели, тарифы, подписки, продления и льготные периоды`},security_auditor:{label:`Аудитор безопасности`,shortLabel:`Аудитор`,description:`Только чтение: сквозной журнал аудита (SHA-256), события безопасности и логи`},release_manager:{label:`Релиз-инженер`,shortLabel:`Релизы`,description:`Управление версиями модулей, каталогом расширений и плановыми обновлениями`}},Yu={critical:{label:`Критическая авария`,short:`Критическая`},high:{label:`Высокая важность`,short:`Высокая`},medium:{label:`Средняя важность`,short:`Средняя`},low:{label:`Низкая важность`,short:`Низкая`},P0_CRITICAL:{label:`P0 Критическая авария`,short:`P0 Критическая`},P1_MAJOR:{label:`P1 Серьёзный инцидент`,short:`P1 Серьёзный`},P2_DEGRADED:{label:`P2 Ограничение работы`,short:`P2 Деградация`},P3_INFO:{label:`P3 Информационный`,short:`P3 Инфо`}},Xu={open:`Открыт`,mitigating:`Устраняется`,resolved:`Устранён`,investigating:`Расследуется`,identified:`Локализован`,monitoring:`Мониторинг устранения`},Zu={suspend_tenant:`Приостановка организации`,resume_tenant:`Возобновление организации`,drain_node:`Вывод сервера на обслуживание (Drain)`,enable_maintenance:`Включение режима тех. обслуживания`,disable_maintenance:`Выключение режима тех. обслуживания`,grant_grace_period:`Предоставление льготного периода`,restart_gateway:`Перезапуск шлюза обмена`,invalidate_cache:`Инвалидация распределённого кэша`,rollback_module:`Откат версии модуля`,circuit_breaker_trip:`Аварийное срабатывание Circuit Breaker`,circuit_breaker_reset:`Восстановление связи мониторинга`},Qu={core:`Базовые модули`,trade:`Торговля и продажи`,kitchen:`Кухня и производство`,finance:`Финансы и учёт`,management:`Управление персоналом`,analytics:`Аналитика и AI`},$u={web:`Веб-версия`,desktop:`Компьютеры (Desktop)`,android:`Android-устройства`},ed={"soft-light":`Мягкая светлая`,light:`Классическая светлая`,dark:`Тёмная`},G={draft:`Черновик`,pilot:`Пилот (15%)`,percentage:`Раскатка (50%)`,general_availability:`Полный релиз (100%)`,paused:`На паузе`,rolled_back:`Откат`},K={supported:`Поддерживается`,outdated:`Устарела`,blocked:`Заблокирована`,revoked:`Отозвана`},q={normal:`Обычный`,important:`Важный`,critical:`Критический`},J={brand:`Krona Control Center`,tagline:`Кабинет оператора платформы`,scope:`Контур платформы`,productionScope:`Боевой контур (Production)`,gateTitle:`Защита доступа оператора`,gateSubtitle:`Демонстрационный стенд закрытого кабинета оператора платформы`,gatePinPlaceholder:`Введите код доступа (например: krona2026 или 8492)...`,gateSubmit:`Войти в консоль оператора`,gateDemoLogin:`Быстрый демо-вход в 1 клик (Режим ревьюера)`,gateError:`Неверный код доступа. Попробуйте krona2026 или 8492.`,forbiddenTitle:`Доступ ограничен политикой безопасности`,forbiddenDescription:`У текущей роли оператора недостаточно прав для выполнения этого действия.`,forbiddenBack:`Вернуться в Обзор`,nav:{overview:`Обзор`,organizations:`Организации`,incidents:`Инциденты`,servers:`Серверы`,more:`Ещё`,billing:`Подписки и платежи`,modules:`Каталог модулей`,installations:`Установки`,announcements:`Оповещения`,audit:`Журнал аудита`,settings:`Настройки оператора`},overviewTabs:{attention:`Требует внимания`,metrics:`Показатели`,infrastructure:`Инфраструктура`},filters:{title:`Фильтры`,apply:`Применить`,reset:`Сбросить фильтры`,searchPlaceholder:`Поиск...`,statusAll:`Все статусы`,roleAll:`Все роли`},inspector:{title:`Инспектор объекта 360°`,tabOverview:`Сводка`,tabModules:`Модули`,tabInstallations:`Установки`,tabBilling:`Биллинг`,close:`Закрыть`},system:{synced:`Синхронизировано`,syncing:`Синхронизация...`,nodeLabel:`Узел`,resetDemo:`Сбросить демоданные`,simulateOutage:`Имитировать сбой мониторинга`,restoreMonitoring:`Восстановить мониторинг`,themeLabel:`Тема оформления`,exitToClient:`Перейти в Krona Business OS`,operatorProfile:`Профиль оператора`}},Y=({onRoleChange:e,variant:t=`full`})=>{let{role:n,operator:r}=qu(),i=W(e=>e.setActiveRole),[a,o]=(0,A.useState)(!1),s=(0,A.useRef)(null);(0,A.useEffect)(()=>{let e=e=>{s.current&&!s.current.contains(e.target)&&o(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]);let c=[`platform_owner`,`platform_admin`,`support_operator`,`billing_manager`,`security_auditor`,`release_manager`],l=t=>{i(t),o(!1),e?.(t)},u=Ju[n]||{label:n,shortLabel:n,description:``};return(0,H.jsxs)(`div`,{className:`relative inline-block text-left`,ref:s,children:[(0,H.jsxs)(`button`,{type:`button`,onClick:()=>o(!a),className:`flex items-center gap-2 px-3 py-2 min-h-[44px] rounded-lg border border-krona-gold/30 bg-krona-gold/10 hover:bg-krona-gold/20 text-krona-gold-text transition-colors text-xs font-medium focus:outline-hidden focus:ring-2 focus:ring-krona-gold`,"aria-expanded":a,"aria-haspopup":`true`,"aria-label":`Сессия оператора`,title:`Сменить роль оператора платформы (RBAC)`,"data-testid":`operator-session-button`,children:[(0,H.jsx)(Dc,{className:`w-4 h-4 text-krona-gold shrink-0`}),(0,H.jsxs)(`div`,{className:`text-left leading-tight`,children:[t===`full`&&(0,H.jsx)(`div`,{className:`font-bold text-krona-primary hidden sm:block`,children:r.name}),(0,H.jsx)(`div`,{className:`text-[11px] text-krona-gold font-semibold uppercase tracking-wider`,children:u.label})]}),(0,H.jsx)(Vo,{className:`w-3.5 h-3.5 text-krona-gold transition-transform ${a?`rotate-180`:``}`})]}),a&&(0,H.jsxs)(`div`,{className:`absolute right-0 mt-2 w-80 max-w-[calc(100vw-2rem)] rounded-xl border border-krona-border bg-krona-surface shadow-2xl z-50 p-2 text-krona-primary animate-in fade-in slide-in-from-top-2 duration-150`,role:`menu`,children:[(0,H.jsxs)(`div`,{className:`px-3 py-2 border-b border-krona-border text-xs text-krona-secondary`,children:[(0,H.jsx)(`span`,{className:`font-semibold text-krona-primary`,children:`Роль оператора (RBAC)`}),(0,H.jsx)(`p`,{className:`text-[11px] text-krona-tertiary mt-0.5`,children:`Выберите роль для проверки разграничения прав доступа:`})]}),(0,H.jsx)(`div`,{className:`py-1 space-y-1 max-h-72 overflow-y-auto`,children:c.map(e=>{let t=Ju[e],r=e===n;return(0,H.jsxs)(`button`,{type:`button`,onClick:()=>l(e),className:`w-full text-left px-3 py-2.5 min-h-[44px] rounded-lg text-xs transition-colors flex items-start gap-2.5 ${r?`bg-krona-gold/15 text-krona-gold font-semibold border border-krona-gold/30`:`hover:bg-krona-hover text-krona-secondary hover:text-krona-primary`}`,role:`menuitem`,"data-testid":`role-option-${e}`,children:[(0,H.jsx)($o,{className:`w-4 h-4 mt-0.5 shrink-0 ${r?`text-krona-gold`:`text-krona-tertiary`}`}),(0,H.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsx)(`span`,{className:`font-medium text-krona-primary`,children:t.label}),r&&(0,H.jsx)(`span`,{className:`text-[10px] bg-krona-gold/20 text-krona-gold px-1.5 py-0.2 rounded font-mono`,children:`Текущая`})]}),(0,H.jsx)(`p`,{className:`text-[11px] text-krona-tertiary mt-0.5 line-clamp-2`,children:t.description})]})]},e)})})]})]})},X=({status:e,customLabel:t,size:n=`md`})=>{let r=n===`sm`,i=r?`w-3 h-3`:`w-3.5 h-3.5`,a={active:{label:`Активна`,className:`bg-status-success-soft text-status-success-text border-status-success-border`,icon:(0,H.jsx)(Zo,{className:i,"aria-hidden":`true`})},trial:{label:`Пробный период`,className:`bg-status-info-soft text-status-info-text border-status-info-border`,icon:(0,H.jsx)(rs,{className:i,"aria-hidden":`true`})},grace:{label:`Льготный период`,className:`bg-status-warning-soft text-status-warning-text border-status-warning-border`,icon:(0,H.jsx)($c,{className:i,"aria-hidden":`true`})},suspended:{label:`Приостановлена`,className:`bg-status-danger-soft text-status-danger-text border-status-danger-border`,icon:(0,H.jsx)(ts,{className:i,"aria-hidden":`true`})},closed:{label:`Закрыта`,className:`bg-krona-muted text-krona-secondary border-krona-border`,icon:(0,H.jsx)(ts,{className:i,"aria-hidden":`true`})},normal:{label:`Оплачена`,className:`bg-status-success-soft text-status-success-text border-status-success-border`,icon:(0,H.jsx)(Zo,{className:i,"aria-hidden":`true`})},overdue:{label:`Просрочена`,className:`bg-status-danger-soft text-status-danger-text border-status-danger-border`,icon:(0,H.jsx)(ts,{className:i,"aria-hidden":`true`})},expiring_7d:{label:`Истекает (< 7 дн.)`,className:`bg-status-warning-soft text-status-warning-text border-status-warning-border font-semibold`,icon:(0,H.jsx)(rs,{className:i,"aria-hidden":`true`})},expiring_30d:{label:`Истекает (< 30 дн.)`,className:`bg-status-info-soft text-status-info-text border-status-info-border`,icon:(0,H.jsx)(rs,{className:i,"aria-hidden":`true`})},healthy:{label:`Работает нормально`,className:`bg-status-success-soft text-status-success-text border-status-success-border`,icon:(0,H.jsx)(Zo,{className:i,"aria-hidden":`true`})},degraded:{label:`Деградация`,className:`bg-status-warning-soft text-status-warning-text border-status-warning-border`,icon:(0,H.jsx)($c,{className:i,"aria-hidden":`true`})},warning:{label:`Предупреждение`,className:`bg-status-warning-soft text-status-warning-text border-status-warning-border`,icon:(0,H.jsx)($c,{className:i,"aria-hidden":`true`})},critical:{label:`Критическое состояние`,className:`bg-status-danger-soft text-status-danger-text border-status-danger-border font-semibold animate-pulse`,icon:(0,H.jsx)(Tc,{className:i,"aria-hidden":`true`})},offline:{label:`Недоступен`,className:`bg-status-danger-soft text-status-danger-text border-status-danger-border`,icon:(0,H.jsx)(lc,{className:i,"aria-hidden":`true`})},unknown:{label:`Неизвестно`,className:`bg-krona-muted text-krona-secondary border-krona-border`,icon:(0,H.jsx)(lc,{className:i,"aria-hidden":`true`})},supported:{label:`Поддерживается`,className:`bg-status-success-soft text-status-success-text border-status-success-border`,icon:(0,H.jsx)(Zo,{className:i,"aria-hidden":`true`})},outdated:{label:`Устарела`,className:`bg-status-warning-soft text-status-warning-text border-status-warning-border`,icon:(0,H.jsx)(Lc,{className:i,"aria-hidden":`true`})},blocked:{label:`Заблокирована`,className:`bg-status-danger-soft text-status-danger-text border-status-danger-border`,icon:(0,H.jsx)(ts,{className:i,"aria-hidden":`true`})},revoked:{label:`Отозвана`,className:`bg-status-danger-soft text-status-danger-text border-status-danger-border`,icon:(0,H.jsx)(ts,{className:i,"aria-hidden":`true`})},pilot:{label:`Пилот (Pilot)`,className:`bg-status-info-soft text-status-info-text border-status-info-border`,icon:(0,H.jsx)(dl,{className:i,"aria-hidden":`true`})},draft:{label:`Черновик (Draft)`,className:`bg-krona-muted text-krona-secondary border-krona-border`,icon:(0,H.jsx)(rs,{className:i,"aria-hidden":`true`})},percentage:{label:`Поэтапный релиз`,className:`bg-status-warning-soft text-status-warning-text border-status-warning-border`,icon:(0,H.jsx)(dl,{className:i,"aria-hidden":`true`})},general_availability:{label:`Общая доступность (GA)`,className:`bg-status-success-soft text-status-success-text border-status-success-border`,icon:(0,H.jsx)(Zo,{className:i,"aria-hidden":`true`})},paused:{label:`Приостановлен`,className:`bg-status-warning-soft text-status-warning-text border-status-warning-border`,icon:(0,H.jsx)($c,{className:i,"aria-hidden":`true`})},rolled_back:{label:`Отозван (Rollback)`,className:`bg-status-danger-soft text-status-danger-text border-status-danger-border`,icon:(0,H.jsx)(ts,{className:i,"aria-hidden":`true`})},open:{label:`Открыт`,className:`bg-status-danger-soft text-status-danger-text border-status-danger-border font-semibold`,icon:(0,H.jsx)(Tc,{className:i,"aria-hidden":`true`})},mitigating:{label:`Устраняется`,className:`bg-status-warning-soft text-status-warning-text border-status-warning-border`,icon:(0,H.jsx)(xc,{className:i,"aria-hidden":`true`})},resolved:{label:`Устранён`,className:`bg-status-success-soft text-status-success-text border-status-success-border`,icon:(0,H.jsx)(Zo,{className:i,"aria-hidden":`true`})}}[e]||{label:e,className:`bg-krona-muted text-krona-secondary border-krona-border`,icon:(0,H.jsx)(lc,{className:i,"aria-hidden":`true`})},o=t||a.label;return(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 font-medium transition-colors ${r?`text-xs py-0.5 px-2`:`text-xs`} ${a.className}`,"data-testid":`status-badge`,"data-status":e,children:[a.icon,(0,H.jsx)(`span`,{children:o})]})},td=({minorUnits:e,currency:t=`RUB`,className:n=``,showZeroAsFree:r=!1})=>{if(r&&e===0)return(0,H.jsx)(`span`,{className:`text-emerald-400 font-medium ${n}`,children:`0 ₽ (Бесплатно / Trial)`});let i=e/100,a=new Intl.NumberFormat(`ru-RU`,{style:`currency`,currency:t,minimumFractionDigits:2,maximumFractionDigits:2}).format(i);return(0,H.jsx)(`span`,{className:`tabular-nums font-medium ${n}`,children:a})},nd=({status:e,count:t=24,className:n=``})=>{let r=Array.from({length:t},(n,r)=>r===t-1?e:e===`offline`?r>=t-4?`offline`:r>=t-8?`warning`:`healthy`:e===`critical`?r>=t-3?`critical`:r>=t-6?`warning`:`healthy`:e===`warning`?r>=t-2?`warning`:`healthy`:r===7||r===18?`warning`:`healthy`),i=e=>{switch(e){case`healthy`:return`bg-emerald-500 hover:bg-emerald-400`;case`warning`:case`degraded`:return`bg-amber-400 hover:bg-amber-300`;case`critical`:return`bg-rose-500 hover:bg-rose-400`;case`offline`:return`bg-zinc-700 hover:bg-zinc-600`;default:return`bg-zinc-600`}};return(0,H.jsx)(`div`,{className:`flex items-center gap-1 ${n}`,title:`Heartbeat status: ${e}`,children:r.map((e,n)=>(0,H.jsx)(`div`,{className:`h-4 w-1.5 rounded-xs transition-all duration-150 ${i(e)}`,title:`Интервал -${t-1-n}h: ${e}`},n))})},rd=()=>{let e=W(e=>e.inspectorTarget),n=W(e=>e.closeInspector),{permissions:r}=qu(),i=W(e=>e.organizations),a=W(e=>e.servers),o=W(e=>e.incidents),s=W(e=>e.modules),c=W(e=>e.installations),l=W(e=>e.subscriptions),u=W(e=>e.instances),d=W(e=>e.auditLog),f=W(e=>e.openConfirmModal),p=W(e=>e.updateOrganizationStatus),m=W(e=>e.grantModuleTrial),h=W(e=>e.resolveIncident),g=W(e=>e.requestServerDiagnostics),_=W(e=>e.scheduleServerMaintenance),[v,y]=(0,A.useState)(`overview`),[b,x]=(0,A.useState)(`krona-omnichannel`),[S,C]=(0,A.useState)(14);return e?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{className:`fixed inset-0 z-40 bg-black/60 backdrop-blur-xs transition-opacity`,onClick:n,"aria-hidden":`true`}),(0,H.jsxs)(`div`,{className:`fixed inset-y-0 right-0 z-50 w-full sm:max-w-xl bg-krona-surface border-l border-krona-border shadow-2xl flex flex-col text-krona-primary animate-in slide-in-from-right duration-200`,role:`complementary`,"aria-label":`Контекстный инспектор`,children:[(0,H.jsxs)(`div`,{className:`px-5 md:px-6 py-4 border-b border-krona-border flex items-center justify-between bg-krona-workspace/80`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-semibold text-krona-secondary uppercase tracking-wider`,children:[(0,H.jsx)(ho,{className:`w-4 h-4 text-amber-500`}),(0,H.jsx)(`span`,{children:`Контекстный инспектор объекта`})]}),(0,H.jsx)(`button`,{type:`button`,onClick:n,className:`min-w-[44px] min-h-[44px] rounded-lg flex items-center justify-center text-krona-secondary hover:bg-krona-workspace hover:text-krona-primary transition-colors`,"aria-label":`Закрыть инспектор`,children:(0,H.jsx)(t,{className:`w-5 h-5`})})]}),(0,H.jsx)(`div`,{className:`flex-1 overflow-y-auto p-4 md:p-6`,children:(()=>{switch(e.type){case`organization`:{let t=i.find(t=>t.tenantId===e.id);if(!t)return(0,H.jsx)(`div`,{className:`p-6 text-krona-secondary`,children:`Организация не найдена`});let n=l.find(e=>e.tenantId===t.tenantId),a=u.filter(e=>e.tenantId===t.tenantId),h=c.filter(e=>e.tenantId===t.tenantId),g=o.filter(e=>e.affectedTenantIds.includes(t.tenantId)),_=d.filter(e=>e.target.tenantId===t.tenantId||e.target.id===t.tenantId),w=e=>{f({title:`Смена статуса организации: ${t.displayName}`,actionName:`organization.status_changed -> ${e}`,impactSummary:`Доступ всех ${t.userCount} пользователей к платформе будет переведен в состояние «${e}».`,targetType:`organization`,targetId:t.tenantId,targetName:t.displayName,onConfirm:async n=>{await p(t.tenantId,e,n)}})};return(0,H.jsxs)(`div`,{className:`space-y-6`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 mb-1.5`,children:[(0,H.jsx)(X,{status:t.platformStatus}),(0,H.jsxs)(`span`,{className:`text-xs text-krona-secondary font-mono`,children:[`ИНН: `,t.inn]})]}),(0,H.jsx)(`h2`,{className:`text-lg font-bold text-krona-primary`,children:t.displayName}),(0,H.jsxs)(`p`,{className:`text-xs text-krona-secondary font-mono`,children:[t.domain,` • ID: `,t.tenantId.slice(0,8),`...`]})]}),(0,H.jsxs)(`div`,{className:`rounded-xl bg-krona-workspace/60 border border-krona-border p-3.5 space-y-3`,children:[(0,H.jsxs)(`div`,{className:`text-xs font-semibold text-krona-primary flex items-center gap-1.5`,children:[(0,H.jsx)(Tc,{className:`w-4 h-4 text-amber-500`}),(0,H.jsx)(`span`,{children:`Действия оператора платформы`})]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[t.platformStatus!==`active`&&(0,H.jsx)(`button`,{disabled:!r.canManagePlatformStatus,onClick:()=>w(`active`),className:`min-h-[44px] px-3 py-2 rounded-lg text-xs font-medium bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border border-emerald-500/30 hover:bg-emerald-500/20 disabled:opacity-40 transition-colors flex items-center justify-center`,children:`Активировать (Active)`}),t.platformStatus!==`grace`&&(0,H.jsx)(`button`,{disabled:!r.canGrantTrialGrace,onClick:()=>w(`grace`),className:`min-h-[44px] px-3 py-2 rounded-lg text-xs font-medium bg-amber-500/10 text-amber-600 dark:text-amber-400 border border-amber-500/30 hover:bg-amber-500/20 disabled:opacity-40 transition-colors flex items-center justify-center`,children:`Назначить Grace`}),t.platformStatus!==`suspended`&&(0,H.jsx)(`button`,{disabled:!r.canManagePlatformStatus,onClick:()=>w(`suspended`),className:`min-h-[44px] px-3 py-2 rounded-lg text-xs font-medium bg-rose-500/10 text-rose-600 dark:text-rose-400 border border-rose-500/30 hover:bg-rose-500/20 disabled:opacity-40 transition-colors flex items-center justify-center`,children:`Заблокировать (Suspend)`})]}),r.canGrantTrialGrace&&(0,H.jsxs)(`div`,{className:`pt-2 border-t border-krona-border space-y-2 text-xs`,children:[(0,H.jsx)(`div`,{className:`font-semibold text-krona-primary`,children:`Выдать Trial на модуль:`}),(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-2 items-center`,children:[(0,H.jsx)(`select`,{value:b,onChange:e=>x(e.target.value),className:`min-h-[44px] bg-krona-surface border border-krona-border rounded-lg px-2.5 py-1.5 text-krona-primary text-xs focus:outline-hidden focus:ring-1 focus:ring-amber-500`,children:s.map(e=>(0,H.jsx)(`option`,{value:e.moduleId,children:e.name},e.moduleId))}),(0,H.jsxs)(`select`,{value:S,onChange:e=>C(Number(e.target.value)),className:`min-h-[44px] bg-krona-surface border border-krona-border rounded-lg px-2.5 py-1.5 text-krona-primary text-xs focus:outline-hidden focus:ring-1 focus:ring-amber-500`,children:[(0,H.jsx)(`option`,{value:7,children:`7 дней`}),(0,H.jsx)(`option`,{value:14,children:`14 дней`}),(0,H.jsx)(`option`,{value:30,children:`30 дней`})]}),(0,H.jsx)(`button`,{type:`button`,onClick:()=>{let e=s.find(e=>e.moduleId===b);f({title:`Выдача Trial: ${e?.name||b}`,actionName:`entitlement.grant_trial (${b})`,impactSummary:`Организации будет предоставлен временный доступ к модулю ${e?.name} на ${S} дней без списания средств.`,targetType:`organization`,targetId:t.tenantId,targetName:t.displayName,onConfirm:async e=>{await m(t.tenantId,b,S,e)}})},className:`min-h-[44px] px-3 py-2 rounded-lg bg-amber-500 hover:bg-amber-400 text-zinc-950 font-bold text-xs transition-colors shrink-0 flex items-center justify-center`,children:`Выдать Trial`})]})]})]}),(0,H.jsx)(`div`,{className:`flex items-center gap-1 border-b border-krona-border overflow-x-auto pb-1 text-xs`,children:[{id:`overview`,label:`Обзор`},{id:`users`,label:`Пользователи (${t.userCount})`},{id:`modules`,label:`Модули (${a.length})`},{id:`installations`,label:`Установки (${h.length})`},{id:`billing`,label:`Платежи`},{id:`incidents`,label:`Инциденты (${g.length})`},{id:`audit`,label:`Аудит`}].map(e=>(0,H.jsx)(`button`,{onClick:()=>y(e.id),className:`min-h-[44px] px-3 py-2 rounded-t-lg font-medium whitespace-nowrap transition-colors flex items-center ${v===e.id?`bg-amber-500/10 text-amber-500 border-b-2 border-amber-500`:`text-krona-secondary hover:text-krona-primary hover:bg-krona-workspace`}`,children:e.label},e.id))}),v===`overview`&&(0,H.jsxs)(`div`,{className:`space-y-4 text-xs`,children:[(0,H.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,H.jsxs)(`div`,{className:`p-3 rounded-lg bg-krona-workspace/60 border border-krona-border`,children:[(0,H.jsx)(`div`,{className:`text-krona-secondary mb-1`,children:`Тарифный план`}),(0,H.jsx)(`div`,{className:`font-semibold text-krona-primary text-sm`,children:t.tariffPlan})]}),(0,H.jsxs)(`div`,{className:`p-3 rounded-lg bg-krona-workspace/60 border border-krona-border`,children:[(0,H.jsx)(`div`,{className:`text-krona-secondary mb-1`,children:`MRR доход`}),(0,H.jsx)(td,{minorUnits:t.mrrMinorUnits,className:`text-sm font-bold text-amber-500`})]}),(0,H.jsxs)(`div`,{className:`p-3 rounded-lg bg-krona-workspace/60 border border-krona-border`,children:[(0,H.jsx)(`div`,{className:`text-krona-secondary mb-1`,children:`Филиалов / точек`}),(0,H.jsx)(`div`,{className:`font-semibold text-krona-primary text-sm`,children:t.branchCount})]}),(0,H.jsxs)(`div`,{className:`p-3 rounded-lg bg-krona-workspace/60 border border-krona-border`,children:[(0,H.jsx)(`div`,{className:`text-krona-secondary mb-1`,children:`Задолженность`}),(0,H.jsx)(td,{minorUnits:t.outstandingDebtMinorUnits,className:`text-sm font-bold ${t.outstandingDebtMinorUnits>0?`text-rose-500`:`text-emerald-500`}`})]})]}),(0,H.jsxs)(`div`,{className:`rounded-lg bg-krona-workspace/60 border border-krona-border p-3 space-y-2`,children:[(0,H.jsx)(`div`,{className:`font-semibold text-krona-primary`,children:`Контакты организации:`}),(0,H.jsxs)(`div`,{className:`text-krona-secondary`,children:[`Email: `,(0,H.jsx)(`span`,{className:`text-krona-primary`,children:t.contactEmail})]}),(0,H.jsxs)(`div`,{className:`text-krona-secondary`,children:[`Телефон: `,(0,H.jsx)(`span`,{className:`text-krona-primary`,children:t.contactPhone})]}),(0,H.jsxs)(`div`,{className:`text-krona-secondary`,children:[`Последняя активность: `,(0,H.jsx)(`span`,{className:`text-krona-primary`,children:new Date(t.lastActiveAt).toLocaleString(`ru-RU`)})]}),(0,H.jsxs)(`div`,{className:`text-krona-secondary`,children:[`Окончание подписки: `,(0,H.jsx)(`span`,{className:`text-krona-primary`,children:new Date(t.subscriptionEndAt).toLocaleDateString(`ru-RU`)})]})]})]}),v===`users`&&(0,H.jsxs)(`div`,{className:`space-y-3 text-xs`,children:[(0,H.jsxs)(`div`,{className:`p-3 rounded-lg bg-krona-workspace/60 border border-krona-border`,children:[(0,H.jsxs)(`div`,{className:`flex justify-between items-center mb-2`,children:[(0,H.jsx)(`span`,{className:`font-semibold text-krona-primary`,children:`Пользователи-агрегаты`}),(0,H.jsxs)(`span`,{className:`text-amber-500 font-bold`,children:[t.userCount,` учетных записей`]})]}),(0,H.jsx)(`p`,{className:`text-krona-secondary text-[11px] leading-relaxed`,children:`В соответствии с контрактом безопасности Control Center отображает только деперсонализированные агрегаты тенанта. Персональные данные сотрудников защищены контуром организации.`})]}),(0,H.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-krona-primary`,children:[(0,H.jsxs)(`div`,{className:`p-2.5 rounded-lg bg-krona-workspace border border-krona-border`,children:[(0,H.jsx)(`div`,{className:`text-krona-secondary`,children:`Администраторы`}),(0,H.jsx)(`div`,{className:`font-bold text-sm text-krona-primary`,children:`2`})]}),(0,H.jsxs)(`div`,{className:`p-2.5 rounded-lg bg-krona-workspace border border-krona-border`,children:[(0,H.jsx)(`div`,{className:`text-krona-secondary`,children:`Менеджеры / операторы`}),(0,H.jsx)(`div`,{className:`font-bold text-sm text-krona-primary`,children:Math.max(0,t.userCount-6)})]})]})]}),v===`modules`&&(0,H.jsx)(`div`,{className:`space-y-2 text-xs`,children:a.map(e=>(0,H.jsxs)(`div`,{className:`p-3 rounded-lg bg-krona-workspace/60 border border-krona-border flex items-center justify-between`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`font-semibold text-krona-primary`,children:e.moduleName}),(0,H.jsxs)(`div`,{className:`text-[11px] text-krona-secondary font-mono mt-0.5`,children:[`v`,e.currentVersion,` • `,e.serverName]})]}),(0,H.jsx)(X,{status:e.health,size:`sm`})]},e.moduleInstanceId))}),v===`installations`&&(0,H.jsxs)(`div`,{className:`space-y-2 text-xs`,children:[h.map(e=>(0,H.jsxs)(`div`,{className:`p-3 rounded-lg bg-krona-workspace/60 border border-krona-border flex items-center justify-between`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`div`,{className:`font-semibold text-krona-primary flex items-center gap-1.5`,children:[(0,H.jsx)(Lc,{className:`w-3.5 h-3.5 text-krona-secondary`}),(0,H.jsx)(`span`,{children:e.deviceName})]}),(0,H.jsxs)(`div`,{className:`text-[11px] text-krona-secondary font-mono mt-0.5`,children:[$u[e.kind]||e.kind,` • v`,e.appVersion,` • `,e.osVersion]})]}),(0,H.jsx)(X,{status:e.status,size:`sm`})]},e.installationId)),h.length===0&&(0,H.jsx)(`div`,{className:`text-krona-secondary py-4 text-center`,children:`Нет активных установок`})]}),v===`billing`&&(0,H.jsx)(`div`,{className:`space-y-3 text-xs`,children:n?(0,H.jsxs)(`div`,{className:`p-3 rounded-lg bg-krona-workspace/60 border border-krona-border space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,H.jsx)(`span`,{className:`font-semibold text-krona-primary`,children:`Тарифная подписка`}),(0,H.jsx)(X,{status:n.status,size:`sm`})]}),(0,H.jsxs)(`div`,{className:`flex justify-between text-krona-secondary`,children:[(0,H.jsx)(`span`,{children:`Период:`}),(0,H.jsx)(`span`,{className:`text-krona-primary`,children:n.period===`year`?`Годовой`:`Ежемесячный`})]}),(0,H.jsxs)(`div`,{className:`flex justify-between text-krona-secondary`,children:[(0,H.jsx)(`span`,{children:`Сумма тарифа:`}),(0,H.jsx)(td,{minorUnits:n.amountMinorUnits,className:`text-amber-500 font-bold`})]}),(0,H.jsxs)(`div`,{className:`flex justify-between text-krona-secondary`,children:[(0,H.jsx)(`span`,{children:`Действует до:`}),(0,H.jsx)(`span`,{className:`text-krona-primary`,children:new Date(n.validUntil).toLocaleDateString(`ru-RU`)})]})]}):(0,H.jsx)(`div`,{className:`text-krona-secondary py-4 text-center`,children:`Данные подписки отсутствуют`})}),v===`incidents`&&(0,H.jsxs)(`div`,{className:`space-y-2 text-xs`,children:[g.map(e=>(0,H.jsxs)(`div`,{className:`p-3 rounded-lg bg-krona-workspace/60 border border-krona-border space-y-1.5`,children:[(0,H.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,H.jsx)(`span`,{className:`font-bold text-krona-primary font-mono`,children:e.incidentNumber}),(0,H.jsx)(X,{status:e.status,size:`sm`})]}),(0,H.jsx)(`p`,{className:`text-krona-primary`,children:e.summary})]},e.incidentId)),g.length===0&&(0,H.jsx)(`div`,{className:`text-krona-secondary py-4 text-center`,children:`Инцидентов нет`})]}),v===`audit`&&(0,H.jsxs)(`div`,{className:`space-y-2 text-xs`,children:[_.map(e=>(0,H.jsxs)(`div`,{className:`p-2.5 rounded-lg bg-krona-workspace/60 border border-krona-border space-y-1`,children:[(0,H.jsxs)(`div`,{className:`flex justify-between text-krona-secondary font-mono text-[10px]`,children:[(0,H.jsx)(`span`,{children:e.action}),(0,H.jsx)(`span`,{children:new Date(e.occurredAt).toLocaleTimeString(`ru-RU`)})]}),(0,H.jsx)(`p`,{className:`text-krona-primary text-[11px]`,children:e.reason}),(0,H.jsxs)(`div`,{className:`text-[10px] text-amber-500`,children:[e.operatorName,` (`,Ju[e.operatorRole]?.shortLabel||e.operatorRole,`)`]})]},e.eventId)),_.length===0&&(0,H.jsx)(`div`,{className:`text-krona-secondary py-4 text-center`,children:`Записей аудита нет`})]})]})}case`server`:{let t=a.find(t=>t.serverId===e.id);if(!t)return(0,H.jsx)(`div`,{className:`p-6 text-krona-secondary`,children:`Сервер не найден`});let n=u.filter(e=>e.serverId===t.serverId);return(0,H.jsxs)(`div`,{className:`space-y-6 text-xs`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 mb-1.5`,children:[(0,H.jsx)(X,{status:t.status}),(0,H.jsxs)(`span`,{className:`text-xs text-krona-secondary font-mono`,children:[t.hostingProvider,` • `,t.region]})]}),(0,H.jsx)(`h2`,{className:`text-lg font-bold text-krona-primary`,children:t.name}),(0,H.jsxs)(`p`,{className:`text-xs text-krona-secondary font-mono`,children:[t.ipAddress,` • `,t.hostname]})]}),(0,H.jsxs)(`div`,{className:`rounded-xl bg-krona-workspace/60 border border-krona-border p-3.5 space-y-2.5`,children:[(0,H.jsxs)(`div`,{className:`text-xs font-semibold text-krona-primary flex items-center gap-1.5`,children:[(0,H.jsx)(Tc,{className:`w-4 h-4 text-amber-500`}),(0,H.jsx)(`span`,{children:`Операции с инфраструктурным узлом`})]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,H.jsxs)(`button`,{disabled:!r.canRequestDiagnostics,onClick:()=>{f({title:`Запрос диагностики: ${t.name}`,actionName:`infrastructure.request_diagnostics`,impactSummary:`На узел ${t.ipAddress} будет отправлен запрос сбора расширенного дампа метрик, журнала dmesg и состояния процессов без раскрытия секретов.`,targetType:`infrastructure`,targetId:t.serverId,targetName:t.name,onConfirm:async e=>{await g(t.serverId,e)}})},className:`min-h-[44px] px-3 py-2 rounded-lg text-xs font-medium bg-krona-workspace text-krona-primary hover:bg-krona-surface border border-krona-border disabled:opacity-40 transition-colors flex items-center gap-1.5`,children:[(0,H.jsx)(ho,{className:`w-3.5 h-3.5 text-sky-400`}),(0,H.jsx)(`span`,{children:`Запросить диагностику`})]}),(0,H.jsxs)(`button`,{disabled:!r.canScheduleMaintenance,onClick:()=>{f({title:`Запланировать ТО: ${t.name}`,actionName:`infrastructure.schedule_maintenance`,impactSummary:`Узел ${t.name} будет помечен как обслуживаемый. Маршрутизация трафика будет плавно перенаправлена на резервные ноды.`,targetType:`infrastructure`,targetId:t.serverId,targetName:t.name,onConfirm:async e=>{await _(t.serverId,e)}})},className:`min-h-[44px] px-3 py-2 rounded-lg text-xs font-medium bg-amber-500/10 text-amber-600 dark:text-amber-400 border border-amber-500/30 hover:bg-amber-500/20 disabled:opacity-40 transition-colors flex items-center gap-1.5`,children:[(0,H.jsx)(rs,{className:`w-3.5 h-3.5 text-amber-500`}),(0,H.jsx)(`span`,{children:`Запланировать ТО`})]})]})]}),(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsxs)(`div`,{className:`font-semibold text-krona-primary flex items-center justify-between`,children:[(0,H.jsx)(`span`,{children:`Телеметрия узла (Server Monitor Agent):`}),(0,H.jsxs)(`span`,{className:`text-[11px] text-krona-secondary font-mono`,children:[`Agent v`,t.agentVersion,` (`,t.agentStatus,`)`]})]}),(0,H.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,H.jsxs)(`div`,{className:`p-3 rounded-lg bg-krona-workspace/60 border border-krona-border`,children:[(0,H.jsxs)(`div`,{className:`flex justify-between text-krona-secondary mb-1`,children:[(0,H.jsx)(`span`,{children:`CPU Нагрузка:`}),(0,H.jsxs)(`span`,{className:`font-bold text-krona-primary`,children:[t.cpuLoadPercent,`%`]})]}),(0,H.jsx)(`div`,{className:`w-full bg-krona-surface h-1.5 rounded-full overflow-hidden`,children:(0,H.jsx)(`div`,{className:`h-full ${t.cpuLoadPercent>80?`bg-rose-500`:`bg-emerald-500`}`,style:{width:`${t.cpuLoadPercent}%`}})})]}),(0,H.jsxs)(`div`,{className:`p-3 rounded-lg bg-krona-workspace/60 border border-krona-border`,children:[(0,H.jsxs)(`div`,{className:`flex justify-between text-krona-secondary mb-1`,children:[(0,H.jsx)(`span`,{children:`RAM Память:`}),(0,H.jsxs)(`span`,{className:`font-bold text-krona-primary`,children:[Math.round(t.ramUsedBytes/1073741824),` / `,Math.round(t.ramTotalBytes/1073741824),` GB`]})]}),(0,H.jsx)(`div`,{className:`w-full bg-krona-surface h-1.5 rounded-full overflow-hidden`,children:(0,H.jsx)(`div`,{className:`h-full bg-emerald-500`,style:{width:`${t.ramUsedBytes/t.ramTotalBytes*100}%`}})})]}),(0,H.jsxs)(`div`,{className:`p-3 rounded-lg bg-krona-workspace/60 border border-krona-border`,children:[(0,H.jsxs)(`div`,{className:`flex justify-between text-krona-secondary mb-1`,children:[(0,H.jsx)(`span`,{children:`Диск:`}),(0,H.jsxs)(`span`,{className:`font-bold text-krona-primary`,children:[Math.round(t.diskUsedBytes/1073741824),` / `,Math.round(t.diskTotalBytes/1073741824),` GB`]})]}),(0,H.jsx)(`div`,{className:`w-full bg-krona-surface h-1.5 rounded-full overflow-hidden`,children:(0,H.jsx)(`div`,{className:`h-full ${t.diskUsedBytes/t.diskTotalBytes>.85?`bg-rose-500`:`bg-amber-500`}`,style:{width:`${t.diskUsedBytes/t.diskTotalBytes*100}%`}})})]}),(0,H.jsxs)(`div`,{className:`p-3 rounded-lg bg-krona-workspace/60 border border-krona-border`,children:[(0,H.jsx)(`div`,{className:`text-krona-secondary mb-1`,children:`Сеть (Rx / Tx):`}),(0,H.jsxs)(`div`,{className:`font-mono text-krona-primary`,children:[(t.networkRxBytesPerSec/1024/1024).toFixed(1),` / `,(t.networkTxBytesPerSec/1024/1024).toFixed(1),` MB/s`]})]})]}),(0,H.jsxs)(`div`,{className:`p-3 rounded-lg bg-krona-workspace/60 border border-krona-border space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,H.jsx)(`span`,{className:`font-semibold text-krona-primary`,children:`Пульс узла (Heartbeat 24h):`}),(0,H.jsxs)(`span`,{className:`text-[11px] text-krona-secondary font-mono`,children:[`RTT: `,t.latencyMs,`ms`]})]}),(0,H.jsx)(nd,{status:t.status,count:24})]}),(0,H.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,H.jsxs)(`div`,{className:`p-3 rounded-lg bg-krona-workspace/60 border border-krona-border space-y-1`,children:[(0,H.jsxs)(`div`,{className:`font-semibold text-krona-primary flex items-center justify-between`,children:[(0,H.jsx)(`span`,{children:`Резервная копия:`}),(0,H.jsx)(X,{status:t.backup.state===`ok`?`healthy`:t.backup.state===`failed`?`critical`:`warning`,size:`sm`,customLabel:t.backup.state===`ok`?`УСПЕШНО`:t.backup.state===`failed`?`ОШИБКА`:`В ПРОЦЕССЕ`})]}),(0,H.jsx)(`div`,{className:`text-krona-secondary text-[11px]`,children:t.backup.lastSuccessfulAt?new Date(t.backup.lastSuccessfulAt).toLocaleString(`ru-RU`):`Нет успешных копий`}),(0,H.jsx)(`div`,{className:`text-krona-secondary text-[10px]`,children:t.backup.targetProvider})]}),(0,H.jsxs)(`div`,{className:`p-3 rounded-lg bg-krona-workspace/60 border border-krona-border space-y-1`,children:[(0,H.jsxs)(`div`,{className:`font-semibold text-krona-primary flex items-center justify-between`,children:[(0,H.jsx)(`span`,{children:`Тест восстановления:`}),(0,H.jsx)(X,{status:t.restoreDrill.state===`passed`?`healthy`:t.restoreDrill.state===`failed`?`critical`:`warning`,size:`sm`,customLabel:t.restoreDrill.state===`passed`?`ПРОЙДЕН`:t.restoreDrill.state===`failed`?`СБОЙ`:`ОЖИДАНИЕ`})]}),(0,H.jsx)(`div`,{className:`text-krona-secondary text-[11px]`,children:t.restoreDrill.verifiedAt?new Date(t.restoreDrill.verifiedAt).toLocaleDateString(`ru-RU`):`Никогда / Устарел`}),(0,H.jsx)(`div`,{className:`text-krona-secondary text-[10px]`,children:t.restoreDrill.drillDurationSeconds?`Время восстановления: ${Math.round(t.restoreDrill.drillDurationSeconds/60)} мин.`:`Тест не проводился`})]})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsxs)(`div`,{className:`font-semibold text-krona-primary`,children:[`Модули на узле (`,n.length,`):`]}),n.map(e=>(0,H.jsxs)(`div`,{className:`p-2.5 rounded-lg bg-krona-workspace/60 border border-krona-border flex justify-between items-center`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`font-semibold text-krona-primary`,children:e.moduleName}),(0,H.jsx)(`div`,{className:`text-krona-secondary text-[11px]`,children:e.tenantName})]}),(0,H.jsx)(X,{status:e.health,size:`sm`})]},e.moduleInstanceId))]})]})]})}case`incident`:{let t=o.find(t=>t.incidentId===e.id);return t?(0,H.jsxs)(`div`,{className:`space-y-6 text-xs`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 mb-1.5`,children:[(0,H.jsx)(X,{status:t.status}),(0,H.jsx)(`span`,{className:`font-bold text-amber-500 uppercase tracking-wider`,children:Yu[t.severity]?.label||t.severity})]}),(0,H.jsx)(`h2`,{className:`text-lg font-bold text-krona-primary`,children:t.incidentNumber}),(0,H.jsx)(`p`,{className:`text-sm text-krona-primary mt-1 font-medium`,children:t.summary})]}),t.status!==`resolved`&&(0,H.jsxs)(`div`,{className:`p-3.5 rounded-xl bg-krona-workspace/60 border border-krona-border flex flex-wrap gap-2 justify-between items-center`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`font-semibold text-krona-primary`,children:`Действие оператора:`}),(0,H.jsx)(`div`,{className:`text-krona-secondary text-[11px]`,children:`Отметить инцидент как устраненный с обоснованием`})]}),(0,H.jsx)(`button`,{disabled:!r.canManageIncidents,onClick:()=>{f({title:`Разрешение инцидента ${t.incidentNumber}`,actionName:`incident.resolve`,impactSummary:`Инцидент будет переведен в статус resolved, дежурная смена будет оповещена об устранении причин.`,targetType:`incident`,targetId:t.incidentId,targetName:t.incidentNumber,onConfirm:async e=>{await h(t.incidentId,e)}})},className:`min-h-[44px] px-4 py-2 rounded-lg bg-emerald-600 hover:bg-emerald-500 text-zinc-950 font-bold text-xs transition-colors disabled:opacity-40 flex items-center justify-center`,children:`Разрешить инцидент`})]}),(0,H.jsxs)(`div`,{className:`rounded-lg bg-krona-workspace/60 p-3.5 border border-krona-border space-y-2`,children:[(0,H.jsx)(`div`,{className:`font-semibold text-krona-primary`,children:`Описание инцидента:`}),(0,H.jsx)(`p`,{className:`text-krona-primary leading-relaxed`,children:t.description}),(0,H.jsxs)(`div`,{className:`text-krona-secondary pt-2 border-t border-krona-border`,children:[`Ответственный: `,(0,H.jsx)(`span`,{className:`text-krona-primary`,children:t.ownerName})]})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(`div`,{className:`font-semibold text-krona-primary`,children:`Хронология расследования (Timeline):`}),(0,H.jsx)(`div`,{className:`space-y-2 relative border-l border-krona-border ml-2 pl-3`,children:t.timeline.map((e,t)=>(0,H.jsxs)(`div`,{className:`relative space-y-1`,children:[(0,H.jsx)(`div`,{className:`absolute -left-[17px] top-1 w-2 h-2 rounded-full bg-amber-500`}),(0,H.jsxs)(`div`,{className:`flex justify-between text-krona-secondary text-[10px]`,children:[(0,H.jsx)(`span`,{className:`font-bold text-krona-primary`,children:e.author}),(0,H.jsx)(`span`,{children:new Date(e.timestamp).toLocaleTimeString(`ru-RU`)})]}),(0,H.jsx)(`p`,{className:`text-krona-primary`,children:e.message})]},t))})]})]}):(0,H.jsx)(`div`,{className:`p-6 text-krona-secondary`,children:`Инцидент не найден`})}default:return(0,H.jsx)(`div`,{className:`p-6 text-krona-secondary`,children:`Детальная информация для данного типа пока формируется`})}})()})]})]}):null},id=({pendingModal:e,onClose:n})=>{let{operator:r,role:i}=qu(),[a,o]=(0,A.useState)(``),[s,c]=(0,A.useState)(null),[l,u]=(0,A.useState)(!1),d=(0,A.useRef)(null);(0,A.useEffect)(()=>{d.current?.focus()},[]);let f=async t=>{t.preventDefault();let r=a.trim();if(r.length<5){c(`Обоснование операции обязательно (минимум 5 символов).`);return}u(!0);try{await e.onConfirm(r),n()}catch(e){c(`Ошибка выполнения: ${e instanceof Error?e.message:String(e)}`),u(!1)}},p=Ju[i]?.label||i;return(0,H.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-xs p-4 animate-in fade-in duration-150`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`confirm-modal-title`,onKeyDown:e=>{e.key===`Escape`&&!l&&n()},children:(0,H.jsxs)(`div`,{className:`w-full max-w-lg rounded-xl border border-amber-500/40 bg-krona-surface text-krona-primary shadow-2xl p-5 md:p-6 space-y-4`,children:[(0,H.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-b border-krona-border pb-4`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,H.jsx)(`div`,{className:`p-2.5 rounded-lg bg-amber-500/15 text-amber-500 border border-amber-500/30 shrink-0`,children:(0,H.jsx)(Tc,{className:`w-6 h-6`})}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`h3`,{id:`confirm-modal-title`,className:`text-base md:text-lg font-bold text-krona-primary`,children:e.title}),(0,H.jsx)(`p`,{className:`text-xs text-krona-secondary`,children:`Требуется авторизация оператора и запись в журнал аудита`})]})]}),(0,H.jsx)(`button`,{onClick:n,disabled:l,className:`min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg text-krona-secondary hover:bg-krona-workspace hover:text-krona-primary transition-colors`,"aria-label":`Закрыть`,children:(0,H.jsx)(t,{className:`w-5 h-5`})})]}),(0,H.jsxs)(`form`,{onSubmit:f,className:`space-y-4`,children:[(0,H.jsxs)(`div`,{className:`rounded-lg bg-krona-workspace border border-krona-border p-3.5 space-y-2 text-xs`,children:[(0,H.jsxs)(`div`,{className:`flex justify-between text-krona-secondary`,children:[(0,H.jsx)(`span`,{children:`Целевой объект:`}),(0,H.jsx)(`span`,{className:`font-semibold text-krona-primary`,children:e.targetName})]}),(0,H.jsxs)(`div`,{className:`flex justify-between text-krona-secondary`,children:[(0,H.jsx)(`span`,{children:`Операция:`}),(0,H.jsx)(`span`,{className:`font-mono text-amber-500 font-semibold`,children:e.actionName})]}),(0,H.jsxs)(`div`,{className:`flex justify-between text-krona-secondary`,children:[(0,H.jsx)(`span`,{children:`Оператор:`}),(0,H.jsxs)(`span`,{className:`text-krona-primary font-medium`,children:[r.name,` (`,p,`)`]})]})]}),(0,H.jsxs)(`div`,{className:`rounded-lg bg-amber-500/10 border border-amber-500/30 p-3.5 text-xs text-amber-600 dark:text-amber-300 flex gap-2.5 items-start`,children:[(0,H.jsx)($c,{className:`w-4 h-4 text-amber-500 shrink-0 mt-0.5`}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`font-semibold text-amber-600 dark:text-amber-300 mb-0.5`,children:`Влияние операции:`}),(0,H.jsx)(`div`,{className:`text-krona-secondary`,children:e.impactSummary})]})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`label`,{htmlFor:`action-reason-input`,className:`block text-xs font-semibold text-krona-primary mb-1.5`,children:[`Обоснование операции (Reason) `,(0,H.jsx)(`span`,{className:`text-rose-500`,children:`*`})]}),(0,H.jsx)(`textarea`,{id:`action-reason-input`,ref:d,rows:3,value:a,onChange:e=>{o(e.target.value),s&&c(null)},placeholder:`Укажите причину выполнения действия (номер заявки, обоснование, согласование)...`,className:`w-full rounded-lg bg-krona-workspace border border-krona-border p-3 text-sm text-krona-primary placeholder:text-krona-secondary/60 focus:outline-hidden focus:border-amber-500 transition-colors resize-none`,disabled:l}),s&&(0,H.jsx)(`p`,{className:`mt-1 text-xs text-rose-500 font-medium`,children:s})]}),(0,H.jsxs)(`div`,{className:`flex flex-col-reverse sm:flex-row items-center justify-end gap-2 pt-3 border-t border-krona-border`,children:[(0,H.jsx)(`button`,{type:`button`,onClick:n,disabled:l,className:`w-full sm:w-auto min-h-[44px] px-4 py-2.5 text-xs font-medium rounded-lg border border-krona-border text-krona-secondary hover:text-krona-primary transition-colors flex items-center justify-center`,children:`Отмена`}),(0,H.jsxs)(`button`,{type:`submit`,disabled:l,className:`w-full sm:w-auto min-h-[44px] px-5 py-2.5 text-xs font-bold rounded-lg bg-amber-500 hover:bg-amber-400 text-zinc-950 transition-colors flex items-center justify-center gap-2 shadow-xs disabled:opacity-50`,children:[(0,H.jsx)(Yo,{className:`w-4 h-4`}),(0,H.jsx)(`span`,{children:l?`Подтверждение...`:`Подтвердить операцию`})]})]})]})]})})},ad=()=>{let e=W(e=>e.pendingConfirmModal),t=W(e=>e.closeConfirmModal);return e?(0,H.jsx)(id,{pendingModal:e,onClose:t}):null},od=()=>{let e=W(e=>e.serverMonitorOutage),t=W(e=>e.toggleServerMonitorOutage);return e?(0,H.jsxs)(`div`,{className:`mb-4 rounded-xl border border-status-danger-border bg-status-danger-soft p-4 text-status-danger-text flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 shadow-md animate-in fade-in slide-in-from-top-1`,role:`alert`,children:[(0,H.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,H.jsx)(`div`,{className:`p-2 rounded-lg bg-status-danger-text/10 text-status-danger-text border border-status-danger-border shrink-0 mt-0.5`,children:(0,H.jsx)($s,{className:`w-5 h-5`})}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`font-bold text-sm`,children:`Авария: Сервис мониторинга недоступен (Circuit Breaker Tripped)`}),(0,H.jsx)(`div`,{className:`text-xs opacity-90 mt-0.5`,children:`Прямой mTLS-канал с агентами узлов не отвечает. Разделы организаций, подписок и биллинга продолжают штатную работу. Показаны последние закешированные данные телеметрии.`})]})]}),(0,H.jsxs)(`button`,{type:`button`,onClick:t,className:`shrink-0 px-3 py-2 min-h-[44px] rounded-lg border border-status-danger-border bg-krona-surface hover:bg-krona-hover text-status-danger-text text-xs font-semibold flex items-center gap-2 transition-colors self-stretch sm:self-auto justify-center`,children:[(0,H.jsx)(pc,{className:`w-3.5 h-3.5`}),(0,H.jsx)(`span`,{children:`Восстановить связь`})]})]}):null},sd=`krona_theme_mode`;function cd(){if(typeof window>`u`)return`soft-light`;let e=localStorage.getItem(sd);return e&&[`soft-light`,`light`,`dark`].includes(e)?e:`soft-light`}function ld(e){typeof document>`u`||document.documentElement.setAttribute(`data-theme`,e)}var ud=f((e,t)=>{let n=cd();return ld(n),{themeMode:n,setTheme:t=>{localStorage.setItem(sd,t),ld(t),e({themeMode:t})},toggleTheme:()=>{let e=t().themeMode,n=e===`soft-light`?`light`:e===`light`?`dark`:`soft-light`;t().setTheme(n)}}}),dd=[{to:`/control`,label:`Обзор`,icon:Ns,end:!0},{to:`/control/organizations`,label:`Организации`,icon:jo},{to:`/control/billing`,label:`Подписки и платежи`,icon:ls},{to:`/control/modules`,label:`Каталог модулей`,icon:tc},{to:`/control/installations`,label:`Установки`,icon:Lc},{to:`/control/infrastructure`,label:`Серверы`,icon:xc},{to:`/control/announcements`,label:`Оповещения`,icon:To},{to:`/control/incidents`,label:`Инциденты`,icon:$c},{to:`/control/audit`,label:`Журнал аудита`,icon:hs}],fd=()=>{let e=Lr(),n=Br(),r=W(e=>e.isInitialized),i=W(e=>e.initialize),a=W(e=>e.resetToDefaults),o=W(e=>e.serverMonitorOutage),s=W(e=>e.toggleServerMonitorOutage),c=W(e=>e.incidents),{role:l,operator:u}=qu(),d=ud(e=>e.themeMode),f=ud(e=>e.setTheme),[p,m]=(0,A.useState)(``),[h,g]=(0,A.useState)(!1),[_,v]=(0,A.useState)(!1),[y,b]=(0,A.useState)(!1),[x,S]=(0,A.useState)(!1),[C,w]=(0,A.useState)(e.pathname);C!==e.pathname&&(w(e.pathname),b(!1)),(0,A.useEffect)(()=>{r||i()},[r,i]),(0,A.useEffect)(()=>{let e=()=>{m(`${new Date().toUTCString().slice(17,25)} UTC`)};e();let t=setInterval(e,1e3);return()=>clearInterval(t)},[]);let T=async()=>{confirm(`Сбросить демонстрационные данные платформы к исходному состоянию?`)&&(g(!0),await a(),g(!1),v(!0),setTimeout(()=>v(!1),3e3))},E=(0,A.useMemo)(()=>{let e=0;return o&&(e+=1),e+=c.filter(e=>e.status!==`resolved`&&(e.severity===`critical`||e.severity===`high`)).length,e},[o,c]),ee=(0,A.useMemo)(()=>[{to:`/control`,label:`Обзор`,icon:Ns,end:!0},{to:`/control/organizations`,label:`Организации`,icon:jo},{to:`/control/incidents`,label:`Инциденты`,icon:$c,badge:E>0?E:void 0},{to:`/control/infrastructure`,label:`Серверы`,icon:xc}],[E]),D=(0,A.useMemo)(()=>dd.map(e=>({...e,badge:e.to===`/control/incidents`&&E>0?E:void 0})),[E]),O=(0,A.useMemo)(()=>dd.find(t=>t.end?e.pathname===t.to:e.pathname.startsWith(t.to))?.label||`Control Center`,[e.pathname]),te=Ju[l]?.shortLabel||l;return(0,H.jsxs)(`div`,{className:`min-h-screen max-w-full overflow-x-hidden bg-krona-app text-krona-primary flex flex-col font-sans selection:bg-krona-gold selection:text-zinc-950 transition-colors duration-200`,"data-testid":`control-center-shell`,children:[(0,H.jsxs)(`header`,{className:`hidden md:flex h-14 border-b border-krona-border bg-krona-workspace/95 backdrop-blur-md px-4 items-center justify-between z-30 shrink-0 max-w-full`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-3 lg:gap-4 min-w-0`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2.5 min-w-0`,children:[(0,H.jsx)(`div`,{className:`w-8 h-8 rounded-lg bg-krona-surface border border-krona-gold/40 flex items-center justify-center text-krona-gold font-extrabold shadow-sm shrink-0`,children:`K`}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsxs)(`div`,{className:`text-xs font-black tracking-wider text-krona-primary uppercase flex items-center gap-1.5`,children:[(0,H.jsx)(`span`,{className:`shrink-0`,children:`Krona Control Center`}),(0,H.jsx)(`span`,{className:`text-[9px] px-1.5 py-0.5 rounded-sm bg-status-success-soft text-status-success-text font-mono`,children:`PROD v1.0`})]}),(0,H.jsx)(`div`,{className:`text-[10px] text-krona-tertiary font-mono tracking-wider`,children:`Кабинет владельца платформы`})]})]}),(0,H.jsxs)(`div`,{className:`hidden xl:flex items-center gap-2 text-[11px] text-krona-tertiary font-mono pl-3 border-l border-krona-border shrink-0`,children:[(0,H.jsx)(`span`,{children:p}),(0,H.jsx)(`span`,{children:`•`}),(0,H.jsxs)(`span`,{className:`flex items-center gap-1 text-status-success-text`,children:[(0,H.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-status-success-text animate-pulse shrink-0`}),(0,H.jsx)(`span`,{children:J.system.synced})]})]})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2 lg:gap-3 shrink-0`,children:[(0,H.jsxs)(`button`,{type:`button`,onClick:s,className:`min-h-[38px] px-2.5 py-1.5 rounded-lg border text-xs font-medium flex items-center gap-1.5 transition-colors ${o?`border-status-danger-border bg-status-danger-soft text-status-danger-text animate-pulse font-semibold`:`border-krona-border bg-krona-surface hover:bg-krona-hover text-krona-secondary`}`,title:`Имитация сбоя канала телеметрии Server Monitor (Circuit Breaker)`,"data-testid":`simulate-outage-toggle`,children:[(0,H.jsx)(lc,{className:`w-3.5 h-3.5 shrink-0`}),(0,H.jsx)(`span`,{className:`hidden lg:inline`,children:o?`Сбой мониторинга (Активен)`:`Имитировать сбой`})]}),(0,H.jsxs)(`div`,{className:`flex items-center bg-krona-surface border border-krona-border rounded-lg p-0.5`,role:`radiogroup`,"aria-label":`Выбор темы`,children:[(0,H.jsx)(`button`,{type:`button`,onClick:()=>f(`soft-light`),className:`p-1.5 rounded-md text-xs transition-colors ${d===`soft-light`?`bg-krona-workspace text-krona-gold font-semibold shadow-xs`:`text-krona-secondary hover:text-krona-primary`}`,title:`Мягкая светлая тема`,"data-testid":`theme-toggle-soft-light`,children:(0,H.jsx)(zc,{className:`w-3.5 h-3.5`})}),(0,H.jsx)(`button`,{type:`button`,onClick:()=>f(`light`),className:`p-1.5 rounded-md text-xs transition-colors ${d===`light`?`bg-krona-workspace text-krona-gold font-semibold shadow-xs`:`text-krona-secondary hover:text-krona-primary`}`,title:`Классическая светлая тема`,"data-testid":`theme-toggle-light`,children:(0,H.jsx)(Uc,{className:`w-3.5 h-3.5`})}),(0,H.jsx)(`button`,{type:`button`,onClick:()=>f(`dark`),className:`p-1.5 rounded-md text-xs transition-colors ${d===`dark`?`bg-krona-workspace text-krona-gold font-semibold shadow-xs`:`text-krona-secondary hover:text-krona-primary`}`,title:`Тёмная тема`,"data-testid":`theme-toggle-dark`,children:(0,H.jsx)(Zs,{className:`w-3.5 h-3.5`})})]}),(0,H.jsxs)(`button`,{type:`button`,onClick:T,disabled:h,className:`min-h-[38px] px-2.5 py-1.5 rounded-lg border border-krona-border bg-krona-surface hover:bg-krona-hover text-krona-secondary transition-colors text-xs flex items-center gap-1.5`,title:`Сброс демонстрационных данных к начальным`,"data-testid":`reset-demo-button`,children:[(0,H.jsx)(hc,{className:`w-3.5 h-3.5 ${h?`animate-spin text-krona-gold`:``}`}),(0,H.jsx)(`span`,{className:`hidden xl:inline`,children:`Сбросить данные`})]}),(0,H.jsx)(Y,{})]})]}),(0,H.jsxs)(`header`,{className:`md:hidden h-14 border-b border-krona-border bg-krona-workspace/95 backdrop-blur-md px-3 flex items-center justify-between z-30 shrink-0 sticky top-0`,"data-testid":`mobile-header`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,H.jsx)(`button`,{type:`button`,onClick:()=>b(!0),className:`min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg border border-krona-border bg-krona-surface text-krona-primary hover:bg-krona-hover transition-colors`,"aria-label":`Открыть меню панели оператора`,"data-testid":`mobile-menu-button`,children:(0,H.jsx)(Vs,{className:`w-5 h-5`})}),(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5 min-w-0`,children:[(0,H.jsx)(`div`,{className:`w-7 h-7 rounded-md bg-krona-surface border border-krona-gold/40 flex items-center justify-center text-krona-gold font-extrabold text-xs shrink-0`,children:`K`}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`div`,{className:`text-xs font-bold text-krona-primary truncate leading-tight`,children:O}),(0,H.jsx)(`div`,{className:`text-[10px] text-krona-gold font-medium truncate`,children:`Control Center`})]})]})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:[E>0&&(0,H.jsxs)(`button`,{type:`button`,onClick:()=>n(`/control/incidents`),className:`min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg bg-status-danger-soft border border-status-danger-border text-status-danger-text text-xs font-bold`,"aria-label":`Критические события: ${E}`,title:`Есть критические события платформы`,"data-testid":`mobile-critical-indicator`,children:[(0,H.jsx)(Tc,{className:`w-4 h-4 animate-pulse mr-1`}),(0,H.jsx)(`span`,{children:E})]}),(0,H.jsxs)(`button`,{type:`button`,onClick:()=>b(!0),className:`min-w-[44px] min-h-[44px] px-2.5 flex items-center gap-1.5 rounded-lg border border-krona-gold/30 bg-krona-gold/10 text-krona-gold-text text-xs font-semibold`,"aria-label":`Профиль оператора: ${te}`,title:`Профиль оператора платформы`,"data-testid":`mobile-operator-profile-btn`,children:[(0,H.jsx)(Dc,{className:`w-4 h-4 text-krona-gold shrink-0`}),(0,H.jsx)(`span`,{className:`truncate max-w-[80px]`,children:te})]})]})]}),(0,H.jsxs)(`div`,{className:`flex-1 flex min-h-0 relative max-w-full`,children:[(0,H.jsxs)(`aside`,{className:`hidden md:flex flex-col border-r border-krona-border bg-krona-workspace transition-all duration-200 shrink-0 z-20 ${x?`w-16`:`w-56 lg:w-64`}`,"data-testid":`desktop-sidebar`,children:[(0,H.jsxs)(`div`,{className:`p-2 border-b border-krona-border flex items-center justify-between`,children:[(0,H.jsx)(`span`,{className:`text-[11px] font-semibold text-krona-tertiary uppercase tracking-wider px-2 ${x?`hidden`:`block`}`,children:`Навигация`}),(0,H.jsx)(`button`,{type:`button`,onClick:()=>S(!x),className:`p-1.5 rounded-md hover:bg-krona-hover text-krona-secondary hover:text-krona-primary transition-colors ml-auto`,title:x?`Развернуть меню`:`Свернуть меню`,children:x?(0,H.jsx)(V,{className:`w-4 h-4`}):(0,H.jsx)(Uo,{className:`w-4 h-4`})})]}),(0,H.jsx)(`nav`,{className:`flex-1 p-2 space-y-1 overflow-y-auto`,children:D.map(e=>{let t=e.icon;return(0,H.jsxs)(ua,{to:e.to,end:e.end,className:({isActive:e})=>`flex items-center min-h-[40px] px-3 py-2 rounded-lg text-xs font-medium transition-colors ${e?`bg-krona-gold/15 text-krona-gold font-bold border border-krona-gold/30`:`text-krona-secondary hover:bg-krona-hover hover:text-krona-primary`}`,title:e.label,"data-testid":`nav-${e.to.replace(`/control`,``).replace(`/`,``)||`overview`}`,children:[(0,H.jsx)(t,{className:`w-4 h-4 shrink-0`}),!x&&(0,H.jsx)(`span`,{className:`ml-2.5 truncate flex-1`,children:e.label}),!x&&e.badge&&e.badge>0&&(0,H.jsx)(`span`,{className:`ml-auto px-1.5 py-0.5 rounded-full text-[10px] font-mono font-bold bg-status-danger-soft text-status-danger-text border border-status-danger-border`,children:e.badge})]},e.to)})}),!x&&(0,H.jsxs)(`div`,{className:`p-3 border-t border-krona-border text-[11px] text-krona-tertiary font-mono space-y-1 bg-krona-surface/30`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsxs)(`span`,{children:[J.system.nodeLabel,`:`]}),(0,H.jsx)(`span`,{className:`font-semibold text-krona-secondary`,children:`srv-msk-prod-01`})]}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsxs)(`span`,{children:[J.scope,`:`]}),(0,H.jsx)(`span`,{className:`text-status-success-text`,children:`Боевой (Live)`})]}),(0,H.jsxs)(ua,{to:`/`,className:`mt-2 pt-2 border-t border-krona-border flex items-center gap-1.5 text-krona-gold hover:underline text-[11px]`,children:[(0,H.jsx)(ps,{className:`w-3.5 h-3.5`}),(0,H.jsx)(`span`,{children:J.system.exitToClient})]})]})]}),(0,H.jsx)(`main`,{className:`flex-1 min-w-0 max-w-full overflow-y-auto overflow-x-hidden p-3 sm:p-5 lg:p-6 pb-20 md:pb-6`,children:(0,H.jsxs)(`div`,{className:`max-w-7xl mx-auto w-full`,children:[_&&(0,H.jsxs)(`div`,{className:`mb-4 p-3.5 rounded-xl border border-status-success-border bg-status-success-soft text-status-success-text text-xs flex items-center gap-2 shadow-md animate-in fade-in`,role:`status`,children:[(0,H.jsx)(Zo,{className:`w-4 h-4 shrink-0`}),(0,H.jsx)(`span`,{children:`Демонстрационные данные успешно сброшены к эталонному состоянию.`})]}),(0,H.jsx)(od,{}),(0,H.jsx)(Ci,{})]})})]}),(0,H.jsxs)(`nav`,{className:`md:hidden fixed bottom-0 left-0 right-0 h-16 border-t border-krona-border bg-krona-workspace/95 backdrop-blur-md px-1 flex items-center justify-around z-40`,"data-testid":`mobile-bottom-bar`,"aria-label":`Основная мобильная навигация`,children:[ee.map(t=>{let n=t.icon,r=t.end?e.pathname===t.to:e.pathname.startsWith(t.to);return(0,H.jsxs)(ua,{to:t.to,end:t.end,className:`flex-1 min-h-[48px] min-w-[44px] flex flex-col items-center justify-center rounded-lg py-1 transition-colors relative ${r?`text-krona-gold font-bold`:`text-krona-secondary hover:text-krona-primary`}`,"data-testid":`bottom-nav-${t.to.replace(`/control`,``).replace(`/`,``)||`overview`}`,children:[(0,H.jsx)(n,{className:`w-5 h-5 ${r?`stroke-[2.5]`:``}`}),(0,H.jsx)(`span`,{className:`text-[10px] mt-0.5 leading-none truncate max-w-[64px]`,children:t.label}),t.badge&&t.badge>0&&(0,H.jsx)(`span`,{className:`absolute top-1 right-3 w-4 h-4 rounded-full bg-status-danger-text text-white text-[9px] font-bold flex items-center justify-center animate-pulse`,children:t.badge})]},t.to)}),(0,H.jsxs)(`button`,{type:`button`,onClick:()=>b(!0),className:`flex-1 min-h-[48px] min-w-[44px] flex flex-col items-center justify-center rounded-lg py-1 transition-colors ${y?`text-krona-gold font-bold`:`text-krona-secondary hover:text-krona-primary`}`,"aria-label":`Ещё разделы и настройки`,"data-testid":`bottom-nav-more`,children:[(0,H.jsx)(Nc,{className:`w-5 h-5`}),(0,H.jsx)(`span`,{className:`text-[10px] mt-0.5 leading-none`,children:`Ещё`})]})]}),y&&(0,H.jsx)(`div`,{className:`fixed inset-0 z-50 flex flex-col justify-end bg-black/60 backdrop-blur-xs md:hidden animate-in fade-in duration-200`,role:`dialog`,"aria-modal":`true`,"aria-label":`Меню оператора платформы`,onClick:()=>b(!1),children:(0,H.jsxs)(`div`,{className:`w-full max-h-[85vh] bg-krona-workspace border-t border-krona-border rounded-t-2xl flex flex-col overflow-hidden shadow-2xl animate-in slide-in-from-bottom duration-250`,onClick:e=>e.stopPropagation(),children:[(0,H.jsxs)(`div`,{className:`px-4 py-3 border-b border-krona-border flex items-center justify-between shrink-0 bg-krona-surface`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`div`,{className:`w-6 h-6 rounded-md bg-krona-gold/20 text-krona-gold font-bold flex items-center justify-center text-xs`,children:`K`}),(0,H.jsx)(`span`,{className:`font-bold text-sm text-krona-primary`,children:`Панель оператора`})]}),(0,H.jsx)(`button`,{type:`button`,onClick:()=>b(!1),className:`min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg text-krona-secondary hover:text-krona-primary hover:bg-krona-hover`,"aria-label":`Закрыть меню`,"data-testid":`close-mobile-drawer`,children:(0,H.jsx)(t,{className:`w-5 h-5`})})]}),(0,H.jsxs)(`div`,{className:`p-4 overflow-y-auto space-y-4`,children:[(0,H.jsxs)(`div`,{className:`p-3 rounded-xl bg-krona-surface border border-krona-border`,children:[(0,H.jsx)(`div`,{className:`text-[11px] font-semibold text-krona-tertiary uppercase tracking-wider mb-2`,children:`Сессия оператора`}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`div`,{className:`font-bold text-sm text-krona-primary`,children:u.name}),(0,H.jsx)(`div`,{className:`text-xs text-krona-gold font-medium`,children:Ju[l]?.label})]}),(0,H.jsx)(Y,{variant:`compact`})]})]}),(0,H.jsxs)(`div`,{className:`p-3 rounded-xl bg-krona-surface border border-krona-border`,children:[(0,H.jsx)(`div`,{className:`text-[11px] font-semibold text-krona-tertiary uppercase tracking-wider mb-2`,children:J.system.themeLabel}),(0,H.jsx)(`div`,{className:`grid grid-cols-3 gap-2`,children:[`soft-light`,`light`,`dark`].map(e=>(0,H.jsxs)(`button`,{type:`button`,onClick:()=>f(e),className:`min-h-[44px] px-2 py-2 rounded-lg text-xs font-semibold flex flex-col items-center justify-center transition-colors border ${d===e?`border-krona-gold bg-krona-gold/15 text-krona-gold shadow-xs`:`border-krona-border bg-krona-workspace text-krona-secondary hover:text-krona-primary`}`,"data-testid":`mobile-theme-${e}`,children:[e===`soft-light`&&(0,H.jsx)(zc,{className:`w-4 h-4 mb-0.5`}),e===`light`&&(0,H.jsx)(Uc,{className:`w-4 h-4 mb-0.5`}),e===`dark`&&(0,H.jsx)(Zs,{className:`w-4 h-4 mb-0.5`}),(0,H.jsx)(`span`,{className:`text-[10px] text-center leading-tight`,children:ed[e]})]},e))})]}),(0,H.jsxs)(`div`,{className:`p-3 rounded-xl bg-krona-surface border border-krona-border`,children:[(0,H.jsx)(`div`,{className:`text-[11px] font-semibold text-krona-tertiary uppercase tracking-wider mb-2`,children:`Все разделы`}),(0,H.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-1.5`,children:D.map(t=>{let n=t.icon,r=t.end?e.pathname===t.to:e.pathname.startsWith(t.to);return(0,H.jsxs)(ua,{to:t.to,end:t.end,className:`min-h-[44px] px-3 py-2.5 rounded-lg text-xs flex items-center justify-between border transition-colors ${r?`border-krona-gold/40 bg-krona-gold/15 text-krona-gold font-bold`:`border-transparent text-krona-secondary hover:text-krona-primary hover:bg-krona-hover`}`,"data-testid":`drawer-nav-${t.to.replace(`/control`,``).replace(`/`,``)||`overview`}`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2.5 min-w-0`,children:[(0,H.jsx)(n,{className:`w-4 h-4 shrink-0`}),(0,H.jsx)(`span`,{className:`truncate`,children:t.label})]}),t.badge&&t.badge>0&&(0,H.jsx)(`span`,{className:`px-2 py-0.5 rounded-full text-[10px] font-bold bg-status-danger-soft text-status-danger-text border border-status-danger-border`,children:t.badge})]},t.to)})})]}),(0,H.jsxs)(`div`,{className:`p-3 rounded-xl bg-krona-surface border border-krona-border space-y-2`,children:[(0,H.jsx)(`div`,{className:`text-[11px] font-semibold text-krona-tertiary uppercase tracking-wider`,children:`Сервисные действия`}),(0,H.jsxs)(`button`,{type:`button`,onClick:s,className:`w-full min-h-[44px] px-3 py-2 rounded-lg text-xs font-semibold flex items-center justify-between border transition-colors ${o?`border-status-danger-border bg-status-danger-soft text-status-danger-text`:`border-krona-border bg-krona-workspace text-krona-secondary hover:text-krona-primary`}`,"data-testid":`drawer-toggle-outage`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(lc,{className:`w-4 h-4`}),(0,H.jsx)(`span`,{children:`Сбой мониторинга (Circuit Breaker)`})]}),(0,H.jsx)(`span`,{className:`text-[11px] font-mono`,children:o?`ВКЛ`:`ВЫКЛ`})]}),(0,H.jsxs)(`button`,{type:`button`,onClick:T,disabled:h,className:`w-full min-h-[44px] px-3 py-2 rounded-lg text-xs font-medium border border-krona-border bg-krona-workspace text-krona-secondary hover:text-krona-primary flex items-center justify-center gap-2 transition-colors`,"data-testid":`drawer-reset-data`,children:[(0,H.jsx)(hc,{className:`w-4 h-4 ${h?`animate-spin text-krona-gold`:``}`}),(0,H.jsx)(`span`,{children:`Сбросить демоданные к эталону`})]}),(0,H.jsxs)(ua,{to:`/`,className:`w-full min-h-[44px] px-3 py-2 rounded-lg text-xs font-medium border border-krona-border bg-krona-workspace text-krona-gold hover:bg-krona-hover flex items-center justify-center gap-2 transition-colors`,children:[(0,H.jsx)(ps,{className:`w-4 h-4`}),(0,H.jsx)(`span`,{children:`Перейти в Krona Business OS`})]})]}),(0,H.jsx)(`div`,{className:`text-center text-[11px] text-krona-tertiary font-mono pt-1 pb-2`,children:`srv-msk-prod-01 • Данные синхронизированы (IndexedDB)`})]})]})}),(0,H.jsx)(rd,{}),(0,H.jsx)(ad,{})]})},pd=()=>(0,H.jsx)(`div`,{className:`min-h-screen bg-krona-app text-krona-primary flex items-center justify-center p-4 md:p-6 transition-colors duration-200`,children:(0,H.jsxs)(`div`,{className:`w-full max-w-md rounded-2xl border border-rose-500/40 bg-krona-surface p-6 md:p-8 text-center space-y-5 shadow-xl`,children:[(0,H.jsx)(`div`,{className:`w-16 h-16 rounded-2xl bg-rose-500/15 border border-rose-500/30 flex items-center justify-center text-rose-500 mx-auto`,children:(0,H.jsx)(Tc,{className:`w-8 h-8`})}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`span`,{className:`text-xs font-mono font-bold uppercase tracking-widest text-rose-500`,children:`HTTP 403 • Доступ ограничен`}),(0,H.jsx)(`h1`,{className:`text-xl md:text-2xl font-black text-krona-primary mt-1`,children:J.forbiddenTitle}),(0,H.jsx)(`p`,{className:`text-xs text-krona-secondary mt-2 leading-relaxed`,children:J.forbiddenDescription})]}),(0,H.jsx)(`div`,{className:`p-3.5 rounded-xl bg-krona-workspace border border-krona-border text-xs text-krona-secondary`,children:`Если вы оператор демонстрационного стенда, переключитесь на роль Владельца или Администратора в сессионном переключателе профиля.`}),(0,H.jsx)(`div`,{className:`flex flex-col gap-2 pt-2`,children:(0,H.jsxs)(ua,{to:`/control`,className:`w-full min-h-[44px] py-2.5 px-4 rounded-xl bg-amber-500 hover:bg-amber-400 text-zinc-950 text-xs font-bold flex items-center justify-center gap-2 transition-colors shadow-xs`,children:[(0,H.jsx)(_o,{className:`w-4 h-4`}),(0,H.jsx)(`span`,{children:J.forbiddenBack})]})})]})}),md=[`platform_owner`,`platform_admin`,`support_operator`,`billing_manager`,`security_auditor`,`release_manager`],hd=R([{path:`/control/gate`,element:(0,H.jsx)(()=>{let e=Br(),t=W(e=>e.setAccessGatePassed),[n,r]=(0,A.useState)(``),[i,a]=(0,A.useState)(!1),o=ud(e=>e.themeMode),s=ud(e=>e.setTheme),c=[{id:`soft-light`,label:ed[`soft-light`],icon:(0,H.jsx)(zc,{className:`w-3.5 h-3.5`})},{id:`light`,label:ed.light,icon:(0,H.jsx)(Uc,{className:`w-3.5 h-3.5`})},{id:`dark`,label:ed.dark,icon:(0,H.jsx)(Zs,{className:`w-3.5 h-3.5`})}];return(0,H.jsxs)(`div`,{className:`min-h-screen bg-krona-app text-krona-primary flex flex-col items-center justify-center p-4 md:p-6 transition-colors duration-200`,children:[(0,H.jsx)(`div`,{className:`absolute top-4 right-4 flex items-center gap-1 p-1 rounded-xl bg-krona-surface border border-krona-border shadow-xs`,children:c.map(e=>(0,H.jsxs)(`button`,{type:`button`,onClick:()=>s(e.id),title:e.label,className:`min-w-[40px] min-h-[40px] px-2.5 py-1 rounded-lg text-xs font-medium flex items-center gap-1.5 transition-colors ${o===e.id?`bg-amber-500 text-zinc-950 font-bold shadow-xs`:`text-krona-secondary hover:text-krona-primary hover:bg-krona-workspace`}`,children:[e.icon,(0,H.jsx)(`span`,{className:`hidden sm:inline`,children:e.label})]},e.id))}),(0,H.jsxs)(`div`,{className:`w-full max-w-md rounded-2xl border border-krona-border bg-krona-surface p-6 md:p-8 text-center space-y-6 shadow-xl`,children:[(0,H.jsx)(`div`,{className:`w-16 h-16 rounded-2xl bg-amber-500/15 border border-amber-500/30 flex items-center justify-center text-amber-500 mx-auto`,children:(0,H.jsx)(Fs,{className:`w-8 h-8`})}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-xs font-mono font-bold uppercase tracking-widest text-amber-500`,children:J.brand}),(0,H.jsx)(`h1`,{className:`text-xl md:text-2xl font-black text-krona-primary mt-1`,children:J.gateTitle}),(0,H.jsx)(`p`,{className:`text-xs text-krona-secondary mt-2`,children:J.gateSubtitle})]}),(0,H.jsxs)(`form`,{onSubmit:r=>{r.preventDefault(),n===`krona2026`||n===`kcc`||n===`admin`||n===`8492`?(t(!0),e(`/control`)):a(!0)},className:`space-y-4`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`input`,{type:`password`,value:n,"data-testid":`pin-input`,onChange:e=>{r(e.target.value),i&&a(!1)},placeholder:J.gatePinPlaceholder,className:`w-full bg-krona-workspace border border-krona-border rounded-xl px-4 py-3 text-center text-sm text-krona-primary placeholder:text-krona-secondary/60 focus:outline-hidden focus:border-amber-500 tracking-wider font-mono min-h-[48px]`}),i&&(0,H.jsx)(`p`,{className:`text-xs text-rose-500 font-medium mt-1.5`,"data-testid":`pin-error`,children:J.gateError})]}),(0,H.jsxs)(`button`,{type:`submit`,"data-testid":`pin-submit`,className:`w-full min-h-[48px] py-3 px-4 rounded-xl bg-amber-500 hover:bg-amber-400 text-zinc-950 font-bold text-xs flex items-center justify-center gap-2 transition-colors shadow-xs`,children:[(0,H.jsx)(`span`,{children:J.gateSubmit}),(0,H.jsx)(yo,{className:`w-4 h-4`})]})]}),(0,H.jsx)(`div`,{className:`pt-2 border-t border-krona-border`,children:(0,H.jsx)(`button`,{type:`button`,"data-testid":`pin-demo-login`,onClick:()=>{t(!0),e(`/control`)},className:`min-h-[44px] inline-flex items-center text-xs text-krona-secondary hover:text-amber-500 transition-colors underline underline-offset-4`,children:J.gateDemoLogin})})]})]})},{})},{path:`/control/403`,element:(0,H.jsx)(pd,{})},{path:`/control`,element:(0,H.jsx)(({children:e})=>{let t=W(e=>e.activeRole);return W(e=>e.isAccessGatePassed)?md.includes(t)?(0,H.jsx)(H.Fragment,{children:e}):(0,H.jsx)(pd,{}):(0,H.jsx)(Si,{to:`/control/gate`,replace:!0})},{children:(0,H.jsx)(fd,{})}),errorElement:(0,H.jsx)(`div`,{className:`p-8 bg-[#07130e] text-zinc-100 min-h-screen`,children:(0,H.jsx)(El,{scope:`Krona Control Center`,children:(0,H.jsx)(pd,{})})}),children:[{index:!0,element:(0,H.jsx)(()=>{let e=Br(),{role:t,operator:n}=qu(),r=W(e=>e.organizations),i=W(e=>e.subscriptions),a=W(e=>e.installations),o=W(e=>e.instances),s=W(e=>e.servers),c=W(e=>e.incidents),l=W(e=>e.openInspector),u=W(e=>e.serverMonitorOutage),d=r.length,f=r.filter(e=>e.platformStatus===`active`).length,p=r.filter(e=>e.platformStatus===`trial`).length,m=r.filter(e=>e.platformStatus===`grace`).length,h=r.filter(e=>e.platformStatus===`suspended`).length,g=r.reduce((e,t)=>e+t.userCount,0),_=r.reduce((e,t)=>e+t.branchCount,0),v=r.reduce((e,t)=>e+t.mrrMinorUnits,0),y=i.filter(e=>e.status===`expiring_7d`),b=i.filter(e=>e.status===`overdue`),x=a.filter(e=>e.kind===`web`).length,S=a.filter(e=>e.kind===`desktop`).length,C=a.filter(e=>e.kind===`android`).length,w=a.filter(e=>e.kind===`android`&&e.status===`outdated`).length,T=o.filter(e=>e.health===`offline`),E=o.filter(e=>e.health===`degraded`),ee=s.filter(e=>e.status===`healthy`).length,D=s.filter(e=>e.status!==`healthy`),O=c.filter(e=>e.status!==`resolved`),te=(0,A.useMemo)(()=>{let e=O.length;return e+=D.length,e+=T.length,e+=E.length,e+=y.length,e+=b.length,u&&(e+=1),e},[O,D,T,E,y,b,u]),[k,ne]=(0,A.useState)(()=>te>0?`attention`:`metrics`);return(0,H.jsxs)(`div`,{className:`space-y-4 sm:space-y-6`,"data-testid":`overview-page`,children:[(0,H.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2.5 border-b border-krona-border pb-4`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`h1`,{className:`text-lg sm:text-xl font-bold text-krona-primary flex items-center gap-2 flex-wrap`,children:[(0,H.jsx)(`span`,{children:`Сводная операторская панель`}),(0,H.jsx)(`span`,{className:`text-[11px] px-2.5 py-0.5 rounded-full bg-status-success-soft text-status-success-text border border-status-success-border font-medium`,children:`Контур платформы`})]}),(0,H.jsx)(`p`,{className:`text-xs text-krona-secondary mt-0.5`,children:`Оперативный контроль организаций, лицензий, модульных инстансов и серверных узлов Krona`})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,H.jsx)(`span`,{className:`text-krona-tertiary`,children:`Оператор:`}),(0,H.jsxs)(`span`,{className:`font-semibold text-krona-gold bg-krona-gold/10 px-2.5 py-1 rounded-md border border-krona-gold/20`,children:[n.name,` (`,Ju[t]?.shortLabel||t,`)`]})]})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5 p-1 bg-krona-surface border border-krona-border rounded-xl max-w-full overflow-x-auto`,children:[(0,H.jsxs)(`button`,{type:`button`,onClick:()=>ne(`attention`),className:`flex-1 min-h-[44px] min-w-[120px] px-3 py-2 rounded-lg text-xs font-semibold flex items-center justify-center gap-2 transition-colors ${k===`attention`?`bg-krona-workspace text-krona-primary shadow-xs border border-krona-border font-bold`:`text-krona-secondary hover:text-krona-primary hover:bg-krona-hover`}`,"data-testid":`tab-attention`,children:[(0,H.jsx)(Tc,{className:`w-4 h-4 shrink-0 ${te>0?`text-status-danger-text`:`text-status-success-text`}`}),(0,H.jsx)(`span`,{children:`Требует внимания`}),te>0&&(0,H.jsx)(`span`,{className:`px-1.5 py-0.2 rounded-full text-[10px] font-mono font-bold bg-status-danger-soft text-status-danger-text border border-status-danger-border`,children:te})]}),(0,H.jsxs)(`button`,{type:`button`,onClick:()=>ne(`metrics`),className:`flex-1 min-h-[44px] min-w-[110px] px-3 py-2 rounded-lg text-xs font-semibold flex items-center justify-center gap-2 transition-colors ${k===`metrics`?`bg-krona-workspace text-krona-primary shadow-xs border border-krona-border font-bold`:`text-krona-secondary hover:text-krona-primary hover:bg-krona-hover`}`,"data-testid":`tab-metrics`,children:[(0,H.jsx)(ho,{className:`w-4 h-4 shrink-0 text-krona-gold`}),(0,H.jsx)(`span`,{children:`Показатели`})]}),(0,H.jsxs)(`button`,{type:`button`,onClick:()=>ne(`infrastructure`),className:`flex-1 min-h-[44px] min-w-[120px] px-3 py-2 rounded-lg text-xs font-semibold flex items-center justify-center gap-2 transition-colors ${k===`infrastructure`?`bg-krona-workspace text-krona-primary shadow-xs border border-krona-border font-bold`:`text-krona-secondary hover:text-krona-primary hover:bg-krona-hover`}`,"data-testid":`tab-infrastructure`,children:[(0,H.jsx)(xc,{className:`w-4 h-4 shrink-0 text-krona-gold`}),(0,H.jsx)(`span`,{children:`Инфраструктура`})]})]}),k===`attention`&&(0,H.jsxs)(`div`,{className:`space-y-4 animate-in fade-in duration-150`,"data-testid":`attention-section`,children:[te===0&&(0,H.jsxs)(`div`,{className:`p-6 rounded-xl border border-status-success-border bg-status-success-soft text-status-success-text text-center space-y-2`,children:[(0,H.jsx)(Zo,{className:`w-10 h-10 mx-auto text-status-success-text`}),(0,H.jsx)(`div`,{className:`font-bold text-base`,children:`Все системы работают в штатном режиме`}),(0,H.jsx)(`p`,{className:`text-xs opacity-90 max-w-md mx-auto`,children:`Нет открытых аварий, серверов с деградацией или просроченных подписок, требующих вмешательства оператора.`})]}),O.length>0&&(0,H.jsxs)(`div`,{className:`rounded-xl border border-krona-border bg-krona-surface p-4 space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(Tc,{className:`w-4 h-4 text-status-danger-text`}),(0,H.jsxs)(`span`,{className:`font-bold text-sm text-krona-primary`,children:[`Открытые инциденты (`,O.length,`)`]})]}),(0,H.jsxs)(`button`,{type:`button`,onClick:()=>e(`/control/incidents`),className:`min-h-[44px] px-3 text-xs text-krona-gold hover:underline flex items-center gap-1 font-medium`,children:[(0,H.jsx)(`span`,{children:`Все инциденты`}),(0,H.jsx)(xo,{className:`w-3.5 h-3.5`})]})]}),(0,H.jsx)(`div`,{className:`space-y-2`,children:O.map(e=>(0,H.jsxs)(`div`,{onClick:()=>l(`incident`,e.incidentId),className:`p-3.5 rounded-lg border border-status-danger-border bg-status-danger-soft cursor-pointer hover:opacity-95 transition-opacity space-y-1.5`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-2 flex-wrap`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`text-[10px] font-mono font-bold bg-status-danger-text text-white px-2 py-0.5 rounded-sm`,children:Yu[e.severity]?.short||e.severity}),(0,H.jsx)(`span`,{className:`font-bold text-xs text-status-danger-text`,children:e.summary})]}),(0,H.jsx)(`span`,{className:`text-[11px] font-medium text-status-danger-text`,children:Xu[e.status]||e.status})]}),(0,H.jsx)(`p`,{className:`text-xs text-krona-secondary line-clamp-2`,children:e.description}),(0,H.jsxs)(`div`,{className:`text-[11px] text-krona-tertiary`,children:[`Затронуто: `,e.affectedTenantIds.length,` орг. • Узлов: `,e.affectedServerIds.length]})]},e.incidentId))})]}),D.length>0&&(0,H.jsxs)(`div`,{className:`rounded-xl border border-krona-border bg-krona-surface p-4 space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(xc,{className:`w-4 h-4 text-status-warning-text`}),(0,H.jsxs)(`span`,{className:`font-bold text-sm text-krona-primary`,children:[`Серверы с предупреждениями (`,D.length,`)`]})]}),(0,H.jsxs)(`button`,{type:`button`,onClick:()=>e(`/control/infrastructure`),className:`min-h-[44px] px-3 text-xs text-krona-gold hover:underline flex items-center gap-1 font-medium`,children:[(0,H.jsx)(`span`,{children:`Инфраструктура`}),(0,H.jsx)(xo,{className:`w-3.5 h-3.5`})]})]}),(0,H.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-3`,children:D.map(e=>{let t=e.cpuLoadPercent,n=Math.round(e.ramUsedBytes/(e.ramTotalBytes||1)*100),r=Math.round(e.diskUsedBytes/(e.diskTotalBytes||1)*100);return(0,H.jsxs)(`div`,{onClick:()=>l(`server`,e.serverId),className:`p-3.5 rounded-lg border border-krona-border bg-krona-workspace cursor-pointer hover:border-krona-gold/40 transition-colors space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsx)(`div`,{className:`font-bold text-xs text-krona-primary font-mono`,children:e.hostname}),(0,H.jsx)(X,{status:e.status,size:`sm`})]}),(0,H.jsxs)(`div`,{className:`grid grid-cols-3 gap-1 text-[11px] text-krona-secondary font-mono`,children:[(0,H.jsxs)(`div`,{children:[`CPU: `,(0,H.jsxs)(`span`,{className:t>80?`text-status-danger-text font-bold`:``,children:[t,`%`]})]}),(0,H.jsxs)(`div`,{children:[`RAM: `,(0,H.jsxs)(`span`,{className:n>80?`text-status-danger-text font-bold`:``,children:[n,`%`]})]}),(0,H.jsxs)(`div`,{children:[`Диск: `,(0,H.jsxs)(`span`,{className:r>85?`text-status-danger-text font-bold`:``,children:[r,`%`]})]})]}),(0,H.jsxs)(`div`,{className:`text-[11px] text-krona-tertiary`,children:[`Провайдер: `,e.hostingProvider,` (`,e.region,`)`]})]},e.serverId)})})]}),(T.length>0||E.length>0)&&(0,H.jsxs)(`div`,{className:`rounded-xl border border-krona-border bg-krona-surface p-4 space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(js,{className:`w-4 h-4 text-status-warning-text`}),(0,H.jsxs)(`span`,{className:`font-bold text-sm text-krona-primary`,children:[`Модули с деградацией (`,T.length+E.length,`)`]})]}),(0,H.jsxs)(`button`,{type:`button`,onClick:()=>e(`/control/modules`),className:`min-h-[44px] px-3 text-xs text-krona-gold hover:underline flex items-center gap-1 font-medium`,children:[(0,H.jsx)(`span`,{children:`Каталог`}),(0,H.jsx)(xo,{className:`w-3.5 h-3.5`})]})]}),(0,H.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-2.5`,children:[...T,...E].map(e=>(0,H.jsxs)(`div`,{onClick:()=>l(`organization`,e.tenantId),className:`p-3 rounded-lg border border-krona-border bg-krona-workspace cursor-pointer hover:border-krona-gold/40 transition-colors flex items-center justify-between`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`div`,{className:`font-bold text-xs text-krona-primary`,children:[e.moduleName,` v`,e.currentVersion]}),(0,H.jsxs)(`div`,{className:`text-[11px] text-krona-tertiary`,children:[`Тенант: `,e.tenantName]})]}),(0,H.jsx)(X,{status:e.health,size:`sm`})]},e.moduleInstanceId))})]}),(y.length>0||b.length>0)&&(0,H.jsxs)(`div`,{className:`rounded-xl border border-krona-border bg-krona-surface p-4 space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(ls,{className:`w-4 h-4 text-status-warning-text`}),(0,H.jsxs)(`span`,{className:`font-bold text-sm text-krona-primary`,children:[`Истекающие подписки (`,y.length+b.length,`)`]})]}),(0,H.jsxs)(`button`,{type:`button`,onClick:()=>e(`/control/billing`),className:`min-h-[44px] px-3 text-xs text-krona-gold hover:underline flex items-center gap-1 font-medium`,children:[(0,H.jsx)(`span`,{children:`Биллинг`}),(0,H.jsx)(xo,{className:`w-3.5 h-3.5`})]})]}),(0,H.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-2.5`,children:[...b,...y].map(e=>(0,H.jsxs)(`div`,{onClick:()=>l(`organization`,e.tenantId),className:`p-3 rounded-lg border border-krona-border bg-krona-workspace cursor-pointer hover:border-krona-gold/40 transition-colors flex items-center justify-between`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`font-bold text-xs text-krona-primary`,children:e.tenantName}),(0,H.jsxs)(`div`,{className:`text-[11px] text-krona-tertiary`,children:[`Тариф: `,e.planCode,` • До: `,new Date(e.validUntil).toLocaleDateString(`ru-RU`)]})]}),(0,H.jsxs)(`div`,{className:`text-right`,children:[(0,H.jsx)(td,{minorUnits:e.amountMinorUnits,currency:e.currency,className:`font-bold text-xs text-krona-primary`}),(0,H.jsx)(`div`,{className:`mt-1`,children:(0,H.jsx)(X,{status:e.status,size:`sm`})})]})]},e.subscriptionId))})]})]}),k===`metrics`&&(0,H.jsxs)(`div`,{className:`space-y-4 animate-in fade-in duration-150`,"data-testid":`metrics-section`,children:[(0,H.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-3 xl:grid-cols-6 gap-2.5 sm:gap-3`,children:[(0,H.jsxs)(`div`,{onClick:()=>e(`/control/organizations`),className:`p-3.5 rounded-xl border border-krona-border bg-krona-surface hover:border-krona-gold/40 cursor-pointer transition-colors`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between text-krona-tertiary mb-1`,children:[(0,H.jsx)(`span`,{className:`text-[11px] font-medium`,children:`Организации`}),(0,H.jsx)(jo,{className:`w-4 h-4 text-krona-gold`})]}),(0,H.jsx)(`div`,{className:`text-lg sm:text-xl font-bold text-krona-primary`,children:d}),(0,H.jsxs)(`div`,{className:`text-[11px] text-status-success-text mt-0.5`,children:[f,` активных`]})]}),(0,H.jsxs)(`div`,{className:`p-3.5 rounded-xl border border-krona-border bg-krona-surface`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between text-krona-tertiary mb-1`,children:[(0,H.jsx)(`span`,{className:`text-[11px] font-medium`,children:`Пользователи`}),(0,H.jsx)(al,{className:`w-4 h-4 text-krona-gold`})]}),(0,H.jsx)(`div`,{className:`text-lg sm:text-xl font-bold text-krona-primary`,children:g}),(0,H.jsxs)(`div`,{className:`text-[11px] text-krona-secondary mt-0.5`,children:[_,` филиалов`]})]}),(0,H.jsxs)(`div`,{onClick:()=>e(`/control/billing`),className:`p-3.5 rounded-xl border border-krona-border bg-krona-surface hover:border-krona-gold/40 cursor-pointer transition-colors col-span-2 sm:col-span-1`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between text-krona-tertiary mb-1`,children:[(0,H.jsx)(`span`,{className:`text-[11px] font-medium`,children:`Выручка (MRR)`}),(0,H.jsx)(ls,{className:`w-4 h-4 text-krona-gold`})]}),(0,H.jsx)(td,{minorUnits:v,currency:`RUB`,className:`text-lg sm:text-xl font-bold text-krona-gold`}),(0,H.jsx)(`div`,{className:`text-[11px] text-krona-secondary mt-0.5`,children:`В месяц`})]}),(0,H.jsxs)(`div`,{onClick:()=>e(`/control/billing`),className:`p-3.5 rounded-xl border border-krona-border bg-krona-surface hover:border-krona-gold/40 cursor-pointer transition-colors`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between text-krona-tertiary mb-1`,children:[(0,H.jsx)(`span`,{className:`text-[11px] font-medium`,children:`Подписки`}),(0,H.jsx)(rs,{className:`w-4 h-4 text-krona-gold`})]}),(0,H.jsx)(`div`,{className:`text-lg sm:text-xl font-bold text-krona-primary`,children:i.length}),(0,H.jsxs)(`div`,{className:`text-[11px] text-krona-secondary mt-0.5`,children:[y.length,` истекают`]})]}),(0,H.jsxs)(`div`,{onClick:()=>e(`/control/installations`),className:`p-3.5 rounded-xl border border-krona-border bg-krona-surface hover:border-krona-gold/40 cursor-pointer transition-colors`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between text-krona-tertiary mb-1`,children:[(0,H.jsx)(`span`,{className:`text-[11px] font-medium`,children:`Установки`}),(0,H.jsx)(Lc,{className:`w-4 h-4 text-krona-gold`})]}),(0,H.jsx)(`div`,{className:`text-lg sm:text-xl font-bold text-krona-primary`,children:a.length}),(0,H.jsxs)(`div`,{className:`text-[11px] text-krona-secondary mt-0.5`,children:[`Android: `,C]})]}),(0,H.jsxs)(`div`,{onClick:()=>e(`/control/infrastructure`),className:`p-3.5 rounded-xl border border-krona-border bg-krona-surface hover:border-krona-gold/40 cursor-pointer transition-colors`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between text-krona-tertiary mb-1`,children:[(0,H.jsx)(`span`,{className:`text-[11px] font-medium`,children:`Серверы`}),(0,H.jsx)(xc,{className:`w-4 h-4 text-krona-gold`})]}),(0,H.jsx)(`div`,{className:`text-lg sm:text-xl font-bold text-krona-primary`,children:s.length}),(0,H.jsxs)(`div`,{className:`text-[11px] text-status-success-text mt-0.5`,children:[ee,` в норме`]})]})]}),(0,H.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4`,children:[(0,H.jsxs)(`div`,{className:`rounded-xl border border-krona-border bg-krona-surface p-4 space-y-3`,children:[(0,H.jsxs)(`div`,{className:`font-bold text-sm text-krona-primary flex items-center justify-between`,children:[(0,H.jsx)(`span`,{children:`Статус организаций`}),(0,H.jsxs)(`span`,{className:`text-xs text-krona-secondary font-normal`,children:[`Всего: `,d]})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between text-xs`,children:[(0,H.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`w-2.5 h-2.5 rounded-full bg-status-success-text`}),(0,H.jsx)(`span`,{className:`text-krona-secondary`,children:`Активные организации`})]}),(0,H.jsx)(`span`,{className:`font-bold text-krona-primary`,children:f})]}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between text-xs`,children:[(0,H.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`w-2.5 h-2.5 rounded-full bg-status-info-text`}),(0,H.jsx)(`span`,{className:`text-krona-secondary`,children:`Пробный период (Trial)`})]}),(0,H.jsx)(`span`,{className:`font-bold text-krona-primary`,children:p})]}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between text-xs`,children:[(0,H.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`w-2.5 h-2.5 rounded-full bg-status-warning-text`}),(0,H.jsx)(`span`,{className:`text-krona-secondary`,children:`Льготный период (Grace)`})]}),(0,H.jsx)(`span`,{className:`font-bold text-krona-primary`,children:m})]}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between text-xs`,children:[(0,H.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`w-2.5 h-2.5 rounded-full bg-status-danger-text`}),(0,H.jsx)(`span`,{className:`text-krona-secondary`,children:`Приостановлены (Suspended)`})]}),(0,H.jsx)(`span`,{className:`font-bold text-krona-primary`,children:h})]})]})]}),(0,H.jsxs)(`div`,{className:`rounded-xl border border-krona-border bg-krona-surface p-4 space-y-3`,children:[(0,H.jsxs)(`div`,{className:`font-bold text-sm text-krona-primary flex items-center justify-between`,children:[(0,H.jsx)(`span`,{children:`Платформы клиентов`}),(0,H.jsxs)(`span`,{className:`text-xs text-krona-secondary font-normal`,children:[`Всего: `,a.length]})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between text-xs`,children:[(0,H.jsx)(`span`,{className:`text-krona-secondary`,children:`Веб-приложения (Web SPA)`}),(0,H.jsx)(`span`,{className:`font-bold text-krona-primary`,children:x})]}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between text-xs`,children:[(0,H.jsx)(`span`,{className:`text-krona-secondary`,children:`Рабочие станции (Desktop)`}),(0,H.jsx)(`span`,{className:`font-bold text-krona-primary`,children:S})]}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between text-xs`,children:[(0,H.jsx)(`span`,{className:`text-krona-secondary`,children:`Мобильные кассы (Android)`}),(0,H.jsx)(`span`,{className:`font-bold text-krona-primary`,children:C})]}),w>0&&(0,H.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-status-warning-text font-medium pt-1 border-t border-krona-border`,children:[(0,H.jsx)(`span`,{children:`Устаревшие версии Android:`}),(0,H.jsx)(`span`,{className:`font-bold`,children:w})]})]})]})]})]}),k===`infrastructure`&&(0,H.jsx)(`div`,{className:`space-y-4 animate-in fade-in duration-150`,"data-testid":`infrastructure-section`,children:(0,H.jsxs)(`div`,{className:`rounded-xl border border-krona-border bg-krona-surface p-4 space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`h3`,{className:`font-bold text-sm text-krona-primary`,children:`Инфраструктурные серверы Krona`}),(0,H.jsx)(`p`,{className:`text-xs text-krona-secondary`,children:`Текущая загрузка вычислительных узлов платформы`})]}),(0,H.jsxs)(`button`,{type:`button`,onClick:()=>e(`/control/infrastructure`),className:`min-h-[44px] px-3 text-xs text-krona-gold hover:underline flex items-center gap-1 font-medium`,children:[(0,H.jsx)(`span`,{children:`Управление`}),(0,H.jsx)(xo,{className:`w-3.5 h-3.5`})]})]}),(0,H.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3`,children:s.map(e=>{let t=e.cpuLoadPercent,n=Math.round(e.ramUsedBytes/(e.ramTotalBytes||1)*100),r=Math.round(e.diskUsedBytes/(e.diskTotalBytes||1)*100);return(0,H.jsxs)(`div`,{onClick:()=>l(`server`,e.serverId),className:`p-3.5 rounded-lg border border-krona-border bg-krona-workspace cursor-pointer hover:border-krona-gold/40 transition-colors space-y-2.5`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`font-bold text-xs text-krona-primary font-mono`,children:e.hostname}),(0,H.jsxs)(`div`,{className:`text-[11px] text-krona-tertiary`,children:[e.hostingProvider,` (`,e.region,`)`]})]}),(0,H.jsx)(X,{status:e.status,size:`sm`})]}),(0,H.jsxs)(`div`,{className:`grid grid-cols-3 gap-2 text-center text-xs py-1 bg-krona-surface/40 rounded-md border border-krona-border`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-[10px] text-krona-tertiary`,children:`CPU`}),(0,H.jsxs)(`div`,{className:`font-mono font-bold ${t>80?`text-status-danger-text`:`text-krona-primary`}`,children:[t,`%`]})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-[10px] text-krona-tertiary`,children:`RAM`}),(0,H.jsxs)(`div`,{className:`font-mono font-bold ${n>80?`text-status-danger-text`:`text-krona-primary`}`,children:[n,`%`]})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-[10px] text-krona-tertiary`,children:`Диск`}),(0,H.jsxs)(`div`,{className:`font-mono font-bold ${r>85?`text-status-danger-text`:`text-krona-primary`}`,children:[r,`%`]})]})]}),(0,H.jsxs)(`div`,{className:`text-[11px] text-krona-tertiary flex items-center justify-between`,children:[(0,H.jsx)(`span`,{children:`Резервная копия:`}),(0,H.jsx)(`span`,{className:e.backup.state===`failed`?`text-status-danger-text font-bold`:`text-status-success-text`,children:e.backup.state===`ok`?`Успешно`:e.backup.state===`failed`?`Ошибка`:e.backup.state})]}),(0,H.jsx)(`div`,{className:`pt-1`,children:(0,H.jsx)(nd,{status:e.status,count:24})})]},e.serverId)})})]})})]})},{})},{path:`organizations`,element:(0,H.jsx)(()=>{let e=W(e=>e.organizations),t=W(e=>e.openInspector),[n,r]=(0,A.useState)(``),[i,a]=(0,A.useState)(`all`),o=e.filter(e=>{let t=!n||e.displayName.toLowerCase().includes(n.toLowerCase())||e.inn.includes(n)||e.domain.toLowerCase().includes(n.toLowerCase()),r=i===`all`||e.platformStatus===i;return t&&r});return(0,H.jsxs)(`div`,{className:`space-y-4 sm:space-y-6`,"data-testid":`organizations-page`,children:[(0,H.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2.5 border-b border-krona-border pb-4`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`h1`,{className:`text-lg sm:text-xl font-bold text-krona-primary flex items-center gap-2`,children:[(0,H.jsx)(jo,{className:`w-5 h-5 text-krona-gold`}),(0,H.jsx)(`span`,{children:`Организации платформы`})]}),(0,H.jsx)(`p`,{className:`text-xs text-krona-secondary mt-0.5`,children:`Реестр организаций, управление статусами, тарифами и 360°-анализ тенантов`})]}),(0,H.jsxs)(`div`,{className:`text-xs text-krona-secondary`,children:[`Всего: `,(0,H.jsx)(`span`,{className:`font-bold text-krona-primary`,children:e.length}),` (найдено:`,` `,(0,H.jsx)(`span`,{className:`font-bold text-krona-gold`,children:o.length}),`)`]})]}),(0,H.jsxs)(`div`,{className:`flex flex-col md:flex-row gap-3 items-stretch md:items-center justify-between`,children:[(0,H.jsxs)(`div`,{className:`relative flex-1 max-w-md`,children:[(0,H.jsx)(_c,{className:`w-4 h-4 text-krona-tertiary absolute left-3 top-1/2 -translate-y-1/2`}),(0,H.jsx)(`input`,{type:`text`,value:n,onChange:e=>r(e.target.value),placeholder:`Поиск по названию, ИНН или домену...`,className:`w-full bg-krona-surface border border-krona-border rounded-lg pl-9 pr-3 py-2.5 min-h-[44px] text-xs text-krona-primary placeholder-krona-tertiary focus:outline-hidden focus:border-krona-gold transition-colors`})]}),(0,H.jsx)(`div`,{className:`flex items-center gap-1.5 overflow-x-auto pb-1 text-xs`,children:[{id:`all`,label:`Все`},{id:`active`,label:`Активные`},{id:`trial`,label:`Пробные`},{id:`grace`,label:`Льготные`},{id:`suspended`,label:`Приостановленные`}].map(e=>(0,H.jsx)(`button`,{type:`button`,onClick:()=>a(e.id),className:`min-h-[44px] px-3.5 py-2 rounded-lg font-medium transition-colors shrink-0 ${i===e.id?`bg-krona-gold/15 text-krona-gold border border-krona-gold/30 font-bold`:`bg-krona-surface text-krona-secondary border border-krona-border hover:text-krona-primary hover:bg-krona-hover`}`,children:e.label},e.id))})]}),(0,H.jsxs)(`div`,{className:`lg:hidden space-y-3`,"data-testid":`orgs-mobile-cards`,children:[o.map(e=>(0,H.jsxs)(`div`,{onClick:()=>t(`organization`,e.tenantId),className:`rounded-xl border border-krona-border bg-krona-surface p-4 space-y-3 shadow-sm hover:border-krona-gold/40 transition-colors cursor-pointer`,children:[(0,H.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`h3`,{className:`font-bold text-sm text-krona-primary truncate`,children:e.displayName}),(0,H.jsxs)(`div`,{className:`text-[11px] text-krona-tertiary font-mono mt-0.5`,children:[`ИНН `,e.inn,` • `,e.domain]})]}),(0,H.jsx)(X,{status:e.platformStatus,size:`sm`})]}),(0,H.jsxs)(`div`,{className:`grid grid-cols-3 gap-2 py-2 border-y border-krona-border text-center text-xs`,children:[(0,H.jsxs)(`div`,{className:`p-1 rounded-md bg-krona-workspace/50`,children:[(0,H.jsx)(`div`,{className:`text-[10px] text-krona-tertiary`,children:`Пользователи`}),(0,H.jsxs)(`div`,{className:`font-bold text-krona-primary`,children:[e.userCount,` `,(0,H.jsxs)(`span`,{className:`text-[10px] font-normal text-krona-tertiary`,children:[`/ `,e.branchCount,` т.`]})]})]}),(0,H.jsxs)(`div`,{className:`p-1 rounded-md bg-krona-workspace/50`,children:[(0,H.jsx)(`div`,{className:`text-[10px] text-krona-tertiary`,children:`Модули`}),(0,H.jsx)(`div`,{className:`font-bold text-krona-primary`,children:e.installedModulesCount})]}),(0,H.jsxs)(`div`,{className:`p-1 rounded-md bg-krona-workspace/50`,children:[(0,H.jsx)(`div`,{className:`text-[10px] text-krona-tertiary`,children:`MRR`}),(0,H.jsx)(td,{minorUnits:e.mrrMinorUnits,className:`font-bold text-krona-gold text-xs`})]})]}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between pt-1`,children:[(0,H.jsxs)(`div`,{className:`text-xs text-krona-secondary`,children:[`Тариф: `,(0,H.jsx)(`span`,{className:`font-semibold text-krona-primary`,children:e.tariffPlan})]}),(0,H.jsxs)(`button`,{type:`button`,onClick:n=>{n.stopPropagation(),t(`organization`,e.tenantId)},className:`min-h-[44px] min-w-[44px] px-3 flex items-center gap-1 text-xs font-semibold text-krona-gold bg-krona-gold/10 hover:bg-krona-gold/20 rounded-lg border border-krona-gold/30 transition-colors`,"data-testid":`inspect-org-${e.tenantId}`,children:[(0,H.jsx)(`span`,{children:`360° Карточка`}),(0,H.jsx)(V,{className:`w-4 h-4`})]})]})]},e.tenantId)),o.length===0&&(0,H.jsx)(`div`,{className:`p-8 text-center text-krona-tertiary rounded-xl border border-krona-border bg-krona-surface text-xs`,children:`Организации не найдены по заданным критериям фильтрации`})]}),(0,H.jsx)(`div`,{className:`hidden lg:block rounded-xl border border-krona-border bg-krona-surface overflow-hidden shadow-sm`,children:(0,H.jsx)(`div`,{className:`overflow-x-auto`,children:(0,H.jsxs)(`table`,{className:`w-full text-left text-xs border-collapse`,children:[(0,H.jsx)(`thead`,{children:(0,H.jsxs)(`tr`,{className:`border-b border-krona-border bg-krona-workspace text-krona-tertiary font-semibold uppercase tracking-wider text-[11px]`,children:[(0,H.jsx)(`th`,{className:`py-3 px-4`,children:`Организация / ИНН`}),(0,H.jsx)(`th`,{className:`py-3 px-3`,children:`Статус`}),(0,H.jsx)(`th`,{className:`py-3 px-3`,children:`Тарифный план`}),(0,H.jsx)(`th`,{className:`py-3 px-3 text-center`,children:`Польз. / Точки`}),(0,H.jsx)(`th`,{className:`py-3 px-3 text-center`,children:`Модули`}),(0,H.jsx)(`th`,{className:`py-3 px-3 text-right`,children:`MRR Доход`}),(0,H.jsx)(`th`,{className:`py-3 px-3 text-right`,children:`Задолженность`}),(0,H.jsx)(`th`,{className:`py-3 px-3`,children:`Активность`}),(0,H.jsx)(`th`,{className:`py-3 px-4 text-right`,children:`Действие`})]})}),(0,H.jsxs)(`tbody`,{className:`divide-y divide-krona-border`,children:[o.map(e=>(0,H.jsxs)(`tr`,{onClick:()=>t(`organization`,e.tenantId),className:`hover:bg-krona-hover cursor-pointer transition-colors group`,children:[(0,H.jsxs)(`td`,{className:`py-3 px-4`,children:[(0,H.jsx)(`div`,{className:`font-bold text-krona-primary group-hover:text-krona-gold transition-colors`,children:e.displayName}),(0,H.jsxs)(`div`,{className:`text-[11px] text-krona-tertiary font-mono mt-0.5`,children:[`ИНН `,e.inn,` • `,e.domain]})]}),(0,H.jsx)(`td`,{className:`py-3 px-3`,children:(0,H.jsx)(X,{status:e.platformStatus,size:`sm`})}),(0,H.jsx)(`td`,{className:`py-3 px-3 font-medium text-krona-primary`,children:e.tariffPlan}),(0,H.jsxs)(`td`,{className:`py-3 px-3 text-center tabular-nums`,children:[(0,H.jsx)(`span`,{className:`font-bold text-krona-primary`,children:e.userCount}),(0,H.jsxs)(`span`,{className:`text-krona-tertiary text-[10px]`,children:[` / `,e.branchCount]})]}),(0,H.jsx)(`td`,{className:`py-3 px-3 text-center font-bold text-krona-primary tabular-nums`,children:e.installedModulesCount}),(0,H.jsx)(`td`,{className:`py-3 px-3 text-right`,children:(0,H.jsx)(td,{minorUnits:e.mrrMinorUnits,className:`text-krona-gold font-bold`})}),(0,H.jsx)(`td`,{className:`py-3 px-3 text-right`,children:(0,H.jsx)(td,{minorUnits:e.outstandingDebtMinorUnits,className:e.outstandingDebtMinorUnits>0?`text-status-danger-text font-bold`:`text-krona-tertiary`})}),(0,H.jsx)(`td`,{className:`py-3 px-3 text-krona-tertiary text-[11px]`,children:new Date(e.lastActiveAt).toLocaleString(`ru-RU`,{day:`2-digit`,month:`2-digit`,hour:`2-digit`,minute:`2-digit`})}),(0,H.jsx)(`td`,{className:`py-3 px-4 text-right`,children:(0,H.jsxs)(`button`,{type:`button`,onClick:n=>{n.stopPropagation(),t(`organization`,e.tenantId)},className:`inline-flex items-center gap-1 px-3 py-2 min-h-[38px] rounded-lg bg-krona-workspace border border-krona-border text-krona-primary hover:text-krona-gold hover:border-krona-gold/40 text-[11px] font-medium transition-colors`,"data-testid":`inspect-org-btn-${e.tenantId}`,children:[(0,H.jsx)(`span`,{children:`360° Карточка`}),(0,H.jsx)(V,{className:`w-3.5 h-3.5`})]})})]},e.tenantId)),o.length===0&&(0,H.jsx)(`tr`,{children:(0,H.jsx)(`td`,{colSpan:9,className:`py-8 text-center text-krona-tertiary`,children:`Организации не найдены по заданным критериям фильтрации`})})]})]})})})]})},{})},{path:`billing`,element:(0,H.jsx)(()=>{let e=W(e=>e.subscriptions),t=W(e=>e.modules),n=W(e=>e.renewSubscription),r=W(e=>e.grantGracePeriod),i=W(e=>e.openConfirmModal),a=W(e=>e.openInspector),{permissions:o}=qu(),[s,c]=(0,A.useState)(`all`),[l,u]=(0,A.useState)(e[0]?.subscriptionId||null),d=e.find(e=>e.subscriptionId===l)||e[0],[f,p]=(0,A.useState)(`year`),[m,h]=(0,A.useState)(null),g=m??(d?d.activeModules:[]),_=e.filter(e=>s===`all`||e.status===s),v=15e5+g.length*4e5,y=f===`year`?v*10:v,b=()=>{d&&i({title:`Продление подписки: ${d.tenantName}`,actionName:`grant_grace_period`,impactSummary:`Подписка будет продлена на ${f===`year`?`1 год`:`1 месяц`}. Состав модулей: ${g.join(`, `)}. Расчётная сумма: ${y/100} ₽.`,targetType:`subscription`,targetId:d.subscriptionId,targetName:d.tenantName,onConfirm:async e=>{await n(d.subscriptionId,f,g,e)}})},x=()=>{d&&i({title:`Предоставление льготного периода: ${d.tenantName}`,actionName:`grant_grace_period`,impactSummary:`Организации будет предоставлен льготный период (Grace Period) на 14 дней с сохранением доступа ко всем модулям.`,targetType:`subscription`,targetId:d.subscriptionId,targetName:d.tenantName,onConfirm:async e=>{await r(d.subscriptionId,14,e)}})},S=e=>{g.includes(e)?h(g.filter(t=>t!==e)):h([...g,e])};return(0,H.jsxs)(`div`,{className:`space-y-4 sm:space-y-6`,"data-testid":`billing-page`,children:[(0,H.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2.5 border-b border-krona-border pb-4`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`h1`,{className:`text-lg sm:text-xl font-bold text-krona-primary flex items-center gap-2`,children:[(0,H.jsx)(ls,{className:`w-5 h-5 text-krona-gold`}),(0,H.jsx)(`span`,{children:`Подписки и биллинг платформы`})]}),(0,H.jsx)(`p`,{className:`text-xs text-krona-secondary mt-0.5`,children:`Контроль сроков действия лицензий, предоставление льготных периодов и продление тарифов`})]}),(0,H.jsxs)(`div`,{className:`text-xs text-krona-secondary`,children:[`Всего подписок: `,(0,H.jsx)(`span`,{className:`font-bold text-krona-primary`,children:e.length}),` (найдено:`,` `,(0,H.jsx)(`span`,{className:`font-bold text-krona-gold`,children:_.length}),`)`]})]}),(0,H.jsx)(`div`,{className:`flex items-center gap-1.5 overflow-x-auto pb-1 text-xs`,children:[{id:`all`,label:`Все подписки`},{id:`expiring_7d`,label:`Истекают (< 7 дн.)`},{id:`expiring_30d`,label:`Истекают (< 30 дн.)`},{id:`grace`,label:`Льготный период`},{id:`overdue`,label:`Просроченные`}].map(e=>(0,H.jsx)(`button`,{type:`button`,"data-testid":`filter-${e.id}`,onClick:()=>c(e.id),className:`min-h-[44px] px-3.5 py-2 rounded-lg font-medium transition-colors shrink-0 ${s===e.id?`bg-krona-gold/15 text-krona-gold border border-krona-gold/30 font-bold`:`bg-krona-surface text-krona-secondary border border-krona-border hover:text-krona-primary hover:bg-krona-hover`}`,children:e.label},e.id))}),(0,H.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-12 gap-4`,children:[(0,H.jsxs)(`div`,{className:`lg:col-span-7 space-y-3`,children:[_.map(e=>{let t=e.subscriptionId===d?.subscriptionId,n=new Date(e.validUntil);return(0,H.jsxs)(`div`,{onClick:()=>{u(e.subscriptionId),h(null)},className:`p-4 rounded-xl border transition-all cursor-pointer space-y-3 ${t?`border-krona-gold bg-krona-surface shadow-md ring-1 ring-krona-gold/30`:`border-krona-border bg-krona-surface/60 hover:bg-krona-surface hover:border-krona-border`}`,"data-testid":`subscription-card-${e.subscriptionId}`,children:[(0,H.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`h3`,{className:`font-bold text-sm text-krona-primary`,children:e.tenantName}),(0,H.jsxs)(`div`,{className:`text-[11px] text-krona-tertiary mt-0.5`,children:[`Тарифный план: `,(0,H.jsx)(`span`,{className:`font-semibold text-krona-primary`,children:e.planCode})]})]}),(0,H.jsx)(X,{status:e.status,size:`sm`})]}),(0,H.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-xs py-2 border-y border-krona-border`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-[10px] text-krona-tertiary`,children:`Стоимость в месяц`}),(0,H.jsx)(td,{minorUnits:e.amountMinorUnits,currency:e.currency,className:`font-bold text-krona-gold text-xs`})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-[10px] text-krona-tertiary`,children:`Действует до`}),(0,H.jsxs)(`div`,{className:`font-bold text-krona-primary flex items-center gap-1`,children:[(0,H.jsx)(No,{className:`w-3.5 h-3.5 text-krona-gold`}),(0,H.jsx)(`span`,{children:n.toLocaleDateString(`ru-RU`)})]})]})]}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between pt-1`,children:[(0,H.jsxs)(`div`,{className:`text-[11px] text-krona-secondary`,children:[`Подключено модулей: `,(0,H.jsx)(`span`,{className:`font-semibold text-krona-primary`,children:e.activeModules.length})]}),(0,H.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),a(`organization`,e.tenantId)},className:`min-h-[44px] px-3 text-xs font-semibold text-krona-gold hover:underline flex items-center gap-1`,children:(0,H.jsx)(`span`,{children:`360° Инспектор`})})]})]},e.subscriptionId)}),_.length===0&&(0,H.jsx)(`div`,{className:`p-8 text-center text-krona-tertiary rounded-xl border border-krona-border bg-krona-surface text-xs`,children:`Подписки не найдены по выбранным критериям`})]}),(0,H.jsx)(`div`,{className:`lg:col-span-5`,children:d?(0,H.jsxs)(`div`,{className:`p-5 rounded-xl border border-krona-border bg-krona-surface space-y-4 sticky top-20 shadow-sm`,children:[(0,H.jsxs)(`div`,{className:`border-b border-krona-border pb-3`,children:[(0,H.jsx)(`div`,{className:`text-[11px] font-semibold text-krona-gold uppercase tracking-wider`,children:`Управление подпиской`}),(0,H.jsx)(`h2`,{className:`text-base font-bold text-krona-primary mt-0.5`,children:d.tenantName}),(0,H.jsxs)(`div`,{className:`text-xs text-krona-secondary mt-0.5`,children:[`Текущий статус: `,(0,H.jsx)(X,{status:d.status,size:`sm`})]})]}),(0,H.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,H.jsx)(`label`,{className:`block text-xs font-semibold text-krona-secondary`,children:`Период продления лицензии`}),(0,H.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,H.jsx)(`button`,{type:`button`,onClick:()=>p(`month`),className:`min-h-[44px] py-2 px-3 rounded-lg text-xs font-semibold border transition-colors ${f===`month`?`border-krona-gold bg-krona-gold/15 text-krona-gold`:`border-krona-border bg-krona-workspace text-krona-secondary hover:text-krona-primary`}`,children:`1 месяц (Базовый)`}),(0,H.jsx)(`button`,{type:`button`,onClick:()=>p(`year`),className:`min-h-[44px] py-2 px-3 rounded-lg text-xs font-semibold border transition-colors ${f===`year`?`border-krona-gold bg-krona-gold/15 text-krona-gold`:`border-krona-border bg-krona-workspace text-krona-secondary hover:text-krona-primary`}`,children:`1 год (Скидка 16%)`})]})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsxs)(`label`,{className:`block text-xs font-semibold text-krona-secondary`,children:[`Состав модулей (`,g.length,`)`]}),(0,H.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-1.5 max-h-48 overflow-y-auto p-1`,children:t.map(e=>{let t=g.includes(e.code);return(0,H.jsxs)(`button`,{type:`button`,onClick:()=>S(e.code),className:`min-h-[40px] px-2.5 py-1.5 rounded-lg text-xs border text-left flex items-center justify-between transition-colors ${t?`border-krona-gold/40 bg-krona-gold/10 text-krona-primary`:`border-krona-border bg-krona-workspace text-krona-tertiary hover:text-krona-secondary`}`,children:[(0,H.jsx)(`span`,{className:`truncate`,children:e.name}),t&&(0,H.jsx)(Zo,{className:`w-3.5 h-3.5 text-krona-gold shrink-0 ml-1`})]},e.code)})})]}),(0,H.jsxs)(`div`,{className:`p-3.5 rounded-xl bg-krona-workspace border border-krona-border flex items-center justify-between`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-[11px] text-krona-tertiary`,children:`Расчётная стоимость продления`}),(0,H.jsx)(td,{minorUnits:y,currency:d.currency,className:`text-lg font-bold text-krona-gold`})]}),(0,H.jsx)(`div`,{className:`text-right text-[11px] text-krona-secondary`,children:f===`year`?`За 12 месяцев`:`За 1 месяц`})]}),(0,H.jsxs)(`div`,{className:`space-y-2 pt-2`,children:[(0,H.jsxs)(`button`,{type:`button`,disabled:!o.canGrantTrialGrace,onClick:b,className:`w-full min-h-[44px] px-4 py-2.5 rounded-lg bg-krona-gold hover:bg-krona-gold-hover text-zinc-950 font-bold text-xs flex items-center justify-center gap-2 transition-colors shadow-sm disabled:opacity-40`,"data-testid":`renew-subscription-btn`,children:[(0,H.jsx)(pc,{className:`w-4 h-4`}),(0,H.jsx)(`span`,{children:`Продлить подписку (Выставить счёт)`})]}),(0,H.jsxs)(`button`,{type:`button`,disabled:!o.canGrantTrialGrace,onClick:x,className:`w-full min-h-[44px] px-4 py-2 rounded-lg border border-status-warning-border bg-status-warning-soft text-status-warning-text font-semibold text-xs flex items-center justify-center gap-2 transition-colors disabled:opacity-40`,"data-testid":`grant-grace-btn`,children:[(0,H.jsx)(rs,{className:`w-4 h-4`}),(0,H.jsx)(`span`,{children:`Предоставить льготный период (14 дн.)`})]})]})]}):(0,H.jsx)(`div`,{className:`p-8 text-center text-krona-tertiary rounded-xl border border-krona-border bg-krona-surface text-xs`,children:`Выберите организацию из списка для продления или изменения состава модулей`})})]})]})},{})},{path:`modules`,element:(0,H.jsx)(()=>{let e=W(e=>e.modules),t=W(e=>e.rollouts),n=W(e=>e.organizations),r=W(e=>e.openConfirmModal),i=W(e=>e.triggerRolloutStage),a=W(e=>e.createRollout),{permissions:o}=qu(),[s,c]=(0,A.useState)(e[0]?.moduleId||`krona-core`),l=e.find(e=>e.moduleId===s),u=l?.latestVersion||`1.0.0`,d=n.slice(0,2).map(e=>e.tenantId),f=t.find(e=>e.moduleId===s),p=(e,t)=>{if(!f)return;let n=G[e]||e;r({title:`Смена фазы раскатки: ${f.moduleName}`,actionName:`rollout.stage_${e}`,impactSummary:`Конвейер раскатки будет переведен в состояние «${n}» (${t}% трафика).`,targetType:`rollout`,targetId:f.rolloutId,targetName:f.moduleName,onConfirm:async n=>{await i(f.rolloutId,e,t,n)}})};return(0,H.jsxs)(`div`,{className:`space-y-4 md:space-y-6`,children:[(0,H.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 border-b border-krona-border pb-4`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`h1`,{className:`text-lg md:text-xl font-bold text-krona-primary flex items-center gap-2`,children:[(0,H.jsx)(tc,{className:`w-5 h-5 text-amber-500 shrink-0`}),(0,H.jsx)(`span`,{children:`Каталог модулей и Rollout конвейер`})]}),(0,H.jsx)(`p`,{className:`text-xs text-krona-secondary mt-0.5`,children:`Управление версиями модулей, совместимостью с ядром, пилотными группами и канареечным развертыванием`})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-krona-secondary`,children:[(0,H.jsxs)(`span`,{className:`px-2.5 py-1 rounded-md bg-krona-workspace border border-krona-border`,children:[`Всего модулей: `,(0,H.jsx)(`strong`,{className:`text-krona-primary`,children:e.length})]}),(0,H.jsxs)(`span`,{className:`px-2.5 py-1 rounded-md bg-amber-500/10 border border-amber-500/30 text-amber-500 font-semibold`,children:[`Активных раскаток: `,(0,H.jsx)(`strong`,{children:t.length})]})]})]}),(0,H.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-3 gap-4 md:gap-6`,children:[(0,H.jsxs)(`div`,{className:`rounded-xl border border-krona-border bg-krona-surface p-3 md:p-4 space-y-3 shadow-xs`,children:[(0,H.jsx)(`div`,{className:`text-xs font-semibold text-krona-secondary uppercase tracking-wider px-1`,children:`Каталог системных модулей`}),(0,H.jsx)(`div`,{className:`space-y-2 max-h-[480px] lg:max-h-none overflow-y-auto`,children:e.map(e=>{let n=e.moduleId===s,r=t.some(t=>t.moduleId===e.moduleId);return(0,H.jsxs)(`div`,{onClick:()=>c(e.moduleId),className:`min-h-[44px] p-3 rounded-lg border text-xs cursor-pointer transition-colors space-y-1.5 ${n?`bg-amber-500/15 border-amber-500/40 text-krona-primary shadow-xs`:`bg-krona-workspace border-krona-border text-krona-secondary hover:bg-krona-surface hover:text-krona-primary`}`,children:[(0,H.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,H.jsx)(`span`,{className:`font-bold text-krona-primary`,children:e.name}),(0,H.jsxs)(`span`,{className:`text-[10px] font-mono px-1.5 py-0.5 rounded-md bg-krona-surface border border-krona-border text-amber-500 font-semibold`,children:[`v`,e.latestVersion]})]}),(0,H.jsx)(`p`,{className:`text-[11px] text-krona-secondary line-clamp-1`,children:e.description}),(0,H.jsxs)(`div`,{className:`flex justify-between items-center text-[10px] text-krona-secondary/80 pt-1`,children:[(0,H.jsxs)(`span`,{children:[`Организаций: `,e.activeTenantsCount,` • Установок: `,e.instancesCount]}),r&&(0,H.jsx)(`span`,{className:`px-1.5 py-0.5 rounded-md bg-amber-500/15 text-amber-600 dark:text-amber-300 border border-amber-500/30 font-bold uppercase text-[9px]`,children:`Раскатка`})]})]},e.moduleId)})})]}),(0,H.jsx)(`div`,{className:`lg:col-span-2 space-y-4 md:space-y-6`,children:l&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`rounded-xl border border-krona-border bg-krona-surface p-4 md:p-5 space-y-4 shadow-xs`,children:[(0,H.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:justify-between sm:items-start gap-3`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 mb-1`,children:[(0,H.jsx)(`span`,{className:`font-mono text-xs text-amber-500 font-bold`,children:l.code}),(0,H.jsx)(`span`,{className:`text-krona-secondary`,children:`•`}),(0,H.jsxs)(`span`,{className:`text-xs text-krona-secondary`,children:[`Категория: `,Qu[l.category]||l.category]})]}),(0,H.jsx)(`h2`,{className:`text-base md:text-lg font-bold text-krona-primary`,children:l.name}),(0,H.jsx)(`p`,{className:`text-xs text-krona-secondary mt-1`,children:l.description})]}),(0,H.jsxs)(`div`,{className:`text-left sm:text-right shrink-0`,children:[(0,H.jsx)(`span`,{className:`text-xs text-krona-secondary`,children:`Текущая версия:`}),(0,H.jsxs)(`div`,{className:`font-mono font-bold text-lg text-emerald-600 dark:text-emerald-400`,children:[`v`,l.latestVersion]})]})]}),(0,H.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-3 gap-2 text-xs pt-3 border-t border-krona-border`,children:[(0,H.jsxs)(`div`,{className:`p-2.5 rounded-lg bg-krona-workspace border border-krona-border`,children:[(0,H.jsx)(`div`,{className:`text-krona-secondary mb-0.5`,children:`Канал релиза:`}),(0,H.jsx)(`div`,{className:`font-semibold text-krona-primary uppercase`,children:l.rolloutChannel})]}),(0,H.jsxs)(`div`,{className:`p-2.5 rounded-lg bg-krona-workspace border border-krona-border`,children:[(0,H.jsx)(`div`,{className:`text-krona-secondary mb-0.5`,children:`Манифест:`}),(0,H.jsxs)(`div`,{className:`font-semibold text-krona-primary font-mono`,children:[`v`,l.manifestVersion]})]}),(0,H.jsxs)(`div`,{className:`p-2.5 rounded-lg bg-krona-workspace border border-krona-border`,children:[(0,H.jsx)(`div`,{className:`text-krona-secondary mb-0.5`,children:`Зависимости:`}),(0,H.jsx)(`div`,{className:`font-semibold text-krona-primary truncate`,children:l.dependencies.length>0?l.dependencies.join(`, `):`Базовый`})]})]})]}),(0,H.jsxs)(`div`,{className:`rounded-xl border border-krona-border bg-krona-surface p-4 md:p-5 space-y-4 shadow-xs`,children:[(0,H.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(Fc,{className:`w-4 h-4 text-amber-500`}),(0,H.jsx)(`h3`,{className:`text-sm font-bold text-krona-primary`,children:`Управление конвейером раскатки (Rollout)`})]}),f&&(0,H.jsx)(X,{status:f.stage,size:`sm`,customLabel:G[f.stage]||f.stage})]}),f?(0,H.jsxs)(`div`,{className:`space-y-4 text-xs`,children:[(0,H.jsxs)(`div`,{className:`p-4 rounded-xl bg-krona-workspace border border-krona-border space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,H.jsxs)(`span`,{className:`font-semibold text-krona-primary`,children:[`Целевая версия:`,` `,(0,H.jsxs)(`span`,{className:`font-mono text-amber-500 font-bold`,children:[`v`,f.targetVersion]})]}),(0,H.jsxs)(`span`,{className:`font-bold text-amber-500 font-mono text-sm`,children:[f.percentage,`%`]})]}),(0,H.jsx)(`div`,{className:`w-full bg-krona-border h-2 rounded-full overflow-hidden`,children:(0,H.jsx)(`div`,{className:`h-full bg-amber-500 transition-all duration-300 rounded-full`,style:{width:`${f.percentage}%`}})}),(0,H.jsxs)(`div`,{className:`flex flex-wrap justify-between gap-2 text-[11px] text-krona-secondary`,children:[(0,H.jsxs)(`span`,{children:[`Стадия:`,` `,(0,H.jsx)(`strong`,{className:`text-krona-primary`,children:G[f.stage]||f.stage})]}),(0,H.jsxs)(`span`,{children:[`Пилотных организаций: `,f.pilotTenantIds.length]}),(0,H.jsxs)(`span`,{children:[`Старт: `,new Date(f.startedAt).toLocaleDateString(`ru-RU`)]})]})]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-2 pt-2`,children:[(0,H.jsx)(`button`,{type:`button`,disabled:!o.canTriggerRollouts||f.stage===`pilot`,onClick:()=>p(`pilot`,15),className:`min-h-[44px] px-3.5 py-2 rounded-lg bg-krona-workspace border border-krona-border text-krona-primary hover:bg-krona-surface text-xs font-medium disabled:opacity-40 transition-colors shadow-xs`,children:`Фаза 1: Пилот (15%)`}),(0,H.jsx)(`button`,{type:`button`,disabled:!o.canTriggerRollouts||f.stage===`percentage`,onClick:()=>p(`percentage`,50),className:`min-h-[44px] px-3.5 py-2 rounded-lg bg-krona-workspace border border-krona-border text-krona-primary hover:bg-krona-surface text-xs font-medium disabled:opacity-40 transition-colors shadow-xs`,children:`Фаза 2: 50% организаций`}),(0,H.jsx)(`button`,{type:`button`,disabled:!o.canTriggerRollouts||f.stage===`general_availability`,onClick:()=>p(`general_availability`,100),className:`min-h-[44px] px-4 py-2 rounded-lg bg-emerald-500/15 text-emerald-600 dark:text-emerald-300 border border-emerald-500/40 hover:bg-emerald-500/25 text-xs font-bold disabled:opacity-40 transition-colors shadow-xs`,children:`Фаза 3: Полный релиз (100% GA)`}),f.stage===`paused`?(0,H.jsxs)(`button`,{type:`button`,disabled:!o.canTriggerRollouts,onClick:()=>p(`pilot`,f.percentage),className:`min-h-[44px] px-3.5 py-2 rounded-lg bg-amber-500 text-zinc-950 font-bold text-xs hover:bg-amber-400 transition-colors flex items-center gap-1.5 shadow-xs`,children:[(0,H.jsx)(ac,{className:`w-4 h-4`}),(0,H.jsx)(`span`,{children:`Снять с паузы`})]}):(0,H.jsxs)(`button`,{type:`button`,disabled:!o.canPauseRollbackRollouts,onClick:()=>p(`paused`,f.percentage),className:`min-h-[44px] px-3.5 py-2 rounded-lg bg-amber-500/15 text-amber-600 dark:text-amber-300 border border-amber-500/40 hover:bg-amber-500/25 text-xs font-bold disabled:opacity-40 transition-colors flex items-center gap-1.5 shadow-xs`,children:[(0,H.jsx)(rc,{className:`w-4 h-4`}),(0,H.jsx)(`span`,{children:`На паузу`})]}),(0,H.jsxs)(`button`,{type:`button`,disabled:!o.canPauseRollbackRollouts||f.stage===`rolled_back`,onClick:()=>p(`rolled_back`,0),className:`min-h-[44px] px-3.5 py-2 rounded-lg bg-rose-500/15 text-rose-600 dark:text-rose-300 border border-rose-500/40 hover:bg-rose-500/25 text-xs font-bold disabled:opacity-40 transition-colors flex items-center gap-1.5 shadow-xs`,children:[(0,H.jsx)(hc,{className:`w-4 h-4`}),(0,H.jsx)(`span`,{children:`Откат (Rollback)`})]})]})]}):(0,H.jsxs)(`div`,{className:`p-4 rounded-xl bg-krona-workspace border border-krona-border text-xs space-y-3`,children:[(0,H.jsxs)(`p`,{className:`text-krona-secondary`,children:[`Для модуля `,(0,H.jsx)(`strong`,{className:`text-krona-primary`,children:l.name}),` нет активных раскаток. Вы можете запустить пилотный релиз новой версии для проверки совместимости.`]}),(0,H.jsxs)(`button`,{type:`button`,disabled:!o.canTriggerRollouts,onClick:()=>{l&&r({title:`Запуск новой раскатки: ${l.name}`,actionName:`rollout.start_pilot (${u})`,impactSummary:`Будет запущен пилотный этап обновления до версии ${u} для ${d.length} пилотных организаций.`,targetType:`rollout`,targetId:l.moduleId,targetName:l.name,onConfirm:async e=>{await a(l.moduleId,u,`pilot`,d,15,`Пилотная фаза раскатки обновления`,e)}})},className:`min-h-[44px] px-4 py-2.5 rounded-lg bg-amber-500 hover:bg-amber-400 text-zinc-950 font-bold text-xs transition-colors flex items-center gap-2 disabled:opacity-40 shadow-xs`,children:[(0,H.jsx)(ac,{className:`w-4 h-4`}),(0,H.jsx)(`span`,{children:`Запустить пилотную раскатку`})]})]})]}),(0,H.jsxs)(`div`,{className:`rounded-xl border border-krona-border bg-krona-surface p-4 md:p-5 space-y-3 text-xs shadow-xs`,children:[(0,H.jsxs)(`h3`,{className:`text-sm font-bold text-krona-primary flex items-center gap-1.5`,children:[(0,H.jsx)(zc,{className:`w-4 h-4 text-amber-500`}),(0,H.jsx)(`span`,{children:`История релизов и совместимость`})]}),(0,H.jsx)(`div`,{className:`space-y-2`,children:l.releaseHistory.map(e=>(0,H.jsxs)(`div`,{className:`p-3 rounded-lg bg-krona-workspace border border-krona-border space-y-1`,children:[(0,H.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,H.jsxs)(`span`,{className:`font-bold text-amber-500 font-mono`,children:[`v`,e.version]}),(0,H.jsx)(`span`,{className:`text-[11px] text-krona-secondary`,children:new Date(e.releasedAt).toLocaleDateString(`ru-RU`)})]}),(0,H.jsx)(`p`,{className:`text-krona-primary text-[11px]`,children:e.changelog}),(0,H.jsxs)(`div`,{className:`text-[10px] text-krona-secondary font-mono pt-1`,children:[`Совместимость с ядром: `,e.compatibleCore]})]},e.version))})]})]})})]})]})},{})},{path:`installations`,element:(0,H.jsx)(()=>{let e=W(e=>e.installations),[t,n]=(0,A.useState)(``),[r,i]=(0,A.useState)(`all`),[a,o]=(0,A.useState)(`all`),s=e.filter(e=>{let n=$u[e.kind]||``,i=!t||e.deviceName.toLowerCase().includes(t.toLowerCase())||e.tenantName.toLowerCase().includes(t.toLowerCase())||e.appVersion.includes(t)||n.toLowerCase().includes(t.toLowerCase()),o=r===`all`||e.kind===r,s=a===`all`||e.status===a;return i&&o&&s}),c=e.filter(e=>e.kind===`android`&&(e.status===`outdated`||e.status===`blocked`)),l=e=>{switch(e){case`android`:return(0,H.jsx)(Lc,{className:`w-4 h-4 text-emerald-500`});case`desktop`:return(0,H.jsx)(Ys,{className:`w-4 h-4 text-sky-500`});case`web`:return(0,H.jsx)(ys,{className:`w-4 h-4 text-amber-500`})}};return(0,H.jsxs)(`div`,{className:`space-y-4 md:space-y-6`,children:[(0,H.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 border-b border-krona-border pb-4`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`h1`,{className:`text-lg md:text-xl font-bold text-krona-primary flex items-center gap-2`,children:[(0,H.jsx)(Lc,{className:`w-5 h-5 text-amber-500 shrink-0`}),(0,H.jsx)(`span`,{children:`Установки и клиентские приложения`})]}),(0,H.jsx)(`p`,{className:`text-xs text-krona-secondary mt-0.5`,children:`Мониторинг клиентских устройств Web, Desktop и Android (ТСД терминалы сбора данных и кассы)`})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-krona-secondary`,children:[(0,H.jsxs)(`span`,{className:`px-2.5 py-1 rounded-md bg-krona-workspace border border-krona-border`,children:[`Всего: `,(0,H.jsx)(`strong`,{className:`text-krona-primary`,children:e.length})]}),(0,H.jsxs)(`span`,{className:`px-2.5 py-1 rounded-md bg-amber-500/10 border border-amber-500/30 text-amber-500 font-semibold`,children:[`Найдено: `,(0,H.jsx)(`strong`,{children:s.length})]})]})]}),c.length>0&&(0,H.jsxs)(`div`,{className:`rounded-xl border border-amber-500/40 bg-amber-500/10 p-4 flex flex-col md:flex-row items-start md:items-center justify-between gap-3 shadow-xs`,children:[(0,H.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,H.jsx)(`div`,{className:`p-2 rounded-lg bg-amber-500/20 text-amber-500 border border-amber-500/30 shrink-0 mt-0.5`,children:(0,H.jsx)($c,{className:`w-5 h-5`})}),(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`div`,{className:`text-sm font-bold text-amber-600 dark:text-amber-300`,children:[`Обнаружены устаревшие Android-установки (`,c.length,` устройств)`]}),(0,H.jsx)(`div`,{className:`text-xs text-krona-secondary mt-0.5 leading-relaxed`,children:`Терминалы сбора данных Zebra, Honeywell и кассы Эвотор работают на устаревших версиях клиента (v1.0.4 – v1.2.0). Рекомендуется запланировать push-обновление APK пакета через MDM канал.`})]})]}),(0,H.jsx)(`button`,{type:`button`,onClick:()=>{i(`android`),o(`outdated`)},className:`shrink-0 min-h-[44px] px-4 py-2 rounded-lg bg-amber-500 hover:bg-amber-400 text-zinc-950 font-bold text-xs transition-colors shadow-xs`,children:`Показать только устаревшие Android`})]}),(0,H.jsxs)(`div`,{className:`flex flex-col md:flex-row gap-3 items-stretch md:items-center justify-between`,children:[(0,H.jsxs)(`div`,{className:`relative flex-1 max-w-md`,children:[(0,H.jsx)(_c,{className:`w-4 h-4 text-krona-secondary absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none`}),(0,H.jsx)(`input`,{type:`text`,value:t,onChange:e=>n(e.target.value),placeholder:`Поиск по устройству, организации или версии...`,className:`w-full bg-krona-workspace border border-krona-border rounded-lg pl-9 pr-3 py-2.5 text-xs text-krona-primary placeholder:text-krona-secondary/60 focus:outline-hidden focus:border-amber-500 transition-colors min-h-[44px]`})]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-1 overflow-x-auto pb-1`,children:[(0,H.jsx)(`span`,{className:`text-krona-secondary text-[11px] mr-1 hidden sm:inline`,children:`Платформа:`}),[{id:`all`,label:`Все`},{id:`android`,label:`Android`},{id:`desktop`,label:`Desktop`},{id:`web`,label:`Web`}].map(e=>(0,H.jsx)(`button`,{onClick:()=>i(e.id),className:`min-h-[44px] px-3 py-2 rounded-lg font-medium transition-colors ${r===e.id?`bg-amber-500/15 text-amber-600 dark:text-amber-300 border border-amber-500/40 font-bold shadow-xs`:`bg-krona-workspace text-krona-secondary border border-krona-border hover:text-krona-primary`}`,children:e.label},e.id))]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-1 pl-2 border-l border-krona-border overflow-x-auto pb-1`,children:[(0,H.jsx)(`span`,{className:`text-krona-secondary text-[11px] mr-1 hidden sm:inline`,children:`Статус:`}),[{id:`all`,label:`Все`},{id:`outdated`,label:`Устарели`},{id:`supported`,label:`В норме`},{id:`blocked`,label:`Блок`}].map(e=>(0,H.jsx)(`button`,{onClick:()=>o(e.id),className:`min-h-[44px] px-3 py-2 rounded-lg font-medium transition-colors ${a===e.id?`bg-amber-500/15 text-amber-600 dark:text-amber-300 border border-amber-500/40 font-bold shadow-xs`:`bg-krona-workspace text-krona-secondary border border-krona-border hover:text-krona-primary`}`,children:e.label},e.id))]})]})]}),(0,H.jsxs)(`div`,{className:`block lg:hidden space-y-3`,children:[s.map(e=>{let t=$u[e.kind]||e.kind,n=K[e.status]||e.status;return(0,H.jsxs)(`div`,{className:`p-4 rounded-xl border border-krona-border bg-krona-surface space-y-3 shadow-xs`,children:[(0,H.jsxs)(`div`,{className:`flex justify-between items-start gap-2 border-b border-krona-border pb-2.5`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[l(e.kind),(0,H.jsx)(`span`,{className:`font-bold text-sm text-krona-primary`,children:e.deviceName})]}),(0,H.jsxs)(`div`,{className:`text-xs text-krona-secondary mt-0.5`,children:[e.tenantName,` • `,t]})]}),(0,H.jsx)(X,{status:e.status,size:`sm`,customLabel:n})]}),(0,H.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-xs`,children:[(0,H.jsxs)(`div`,{className:`p-2 rounded-lg bg-krona-workspace border border-krona-border`,children:[(0,H.jsx)(`span`,{className:`text-[10px] text-krona-secondary block`,children:`Версия клиента`}),(0,H.jsxs)(`span`,{className:`font-mono font-bold text-amber-500`,children:[`v`,e.appVersion]})]}),(0,H.jsxs)(`div`,{className:`p-2 rounded-lg bg-krona-workspace border border-krona-border`,children:[(0,H.jsx)(`span`,{className:`text-[10px] text-krona-secondary block`,children:`ОС устройства`}),(0,H.jsx)(`span`,{className:`font-mono text-krona-primary truncate block`,children:e.osVersion})]})]}),(0,H.jsxs)(`div`,{className:`pt-2 border-t border-krona-border flex items-center justify-between text-[11px] text-krona-secondary`,children:[(0,H.jsxs)(`span`,{className:`flex items-center gap-1 font-mono`,children:[(0,H.jsx)(lc,{className:`w-3 h-3 text-emerald-500`}),e.ipAddressMasked]}),(0,H.jsxs)(`span`,{children:[`Активность: `,new Date(e.lastSeenAt).toLocaleTimeString(`ru-RU`,{hour:`2-digit`,minute:`2-digit`})]})]})]},e.installationId)}),s.length===0&&(0,H.jsx)(`div`,{className:`p-8 rounded-xl border border-krona-border bg-krona-surface text-center text-xs text-krona-secondary`,children:`Установки не найдены по выбранным критериям`})]}),(0,H.jsx)(`div`,{className:`hidden lg:block rounded-xl border border-krona-border bg-krona-surface overflow-hidden shadow-xs`,children:(0,H.jsx)(`div`,{className:`overflow-x-auto`,children:(0,H.jsxs)(`table`,{className:`w-full text-left text-xs border-collapse`,children:[(0,H.jsx)(`thead`,{children:(0,H.jsxs)(`tr`,{className:`border-b border-krona-border bg-krona-workspace text-krona-secondary font-semibold uppercase tracking-wider text-[11px]`,children:[(0,H.jsx)(`th`,{className:`py-3 px-4`,children:`Платформа`}),(0,H.jsx)(`th`,{className:`py-3 px-3`,children:`Устройство / Модель`}),(0,H.jsx)(`th`,{className:`py-3 px-3`,children:`Организация`}),(0,H.jsx)(`th`,{className:`py-3 px-3 font-mono`,children:`Версия клиента`}),(0,H.jsx)(`th`,{className:`py-3 px-3`,children:`ОС устройства`}),(0,H.jsx)(`th`,{className:`py-3 px-3`,children:`Статус поддержки`}),(0,H.jsx)(`th`,{className:`py-3 px-3`,children:`Последняя активность`}),(0,H.jsx)(`th`,{className:`py-3 px-4`,children:`Сегмент IP`})]})}),(0,H.jsxs)(`tbody`,{className:`divide-y divide-krona-border/60`,children:[s.map(e=>(0,H.jsxs)(`tr`,{className:`hover:bg-krona-workspace/50 transition-colors`,children:[(0,H.jsx)(`td`,{className:`py-3 px-4`,children:(0,H.jsxs)(`div`,{className:`flex items-center gap-2 font-medium text-krona-primary`,children:[l(e.kind),(0,H.jsx)(`span`,{children:$u[e.kind]||e.kind})]})}),(0,H.jsx)(`td`,{className:`py-3 px-3 font-semibold text-krona-primary`,children:e.deviceName}),(0,H.jsx)(`td`,{className:`py-3 px-3 text-krona-secondary font-medium`,children:e.tenantName}),(0,H.jsxs)(`td`,{className:`py-3 px-3 font-mono font-bold text-amber-500`,children:[`v`,e.appVersion]}),(0,H.jsx)(`td`,{className:`py-3 px-3 text-krona-secondary font-mono text-[11px]`,children:e.osVersion}),(0,H.jsx)(`td`,{className:`py-3 px-3`,children:(0,H.jsx)(X,{status:e.status,size:`sm`,customLabel:K[e.status]||e.status})}),(0,H.jsx)(`td`,{className:`py-3 px-3 text-krona-secondary text-[11px]`,children:new Date(e.lastSeenAt).toLocaleString(`ru-RU`,{day:`2-digit`,month:`2-digit`,hour:`2-digit`,minute:`2-digit`})}),(0,H.jsx)(`td`,{className:`py-3 px-4 font-mono text-krona-secondary text-[11px]`,children:e.ipAddressMasked})]},e.installationId)),s.length===0&&(0,H.jsx)(`tr`,{children:(0,H.jsx)(`td`,{colSpan:8,className:`py-8 text-center text-krona-secondary`,children:`Установки не найдены по выбранным критериям фильтрации`})})]})]})})})]})},{})},{path:`infrastructure`,element:(0,H.jsx)(()=>{let e=W(e=>e.servers),t=W(e=>e.instances),n=W(e=>e.openInspector),r=W(e=>e.openConfirmModal),i=W(e=>e.createIncidentFromAlert),a=W(e=>e.requestServerDiagnostics),[o,s]=(0,A.useState)(``),[c,l]=(0,A.useState)(`all`),[u,d]=(0,A.useState)({}),f=(e,t)=>{t.stopPropagation(),d(t=>({...t,[e]:!t[e]}))},p=e.filter(e=>{let t=!o||e.name.toLowerCase().includes(o.toLowerCase())||e.ipAddress.includes(o)||e.hostname.toLowerCase().includes(o.toLowerCase())||e.hostingProvider.toLowerCase().includes(o.toLowerCase()),n=c===`all`||e.hostingProvider===c;return t&&n}),m=(e,t)=>{t.stopPropagation(),r({title:`Создать инцидент для сервера: ${e.name}`,actionName:`circuit_breaker_trip`,impactSummary:`Будет открыт критический инцидент платформы, затронутые организации получат уведомление о расследовании.`,targetType:`infrastructure`,targetId:e.serverId,targetName:e.name,onConfirm:async t=>{await i(e.serverId,`Сбой сервера ${e.name} (${e.status})`,`critical`,t)}})},h=(e,t)=>{t.stopPropagation(),r({title:`Запрос телеметрии: ${e.name}`,actionName:`invalidate_cache`,impactSummary:`Агенту мониторинга v${e.agentVersion} будет направлен запрос выгрузки моментального снимка состояния.`,targetType:`infrastructure`,targetId:e.serverId,targetName:e.name,onConfirm:async t=>{await a(e.serverId,t)}})};return(0,H.jsxs)(`div`,{className:`space-y-4 sm:space-y-6`,"data-testid":`infrastructure-page`,children:[(0,H.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2.5 border-b border-krona-border pb-4`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`h1`,{className:`text-lg sm:text-xl font-bold text-krona-primary flex items-center gap-2`,children:[(0,H.jsx)(xc,{className:`w-5 h-5 text-krona-gold`}),(0,H.jsx)(`span`,{children:`Инфраструктурные серверы`})]}),(0,H.jsx)(`p`,{className:`text-xs text-krona-secondary mt-0.5`,children:`Управление вычислительными узлами, телеметрией mTLS, бэкапами и нагрузкой`})]}),(0,H.jsxs)(`div`,{className:`text-xs text-krona-secondary`,children:[`Всего узлов: `,(0,H.jsx)(`span`,{className:`font-bold text-krona-primary`,children:e.length}),` (Selectel:`,` `,(0,H.jsx)(`span`,{className:`font-bold text-krona-gold`,children:e.filter(e=>e.hostingProvider===`Selectel`).length}),`, Timeweb:`,` `,(0,H.jsx)(`span`,{className:`font-bold text-krona-gold`,children:e.filter(e=>e.hostingProvider===`Timeweb Cloud`).length}),`)`]})]}),(0,H.jsxs)(`div`,{className:`flex flex-col md:flex-row gap-3 items-stretch md:items-center justify-between`,children:[(0,H.jsxs)(`div`,{className:`relative flex-1 max-w-md`,children:[(0,H.jsx)(_c,{className:`w-4 h-4 text-krona-tertiary absolute left-3 top-1/2 -translate-y-1/2`}),(0,H.jsx)(`input`,{type:`text`,value:o,onChange:e=>s(e.target.value),placeholder:`Поиск по имени сервера, IP, хосту или организации...`,className:`w-full bg-krona-surface border border-krona-border rounded-lg pl-9 pr-3 py-2.5 min-h-[44px] text-xs text-krona-primary placeholder-krona-tertiary focus:outline-hidden focus:border-krona-gold transition-colors`})]}),(0,H.jsx)(`div`,{className:`flex items-center gap-1.5 overflow-x-auto pb-1 text-xs`,children:[{id:`all`,label:`Все провайдеры`},{id:`Selectel`,label:`Selectel`},{id:`Timeweb Cloud`,label:`Timeweb Cloud`}].map(e=>(0,H.jsx)(`button`,{type:`button`,onClick:()=>l(e.id),className:`min-h-[44px] px-3.5 py-2 rounded-lg font-medium transition-colors shrink-0 ${c===e.id?`bg-krona-gold/15 text-krona-gold border border-krona-gold/30 font-bold`:`bg-krona-surface text-krona-secondary border border-krona-border hover:text-krona-primary hover:bg-krona-hover`}`,children:e.label},e.id))})]}),(0,H.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3 sm:gap-4`,"data-testid":`servers-list`,children:[p.map(e=>{let r=t.filter(t=>t.serverId===e.serverId),i=!!u[e.serverId],a=new Date(e.lastSeenAt),o=e.cpuLoadPercent,s=Math.round(e.ramUsedBytes/(e.ramTotalBytes||1)*100),c=Math.round(e.diskUsedBytes/(e.diskTotalBytes||1)*100);return(0,H.jsxs)(`div`,{onClick:()=>n(`server`,e.serverId),className:`p-4 rounded-xl border bg-krona-surface hover:border-krona-gold/40 cursor-pointer transition-all space-y-3 relative shadow-xs ${e.status===`critical`||e.status===`offline`?`border-status-danger-border bg-status-danger-soft/20`:e.status===`warning`?`border-status-warning-border bg-status-warning-soft/20`:`border-krona-border`}`,"data-testid":`server-card-${e.serverId}`,children:[(0,H.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,H.jsx)(`span`,{className:`font-bold text-sm text-krona-primary truncate`,children:e.name}),(0,H.jsx)(X,{status:e.status,size:`sm`})]}),(0,H.jsxs)(`div`,{className:`text-[11px] text-krona-tertiary font-mono mt-0.5 truncate`,children:[e.hostname,` • `,e.ipAddress,` • `,e.hostingProvider,` (`,e.region,`)`]})]}),(0,H.jsxs)(`span`,{className:`text-[10px] text-krona-tertiary font-mono bg-krona-workspace px-2 py-0.5 rounded-sm shrink-0 border border-krona-border`,children:[`Агент v`,e.agentVersion]})]}),(0,H.jsxs)(`div`,{className:`text-xs text-krona-secondary flex items-center justify-between`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`span`,{className:`text-krona-tertiary`,children:`Провайдер: `}),(0,H.jsx)(`span`,{className:`font-semibold text-krona-primary`,children:e.hostingProvider})]}),(0,H.jsxs)(`div`,{className:`text-[11px] text-krona-tertiary flex items-center gap-1`,children:[(0,H.jsx)(rs,{className:`w-3.5 h-3.5`}),(0,H.jsxs)(`span`,{children:[`Сигнал: `,a.toLocaleTimeString(`ru-RU`)]})]})]}),(0,H.jsxs)(`div`,{className:`grid grid-cols-3 gap-2 pt-2 border-t border-krona-border text-xs`,children:[(0,H.jsxs)(`div`,{className:`p-2 rounded-lg bg-krona-workspace border border-krona-border space-y-1`,children:[(0,H.jsxs)(`div`,{className:`flex justify-between text-[11px] text-krona-tertiary`,children:[(0,H.jsx)(`span`,{children:`CPU`}),(0,H.jsxs)(`span`,{className:`font-bold font-mono ${o>80?`text-status-danger-text`:`text-krona-primary`}`,children:[o,`%`]})]}),(0,H.jsx)(`div`,{className:`w-full bg-krona-surface h-1.5 rounded-full overflow-hidden`,children:(0,H.jsx)(`div`,{className:`h-full ${o>80?`bg-red-500`:`bg-emerald-500`}`,style:{width:`${o}%`}})})]}),(0,H.jsxs)(`div`,{className:`p-2 rounded-lg bg-krona-workspace border border-krona-border space-y-1`,children:[(0,H.jsxs)(`div`,{className:`flex justify-between text-[11px] text-krona-tertiary`,children:[(0,H.jsx)(`span`,{children:`RAM`}),(0,H.jsxs)(`span`,{className:`font-bold font-mono ${s>80?`text-status-danger-text`:`text-krona-primary`}`,children:[s,`%`]})]}),(0,H.jsx)(`div`,{className:`w-full bg-krona-surface h-1.5 rounded-full overflow-hidden`,children:(0,H.jsx)(`div`,{className:`h-full ${s>80?`bg-red-500`:`bg-emerald-500`}`,style:{width:`${s}%`}})})]}),(0,H.jsxs)(`div`,{className:`p-2 rounded-lg bg-krona-workspace border border-krona-border space-y-1`,children:[(0,H.jsxs)(`div`,{className:`flex justify-between text-[11px] text-krona-tertiary`,children:[(0,H.jsx)(`span`,{children:`Диск`}),(0,H.jsxs)(`span`,{className:`font-bold font-mono ${c>85?`text-status-danger-text`:`text-krona-primary`}`,children:[c,`%`]})]}),(0,H.jsx)(`div`,{className:`w-full bg-krona-surface h-1.5 rounded-full overflow-hidden`,children:(0,H.jsx)(`div`,{className:`h-full ${c>85?`bg-red-500`:`bg-emerald-500`}`,style:{width:`${c}%`}})})]})]}),i&&(0,H.jsxs)(`div`,{className:`pt-2 border-t border-krona-border space-y-2.5 text-xs animate-in fade-in duration-150`,children:[(0,H.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-[11px] text-krona-secondary`,children:[(0,H.jsxs)(`div`,{children:[`Резервная копия:`,` `,(0,H.jsx)(`span`,{className:e.backup.state===`failed`?`text-status-danger-text font-bold`:`text-status-success-text font-semibold`,children:e.backup.state===`ok`?`В норме`:e.backup.state===`failed`?`Ошибка`:e.backup.state})]}),(0,H.jsxs)(`div`,{children:[`Срок mTLS-сертификата:`,` `,(0,H.jsxs)(`span`,{className:`font-mono text-krona-primary font-semibold`,children:[e.certificateDaysRemaining,` дней`]})]}),(0,H.jsxs)(`div`,{children:[`Активных модулей:`,` `,(0,H.jsx)(`span`,{className:`font-mono text-krona-primary font-semibold`,children:r.length})]})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-[11px] text-krona-tertiary mb-1`,children:`История сигналов (Heartbeat):`}),(0,H.jsx)(nd,{status:e.status,count:24})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2 pt-1`,children:[(0,H.jsx)(`button`,{type:`button`,onClick:t=>h(e,t),className:`min-h-[38px] px-3 py-1.5 rounded-lg border border-krona-border bg-krona-workspace text-krona-secondary hover:text-krona-primary text-xs font-medium`,children:`Диагностика`}),(e.status===`critical`||e.status===`offline`)&&(0,H.jsx)(`button`,{type:`button`,onClick:t=>m(e,t),className:`min-h-[38px] px-3 py-1.5 rounded-lg border border-status-danger-border bg-status-danger-soft text-status-danger-text text-xs font-bold`,children:`Открыть инцидент`})]})]}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between pt-1 gap-2`,children:[(0,H.jsx)(`button`,{type:`button`,onClick:t=>f(e.serverId,t),className:`min-h-[44px] px-2.5 text-xs text-krona-secondary hover:text-krona-primary flex items-center gap-1 font-medium`,"aria-expanded":i,children:i?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{children:`Скрыть детали`}),(0,H.jsx)(Go,{className:`w-3.5 h-3.5`})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{children:`Вторичные сведения`}),(0,H.jsx)(Vo,{className:`w-3.5 h-3.5`})]})}),(0,H.jsxs)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),n(`server`,e.serverId)},className:`min-h-[44px] px-3 flex items-center gap-1.5 text-xs font-semibold text-krona-gold bg-krona-gold/10 hover:bg-krona-gold/20 rounded-lg border border-krona-gold/30 transition-colors`,"data-testid":`inspect-server-${e.serverId}`,children:[(0,H.jsx)(`span`,{children:`Подробности`}),(0,H.jsx)(V,{className:`w-4 h-4`})]})]})]},e.serverId)}),p.length===0&&(0,H.jsx)(`div`,{className:`col-span-full p-8 text-center text-krona-tertiary rounded-xl border border-krona-border bg-krona-surface text-xs`,children:`Серверные узлы не найдены по заданным критериям фильтрации`})]})]})},{})},{path:`announcements`,element:(0,H.jsx)(()=>{let e=W(e=>e.announcements),n=W(e=>e.organizations),r=W(e=>e.modules),i=W(e=>e.createAnnouncement),a=W(e=>e.openConfirmModal),{permissions:o}=qu(),[s,c]=(0,A.useState)(!1),[l,u]=(0,A.useState)(``),[d,f]=(0,A.useState)(``),[p,m]=(0,A.useState)(`normal`),[h,g]=(0,A.useState)(`module`),[_,v]=(0,A.useState)(`krona-omnichannel`),[y]=(0,A.useState)([n[0]?.tenantId||``,n[1]?.tenantId||``].filter(Boolean));return(0,H.jsxs)(`div`,{className:`space-y-4 md:space-y-6`,children:[(0,H.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 border-b border-krona-border pb-4`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`h1`,{className:`text-lg md:text-xl font-bold text-krona-primary flex items-center gap-2`,children:[(0,H.jsx)(To,{className:`w-5 h-5 text-amber-500 shrink-0`}),(0,H.jsx)(`span`,{children:`Оповещения и системные сообщения`})]}),(0,H.jsx)(`p`,{className:`text-xs text-krona-secondary mt-0.5`,children:`Таргетированные сервисные рассылки, уведомления об обновлениях модулей и плановом ТО`})]}),(0,H.jsxs)(`button`,{type:`button`,disabled:!o.canCreateAnnouncements,onClick:()=>c(!s),className:`min-h-[44px] px-4 py-2.5 rounded-lg bg-amber-500 hover:bg-amber-400 text-zinc-950 font-bold text-xs flex items-center justify-center gap-2 transition-colors disabled:opacity-40 shadow-xs shrink-0`,children:[s?(0,H.jsx)(t,{className:`w-4 h-4`}):(0,H.jsx)(sc,{className:`w-4 h-4`}),(0,H.jsx)(`span`,{children:s?`Закрыть редактор`:`Создать оповещение`})]})]}),s&&(0,H.jsxs)(`form`,{onSubmit:e=>{if(e.preventDefault(),!l.trim()||!d.trim())return;let t,r=!1;h===`all`?r=!0:h===`specific`?t=y:h===`module`&&(t=n.slice(0,4).map(e=>e.tenantId)),a({title:`Отправка оповещения: ${l}`,actionName:`announcement.publish_broadcast`,impactSummary:`Оповещение будет доставлено через In-App канал ${r?`всем организациям`:`${t?.length||0} выбранным организациям`}.`,targetType:`announcement`,targetId:`new-announcement`,targetName:l,onConfirm:async e=>{await i({title:l.trim(),body:d.trim(),priority:p,channels:[`in_app`,`comm_adapter`],status:`completed`,validFrom:new Date().toISOString(),validUntil:null,audience:{allTenants:r,tenantIds:t,requiredModuleId:h===`module`?_:void 0}},e),c(!1),u(``),f(``)}})},className:`rounded-xl border border-amber-500/40 bg-krona-surface p-4 md:p-5 space-y-4 shadow-lg animate-in fade-in slide-in-from-top-2`,children:[(0,H.jsxs)(`div`,{className:`flex justify-between items-center border-b border-krona-border pb-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-bold text-krona-primary`,children:[(0,H.jsx)(yc,{className:`w-4 h-4 text-amber-500`}),(0,H.jsx)(`span`,{children:`Конструктор операторского оповещения`})]}),(0,H.jsx)(`span`,{className:`text-[11px] text-amber-600 dark:text-amber-300 font-mono`,children:`ДЕМО: In-App доставка`})]}),(0,H.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4 text-xs`,children:[(0,H.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,H.jsx)(`label`,{className:`font-semibold text-krona-primary`,children:`Заголовок оповещения:`}),(0,H.jsx)(`input`,{type:`text`,required:!0,value:l,onChange:e=>u(e.target.value),placeholder:`Например: Доступно обновление платформы v3.0`,className:`w-full bg-krona-workspace border border-krona-border rounded-lg px-3 py-2.5 text-xs text-krona-primary placeholder:text-krona-secondary/60 focus:outline-hidden focus:border-amber-500 min-h-[44px]`})]}),(0,H.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,H.jsx)(`label`,{className:`font-semibold text-krona-primary`,children:`Приоритет доставки:`}),(0,H.jsxs)(`select`,{value:p,onChange:e=>m(e.target.value),className:`w-full bg-krona-workspace border border-krona-border rounded-lg px-3 py-2.5 text-xs text-krona-primary focus:outline-hidden min-h-[44px]`,children:[(0,H.jsx)(`option`,{value:`normal`,children:`Обычный (Информационный баннер)`}),(0,H.jsx)(`option`,{value:`important`,children:`Важный (Уведомление в шапке)`}),(0,H.jsx)(`option`,{value:`critical`,children:`Критический (Блокирующий диалог)`})]})]})]}),(0,H.jsxs)(`div`,{className:`space-y-2 text-xs`,children:[(0,H.jsx)(`label`,{className:`font-semibold text-krona-primary`,children:`Целевая аудитория организаций:`}),(0,H.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-3 gap-2`,children:[(0,H.jsxs)(`button`,{type:`button`,onClick:()=>g(`all`),className:`min-h-[44px] p-2.5 rounded-lg border text-xs font-medium transition-colors flex items-center justify-center gap-1.5 ${h===`all`?`bg-amber-500/15 text-amber-600 dark:text-amber-300 border-amber-500/50 font-bold`:`bg-krona-workspace text-krona-secondary border-krona-border hover:text-krona-primary`}`,children:[(0,H.jsx)(al,{className:`w-3.5 h-3.5`}),(0,H.jsxs)(`span`,{children:[`Все (`,n.length,`)`]})]}),(0,H.jsx)(`button`,{type:`button`,onClick:()=>g(`module`),className:`min-h-[44px] p-2.5 rounded-lg border text-xs font-medium transition-colors flex items-center justify-center gap-1.5 ${h===`module`?`bg-amber-500/15 text-amber-600 dark:text-amber-300 border-amber-500/50 font-bold`:`bg-krona-workspace text-krona-secondary border-krona-border hover:text-krona-primary`}`,children:(0,H.jsx)(`span`,{children:`По модулю`})}),(0,H.jsx)(`button`,{type:`button`,onClick:()=>g(`specific`),className:`min-h-[44px] p-2.5 rounded-lg border text-xs font-medium transition-colors flex items-center justify-center gap-1.5 ${h===`specific`?`bg-amber-500/15 text-amber-600 dark:text-amber-300 border-amber-500/50 font-bold`:`bg-krona-workspace text-krona-secondary border-krona-border hover:text-krona-primary`}`,children:(0,H.jsxs)(`span`,{children:[`Выборочные (`,y.length,`)`]})})]}),h===`module`&&(0,H.jsxs)(`div`,{className:`pt-2 flex flex-col sm:flex-row sm:items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`text-krona-secondary text-xs`,children:`Выберите модуль:`}),(0,H.jsx)(`select`,{value:_,onChange:e=>v(e.target.value),className:`bg-krona-workspace border border-krona-border rounded-lg px-3 py-2 text-xs text-krona-primary min-h-[44px]`,children:r.map(e=>(0,H.jsx)(`option`,{value:e.moduleId,children:e.name},e.moduleId))})]})]}),(0,H.jsxs)(`div`,{className:`space-y-1.5 text-xs`,children:[(0,H.jsx)(`label`,{className:`font-semibold text-krona-primary`,children:`Текст сообщения:`}),(0,H.jsx)(`textarea`,{required:!0,rows:3,value:d,onChange:e=>f(e.target.value),placeholder:`Введите текст объявления для операторов и пользователей организаций...`,className:`w-full bg-krona-workspace border border-krona-border rounded-lg p-3 text-xs text-krona-primary placeholder:text-krona-secondary/60 focus:outline-hidden focus:border-amber-500 resize-none`})]}),(0,H.jsxs)(`div`,{className:`flex flex-col-reverse sm:flex-row justify-end gap-2 pt-2 border-t border-krona-border`,children:[(0,H.jsx)(`button`,{type:`button`,onClick:()=>c(!1),className:`min-h-[44px] px-4 py-2.5 rounded-lg border border-krona-border text-krona-secondary hover:text-krona-primary text-xs font-medium transition-colors`,children:`Отмена`}),(0,H.jsxs)(`button`,{type:`submit`,className:`min-h-[44px] px-5 py-2.5 rounded-lg bg-amber-500 hover:bg-amber-400 text-zinc-950 font-bold text-xs flex items-center justify-center gap-2 shadow-xs`,children:[(0,H.jsx)(yc,{className:`w-4 h-4`}),(0,H.jsx)(`span`,{children:`Опубликовать с подтверждением`})]})]})]}),(0,H.jsx)(`div`,{className:`space-y-3`,children:e.map(e=>{let t=q[e.priority]||e.priority,n=e.priority===`critical`,r=e.priority===`important`;return(0,H.jsxs)(`div`,{className:`rounded-xl border border-krona-border bg-krona-surface p-4 md:p-5 space-y-3 shadow-xs`,children:[(0,H.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-2 border-b border-krona-border pb-3`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 mb-1`,children:[(0,H.jsx)(`span`,{className:`font-bold text-sm text-krona-primary`,children:e.title}),(0,H.jsx)(X,{status:e.status===`completed`?`healthy`:`warning`,size:`sm`,customLabel:e.status===`completed`?`Доставлено`:`Отправка`}),(0,H.jsx)(`span`,{className:`text-[10px] font-bold px-2 py-0.5 rounded-md border ${n?`bg-rose-500/15 text-rose-600 dark:text-rose-300 border-rose-500/40`:r?`bg-amber-500/15 text-amber-600 dark:text-amber-300 border-amber-500/40`:`bg-krona-workspace text-krona-secondary border-krona-border`}`,children:t})]}),(0,H.jsxs)(`div`,{className:`text-[11px] text-krona-secondary`,children:[`Автор: `,(0,H.jsx)(`span`,{className:`text-krona-primary font-medium`,children:e.author}),` • Опубликовано:`,` `,new Date(e.createdAt).toLocaleDateString(`ru-RU`)]})]}),(0,H.jsx)(`div`,{className:`flex items-center gap-3 text-xs shrink-0 font-mono`,children:(0,H.jsxs)(`div`,{className:`text-left sm:text-right`,children:[(0,H.jsx)(`div`,{className:`text-[10px] text-krona-secondary`,children:`Доставлено`}),(0,H.jsxs)(`div`,{className:`font-bold text-emerald-600 dark:text-emerald-400 flex items-center gap-1`,children:[(0,H.jsx)(Zo,{className:`w-3 h-3 inline`}),(0,H.jsxs)(`span`,{children:[e.stats.delivered,` / `,e.stats.totalTargeted]})]})]})})]}),(0,H.jsx)(`p`,{className:`text-xs text-krona-secondary leading-relaxed`,children:e.body})]},e.announcementId)})})]})},{})},{path:`incidents`,element:(0,H.jsx)(()=>{let e=W(e=>e.incidents),t=W(e=>e.openInspector),[n,r]=(0,A.useState)(`all`),[i,a]=(0,A.useState)(``),o=e.filter(e=>{let t=!i||e.incidentNumber.toLowerCase().includes(i.toLowerCase())||e.summary.toLowerCase().includes(i.toLowerCase())||e.description.toLowerCase().includes(i.toLowerCase()),r=n===`all`||e.status===n;return t&&r}),s=e.filter(e=>e.status!==`resolved`).length,c=e.filter(e=>e.status!==`resolved`&&(e.severity===`critical`||e.severity===`high`)).length;return(0,H.jsxs)(`div`,{className:`space-y-4 md:space-y-6`,children:[(0,H.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 border-b border-krona-border pb-4`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`h1`,{className:`text-lg md:text-xl font-bold text-krona-primary flex items-center gap-2`,children:[(0,H.jsx)($c,{className:`w-5 h-5 text-rose-500 shrink-0`}),(0,H.jsx)(`span`,{children:`Журнал инцидентов платформы`})]}),(0,H.jsx)(`p`,{className:`text-xs text-krona-secondary mt-0.5`,children:`Оперативное реагирование на сбои серверных узлов, деградацию модулей и инфраструктурные аварии`})]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-krona-secondary`,children:[(0,H.jsxs)(`span`,{className:`px-2.5 py-1 rounded-md bg-krona-workspace border border-krona-border`,children:[`Всего: `,(0,H.jsx)(`strong`,{className:`text-krona-primary`,children:e.length})]}),(0,H.jsxs)(`span`,{className:`px-2.5 py-1 rounded-md bg-amber-500/10 border border-amber-500/30 text-amber-500 font-semibold`,children:[`В работе: `,(0,H.jsx)(`strong`,{children:s})]}),c>0&&(0,H.jsxs)(`span`,{className:`px-2.5 py-1 rounded-md bg-rose-500/10 border border-rose-500/30 text-rose-500 font-bold`,children:[`Критических: `,c]})]})]}),(0,H.jsxs)(`div`,{className:`flex flex-col md:flex-row gap-3 items-stretch md:items-center justify-between`,children:[(0,H.jsxs)(`div`,{className:`relative flex-1 max-w-md`,children:[(0,H.jsx)(_c,{className:`w-4 h-4 text-krona-secondary absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none`}),(0,H.jsx)(`input`,{type:`text`,value:i,onChange:e=>a(e.target.value),placeholder:`Поиск по номеру, описанию или теме...`,className:`w-full bg-krona-workspace border border-krona-border rounded-lg pl-9 pr-3 py-2.5 text-xs text-krona-primary placeholder:text-krona-secondary/60 focus:outline-hidden focus:border-amber-500 transition-colors min-h-[44px]`})]}),(0,H.jsx)(`div`,{className:`flex items-center gap-1.5 overflow-x-auto pb-1 text-xs -mx-1 px-1`,children:[{id:`all`,label:`Все инциденты`},{id:`open`,label:`Открытые`},{id:`mitigating`,label:`В процессе`},{id:`resolved`,label:`Устранённые`}].map(e=>(0,H.jsx)(`button`,{onClick:()=>r(e.id),className:`min-h-[44px] px-3.5 py-2 rounded-lg font-medium transition-colors whitespace-nowrap ${n===e.id?`bg-amber-500/15 text-amber-600 dark:text-amber-300 border border-amber-500/40 font-bold shadow-xs`:`bg-krona-workspace text-krona-secondary border border-krona-border hover:text-krona-primary`}`,children:e.label},e.id))})]}),(0,H.jsxs)(`div`,{className:`space-y-3`,children:[o.map(e=>{let n=e.severity===`critical`,r=e.severity===`high`,i=Yu[e.severity]||{label:e.severity,short:e.severity},a=Xu[e.status]||e.status;return(0,H.jsxs)(`div`,{onClick:()=>t(`incident`,e.incidentId),className:`p-4 md:p-5 rounded-xl border bg-krona-surface transition-all cursor-pointer space-y-3 shadow-xs hover:border-amber-500/50 group ${n?`border-rose-500/40 bg-rose-500/5`:r?`border-amber-500/30`:`border-krona-border`}`,children:[(0,H.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-2 border-b border-krona-border pb-3`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`font-mono font-bold text-sm text-krona-primary group-hover:text-amber-500 transition-colors`,children:e.incidentNumber}),(0,H.jsx)(X,{status:e.status,size:`sm`,customLabel:a}),(0,H.jsx)(`span`,{className:`text-[11px] font-bold px-2 py-0.5 rounded-md border font-mono ${n?`bg-rose-500/15 text-rose-600 dark:text-rose-300 border-rose-500/40`:r?`bg-amber-500/15 text-amber-600 dark:text-amber-300 border-amber-500/40`:`bg-sky-500/15 text-sky-600 dark:text-sky-300 border-sky-500/40`}`,children:i.short})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-krona-secondary`,children:[(0,H.jsxs)(`span`,{children:[`Ответственный: `,(0,H.jsx)(`strong`,{className:`text-krona-primary font-medium`,children:e.ownerName})]}),(0,H.jsx)(`span`,{children:`•`}),(0,H.jsx)(`span`,{children:new Date(e.openedAt).toLocaleDateString(`ru-RU`)})]})]}),(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`h3`,{className:`font-bold text-sm text-krona-primary`,children:e.summary}),(0,H.jsx)(`p`,{className:`text-xs text-krona-secondary leading-relaxed line-clamp-2 md:line-clamp-none`,children:e.description})]}),(0,H.jsxs)(`div`,{className:`pt-2 border-t border-krona-border flex flex-col sm:flex-row sm:items-center justify-between gap-3 text-xs text-krona-secondary`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 md:gap-5`,children:[(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,H.jsx)(jo,{className:`w-3.5 h-3.5 text-krona-secondary`}),`Организаций: `,(0,H.jsx)(`strong`,{className:`text-krona-primary font-medium`,children:e.affectedTenantIds.length})]}),(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,H.jsx)(xc,{className:`w-3.5 h-3.5 text-krona-secondary`}),`Узлов: `,(0,H.jsx)(`strong`,{className:`text-krona-primary font-medium`,children:e.affectedServerIds.length})]}),(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,H.jsx)(tc,{className:`w-3.5 h-3.5 text-krona-secondary`}),`Модулей: `,(0,H.jsx)(`strong`,{className:`text-krona-primary font-medium`,children:e.affectedModuleIds.length})]})]}),(0,H.jsxs)(`div`,{className:`inline-flex items-center gap-1 text-xs font-semibold text-amber-500 hover:text-amber-600 transition-colors min-h-[44px]`,children:[(0,H.jsx)(`span`,{children:`Детали расследования`}),(0,H.jsx)(V,{className:`w-4 h-4 group-hover:translate-x-0.5 transition-transform`})]})]})]},e.incidentId)}),o.length===0&&(0,H.jsxs)(`div`,{className:`p-8 rounded-xl border border-krona-border bg-krona-surface text-center space-y-2`,children:[(0,H.jsx)(Tc,{className:`w-8 h-8 text-krona-secondary mx-auto opacity-50`}),(0,H.jsx)(`p`,{className:`text-xs text-krona-secondary`,children:`Инциденты не найдены по выбранным критериям фильтрации`})]})]})]})},{})},{path:`audit`,element:(0,H.jsx)(()=>{let e=W(e=>e.auditLog),{permissions:n}=qu(),[r,i]=(0,A.useState)(``),[a,o]=(0,A.useState)(null),s=e.filter(e=>{let t=Zu[e.action]||``;return!r||e.operatorName.toLowerCase().includes(r.toLowerCase())||e.reason.toLowerCase().includes(r.toLowerCase())||e.action.toLowerCase().includes(r.toLowerCase())||t.toLowerCase().includes(r.toLowerCase())||e.correlationId.toLowerCase().includes(r.toLowerCase())}),c=e.find(e=>e.eventId===a);return(0,H.jsxs)(`div`,{className:`space-y-4 md:space-y-6`,children:[(0,H.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 border-b border-krona-border pb-4`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`h1`,{className:`text-lg md:text-xl font-bold text-krona-primary flex items-center gap-2`,children:[(0,H.jsx)(hs,{className:`w-5 h-5 text-amber-500 shrink-0`}),(0,H.jsx)(`span`,{children:`Неизменяемый журнал аудита действий`})]}),(0,H.jsx)(`p`,{className:`text-xs text-krona-secondary mt-0.5`,children:`Криптографическая цепочка событий (SHA-256 Hash Chain). Записи защищены от редактирования и удаления.`})]}),(0,H.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,H.jsxs)(`button`,{type:`button`,disabled:!n.canExportAudit,onClick:()=>{let t=`data:text/json;charset=utf-8,`+encodeURIComponent(JSON.stringify(e,null,2)),n=document.createElement(`a`);n.setAttribute(`href`,t),n.setAttribute(`download`,`kcc-immutable-audit-${Date.now()}.json`),document.body.appendChild(n),n.click(),n.remove()},className:`min-h-[44px] px-4 py-2.5 rounded-lg bg-krona-surface border border-krona-border hover:bg-krona-workspace text-krona-primary text-xs font-semibold flex items-center justify-center gap-2 transition-colors disabled:opacity-40 shadow-xs`,title:`Экспорт неизменяемого журнала для регулятора/аудитора`,children:[(0,H.jsx)(ds,{className:`w-4 h-4`}),(0,H.jsx)(`span`,{children:`Экспорт JSON`})]})})]}),(0,H.jsxs)(`div`,{className:`rounded-xl border border-emerald-500/40 bg-emerald-500/10 p-3.5 flex flex-col sm:flex-row sm:items-center justify-between gap-2 text-xs text-emerald-600 dark:text-emerald-300`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(Dc,{className:`w-5 h-5 text-emerald-500 shrink-0`}),(0,H.jsxs)(`span`,{children:[`Целостность журнала подтверждена: `,(0,H.jsxs)(`strong`,{children:[e.length,` событий`]}),` в цепочке хешей.`]})]}),(0,H.jsx)(`span`,{className:`font-mono text-[11px] text-emerald-600/80 dark:text-emerald-400/80`,children:`WORM (Write Once, Read Many)`})]}),(0,H.jsxs)(`div`,{className:`relative max-w-md`,children:[(0,H.jsx)(_c,{className:`w-4 h-4 text-krona-secondary absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none`}),(0,H.jsx)(`input`,{type:`text`,value:r,onChange:e=>i(e.target.value),placeholder:`Поиск по оператору, действию или обоснованию...`,className:`w-full bg-krona-workspace border border-krona-border rounded-lg pl-9 pr-3 py-2.5 text-xs text-krona-primary placeholder:text-krona-secondary/60 focus:outline-hidden focus:border-amber-500 transition-colors min-h-[44px]`})]}),(0,H.jsxs)(`div`,{className:`block lg:hidden space-y-3`,children:[s.map(e=>{let t=Zu[e.action]||e.action,n=Ju[e.operatorRole]?.shortLabel||e.operatorRole;return(0,H.jsxs)(`div`,{onClick:()=>o(e.eventId),className:`p-4 rounded-xl border border-krona-border bg-krona-surface space-y-3 cursor-pointer shadow-xs hover:border-amber-500/50 transition-colors`,children:[(0,H.jsxs)(`div`,{className:`flex justify-between items-start gap-2 border-b border-krona-border pb-2.5`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`font-bold text-sm text-krona-primary`,children:t}),(0,H.jsxs)(`div`,{className:`text-[11px] text-krona-secondary font-mono mt-0.5`,children:[e.operatorName,` • `,(0,H.jsx)(`span`,{className:`text-amber-500 font-semibold`,children:n})]})]}),(0,H.jsx)(`div`,{className:`text-right text-[11px] text-krona-secondary font-mono`,children:new Date(e.occurredAt).toLocaleTimeString(`ru-RU`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})})]}),(0,H.jsxs)(`div`,{className:`text-xs text-krona-secondary space-y-1`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,H.jsx)(`span`,{className:`text-krona-secondary/70`,children:`Объект:`}),(0,H.jsx)(`span`,{className:`font-medium text-krona-primary`,children:e.target.displayName||e.target.id})]}),(0,H.jsx)(`div`,{className:`line-clamp-2 text-krona-primary/90 bg-krona-workspace p-2 rounded-lg border border-krona-border`,children:e.reason})]}),(0,H.jsxs)(`div`,{className:`pt-2 border-t border-krona-border flex items-center justify-between text-[11px] text-krona-secondary`,children:[(0,H.jsxs)(`span`,{className:`font-mono text-xs text-krona-secondary flex items-center gap-1`,children:[(0,H.jsx)(Cs,{className:`w-3 h-3 text-amber-500`}),e.hash.slice(0,8),`...`,e.hash.slice(-4)]}),(0,H.jsxs)(`span`,{className:`text-amber-500 font-medium inline-flex items-center gap-0.5`,children:[`Подробнее `,(0,H.jsx)(V,{className:`w-3.5 h-3.5`})]})]})]},e.eventId)}),s.length===0&&(0,H.jsx)(`div`,{className:`p-8 rounded-xl border border-krona-border bg-krona-surface text-center text-xs text-krona-secondary`,children:`Записи аудита не найдены`})]}),(0,H.jsx)(`div`,{className:`hidden lg:block rounded-xl border border-krona-border bg-krona-surface overflow-hidden shadow-xs`,children:(0,H.jsx)(`div`,{className:`overflow-x-auto`,children:(0,H.jsxs)(`table`,{className:`w-full text-left text-xs border-collapse`,children:[(0,H.jsx)(`thead`,{children:(0,H.jsxs)(`tr`,{className:`border-b border-krona-border bg-krona-workspace text-krona-secondary font-semibold uppercase tracking-wider text-[11px]`,children:[(0,H.jsx)(`th`,{className:`py-3 px-4`,children:`Время`}),(0,H.jsx)(`th`,{className:`py-3 px-3`,children:`Оператор / Роль`}),(0,H.jsx)(`th`,{className:`py-3 px-3`,children:`Действие`}),(0,H.jsx)(`th`,{className:`py-3 px-3`,children:`Целевой объект`}),(0,H.jsx)(`th`,{className:`py-3 px-3`,children:`Обоснование`}),(0,H.jsx)(`th`,{className:`py-3 px-3 font-mono`,children:`Correlation ID`}),(0,H.jsx)(`th`,{className:`py-3 px-4 text-right font-mono`,children:`SHA-256 Hash`})]})}),(0,H.jsxs)(`tbody`,{className:`divide-y divide-krona-border/60`,children:[s.map(e=>{let t=Zu[e.action]||e.action,n=Ju[e.operatorRole]?.label||e.operatorRole;return(0,H.jsxs)(`tr`,{onClick:()=>o(e.eventId),className:`hover:bg-krona-workspace/50 cursor-pointer transition-colors`,children:[(0,H.jsx)(`td`,{className:`py-3 px-4 font-mono text-krona-secondary text-[11px] whitespace-nowrap`,children:new Date(e.occurredAt).toLocaleString(`ru-RU`,{day:`2-digit`,month:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}),(0,H.jsxs)(`td`,{className:`py-3 px-3`,children:[(0,H.jsx)(`div`,{className:`font-bold text-krona-primary`,children:e.operatorName}),(0,H.jsx)(`div`,{className:`text-[10px] text-amber-500 font-medium`,children:n})]}),(0,H.jsxs)(`td`,{className:`py-3 px-3`,children:[(0,H.jsx)(`div`,{className:`font-semibold text-krona-primary text-xs`,children:t}),(0,H.jsx)(`div`,{className:`font-mono text-[10px] text-krona-secondary`,children:e.action})]}),(0,H.jsxs)(`td`,{className:`py-3 px-3 text-krona-secondary`,children:[(0,H.jsx)(`span`,{className:`font-semibold text-krona-primary`,children:e.target.displayName||e.target.id}),(0,H.jsxs)(`span`,{className:`text-[10px] text-krona-secondary block font-mono`,children:[`тип: `,e.target.type]})]}),(0,H.jsx)(`td`,{className:`py-3 px-3 text-krona-primary max-w-xs truncate`,title:e.reason,children:e.reason}),(0,H.jsx)(`td`,{className:`py-3 px-3 font-mono text-krona-secondary text-[11px]`,children:e.correlationId}),(0,H.jsxs)(`td`,{className:`py-3 px-4 text-right font-mono text-krona-secondary text-[10px]`,title:e.hash,children:[e.hash.slice(0,10),`...`,e.hash.slice(-6)]})]},e.eventId)}),s.length===0&&(0,H.jsx)(`tr`,{children:(0,H.jsx)(`td`,{colSpan:7,className:`py-8 text-center text-krona-secondary`,children:`Записи аудита не найдены`})})]})]})})}),c&&(0,H.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-xs p-4 animate-in fade-in`,role:`dialog`,"aria-modal":`true`,children:(0,H.jsxs)(`div`,{className:`w-full max-w-xl rounded-xl border border-krona-border bg-krona-surface p-5 md:p-6 text-krona-primary space-y-4 shadow-2xl`,children:[(0,H.jsxs)(`div`,{className:`flex justify-between items-start border-b border-krona-border pb-3`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-xs font-mono text-amber-500`,children:c.eventId}),(0,H.jsx)(`h3`,{className:`text-base font-bold text-krona-primary`,children:Zu[c.action]||c.action})]}),(0,H.jsx)(`button`,{onClick:()=>o(null),className:`min-w-[44px] min-h-[44px] flex items-center justify-center text-krona-secondary hover:text-krona-primary rounded-lg hover:bg-krona-workspace transition-colors`,"aria-label":`Закрыть`,children:(0,H.jsx)(t,{className:`w-5 h-5`})})]}),(0,H.jsxs)(`div`,{className:`space-y-3 text-xs`,children:[(0,H.jsxs)(`div`,{className:`p-3.5 rounded-lg bg-krona-workspace border border-krona-border space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex justify-between text-krona-secondary`,children:[(0,H.jsx)(`span`,{children:`Оператор:`}),(0,H.jsxs)(`span`,{className:`font-semibold text-krona-primary`,children:[c.operatorName,` (`,Ju[c.operatorRole]?.label||c.operatorRole,`)`]})]}),(0,H.jsx)(`div`,{className:`text-krona-secondary`,children:`Обоснование действия:`}),(0,H.jsx)(`div`,{className:`font-medium text-krona-primary p-2 bg-krona-surface rounded-md border border-krona-border`,children:c.reason}),(0,H.jsxs)(`div`,{className:`text-krona-secondary text-[11px] pt-1 border-t border-krona-border`,children:[`Влияние: `,(0,H.jsx)(`span`,{className:`text-amber-500 font-medium`,children:c.impactSummary})]})]}),(0,H.jsxs)(`div`,{className:`p-3.5 rounded-lg bg-krona-workspace border border-krona-border space-y-1.5 font-mono text-[11px]`,children:[(0,H.jsx)(`div`,{className:`text-krona-secondary`,children:`Предыдущий хеш (Previous Hash N-1):`}),(0,H.jsx)(`div`,{className:`text-krona-secondary/80 break-all text-[10px]`,children:c.previousHash}),(0,H.jsx)(`div`,{className:`text-krona-secondary pt-1`,children:`Текущий хеш (SHA-256):`}),(0,H.jsx)(`div`,{className:`text-emerald-600 dark:text-emerald-400 break-all font-bold text-[10px]`,children:c.hash})]})]})]})})]})},{})},{path:`*`,element:(0,H.jsx)(Ou,{})}]},{path:`/`,element:(0,H.jsx)(Pl,{}),errorElement:(0,H.jsx)(`div`,{className:`p-8`,children:(0,H.jsx)(El,{scope:`Маршрутизатор приложения`,children:(0,H.jsx)(Ou,{})})}),children:[{index:!0,element:(0,H.jsx)(Rl,{})},{path:`operations/*`,element:(0,H.jsx)(Bl,{})},{path:`crm/*`,element:(0,H.jsx)(Hl,{})},{path:`sales/*`,element:(0,H.jsx)(Wl,{})},{path:`inventory/*`,element:(0,H.jsx)(Kl,{})},{path:`finance/*`,element:(0,H.jsx)(Jl,{})},{path:`employees/*`,element:(0,H.jsx)(Xl,{})},{path:`communications/*`,element:(0,H.jsx)(Ql,{})},{path:`helpdesk/*`,element:(0,H.jsx)(eu,{})},{path:`tasks/*`,element:(0,H.jsx)(nu,{})},{path:`cms/*`,element:(0,H.jsx)(iu,{})},{path:`marketing/*`,element:(0,H.jsx)(ou,{})},{path:`analytics/*`,element:(0,H.jsx)(su,{})},{path:`automation/*`,element:(0,H.jsx)(lu,{})},{path:`ai/*`,element:(0,H.jsx)(du,{})},{path:`apps/*`,element:(0,H.jsx)(pu,{})},{path:`settings/entities`,element:(0,H.jsx)(_u,{})},{path:`settings/entities/:entityCode/fields`,element:(0,H.jsx)(yu,{})},{path:`settings/entities/:entityCode/forms`,element:(0,H.jsx)(xu,{})},{path:`settings/entities/:entityCode/card`,element:(0,H.jsx)(Cu,{})},{path:`settings/entities/:entityCode/views`,element:(0,H.jsx)(Tu,{})},{path:`settings/*`,element:(0,H.jsx)(hu,{})},{path:`entities/:entityCode`,element:(0,H.jsx)(Du,{})},{path:`entities/:entityCode/:recordId`,element:(0,H.jsx)(Du,{})},{path:`forbidden`,element:(0,H.jsx)(Fl,{})},{path:`403`,element:(0,H.jsx)(Fl,{})},{path:`*`,element:(0,H.jsx)(Ou,{})}]}]),gd=[{id:`tenant_main`,name:`Основной бизнес (Main)`,description:`Главный тенант компании`},{id:`tenant_alpha`,name:`Филиал «Север» (Alpha)`,description:`Северное подразделение`},{id:`tenant_beta`,name:`Филиал «Юг» (Beta)`,description:`Южное подразделение`},{id:`tenant_demo`,name:`Песочница (Demo/Sandbox)`,description:`Тестовая изолированная среда`}],_d=(0,A.createContext)(null),vd=({children:e,initialTenantId:t})=>{let[n,r]=(0,A.useState)(()=>t||k()||`tenant_main`),i=(0,A.useCallback)(e=>{r(e),m(e)},[]);(0,A.useEffect)(()=>{m(n)},[n]);let a=(0,A.useMemo)(()=>gd.find(e=>e.id===n)||{id:n,name:`Тенант ${n}`},[n]),o=(0,A.useMemo)(()=>h({tenantId:n}),[n]),s=(0,A.useCallback)(e=>h({tenantId:n,...e}),[n]),c=(0,A.useMemo)(()=>({currentTenantId:n,currentTenant:a,availableTenants:gd,requestContext:o,switchTenant:i,createContextForCurrentTenant:s}),[n,a,o,i,s]);return(0,H.jsx)(_d.Provider,{value:c,children:e})},yd=({children:e})=>((0,A.useEffect)(()=>{co()},[]),(0,H.jsx)(El,{scope:`Корневое приложение Krona`,children:(0,H.jsx)(vd,{children:(0,H.jsx)(xl,{children:e})})}));function bd(){return(0,H.jsx)(yd,{children:(0,H.jsx)(xa,{router:hd})})}(0,le.createRoot)(document.getElementById(`root`)).render((0,H.jsx)(A.StrictMode,{children:(0,H.jsx)(bd,{})}));export{po as $,Fs as A,Zo as B,lc as C,Ys as D,tc as E,ps as F,Lo as G,V as H,ds as I,Co as J,Fo as K,ls as L,ks as M,Cs as N,qs as O,ys as P,ho as Q,rs as R,dc as S,ac as T,Vo as U,qo as V,zo as W,yo as X,xo as Y,_o as Z,kc as _,hl as a,no as at,hc as b,Zc as c,ka as ct,Gc as d,Lr as dt,uo as et,Vc as f,Br as ft,jc as g,Fc as h,vl as i,ro as it,js as j,Ls as k,Yc as l,Oa as lt,Lc as m,oe as mt,bl as n,to as nt,al as o,Ra as ot,zc as p,Wr as pt,No as q,yl as r,eo as rt,$c as s,za as st,Dl as t,lo as tt,qc as u,Sa as ut,yc as v,sc as w,pc as x,_c as y,ts as z}; |