function Xf(i,u){for(var a=0;ad[p]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}(function(){const u=document.createElement("link").relList;if(u&&u.supports&&u.supports("modulepreload"))return;for(const p of document.querySelectorAll('link[rel="modulepreload"]'))d(p);new MutationObserver(p=>{for(const m of p)if(m.type==="childList")for(const y of m.addedNodes)y.tagName==="LINK"&&y.rel==="modulepreload"&&d(y)}).observe(document,{childList:!0,subtree:!0});function a(p){const m={};return p.integrity&&(m.integrity=p.integrity),p.referrerPolicy&&(m.referrerPolicy=p.referrerPolicy),p.crossOrigin==="use-credentials"?m.credentials="include":p.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function d(p){if(p.ep)return;p.ep=!0;const m=a(p);fetch(p.href,m)}})();function Zf(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var ss={exports:{}},Qr={},as={exports:{}},oe={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var fc;function qf(){if(fc)return oe;fc=1;var i=Symbol.for("react.element"),u=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),y=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),E=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),_=Symbol.iterator;function D(g){return g===null||typeof g!="object"?null:(g=_&&g[_]||g["@@iterator"],typeof g=="function"?g:null)}var O={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},W=Object.assign,P={};function N(g,T,ne){this.props=g,this.context=T,this.refs=P,this.updater=ne||O}N.prototype.isReactComponent={},N.prototype.setState=function(g,T){if(typeof g!="object"&&typeof g!="function"&&g!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,g,T,"setState")},N.prototype.forceUpdate=function(g){this.updater.enqueueForceUpdate(this,g,"forceUpdate")};function V(){}V.prototype=N.prototype;function A(g,T,ne){this.props=g,this.context=T,this.refs=P,this.updater=ne||O}var X=A.prototype=new V;X.constructor=A,W(X,N.prototype),X.isPureReactComponent=!0;var K=Array.isArray,ue=Object.prototype.hasOwnProperty,ae={current:null},je={key:!0,ref:!0,__self:!0,__source:!0};function xe(g,T,ne){var le,ie={},se=null,pe=null;if(T!=null)for(le in T.ref!==void 0&&(pe=T.ref),T.key!==void 0&&(se=""+T.key),T)ue.call(T,le)&&!je.hasOwnProperty(le)&&(ie[le]=T[le]);var ce=arguments.length-2;if(ce===1)ie.children=ne;else if(1>>1,T=U[g];if(0>>1;gp(ie,B))sep(pe,ie)?(U[g]=pe,U[se]=B,g=se):(U[g]=ie,U[le]=B,g=le);else if(sep(pe,B))U[g]=pe,U[se]=B,g=se;else break e}}return G}function p(U,G){var B=U.sortIndex-G.sortIndex;return B!==0?B:U.id-G.id}if(typeof performance=="object"&&typeof performance.now=="function"){var m=performance;i.unstable_now=function(){return m.now()}}else{var y=Date,w=y.now();i.unstable_now=function(){return y.now()-w}}var k=[],E=[],R=1,_=null,D=3,O=!1,W=!1,P=!1,N=typeof setTimeout=="function"?setTimeout:null,V=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function X(U){for(var G=a(E);G!==null;){if(G.callback===null)d(E);else if(G.startTime<=U)d(E),G.sortIndex=G.expirationTime,u(k,G);else break;G=a(E)}}function K(U){if(P=!1,X(U),!W)if(a(k)!==null)W=!0,De(ue);else{var G=a(E);G!==null&&he(K,G.startTime-U)}}function ue(U,G){W=!1,P&&(P=!1,V(xe),xe=-1),O=!0;var B=D;try{for(X(G),_=a(k);_!==null&&(!(_.expirationTime>G)||U&&!Ye());){var g=_.callback;if(typeof g=="function"){_.callback=null,D=_.priorityLevel;var T=g(_.expirationTime<=G);G=i.unstable_now(),typeof T=="function"?_.callback=T:_===a(k)&&d(k),X(G)}else d(k);_=a(k)}if(_!==null)var ne=!0;else{var le=a(E);le!==null&&he(K,le.startTime-G),ne=!1}return ne}finally{_=null,D=B,O=!1}}var ae=!1,je=null,xe=-1,Ke=5,Ie=-1;function Ye(){return!(i.unstable_now()-IeU||125g?(U.sortIndex=B,u(E,U),a(k)===null&&U===a(E)&&(P?(V(xe),xe=-1):P=!0,he(K,B-g))):(U.sortIndex=T,u(k,U),W||O||(W=!0,De(ue))),U},i.unstable_shouldYield=Ye,i.unstable_wrapCallback=function(U){var G=D;return function(){var B=D;D=G;try{return U.apply(this,arguments)}finally{D=B}}}})(ds)),ds}var gc;function lp(){return gc||(gc=1,cs.exports=rp()),cs.exports}/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var yc;function op(){if(yc)return at;yc=1;var i=ws(),u=lp();function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),k=Object.prototype.hasOwnProperty,E=/^[: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]*$/,R={},_={};function D(e){return k.call(_,e)?!0:k.call(R,e)?!1:E.test(e)?_[e]=!0:(R[e]=!0,!1)}function O(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function W(e,t,n,r){if(t===null||typeof t>"u"||O(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function P(e,t,n,r,l,o,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var N={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){N[e]=new P(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];N[t]=new P(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){N[e]=new P(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){N[e]=new P(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){N[e]=new P(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){N[e]=new P(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){N[e]=new P(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){N[e]=new P(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){N[e]=new P(e,5,!1,e.toLowerCase(),null,!1,!1)});var V=/[\-:]([a-z])/g;function A(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(V,A);N[t]=new P(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(V,A);N[t]=new P(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(V,A);N[t]=new P(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){N[e]=new P(e,1,!1,e.toLowerCase(),null,!1,!1)}),N.xlinkHref=new P("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){N[e]=new P(e,1,!1,e.toLowerCase(),null,!0,!0)});function X(e,t,n,r){var l=N.hasOwnProperty(t)?N[t]:null;(l!==null?l.type!==0:r||!(2f||l[s]!==o[f]){var h=` `+l[s].replace(" at new "," at ");return e.displayName&&h.includes("")&&(h=h.replace("",e.displayName)),h}while(1<=s&&0<=f);break}}}finally{ne=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?T(e):""}function ie(e){switch(e.tag){case 5:return T(e.type);case 16:return T("Lazy");case 13:return T("Suspense");case 19:return T("SuspenseList");case 0:case 2:case 15:return e=le(e.type,!1),e;case 11:return e=le(e.type.render,!1),e;case 1:return e=le(e.type,!0),e;default:return""}}function se(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case je:return"Fragment";case ae:return"Portal";case Ke:return"Profiler";case xe:return"StrictMode";case Pe:return"Suspense";case Fe:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ye:return(e.displayName||"Context")+".Consumer";case Ie:return(e._context.displayName||"Context")+".Provider";case ze:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Je:return t=e.displayName||null,t!==null?t:se(e.type)||"Memo";case De:t=e._payload,e=e._init;try{return se(e(t))}catch{}}return null}function pe(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return se(t);case 8:return t===xe?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ce(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ve(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ve(e){var t=ve(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function $t(e){e._valueTracker||(e._valueTracker=Ve(e))}function Pn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ve(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Nt(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function pn(e,t){var n=t.checked;return B({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Tn(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ce(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function re(e,t){t=t.checked,t!=null&&X(e,"checked",t,!1)}function me(e,t){re(e,t);var n=ce(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?I(e,t.type,n):t.hasOwnProperty("defaultValue")&&I(e,t.type,ce(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function be(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function I(e,t,n){(t!=="number"||Nt(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var b=Array.isArray;function ee(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=br.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function sr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ar={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},bc=["Webkit","ms","Moz","O"];Object.keys(ar).forEach(function(e){bc.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ar[t]=ar[e]})});function Ns(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ar.hasOwnProperty(e)&&ar[e]?(""+t).trim():t+"px"}function Ps(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=Ns(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var ed=B({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function xo(e,t){if(t){if(ed[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(a(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(a(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(a(61))}if(t.style!=null&&typeof t.style!="object")throw Error(a(62))}}function ko(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var So=null;function wo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var jo=null,Rn=null,zn=null;function Ts(e){if(e=Rr(e)){if(typeof jo!="function")throw Error(a(280));var t=e.stateNode;t&&(t=wl(t),jo(e.stateNode,e.type,t))}}function Rs(e){Rn?zn?zn.push(e):zn=[e]:Rn=e}function zs(){if(Rn){var e=Rn,t=zn;if(zn=Rn=null,Ts(e),t)for(e=0;e>>=0,e===0?32:31-(dd(e)/fd|0)|0}var ll=64,ol=4194304;function fr(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function il(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,o=e.pingedLanes,s=n&268435455;if(s!==0){var f=s&~l;f!==0?r=fr(f):(o&=s,o!==0&&(r=fr(o)))}else s=n&~l,s!==0?r=fr(s):o!==0&&(r=fr(o));if(r===0)return 0;if(t!==0&&t!==r&&(t&l)===0&&(l=r&-r,o=t&-t,l>=o||l===16&&(o&4194240)!==0))return t;if((r&4)!==0&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function pr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-kt(t),e[t]=n}function vd(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Sr),oa=" ",ia=!1;function sa(e,t){switch(e){case"keyup":return Hd.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function aa(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Dn=!1;function Kd(e,t){switch(e){case"compositionend":return aa(t);case"keypress":return t.which!==32?null:(ia=!0,oa);case"textInput":return e=t.data,e===oa&&ia?null:e;default:return null}}function Yd(e,t){if(Dn)return e==="compositionend"||!Ao&&sa(e,t)?(e=bs(),dl=Mo=Yt=null,Dn=!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)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ma(n)}}function ga(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ga(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ya(){for(var e=window,t=Nt();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Nt(e.document)}return t}function Ho(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function nf(e){var t=ya(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ga(n.ownerDocument.documentElement,n)){if(r!==null&&Ho(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,o=Math.min(r.start,l);r=r.end===void 0?o:Math.min(r.end,l),!e.extend&&o>r&&(l=r,r=o,o=l),l=va(n,o);var s=va(n,r);l&&s&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Mn=null,Qo=null,Er=null,Ko=!1;function xa(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ko||Mn==null||Mn!==Nt(r)||(r=Mn,"selectionStart"in r&&Ho(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}),Er&&Cr(Er,r)||(Er=r,r=xl(Qo,"onSelect"),0Bn||(e.current=li[Bn],li[Bn]=null,Bn--)}function ye(e,t){Bn++,li[Bn]=e.current,e.current=t}var Zt={},Ge=Xt(Zt),rt=Xt(!1),gn=Zt;function An(e,t){var n=e.type.contextTypes;if(!n)return Zt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},o;for(o in n)l[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function lt(e){return e=e.childContextTypes,e!=null}function jl(){we(rt),we(Ge)}function Da(e,t,n){if(Ge.current!==Zt)throw Error(a(168));ye(Ge,t),ye(rt,n)}function Ma(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(a(108,pe(e)||"Unknown",l));return B({},n,r)}function Cl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Zt,gn=Ge.current,ye(Ge,e),ye(rt,rt.current),!0}function Ia(e,t,n){var r=e.stateNode;if(!r)throw Error(a(169));n?(e=Ma(e,t,gn),r.__reactInternalMemoizedMergedChildContext=e,we(rt),we(Ge),ye(Ge,e)):we(rt),ye(rt,n)}var Dt=null,El=!1,oi=!1;function Fa(e){Dt===null?Dt=[e]:Dt.push(e)}function mf(e){El=!0,Fa(e)}function qt(){if(!oi&&Dt!==null){oi=!0;var e=0,t=ge;try{var n=Dt;for(ge=1;e>=s,l-=s,Mt=1<<32-kt(t)+l|n<te?($e=q,q=null):$e=q.sibling;var fe=z(x,q,S[te],F);if(fe===null){q===null&&(q=$e);break}e&&q&&fe.alternate===null&&t(x,q),v=o(fe,v,te),Z===null?J=fe:Z.sibling=fe,Z=fe,q=$e}if(te===S.length)return n(x,q),Ce&&xn(x,te),J;if(q===null){for(;tete?($e=q,q=null):$e=q.sibling;var an=z(x,q,fe.value,F);if(an===null){q===null&&(q=$e);break}e&&q&&an.alternate===null&&t(x,q),v=o(an,v,te),Z===null?J=an:Z.sibling=an,Z=an,q=$e}if(fe.done)return n(x,q),Ce&&xn(x,te),J;if(q===null){for(;!fe.done;te++,fe=S.next())fe=M(x,fe.value,F),fe!==null&&(v=o(fe,v,te),Z===null?J=fe:Z.sibling=fe,Z=fe);return Ce&&xn(x,te),J}for(q=r(x,q);!fe.done;te++,fe=S.next())fe=$(q,x,te,fe.value,F),fe!==null&&(e&&fe.alternate!==null&&q.delete(fe.key===null?te:fe.key),v=o(fe,v,te),Z===null?J=fe:Z.sibling=fe,Z=fe);return e&&q.forEach(function(Gf){return t(x,Gf)}),Ce&&xn(x,te),J}function Oe(x,v,S,F){if(typeof S=="object"&&S!==null&&S.type===je&&S.key===null&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case ue:e:{for(var J=S.key,Z=v;Z!==null;){if(Z.key===J){if(J=S.type,J===je){if(Z.tag===7){n(x,Z.sibling),v=l(Z,S.props.children),v.return=x,x=v;break e}}else if(Z.elementType===J||typeof J=="object"&&J!==null&&J.$$typeof===De&&Va(J)===Z.type){n(x,Z.sibling),v=l(Z,S.props),v.ref=zr(x,Z,S),v.return=x,x=v;break e}n(x,Z);break}else t(x,Z);Z=Z.sibling}S.type===je?(v=Nn(S.props.children,x.mode,F,S.key),v.return=x,x=v):(F=bl(S.type,S.key,S.props,null,x.mode,F),F.ref=zr(x,v,S),F.return=x,x=F)}return s(x);case ae:e:{for(Z=S.key;v!==null;){if(v.key===Z)if(v.tag===4&&v.stateNode.containerInfo===S.containerInfo&&v.stateNode.implementation===S.implementation){n(x,v.sibling),v=l(v,S.children||[]),v.return=x,x=v;break e}else{n(x,v);break}else t(x,v);v=v.sibling}v=ns(S,x.mode,F),v.return=x,x=v}return s(x);case De:return Z=S._init,Oe(x,v,Z(S._payload),F)}if(b(S))return Q(x,v,S,F);if(G(S))return Y(x,v,S,F);Tl(x,S)}return typeof S=="string"&&S!==""||typeof S=="number"?(S=""+S,v!==null&&v.tag===6?(n(x,v.sibling),v=l(v,S),v.return=x,x=v):(n(x,v),v=ts(S,x.mode,F),v.return=x,x=v),s(x)):n(x,v)}return Oe}var Qn=Ha(!0),Qa=Ha(!1),Rl=Xt(null),zl=null,Kn=null,di=null;function fi(){di=Kn=zl=null}function pi(e){var t=Rl.current;we(Rl),e._currentValue=t}function hi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Yn(e,t){zl=e,di=Kn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(ot=!0),e.firstContext=null)}function vt(e){var t=e._currentValue;if(di!==e)if(e={context:e,memoizedValue:t,next:null},Kn===null){if(zl===null)throw Error(a(308));Kn=e,zl.dependencies={lanes:0,firstContext:e}}else Kn=Kn.next=e;return t}var kn=null;function mi(e){kn===null?kn=[e]:kn.push(e)}function Ka(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,mi(t)):(n.next=l.next,l.next=n),t.interleaved=n,Ft(e,r)}function Ft(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var bt=!1;function vi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ya(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Wt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function en(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(de&2)!==0){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,Ft(e,n)}return l=r.interleaved,l===null?(t.next=t,mi(r)):(t.next=l.next,l.next=t),r.interleaved=t,Ft(e,n)}function Ll(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ro(e,n)}}function Ja(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?l=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?l=o=t:o=o.next=t}else l=o=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ol(e,t,n,r){var l=e.updateQueue;bt=!1;var o=l.firstBaseUpdate,s=l.lastBaseUpdate,f=l.shared.pending;if(f!==null){l.shared.pending=null;var h=f,j=h.next;h.next=null,s===null?o=j:s.next=j,s=h;var L=e.alternate;L!==null&&(L=L.updateQueue,f=L.lastBaseUpdate,f!==s&&(f===null?L.firstBaseUpdate=j:f.next=j,L.lastBaseUpdate=h))}if(o!==null){var M=l.baseState;s=0,L=j=h=null,f=o;do{var z=f.lane,$=f.eventTime;if((r&z)===z){L!==null&&(L=L.next={eventTime:$,lane:0,tag:f.tag,payload:f.payload,callback:f.callback,next:null});e:{var Q=e,Y=f;switch(z=t,$=n,Y.tag){case 1:if(Q=Y.payload,typeof Q=="function"){M=Q.call($,M,z);break e}M=Q;break e;case 3:Q.flags=Q.flags&-65537|128;case 0:if(Q=Y.payload,z=typeof Q=="function"?Q.call($,M,z):Q,z==null)break e;M=B({},M,z);break e;case 2:bt=!0}}f.callback!==null&&f.lane!==0&&(e.flags|=64,z=l.effects,z===null?l.effects=[f]:z.push(f))}else $={eventTime:$,lane:z,tag:f.tag,payload:f.payload,callback:f.callback,next:null},L===null?(j=L=$,h=M):L=L.next=$,s|=z;if(f=f.next,f===null){if(f=l.shared.pending,f===null)break;z=f,f=z.next,z.next=null,l.lastBaseUpdate=z,l.shared.pending=null}}while(!0);if(L===null&&(h=M),l.baseState=h,l.firstBaseUpdate=j,l.lastBaseUpdate=L,t=l.shared.interleaved,t!==null){l=t;do s|=l.lane,l=l.next;while(l!==t)}else o===null&&(l.shared.lanes=0);jn|=s,e.lanes=s,e.memoizedState=M}}function Ga(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Si.transition;Si.transition={};try{e(!1),t()}finally{ge=n,Si.transition=r}}function hu(){return gt().memoizedState}function xf(e,t,n){var r=ln(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},mu(e))vu(t,n);else if(n=Ka(e,t,n,r),n!==null){var l=tt();_t(n,e,r,l),gu(n,t,r)}}function kf(e,t,n){var r=ln(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(mu(e))vu(t,l);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,f=o(s,n);if(l.hasEagerState=!0,l.eagerState=f,St(f,s)){var h=t.interleaved;h===null?(l.next=l,mi(t)):(l.next=h.next,h.next=l),t.interleaved=l;return}}catch{}finally{}n=Ka(e,t,l,r),n!==null&&(l=tt(),_t(n,e,r,l),gu(n,t,r))}}function mu(e){var t=e.alternate;return e===_e||t!==null&&t===_e}function vu(e,t){Mr=Il=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function gu(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ro(e,n)}}var Ul={readContext:vt,useCallback:Xe,useContext:Xe,useEffect:Xe,useImperativeHandle:Xe,useInsertionEffect:Xe,useLayoutEffect:Xe,useMemo:Xe,useReducer:Xe,useRef:Xe,useState:Xe,useDebugValue:Xe,useDeferredValue:Xe,useTransition:Xe,useMutableSource:Xe,useSyncExternalStore:Xe,useId:Xe,unstable_isNewReconciler:!1},Sf={readContext:vt,useCallback:function(e,t){return zt().memoizedState=[e,t===void 0?null:t],e},useContext:vt,useEffect:iu,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Fl(4194308,4,uu.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Fl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Fl(4,2,e,t)},useMemo:function(e,t){var n=zt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=zt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=xf.bind(null,_e,e),[r.memoizedState,e]},useRef:function(e){var t=zt();return e={current:e},t.memoizedState=e},useState:lu,useDebugValue:Pi,useDeferredValue:function(e){return zt().memoizedState=e},useTransition:function(){var e=lu(!1),t=e[0];return e=yf.bind(null,e[1]),zt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=_e,l=zt();if(Ce){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),Ae===null)throw Error(a(349));(wn&30)!==0||ba(r,t,n)}l.memoizedState=n;var o={value:n,getSnapshot:t};return l.queue=o,iu(tu.bind(null,r,o,e),[e]),r.flags|=2048,Wr(9,eu.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=zt(),t=Ae.identifierPrefix;if(Ce){var n=It,r=Mt;n=(r&~(1<<32-kt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ir++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Tt]=t,e[Tr]=r,Fu(e,t,!1,!1),t.stateNode=e;e:{switch(s=ko(n,r),n){case"dialog":Se("cancel",e),Se("close",e),l=r;break;case"iframe":case"object":case"embed":Se("load",e),l=r;break;case"video":case"audio":for(l=0;l<_r.length;l++)Se(_r[l],e);l=r;break;case"source":Se("error",e),l=r;break;case"img":case"image":case"link":Se("error",e),Se("load",e),l=r;break;case"details":Se("toggle",e),l=r;break;case"input":Tn(e,r),l=pn(e,r),Se("invalid",e);break;case"option":l=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},l=B({},r,{value:void 0}),Se("invalid",e);break;case"textarea":Te(e,r),l=ke(e,r),Se("invalid",e);break;default:l=r}xo(n,l),f=l;for(o in f)if(f.hasOwnProperty(o)){var h=f[o];o==="style"?Ps(e,h):o==="dangerouslySetInnerHTML"?(h=h?h.__html:void 0,h!=null&&_s(e,h)):o==="children"?typeof h=="string"?(n!=="textarea"||h!=="")&&sr(e,h):typeof h=="number"&&sr(e,""+h):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(p.hasOwnProperty(o)?h!=null&&o==="onScroll"&&Se("scroll",e):h!=null&&X(e,o,h,s))}switch(n){case"input":$t(e),be(e,r,!1);break;case"textarea":$t(e),ir(e);break;case"option":r.value!=null&&e.setAttribute("value",""+ce(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?ee(e,!!r.multiple,o,!1):r.defaultValue!=null&&ee(e,!!r.multiple,r.defaultValue,!0);break;default:typeof l.onClick=="function"&&(e.onclick=Sl)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Ze(t),null;case 6:if(e&&t.stateNode!=null)Uu(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(a(166));if(n=Sn(Dr.current),Sn(Rt.current),Pl(t)){if(r=t.stateNode,n=t.memoizedProps,r[Tt]=t,(o=r.nodeValue!==n)&&(e=dt,e!==null))switch(e.tag){case 3:kl(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&kl(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Tt]=t,t.stateNode=r}return Ze(t),null;case 13:if(we(Ee),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ce&&ft!==null&&(t.mode&1)!==0&&(t.flags&128)===0)$a(),Hn(),t.flags|=98560,o=!1;else if(o=Pl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(a(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(a(317));o[Tt]=t}else Hn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ze(t),o=!1}else wt!==null&&(Xi(wt),wt=null),o=!0;if(!o)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(Ee.current&1)!==0?Ue===0&&(Ue=3):bi())),t.updateQueue!==null&&(t.flags|=4),Ze(t),null);case 4:return Jn(),Ui(e,t),e===null&&Nr(t.stateNode.containerInfo),Ze(t),null;case 10:return pi(t.type._context),Ze(t),null;case 17:return lt(t.type)&&jl(),Ze(t),null;case 19:if(we(Ee),o=t.memoizedState,o===null)return Ze(t),null;if(r=(t.flags&128)!==0,s=o.rendering,s===null)if(r)Ur(o,!1);else{if(Ue!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=Dl(e),s!==null){for(t.flags|=128,Ur(o,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,s=o.alternate,s===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=s.childLanes,o.lanes=s.lanes,o.child=s.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=s.memoizedProps,o.memoizedState=s.memoizedState,o.updateQueue=s.updateQueue,o.type=s.type,e=s.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ye(Ee,Ee.current&1|2),t.child}e=e.sibling}o.tail!==null&&Le()>qn&&(t.flags|=128,r=!0,Ur(o,!1),t.lanes=4194304)}else{if(!r)if(e=Dl(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ur(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!Ce)return Ze(t),null}else 2*Le()-o.renderingStartTime>qn&&n!==1073741824&&(t.flags|=128,r=!0,Ur(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(n=o.last,n!==null?n.sibling=s:t.child=s,o.last=s)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Le(),t.sibling=null,n=Ee.current,ye(Ee,r?n&1|2:n&1),t):(Ze(t),null);case 22:case 23:return qi(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(pt&1073741824)!==0&&(Ze(t),t.subtreeFlags&6&&(t.flags|=8192)):Ze(t),null;case 24:return null;case 25:return null}throw Error(a(156,t.tag))}function Tf(e,t){switch(si(t),t.tag){case 1:return lt(t.type)&&jl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Jn(),we(rt),we(Ge),ki(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return yi(t),null;case 13:if(we(Ee),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));Hn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return we(Ee),null;case 4:return Jn(),null;case 10:return pi(t.type._context),null;case 22:case 23:return qi(),null;case 24:return null;default:return null}}var Vl=!1,qe=!1,Rf=typeof WeakSet=="function"?WeakSet:Set,H=null;function Xn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Re(e,t,r)}else n.current=null}function Bi(e,t,n){try{n()}catch(r){Re(e,t,r)}}var Bu=!1;function zf(e,t){if(qo=ul,e=ya(),Ho(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,f=-1,h=-1,j=0,L=0,M=e,z=null;t:for(;;){for(var $;M!==n||l!==0&&M.nodeType!==3||(f=s+l),M!==o||r!==0&&M.nodeType!==3||(h=s+r),M.nodeType===3&&(s+=M.nodeValue.length),($=M.firstChild)!==null;)z=M,M=$;for(;;){if(M===e)break t;if(z===n&&++j===l&&(f=s),z===o&&++L===r&&(h=s),($=M.nextSibling)!==null)break;M=z,z=M.parentNode}M=$}n=f===-1||h===-1?null:{start:f,end:h}}else n=null}n=n||{start:0,end:0}}else n=null;for(bo={focusedElem:e,selectionRange:n},ul=!1,H=t;H!==null;)if(t=H,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,H=e;else for(;H!==null;){t=H;try{var Q=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(Q!==null){var Y=Q.memoizedProps,Oe=Q.memoizedState,x=t.stateNode,v=x.getSnapshotBeforeUpdate(t.elementType===t.type?Y:jt(t.type,Y),Oe);x.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var S=t.stateNode.containerInfo;S.nodeType===1?S.textContent="":S.nodeType===9&&S.documentElement&&S.removeChild(S.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(F){Re(t,t.return,F)}if(e=t.sibling,e!==null){e.return=t.return,H=e;break}H=t.return}return Q=Bu,Bu=!1,Q}function Br(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var o=l.destroy;l.destroy=void 0,o!==void 0&&Bi(t,n,o)}l=l.next}while(l!==r)}}function Hl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Ai(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Au(e){var t=e.alternate;t!==null&&(e.alternate=null,Au(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Tt],delete t[Tr],delete t[ri],delete t[pf],delete t[hf])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function $u(e){return e.tag===5||e.tag===3||e.tag===4}function Vu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||$u(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function $i(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Sl));else if(r!==4&&(e=e.child,e!==null))for($i(e,t,n),e=e.sibling;e!==null;)$i(e,t,n),e=e.sibling}function Vi(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Vi(e,t,n),e=e.sibling;e!==null;)Vi(e,t,n),e=e.sibling}var He=null,Ct=!1;function tn(e,t,n){for(n=n.child;n!==null;)Hu(e,t,n),n=n.sibling}function Hu(e,t,n){if(Pt&&typeof Pt.onCommitFiberUnmount=="function")try{Pt.onCommitFiberUnmount(rl,n)}catch{}switch(n.tag){case 5:qe||Xn(n,t);case 6:var r=He,l=Ct;He=null,tn(e,t,n),He=r,Ct=l,He!==null&&(Ct?(e=He,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):He.removeChild(n.stateNode));break;case 18:He!==null&&(Ct?(e=He,n=n.stateNode,e.nodeType===8?ni(e.parentNode,n):e.nodeType===1&&ni(e,n),yr(e)):ni(He,n.stateNode));break;case 4:r=He,l=Ct,He=n.stateNode.containerInfo,Ct=!0,tn(e,t,n),He=r,Ct=l;break;case 0:case 11:case 14:case 15:if(!qe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var o=l,s=o.destroy;o=o.tag,s!==void 0&&((o&2)!==0||(o&4)!==0)&&Bi(n,t,s),l=l.next}while(l!==r)}tn(e,t,n);break;case 1:if(!qe&&(Xn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(f){Re(n,t,f)}tn(e,t,n);break;case 21:tn(e,t,n);break;case 22:n.mode&1?(qe=(r=qe)||n.memoizedState!==null,tn(e,t,n),qe=r):tn(e,t,n);break;default:tn(e,t,n)}}function Qu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Rf),t.forEach(function(r){var l=Bf.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function Et(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=s),r&=~o}if(r=l,r=Le()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Of(r/1960))-r,10e?16:e,rn===null)var r=!1;else{if(e=rn,rn=null,Gl=0,(de&6)!==0)throw Error(a(331));var l=de;for(de|=4,H=e.current;H!==null;){var o=H,s=o.child;if((H.flags&16)!==0){var f=o.deletions;if(f!==null){for(var h=0;hLe()-Ki?En(e,0):Qi|=n),st(e,t)}function lc(e,t){t===0&&((e.mode&1)===0?t=1:(t=ol,ol<<=1,(ol&130023424)===0&&(ol=4194304)));var n=tt();e=Ft(e,t),e!==null&&(pr(e,t,n),st(e,n))}function Uf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),lc(e,n)}function Bf(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(a(314))}r!==null&&r.delete(t),lc(e,n)}var oc;oc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||rt.current)ot=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return ot=!1,Nf(e,t,n);ot=(e.flags&131072)!==0}else ot=!1,Ce&&(t.flags&1048576)!==0&&Wa(t,Nl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;$l(e,t),e=t.pendingProps;var l=An(t,Ge.current);Yn(t,n),l=ji(null,t,r,e,l,n);var o=Ci();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,lt(r)?(o=!0,Cl(t)):o=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,vi(t),l.updater=Bl,t.stateNode=l,l._reactInternals=t,Ri(t,r,e,n),t=Di(null,t,r,!0,o,n)):(t.tag=0,Ce&&o&&ii(t),et(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch($l(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=$f(r),e=jt(r,e),l){case 0:t=Oi(null,t,r,e,n);break e;case 1:t=zu(null,t,r,e,n);break e;case 11:t=_u(null,t,r,e,n);break e;case 14:t=Nu(null,t,r,jt(r.type,e),n);break e}throw Error(a(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:jt(r,l),Oi(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:jt(r,l),zu(e,t,r,l,n);case 3:e:{if(Lu(t),e===null)throw Error(a(387));r=t.pendingProps,o=t.memoizedState,l=o.element,Ya(e,t),Ol(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){l=Gn(Error(a(423)),t),t=Ou(e,t,r,n,l);break e}else if(r!==l){l=Gn(Error(a(424)),t),t=Ou(e,t,r,n,l);break e}else for(ft=Gt(t.stateNode.containerInfo.firstChild),dt=t,Ce=!0,wt=null,n=Qa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Hn(),r===l){t=Ut(e,t,n);break e}et(e,t,r,n)}t=t.child}return t;case 5:return Xa(t),e===null&&ui(t),r=t.type,l=t.pendingProps,o=e!==null?e.memoizedProps:null,s=l.children,ei(r,l)?s=null:o!==null&&ei(r,o)&&(t.flags|=32),Ru(e,t),et(e,t,s,n),t.child;case 6:return e===null&&ui(t),null;case 13:return Du(e,t,n);case 4:return gi(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Qn(t,null,r,n):et(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:jt(r,l),_u(e,t,r,l,n);case 7:return et(e,t,t.pendingProps,n),t.child;case 8:return et(e,t,t.pendingProps.children,n),t.child;case 12:return et(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,o=t.memoizedProps,s=l.value,ye(Rl,r._currentValue),r._currentValue=s,o!==null)if(St(o.value,s)){if(o.children===l.children&&!rt.current){t=Ut(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var f=o.dependencies;if(f!==null){s=o.child;for(var h=f.firstContext;h!==null;){if(h.context===r){if(o.tag===1){h=Wt(-1,n&-n),h.tag=2;var j=o.updateQueue;if(j!==null){j=j.shared;var L=j.pending;L===null?h.next=h:(h.next=L.next,L.next=h),j.pending=h}}o.lanes|=n,h=o.alternate,h!==null&&(h.lanes|=n),hi(o.return,n,t),f.lanes|=n;break}h=h.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(a(341));s.lanes|=n,f=s.alternate,f!==null&&(f.lanes|=n),hi(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}et(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,Yn(t,n),l=vt(l),r=r(l),t.flags|=1,et(e,t,r,n),t.child;case 14:return r=t.type,l=jt(r,t.pendingProps),l=jt(r.type,l),Nu(e,t,r,l,n);case 15:return Pu(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:jt(r,l),$l(e,t),t.tag=1,lt(r)?(e=!0,Cl(t)):e=!1,Yn(t,n),xu(t,r,l),Ri(t,r,l,n),Di(null,t,r,!0,e,n);case 19:return Iu(e,t,n);case 22:return Tu(e,t,n)}throw Error(a(156,t.tag))};function ic(e,t){return Us(e,t)}function Af(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.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 xt(e,t,n,r){return new Af(e,t,n,r)}function es(e){return e=e.prototype,!(!e||!e.isReactComponent)}function $f(e){if(typeof e=="function")return es(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ze)return 11;if(e===Je)return 14}return 2}function sn(e,t){var n=e.alternate;return n===null?(n=xt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function bl(e,t,n,r,l,o){var s=2;if(r=e,typeof e=="function")es(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case je:return Nn(n.children,l,o,t);case xe:s=8,l|=8;break;case Ke:return e=xt(12,n,t,l|2),e.elementType=Ke,e.lanes=o,e;case Pe:return e=xt(13,n,t,l),e.elementType=Pe,e.lanes=o,e;case Fe:return e=xt(19,n,t,l),e.elementType=Fe,e.lanes=o,e;case he:return eo(n,l,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ie:s=10;break e;case Ye:s=9;break e;case ze:s=11;break e;case Je:s=14;break e;case De:s=16,r=null;break e}throw Error(a(130,e==null?e:typeof e,""))}return t=xt(s,n,t,l),t.elementType=e,t.type=r,t.lanes=o,t}function Nn(e,t,n,r){return e=xt(7,e,r,t),e.lanes=n,e}function eo(e,t,n,r){return e=xt(22,e,r,t),e.elementType=he,e.lanes=n,e.stateNode={isHidden:!1},e}function ts(e,t,n){return e=xt(6,e,null,t),e.lanes=n,e}function ns(e,t,n){return t=xt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Vf(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=To(0),this.expirationTimes=To(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=To(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function rs(e,t,n,r,l,o,s,f,h){return e=new Vf(e,t,n,f,h),t===1?(t=1,o===!0&&(t|=8)):t=0,o=xt(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},vi(o),e}function Hf(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(u){console.error(u)}}return i(),us.exports=op(),us.exports}var kc;function ip(){if(kc)return so;kc=1;var i=Fc();return so.createRoot=i.createRoot,so.hydrateRoot=i.hydrateRoot,so}var sp=ip();Fc();/** * @remix-run/router v1.23.3 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Gr(){return Gr=Object.assign?Object.assign.bind():function(i){for(var u=1;u"u")throw new Error(u)}function js(i,u){if(!i){typeof console<"u"&&console.warn(u);try{throw new Error(u)}catch{}}}function up(){return Math.random().toString(36).substr(2,8)}function wc(i,u){return{usr:i.state,key:i.key,idx:u}}function gs(i,u,a,d){return a===void 0&&(a=null),Gr({pathname:typeof i=="string"?i:i.pathname,search:"",hash:""},typeof u=="string"?rr(u):u,{state:a,key:u&&u.key||d||up()})}function fo(i){let{pathname:u="/",search:a="",hash:d=""}=i;return a&&a!=="?"&&(u+=a.charAt(0)==="?"?a:"?"+a),d&&d!=="#"&&(u+=d.charAt(0)==="#"?d:"#"+d),u}function rr(i){let u={};if(i){let a=i.indexOf("#");a>=0&&(u.hash=i.substr(a),i=i.substr(0,a));let d=i.indexOf("?");d>=0&&(u.search=i.substr(d),i=i.substr(0,d)),i&&(u.pathname=i)}return u}function cp(i,u,a,d){d===void 0&&(d={});let{window:p=document.defaultView,v5Compat:m=!1}=d,y=p.history,w=cn.Pop,k=null,E=R();E==null&&(E=0,y.replaceState(Gr({},y.state,{idx:E}),""));function R(){return(y.state||{idx:null}).idx}function _(){w=cn.Pop;let N=R(),V=N==null?null:N-E;E=N,k&&k({action:w,location:P.location,delta:V})}function D(N,V){w=cn.Push;let A=gs(P.location,N,V);E=R()+1;let X=wc(A,E),K=P.createHref(A);try{y.pushState(X,"",K)}catch(ue){if(ue instanceof DOMException&&ue.name==="DataCloneError")throw ue;p.location.assign(K)}m&&k&&k({action:w,location:P.location,delta:1})}function O(N,V){w=cn.Replace;let A=gs(P.location,N,V);E=R();let X=wc(A,E),K=P.createHref(A);y.replaceState(X,"",K),m&&k&&k({action:w,location:P.location,delta:0})}function W(N){let V=p.location.origin!=="null"?p.location.origin:p.location.href,A=typeof N=="string"?N:fo(N);return A=A.replace(/ $/,"%20"),Ne(V,"No window.location.(origin|href) available to create URL for href: "+A),new URL(A,V)}let P={get action(){return w},get location(){return i(p,y)},listen(N){if(k)throw new Error("A history only accepts one active listener");return p.addEventListener(Sc,_),k=N,()=>{p.removeEventListener(Sc,_),k=null}},createHref(N){return u(p,N)},createURL:W,encodeLocation(N){let V=W(N);return{pathname:V.pathname,search:V.search,hash:V.hash}},push:D,replace:O,go(N){return y.go(N)}};return P}var jc;(function(i){i.data="data",i.deferred="deferred",i.redirect="redirect",i.error="error"})(jc||(jc={}));function dp(i,u,a){return a===void 0&&(a="/"),fp(i,u,a)}function fp(i,u,a,d){let p=typeof u=="string"?rr(u):u,m=tr(p.pathname||"/",a);if(m==null)return null;let y=Wc(i);pp(y);let w=null,k=Cp(m);for(let E=0;w==null&&E{let k={relativePath:w===void 0?m.path||"":w,caseSensitive:m.caseSensitive===!0,childrenIndex:y,route:m};k.relativePath.startsWith("/")&&(Ne(k.relativePath.startsWith(d),'Absolute route path "'+k.relativePath+'" nested under path '+('"'+d+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),k.relativePath=k.relativePath.slice(d.length));let E=dn([d,k.relativePath]),R=a.concat(k);m.children&&m.children.length>0&&(Ne(m.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+E+'".')),Wc(m.children,u,R,E)),!(m.path==null&&!m.index)&&u.push({path:E,score:kp(E,m.index),routesMeta:R})};return i.forEach((m,y)=>{var w;if(m.path===""||!((w=m.path)!=null&&w.includes("?")))p(m,y);else for(let k of Uc(m.path))p(m,y,k)}),u}function Uc(i){let u=i.split("/");if(u.length===0)return[];let[a,...d]=u,p=a.endsWith("?"),m=a.replace(/\?$/,"");if(d.length===0)return p?[m,""]:[m];let y=Uc(d.join("/")),w=[];return w.push(...y.map(k=>k===""?m:[m,k].join("/"))),p&&w.push(...y),w.map(k=>i.startsWith("/")&&k===""?"/":k)}function pp(i){i.sort((u,a)=>u.score!==a.score?a.score-u.score:Sp(u.routesMeta.map(d=>d.childrenIndex),a.routesMeta.map(d=>d.childrenIndex)))}const hp=/^:[\w-]+$/,mp=3,vp=2,gp=1,yp=10,xp=-2,Cc=i=>i==="*";function kp(i,u){let a=i.split("/"),d=a.length;return a.some(Cc)&&(d+=xp),u&&(d+=vp),a.filter(p=>!Cc(p)).reduce((p,m)=>p+(hp.test(m)?mp:m===""?gp:yp),d)}function Sp(i,u){return i.length===u.length&&i.slice(0,-1).every((d,p)=>d===u[p])?i[i.length-1]-u[u.length-1]:0}function wp(i,u,a){let{routesMeta:d}=i,p={},m="/",y=[];for(let w=0;w{let{paramName:D,isOptional:O}=R;if(D==="*"){let P=w[_]||"";y=m.slice(0,m.length-P.length).replace(/(.)\/+$/,"$1")}const W=w[_];return O&&!W?E[D]=void 0:E[D]=(W||"").replace(/%2F/g,"/"),E},{}),pathname:m,pathnameBase:y,pattern:i}}function jp(i,u,a){u===void 0&&(u=!1),a===void 0&&(a=!0),js(i==="*"||!i.endsWith("*")||i.endsWith("/*"),'Route path "'+i+'" will be treated as if it were '+('"'+i.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+i.replace(/\*$/,"/*")+'".'));let d=[],p="^"+i.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(y,w,k)=>(d.push({paramName:w,isOptional:k!=null}),k?"/?([^\\/]+)?":"/([^\\/]+)"));return i.endsWith("*")?(d.push({paramName:"*"}),p+=i==="*"||i==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?p+="\\/*$":i!==""&&i!=="/"&&(p+="(?:(?=\\/|$))"),[new RegExp(p,u?void 0:"i"),d]}function Cp(i){try{return i.split("/").map(u=>decodeURIComponent(u).replace(/\//g,"%2F")).join("/")}catch(u){return js(!1,'The URL path "'+i+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+u+").")),i}}function tr(i,u){if(u==="/")return i;if(!i.toLowerCase().startsWith(u.toLowerCase()))return null;let a=u.endsWith("/")?u.length-1:u.length,d=i.charAt(a);return d&&d!=="/"?null:i.slice(a)||"/"}const Ep=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,_p=i=>Ep.test(i);function Np(i,u){u===void 0&&(u="/");let{pathname:a,search:d="",hash:p=""}=typeof i=="string"?rr(i):i,m;if(a)if(_p(a))m=a;else{if(a.includes("//")){let y=a;a=Bc(a),js(!1,"Pathnames cannot have embedded double slashes - normalizing "+(y+" -> "+a))}a.startsWith("/")?m=Ec(a.substring(1),"/"):m=Ec(a,u)}else m=u;return{pathname:m,search:Rp(d),hash:zp(p)}}function Ec(i,u){let a=u.replace(/\/+$/,"").split("/");return i.split("/").forEach(p=>{p===".."?a.length>1&&a.pop():p!=="."&&a.push(p)}),a.length>1?a.join("/"):"/"}function fs(i,u,a,d){return"Cannot include a '"+i+"' character in a manually specified "+("`to."+u+"` field ["+JSON.stringify(d)+"]. Please separate it out to the ")+("`to."+a+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Pp(i){return i.filter((u,a)=>a===0||u.route.path&&u.route.path.length>0)}function Cs(i,u){let a=Pp(i);return u?a.map((d,p)=>p===a.length-1?d.pathname:d.pathnameBase):a.map(d=>d.pathnameBase)}function Es(i,u,a,d){d===void 0&&(d=!1);let p;typeof i=="string"?p=rr(i):(p=Gr({},i),Ne(!p.pathname||!p.pathname.includes("?"),fs("?","pathname","search",p)),Ne(!p.pathname||!p.pathname.includes("#"),fs("#","pathname","hash",p)),Ne(!p.search||!p.search.includes("#"),fs("#","search","hash",p)));let m=i===""||p.pathname==="",y=m?"/":p.pathname,w;if(y==null)w=a;else{let _=u.length-1;if(!d&&y.startsWith("..")){let D=y.split("/");for(;D[0]==="..";)D.shift(),_-=1;p.pathname=D.join("/")}w=_>=0?u[_]:"/"}let k=Np(p,w),E=y&&y!=="/"&&y.endsWith("/"),R=(m||y===".")&&a.endsWith("/");return!k.pathname.endsWith("/")&&(E||R)&&(k.pathname+="/"),k}const Bc=i=>i.replace(/\/\/+/g,"/"),dn=i=>Bc(i.join("/")),Tp=i=>i.replace(/\/+$/,"").replace(/^\/*/,"/"),Rp=i=>!i||i==="?"?"":i.startsWith("?")?i:"?"+i,zp=i=>!i||i==="#"?"":i.startsWith("#")?i:"#"+i;function Lp(i){return i!=null&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.internal=="boolean"&&"data"in i}const Ac=["post","put","patch","delete"];new Set(Ac);const Op=["get",...Ac];new Set(Op);/** * React Router v6.30.4 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Xr(){return Xr=Object.assign?Object.assign.bind():function(i){for(var u=1;u{w.current=!0}),C.useCallback(function(E,R){if(R===void 0&&(R={}),!w.current)return;if(typeof E=="number"){d.go(E);return}let _=Es(E,JSON.parse(y),m,R.relative==="path");i==null&&u!=="/"&&(_.pathname=_.pathname==="/"?u:dn([u,_.pathname])),(R.replace?d.replace:d.push)(_,R.state,R)},[u,d,y,m,i])}function vo(i,u){let{relative:a}=u===void 0?{}:u,{future:d}=C.useContext(At),{matches:p}=C.useContext(fn),{pathname:m}=or(),y=JSON.stringify(Cs(p,d.v7_relativeSplatPath));return C.useMemo(()=>Es(i,JSON.parse(y),m,a==="path"),[i,y,m,a])}function Ip(i,u){return Fp(i,u)}function Fp(i,u,a,d){lr()||Ne(!1);let{navigator:p}=C.useContext(At),{matches:m}=C.useContext(fn),y=m[m.length-1],w=y?y.params:{};y&&y.pathname;let k=y?y.pathnameBase:"/";y&&y.route;let E=or(),R;if(u){var _;let N=typeof u=="string"?rr(u):u;k==="/"||(_=N.pathname)!=null&&_.startsWith(k)||Ne(!1),R=N}else R=E;let D=R.pathname||"/",O=D;if(k!=="/"){let N=k.replace(/^\//,"").split("/");O="/"+D.replace(/^\//,"").split("/").slice(N.length).join("/")}let W=dp(i,{pathname:O}),P=$p(W&&W.map(N=>Object.assign({},N,{params:Object.assign({},w,N.params),pathname:dn([k,p.encodeLocation?p.encodeLocation(N.pathname).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?k:dn([k,p.encodeLocation?p.encodeLocation(N.pathnameBase).pathname:N.pathnameBase])})),m,a,d);return u&&P?C.createElement(mo.Provider,{value:{location:Xr({pathname:"/",search:"",hash:"",state:null,key:"default"},R),navigationType:cn.Pop}},P):P}function Wp(){let i=Kp(),u=Lp(i)?i.status+" "+i.statusText:i instanceof Error?i.message:JSON.stringify(i),a=i instanceof Error?i.stack:null,p={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return C.createElement(C.Fragment,null,C.createElement("h2",null,"Unexpected Application Error!"),C.createElement("h3",{style:{fontStyle:"italic"}},u),a?C.createElement("pre",{style:p},a):null,null)}const Up=C.createElement(Wp,null);class Bp extends C.Component{constructor(u){super(u),this.state={location:u.location,revalidation:u.revalidation,error:u.error}}static getDerivedStateFromError(u){return{error:u}}static getDerivedStateFromProps(u,a){return a.location!==u.location||a.revalidation!=="idle"&&u.revalidation==="idle"?{error:u.error,location:u.location,revalidation:u.revalidation}:{error:u.error!==void 0?u.error:a.error,location:a.location,revalidation:u.revalidation||a.revalidation}}componentDidCatch(u,a){console.error("React Router caught the following error during render",u,a)}render(){return this.state.error!==void 0?C.createElement(fn.Provider,{value:this.props.routeContext},C.createElement(Vc.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Ap(i){let{routeContext:u,match:a,children:d}=i,p=C.useContext(ho);return p&&p.static&&p.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(p.staticContext._deepestRenderedBoundaryId=a.route.id),C.createElement(fn.Provider,{value:u},d)}function $p(i,u,a,d){var p;if(u===void 0&&(u=[]),a===void 0&&(a=null),d===void 0&&(d=null),i==null){var m;if(!a)return null;if(a.errors)i=a.matches;else if((m=d)!=null&&m.v7_partialHydration&&u.length===0&&!a.initialized&&a.matches.length>0)i=a.matches;else return null}let y=i,w=(p=a)==null?void 0:p.errors;if(w!=null){let R=y.findIndex(_=>_.route.id&&(w==null?void 0:w[_.route.id])!==void 0);R>=0||Ne(!1),y=y.slice(0,Math.min(y.length,R+1))}let k=!1,E=-1;if(a&&d&&d.v7_partialHydration)for(let R=0;R=0?y=y.slice(0,E+1):y=[y[0]];break}}}return y.reduceRight((R,_,D)=>{let O,W=!1,P=null,N=null;a&&(O=w&&_.route.id?w[_.route.id]:void 0,P=_.route.errorElement||Up,k&&(E<0&&D===0?(Jp("route-fallback"),W=!0,N=null):E===D&&(W=!0,N=_.route.hydrateFallbackElement||null)));let V=u.concat(y.slice(0,D+1)),A=()=>{let X;return O?X=P:W?X=N:_.route.Component?X=C.createElement(_.route.Component,null):_.route.element?X=_.route.element:X=R,C.createElement(Ap,{match:_,routeContext:{outlet:R,matches:V,isDataRoute:a!=null},children:X})};return a&&(_.route.ErrorBoundary||_.route.errorElement||D===0)?C.createElement(Bp,{location:a.location,revalidation:a.revalidation,component:P,error:O,children:A(),routeContext:{outlet:null,matches:V,isDataRoute:!0}}):A()},null)}var Kc=(function(i){return i.UseBlocker="useBlocker",i.UseRevalidator="useRevalidator",i.UseNavigateStable="useNavigate",i})(Kc||{}),Yc=(function(i){return i.UseBlocker="useBlocker",i.UseLoaderData="useLoaderData",i.UseActionData="useActionData",i.UseRouteError="useRouteError",i.UseNavigation="useNavigation",i.UseRouteLoaderData="useRouteLoaderData",i.UseMatches="useMatches",i.UseRevalidator="useRevalidator",i.UseNavigateStable="useNavigate",i.UseRouteId="useRouteId",i})(Yc||{});function Vp(i){let u=C.useContext(ho);return u||Ne(!1),u}function Hp(i){let u=C.useContext($c);return u||Ne(!1),u}function Qp(i){let u=C.useContext(fn);return u||Ne(!1),u}function Jc(i){let u=Qp(),a=u.matches[u.matches.length-1];return a.route.id||Ne(!1),a.route.id}function Kp(){var i;let u=C.useContext(Vc),a=Hp(),d=Jc();return u!==void 0?u:(i=a.errors)==null?void 0:i[d]}function Yp(){let{router:i}=Vp(Kc.UseNavigateStable),u=Jc(Yc.UseNavigateStable),a=C.useRef(!1);return Hc(()=>{a.current=!0}),C.useCallback(function(p,m){m===void 0&&(m={}),a.current&&(typeof p=="number"?i.navigate(p):i.navigate(p,Xr({fromRouteId:u},m)))},[i,u])}const _c={};function Jp(i,u,a){_c[i]||(_c[i]=!0)}function Gp(i,u){i==null||i.v7_startTransition,i==null||i.v7_relativeSplatPath}function ps(i){let{to:u,replace:a,state:d,relative:p}=i;lr()||Ne(!1);let{future:m,static:y}=C.useContext(At),{matches:w}=C.useContext(fn),{pathname:k}=or(),E=Qc(),R=Es(u,Cs(w,m.v7_relativeSplatPath),k,p==="path"),_=JSON.stringify(R);return C.useEffect(()=>E(JSON.parse(_),{replace:a,state:d,relative:p}),[E,_,p,a,d]),null}function Yr(i){Ne(!1)}function Xp(i){let{basename:u="/",children:a=null,location:d,navigationType:p=cn.Pop,navigator:m,static:y=!1,future:w}=i;lr()&&Ne(!1);let k=u.replace(/^\/*/,"/"),E=C.useMemo(()=>({basename:k,navigator:m,static:y,future:Xr({v7_relativeSplatPath:!1},w)}),[k,w,m,y]);typeof d=="string"&&(d=rr(d));let{pathname:R="/",search:_="",hash:D="",state:O=null,key:W="default"}=d,P=C.useMemo(()=>{let N=tr(R,k);return N==null?null:{location:{pathname:N,search:_,hash:D,state:O,key:W},navigationType:p}},[k,R,_,D,O,W,p]);return P==null?null:C.createElement(At.Provider,{value:E},C.createElement(mo.Provider,{children:a,value:P}))}function Zp(i){let{children:u,location:a}=i;return Ip(xs(u),a)}new Promise(()=>{});function xs(i,u){u===void 0&&(u=[]);let a=[];return C.Children.forEach(i,(d,p)=>{if(!C.isValidElement(d))return;let m=[...u,p];if(d.type===C.Fragment){a.push.apply(a,xs(d.props.children,m));return}d.type!==Yr&&Ne(!1),!d.props.index||!d.props.children||Ne(!1);let y={id:d.props.id||m.join("-"),caseSensitive:d.props.caseSensitive,element:d.props.element,Component:d.props.Component,index:d.props.index,path:d.props.path,loader:d.props.loader,action:d.props.action,errorElement:d.props.errorElement,ErrorBoundary:d.props.ErrorBoundary,hasErrorBoundary:d.props.ErrorBoundary!=null||d.props.errorElement!=null,shouldRevalidate:d.props.shouldRevalidate,handle:d.props.handle,lazy:d.props.lazy};d.props.children&&(y.children=xs(d.props.children,m)),a.push(y)}),a}/** * React Router DOM v6.30.4 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function po(){return po=Object.assign?Object.assign.bind():function(i){for(var u=1;u{E&&Nc?Nc(()=>k(_)):k(_)},[k,E]);return C.useLayoutEffect(()=>y.listen(R),[y,R]),C.useEffect(()=>Gp(d),[d]),C.createElement(Xp,{basename:u,children:a,location:w.location,navigationType:w.action,navigator:y,future:d})}const ih=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",sh=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ah=C.forwardRef(function(u,a){let{onClick:d,relative:p,reloadDocument:m,replace:y,state:w,target:k,to:E,preventScrollReset:R,viewTransition:_}=u,D=Gc(u,eh),{basename:O}=C.useContext(At),W,P=!1;if(typeof E=="string"&&sh.test(E)&&(W=E,ih))try{let X=new URL(window.location.href),K=E.startsWith("//")?new URL(X.protocol+E):new URL(E),ue=tr(K.pathname,O);K.origin===X.origin&&ue!=null?E=ue+K.search+K.hash:P=!0}catch{}let N=Dp(E,{relative:p}),V=dh(E,{replace:y,state:w,target:k,preventScrollReset:R,relative:p,viewTransition:_});function A(X){d&&d(X),X.defaultPrevented||V(X)}return C.createElement("a",po({},D,{href:W||N,onClick:P||m?d:A,ref:a,target:k}))}),uh=C.forwardRef(function(u,a){let{"aria-current":d="page",caseSensitive:p=!1,className:m="",end:y=!1,style:w,to:k,viewTransition:E,children:R}=u,_=Gc(u,th),D=vo(k,{relative:_.relative}),O=or(),W=C.useContext($c),{navigator:P,basename:N}=C.useContext(At),V=W!=null&&fh(D)&&E===!0,A=P.encodeLocation?P.encodeLocation(D).pathname:D.pathname,X=O.pathname,K=W&&W.navigation&&W.navigation.location?W.navigation.location.pathname:null;p||(X=X.toLowerCase(),K=K?K.toLowerCase():null,A=A.toLowerCase()),K&&N&&(K=tr(K,N)||K);const ue=A!=="/"&&A.endsWith("/")?A.length-1:A.length;let ae=X===A||!y&&X.startsWith(A)&&X.charAt(ue)==="/",je=K!=null&&(K===A||!y&&K.startsWith(A)&&K.charAt(A.length)==="/"),xe={isActive:ae,isPending:je,isTransitioning:V},Ke=ae?d:void 0,Ie;typeof m=="function"?Ie=m(xe):Ie=[m,ae?"active":null,je?"pending":null,V?"transitioning":null].filter(Boolean).join(" ");let Ye=typeof w=="function"?w(xe):w;return C.createElement(ah,po({},_,{"aria-current":Ke,className:Ie,ref:a,style:Ye,to:k,viewTransition:E}),typeof R=="function"?R(xe):R)});var ks;(function(i){i.UseScrollRestoration="useScrollRestoration",i.UseSubmit="useSubmit",i.UseSubmitFetcher="useSubmitFetcher",i.UseFetcher="useFetcher",i.useViewTransitionState="useViewTransitionState"})(ks||(ks={}));var Pc;(function(i){i.UseFetcher="useFetcher",i.UseFetchers="useFetchers",i.UseScrollRestoration="useScrollRestoration"})(Pc||(Pc={}));function ch(i){let u=C.useContext(ho);return u||Ne(!1),u}function dh(i,u){let{target:a,replace:d,state:p,preventScrollReset:m,relative:y,viewTransition:w}=u===void 0?{}:u,k=Qc(),E=or(),R=vo(i,{relative:y});return C.useCallback(_=>{if(bp(_,a)){_.preventDefault();let D=d!==void 0?d:fo(E)===fo(R);k(i,{replace:D,state:p,preventScrollReset:m,relative:y,viewTransition:w})}},[E,k,R,d,p,a,i,m,y,w])}function fh(i,u){u===void 0&&(u={});let a=C.useContext(rh);a==null&&Ne(!1);let{basename:d}=ch(ks.useViewTransitionState),p=vo(i,{relative:u.relative});if(!a.isTransitioning)return!1;let m=tr(a.currentLocation.pathname,d)||a.currentLocation.pathname,y=tr(a.nextLocation.pathname,d)||a.nextLocation.pathname;return ys(p.pathname,y)!=null||ys(p.pathname,m)!=null}function ph(){if(window.matchMedia("(display-mode: standalone)").matches)return;const i=document.cookie.split(";").map(a=>a.trim()).find(a=>a.startsWith("hnf_inactivity_mins="));if(!i)return;const u=parseInt(i.split("=")[1]);return isNaN(u)||u<=0?void 0:u*60*1e3}const Tc={background:"var(--navy-dark)",border:"1px solid var(--surface-2)",borderRadius:"6px",color:"var(--text)",padding:"0.625rem 0.75rem",fontSize:"1rem",width:"100%",outline:"none"},hh={background:"var(--hk-green)",color:"#fff",border:"none",borderRadius:"6px",padding:"0.625rem",fontSize:"1rem",fontWeight:600,marginTop:"0.25rem",width:"100%"};function mh({children:i}){const[u,a]=C.useState("checking"),[d,p]=C.useState(null),[m,y]=C.useState(""),[w,k]=C.useState(""),[E,R]=C.useState(""),[_,D]=C.useState(!1),O=C.useRef(null);C.useEffect(()=>{fetch("/api/auth/verify?app=hk-planner",{credentials:"include"}).then(async P=>{P.ok?(p(await P.json()),a("authed")):a("login")}).catch(()=>a("login"))},[]),C.useEffect(()=>{const P=ph();if(u!=="authed"||!P)return;async function N(){await fetch("/api/auth/logout",{method:"POST",credentials:"include"}).catch(()=>{}),p(null),a("login")}function V(){O.current&&clearTimeout(O.current),O.current=setTimeout(N,P)}const A=["mousemove","keydown","click","touchstart"];return A.forEach(X=>window.addEventListener(X,V,{passive:!0})),V(),()=>{O.current&&clearTimeout(O.current),A.forEach(X=>window.removeEventListener(X,V))}},[u]);async function W(P){P.preventDefault(),D(!0),R("");try{if(!(await fetch("/api/auth/login",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:m,password:w})})).ok){R("Invalid email or password");return}const V=await fetch("/api/auth/verify?app=hk-planner",{credentials:"include"});V.ok?(p(await V.json()),a("authed")):R("You don't have access to this app.")}catch{R("Connection error — please try again")}finally{D(!1)}}return u==="checking"?c.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100dvh"},children:c.jsx("div",{style:{color:"var(--text-muted)"},children:"Loading…"})}):u==="login"?c.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100dvh",padding:"1.5rem",background:"var(--navy-dark)"},children:c.jsxs("div",{style:{background:"var(--navy)",borderRadius:"var(--radius)",padding:"2rem",width:"100%",maxWidth:"360px",border:"1px solid var(--surface-2)"},children:[c.jsx("h1",{style:{fontSize:"1.4rem",marginBottom:"0.25rem",color:"#74c69d"},children:"HK Planner"}),c.jsx("p",{style:{color:"var(--text-muted)",fontSize:"0.875rem",marginBottom:"1.5rem"},children:void 0}),c.jsxs("form",{onSubmit:W,style:{display:"flex",flexDirection:"column",gap:"0.75rem"},children:[c.jsx("input",{type:"email",value:m,onChange:P=>y(P.target.value),placeholder:"Email",required:!0,autoComplete:"email",style:Tc}),c.jsx("input",{type:"password",value:w,onChange:P=>k(P.target.value),placeholder:"Password",required:!0,autoComplete:"current-password",style:Tc}),E&&c.jsx("p",{style:{color:"#f87171",fontSize:"0.875rem"},children:E}),c.jsx("button",{type:"submit",disabled:_,style:hh,children:_?"Signing in…":"Sign in"})]})]})}):c.jsx(c.Fragment,{children:i(d)})}/** * @license lucide-react v1.24.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Xc=(...i)=>i.filter((u,a,d)=>!!u&&u.trim()!==""&&d.indexOf(u)===a).join(" ").trim();/** * @license lucide-react v1.24.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const vh=i=>i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** * @license lucide-react v1.24.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const gh=i=>i.replace(/^([A-Z])|[\s-_]+(\w)/g,(u,a,d)=>d?d.toUpperCase():a.toLowerCase());/** * @license lucide-react v1.24.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Rc=i=>{const u=gh(i);return u.charAt(0).toUpperCase()+u.slice(1)};/** * @license lucide-react v1.24.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var hs={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v1.24.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const yh=i=>{for(const u in i)if(u.startsWith("aria-")||u==="role"||u==="title")return!0;return!1},xh=C.createContext({}),kh=()=>C.useContext(xh),Sh=C.forwardRef(({color:i,size:u,strokeWidth:a,absoluteStrokeWidth:d,className:p="",children:m,iconNode:y,...w},k)=>{const{size:E=24,strokeWidth:R=2,absoluteStrokeWidth:_=!1,color:D="currentColor",className:O=""}=kh()??{},W=d??_?Number(a??R)*24/Number(u??E):a??R;return C.createElement("svg",{ref:k,...hs,width:u??E??hs.width,height:u??E??hs.height,stroke:i??D,strokeWidth:W,className:Xc("lucide",O,p),...!m&&!yh(w)&&{"aria-hidden":"true"},...w},[...y.map(([P,N])=>C.createElement(P,N)),...Array.isArray(m)?m:[m]])});/** * @license lucide-react v1.24.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Zr=(i,u)=>{const a=C.forwardRef(({className:d,...p},m)=>C.createElement(Sh,{ref:m,iconNode:u,className:Xc(`lucide-${vh(Rc(i))}`,`lucide-${i}`,d),...p}));return a.displayName=Rc(i),a};/** * @license lucide-react v1.24.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const wh=[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],zc=Zr("calendar-clock",wh);/** * @license lucide-react v1.24.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const jh=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],Ch=Zr("grip-vertical",jh);/** * @license lucide-react v1.24.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Eh=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],_h=Zr("log-out",Eh);/** * @license lucide-react v1.24.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Nh=[["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"}]],Ss=Zr("refresh-cw",Nh);/** * @license lucide-react v1.24.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ph=[["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"}]],Th=Zr("settings",Ph);function Rh({visible:i}){return i?c.jsxs("div",{style:{position:"fixed",bottom:0,left:0,right:0,zIndex:9999,background:"var(--sidebar)",color:"var(--text-light)",display:"flex",alignItems:"center",justifyContent:"center",gap:"12px",padding:"10px 16px",fontSize:"14px",boxShadow:"0 -2px 8px rgba(0,0,0,0.3)"},children:[c.jsx("span",{children:"A new version is available."}),c.jsxs("button",{onClick:()=>window.location.reload(),style:{display:"flex",alignItems:"center",gap:"6px",background:"var(--accent)",color:"var(--sidebar)",border:"none",borderRadius:"4px",padding:"6px 14px",fontWeight:600,cursor:"pointer",fontSize:"13px"},children:[c.jsx(Ss,{size:14,strokeWidth:1.75}),"Reload"]})]}):null}const zh=120*1e3;function Lh(i){const[u,a]=C.useState(!1);return C.useEffect(()=>{let d=null;async function p(){try{const w=await fetch(i,{cache:"no-store"});if(!w.ok)return;const E=(await w.json()).version;if(!E)return;d===null?d=E:E!==d&&a(!0)}catch{}}p();const m=setInterval(p,zh);function y(){document.visibilityState==="visible"&&p()}return document.addEventListener("visibilitychange",y),()=>{clearInterval(m),document.removeEventListener("visibilitychange",y)}},[i]),u}function Zc(i,u){return i.is_admin||i.caps.includes(u)}const Oh="width=1280",Dh="width=device-width, initial-scale=1.0";function Lc(i){const u=document.querySelector('meta[name="viewport"]');u&&(u.content=i)}function Mh(i){C.useEffect(()=>(Lc(Oh),window.parent.postMessage({type:"hnf:viewport",mode:i},"*"),()=>{Lc(Dh),window.parent.postMessage({type:"hnf:viewport",mode:"responsive"},"*")}),[i])}function Ih({user:i,children:u}){Mh("desktop");async function a(){await fetch("/hk-planner/api/auth/logout",{method:"POST",credentials:"include"}),window.location.reload()}return c.jsxs("div",{style:{display:"flex",height:"100dvh",overflow:"hidden"},children:[c.jsxs("nav",{style:{width:"200px",flexShrink:0,background:"var(--navy)",display:"flex",flexDirection:"column",padding:"1rem 0",borderRight:"1px solid var(--surface-2)"},children:[c.jsx("div",{style:{padding:"0 1rem 1rem",borderBottom:"1px solid var(--surface-2)"},children:c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem"},children:[c.jsx(zc,{size:20,strokeWidth:1.75,color:"#74c69d"}),c.jsx("span",{style:{color:"#74c69d",fontWeight:700,fontSize:"0.95rem"},children:"HK Planner"})]})}),c.jsxs("div",{className:"nav-scroll",style:{flex:1,padding:"0.5rem 0",overflowY:"auto"},children:[c.jsx(Oc,{to:"/planner",icon:zc,label:"Planner"}),Zc(i,"settings")&&c.jsx(Oc,{to:"/settings",icon:Th,label:"Settings"})]}),c.jsxs("div",{style:{padding:"0.75rem 1rem",borderTop:"1px solid var(--surface-2)"},children:[c.jsxs("div",{style:{marginBottom:"0.5rem"},children:[c.jsx("div",{style:{color:"var(--text)",fontSize:"0.8rem",fontWeight:600},children:i.name}),c.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.72rem"},children:i.email})]}),c.jsxs("button",{onClick:a,style:{display:"flex",alignItems:"center",gap:"0.5rem",background:"none",border:"none",color:"var(--text-muted)",fontSize:"0.8rem",padding:"0.375rem 0",width:"100%",cursor:"pointer"},children:[c.jsx(_h,{size:14,strokeWidth:1.75}),"Sign out"]})]})]}),c.jsx("main",{style:{flex:1,overflow:"auto",background:"var(--body-bg)"},children:u})]})}function Oc({to:i,icon:u,label:a}){return c.jsxs(uh,{to:i,style:({isActive:d})=>({display:"flex",alignItems:"center",gap:"0.625rem",padding:"0.625rem 1rem",textDecoration:"none",color:d?"#74c69d":"var(--text)",background:d?"var(--surface)":"transparent",borderLeft:d?"2px solid #74c69d":"2px solid transparent",fontSize:"0.875rem",transition:"background 0.15s"}),children:[c.jsx(u,{size:15,strokeWidth:1.75}),a]})}const Fh="/hk-planner/api";async function nt(i,u){const a=await fetch(Fh+i,{credentials:"include",...u});if(a.status===401)throw(window.top??window).location.href="/login",new Error("Unauthenticated");if(!a.ok){const d=await a.json().catch(()=>({}));throw new Error(d.error||`HTTP ${a.status}`)}return a.json()}function Wh(i,u,a=!1){const d=new URLSearchParams;return i&&d.set("week_start",i),u&&d.set("last_viewed",u),a&&d.set("force_refresh","1"),nt(`/bookings?${d}`)}function qc(){return nt("/config")}function Uh(i,u,a){return nt("/config/time-requirements",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({cat:i,action:u,value:a})})}function Bh(i){return nt("/config/staff",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({staff_data:i})})}function Ah(i){return nt("/config/pickup",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({pickup_data:i})})}function $h(i){return nt("/config/general-tasks",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({general_tasks:i})})}function Vh(i){return nt("/config/last-reviewed",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({date:i})})}function Hh(){return nt("/categories")}function Qh(i,u){return nt("/categories",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({order:i,excluded:u})})}function Kh(){return nt("/newbook/test",{method:"POST"})}function Yh(){return nt("/workforce/departments")}function Jh(i){return nt("/config/workforce-departments",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({dept_ids:i})})}function Gh(i,u){return nt(`/workforce/sync?start=${i}&end=${u}`,{method:"POST"})}function Xh(){return nt("/workforce/staff")}function Zh(i){return nt("/config/adjustments",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({adjustments:i})})}function ao(){const i=new Date;return`${i.getFullYear()}-${String(i.getMonth()+1).padStart(2,"0")}-${String(i.getDate()).padStart(2,"0")}`}function ms(i,u){const[a,d,p]=i.split("-").map(Number),m=new Date(a,d-1,p);return m.setDate(m.getDate()+u),`${m.getFullYear()}-${String(m.getMonth()+1).padStart(2,"0")}-${String(m.getDate()).padStart(2,"0")}`}function go(i){const u=new Date(i+"T00:00:00");return["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][u.getDay()]+" "+u.getDate()+" "+["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][u.getMonth()]}function qh(i){const u=new Date(i+"T00:00:00");return["Mon","Tue","Wed","Thu","Fri","Sat","Sun"][(u.getDay()+6)%7]}function bh(i){const u=new Date(i+"T00:00:00");return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][u.getDay()]}function Jr(i){const u=new Date(i+"T00:00:00").getDay();return u===0||u===6}function em(i,u){const a=u.pickup_hint??0,d=u.pickup_lead??0,p=a>0?`${a} room${a===1?"":"s"} picked up within ${d} day${d===1?"":"s"} of arrival`:"no late pickups";return`Last ${bh(i)}: ${u.prior_occ} occ (${u.prior_vac} vac) — ${p}`}function Dc(i){return new Date(i+"T00:00:00").toLocaleDateString("en-GB",{weekday:"short",day:"numeric",month:"short"})}function ut(i){return i.toFixed(2)+"h"}function nr(i,u,a,d,p){var E;const m=Math.max(0,p-d),y=(E=i[u])==null?void 0:E[a];if(!y||!y.count)return 0;const w=y.total-y.count,k=d>w?Math.max(0,y.total-d):y.count;return Math.min(k,m)}function tm(i,u,a,d,p){const m={};for(const y of i.dates){const w=qh(y),k=d.reduce((R,_)=>R+(_.hours[w]||0)/60,0),E=p.reduce((R,_)=>R+(_.hours[y]||0),0);m[y]={booked:0,pickup:0,general:k,adjustments:E,total:k+E,by_cat:{},pickup_by_cat:{}}}for(const y of i.categories){const w=u[y.id]||{depart:0,stay:0,arrive:0};i.dates.forEach((k,E)=>{const R=y.days[k],_=R.stays+R.arrivals,D=nr(a,y.id,k,_,y.total_rooms),O=(R.departs*(w.depart||0)+R.stays*(w.stay||0)+R.arrivals*(w.arrive||0))/60,W=D*(w.arrive||0)/60;m[k].by_cat[y.id]=O,m[k].pickup_by_cat[y.id]=(m[k].pickup_by_cat[y.id]||0)+W,m[k].booked+=O,m[k].pickup+=W,m[k].total+=O+W;const P=i.dates[E+1];if(P&&D>0){const N=D*(w.depart||0)/60;m[P].pickup_by_cat[y.id]=(m[P].pickup_by_cat[y.id]||0)+N,m[P].pickup+=N,m[P].total+=N}})}return m}function nm(){const[i,u]=C.useState(null),[a,d]=C.useState({}),[p,m]=C.useState([]),[y,w]=C.useState({}),[k,E]=C.useState([]),[R,_]=C.useState(30),[D,O]=C.useState([]),[W,P]=C.useState(null),[N,V]=C.useState([]),[A,X]=C.useState(!1),[K,ue]=C.useState(null),[ae,je]=C.useState(""),[xe,Ke]=C.useState(""),[Ie,Ye]=C.useState(!0),[ze,Pe]=C.useState(""),[Fe,Je]=C.useState(null),De=C.useRef({}),he=C.useRef(null),U=C.useRef(!1);function G(re,me,be=400){clearTimeout(De.current[re]),De.current[re]=setTimeout(me,be)}function B(re,me=!1){he.current&&clearTimeout(he.current),Je({text:re,err:me}),he.current=setTimeout(()=>Je(null),me?5e3:2500)}function g(){const re=ao();re!==xe&&(Ke(re),Vh(re).catch(()=>{}))}const T=C.useCallback(async(re=!1,me,be)=>{Ye(!0),Pe("");const I=ao(),b=me!==void 0?me??I:K||I,ee=be!==void 0?be||ms(I,-1):ae||xe||ms(I,-1);try{const[ke,Te]=await Promise.all([Wh(b,ee,re),qc()]);u(ke),d(Te.time_requirements||{}),m(Te.staff_data||[]),w(Te.pickup_data||{}),E(Te.general_tasks||[]),_(Te.tolerance_minutes??30),O(Te.adjustments||[]),P(Te.workforce_rota||null),Te.last_reviewed&&(Ke(Te.last_reviewed),ae||je(Te.last_reviewed))}catch(ke){Pe(ke instanceof Error?ke.message:"Failed to load data")}finally{Ye(!1)}},[K,ae,xe]);C.useEffect(()=>{T(!1)},[]),C.useEffect(()=>{W&&!U.current&&(U.current=!0,Xh().then(V).catch(()=>{}))},[W]),C.useEffect(()=>{function re(){p.length&&navigator.sendBeacon("/hk-planner/api/config/staff",JSON.stringify({staff_data:p})),Object.keys(y).length&&navigator.sendBeacon("/hk-planner/api/config/pickup",JSON.stringify({pickup_data:y})),D.length&&navigator.sendBeacon("/hk-planner/api/config/adjustments",JSON.stringify({adjustments:D}))}return window.addEventListener("beforeunload",re),()=>window.removeEventListener("beforeunload",re)},[p,y,D]);function ne(re){const me=ao(),be=ms(K||me,re);ue(be),g(),T(!0,be)}function le(){ue(null),g(),T(!0,null)}function ie(){g(),T(!0)}function se(re,me,be,I){const b=I.days[me],ee=b.stays+b.arrivals,ke=Math.max(0,I.total_rooms-ee),Te=nr(y,re,me,ee,I.total_rooms),hn=Math.max(0,Math.min(Te+be,ke)),ir={...y,[re]:{...y[re]||{},[me]:{count:hn,total:ee+hn}}};w(ir),g(),G("pickup",()=>Ah(ir).then(()=>B("Pickup saved")).catch(qr=>B(qr.message,!0)))}function pe(re){O(re),G("adjustments",()=>Zh(re).then(()=>B("Adjustments saved")).catch(me=>B(me.message,!0)))}function ce(){pe([...D,{label:"",hours:{}}])}function ve(re){m(re),g(),G("staff",()=>Bh(re).then(()=>B("Staff hours saved")).catch(me=>B(me.message,!0)))}function Ve(){ve([...p,{name:"",hours:{}}])}async function $t(){if(i){X(!0);try{const re=await Gh(i.dates[0],i.dates[i.dates.length-1]);P(re),B("Rota synced from Workforce")}catch(re){B(re instanceof Error?re.message:"Sync failed",!0)}finally{X(!1)}}}function Pn(){if(!W)return"Never synced";const re=new Date(W.last_sync).toLocaleDateString("en-GB",{weekday:"short",day:"numeric",month:"short"});return i&&W.dates[0]===i.dates[0]&&W.dates[1]===i.dates[i.dates.length-1]?`Synced ${re}`:`Synced ${re} — different week`}const Nt=i?tm(i,a,y,k,D):null,pn=ao(),Tn=K||pn;return c.jsxs("div",{style:{padding:"1.5rem",maxWidth:"1600px"},children:[c.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"0.75rem",marginBottom:"1.25rem"},children:[c.jsxs("div",{children:[c.jsx("h1",{style:{fontSize:"1.15rem",fontWeight:700,color:"var(--text-dark)"},children:"Housekeeping Planner"}),i&&c.jsxs("p",{style:{fontSize:"0.8rem",color:"var(--text-mid)",marginTop:"0.1rem"},children:[Dc(i.dates[0])," – ",Dc(i.dates[i.dates.length-1])]})]}),c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.4rem",marginLeft:"auto",flexWrap:"wrap"},children:[c.jsx(er,{onClick:()=>ne(-7),children:"‹ Prev"}),c.jsx(er,{onClick:le,primary:!0,children:"Today"}),c.jsx(er,{onClick:()=>ne(7),children:"Next ›"}),c.jsx("input",{type:"date",value:Tn,onChange:re=>{if(re.target.value){const me=re.target.value;ue(me),g(),G("weekStart",()=>T(!0,me),600)}},style:{border:"1px solid var(--card-border)",borderRadius:"6px",padding:"0.35rem 0.5rem",fontSize:"0.82rem",color:"var(--text-dark)"}}),c.jsx("div",{style:{width:"1px",height:"24px",background:"var(--card-border)"}}),c.jsxs("label",{style:{fontSize:"0.78rem",color:"var(--text-mid)",display:"flex",alignItems:"center",gap:"0.3rem"},children:[c.jsx("span",{children:"Since"}),c.jsx("input",{type:"date",value:ae,onChange:re=>{if(re.target.value){const me=re.target.value;je(me),G("lastViewed",()=>T(!0,void 0,me),600)}},style:{border:"1px solid var(--card-border)",borderRadius:"6px",padding:"0.3rem 0.5rem",fontSize:"0.78rem",color:"var(--text-dark)"}})]}),c.jsx(er,{onClick:()=>{g(),T(!0)},children:"Update to now"}),c.jsx("div",{style:{width:"1px",height:"24px",background:"var(--card-border)"}}),c.jsx("button",{onClick:ie,title:"Refresh",style:{background:"var(--card-bg)",border:"1px solid var(--card-border)",borderRadius:"6px",padding:"0.35rem 0.5rem",display:"flex",alignItems:"center",gap:"0.3rem",fontSize:"0.82rem",color:"var(--text-dark)"},children:c.jsx(Ss,{size:13,strokeWidth:1.75,style:{animation:Ie?"spin 1s linear infinite":"none"}})})]})]}),c.jsx("style",{children:"@keyframes spin { from { transform: rotate(0deg) } to { transform: rotate(360deg) } }"}),Fe&&c.jsx("div",{style:{display:"inline-block",marginBottom:"0.75rem",padding:"0.35rem 0.75rem",borderRadius:"6px",fontSize:"0.8rem",fontWeight:500,background:Fe.err?"#fee2e2":"#dcfce7",color:Fe.err?"var(--danger)":"var(--success)"},children:Fe.text}),ze&&c.jsxs("div",{style:{marginBottom:"1rem",padding:"0.75rem 1rem",borderRadius:"8px",background:"#fee2e2",color:"var(--danger)",fontSize:"0.875rem"},children:["Error: ",ze]}),Ie&&!i&&c.jsx("div",{style:{color:"var(--text-mid)",padding:"2rem 0",textAlign:"center"},children:"Loading bookings…"}),i&&Nt&&c.jsxs(c.Fragment,{children:[c.jsx(uo,{title:"7-Day Occupancy",children:c.jsx("div",{className:"table-scroll",children:c.jsx(rm,{bookings:i,pickup:y,onPickupChange:se})})}),c.jsx(uo,{title:"Required Hours",children:c.jsx("div",{className:"table-scroll",children:c.jsx(im,{bookings:i,required:Nt})})}),c.jsx(uo,{title:"Adjustments",action:c.jsx(er,{onClick:ce,children:"+ Add adjustment"}),children:c.jsx("div",{className:"table-scroll",children:c.jsx(am,{bookings:i,adjustments:D,onChange:pe})})}),c.jsx(uo,{title:"Staff Rota",action:c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",flexWrap:"wrap"},children:[c.jsxs("button",{onClick:$t,disabled:A,style:{display:"flex",alignItems:"center",gap:"0.3rem",background:"var(--card-bg)",color:"var(--text-dark)",border:"1px solid var(--card-border)",borderRadius:"6px",padding:"0.3rem 0.65rem",fontSize:"0.78rem",fontWeight:600},children:[c.jsx(Ss,{size:11,strokeWidth:1.75,style:{animation:A?"spin 1s linear infinite":"none"}}),A?"Syncing…":"Sync from Workforce"]}),c.jsx("span",{style:{fontSize:"0.72rem",color:"var(--text-mid)"},children:Pn()}),c.jsx(er,{onClick:Ve,children:"+ Add staff"})]}),children:c.jsx("div",{className:"table-scroll",children:c.jsx(sm,{bookings:i,staff:p,required:Nt,tolerance:R,onChange:ve,workforceRota:W,wfStaff:N})})})]})]})}function uo({title:i,children:u,action:a}){return c.jsxs("div",{style:{marginBottom:"1.5rem"},children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem",marginBottom:"0.5rem"},children:[c.jsx("h2",{style:{fontSize:"0.72rem",fontWeight:700,color:"var(--text-mid)",textTransform:"uppercase",letterSpacing:"0.08em"},children:i}),a]}),u]})}function er({children:i,onClick:u,primary:a}){return c.jsx("button",{onClick:u,style:{background:a?"var(--hk-green)":"var(--card-bg)",color:a?"#fff":"var(--text-dark)",border:`1px solid ${a?"var(--hk-green)":"var(--card-border)"}`,borderRadius:"6px",padding:"0.35rem 0.75rem",fontSize:"0.82rem",fontWeight:600},children:i})}function rm({bookings:i,pickup:u,onPickupChange:a}){const{dates:d,categories:p}=i;return c.jsxs("table",{className:"hk-table",children:[c.jsxs("thead",{children:[c.jsxs("tr",{children:[c.jsx("th",{className:"col-label",rowSpan:2,children:"Category"}),d.map(m=>c.jsx("th",{colSpan:2,style:{borderLeft:"2px solid rgba(255,255,255,0.3)",...Jr(m)?{background:"#253555"}:{}},children:go(m)},m))]}),c.jsx("tr",{children:d.map(m=>c.jsxs(c.Fragment,{children:[c.jsx("th",{style:{fontSize:"0.72rem",fontWeight:400,minWidth:"72px",background:Jr(m)?"#2a3d5e":"#1e2d42",borderLeft:"2px solid rgba(255,255,255,0.3)"},children:"Rooms"},m+"-r"),c.jsx("th",{style:{fontSize:"0.72rem",fontWeight:400,minWidth:"56px",textAlign:"center",background:Jr(m)?"#2a3d5e":"#1e2d42",borderLeft:"1px solid rgba(255,255,255,0.1)"},children:"D / S / A"},m+"-d")]}))})]}),c.jsx("tbody",{children:p.map((m,y)=>{const w=y===p.length-1;return c.jsx(lm,{cat:m,dates:d,pickup:u,onPickupChange:(k,E)=>a(m.id,k,E,m),isLast:w},m.id)})}),c.jsx("tfoot",{children:c.jsx(om,{dates:d,cats:p,pickup:u})})]})}function lm({cat:i,dates:u,pickup:a,onPickupChange:d,isLast:p}){const m=p?"2px solid var(--card-border)":void 0;return c.jsxs("tr",{children:[c.jsx("td",{className:"col-label",style:{borderBottom:m},children:i.name}),u.map((y,w)=>{var ue;const k=i.days[y],E=k.stays+k.arrivals,R=Math.max(0,i.total_rooms-E),_=nr(a,i.id,y,E,i.total_rooms),D=u[w-1],O=D?i.days[D].stays+i.days[D].arrivals:0,W=D?nr(a,i.id,D,O,i.total_rooms):0,P=k.delta_new||0,N=k.delta_cancelled||0,V=Jr(y),A=(ue=a[i.id])==null?void 0:ue[y],X=em(y,k);let K="";if(A&&A.count){const ae=A.total-A.count,je=E>ae?"changed":"unchanged",xe=E>ae?"decreased":"remains";K=`+${A.count} pickup set when booked was ${ae} (target ${A.total}). Booked ${je}, so pickup ${xe}.`}return K=(K?K+" | ":"")+X,c.jsxs(c.Fragment,{children:[c.jsxs("td",{style:{textAlign:"center",verticalAlign:"middle",borderBottom:m,padding:"0.4rem 0.3rem",borderLeft:"2px solid var(--card-border)",...V?{background:"rgba(100,120,160,0.07)"}:{}},children:[(P>0||N>0)&&c.jsxs("div",{style:{marginBottom:"2px",fontSize:"0.72rem"},children:[P>0&&c.jsxs("span",{className:"delta-new",children:["▲",P]}),N>0&&c.jsxs("span",{className:"delta-canc",children:[" ▼",N]})]}),c.jsxs("div",{style:{fontWeight:700,fontSize:"1.1rem"},title:K,children:[E,_>0&&c.jsxs("span",{className:"pickup-tag",children:[" +",_]})]}),c.jsxs("div",{style:{fontSize:"0.72rem",color:"var(--text-mid)",marginBottom:"4px"},children:[R," vac",_>0&&c.jsxs("span",{className:"pickup-tag",children:[" (",R-_,")"]})]}),c.jsxs("div",{className:"pickup-ctrl",children:[c.jsx("button",{className:"pickup-btn",disabled:_<=0,onClick:()=>d(y,-1),children:"−"}),c.jsx("span",{className:"pickup-num",children:_}),c.jsx("button",{className:"pickup-btn",disabled:_>=R,title:X,onClick:()=>d(y,1),children:"+"})]})]},y+"-r"),c.jsxs("td",{style:{verticalAlign:"middle",borderLeft:"1px solid var(--card-border)",borderBottom:m,padding:"0.4rem 0.3rem",textAlign:"center",...V?{background:"rgba(100,120,160,0.07)"}:{}},children:[c.jsxs("div",{style:{fontSize:"0.8rem",color:"#c2502e",fontWeight:600},children:[k.departs,"d",W>0&&c.jsxs("span",{className:"pickup-tag",children:[" +",W]})]}),c.jsxs("div",{style:{fontSize:"0.8rem",color:"#1d6fb8",fontWeight:600},children:[k.stays,"s"]}),c.jsxs("div",{style:{fontSize:"0.8rem",color:"#1a7a4a",fontWeight:600},children:[k.arrivals,"a",_>0&&c.jsxs("span",{className:"pickup-tag",children:[" +",_]})]})]},y+"-dsa")]})})]})}function om({dates:i,cats:u,pickup:a}){return c.jsxs("tr",{children:[c.jsx("td",{className:"col-label",style:{fontStyle:"italic"},children:"Total"}),i.map((d,p)=>{let m=0,y=0,w=0,k=0,E=0,R=0,_=0,D=0,O=0;for(const P of u){const N=P.days[d],V=N.stays+N.arrivals,A=Math.max(0,P.total_rooms-V),X=nr(a,P.id,d,V,P.total_rooms),K=i[p-1],ue=K?P.days[K].stays+P.days[K].arrivals:0,ae=K?nr(a,P.id,K,ue,P.total_rooms):0;m+=V,y+=A,w+=X,k+=ae,E+=N.departs,R+=N.stays,_+=N.arrivals,D+=N.delta_new||0,O+=N.delta_cancelled||0}const W=Jr(d);return c.jsxs(c.Fragment,{children:[c.jsxs("td",{style:{textAlign:"center",verticalAlign:"middle",padding:"0.4rem 0.3rem",borderLeft:"2px solid var(--card-border)",...W?{background:"rgba(100,120,160,0.07)"}:{}},children:[(D>0||O>0)&&c.jsxs("div",{style:{marginBottom:"2px",fontSize:"0.72rem"},children:[D>0&&c.jsxs("span",{className:"delta-new",children:["▲",D]}),O>0&&c.jsxs("span",{className:"delta-canc",children:[" ▼",O]})]}),c.jsxs("div",{style:{fontWeight:700,fontSize:"1.1rem"},children:[m,w>0&&c.jsxs("span",{className:"pickup-tag",children:[" +",w]})]}),c.jsxs("div",{style:{fontSize:"0.72rem",color:"var(--text-mid)"},children:[y," vac",w>0&&c.jsxs("span",{className:"pickup-tag",children:[" (",y-w,")"]})]})]},d+"-r"),c.jsxs("td",{style:{verticalAlign:"middle",borderLeft:"1px solid var(--card-border)",padding:"0.4rem 0.3rem",textAlign:"center",...W?{background:"rgba(100,120,160,0.07)"}:{}},children:[c.jsxs("div",{style:{fontSize:"0.8rem",color:"#c2502e",fontWeight:600},children:[E,"d",k>0&&c.jsxs("span",{className:"pickup-tag",children:[" +",k]})]}),c.jsxs("div",{style:{fontSize:"0.8rem",color:"#1d6fb8",fontWeight:600},children:[R,"s"]}),c.jsxs("div",{style:{fontSize:"0.8rem",color:"#1a7a4a",fontWeight:600},children:[_,"a",w>0&&c.jsxs("span",{className:"pickup-tag",children:[" +",w]})]})]},d+"-dsa")]})})]})}function im({bookings:i,required:u}){const{dates:a,categories:d}=i;return c.jsxs("table",{className:"hk-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{className:"col-label",children:"Category"}),a.map(p=>c.jsx("th",{children:go(p)},p))]})}),c.jsx("tbody",{children:d.map(p=>c.jsxs("tr",{children:[c.jsx("td",{className:"col-label",children:p.name}),a.map(m=>{const y=u[m].by_cat[p.id]||0,w=u[m].pickup_by_cat[p.id]||0;return c.jsxs("td",{children:[y===0&&w===0?"—":ut(y),w>.001&&c.jsxs("span",{className:"pickup-tag",children:[" (+",ut(w),")"]})]},m)})]},p.id))}),c.jsxs("tfoot",{children:[c.jsxs("tr",{style:{background:"#f1f5f9"},children:[c.jsx("td",{className:"col-label",style:{color:"var(--text-mid)",fontSize:"0.78rem"},children:"Booked hrs"}),a.map(p=>c.jsx("td",{children:ut(u[p].booked)},p))]}),c.jsxs("tr",{style:{background:"#f1f5f9"},children:[c.jsx("td",{className:"col-label",style:{color:"var(--text-mid)",fontSize:"0.78rem"},children:"Pickup hrs"}),a.map(p=>c.jsx("td",{children:u[p].pickup>.001?ut(u[p].pickup):"—"},p))]}),c.jsxs("tr",{style:{background:"#f1f5f9"},children:[c.jsx("td",{className:"col-label",style:{color:"var(--text-mid)",fontSize:"0.78rem"},children:"Recurring tasks"}),a.map(p=>c.jsx("td",{children:u[p].general>.001?ut(u[p].general):"—"},p))]}),a.some(p=>u[p].adjustments!==0)&&c.jsxs("tr",{style:{background:"#f1f5f9"},children:[c.jsx("td",{className:"col-label",style:{color:"var(--text-mid)",fontSize:"0.78rem"},children:"Adjustments"}),a.map(p=>{const m=u[p].adjustments;return c.jsx("td",{style:{color:m<0?"var(--danger)":m>0?"#1a7a4a":"var(--text-mid)"},children:m===0?"—":(m>0?"+":"")+ut(m)},p)})]}),c.jsxs("tr",{style:{background:"#e2e8f0"},children:[c.jsx("td",{className:"col-label",children:"Total Required"}),a.map(p=>c.jsxs("td",{style:{fontWeight:700},children:[ut(u[p].total),u[p].pickup>.001&&c.jsxs("span",{className:"pickup-tag",style:{display:"block",fontSize:"0.7rem"},children:["inc ",ut(u[p].pickup)," pickup"]})]},p))]})]})]})}function sm({bookings:i,staff:u,required:a,tolerance:d,onChange:p,workforceRota:m,wfStaff:y}){const{dates:w}=i,k=d/60;function E(O,W){const P=u.map((N,V)=>V===O?{...N,name:W}:N);p(P)}function R(O,W,P){const N=parseFloat(P),V=u.map((A,X)=>{if(X!==O)return A;const K={...A.hours};return!isNaN(N)&&N>=0?K[W]=N:delete K[W],{...A,hours:K}});p(V)}function _(O){p(u.filter((W,P)=>P!==O))}const D=(m==null?void 0:m.staff)??[];return c.jsxs("table",{className:"hk-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{className:"col-label",children:"Staff Member"}),w.map(O=>c.jsx("th",{children:go(O)},O)),c.jsx("th",{style:{width:"32px"}})]})}),c.jsxs("tbody",{children:[D.map(O=>c.jsxs("tr",{style:{background:"rgba(42,100,72,0.05)"},children:[c.jsxs("td",{className:"col-label",children:[c.jsx("span",{style:{display:"inline-block",fontSize:"0.67rem",fontWeight:700,background:"rgba(42,100,72,0.18)",color:"#1a7a4a",borderRadius:"3px",padding:"0 4px",marginRight:"0.4rem",lineHeight:"1.5"},children:"WF"}),O.name]}),w.map(W=>{const P=O.days[W];return c.jsx("td",{style:{textAlign:"center",padding:"0.3rem 0.4rem",verticalAlign:"middle"},children:P?c.jsxs(c.Fragment,{children:[c.jsx("div",{style:{fontSize:"0.68rem",color:"var(--text-mid)",lineHeight:1.25},children:P.times}),c.jsx("div",{style:{fontWeight:600},children:ut(P.hours)})]}):c.jsx("span",{style:{color:"var(--text-mid)"},children:"—"})},W)}),c.jsx("td",{})]},"wf-"+O.id)),y.length>0&&c.jsx("datalist",{id:"wf-staff-datalist",children:y.map(O=>c.jsx("option",{value:O.name},O.id))}),u.map((O,W)=>c.jsxs("tr",{children:[c.jsx("td",{className:"col-label",style:{padding:"0.3rem 0.5rem"},children:c.jsx("input",{className:"hk-text-input",value:O.name,placeholder:"Staff name",list:y.length>0?"wf-staff-datalist":void 0,onChange:P=>E(W,P.target.value)})}),w.map(P=>c.jsx("td",{style:{padding:"0.3rem 0.4rem"},children:c.jsx("input",{type:"number",className:"hk-num-input",min:0,max:24,step:.5,value:O.hours[P]??"",placeholder:"0",onChange:N=>R(W,P,N.target.value)})},P)),c.jsx("td",{children:c.jsx("button",{onClick:()=>_(W),style:{background:"none",border:"none",color:"var(--text-mid)",fontSize:"1rem",padding:"0.2rem 0.4rem"},children:"×"})})]},W))]}),c.jsxs("tfoot",{children:[c.jsxs("tr",{children:[c.jsx("td",{className:"col-label",style:{fontSize:"0.78rem",color:"var(--text-mid)"},children:"Total Available"}),w.map(O=>{const W=D.reduce((N,V)=>{var A;return N+(((A=V.days[O])==null?void 0:A.hours)||0)},0),P=u.reduce((N,V)=>N+(V.hours[O]||0),0);return c.jsx("td",{children:ut(W+P)},O)}),c.jsx("td",{})]}),c.jsxs("tr",{children:[c.jsx("td",{className:"col-label",style:{fontSize:"0.72rem",color:"var(--text-mid)"},children:"vs Booked"}),w.map(O=>{const W=D.reduce((V,A)=>{var X;return V+(((X=A.days[O])==null?void 0:X.hours)||0)},0),P=u.reduce((V,A)=>V+(A.hours[O]||0),0),N=a[O].booked+a[O].general;return c.jsx("td",{children:c.jsx(Mc,{available:W+P,required:N,tolerance:k})},O)}),c.jsx("td",{})]}),c.jsxs("tr",{children:[c.jsx("td",{className:"col-label",style:{fontSize:"0.72rem",color:"var(--text-mid)"},children:"vs with Pickup"}),w.map(O=>{const W=D.reduce((N,V)=>{var A;return N+(((A=V.days[O])==null?void 0:A.hours)||0)},0),P=u.reduce((N,V)=>N+(V.hours[O]||0),0);return c.jsx("td",{children:c.jsx(Mc,{available:W+P,required:a[O].total,tolerance:k})},O)}),c.jsx("td",{})]})]})]})}function Mc({available:i,required:u,tolerance:a}){const d=i-u;return u===0&&i===0?c.jsx("span",{style:{color:"var(--text-mid)"},children:"—"}):d<-a?c.jsxs("span",{className:"diff-under",children:["✗ ",ut(Math.abs(d))," short"]}):d>a?c.jsxs("span",{className:"diff-over",children:["⚠ ",ut(d)," spare"]}):c.jsxs("span",{className:"diff-ok",children:["✓ ",d>=0?"+":"",ut(d)]})}function am({bookings:i,adjustments:u,onChange:a}){const{dates:d}=i;function p(w,k){a(u.map((E,R)=>R===w?{...E,label:k}:E))}function m(w,k,E){const R=parseFloat(E);a(u.map((_,D)=>{if(D!==w)return _;const O={..._.hours};return isNaN(R)?delete O[k]:O[k]=R,{..._,hours:O}}))}function y(w){a(u.filter((k,E)=>E!==w))}return u.length===0?c.jsx("p",{style:{color:"var(--text-mid)",fontSize:"0.82rem",padding:"0.5rem 0"},children:'No adjustments — use "+ Add adjustment" above to add a one-off hour offset for a specific date.'}):c.jsxs("table",{className:"hk-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{className:"col-label",children:"Label"}),d.map(w=>c.jsx("th",{children:go(w)},w)),c.jsx("th",{style:{width:"32px"}})]})}),c.jsx("tbody",{children:u.map((w,k)=>c.jsxs("tr",{children:[c.jsx("td",{className:"col-label",style:{padding:"0.3rem 0.5rem"},children:c.jsx("input",{className:"hk-text-input",value:w.label,placeholder:"e.g. Rooms from Sunday",onChange:E=>p(k,E.target.value)})}),d.map(E=>c.jsx("td",{style:{padding:"0.3rem 0.4rem"},children:c.jsx("input",{type:"number",className:"hk-num-input",step:.25,value:w.hours[E]??"",placeholder:"0",onChange:R=>m(k,E,R.target.value)})},E)),c.jsx("td",{children:c.jsx("button",{onClick:()=>y(k),style:{background:"none",border:"none",color:"var(--text-mid)",fontSize:"1rem",padding:"0.2rem 0.4rem"},children:"×"})})]},k))}),c.jsx("tfoot",{children:c.jsxs("tr",{children:[c.jsx("td",{className:"col-label",style:{fontSize:"0.78rem",color:"var(--text-mid)"},children:"Total"}),d.map(w=>{const k=u.reduce((E,R)=>E+(R.hours[w]||0),0);return c.jsx("td",{style:{color:k<0?"var(--danger)":k>0?"#1a7a4a":"var(--text-mid)",fontWeight:k!==0?600:void 0},children:k===0?"—":(k>0?"+":"")+ut(k)},w)}),c.jsx("td",{})]})})]})}const Ic=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function um(){const[i,u]=C.useState([]),[a,d]=C.useState(!0),[p,m]=C.useState(!1),[y,w]=C.useState(!1),[k,E]=C.useState(""),[R,_]=C.useState(""),[D,O]=C.useState(null),[W,P]=C.useState([]),[N,V]=C.useState([]),[A,X]=C.useState(!0),[K,ue]=C.useState(""),[ae,je]=C.useState(!1),[xe,Ke]=C.useState(!1),[Ie,Ye]=C.useState(""),[ze,Pe]=C.useState([]),[Fe,Je]=C.useState(!1),[De,he]=C.useState(""),[U,G]=C.useState(""),[B,g]=C.useState({}),[T,ne]=C.useState(""),[le,ie]=C.useState("");C.useEffect(()=>{Promise.all([Hh(),qc(),Yh().catch(I=>(I.message.includes("503")||I.message.toLowerCase().includes("not configured")?je(!0):ue(I.message),null))]).then(([I,b,ee])=>{u(I.categories),Pe(b.general_tasks||[]),g(b.time_requirements||{}),V(b.workforce_departments||[]),ee&&P(ee),d(!1),X(!1)}).catch(I=>{E(I.message),d(!1),X(!1)})},[]);function se(I){u(i.map((b,ee)=>ee===I?{...b,excluded:!b.excluded}:b))}function pe(I,b){O(b),I.dataTransfer.effectAllowed="move"}function ce(I,b){if(I.preventDefault(),D===null||D===b)return;const ee=[...i],[ke]=ee.splice(D,1);ee.splice(b,0,ke),u(ee),O(b)}function ve(){O(null)}async function Ve(){m(!0),E(""),_("");try{await Qh(i.map(I=>I.id),i.filter(I=>I.excluded).map(I=>I.id)),_("Saved"),setTimeout(()=>_(""),2500)}catch(I){E(I instanceof Error?I.message:"Save failed")}finally{m(!1)}}async function $t(){w(!0),E(""),_("");try{const I=await Kh();_(I.ok?`Connection OK: ${I.message||""}`:`Failed: ${I.error||"unknown"}`)}catch(I){E(I instanceof Error?I.message:"Test failed")}finally{w(!1)}}function Pn(I){V(b=>b.includes(I)?b.filter(ee=>ee!==I):[...b,I])}async function Nt(){Ke(!0),ue(""),Ye("");try{await Jh(N),Ye("Departments saved"),setTimeout(()=>Ye(""),2500)}catch(I){ue(I instanceof Error?I.message:"Save failed")}finally{Ke(!1)}}function pn(I,b){Pe(ze.map((ee,ke)=>ke===I?{...ee,name:b}:ee))}function Tn(I,b,ee){const ke=parseInt(ee,10);Pe(ze.map((Te,hn)=>hn!==I?Te:{...Te,hours:{...Te.hours,[b]:isNaN(ke)?0:Math.max(0,ke)}}))}function re(I){Pe(ze.filter((b,ee)=>ee!==I))}async function me(){Je(!0),G(""),he("");try{await $h(ze),he("Saved"),setTimeout(()=>he(""),2500)}catch(I){G(I instanceof Error?I.message:"Save failed")}finally{Je(!1)}}async function be(I,b,ee){const ke={...B,[I]:{...B[I]||{depart:0,stay:0,arrive:0},[b]:ee}};g(ke);try{await Uh(I,b,ee),ne("Saved"),setTimeout(()=>ne(""),1500)}catch(Te){ie(Te instanceof Error?Te.message:"Save failed")}}return a?c.jsx("div",{style:{padding:"2rem",color:"var(--text-mid)"},children:"Loading…"}):c.jsxs("div",{style:{padding:"1.5rem",maxWidth:"680px"},children:[c.jsx("h1",{style:{fontSize:"1.1rem",fontWeight:700,color:"var(--text-dark)",marginBottom:"1.5rem"},children:"Settings"}),c.jsx(co,{title:"Room Categories"}),c.jsx("p",{style:{fontSize:"0.82rem",color:"var(--text-mid)",marginBottom:"1rem"},children:"Drag to reorder. Toggle to exclude categories from the planner."}),k&&c.jsx(un,{type:"error",children:k}),R&&c.jsx(un,{type:"ok",children:R}),c.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.5rem",marginBottom:"1rem"},children:i.map((I,b)=>c.jsxs("div",{draggable:!0,onDragStart:ee=>pe(ee,b),onDragOver:ee=>ce(ee,b),onDragEnd:ve,style:{display:"flex",alignItems:"center",gap:"0.75rem",padding:"0.625rem 0.875rem",border:"1px solid var(--card-border)",borderRadius:"8px",background:I.excluded?"#f8fafc":"var(--card-bg)",opacity:D===b?.5:1},children:[c.jsx(Ch,{size:16,color:"var(--text-mid)",style:{cursor:"grab",flexShrink:0}}),c.jsx("span",{style:{flex:1,fontSize:"0.9rem",color:I.excluded?"var(--text-mid)":"var(--text-dark)",textDecoration:I.excluded?"line-through":"none"},children:I.name}),c.jsxs("span",{style:{fontSize:"0.75rem",color:"var(--text-mid)",marginRight:"0.5rem"},children:[I.room_count," rooms"]}),c.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"0.375rem",fontSize:"0.8rem",color:"var(--text-mid)"},children:[c.jsx("input",{type:"checkbox",checked:!I.excluded,onChange:()=>se(b)}),"Active"]})]},I.id))}),c.jsxs("div",{style:{display:"flex",gap:"0.75rem",flexWrap:"wrap",marginBottom:"2.5rem"},children:[c.jsx(Kr,{onClick:Ve,disabled:p,primary:!0,children:p?"Saving…":"Save Order & Visibility"}),c.jsx(Kr,{onClick:$t,disabled:y,children:y?"Testing…":"Test Newbook Connection"})]}),c.jsx(vs,{}),c.jsx(co,{title:"Workforce Departments"}),c.jsx("p",{style:{fontSize:"0.82rem",color:"var(--text-mid)",marginBottom:"1rem"},children:"Select the department(s) whose shifts should appear in the HK staff rota."}),ae&&c.jsxs("div",{style:{padding:"0.75rem",borderRadius:"8px",background:"#f8fafc",border:"1px solid var(--card-border)",color:"var(--text-mid)",fontSize:"0.85rem",marginBottom:"2rem"},children:["Workforce integration not configured — add the bearer token in ",c.jsx("strong",{children:"Settings → Integrations → Workforce"}),"."]}),!ae&&A&&c.jsx("div",{style:{color:"var(--text-mid)",fontSize:"0.85rem",marginBottom:"2rem"},children:"Loading departments…"}),!ae&&!A&&c.jsxs("div",{style:{marginBottom:"2.5rem"},children:[K&&c.jsx(un,{type:"error",children:K}),Ie&&c.jsx(un,{type:"ok",children:Ie}),W.length===0?c.jsx("div",{style:{color:"var(--text-mid)",fontSize:"0.85rem",marginBottom:"1rem"},children:"No departments found for this location."}):c.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.4rem",marginBottom:"1rem"},children:W.map(I=>c.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"0.625rem",padding:"0.5rem 0.75rem",border:"1px solid var(--card-border)",borderRadius:"7px",background:N.includes(I.id)?"rgba(42,100,72,0.05)":"var(--card-bg)",cursor:"pointer",fontSize:"0.9rem",color:"var(--text-dark)"},children:[c.jsx("input",{type:"checkbox",checked:N.includes(I.id),onChange:()=>Pn(I.id)}),I.name]},I.id))}),N.length===0&&W.length>0&&c.jsx("div",{style:{marginBottom:"0.75rem",fontSize:"0.8rem",color:"#b45309"},children:"Select at least one department to enable Workforce sync."}),c.jsx(Kr,{onClick:Nt,disabled:xe,primary:!0,children:xe?"Saving…":"Save Departments"})]}),c.jsx(vs,{}),c.jsx(co,{title:"Recurring General Tasks"}),c.jsx("p",{style:{fontSize:"0.82rem",color:"var(--text-mid)",marginBottom:"1rem"},children:"Tasks that recur every week. Enter minutes per day. These add to the total required hours every week."}),U&&c.jsx(un,{type:"error",children:U}),De&&c.jsx(un,{type:"ok",children:De}),c.jsx("div",{style:{overflowX:"auto",marginBottom:"1rem"},children:c.jsxs("table",{className:"hk-table",style:{minWidth:"560px"},children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{className:"col-label",children:"Task"}),Ic.map(I=>c.jsx("th",{children:I},I)),c.jsx("th",{style:{width:"32px"}})]})}),c.jsxs("tbody",{children:[ze.length===0&&c.jsx("tr",{children:c.jsx("td",{colSpan:9,style:{color:"var(--text-mid)",textAlign:"center",padding:"1rem"},children:"No tasks yet"})}),ze.map((I,b)=>c.jsxs("tr",{children:[c.jsx("td",{style:{padding:"0.3rem 0.5rem"},children:c.jsx("input",{className:"hk-text-input",value:I.name,placeholder:"Task name",onChange:ee=>pn(b,ee.target.value)})}),Ic.map(ee=>c.jsx("td",{style:{padding:"0.3rem 0.4rem"},children:c.jsx("input",{type:"number",className:"hk-num-input",min:0,max:999,value:I.hours[ee]||"",placeholder:"0",onChange:ke=>Tn(b,ee,ke.target.value)})},ee)),c.jsx("td",{children:c.jsx("button",{onClick:()=>re(b),style:{background:"none",border:"none",color:"var(--text-mid)",fontSize:"1rem",padding:"0.2rem 0.4rem"},children:"×"})})]},b))]})]})}),c.jsxs("div",{style:{display:"flex",gap:"0.75rem",flexWrap:"wrap",marginBottom:"2.5rem"},children:[c.jsx(Kr,{onClick:()=>Pe([...ze,{name:"",hours:{}}]),children:"+ Add task"}),c.jsx(Kr,{onClick:me,disabled:Fe,primary:!0,children:Fe?"Saving…":"Save Tasks"})]}),c.jsx(vs,{}),c.jsx(co,{title:"Time Requirements (minutes per room)"}),c.jsx("p",{style:{fontSize:"0.82rem",color:"var(--text-mid)",marginBottom:"1rem"},children:"How many minutes each room type takes depending on guest status."}),le&&c.jsx(un,{type:"error",children:le}),T&&c.jsx(un,{type:"ok",children:T}),c.jsx("div",{style:{overflowX:"auto",marginBottom:"2rem"},children:c.jsxs("table",{className:"hk-table",style:{maxWidth:"500px"},children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{className:"col-label",children:"Category"}),c.jsx("th",{children:"Depart (mins)"}),c.jsx("th",{children:"Stay (mins)"}),c.jsx("th",{children:"Arrive (mins)"})]})}),c.jsx("tbody",{children:i.filter(I=>!I.excluded).map(I=>{const b=B[I.id]||{depart:0,stay:0,arrive:0};return c.jsxs("tr",{children:[c.jsx("td",{className:"col-label",children:I.name}),["depart","stay","arrive"].map(ee=>c.jsx("td",{style:{padding:"0.3rem 0.4rem"},children:c.jsx("input",{type:"number",className:"hk-num-input",min:0,max:999,value:b[ee]||"",placeholder:"0",onChange:ke=>be(I.id,ee,parseInt(ke.target.value,10)||0),onBlur:ke=>be(I.id,ee,parseInt(ke.target.value,10)||0)})},ee))]},I.id)})})]})})]})}function co({title:i}){return c.jsx("h2",{style:{fontSize:"0.95rem",fontWeight:700,color:"var(--text-dark)",marginBottom:"0.25rem"},children:i})}function vs(){return c.jsx("div",{style:{height:"1px",background:"var(--card-border)",margin:"0.5rem 0 2rem"}})}function un({type:i,children:u}){return c.jsx("div",{style:{marginBottom:"0.75rem",padding:"0.75rem",borderRadius:"8px",fontSize:"0.875rem",background:i==="ok"?"#dcfce7":"#fee2e2",color:i==="ok"?"var(--success)":"var(--danger)"},children:u})}function Kr({children:i,onClick:u,disabled:a,primary:d}){return c.jsx("button",{onClick:u,disabled:a,style:{background:d?"var(--hk-green)":"var(--card-bg)",color:d?"#fff":"var(--text-dark)",border:`1px solid ${d?"var(--hk-green)":"var(--card-border)"}`,borderRadius:"6px",padding:"0.5rem 1.25rem",fontSize:"0.875rem",fontWeight:600},children:i})}function cm({user:i}){return c.jsx(Ih,{user:i,children:c.jsxs(Zp,{children:[c.jsx(Yr,{path:"/",element:c.jsx(ps,{to:"/planner",replace:!0})}),c.jsx(Yr,{path:"/planner",element:c.jsx(nm,{})}),c.jsx(Yr,{path:"/settings",element:Zc(i,"settings")?c.jsx(um,{}):c.jsx(ps,{to:"/planner",replace:!0})}),c.jsx(Yr,{path:"*",element:c.jsx(ps,{to:"/planner",replace:!0})})]})})}function dm(){const i=Lh("/hk-planner/health");return c.jsxs(c.Fragment,{children:[c.jsx(oh,{basename:"/hk-planner",children:c.jsx(mh,{children:u=>c.jsx(cm,{user:u})})}),c.jsx(Rh,{visible:i})]})}new URLSearchParams(window.location.search).has("install")&&window.addEventListener("beforeinstallprompt",i=>{i.preventDefault(),i.prompt()},{once:!0});sp.createRoot(document.getElementById("root")).render(c.jsx(C.StrictMode,{children:c.jsx(dm,{})}));